From 52b637386c1d06168ad5ec0583407d6366286f0d Mon Sep 17 00:00:00 2001 From: jviotti Date: Mon, 11 Mar 2024 20:27:53 +0000 Subject: [PATCH] deploy: 51f2bb67bec1a5af4bf9d5a4b6e97be60a5dd7c0 --- apple-touch-icon.png | Bin 6571 -> 6571 bytes icon-180x180.png | Bin 6571 -> 6571 bytes icon-192x192.png | Bin 6932 -> 6932 bytes icon-32x32.png | Bin 923 -> 923 bytes icon-512x512.png | Bin 25094 -> 25094 bytes main.js | 2 +- 6 files changed, 1 insertion(+), 1 deletion(-) diff --git a/apple-touch-icon.png b/apple-touch-icon.png index bfcecda7b39db8f8d6f4920d66d006a59979e11e..3e68bed87589ac261eda27a00e8e5bb0ab0a8fe3 100644 GIT binary patch delta 55 zcmZ2&yxMp|1)H>q>G@x>8|w~B@R?hg8fhCCSQ!|^u>@S4>@TT|B%~ktB6o6wq&5Km CrV%Ot delta 55 zcmZ2&yxMp|1)Bt~<8#Gp8|w~B@R?W{8fzOESQ!{h=X*D2vcIGq>G@x>8|w~B@R?hg8fhCCSQ!|^u>@S4>@TT|B%~ktB6o6wq&5Km CrV%Ot delta 55 zcmZ2&yxMp|1)Bt~<8#Gp8|w~B@R?W{8fzOESQ!{h=X*D2vcIGq>G@x>8|!qW_{^q>G@x>8|yYR@tIqh8fhCCSQ!|^u>@S4Y|pHWB%~ktB6o5Dvo-+T CN)SK* delta 55 zcmbQuKAU|)1)Bt~<8#Gp8|yYR@tIf|8fzOESQ!{h=X*D2vOTjhlF+l@Fonql%-R6v CmJo~p diff --git a/icon-512x512.png b/icon-512x512.png index 81bca51f5f6d1c89ce699f427f104d46d8fecdc2..77449ac402ece2b517b8fc769d99b57830bbca49 100644 GIT binary patch delta 57 zcmZoW!q|3%aY6-~w2A5YU$PtP2#RsEj0}ANeA8^6f-z E05KpE?f?J) delta 57 zcmZoW!q|3%aY6-~1h3{var e={9960:(e,t,n)=>{const r=["draft3","draft4","draft6","draft7","2019-09","2020-12"],i=r.flatMap(((e,t)=>{const i=[n(6085)(`./jsonschema-${e}-to-${e}.json`)];return t+1[e,2*t])));t.builtin=(e,t)=>{if(!o.has(e))throw new Error(`Invalid "from": ${e}`);if(!o.has(t))throw new Error(`Invalid "to": ${t}`);const n=o.get(e),r=o.get(t);return i.slice(n,r+1)},t.drafts=r},8770:(e,t,n)=>{const r=n(6486),i=n(1471),o=n(705),s=n(1178),a=n(3552),l=n(9960);async function c(e,t,n,a,l,h){const u=0===t.length?e:r.get(e,t);for(const f of n)if(await s.matches(f.condition,u)&&s.usesVocabulary(e,u,f.vocabulary)){const d=i(f.transform,{schema:u,original:l,jsonHash:e=>o.sha1(e),hasContext:(t,n)=>{for(const i of a){const o=i.path.concat(t);if(void 0===n&&r.has(e,o))return!0;if(r.isEqual(r.get(e,o),n))return!0;if(r.has(e,i.path.concat(s.getIdProperty(h))))return!1}return!1},omit:(e,t)=>r.omit(e,r.castArray(t)),replace:(e,t,n)=>e.replace(new RegExp(t,"g"),n)});if(await s.matches(f.condition,d))throw new Error("Rule condition must not match after transform");return c(0===t.length?d:r.set(e,t,d),t,n,a,l,h)}return u}e.exports=async(e,t,n)=>{let i=r.cloneDeep(e);for(const o of l.builtin(t,n)){const n=a(o.walker,i,[]).sort(((e,t)=>t.path.length-e.path.length));for(const s of n){if(s.path.length>0&&!r.has(i,s.path))continue;const a=await c(i,s.path,o.rules,n,e,t);0===s.path.length?i=a:r.set(i,s.path,a)}}return i}},1178:(e,t,n)=>{const r=n(5105),i=n(4226);r.setMetaOutputFormat(r.FLAG),t.implementation=r,t.usesVocabulary=(e,t,n)=>"object"==typeof t&&!Array.isArray(t)&&null!==t,t.getIdProperty=e=>["draft3","draft4"].includes(e)?"id":"$id",t.matches=async(e,n)=>{const o=t.getIdProperty(i[e.$schema]);return r.add(e),(await r.validate(r.get(e[o]),n)).valid}},3552:(e,t,n)=>{const r=n(6486),i=n(1178);e.exports=(t,o,s)=>{const a=0===s.length?o:r.get(o,s);return r.reduce(n(6218)(`./${t}.json`),((t,n,l)=>{if(void 0===a[l]||!i.usesVocabulary(o,a,n.vocabulary))return t;for(const i of r.castArray(n.type))if("array"===i&&Array.isArray(a[l]))for(const[r,i]of a[l].entries())t.push(...e.exports(n.walker,o,s.concat([l,r])));else if("object"===i&&r.isPlainObject(a[l]))for(const r of Object.keys(a[l]))t.push(...e.exports(n.walker,o,s.concat([l,r])));else"value"!==i||Array.isArray(a[l])||"string"==typeof a[l]||t.push(...e.exports(n.walker,o,s.concat([l])));return t}),[{type:t,path:s}])}},5242:(e,t,n)=>{const r=n(3565),i=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(u)},o=(e,t,n,r)=>{if(0===e.length)return n;if(e.length>1){const i=e.shift();return{...t,[i]:o(e,d(t,i,r),n,c(i,r))}}if(Array.isArray(t)){const r=[...t];return r[f(t,e[0])]=n,r}return"object"==typeof t&&null!==t?{...t,[e[0]]:n}:d(t,e[0],r)},s=(e,t,n,r)=>{if(0!==e.length)if(1!==e.length||p(t)){const i=e.shift();s(e,d(t,i,r),n,c(i,r))}else t[f(t,e[0])]=n},a=(e,t,n)=>{if(0!=e.length){if(e.length>1){const r=e.shift(),i=d(t,r,n);return{...t,[r]:a(e,i,c(r,n))}}if(Array.isArray(t))return t.filter(((t,n)=>n!=e[0]));if("object"==typeof t&&null!==t){const{[e[0]]:n,...r}=t;return r}return d(t,e[0],n)}},l=(e,t,n)=>{if(0!==e.length)if(e.length>1){const r=e.shift(),i=d(t,r,n);l(e,i,c(r,n))}else Array.isArray(t)?t.splice(e[0],1):"object"==typeof t&&null!==t?delete t[e[0]]:d(t,e[0],n)},c=r(((e,t)=>t+"/"+h(e))),h=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),u=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),f=(e,t)=>Array.isArray(e)&&"-"===t?e.length:t,d=(e,t,n="")=>{if(void 0===e)throw TypeError(`Value at '${n}' is undefined and does not have property '${t}'`);if(null===e)throw TypeError(`Value at '${n}' is null and does not have property '${t}'`);if(p(e))throw TypeError(`Value at '${n}' is a ${typeof e} and does not have property '${t}'`);return e[f(e,t)]},p=e=>null===e||"object"!=typeof e;e.exports={nil:"",append:c,get:(e,t=undefined)=>{const n=i(e),r=e=>n.reduce((([e,t],n)=>[d(e,n,t),c(n,t)]),[e,""])[0];return void 0===t?r:r(t)},set:(e,t=undefined,n=undefined)=>{const s=i(e),a=r(((e,t)=>o(s,e,t,"")));return void 0===t?a:a(t,n)},assign:(e,t=undefined,n=undefined)=>{const o=i(e),a=r(((e,t)=>s(o,e,t,"")));return void 0===t?a:a(t,n)},unset:(e,t=undefined)=>{const n=i(e),r=e=>a(n,e,"");return void 0===t?r:r(t)},remove:(e,t=undefined)=>{const n=i(e),r=e=>l(n,e,"");return void 0===t?r:r(t)}}},9078:(e,t,n)=>{const r=n(540),i={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};e.exports={jsonTypeOf:(e,t)=>i[t](e),resolveUrl:(e,t)=>{const n=r.resolve(e,t,{iri:!0});if(r.resolve(e,"",{iri:!0})&&"file"===r.parse(n).scheme&&"file"!==r.parse(e).scheme)throw Error(`Can't access file '${n}' resource from network context '${e}'`);return n},urlFragment:e=>r.unescapeComponent(r.parse(e).fragment)||"",pathRelative:(e,t)=>{if(e===t)return"";let n=1;const r=e.length-1,i=t.length-n,o=ro){if(47===t.charCodeAt(n+a))return t.slice(n+a+1);if(0===a)return t.slice(n+a)}r>o&&(47===e.charCodeAt(a+1)?s=a:0===o&&(s=0));let l="";for(a=s+2;a<=e.length;++a)a!==e.length&&47!==e.charCodeAt(a)||(l+=0===l.length?"..":"/..");return n+=s,l.length>0?`${l}${t.slice(n,t.length)}`:(47===t.charCodeAt(n)&&++n,t.slice(n,t.length))}}},1434:(e,t,n)=>{const r=n(3565),i=n(1798),{resolveUrl:o}=n(9078),s=n(5043),a=n(6544),l=n(2916),c=n(9952),h=n(4536),u="FLAG",f="BASIC",d="DETAILED",p="VERBOSE";let m=d,g=!0;c.addPlugin("application/schema+json",{parse:async(e,t)=>[await e.json(),t.schema||t.profile],matcher:e=>e.endsWith(".schema.json")});const v=async e=>{const t={metaData:{}};return{ast:t,schemaUri:await C(e,t)}},y=r((({ast:e,schemaUri:t},n,r=u)=>{if(![u,f,d,p].includes(r))throw Error(`The '${r}' error format is not supported`);const o=[],s=i.subscribe("result",b(r,o));return E(t,n,e,{}),i.unsubscribe(s),o[0]})),b=(e,t)=>{const n=[];return(r,i)=>{if("result"===r){const{keyword:e,absoluteKeywordLocation:t,instanceLocation:r,valid:o}=i,s={keyword:e,absoluteKeywordLocation:t,instanceLocation:r,valid:o,errors:[]};n.push(s)}else if("result.start"===r)n.push(r);else if("result.end"===r){const r=n.pop();for(;"result.start"!==n[n.length-1];){const t=n.pop(),i=[t];e===f&&(i.push(...t.errors),delete t.errors),(e===p||e!==u&&!t.valid)&&r.errors.unshift(...i)}n[n.length-1]=r,t[0]=r}}},w={},x=e=>w[e]||h,k=e=>e in w,S={},A={},C=async(e,t)=>{if(e=await O(e),!k(`${e.dialectId}#validate`)){const t=await a.get(e.dialectId);(a.getConfig(t.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!t.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(t.vocabulary).forEach((([e,n])=>{if(e in S)Object.entries(S[e]).forEach((([e,n])=>{((e,t)=>{w[e]={collectEvaluatedItems:(e,n,r,i,o)=>t.interpret(e,n,r,i,o)&&new Set,collectEvaluatedProperties:(e,n,r,i,o)=>t.interpret(e,n,r,i,o)&&[],...t}})(`${t.id}#${e}`,n)}));else if(n)throw Error(`Missing required vocabulary: ${e}`)}))}if(g&&!e.validated){if(a.markValidated(e.id),!(e.dialectId in A)){const t=await a.get(e.dialectId),n=await v(t);A[t.id]=y(n)}const t=s.cons(e.schema,e.id),n=A[e.dialectId](t,m);if(!n.valid)throw new l(n)}return e.id in t.metaData||(t.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),x(`${e.dialectId}#validate`).compile(e,t)},O=async e=>a.typeOf(e,"string")?O(await a.get(a.value(e),e)):e,E=(e,t,n,r)=>{const i=j(e,n),s=o(e,"");return x(i).interpret(e,t,n,{...n.metaData[s].dynamicAnchors,...r})},j=(e,t)=>{if(!(e in t))throw Error(`No schema found at ${e}`);return t[e][0]};e.exports={validate:async(e,t=undefined,n=undefined)=>{const r=await v(e),i=(e,t)=>y(r,s.cons(e),t);return void 0===t?i:i(t,n)},compile:v,interpret:y,setMetaOutputFormat:e=>{m=e},setShouldMetaValidate:e=>{g=e},FLAG:u,BASIC:f,DETAILED:d,VERBOSE:p,add:(e,t="",n="")=>{const r=a.add(e,t,n);delete A[r]},getKeyword:x,hasKeyword:k,defineVocabulary:(e,t)=>{S[e]=t},compileSchema:C,interpretSchema:E,collectEvaluatedProperties:(e,t,n,r,i)=>{const o=j(e,n);return x(o).collectEvaluatedProperties(e,t,n,r,i)},collectEvaluatedItems:(e,t,n,r,i)=>{const o=j(e,n);return x(o).collectEvaluatedItems(e,t,n,r,i)},addMediaTypePlugin:c.addPlugin}},2095:e=>{e.exports=fetch},2735:(e,t,n)=>{const r=n(1434),i=n(6544),o=n(5043),s=n(9897),a=n(3812),l=n(2916);e.exports={Core:r,Schema:i,Instance:o,Reference:s,Keywords:a,InvalidSchemaError:l}},5043:(e,t,n)=>{const r=n(5242),i=n(3565),{resolveUrl:o,jsonTypeOf:s}=n(9078),a=n(9897),l=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),c=e=>a.isReference(e.value)?a.value(e.value):e.value,h=i(((e,t)=>s(c(e),t))),u=(e,t)=>Object.freeze({...t,pointer:r.append(e,t.pointer),value:c(t)[e]}),f=i(((e,t)=>c(t).map(((n,r,i,o)=>e(u(r,t),r,i,o))))),d=i(((e,t)=>c(t).forEach(((n,r,i,o)=>e(u(r,t),r,i,o))))),p=i(((e,t)=>c(t).map(((e,n,r,i)=>u(n,t))).filter(((t,n,r,i)=>e(t,n,r,i))))),m=i(((e,t,n)=>c(n).reduce(((t,r,i)=>e(t,u(i,n),i)),t))),g=i(((e,t)=>c(t).every(((n,r,i,o)=>e(u(r,t),r,i,o))))),v=i(((e,t)=>c(t).some(((n,r,i,o)=>e(u(r,t),r,i,o)))));e.exports={nil:l,cons:(e,t="")=>Object.freeze({...l,id:o(t,""),instance:e,value:e}),get:(e,t=l)=>{if(!e.startsWith("#"))throw Error(`No JSON document found at '${e.split("#")[0]}'`);return Object.freeze({...t,pointer:e.substr(1)})},uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:c,has:(e,t)=>e in c(t),typeOf:h,length:e=>c(e).length,step:u,entries:e=>Object.keys(c(e)).map((t=>[t,u(t,e)])),keys:e=>Object.keys(c(e)),map:f,forEach:d,filter:p,reduce:m,every:g,some:v}},2916:e=>{class t extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}e.exports=t},3812:(e,t,n)=>{const r=n(4536),i=n(3867);e.exports={metaData:r,validate:i}},4536:(e,t,n)=>{const r=n(6544);e.exports={compile:e=>r.value(e),interpret:()=>!0}},3867:(e,t,n)=>{const r=n(7833),i=n(1798),o=n(1434),s=n(5043),a=n(6544);e.exports={compile:async(e,t)=>{const n=a.uri(e);if(!(n in t)){t[n]=!1;const i=a.value(e);if(!["object","boolean"].includes(typeof i))throw Error(`No schema found at '${a.uri(e)}'`);t[n]=[`${e.dialectId}#validate`,a.uri(e),"boolean"==typeof i?i:await r.pipeline([a.entries,r.map((([t,n])=>[`${e.dialectId}#${t}`,n])),r.filter((([t])=>t!==`${e.dialectId}#validate`)),r.map((async([n,r])=>{const i=await o.getKeyword(n).compile(r,t,e);return[n,a.uri(r),i]})),r.all],e)]}return n},interpret:(e,t,n,r)=>{const[a,l,c]=n[e];i.publishSync("result.start");const h="boolean"==typeof c?c:c.every((([e,a,l])=>{i.publishSync("result.start");const c=o.getKeyword(e).interpret(l,t,n,r);return i.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:s.uri(t),valid:c,ast:l}),i.publishSync("result.end"),c}));return i.publishSync("result",{keyword:a,absoluteKeywordLocation:l,instanceLocation:s.uri(t),valid:h,ast:e}),i.publishSync("result.end"),h},collectEvaluatedProperties:(e,t,n,r,i=!1)=>{const s=n[e][2];return"boolean"==typeof s?!!s&&[]:s.filter((([e])=>!i||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[i,,s])=>{const a=e&&o.getKeyword(i).collectEvaluatedProperties(s,t,n,r);return!1!==a&&[...e,...a]}),[])},collectEvaluatedItems:(e,t,n,r,i=!1)=>{const s=n[e][2];return"boolean"==typeof s?!!s&&new Set:s.filter((([e])=>!i||!e.endsWith("#unevaluatedItems"))).reduce(((e,[i,,s])=>{const a=!1!==e&&o.getKeyword(i).collectEvaluatedItems(s,t,n,r);return!1!==a&&new Set([...e,...a])}),new Set)}}},9952:(e,t,n)=>{const r=n(7811),i={};e.exports={addPlugin:(e,t)=>{i[e]=t},parse:e=>{const t=r.parse(e.headers.get("content-type"));if(!(t.type in i))throw Error(`${e.url} is not a schema. Found a document with media type: ${t.type}`);return i[t.type].parse(e,t.parameters)},getContentType:e=>{for(const t in i)if(i[t].matcher(e))return t;return"application/octet-stream"}}},9897:e=>{const t=Symbol("$__value"),n=Symbol("$__href");e.exports={cons:(e,r)=>Object.freeze({[n]:e,[t]:r}),isReference:e=>e&&void 0!==e[n],href:e=>e[n],value:e=>e[t]}},6544:(e,t,n)=>{const r=n(3565),i=n(7833),o=n(5242),{jsonTypeOf:s,resolveUrl:a,urlFragment:l,pathRelative:c}=n(9078),h=n(2095),u=n(9897),f=n(9952),d="https://json-schema.org/draft/2019-09/vocab/core",p="https://json-schema.org/draft/2020-12/vocab/core",m={},g={},v=(e,t)=>{const n=g[e];return m[n]?.[t]},y={},b={},w=(e,t="",n="")=>{e=JSON.parse(JSON.stringify(e));const r=a(t,""),i=a(e.$schema||n,"");if(!i)throw Error("Couldn't determine schema dialect");if(delete e.$schema,!(i in g))if(!0===e?.$vocabulary?.[d]&&i===x(e,r,d)[0])g[i]=d;else if(!0===e?.$vocabulary?.[p]&&i===x(e,r,p)[0])g[i]=p;else{const e=y[i];if(!e)throw Error(`Couldn't determine JSON Schema version for dialect: '${i}'`);!0===e.vocabulary[d]?g[i]=d:!0===e.vocabulary[p]?g[i]=p:g[i]=g[e.dialectId]}const[l,c]=x(e,r,g[i]);if(!l)throw Error("Couldn't determine an identifier for the schema");const h=v(i,"baseToken");delete e[h],r&&(b[r]=l);const u=v(i,"anchorToken");c&&h===u&&(e[u]=u!==h?encodeURI(c):`#${encodeURI(c)}`);const f={},m=v(i,"recursiveAnchorToken");let w;!0===e[m]&&(f[""]=`${l}#`,e[u]="",delete e[m]);const S=v(i,"vocabularyToken");s(e[S],"object")?(w=e[S],delete e[S]):w={[g[i]]:!0};const A={"":""};return y[l]={id:l,dialectId:i,schema:k(e,l,i,o.nil,A,f),anchors:A,dynamicAnchors:f,vocabulary:w,validated:!1},l},x=(e,t,n)=>{const r=m[n]?.baseToken,i=a(t,e[r]||"");return[a(i,""),l(i)]},k=(e,t,n,r,i,l)=>{if(s(e,"object")){const s="string"==typeof e.$schema?a(e.$schema,""):n,c=v(s,"embeddedToken"),h=v(s,"anchorToken");if("string"==typeof e[c]&&(c!==h||"#"!==e[c][0])){const r=a(t,e[c]);return e[v(s,"baseToken")]=r,w(e,r,n),u.cons(e[c],e)}const f=v(n,"anchorToken"),d=v(n,"dynamicAnchorToken");"string"==typeof e[d]&&(l[e[d]]=`${t}#${encodeURI(r)}`,i[e[d]]=r,delete e[d]);const p=v(n,"embeddedToken");if("string"==typeof e[f]){const t=f!==p?e[f]:e[f].slice(1);i[t]=r,delete e[f]}const m=v(n,"jrefToken");if("string"==typeof e[m])return u.cons(e[m],e);for(const s in e)e[s]=k(e[s],t,n,o.append(s,r),i,l);return e}return Array.isArray(e)?e.map(((e,s)=>k(e,t,n,o.append(s,r),i,l))):e},S=e=>y[b[e]]||y[e],A=Object.freeze({id:"",dialectId:void 0,vocabulary:{},pointer:o.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),C=async(e,t=A)=>{const n=a(j(t),e),r=a(n,""),i=l(n);if(!(e=>e in y||e in b)(r)){const e=await h(r,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${r}`);const[t,n]=await f.parse(e);let i;i=t.$schema?a(t.$schema,""):n?a(r,n):"",i&&r!==i&&!(i in g)&&await C(i),w(t,r,i)}const s=S(r),c="/"!==i[0]?E(s,i):i,u=Object.freeze({...s,pointer:c,value:o.get(c,s.schema)});return O(u)},O=e=>u.isReference(e.value)?C(u.href(e.value),e):e,E=(e,t)=>{if(!(t in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(t)}'`);return e.anchors[t]},j=e=>`${e.id}#${encodeURI(e.pointer)}`,M=e=>u.isReference(e.value)?u.value(e.value):e.value,I=(e,t)=>{const n=S(t.id),r=Object.freeze({...t,pointer:o.append(e,t.pointer),value:M(t)[e],validated:n.validated});return O(r)},$=r(((e,t)=>i.pipeline([M,i.map((async(n,r)=>e(await I(r,t),r))),i.all],t))),T={parentId:"",parentDialect:"",includeEmbedded:!0};e.exports={setConfig:(e,t,n)=>{g[e]=e,m[e]||(m[e]={}),m[e][t]=n},getConfig:v,add:w,get:C,markValidated:e=>{y[e].validated=!0},uri:j,value:M,getAnchorPointer:E,typeOf:(e,t)=>s(M(e),t),has:(e,t)=>e in M(t),step:I,keys:e=>Object.keys(M(e)),entries:e=>i.pipeline([M,Object.keys,i.map((async t=>[t,await I(t,e)])),i.all],e),map:$,length:e=>M(e).length,toSchema:(e,t={})=>{const n={...T,...t},r=JSON.parse(JSON.stringify(e.schema,((t,r)=>{if(!u.isReference(r))return r;const i=u.value(r),o="string"==typeof i.$schema?a(i.$schema,""):e.dialectId,s=v(o,"embeddedToken");return!n.includeEmbedded&&s in i?void 0:u.value(r)}))),i=v(e.dialectId,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,t])=>{const n=o.append(i,l(t));o.assign(n,r,e)}));const s=v(e.dialectId,"anchorToken");Object.entries(e.anchors).filter((([t])=>""!==t&&!(t in e.dynamicAnchors))).forEach((([e,t])=>{const n=o.append(s,t);o.assign(n,r,e)}));const h=v(e.dialectId,"baseToken"),f=((e,t)=>{if(t.startsWith("file://")){const n=e.slice(7,e.lastIndexOf("/"));return""===e?"":c(n,t.slice(7))}return t})(n.parentId,e.id),d=n.parentDialect===e.dialectId?"":e.dialectId;return{...f&&{[h]:f},...d&&{$schema:d},...r}}}},328:e=>{e.exports={isObject:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,escapeRegExp:e=>e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&"),splitUrl:e=>{const t=e.indexOf("#"),n=-1===t?e.length:t,r=e.slice(0,n),i=e.slice(n+1);return[decodeURI(r),decodeURI(i)]}}},8907:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=n(2077),s=n(89),a="http://json-schema.org/draft-04/schema";i.setConfig(a,"baseToken","id"),i.setConfig(a,"embeddedToken","id"),i.setConfig(a,"anchorToken","id"),i.setConfig(a,"jrefToken","$ref"),i.add(JSON.parse(s)),r.defineVocabulary(a,{validate:o.validate,additionalItems:o.additionalItems,additionalProperties:o.additionalProperties,allOf:o.allOf,anyOf:o.anyOf,default:o.metaData,definitions:o.definitions,dependencies:o.dependencies,description:o.metaData,enum:o.enum,format:o.metaData,items:o.items,maxItems:o.maxItems,maxLength:o.maxLength,maxProperties:o.maxProperties,maximum:o.maximumExclusiveMaximum,minItems:o.minItems,minLength:o.minLength,minProperties:o.minProperties,minimum:o.minimumExclusiveMinimum,multipleOf:o.multipleOf,not:o.not,oneOf:o.oneOf,pattern:o.pattern,patternProperties:o.patternProperties,properties:o.properties,required:o.required,title:o.metaData,type:o.type,uniqueItems:o.uniqueItems})},8822:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=n(2077),s=n(9403),a="http://json-schema.org/draft-06/schema";i.setConfig(a,"baseToken","$id"),i.setConfig(a,"embeddedToken","$id"),i.setConfig(a,"anchorToken","$id"),i.setConfig(a,"jrefToken","$ref"),i.add(JSON.parse(s)),r.defineVocabulary(a,{validate:o.validate,additionalItems:o.additionalItems6,additionalProperties:o.additionalProperties6,allOf:o.allOf,anyOf:o.anyOf,const:o.const,contains:o.contains,default:o.metaData,definitions:o.definitions,dependencies:o.dependencies,description:o.metaData,enum:o.enum,examples:o.metaData,exclusiveMaximum:o.exclusiveMaximum,exclusiveMinimum:o.exclusiveMinimum,format:o.metaData,items:o.items,maxItems:o.maxItems,maxLength:o.maxLength,maxProperties:o.maxProperties,maximum:o.maximum,minItems:o.minItems,minLength:o.minLength,minProperties:o.minProperties,minimum:o.minimum,multipleOf:o.multipleOf,not:o.not,oneOf:o.oneOf,pattern:o.pattern,patternProperties:o.patternProperties,properties:o.properties,propertyNames:o.propertyNames,required:o.required,title:o.metaData,type:o.type,uniqueItems:o.uniqueItems})},5077:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=n(2077),s=n(2613),a="http://json-schema.org/draft-07/schema";i.setConfig(a,"baseToken","$id"),i.setConfig(a,"embeddedToken","$id"),i.setConfig(a,"anchorToken","$id"),i.setConfig(a,"jrefToken","$ref"),i.add(JSON.parse(s)),r.defineVocabulary(a,{validate:o.validate,additionalItems:o.additionalItems6,additionalProperties:o.additionalProperties6,allOf:o.allOf,anyOf:o.anyOf,const:o.const,contains:o.contains,default:o.metaData,definitions:o.definitions,dependencies:o.dependencies,description:o.metaData,enum:o.enum,exclusiveMaximum:o.exclusiveMaximum,exclusiveMinimum:o.exclusiveMinimum,format:o.metaData,if:o.if,then:o.then,else:o.else,items:o.items,maxItems:o.maxItems,maxLength:o.maxLength,maxProperties:o.maxProperties,maximum:o.maximum,minItems:o.minItems,minLength:o.minLength,minProperties:o.minProperties,minimum:o.minimum,multipleOf:o.multipleOf,not:o.not,oneOf:o.oneOf,pattern:o.pattern,patternProperties:o.patternProperties,properties:o.properties,propertyNames:o.propertyNames,readOnly:o.metaData,required:o.required,title:o.metaData,type:o.type,uniqueItems:o.uniqueItems,writeOnly:o.metaData})},7406:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=n(2077),s=n(6998),a=n(2037),l=n(3334),c=n(9447),h=n(3198),u=n(830),f=n(480),d="https://json-schema.org/draft/2019-09/vocab/core";i.setConfig(d,"baseToken","$id"),i.setConfig(d,"embeddedToken","$id"),i.setConfig(d,"anchorToken","$anchor"),i.setConfig(d,"recursiveAnchorToken","$recursiveAnchor"),i.setConfig(d,"vocabularyToken","$vocabulary"),i.setConfig(d,"mandatoryVocabularies",["https://json-schema.org/draft/2019-09/vocab/core"]),i.add(JSON.parse(s)),i.add(JSON.parse(a)),r.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/core",{validate:o.validate,$defs:o.definitions,$recursiveRef:o.dynamicRef,$ref:o.ref}),i.add(JSON.parse(l)),r.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/applicator",{additionalItems:o.additionalItems6,additionalProperties:o.additionalProperties6,allOf:o.allOf,anyOf:o.anyOf,contains:o.containsMinContainsMaxContains,dependentSchemas:o.dependentSchemas,if:o.if,then:o.then,else:o.else,items:o.items,not:o.not,oneOf:o.oneOf,patternProperties:o.patternProperties,properties:o.properties,propertyNames:o.propertyNames,unevaluatedItems:o.unevaluatedItems,unevaluatedProperties:o.unevaluatedProperties}),i.add(JSON.parse(c)),r.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/validation",{const:o.const,dependentRequired:o.dependentRequired,enum:o.enum,exclusiveMaximum:o.exclusiveMaximum,exclusiveMinimum:o.exclusiveMinimum,maxItems:o.maxItems,maxLength:o.maxLength,maxProperties:o.maxProperties,maximum:o.maximum,minItems:o.minItems,minLength:o.minLength,minProperties:o.minProperties,minimum:o.minimum,multipleOf:o.multipleOf,pattern:o.pattern,required:o.required,type:o.type,uniqueItems:o.uniqueItems}),i.add(JSON.parse(h)),r.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/meta-data",{default:o.metaData,deprecated:o.metaData,description:o.metaData,examples:o.metaData,readOnly:o.metaData,title:o.metaData,writeOnly:o.metaData}),i.add(JSON.parse(u)),i.add(JSON.parse(f)),r.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/content",{contentEncoding:o.metaData,contentMediaType:o.metaData,contentSchema:o.metaData})},6291:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=n(2077),s=n(3024),a=n(9824),l=n(9461),c=n(3512),h=n(4929),u=n(8905),f=n(6646),d=n(7525),p=n(8e3),m="https://json-schema.org/draft/2020-12/vocab/core";i.setConfig(m,"baseToken","$id"),i.setConfig(m,"embeddedToken","$id"),i.setConfig(m,"anchorToken","$anchor"),i.setConfig(m,"dynamicAnchorToken","$dynamicAnchor"),i.setConfig(m,"vocabularyToken","$vocabulary"),i.setConfig(m,"mandatoryVocabularies",["https://json-schema.org/draft/2020-12/vocab/core"]),i.add(JSON.parse(s)),i.add(JSON.parse(a)),r.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/core",{validate:o.validate,$defs:o.definitions,$dynamicRef:o.dynamicRef,$ref:o.ref}),i.add(JSON.parse(l)),r.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/applicator",{additionalProperties:o.additionalProperties6,allOf:o.allOf,anyOf:o.anyOf,contains:o.containsMinContainsMaxContains,dependentSchemas:o.dependentSchemas,if:o.if,then:o.then,else:o.else,items:o.items202012,not:o.not,oneOf:o.oneOf,patternProperties:o.patternProperties,prefixItems:o.tupleItems,properties:o.properties,propertyNames:o.propertyNames}),i.add(JSON.parse(c)),r.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/validation",{const:o.const,dependentRequired:o.dependentRequired,enum:o.enum,exclusiveMaximum:o.exclusiveMaximum,exclusiveMinimum:o.exclusiveMinimum,maxItems:o.maxItems,maxLength:o.maxLength,maxProperties:o.maxProperties,maximum:o.maximum,minItems:o.minItems,minLength:o.minLength,minProperties:o.minProperties,minimum:o.minimum,multipleOf:o.multipleOf,pattern:o.pattern,required:o.required,type:o.type,uniqueItems:o.uniqueItems}),i.add(JSON.parse(h)),r.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/meta-data",{default:o.metaData,deprecated:o.metaData,description:o.metaData,examples:o.metaData,readOnly:o.metaData,title:o.metaData,writeOnly:o.metaData}),i.add(JSON.parse(u)),r.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/format-annotation",{format:o.metaData}),i.add(JSON.parse(f)),i.add(JSON.parse(d)),r.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/content",{contentEncoding:o.metaData,contentMediaType:o.metaData,contentSchema:o.metaData}),i.add(JSON.parse(p)),r.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/unevaluated",{unevaluatedItems:o.unevaluatedItems,unevaluatedProperties:o.unevaluatedProperties})},5105:(e,t,n)=>{const{Core:r,Schema:i,InvalidSchemaError:o}=n(2735),s=n(2077);n(8907),n(8822),n(5077),n(7406),n(6291),e.exports={add:r.add,get:i.get,validate:r.validate,compile:r.compile,interpret:r.interpret,setMetaOutputFormat:r.setMetaOutputFormat,setShouldMetaValidate:r.setShouldMetaValidate,addMediaTypePlugin:r.addMediaTypePlugin,FLAG:r.FLAG,BASIC:r.BASIC,DETAILED:r.DETAILED,VERBOSE:r.VERBOSE,Keywords:s,InvalidSchemaError:o}},6414:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735);e.exports={compile:async(e,t,n)=>{const o=await i.step("items",n),s=i.typeOf(o,"array")?i.length(o):Number.MAX_SAFE_INTEGER;return i.typeOf(e,"boolean")?[s,i.value(e)]:[s,await r.compileSchema(e,t)]},interpret:([e,t],n,i,s)=>!o.typeOf(n,"array")||("string"==typeof t?o.every(((n,o)=>or{const{Core:r,Schema:i,Instance:o}=n(2735),s=([e,t],n,i,s)=>!o.typeOf(n,"array")||o.every(((n,o)=>o{const o=await i.step("items",n);return[i.typeOf(o,"array")?i.length(o):Number.MAX_SAFE_INTEGER,await r.compileSchema(e,t)]},interpret:s,collectEvaluatedItems:(e,t,n,r)=>{if(!s(e,t,n,r))return!1;const i=new Set;for(let n=e[0];n{const{Core:r,Schema:i,Instance:o}=n(2735);e.exports={compile:async(e,t,n)=>{const o=await i.step("properties",n),s=i.typeOf(o,"object")?i.keys(o):[],a=await i.step("patternProperties",n),l=i.typeOf(a,"object")?i.keys(a).map((e=>new RegExp(e))):[];return i.typeOf(e,"boolean")?[s,l,i.value(e)]:[s,l,await r.compileSchema(e,t)]},interpret:([e,t,n],i,s,a)=>{if(!o.typeOf(i,"object"))return!0;const l=o.entries(i).filter((([n])=>!e.includes(n)&&!t.some((e=>e.test(n)))));return"string"==typeof n?l.every((([,e])=>r.interpretSchema(n,e,s,a))):0===l.length||n}}},7461:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=([e,t,n],i,s,a)=>!o.typeOf(i,"object")||o.entries(i).filter((([n])=>!e.includes(n)&&!t.some((e=>e.test(n))))).every((([,e])=>r.interpretSchema(n,e,s,a)));e.exports={compile:async(e,t,n)=>{const o=await i.step("properties",n),s=i.typeOf(o,"object")?i.keys(o):[],a=await i.step("patternProperties",n);return[s,i.typeOf(a,"object")?i.keys(a).map((e=>new RegExp(e))):[],await r.compileSchema(e,t)]},interpret:s,collectEvaluatedProperties:(e,t,n,r)=>s(e,t,n,r)&&[new RegExp("")]}},296:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=n(7833);e.exports={compile:(e,t)=>o.pipeline([i.map((async e=>r.compileSchema(await e,t))),o.all],e),interpret:(e,t,n,i)=>e.every((e=>r.interpretSchema(e,t,n,i))),collectEvaluatedProperties:(e,t,n,i)=>e.reduce(((e,o)=>{const s=e&&r.collectEvaluatedProperties(o,t,n,i);return!1!==s&&[...e,...s]}),[]),collectEvaluatedItems:(e,t,n,i)=>e.reduce(((e,o)=>{const s=!1!==e&&r.collectEvaluatedItems(o,t,n,i);return!1!==s&&new Set([...e,...s])}),new Set)}},7803:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=n(7833);e.exports={compile:(e,t)=>o.pipeline([i.map((async e=>r.compileSchema(await e,t))),o.all],e),interpret:(e,t,n,i)=>e.filter((e=>r.interpretSchema(e,t,n,i))).length>0,collectEvaluatedProperties:(e,t,n,i)=>e.reduce(((e,o)=>{const s=r.collectEvaluatedProperties(o,t,n,i);return!1!==s?[...e||[],...s]:e}),!1),collectEvaluatedItems:(e,t,n,i)=>e.reduce(((e,o)=>{const s=r.collectEvaluatedItems(o,t,n,i);return!1!==s?new Set([...e||[],...s]):e}),!1)}},3840:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735),o=n(1049);e.exports={compile:e=>o(r.value(e)),interpret:(e,t)=>o(i.value(t))===e}},2670:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=({contains:e,minContains:t,maxContains:n},i,s,a)=>{if(!o.typeOf(i,"array"))return!0;const l=o.reduce(((t,n)=>r.interpretSchema(e,n,s,a)?t+1:t),0,i);return l>=t&&l<=n};e.exports={compile:async(e,t,n)=>{const o=await r.compileSchema(e,t),s=await i.step("minContains",n),a=i.typeOf(s,"number")?i.value(s):1,l=await i.step("maxContains",n);return{contains:o,minContains:a,maxContains:i.typeOf(l,"number")?i.value(l):Number.MAX_SAFE_INTEGER}},interpret:s,collectEvaluatedItems:(e,t,n,i)=>s(e,t,n,i)&&o.reduce(((t,o,s)=>r.interpretSchema(e.contains,o,n,i)?t.add(s):t),new Set,t)}},7015:(e,t,n)=>{const{Core:r,Instance:i}=n(2735);e.exports={compile:(e,t)=>r.compileSchema(e,t),interpret:(e,t,n,o)=>!i.typeOf(t,"array")||i.some((t=>r.interpretSchema(e,t,n,o)),t)}},2313:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=n(7833);e.exports={compile:async(e,t)=>{await o.pipeline([i.entries,o.map((([,e])=>r.compileSchema(e,t))),o.all],e)},interpret:()=>!0}},357:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=n(7833);e.exports={compile:(e,t)=>s.pipeline([i.entries,s.map((async([e,n])=>[e,i.typeOf(n,"array")?i.value(n):await r.compileSchema(n,t)])),s.all],e),interpret:(e,t,n,i)=>{const s=o.value(t);return!o.typeOf(t,"object")||e.every((([e,o])=>!(e in s)||(Array.isArray(o)?o.every((e=>e in s)):r.interpretSchema(o,t,n,i))))}}},3832:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735),o=n(7833);e.exports={compile:e=>o.pipeline([r.entries,o.map((([e,t])=>[e,r.value(t)])),o.all],e),interpret:(e,t)=>{const n=i.value(t);return!i.typeOf(t,"object")||e.every((([e,t])=>!(e in n)||t.every((e=>e in n))))}}},5064:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=n(7833);e.exports={compile:(e,t)=>s.pipeline([i.entries,s.map((async([e,n])=>[e,await r.compileSchema(n,t)])),s.all],e),interpret:(e,t,n,i)=>{const s=o.value(t);return!o.typeOf(t,"object")||e.every((([e,o])=>!(e in s)||r.interpretSchema(o,t,n,i)))},collectEvaluatedProperties:(e,t,n,i)=>e.reduce(((e,[s,a])=>{if(!e||!o.has(s,t))return e;const l=r.collectEvaluatedProperties(a,t,n,i);return!1!==l&&e.concat(l)}),[])}},2560:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),{splitUrl:o}=n(328),s=r.collectEvaluatedProperties,a=r.collectEvaluatedItems;e.exports={compile:async(e,t)=>{const[,n]=o(i.value(e)),s=await i.get(i.value(e),e);return await r.compileSchema(s,t),[s.id,n,i.uri(s)]},interpret:([e,t,n],i,o,s)=>t in o.metaData[e].dynamicAnchors?r.interpretSchema(s[t],i,o,s):r.interpretSchema(n,i,o,s),collectEvaluatedProperties:s,collectEvaluatedItems:a}},6324:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=(e,t,n,i)=>{const o=n[e][2];return"boolean"==typeof o?o:o.every((([e,,o])=>r.getKeyword(e).interpret(o,t,n,i)))};e.exports={compile:async(e,t,n)=>{if(i.has("if",n)){const o=await i.step("if",n);return[await r.compileSchema(o,t),await r.compileSchema(e,t)]}return[]},interpret:([e,t],n,i,s)=>void 0===e||o(e,n,i,s)||r.interpretSchema(t,n,i,s),collectEvaluatedProperties:([e,t],n,i,s)=>void 0===e||o(e,n,i,s)?[]:r.collectEvaluatedProperties(t,n,i,s),collectEvaluatedItems:([e,t],n,i,s)=>void 0===e||o(e,n,i,s)?new Set:r.collectEvaluatedItems(t,n,i,s)}},6022:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735),o=n(1049);e.exports={compile:e=>r.value(e).map(o),interpret:(e,t)=>e.some((e=>o(i.value(t))===e))}},1633:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:async e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"number")||i.value(t){const{Schema:r,Instance:i}=n(2735);e.exports={compile:async e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"number")||i.value(t)>e}},7770:(e,t,n)=>{const{Core:r}=n(2735);e.exports={compile:(e,t)=>r.compileSchema(e,t),interpret:(e,t,n,i)=>(r.interpretSchema(e,t,n,i),!0),collectEvaluatedProperties:(e,t,n,i)=>r.collectEvaluatedProperties(e,t,n,i)||[],collectEvaluatedItems:(e,t,n,i)=>r.collectEvaluatedItems(e,t,n,i)||new Set}},2077:(e,t,n)=>{const{Keywords:r}=n(2735);e.exports={additionalItems:n(6414),additionalItems6:n(3521),additionalProperties:n(269),additionalProperties6:n(7461),allOf:n(296),anyOf:n(7803),const:n(3840),contains:n(7015),containsMinContainsMaxContains:n(2670),definitions:n(2313),dependencies:n(357),dependentRequired:n(3832),dependentSchemas:n(5064),enum:n(6022),exclusiveMaximum:n(1633),exclusiveMinimum:n(1743),if:n(7770),then:n(318),else:n(6324),items:n(7777),items202012:n(9156),maxItems:n(2367),maxLength:n(6598),maxProperties:n(5075),maximumExclusiveMaximum:n(5792),maximum:n(3692),metaData:r.metaData,minItems:n(6032),minLength:n(9925),minProperties:n(7302),minimumExclusiveMinimum:n(2526),minimum:n(5715),multipleOf:n(8924),not:n(7166),oneOf:n(231),pattern:n(6371),patternProperties:n(1395),properties:n(8231),propertyNames:n(2028),dynamicRef:n(2560),ref:n(3435),required:n(1137),tupleItems:n(3352),type:n(6380),unevaluatedItems:n(7754),unevaluatedProperties:n(9953),uniqueItems:n(7707),validate:r.validate}},7777:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=(e,t,n,i)=>!o.typeOf(t,"array")||("string"==typeof e?o.every((t=>r.interpretSchema(e,t,n,i)),t):o.every(((t,o)=>!(o in e)||r.interpretSchema(e[o],t,n,i)),t));e.exports={compile:async(e,t)=>{if(i.typeOf(e,"array")){const n=await i.map((e=>r.compileSchema(e,t)),e);return Promise.all(n)}return r.compileSchema(e,t)},interpret:s,collectEvaluatedItems:(e,t,n,r)=>s(e,t,n,r)&&("string"==typeof e?new Set(o.map(((e,t)=>t),t)):new Set(e.map(((e,t)=>t))))}},9156:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=([e,t],n,i,s)=>!o.typeOf(n,"array")||o.every(((n,o)=>o{const o=await i.step("prefixItems",n);return[i.typeOf(o,"array")?i.length(o):0,await r.compileSchema(e,t)]},interpret:s,collectEvaluatedItems:(e,t,n,r)=>s(e,t,n,r)&&new Set(o.map(((e,t)=>t),t))}},2367:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"array")||i.length(t)<=e}},6598:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"string")||[...i.value(t)].length<=e}},5075:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"object")||i.keys(t).length<=e}},5792:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:async(e,t,n)=>{const i=await r.step("exclusiveMaximum",n),o=r.value(i);return[r.value(e),o]},interpret:([e,t],n)=>{if(!i.typeOf(n,"number"))return!0;const r=i.value(n);return t?r{const{Schema:r,Instance:i}=n(2735);e.exports={compile:async e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"number")||i.value(t)<=e}},6032:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"array")||i.length(t)>=e}},9925:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"string")||[...i.value(t)].length>=e}},7302:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"object")||i.keys(t).length>=e}},2526:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:async(e,t,n)=>{const i=await r.step("exclusiveMinimum",n),o=r.value(i);return[r.value(e),o]},interpret:([e,t],n)=>{if(!i.typeOf(n,"number"))return!0;const r=i.value(n);return t?r>e:r>=e}}},5715:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:async e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"number")||i.value(t)>=e}},8924:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735),o=(e,t)=>Math.abs(e-t)<1.1920929e-7;e.exports={compile:e=>r.value(e),interpret:(e,t)=>{if(!i.typeOf(t,"number"))return!0;const n=i.value(t)%e;return o(0,n)||o(e,n)}}},7166:(e,t,n)=>{const{Core:r}=n(2735),i=r.compileSchema;e.exports={compile:i,interpret:(e,t,n,i)=>!r.interpretSchema(e,t,n,i)}},231:(e,t,n)=>{const{Core:r,Schema:i}=n(2735);e.exports={compile:async(e,t)=>{const n=await i.map((e=>r.compileSchema(e,t)),e);return Promise.all(n)},interpret:(e,t,n,i)=>{let o=0;for(const s of e)if(r.interpretSchema(s,t,n,i)&&o++,o>1)break;return 1===o},collectEvaluatedProperties:(e,t,n,i)=>{let o=0;return e.reduce(((e,s)=>{if(o>1)return!1;const a=r.collectEvaluatedProperties(s,t,n,i);return a?0==o++&&a:e}),!1)},collectEvaluatedItems:(e,t,n,i)=>{let o=0;return e.reduce(((e,s)=>{if(o>1)return!1;const a=r.collectEvaluatedItems(s,t,n,i);return a?0==o++&&a:e}),!1)}}},6371:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:e=>new RegExp(r.value(e),"u"),interpret:(e,t)=>!i.typeOf(t,"string")||e.test(i.value(t))}},1395:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=n(7833),a=(e,t,n,i)=>!o.typeOf(t,"object")||e.every((([e,s])=>o.entries(t).filter((([t])=>e.test(t))).every((([,e])=>r.interpretSchema(s,e,n,i)))));e.exports={compile:(e,t)=>s.pipeline([i.entries,s.map((async([e,n])=>[new RegExp(e,"u"),await r.compileSchema(n,t)])),s.all],e),interpret:a,collectEvaluatedProperties:(e,t,n,r)=>a(e,t,n,r)&&e.map((([e])=>e))}},8231:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=n(7833),{escapeRegExp:a}=n(328),l=(e,t,n,i)=>!o.typeOf(t,"object")||o.entries(t).filter((([t])=>t in e)).every((([t,o])=>r.interpretSchema(e[t],o,n,i)));e.exports={compile:(e,t)=>s.pipeline([i.entries,s.reduce((async(e,[n,i])=>(e[n]=await r.compileSchema(i,t),e)),Object.create(null))],e),interpret:l,collectEvaluatedProperties:(e,t,n,r)=>l(e,t,n,r)&&Object.keys(e).map((e=>new RegExp(`^${a(e)}$`)))}},2028:(e,t,n)=>{const{Core:r,Instance:i}=n(2735);e.exports={compile:(e,t)=>r.compileSchema(e,t),interpret:(e,t,n,o)=>!i.typeOf(t,"object")||i.keys(t).every((t=>r.interpretSchema(e,i.cons(t),n,o)))}},3435:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=r.interpretSchema,s=r.collectEvaluatedProperties,a=r.collectEvaluatedItems;e.exports={compile:async(e,t)=>{const n=await i.get(i.value(e),e);return r.compileSchema(n,t)},interpret:o,collectEvaluatedProperties:s,collectEvaluatedItems:a}},1137:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"object")||e.every((e=>Object.prototype.hasOwnProperty.call(i.value(t),e)))}},318:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=(e,t,n,i)=>{const o=n[e][2];return"boolean"==typeof o?o:o.every((([e,,o])=>r.getKeyword(e).interpret(o,t,n,i)))};e.exports={compile:async(e,t,n)=>{if(i.has("if",n)){const o=await i.step("if",n);return[await r.compileSchema(o,t),await r.compileSchema(e,t)]}return[]},interpret:([e,t],n,i,s)=>void 0===e||!o(e,n,i,s)||r.interpretSchema(t,n,i,s),collectEvaluatedProperties:([e,t],n,i,s)=>void 0!==e&&o(e,n,i,s)?r.collectEvaluatedProperties(t,n,i,s):[],collectEvaluatedItems:([e,t],n,i,s)=>void 0!==e&&o(e,n,i,s)?r.collectEvaluatedItems(t,n,i,s):new Set}},3352:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=n(7833),a=(e,t,n,i)=>!o.typeOf(t,"array")||o.every(((t,o)=>!(o in e)||r.interpretSchema(e[o],t,n,i)),t);e.exports={compile:(e,t)=>s.pipeline([i.map((e=>r.compileSchema(e,t))),s.all],e),interpret:a,collectEvaluatedItems:(e,t,n,r)=>a(e,t,n,r)&&new Set(e.map(((e,t)=>t)))}},6380:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:e=>r.value(e),interpret:(e,t)=>"string"==typeof e?i.typeOf(t,e):e.some(i.typeOf(t))}},7754:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=([e,t],n,i,s)=>{if(!o.typeOf(n,"array"))return!0;const a=r.collectEvaluatedItems(e,n,i,s,!0);return!1===a||o.every(((e,l)=>a.has(l)||r.interpretSchema(t,o.step(l,n),i,s)),n)};e.exports={compile:async(e,t,n)=>[i.uri(n),await r.compileSchema(e,t)],interpret:s,collectEvaluatedItems:(e,t,n,r)=>s(e,t,n,r)&&new Set(o.map(((e,t)=>t),t))}},9953:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=([e,t],n,i,s)=>{if(!o.typeOf(n,"object"))return!0;const a=r.collectEvaluatedProperties(e,n,i,s,!0);return!a||o.entries(n).filter((([e])=>!a.some((t=>e.match(t))))).every((([,e])=>r.interpretSchema(t,e,i,s)))};e.exports={compile:async(e,t,n)=>[i.uri(n),await r.compileSchema(e,t)],interpret:s,collectEvaluatedProperties:(e,t,n,r)=>s(e,t,n,r)&&[new RegExp("")]}},7707:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735),o=n(1049);e.exports={compile:e=>r.value(e),interpret:(e,t)=>{if(!i.typeOf(t,"array")||!1===e)return!0;const n=i.map((e=>o(i.value(e))),t);return new Set(n).size===n.length}}},89:e=>{e.exports='{\n "id": "http://json-schema.org/draft-04/schema#",\n "$schema": "http://json-schema.org/draft-04/schema#",\n "description": "Core schema meta-schema",\n "definitions": {\n "schemaArray": {\n "type": "array",\n "minItems": 1,\n "items": { "$ref": "#" }\n },\n "positiveInteger": {\n "type": "integer",\n "minimum": 0\n },\n "positiveIntegerDefault0": {\n "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]\n },\n "simpleTypes": {\n "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]\n },\n "stringArray": {\n "type": "array",\n "items": { "type": "string" },\n "minItems": 1,\n "uniqueItems": true\n }\n },\n "type": "object",\n "properties": {\n "id": {\n "type": "string"\n },\n "$schema": {\n "type": "string"\n },\n "title": {\n "type": "string"\n },\n "description": {\n "type": "string"\n },\n "default": {},\n "multipleOf": {\n "type": "number",\n "minimum": 0,\n "exclusiveMinimum": true\n },\n "maximum": {\n "type": "number"\n },\n "exclusiveMaximum": {\n "type": "boolean",\n "default": false\n },\n "minimum": {\n "type": "number"\n },\n "exclusiveMinimum": {\n "type": "boolean",\n "default": false\n },\n "maxLength": { "$ref": "#/definitions/positiveInteger" },\n "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },\n "pattern": {\n "type": "string",\n "format": "regex"\n },\n "additionalItems": {\n "anyOf": [\n { "type": "boolean" },\n { "$ref": "#" }\n ],\n "default": {}\n },\n "items": {\n "anyOf": [\n { "$ref": "#" },\n { "$ref": "#/definitions/schemaArray" }\n ],\n "default": {}\n },\n "maxItems": { "$ref": "#/definitions/positiveInteger" },\n "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },\n "uniqueItems": {\n "type": "boolean",\n "default": false\n },\n "maxProperties": { "$ref": "#/definitions/positiveInteger" },\n "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },\n "required": { "$ref": "#/definitions/stringArray" },\n "additionalProperties": {\n "anyOf": [\n { "type": "boolean" },\n { "$ref": "#" }\n ],\n "default": {}\n },\n "definitions": {\n "type": "object",\n "additionalProperties": { "$ref": "#" },\n "default": {}\n },\n "properties": {\n "type": "object",\n "additionalProperties": { "$ref": "#" },\n "default": {}\n },\n "patternProperties": {\n "type": "object",\n "additionalProperties": { "$ref": "#" },\n "default": {}\n },\n "dependencies": {\n "type": "object",\n "additionalProperties": {\n "anyOf": [\n { "$ref": "#" },\n { "$ref": "#/definitions/stringArray" }\n ]\n }\n },\n "enum": {\n "type": "array",\n "minItems": 1,\n "uniqueItems": true\n },\n "type": {\n "anyOf": [\n { "$ref": "#/definitions/simpleTypes" },\n {\n "type": "array",\n "items": { "$ref": "#/definitions/simpleTypes" },\n "minItems": 1,\n "uniqueItems": true\n }\n ]\n },\n "format": { "type": "string" },\n "allOf": { "$ref": "#/definitions/schemaArray" },\n "anyOf": { "$ref": "#/definitions/schemaArray" },\n "oneOf": { "$ref": "#/definitions/schemaArray" },\n "not": { "$ref": "#" }\n },\n "dependencies": {\n "exclusiveMaximum": [ "maximum" ],\n "exclusiveMinimum": [ "minimum" ]\n },\n "default": {}\n}'},9403:e=>{e.exports='{\n "$schema": "http://json-schema.org/draft-06/schema#",\n "$id": "http://json-schema.org/draft-06/schema#",\n "title": "Core schema meta-schema",\n "definitions": {\n "schemaArray": {\n "type": "array",\n "minItems": 1,\n "items": { "$ref": "#" }\n },\n "nonNegativeInteger": {\n "type": "integer",\n "minimum": 0\n },\n "nonNegativeIntegerDefault0": {\n "allOf": [\n { "$ref": "#/definitions/nonNegativeInteger" },\n { "default": 0 }\n ]\n },\n "simpleTypes": {\n "enum": [\n "array",\n "boolean",\n "integer",\n "null",\n "number",\n "object",\n "string"\n ]\n },\n "stringArray": {\n "type": "array",\n "items": { "type": "string" },\n "uniqueItems": true,\n "default": []\n }\n },\n "type": ["object", "boolean"],\n "properties": {\n "$id": {\n "type": "string",\n "format": "uri-reference"\n },\n "$schema": {\n "type": "string",\n "format": "uri"\n },\n "$ref": {\n "type": "string",\n "format": "uri-reference"\n },\n "title": {\n "type": "string"\n },\n "description": {\n "type": "string"\n },\n "default": {},\n "examples": {\n "type": "array",\n "items": {}\n },\n "multipleOf": {\n "type": "number",\n "exclusiveMinimum": 0\n },\n "maximum": {\n "type": "number"\n },\n "exclusiveMaximum": {\n "type": "number"\n },\n "minimum": {\n "type": "number"\n },\n "exclusiveMinimum": {\n "type": "number"\n },\n "maxLength": { "$ref": "#/definitions/nonNegativeInteger" },\n "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },\n "pattern": {\n "type": "string",\n "format": "regex"\n },\n "additionalItems": { "$ref": "#" },\n "items": {\n "anyOf": [\n { "$ref": "#" },\n { "$ref": "#/definitions/schemaArray" }\n ],\n "default": {}\n },\n "maxItems": { "$ref": "#/definitions/nonNegativeInteger" },\n "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },\n "uniqueItems": {\n "type": "boolean",\n "default": false\n },\n "contains": { "$ref": "#" },\n "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },\n "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },\n "required": { "$ref": "#/definitions/stringArray" },\n "additionalProperties": { "$ref": "#" },\n "definitions": {\n "type": "object",\n "additionalProperties": { "$ref": "#" },\n "default": {}\n },\n "properties": {\n "type": "object",\n "additionalProperties": { "$ref": "#" },\n "default": {}\n },\n "patternProperties": {\n "type": "object",\n "additionalProperties": { "$ref": "#" },\n "default": {}\n },\n "dependencies": {\n "type": "object",\n "additionalProperties": {\n "anyOf": [\n { "$ref": "#" },\n { "$ref": "#/definitions/stringArray" }\n ]\n }\n },\n "propertyNames": { "$ref": "#" },\n "const": {},\n "enum": {\n "type": "array",\n "minItems": 1,\n "uniqueItems": true\n },\n "type": {\n "anyOf": [\n { "$ref": "#/definitions/simpleTypes" },\n {\n "type": "array",\n "items": { "$ref": "#/definitions/simpleTypes" },\n "minItems": 1,\n "uniqueItems": true\n }\n ]\n },\n "format": { "type": "string" },\n "allOf": { "$ref": "#/definitions/schemaArray" },\n "anyOf": { "$ref": "#/definitions/schemaArray" },\n "oneOf": { "$ref": "#/definitions/schemaArray" },\n "not": { "$ref": "#" }\n },\n "default": {}\n}'},2613:e=>{e.exports='{\n "$schema": "http://json-schema.org/draft-07/schema#",\n "$id": "http://json-schema.org/draft-07/schema#",\n "title": "Core schema meta-schema",\n "definitions": {\n "schemaArray": {\n "type": "array",\n "minItems": 1,\n "items": { "$ref": "#" }\n },\n "nonNegativeInteger": {\n "type": "integer",\n "minimum": 0\n },\n "nonNegativeIntegerDefault0": {\n "allOf": [\n { "$ref": "#/definitions/nonNegativeInteger" },\n { "default": 0 }\n ]\n },\n "simpleTypes": {\n "enum": [\n "array",\n "boolean",\n "integer",\n "null",\n "number",\n "object",\n "string"\n ]\n },\n "stringArray": {\n "type": "array",\n "items": { "type": "string" },\n "uniqueItems": true,\n "default": []\n }\n },\n "type": ["object", "boolean"],\n "properties": {\n "$id": {\n "type": "string",\n "format": "uri-reference"\n },\n "$schema": {\n "type": "string",\n "format": "uri"\n },\n "$ref": {\n "type": "string",\n "format": "uri-reference"\n },\n "$comment": {\n "type": "string"\n },\n "title": {\n "type": "string"\n },\n "description": {\n "type": "string"\n },\n "default": true,\n "readOnly": {\n "type": "boolean",\n "default": false\n },\n "writeOnly": {\n "type": "boolean",\n "default": false\n },\n "examples": {\n "type": "array",\n "items": true\n },\n "multipleOf": {\n "type": "number",\n "exclusiveMinimum": 0\n },\n "maximum": {\n "type": "number"\n },\n "exclusiveMaximum": {\n "type": "number"\n },\n "minimum": {\n "type": "number"\n },\n "exclusiveMinimum": {\n "type": "number"\n },\n "maxLength": { "$ref": "#/definitions/nonNegativeInteger" },\n "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },\n "pattern": {\n "type": "string",\n "format": "regex"\n },\n "additionalItems": { "$ref": "#" },\n "items": {\n "anyOf": [\n { "$ref": "#" },\n { "$ref": "#/definitions/schemaArray" }\n ],\n "default": true\n },\n "maxItems": { "$ref": "#/definitions/nonNegativeInteger" },\n "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },\n "uniqueItems": {\n "type": "boolean",\n "default": false\n },\n "contains": { "$ref": "#" },\n "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },\n "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },\n "required": { "$ref": "#/definitions/stringArray" },\n "additionalProperties": { "$ref": "#" },\n "definitions": {\n "type": "object",\n "additionalProperties": { "$ref": "#" },\n "default": {}\n },\n "properties": {\n "type": "object",\n "additionalProperties": { "$ref": "#" },\n "default": {}\n },\n "patternProperties": {\n "type": "object",\n "additionalProperties": { "$ref": "#" },\n "propertyNames": { "format": "regex" },\n "default": {}\n },\n "dependencies": {\n "type": "object",\n "additionalProperties": {\n "anyOf": [\n { "$ref": "#" },\n { "$ref": "#/definitions/stringArray" }\n ]\n }\n },\n "propertyNames": { "$ref": "#" },\n "const": true,\n "enum": {\n "type": "array",\n "items": true,\n "minItems": 1,\n "uniqueItems": true\n },\n "type": {\n "anyOf": [\n { "$ref": "#/definitions/simpleTypes" },\n {\n "type": "array",\n "items": { "$ref": "#/definitions/simpleTypes" },\n "minItems": 1,\n "uniqueItems": true\n }\n ]\n },\n "format": { "type": "string" },\n "contentMediaType": { "type": "string" },\n "contentEncoding": { "type": "string" },\n "if": { "$ref": "#" },\n "then": { "$ref": "#" },\n "else": { "$ref": "#" },\n "allOf": { "$ref": "#/definitions/schemaArray" },\n "anyOf": { "$ref": "#/definitions/schemaArray" },\n "oneOf": { "$ref": "#/definitions/schemaArray" },\n "not": { "$ref": "#" }\n },\n "default": true\n}'},3334:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2019-09/meta/applicator",\n "$schema": "https://json-schema.org/draft/2019-09/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2019-09/vocab/applicator": true\n },\n "$recursiveAnchor": true,\n\n "title": "Applicator vocabulary meta-schema",\n "properties": {\n "additionalItems": { "$recursiveRef": "#" },\n "unevaluatedItems": { "$recursiveRef": "#" },\n "items": {\n "anyOf": [\n { "$recursiveRef": "#" },\n { "$ref": "#/$defs/schemaArray" }\n ]\n },\n "contains": { "$recursiveRef": "#" },\n "additionalProperties": { "$recursiveRef": "#" },\n "unevaluatedProperties": { "$recursiveRef": "#" },\n "properties": {\n "type": "object",\n "additionalProperties": { "$recursiveRef": "#" },\n "default": {}\n },\n "patternProperties": {\n "type": "object",\n "additionalProperties": { "$recursiveRef": "#" },\n "propertyNames": { "format": "regex" },\n "default": {}\n },\n "dependentSchemas": {\n "type": "object",\n "additionalProperties": {\n "$recursiveRef": "#"\n }\n },\n "propertyNames": { "$recursiveRef": "#" },\n "if": { "$recursiveRef": "#" },\n "then": { "$recursiveRef": "#" },\n "else": { "$recursiveRef": "#" },\n "allOf": { "$ref": "#/$defs/schemaArray" },\n "anyOf": { "$ref": "#/$defs/schemaArray" },\n "oneOf": { "$ref": "#/$defs/schemaArray" },\n "not": { "$recursiveRef": "#" }\n },\n "$defs": {\n "schemaArray": {\n "type": "array",\n "minItems": 1,\n "items": { "$recursiveRef": "#" }\n }\n }\n}'},480:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2019-09/meta/content",\n "$schema": "https://json-schema.org/draft/2019-09/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2019-09/vocab/content": true\n },\n "$recursiveAnchor": true,\n\n "title": "Content vocabulary meta-schema",\n\n "type": ["object", "boolean"],\n "properties": {\n "contentMediaType": { "type": "string" },\n "contentEncoding": { "type": "string" },\n "contentSchema": { "$recursiveRef": "#" }\n }\n}'},2037:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2019-09/meta/core",\n "$schema": "https://json-schema.org/draft/2019-09/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2019-09/vocab/core": true\n },\n "$recursiveAnchor": true,\n\n "title": "Core vocabulary meta-schema",\n "type": ["object", "boolean"],\n "properties": {\n "$id": {\n "type": "string",\n "format": "uri-reference",\n "$comment": "Non-empty fragments not allowed.",\n "pattern": "^[^#]*#?$"\n },\n "$schema": {\n "type": "string",\n "format": "uri"\n },\n "$anchor": {\n "type": "string",\n "pattern": "^[A-Za-z][-A-Za-z0-9.:_]*$"\n },\n "$ref": {\n "type": "string",\n "format": "uri-reference"\n },\n "$recursiveRef": {\n "type": "string",\n "format": "uri-reference"\n },\n "$recursiveAnchor": {\n "type": "boolean",\n "default": false\n },\n "$vocabulary": {\n "type": "object",\n "propertyNames": {\n "type": "string",\n "format": "uri"\n },\n "additionalProperties": {\n "type": "boolean"\n }\n },\n "$comment": {\n "type": "string"\n },\n "$defs": {\n "type": "object",\n "additionalProperties": { "$recursiveRef": "#" },\n "default": {}\n }\n }\n}'},830:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2019-09/meta/format",\n "$schema": "https://json-schema.org/draft/2019-09/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2019-09/vocab/format": true\n },\n "$recursiveAnchor": true,\n\n "title": "Format vocabulary meta-schema",\n "type": ["object", "boolean"],\n "properties": {\n "format": { "type": "string" }\n }\n}'},3198:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2019-09/meta/meta-data",\n "$schema": "https://json-schema.org/draft/2019-09/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2019-09/vocab/meta-data": true\n },\n "$recursiveAnchor": true,\n\n "title": "Meta-data vocabulary meta-schema",\n\n "type": ["object", "boolean"],\n "properties": {\n "title": {\n "type": "string"\n },\n "description": {\n "type": "string"\n },\n "default": true,\n "deprecated": {\n "type": "boolean",\n "default": false\n },\n "readOnly": {\n "type": "boolean",\n "default": false\n },\n "writeOnly": {\n "type": "boolean",\n "default": false\n },\n "examples": {\n "type": "array",\n "items": true\n }\n }\n}'},9447:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2019-09/meta/validation",\n "$schema": "https://json-schema.org/draft/2019-09/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2019-09/vocab/validation": true\n },\n "$recursiveAnchor": true,\n\n "title": "Validation vocabulary meta-schema",\n "type": ["object", "boolean"],\n "properties": {\n "multipleOf": {\n "type": "number",\n "exclusiveMinimum": 0\n },\n "maximum": {\n "type": "number"\n },\n "exclusiveMaximum": {\n "type": "number"\n },\n "minimum": {\n "type": "number"\n },\n "exclusiveMinimum": {\n "type": "number"\n },\n "maxLength": { "$ref": "#/$defs/nonNegativeInteger" },\n "minLength": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },\n "pattern": {\n "type": "string",\n "format": "regex"\n },\n "maxItems": { "$ref": "#/$defs/nonNegativeInteger" },\n "minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },\n "uniqueItems": {\n "type": "boolean",\n "default": false\n },\n "maxContains": { "$ref": "#/$defs/nonNegativeInteger" },\n "minContains": {\n "$ref": "#/$defs/nonNegativeInteger",\n "default": 1\n },\n "maxProperties": { "$ref": "#/$defs/nonNegativeInteger" },\n "minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },\n "required": { "$ref": "#/$defs/stringArray" },\n "dependentRequired": {\n "type": "object",\n "additionalProperties": {\n "$ref": "#/$defs/stringArray"\n }\n },\n "const": true,\n "enum": {\n "type": "array",\n "items": true\n },\n "type": {\n "anyOf": [\n { "$ref": "#/$defs/simpleTypes" },\n {\n "type": "array",\n "items": { "$ref": "#/$defs/simpleTypes" },\n "minItems": 1,\n "uniqueItems": true\n }\n ]\n }\n },\n "$defs": {\n "nonNegativeInteger": {\n "type": "integer",\n "minimum": 0\n },\n "nonNegativeIntegerDefault0": {\n "$ref": "#/$defs/nonNegativeInteger",\n "default": 0\n },\n "simpleTypes": {\n "enum": [\n "array",\n "boolean",\n "integer",\n "null",\n "number",\n "object",\n "string"\n ]\n },\n "stringArray": {\n "type": "array",\n "items": { "type": "string" },\n "uniqueItems": true,\n "default": []\n }\n }\n}'},6998:e=>{e.exports='{\n "$schema": "https://json-schema.org/draft/2019-09/schema",\n "$id": "https://json-schema.org/draft/2019-09/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2019-09/vocab/core": true,\n "https://json-schema.org/draft/2019-09/vocab/applicator": true,\n "https://json-schema.org/draft/2019-09/vocab/validation": true,\n "https://json-schema.org/draft/2019-09/vocab/meta-data": true,\n "https://json-schema.org/draft/2019-09/vocab/format": false,\n "https://json-schema.org/draft/2019-09/vocab/content": true\n },\n "$recursiveAnchor": true,\n\n "title": "Core and Validation specifications meta-schema",\n "allOf": [\n {"$ref": "meta/core"},\n {"$ref": "meta/applicator"},\n {"$ref": "meta/validation"},\n {"$ref": "meta/meta-data"},\n {"$ref": "meta/format"},\n {"$ref": "meta/content"}\n ],\n "type": ["object", "boolean"],\n "properties": {\n "definitions": {\n "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",\n "type": "object",\n "additionalProperties": { "$recursiveRef": "#" },\n "default": {}\n },\n "dependencies": {\n "$comment": "\\"dependencies\\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \\"dependentSchemas\\" and \\"dependentRequired\\"",\n "type": "object",\n "additionalProperties": {\n "anyOf": [\n { "$recursiveRef": "#" },\n { "$ref": "meta/validation#/$defs/stringArray" }\n ]\n }\n }\n }\n}'},9461:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2020-12/meta/applicator",\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2020-12/vocab/applicator": true\n },\n "$dynamicAnchor": "meta",\n\n "title": "Applicator vocabulary meta-schema",\n "type": ["object", "boolean"],\n "properties": {\n "prefixItems": { "$ref": "#/$defs/schemaArray" },\n "items": { "$dynamicRef": "#meta" },\n "contains": { "$dynamicRef": "#meta" },\n "additionalProperties": { "$dynamicRef": "#meta" },\n "properties": {\n "type": "object",\n "additionalProperties": { "$dynamicRef": "#meta" },\n "default": {}\n },\n "patternProperties": {\n "type": "object",\n "additionalProperties": { "$dynamicRef": "#meta" },\n "propertyNames": { "format": "regex" },\n "default": {}\n },\n "dependentSchemas": {\n "type": "object",\n "additionalProperties": {\n "$dynamicRef": "#meta"\n }\n },\n "propertyNames": { "$dynamicRef": "#meta" },\n "if": { "$dynamicRef": "#meta" },\n "then": { "$dynamicRef": "#meta" },\n "else": { "$dynamicRef": "#meta" },\n "allOf": { "$ref": "#/$defs/schemaArray" },\n "anyOf": { "$ref": "#/$defs/schemaArray" },\n "oneOf": { "$ref": "#/$defs/schemaArray" },\n "not": { "$dynamicRef": "#meta" }\n },\n "$defs": {\n "schemaArray": {\n "type": "array",\n "minItems": 1,\n "items": { "$dynamicRef": "#meta" }\n }\n }\n}'},7525:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2020-12/meta/content",\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2020-12/vocab/content": true\n },\n "$dynamicAnchor": "meta",\n\n "title": "Content vocabulary meta-schema",\n\n "type": ["object", "boolean"],\n "properties": {\n "contentMediaType": { "type": "string" },\n "contentEncoding": { "type": "string" },\n "contentSchema": { "$dynamicRef": "#meta" }\n }\n}'},9824:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2020-12/meta/core",\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2020-12/vocab/core": true\n },\n "$dynamicAnchor": "meta",\n\n "title": "Core vocabulary meta-schema",\n "type": ["object", "boolean"],\n "properties": {\n "$id": {\n "type": "string",\n "format": "uri-reference",\n "$comment": "Non-empty fragments not allowed.",\n "pattern": "^[^#]*#?$"\n },\n "$schema": {\n "type": "string",\n "format": "uri"\n },\n "$anchor": {\n "type": "string",\n "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$"\n },\n "$ref": {\n "type": "string",\n "format": "uri-reference"\n },\n "$dynamicRef": {\n "type": "string",\n "format": "uri-reference"\n },\n "$dynamicAnchor": {\n "type": "string",\n "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$"\n },\n "$vocabulary": {\n "type": "object",\n "propertyNames": {\n "type": "string",\n "format": "uri"\n },\n "additionalProperties": {\n "type": "boolean"\n }\n },\n "$comment": {\n "type": "string"\n },\n "$defs": {\n "type": "object",\n "additionalProperties": { "$dynamicRef": "#meta" },\n "default": {}\n }\n }\n}'},8905:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2020-12/meta/format-annotation",\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2020-12/vocab/format-annotation": true\n },\n "$dynamicAnchor": "meta",\n\n "title": "Format vocabulary meta-schema for annotation results",\n "type": ["object", "boolean"],\n "properties": {\n "format": { "type": "string" }\n }\n}'},6646:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2020-12/meta/format-assertion",\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2020-12/vocab/format-assertion": true\n },\n "$dynamicAnchor": "meta",\n\n "title": "Format vocabulary meta-schema for assertion results",\n "type": ["object", "boolean"],\n "properties": {\n "format": { "type": "string" }\n }\n}'},4929:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2020-12/meta/meta-data",\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2020-12/vocab/meta-data": true\n },\n "$dynamicAnchor": "meta",\n\n "title": "Meta-data vocabulary meta-schema",\n\n "type": ["object", "boolean"],\n "properties": {\n "title": {\n "type": "string"\n },\n "description": {\n "type": "string"\n },\n "default": true,\n "deprecated": {\n "type": "boolean",\n "default": false\n },\n "readOnly": {\n "type": "boolean",\n "default": false\n },\n "writeOnly": {\n "type": "boolean",\n "default": false\n },\n "examples": {\n "type": "array",\n "items": true\n }\n }\n}'},8e3:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2020-12/meta/unevaluated",\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2020-12/vocab/unevaluated": true\n },\n "$dynamicAnchor": "meta",\n\n "title": "Unevaluated applicator vocabulary meta-schema",\n "type": ["object", "boolean"],\n "properties": {\n "unevaluatedItems": { "$dynamicRef": "#meta" },\n "unevaluatedProperties": { "$dynamicRef": "#meta" }\n }\n}'},3512:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2020-12/meta/validation",\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2020-12/vocab/validation": true\n },\n "$dynamicAnchor": "meta",\n\n "title": "Validation vocabulary meta-schema",\n "type": ["object", "boolean"],\n "properties": {\n "multipleOf": {\n "type": "number",\n "exclusiveMinimum": 0\n },\n "maximum": {\n "type": "number"\n },\n "exclusiveMaximum": {\n "type": "number"\n },\n "minimum": {\n "type": "number"\n },\n "exclusiveMinimum": {\n "type": "number"\n },\n "maxLength": { "$ref": "#/$defs/nonNegativeInteger" },\n "minLength": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },\n "pattern": {\n "type": "string",\n "format": "regex"\n },\n "maxItems": { "$ref": "#/$defs/nonNegativeInteger" },\n "minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },\n "uniqueItems": {\n "type": "boolean",\n "default": false\n },\n "maxContains": { "$ref": "#/$defs/nonNegativeInteger" },\n "minContains": {\n "$ref": "#/$defs/nonNegativeInteger",\n "default": 1\n },\n "maxProperties": { "$ref": "#/$defs/nonNegativeInteger" },\n "minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },\n "required": { "$ref": "#/$defs/stringArray" },\n "dependentRequired": {\n "type": "object",\n "additionalProperties": {\n "$ref": "#/$defs/stringArray"\n }\n },\n "const": true,\n "enum": {\n "type": "array",\n "items": true\n },\n "type": {\n "anyOf": [\n { "$ref": "#/$defs/simpleTypes" },\n {\n "type": "array",\n "items": { "$ref": "#/$defs/simpleTypes" },\n "minItems": 1,\n "uniqueItems": true\n }\n ]\n }\n },\n "$defs": {\n "nonNegativeInteger": {\n "type": "integer",\n "minimum": 0\n },\n "nonNegativeIntegerDefault0": {\n "$ref": "#/$defs/nonNegativeInteger",\n "default": 0\n },\n "simpleTypes": {\n "enum": [\n "array",\n "boolean",\n "integer",\n "null",\n "number",\n "object",\n "string"\n ]\n },\n "stringArray": {\n "type": "array",\n "items": { "type": "string" },\n "uniqueItems": true,\n "default": []\n }\n }\n}'},3024:e=>{e.exports='{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://json-schema.org/draft/2020-12/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2020-12/vocab/core": true,\n "https://json-schema.org/draft/2020-12/vocab/applicator": true,\n "https://json-schema.org/draft/2020-12/vocab/unevaluated": true,\n "https://json-schema.org/draft/2020-12/vocab/validation": true,\n "https://json-schema.org/draft/2020-12/vocab/meta-data": true,\n "https://json-schema.org/draft/2020-12/vocab/format-annotation": true,\n "https://json-schema.org/draft/2020-12/vocab/content": true\n },\n "$dynamicAnchor": "meta",\n\n "title": "Core and Validation specifications meta-schema",\n "allOf": [\n {"$ref": "meta/core"},\n {"$ref": "meta/applicator"},\n {"$ref": "meta/unevaluated"},\n {"$ref": "meta/validation"},\n {"$ref": "meta/meta-data"},\n {"$ref": "meta/format-annotation"},\n {"$ref": "meta/content"}\n ],\n "type": ["object", "boolean"],\n "properties": {\n "definitions": {\n "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",\n "type": "object",\n "additionalProperties": { "$dynamicRef": "#meta" },\n "default": {}\n },\n "dependencies": {\n "$comment": "\\"dependencies\\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \\"dependentSchemas\\" and \\"dependentRequired\\"",\n "type": "object",\n "additionalProperties": {\n "anyOf": [\n { "$dynamicRef": "#meta" },\n { "$ref": "meta/validation#/$defs/stringArray" }\n ]\n }\n }\n }\n}'},7622:e=>{e.exports=e=>Promise.all(e)},1821:(e,t,n)=>{const r=n(8912),i=n(7453),o=n(8162);e.exports=e=>r([i,o((async(e,[t,n])=>(e[t]=await n,e)),{})],e)},7453:e=>{e.exports=async e=>Object.entries(await e)},9112:(e,t,n)=>{const r=n(3565),i=n(2169);e.exports=r((async(e,t)=>{const n=await i(e,t);return(await Promise.all(n)).every((e=>e))}))},7121:(e,t,n)=>{const r=n(3565),i=n(8162);e.exports=r((async(e,t,n={})=>i((async(t,n)=>await e(n)?t.concat([n]):t),[],t,n)))},7833:(e,t,n)=>{e.exports={entries:n(7453),map:n(2169),filter:n(7121),reduce:n(8162),some:n(5292),every:n(9112),pipeline:n(8912),all:n(7622),allValues:n(1821)}},2169:(e,t,n)=>{const r=n(3565);e.exports=r((async(e,t)=>(await t).map(e)))},8912:(e,t,n)=>{const r=n(3565);e.exports=r(((e,t)=>e.reduce((async(e,t)=>t(await e)),t)))},8162:(e,t,n)=>{const r=n(3565);e.exports=r((async(e,t,n)=>(await n).reduce((async(t,n)=>e(await t,n)),t)))},5292:(e,t,n)=>{const r=n(3565),i=n(2169);e.exports=r((async(e,t)=>{const n=await i(e,t);return(await Promise.all(n)).some((e=>e))}))},7811:(e,t)=>{"use strict";var n=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,i=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,o=/\\([\u000b\u0020-\u00ff])/g,s=/([\\"])/g,a=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function l(e){var t=String(e);if(i.test(t))return t;if(t.length>0&&!r.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(s,"\\$1")+'"'}function c(e){this.parameters=Object.create(null),this.type=e}t.format=function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var t=e.parameters,n=e.type;if(!n||!a.test(n))throw new TypeError("invalid type");var r=n;if(t&&"object"==typeof t)for(var o,s=Object.keys(t).sort(),c=0;c{"use strict";var t=Object.keys,n=JSON.stringify;function r(e,i){var o,s,a,l,c,h,u;if("string"==(u=typeof e))return n(e);if(!0===e)return"true";if(!1===e)return"false";if(null===e)return"null";if(e instanceof Array){for(a="[",s=e.length-1,o=0;o-1&&(a+=r(e[o],!1)),a+"]"}if(e instanceof Object){if("function"==typeof e.toJSON)return r(e.toJSON(),i);for(s=(l=t(e).sort()).length,a="",o=0;o(t.sort(),new m(`Found: ${e.value} token, expected one of: ${t.join(", ")}`,e));let v=e=>e.slice(1,-1);e.Parser=class{constructor(e,t,n=0){this._source=t,this._tokenizer=e,this.current_token=this._tokenizer.next(this._source,n),this.unaryOpTokens=["-","+","!"],this.primitivesTokens=["number","null","true","false","string"],this.operations=[["||"],["&&"],["in"],["==","!="],["<",">","<=",">="],["+","-"],["*","/"],["**"]],this.expectedTokens=["!","(","+","-","[","false","identifier","null","number","string","true","{"]}takeToken(...e){if(null==this.current_token)throw new m("Unexpected end of input");if(e.length>0&&-1===e.indexOf(this.current_token.kind))throw g(this.current_token,e);try{this.current_token=this._tokenizer.next(this._source,this.current_token.end)}catch(e){throw e}}parse(e=0){let t;if(e==this.operations.length-1){t=this.parsePropertyAccessOrFunc();let n=this.current_token;for(;null!=n&&-1!==this.operations[e].indexOf(n.kind);n=this.current_token)this.takeToken(n.kind),t=new l(n,this.parse(e),t)}else{t=this.parse(e+1);let n=this.current_token;for(;null!=n&&-1!==this.operations[e].indexOf(n.kind);n=this.current_token)this.takeToken(n.kind),t=new l(n,t,this.parse(e+1))}return t}parsePropertyAccessOrFunc(){let e,t=this.parseUnit(),n=["[","(","."];for(let r=this.current_token;null!=r&&-1!==n.indexOf(r.kind);r=this.current_token)"["==r.kind?t=this.parseAccessWithBrackets(t):"."==r.kind?(r=this.current_token,this.takeToken("."),e=new c(this.current_token),this.takeToken("identifier"),t=new l(r,t,e)):"("==r.kind&&(t=this.parseFunctionCall(t));return t}parseUnit(){let e,t=this.current_token,n=-1!==this.unaryOpTokens.indexOf(t.kind),r=-1!==this.primitivesTokens.indexOf(t.kind);if(null==this.current_token)throw new m("Unexpected end of input");if(n)this.takeToken(t.kind),e=new a(t,this.parseUnit());else if(r)this.takeToken(t.kind),e=new c(t);else if("identifier"==t.kind)this.takeToken(t.kind),e=new h(t);else if("("==t.kind){if(this.takeToken("("),e=this.parse(),null==e)throw g(this.current_token,this.expectedTokens);this.takeToken(")")}else"["==t.kind?e=this.parseList():"{"==t.kind&&(e=this.parseObject());return e}parseFunctionCall(e){let t,n=this.current_token,r=[];if(this.takeToken("("),")"!=this.current_token.kind)for(t=this.parse(),r.push(t);null!=this.current_token&&","==this.current_token.kind;){if(null==r[r.length-1])throw g(this.current_token,this.expectedTokens);this.takeToken(","),t=this.parse(),r.push(t)}return this.takeToken(")"),t=new u(n,e,r),t}parseList(){let e,t=[],n=this.current_token;if(this.takeToken("["),"]"!=this.current_token.kind)for(e=this.parse(),t.push(e);","==this.current_token.kind;){if(null==t[t.length-1])throw g(this.current_token,this.expectedTokens);this.takeToken(","),e=this.parse(),t.push(e)}return this.takeToken("]"),e=new d(n,t),e}parseAccessWithBrackets(e){let t=null,n=null,r=this.current_token,i=!1;if(this.takeToken("["),"]"==this.current_token.kind)throw g(this.current_token,this.expectedTokens);if(":"!=this.current_token.kind&&(t=this.parse()),":"==this.current_token.kind&&(i=!0,this.takeToken(":")),"]"!=this.current_token.kind&&(n=this.parse()),i&&null==n&&"]"!=this.current_token.kind)throw g(this.current_token,this.expectedTokens);return this.takeToken("]"),new f(r,e,i,t,n)}parseObject(){let e,t,n,r={},i=this.current_token;this.takeToken("{");let o=this.current_token;for(;null!=o&&("string"==o.kind||"identifier"==o.kind);){if(t=o.value,"string"==o.kind&&(t=v(t)),this.takeToken(o.kind),this.takeToken(":"),n=this.parse(),null==n)throw g(this.current_token,this.expectedTokens);if(r[t]=n,null!=this.current_token&&"}"==this.current_token.kind)break;this.takeToken(","),o=this.current_token}return this.takeToken("}"),e=new p(i,r),e}};var{SyntaxError:y}=s;let b=e=>(e=>{if("string"!=typeof e)return!1;try{new RegExp(`^${e}$`)}catch(e){return!1}return!0})(e)&&1===new RegExp(`^(?:|${e})$`).exec("").length,w=(e,t=0)=>{let n=e.length;for(let r=t;r{if(!e)throw new Error("Token configuration is invalid")};var k=class{constructor(e={}){e=Object.assign({},{ignore:null,patterns:{},tokens:[]},e),x(null===e.ignore||b(e.ignore)),x(e.patterns instanceof Object);for(let t of Object.keys(e.patterns))x(b(e.patterns[t]));x(e.tokens instanceof Array),e.tokens.forEach((e=>x("string"==typeof e))),this._tokens=e.tokens,this._hasIgnore=e.ignore?1:0,this._regex=new RegExp("^(?:"+[this._hasIgnore?`(${e.ignore})`:null,...this._tokens.map((t=>{return`(${e.patterns[t]||(n=t,n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))})`;var n}))].filter((e=>null!==e)).join("|")+")")}next(e,t=0){let n,r;do{if(n=this._regex.exec(e.slice(t)),null===n){if(""!==e.slice(t))throw new y(`Unexpected input for '${e}' at '${e.slice(t)}'`,{start:t,end:e.length});return null}r=w(n,1),t+=n[0].length}while(this._hasIgnore&&1===r);return{kind:this._tokens[r-1-this._hasIgnore],value:n[r],start:t-n[0].length,end:t}}tokenize(e,t=0){let n={end:t},r=[];for(;n=this.next(e,n.end);)r.push(n);return r}},S={};let A={isString:e=>"string"==typeof e,isNumber:e=>"number"==typeof e,isInteger:e=>"number"==typeof e&&Number.isInteger(e),isBool:e=>"boolean"==typeof e,isNull:e=>null===e,isArray:e=>e instanceof Array,isObject:e=>e instanceof Object&&!(e instanceof Array)&&!(e instanceof Function),isFunction:e=>e instanceof Function,isTruthy:e=>null!==e&&(A.isArray(e)&&e.length>0||A.isObject(e)&&Object.keys(e).length>0||A.isString(e)&&e.length>0||A.isNumber(e)&&0!==e||A.isBool(e)&&e||A.isFunction(e))};var C=A;const{isFunction:O,isObject:E,isString:j,isArray:M,isNumber:I,isInteger:$,isTruthy:T}=C,{InterpreterError:_}=s;let P=(e,t)=>new _(`${e} expects ${t}`);let D=(e,t)=>{if(M(e)&&M(t)&&e.length===t.length){for(let n=0;n{if("+"===e&&!(I(t)&&I(n)||j(t)&&j(n)))throw P("infix: +","numbers/strings + numbers/strings");if(["-","*","/","**"].some((t=>t===e))&&(!I(t)||!I(n)))throw P(`infix: ${e}`,`number ${e} number`)},N=(e,t,n)=>{if("=="===e||"!="===e)return null;if(![">=","<=","<",">"].some((t=>t===e))||!(I(t)&&I(n)||j(t)&&j(n)))throw P(`infix: ${e}`,`numbers/strings ${e} numbers/strings`)};S.Interpreter=class{constructor(e){this.context=e}visit(e){return this["visit_"+e.constructorName](e)}visit_ASTNode(e){let t;switch(e.token.kind){case"number":return+e.token.value;case"null":return null;case"string":return t=e.token.value.slice(1,-1),t;case"true":return!0;case"false":return!1;case"identifier":return e.token.value}}visit_UnaryOp(e){let t=this.visit(e.expr);switch(e.token.kind){case"+":if(!I(t))throw P("unary +","number");return+t;case"-":if(!I(t))throw P("unary -","number");return-t;case"!":return!T(t)}}visit_BinOp(e){let t,n=this.visit(e.left);switch(e.token.kind){case"||":return T(n)||T(this.visit(e.right));case"&&":return T(n)&&T(this.visit(e.right));default:t=this.visit(e.right)}switch(e.token.kind){case"+":return R("+",n,t),n+t;case"-":return R("-",n,t),n-t;case"/":return R("/",n,t),n/t;case"*":return R("*",n,t),n*t;case">":return N(">",n,t),n>t;case"<":return N("<",n,t),n=":return N(">=",n,t),n>=t;case"<=":return N("<=",n,t),n<=t;case"!=":return N("!=",n,t),!D(n,t);case"==":return N("==",n,t),D(n,t);case"**":return R("**",n,t),Math.pow(t,n);case".":if(E(n)){if(n.hasOwnProperty(t))return n[t];throw new _(`object has no property "${t}"`)}throw P("infix: .","objects");case"in":if(E(t)){if(!j(n))throw P("Infix: in-object","string on left side");t=Object.keys(t)}else{if(j(t)){if(!j(n))throw P("Infix: in-string","string on left side");return-1!==t.indexOf(n)}if(!M(t))throw P("Infix: in","Array, string, or object on right side")}return t.some((e=>D(n,e)))}}visit_List(e){let t=[];return void 0!==e.list[0]&&e.list.forEach((function(e){t.push(this.visit(e))}),this),t}visit_ValueAccess(e){let t=this.visit(e.arr),n=0,r=null;if(e.left&&(n=this.visit(e.left)),e.right&&(r=this.visit(e.right)),n<0&&(n=t.length+n),M(t)||j(t)){if(e.isInterval){if(r=null===r?t.length:r,r<0&&(r=t.length+r,r<0&&(r=0)),n>r&&(n=r),!$(n)||!$(r))throw new _("cannot perform interval access with non-integers");return t.slice(n,r)}if(!$(n))throw new _("should only use integers to access arrays or strings");if(n>=t.length)throw new _("index out of bounds");return t[n]}if(!E(t))throw P('infix: "[..]"',"object, array, or string");if(!j(n))throw new _("object keys must be strings");return t.hasOwnProperty(n)?t[n]:null}visit_ContextValue(e){if(this.context.hasOwnProperty(e.token.value))return this.context[e.token.value];throw new _(`unknown context value ${e.token.value}`)}visit_FunctionCall(e){let t=[],n=this.visit(e.name);if(O(n))return e.args.forEach((function(e){t.push(this.visit(e))}),this),n.hasOwnProperty("jsone_builtin")&&t.unshift(this.context),n.apply(null,t);throw new _(`${n} is not callable`)}visit_Object(e){let t={};for(let n in e.obj)t[n]=this.visit(e.obj[n]);return t}interpret(e){return this.visit(e)}};var B=new RegExp(["^(\\s*(-|\\+))?","(\\s*(\\d+)\\s*y((ears?)|r)?)?","(\\s*(\\d+)\\s*mo(nths?)?)?","(\\s*(\\d+)\\s*w((eeks?)|k)?)?","(\\s*(\\d+)\\s*d(ays?)?)?","(\\s*(\\d+)\\s*h((ours?)|r)?)?","(\\s*(\\d+)\\s*m(in(utes?)?)?)?","(\\s*(\\d+)\\s*s(ec(onds?)?)?)?","\\s*$"].join(""),"i"),L=(e="",t)=>{let n=function(e){var t=B.exec(e||"");if(!t)throw new Error("String: '"+e+"' isn't a time expression");var n="-"===t[2]?-1:1;return{years:parseInt(t[4]||0,10)*n,months:parseInt(t[8]||0,10)*n,weeks:parseInt(t[11]||0,10)*n,days:parseInt(t[15]||0,10)*n,hours:parseInt(t[18]||0,10)*n,minutes:parseInt(t[22]||0,10)*n,seconds:parseInt(t[25]||0,10)*n}}(e);return n.days+=30*n.months,n.days+=365*n.years,t=t?new Date(t):new Date,new Date(t.getTime()+7*n.weeks*24*60*60*1e3+24*n.days*60*60*1e3+60*n.hours*60*1e3+60*n.minutes*1e3+1e3*n.seconds).toJSON()},F=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},V=Object.keys||function(e){var t=Object.prototype.hasOwnProperty||function(){return!0},n=[];for(var r in e)t.call(e,r)&&n.push(r);return n},{BuiltinError:z}=s,q=L,{isString:H,isNumber:W,isBool:U,isArray:J,isObject:K,isNull:G,isFunction:Q}=C;let Z={string:H,number:W,boolean:U,array:J,object:K,null:G,function:Q},Y=e=>new z(`invalid arguments to ${e}`);const{Parser:X}=e,ee=k,{Interpreter:te}=S;var ne=L,re=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var n=t.space||"";"number"==typeof n&&(n=Array(n+1).join(" "));var r,i="boolean"==typeof t.cycles&&t.cycles,o=t.replacer||function(e,t){return t},s=t.cmp&&(r=t.cmp,function(e){return function(t,n){var i={key:t,value:e[t]},o={key:n,value:e[n]};return r(i,o)}}),a=[];return function e(t,r,l,c){var h=n?"\n"+new Array(c+1).join(n):"",u=n?": ":":";if(l&&l.toJSON&&"function"==typeof l.toJSON&&(l=l.toJSON()),void 0!==(l=o.call(t,r,l))){if("object"!=typeof l||null===l)return JSON.stringify(l);if(F(l)){for(var f=[],d=0;d{let t={},n=(e,t,{argumentTests:n=[],minArgs:r=!1,variadic:i=null,needsContext:o=!1,invoke:s})=>(t[e]=(...t)=>{let a=t.shift();if(!i&&t.lengthi))),t.forEach(((t,r)=>{if(!n[r].split("|").some((e=>Z[e](t))))throw Y(`builtin: ${e}`,n[r])})),o?s(a,...t):s(...t)},t[e].jsone_builtin=!0,t[e]);return["max","min"].forEach((e=>{if(null==Math[e])throw new Error(`${e} in Math undefined`);n(e,t,{minArgs:1,variadic:"number",invoke:(...t)=>Math[e](...t)})})),["sqrt","ceil","floor","abs"].forEach((e=>{if(null==Math[e])throw new Error(`${e} in Math undefined`);n(e,t,{argumentTests:["number"],invoke:t=>Math[e](t)})})),n("lowercase",t,{argumentTests:["string"],invoke:e=>e.toLowerCase()}),n("uppercase",t,{argumentTests:["string"],invoke:e=>e.toUpperCase()}),n("str",t,{argumentTests:["string|number|boolean|null"],invoke:e=>null===e?"null":e.toString()}),n("number",t,{argumentTests:["string"],invoke:Number}),n("len",t,{argumentTests:["string|array"],invoke:e=>Array.from(e).length}),n("strip",t,{argumentTests:["string"],invoke:e=>e.trim()}),n("rstrip",t,{argumentTests:["string"],invoke:e=>e.replace(/\s+$/,"")}),n("lstrip",t,{argumentTests:["string"],invoke:e=>e.replace(/^\s+/,"")}),n("split",t,{minArgs:1,variadic:"string|number",invoke:(e,t)=>e.split(t)}),n("join",t,{argumentTests:["array","string|number"],invoke:(e,t)=>e.join(t)}),n("fromNow",t,{variadic:"string",minArgs:1,needsContext:!0,invoke:(e,t,n)=>q(t,n||e.now)}),n("typeof",t,{argumentTests:["string|number|boolean|array|object|null|function"],invoke:e=>{for(let t of["string","number","boolean","array","object","function"])if(Z[t](e))return t;if(Z.null(e))return"null";throw Y("builtin: typeof")}}),n("defined",t,{argumentTests:["string"],needsContext:!0,invoke:(e,t)=>e.hasOwnProperty(t)}),Object.assign({},t,e)},{JSONTemplateError:fe,TemplateError:de,SyntaxError:pe}=s;let me=e=>new pe(`Found: ${e.value} token, expected one of: !=, &&, (, *, **, +, -, ., /, <, <=, ==, >, >=, [, in, ||`);function ge(e,t){var n="",r=new RegExp(t.join("|")+"$");for(var i of Object.keys(e).sort())r.test(i)||(n+=" "+i);if(n)throw new de(t[0].replace("\\","")+" has undefined properties:"+n)}let ve=e=>Array.isArray(e)?[].concat(...e.map(ve)):e,ye=(e,t)=>{let n,r="",i=e;for(;-1!==(n=i.search(/\$?\${/g));)if(r+=i.slice(0,n),"$"!=i[n+1]){let e=Ae(i.slice(n+2),"}",t);if(ae(e.result)||le(e.result)){let t=i.slice(n+2,n+e.offset);throw new de(`interpolation of '${t}' produced an array or object`)}null===e.result?r+="":r+=e.result.toString(),i=i.slice(n+e.offset+1)}else r+="${",i=i.slice(n+3);return r+=i,r},be={},we={$eval:(e,t)=>{if(ge(e,["\\$eval"]),!ie(e.$eval))throw new de("$eval must be given a string expression");return Se(e.$eval,t)},$flatten:(e,t)=>{ge(e,["\\$flatten"]);let n=xe(e.$flatten,t);if(!ae(n))throw new de("$flatten value must evaluate to an array");return n.reduce(((e,t)=>e.concat(t)),[])},$flattenDeep:(e,t)=>{ge(e,["\\$flattenDeep"]);let n=xe(e.$flattenDeep,t);if(!ae(n))throw new de("$flattenDeep value must evaluate to an array");return ve(n)},$fromNow:(e,t)=>{ge(e,["\\$fromNow","from"]);let n=xe(e.$fromNow,t),r=t.now;if(e.from&&(r=xe(e.from,t)),!ie(n))throw new de("$fromNow expects a string");return ne(n,r)},$if:(e,t)=>{if(ge(e,["\\$if","then","else"]),!ie(e.$if))throw new de("$if can evaluate string expressions only");if(ce(Se(e.$if,t))){if(e.hasOwnProperty("$then"))throw new de("$if Syntax error: $then: should be spelled then: (no $)");return e.hasOwnProperty("then")?xe(e.then,t):be}return e.hasOwnProperty("else")?xe(e.else,t):be},$json:(e,t)=>{ge(e,["\\$json"]);const n=xe(e.$json,t);if(Ce(n))throw new de("evaluated template contained uncalled functions");return re(n)},$let:(e,t)=>{if(ge(e,["\\$let","in"]),!le(e.$let))throw new de("$let value must be an object");let n={},r=xe(e.$let,t);if(!le(r))throw new de("$let value must be an object");Object.keys(r).forEach((e=>{if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e))throw new de("top level keys of $let must follow /[a-zA-Z_][a-zA-Z0-9_]*/");n[e]=r[e]}));var i=Object.assign(t,n);if(null==e.in)throw new de("$let operator requires an `in` clause");return xe(e.in,i)},$map:(e,t)=>{ge(e,["\\$map","each\\(([a-zA-Z_][a-zA-Z0-9_]*)(,\\s*([a-zA-Z_][a-zA-Z0-9_]*))?\\)"]);let n=xe(e.$map,t);if(!ae(n)&&!le(n))throw new de("$map value must evaluate to an array or object");if(2!==Object.keys(e).length)throw new de("$map must have exactly two properties");let r=Object.keys(e).filter((e=>"$map"!==e))[0],i=/^each\(([a-zA-Z_][a-zA-Z0-9_]*)(,\s*([a-zA-Z_][a-zA-Z0-9_]*))?\)$/.exec(r);if(!i)throw new de("$map requires each(identifier) syntax");let o=i[1],s=i[3],a=e[r];if(le(n)){let e;return n=Object.keys(n).map((e=>({key:e,val:n[e]}))),n=n.map((n=>{let r=void 0!==s?{[o]:n.val,[s]:n.key}:{[o]:n};if(e=xe(a,Object.assign({},t,r)),!le(e))throw new de(`$map on objects expects each(${o}) to evaluate to an object`);return e})).filter((e=>e!==be)),Object.assign({},...n)}return n.map(((e,n)=>{let r=void 0!==s?{[o]:e,[s]:n}:{[o]:e};return xe(a,Object.assign({},t,r))})).filter((e=>e!==be))},$match:(e,t)=>{if(ge(e,["\\$match"]),!le(e.$match))throw new de("$match can evaluate objects only");const n=[],r=e.$match;for(let e of Object.keys(r).sort())ce(Se(e,t))&&n.push(xe(r[e],t));return n},$switch:(e,t)=>{if(ge(e,["\\$switch"]),!le(e.$switch))throw new de("$switch can evaluate objects only");let n=[];const r=e.$switch;for(let e of Object.keys(r).filter((e=>"$default"!==e)).sort())ce(Se(e,t))&&n.push(xe(r[e],t));if(n.length>1)throw new de("$switch can only have one truthy condition");return 0===n.length&&r.$default&&n.push(xe(r.$default,t)),n.length>0?n[0]:be},$merge:(e,t)=>{ge(e,["\\$merge"]);let n=xe(e.$merge,t);if(!ae(n)||n.some((e=>!le(e))))throw new de("$merge value must evaluate to an array of objects");return Object.assign({},...n)},$mergeDeep:(e,t)=>{ge(e,["\\$mergeDeep"]);let n=xe(e.$mergeDeep,t);if(!ae(n)||n.some((e=>!le(e))))throw new de("$mergeDeep value must evaluate to an array of objects");if(0===n.length)return{};let r=(e,t)=>{if(ae(e)&&ae(t))return e.concat(t);if(le(e)&&le(t)){let n=Object.assign({},e);for(let i in t)n[i]=i in e?r(e[i],t[i]):t[i];return n}return t};return n.reduce(r,n.shift())},$reverse:(e,t)=>{ge(e,["\\$reverse"]);let n=xe(e.$reverse,t);if(!ae(n))throw new de("$reverse value must evaluate to an array of objects");return n.reverse()},$sort:(e,t)=>{ge(e,["\\$sort","by\\(([a-zA-Z_][a-zA-Z0-9_]*)\\)"]);let n=xe(e.$sort,t);if(!ae(n))throw new de("$sorted values to be sorted must have the same type");let r,i=Object.keys(e).filter((e=>"$sort"!==e))[0],o=/^by\(([a-zA-Z_][a-zA-Z0-9_]*)\)$/.exec(i);if(o){let n=Object.assign({},t),s=o[1],a=e[i];r=e=>(n[s]=e,Se(a,n))}else{if(n.some((e=>ae(e)||le(e))))throw new de("$sorted values to be sorted must have the same type");r=e=>e}let s=n.map((e=>[r(e),e]));if(s.length>0){let e=typeof s[0][0];if("number"!==e&&"string"!==e||s.some((t=>e!==typeof t[0])))throw new de("$sorted values to be sorted must have the same type")}return s.sort(((e,t)=>(e=e[0])<(t=t[0])?-1:e>t?1:0)).map((e=>e[1]))}},xe=(e,t)=>{if(oe(e)||se(e)||null===e)return e;if(ie(e))return ye(e,t);if(ae(e))return e.map(((e,n)=>{try{return xe(e,t)}catch(e){throw e instanceof fe&&e.add_location(`[${n}]`),e}})).filter((e=>e!==be));let n=Object.keys(we).filter((t=>e.hasOwnProperty(t)));if(n.length>1)throw new de("only one operator allowed");if(1===n.length)return we[n[0]](e,t);let r={};for(let n of Object.keys(e)){let i;try{i=xe(e[n],t)}catch(e){throw e instanceof fe&&(/^[a-zA-Z][a-zA-Z0-9]*$/.test(n)?e.add_location(`.${n}`):e.add_location(`[${JSON.stringify(n)}]`)),e}if(i!==be){if(n.startsWith("$$"))n=n.substr(1);else{if(/^\$[a-zA-Z][a-zA-Z0-9]*$/.test(n))throw new de("$ is reserved; use $$");n=ye(n,t)}r[n]=i}}return r},ke=new ee({ignore:"\\s+",patterns:{number:"[0-9]+(?:\\.[0-9]+)?",identifier:"[a-zA-Z_][a-zA-Z_0-9]*",string:"'[^']*'|\"[^\"]*\"",true:"true(?![a-zA-Z_0-9])",false:"false(?![a-zA-Z_0-9])",in:"in(?![a-zA-Z_0-9])",null:"null(?![a-zA-Z_0-9])"},tokens:["**",..."+-*/[].(){}:,".split(""),">=","<=","<",">","==","!=","!","&&","||","true","false","in","null","number","identifier","string"]}),Se=(e,t)=>{let n=new X(ke,e),r=n.parse();if(null!=n.current_token)throw me(n.current_token);return new te(t).interpret(r)},Ae=(e,t,n)=>{let r=new X(ke,e),i=r.parse(),o=r.current_token;if(!o){let n=e.length;throw new pe(`Found end of string, expected ${t}`,{start:n,end:n})}if(o.kind!==t)throw me(o);return{result:new te(n).interpret(i),offset:o.start+2}},Ce=e=>{if(he(e))return!0;if(Array.isArray(e))return e.some(Ce);if("object"==typeof e&&null!==e){for(const t of Object.keys(e))if(Ce(e[t]))return!0;return!1}return!1};return(e,t={})=>{if("object"!=typeof t)throw new de("context must be an object");if(!Object.keys(t).every((e=>/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e))))throw new de("top level keys of context must follow /[a-zA-Z_][a-zA-Z0-9_]*/");t=ue(Object.assign({},{now:ne("0 seconds")},t));let n=xe(e,t);if(n===be)return null;if(Ce(n))throw new de("evaluated template contained uncalled functions");return n}}()},3565:e=>{e.exports=function(e,t){return function n(){null==t&&(t=e.length);var r=[].slice.call(arguments);return r.length>=t?e.apply(this,r):function(){return n.apply(this,r.concat([].slice.call(arguments)))}}}},6486:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",l=32,c=128,h=1/0,u=9007199254740991,f=NaN,d=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",l],["partialRight",64],["rearg",256]],m="[object Arguments]",g="[object Array]",v="[object Boolean]",y="[object Date]",b="[object Error]",w="[object Function]",x="[object GeneratorFunction]",k="[object Map]",S="[object Number]",A="[object Object]",C="[object Promise]",O="[object RegExp]",E="[object Set]",j="[object String]",M="[object Symbol]",I="[object WeakMap]",$="[object ArrayBuffer]",T="[object DataView]",_="[object Float32Array]",P="[object Float64Array]",D="[object Int8Array]",R="[object Int16Array]",N="[object Int32Array]",B="[object Uint8Array]",L="[object Uint8ClampedArray]",F="[object Uint16Array]",V="[object Uint32Array]",z=/\b__p \+= '';/g,q=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,U=/[&<>"']/g,J=RegExp(W.source),K=RegExp(U.source),G=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,Y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,X=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),re=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,le=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fe=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,ve=/^(?:0|[1-9]\d*)$/,ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,be=/($^)/,we=/['\n\r\u2028\u2029\\]/g,xe="\\ud800-\\udfff",ke="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="\\u2700-\\u27bf",Ae="a-z\\xdf-\\xf6\\xf8-\\xff",Ce="A-Z\\xc0-\\xd6\\xd8-\\xde",Oe="\\ufe0e\\ufe0f",Ee="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",je="["+xe+"]",Me="["+Ee+"]",Ie="["+ke+"]",$e="\\d+",Te="["+Se+"]",_e="["+Ae+"]",Pe="[^"+xe+Ee+$e+Se+Ae+Ce+"]",De="\\ud83c[\\udffb-\\udfff]",Re="[^"+xe+"]",Ne="(?:\\ud83c[\\udde6-\\uddff]){2}",Be="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+Ce+"]",Fe="\\u200d",Ve="(?:"+_e+"|"+Pe+")",ze="(?:"+Le+"|"+Pe+")",qe="(?:['’](?:d|ll|m|re|s|t|ve))?",He="(?:['’](?:D|LL|M|RE|S|T|VE))?",We="(?:"+Ie+"|"+De+")?",Ue="["+Oe+"]?",Je=Ue+We+"(?:"+Fe+"(?:"+[Re,Ne,Be].join("|")+")"+Ue+We+")*",Ke="(?:"+[Te,Ne,Be].join("|")+")"+Je,Ge="(?:"+[Re+Ie+"?",Ie,Ne,Be,je].join("|")+")",Qe=RegExp("['’]","g"),Ze=RegExp(Ie,"g"),Ye=RegExp(De+"(?="+De+")|"+Ge+Je,"g"),Xe=RegExp([Le+"?"+_e+"+"+qe+"(?="+[Me,Le,"$"].join("|")+")",ze+"+"+He+"(?="+[Me,Le+Ve,"$"].join("|")+")",Le+"?"+Ve+"+"+qe,Le+"+"+He,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",$e,Ke].join("|"),"g"),et=RegExp("["+Fe+xe+ke+Oe+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,it={};it[_]=it[P]=it[D]=it[R]=it[N]=it[B]=it[L]=it[F]=it[V]=!0,it[m]=it[g]=it[$]=it[v]=it[T]=it[y]=it[b]=it[w]=it[k]=it[S]=it[A]=it[O]=it[E]=it[j]=it[I]=!1;var ot={};ot[m]=ot[g]=ot[$]=ot[T]=ot[v]=ot[y]=ot[_]=ot[P]=ot[D]=ot[R]=ot[N]=ot[k]=ot[S]=ot[A]=ot[O]=ot[E]=ot[j]=ot[M]=ot[B]=ot[L]=ot[F]=ot[V]=!0,ot[b]=ot[w]=ot[I]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,lt=parseInt,ct="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ht="object"==typeof self&&self&&self.Object===Object&&self,ut=ct||ht||Function("return this")(),ft=t&&!t.nodeType&&t,dt=ft&&e&&!e.nodeType&&e,pt=dt&&dt.exports===ft,mt=pt&&ct.process,gt=function(){try{return dt&&dt.require&&dt.require("util").types||mt&&mt.binding&&mt.binding("util")}catch(e){}}(),vt=gt&>.isArrayBuffer,yt=gt&>.isDate,bt=gt&>.isMap,wt=gt&>.isRegExp,xt=gt&>.isSet,kt=gt&>.isTypedArray;function St(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 At(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function It(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function Xt(e,t){for(var n=e.length;n--&&Lt(t,e[n],0)>-1;);return n}var en=Ht({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tn=Ht({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(e){return"\\"+st[e]}function rn(e){return et.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function sn(e,t){return function(n){return e(t(n))}}function an(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"}),pn=function e(t){var n,r=(t=null==t?ut:pn.defaults(ut.Object(),t,pn.pick(ut,nt))).Array,ie=t.Date,xe=t.Error,ke=t.Function,Se=t.Math,Ae=t.Object,Ce=t.RegExp,Oe=t.String,Ee=t.TypeError,je=r.prototype,Me=ke.prototype,Ie=Ae.prototype,$e=t["__core-js_shared__"],Te=Me.toString,_e=Ie.hasOwnProperty,Pe=0,De=(n=/[^.]+$/.exec($e&&$e.keys&&$e.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Re=Ie.toString,Ne=Te.call(Ae),Be=ut._,Le=Ce("^"+Te.call(_e).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fe=pt?t.Buffer:i,Ve=t.Symbol,ze=t.Uint8Array,qe=Fe?Fe.allocUnsafe:i,He=sn(Ae.getPrototypeOf,Ae),We=Ae.create,Ue=Ie.propertyIsEnumerable,Je=je.splice,Ke=Ve?Ve.isConcatSpreadable:i,Ge=Ve?Ve.iterator:i,Ye=Ve?Ve.toStringTag:i,et=function(){try{var e=lo(Ae,"defineProperty");return e({},"",{}),e}catch(e){}}(),st=t.clearTimeout!==ut.clearTimeout&&t.clearTimeout,ct=ie&&ie.now!==ut.Date.now&&ie.now,ht=t.setTimeout!==ut.setTimeout&&t.setTimeout,ft=Se.ceil,dt=Se.floor,mt=Ae.getOwnPropertySymbols,gt=Fe?Fe.isBuffer:i,Rt=t.isFinite,Ht=je.join,mn=sn(Ae.keys,Ae),gn=Se.max,vn=Se.min,yn=ie.now,bn=t.parseInt,wn=Se.random,xn=je.reverse,kn=lo(t,"DataView"),Sn=lo(t,"Map"),An=lo(t,"Promise"),Cn=lo(t,"Set"),On=lo(t,"WeakMap"),En=lo(Ae,"create"),jn=On&&new On,Mn={},In=No(kn),$n=No(Sn),Tn=No(An),_n=No(Cn),Pn=No(On),Dn=Ve?Ve.prototype:i,Rn=Dn?Dn.valueOf:i,Nn=Dn?Dn.toString:i;function Bn(e){if(ea(e)&&!qs(e)&&!(e instanceof zn)){if(e instanceof Vn)return e;if(_e.call(e,"__wrapped__"))return Bo(e)}return new Vn(e)}var Ln=function(){function e(){}return function(t){if(!Xs(t))return{};if(We)return We(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Fn(){}function Vn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function zn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function sr(e,t,n,r,o,s){var a,l=1&t,c=2&t,h=4&t;if(n&&(a=o?n(e,r,o,s):n(e)),a!==i)return a;if(!Xs(e))return e;var u=qs(e);if(u){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&_e.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!l)return Oi(e,a)}else{var f=uo(e),d=f==w||f==x;if(Js(e))return wi(e,l);if(f==A||f==m||d&&!o){if(a=c||d?{}:po(e),!l)return c?function(e,t){return Ei(e,ho(e),t)}(e,function(e,t){return e&&Ei(t,$a(t),e)}(a,e)):function(e,t){return Ei(e,co(e),t)}(e,nr(a,e))}else{if(!ot[f])return o?e:{};a=function(e,t,n){var r,i=e.constructor;switch(t){case $:return xi(e);case v:case y:return new i(+e);case T:return function(e,t){var n=t?xi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case _:case P:case D:case R:case N:case B:case L:case F:case V:return ki(e,n);case k:return new i;case S:case j:return new i(e);case O:return function(e){var t=new e.constructor(e.source,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new i;case M:return r=e,Rn?Ae(Rn.call(r)):{}}}(e,f,l)}}s||(s=new Jn);var p=s.get(e);if(p)return p;s.set(e,a),oa(e)?e.forEach((function(r){a.add(sr(r,t,n,r,e,s))})):ta(e)&&e.forEach((function(r,i){a.set(i,sr(r,t,n,i,e,s))}));var g=u?i:(h?c?to:eo:c?$a:Ia)(e);return Ct(g||e,(function(r,i){g&&(r=e[i=r]),Xn(a,i,sr(r,t,n,i,e,s))})),a}function ar(e,t,n){var r=n.length;if(null==e)return!r;for(e=Ae(e);r--;){var o=n[r],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function lr(e,t,n){if("function"!=typeof e)throw new Ee(o);return jo((function(){e.apply(i,n)}),t)}function cr(e,t,n,r){var i=-1,o=Mt,s=!0,a=e.length,l=[],c=t.length;if(!a)return l;n&&(t=$t(t,Gt(n))),r?(o=It,s=!1):t.length>=200&&(o=Zt,s=!1,t=new Un(t));e:for(;++i-1},Hn.prototype.set=function(e,t){var n=this.__data__,r=er(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Wn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(Sn||Hn),string:new qn}},Wn.prototype.delete=function(e){var t=so(this,e).delete(e);return this.size-=t?1:0,t},Wn.prototype.get=function(e){return so(this,e).get(e)},Wn.prototype.has=function(e){return so(this,e).has(e)},Wn.prototype.set=function(e,t){var n=so(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Un.prototype.add=Un.prototype.push=function(e){return this.__data__.set(e,s),this},Un.prototype.has=function(e){return this.__data__.has(e)},Jn.prototype.clear=function(){this.__data__=new Hn,this.size=0},Jn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Jn.prototype.get=function(e){return this.__data__.get(e)},Jn.prototype.has=function(e){return this.__data__.has(e)},Jn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Hn){var r=n.__data__;if(!Sn||r.length<199)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};var hr=Ii(yr),ur=Ii(br,!0);function fr(e,t){var n=!0;return hr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function dr(e,t,n){for(var r=-1,o=e.length;++r0&&n(a)?t>1?mr(a,t-1,n,r,i):Tt(i,a):r||(i[i.length]=a)}return i}var gr=$i(),vr=$i(!0);function yr(e,t){return e&&gr(e,t,Ia)}function br(e,t){return e&&vr(e,t,Ia)}function wr(e,t){return jt(t,(function(t){return Qs(e[t])}))}function xr(e,t){for(var n=0,r=(t=gi(t,e)).length;null!=e&&nt}function Cr(e,t){return null!=e&&_e.call(e,t)}function Or(e,t){return null!=e&&t in Ae(e)}function Er(e,t,n){for(var o=n?It:Mt,s=e[0].length,a=e.length,l=a,c=r(a),h=1/0,u=[];l--;){var f=e[l];l&&t&&(f=$t(f,Gt(t))),h=vn(f.length,h),c[l]=!n&&(t||s>=120&&f.length>=120)?new Un(l&&f):i}f=e[0];var d=-1,p=c[0];e:for(;++d=a?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}));r--;)e[r]=e[r].value;return e}(i)}function zr(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)a!==e&&Je.call(a,l,1),Je.call(e,l,1);return e}function Hr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;go(i)?Je.call(e,i,1):li(e,i)}}return e}function Wr(e,t){return e+dt(wn()*(t-e+1))}function Ur(e,t){var n="";if(!e||t<1||t>u)return n;do{t%2&&(n+=e),(t=dt(t/2))&&(e+=e)}while(t);return n}function Jr(e,t){return Mo(Ao(e,t,nl),e+"")}function Kr(e){return Gn(La(e))}function Gr(e,t){var n=La(e);return To(n,or(t,0,n.length))}function Qr(e,t,n,r){if(!Xs(e))return e;for(var o=-1,s=(t=gi(t,e)).length,a=s-1,l=e;null!=l&&++oo?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=r(o);++i>>1,s=e[o];null!==s&&!aa(s)&&(n?s<=t:s=200){var c=t?null:Ui(e);if(c)return ln(c);s=!1,i=Zt,l=new Un}else l=t?[]:a;e:for(;++r=r?e:ei(e,t,n)}var bi=st||function(e){return ut.clearTimeout(e)};function wi(e,t){if(t)return e.slice();var n=e.length,r=qe?qe(n):new e.constructor(n);return e.copy(r),r}function xi(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function ki(e,t){var n=t?xi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Si(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,s=aa(e),a=t!==i,l=null===t,c=t==t,h=aa(t);if(!l&&!h&&!s&&e>t||s&&a&&c&&!l&&!h||r&&a&&c||!n&&c||!o)return 1;if(!r&&!s&&!h&&e1?n[o-1]:i,a=o>2?n[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&vo(n[0],n[1],a)&&(s=o<3?i:s,o=1),t=Ae(t);++r-1?o[s?t[a]:a]:i}}function Ri(e){return Xi((function(t){var n=t.length,r=n,s=Vn.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new Ee(o);if(s&&!l&&"wrapper"==ro(a))var l=new Vn([],!0)}for(r=l?r:n;++r1&&w.reverse(),d&&ul))return!1;var h=s.get(e),u=s.get(t);if(h&&u)return h==t&&u==e;var f=-1,d=!0,p=2&n?new Un:i;for(s.set(e,t),s.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Ct(p,(function(n){var r="_."+n[0];t&n[1]&&!Mt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ae):[]}(r),n)))}function $o(e){var t=0,n=0;return function(){var r=yn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function To(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,is(e,n)}));function us(e){var t=Bn(e);return t.__chain__=!0,t}function fs(e,t){return t(e)}var ds=Xi((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return ir(t,e)};return!(t>1||this.__actions__.length)&&r instanceof zn&&go(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:fs,args:[o],thisArg:i}),new Vn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),ps=ji((function(e,t,n){_e.call(e,n)?++e[n]:rr(e,n,1)})),ms=Di(zo),gs=Di(qo);function vs(e,t){return(qs(e)?Ct:hr)(e,oo(t,3))}function ys(e,t){return(qs(e)?Ot:ur)(e,oo(t,3))}var bs=ji((function(e,t,n){_e.call(e,n)?e[n].push(t):rr(e,n,[t])})),ws=Jr((function(e,t,n){var i=-1,o="function"==typeof t,s=Ws(e)?r(e.length):[];return hr(e,(function(e){s[++i]=o?St(t,e,n):jr(e,t,n)})),s})),xs=ji((function(e,t,n){rr(e,n,t)}));function ks(e,t){return(qs(e)?$t:Rr)(e,oo(t,3))}var Ss=ji((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]})),As=Jr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&vo(e,t[0],t[1])?t=[]:n>2&&vo(t[0],t[1],t[2])&&(t=[t[0]]),Vr(e,mr(t,1),[])})),Cs=ct||function(){return ut.Date.now()};function Os(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Ki(e,c,i,i,i,i,t)}function Es(e,t){var n;if("function"!=typeof t)throw new Ee(o);return e=da(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var js=Jr((function(e,t,n){var r=1;if(n.length){var i=an(n,io(js));r|=l}return Ki(e,r,t,n,i)})),Ms=Jr((function(e,t,n){var r=3;if(n.length){var i=an(n,io(Ms));r|=l}return Ki(t,r,e,n,i)}));function Is(e,t,n){var r,s,a,l,c,h,u=0,f=!1,d=!1,p=!0;if("function"!=typeof e)throw new Ee(o);function m(t){var n=r,o=s;return r=s=i,u=t,l=e.apply(o,n)}function g(e){var n=e-h;return h===i||n>=t||n<0||d&&e-u>=a}function v(){var e=Cs();if(g(e))return y(e);c=jo(v,function(e){var n=t-(e-h);return d?vn(n,a-(e-u)):n}(e))}function y(e){return c=i,p&&r?m(e):(r=s=i,l)}function b(){var e=Cs(),n=g(e);if(r=arguments,s=this,h=e,n){if(c===i)return function(e){return u=e,c=jo(v,t),f?m(e):l}(h);if(d)return bi(c),c=jo(v,t),m(h)}return c===i&&(c=jo(v,t)),l}return t=ma(t)||0,Xs(n)&&(f=!!n.leading,a=(d="maxWait"in n)?gn(ma(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),b.cancel=function(){c!==i&&bi(c),u=0,r=h=s=c=i},b.flush=function(){return c===i?l:y(Cs())},b}var $s=Jr((function(e,t){return lr(e,1,t)})),Ts=Jr((function(e,t,n){return lr(e,ma(t)||0,n)}));function _s(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(_s.Cache||Wn),n}function Ps(e){if("function"!=typeof e)throw new Ee(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}_s.Cache=Wn;var Ds=vi((function(e,t){var n=(t=1==t.length&&qs(t[0])?$t(t[0],Gt(oo())):$t(mr(t,1),Gt(oo()))).length;return Jr((function(r){for(var i=-1,o=vn(r.length,n);++i=t})),zs=Mr(function(){return arguments}())?Mr:function(e){return ea(e)&&_e.call(e,"callee")&&!Ue.call(e,"callee")},qs=r.isArray,Hs=vt?Gt(vt):function(e){return ea(e)&&Sr(e)==$};function Ws(e){return null!=e&&Ys(e.length)&&!Qs(e)}function Us(e){return ea(e)&&Ws(e)}var Js=gt||ml,Ks=yt?Gt(yt):function(e){return ea(e)&&Sr(e)==y};function Gs(e){if(!ea(e))return!1;var t=Sr(e);return t==b||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ra(e)}function Qs(e){if(!Xs(e))return!1;var t=Sr(e);return t==w||t==x||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Zs(e){return"number"==typeof e&&e==da(e)}function Ys(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function Xs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ea(e){return null!=e&&"object"==typeof e}var ta=bt?Gt(bt):function(e){return ea(e)&&uo(e)==k};function na(e){return"number"==typeof e||ea(e)&&Sr(e)==S}function ra(e){if(!ea(e)||Sr(e)!=A)return!1;var t=He(e);if(null===t)return!0;var n=_e.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Te.call(n)==Ne}var ia=wt?Gt(wt):function(e){return ea(e)&&Sr(e)==O},oa=xt?Gt(xt):function(e){return ea(e)&&uo(e)==E};function sa(e){return"string"==typeof e||!qs(e)&&ea(e)&&Sr(e)==j}function aa(e){return"symbol"==typeof e||ea(e)&&Sr(e)==M}var la=kt?Gt(kt):function(e){return ea(e)&&Ys(e.length)&&!!it[Sr(e)]},ca=qi(Dr),ha=qi((function(e,t){return e<=t}));function ua(e){if(!e)return[];if(Ws(e))return sa(e)?un(e):Oi(e);if(Ge&&e[Ge])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Ge]());var t=uo(e);return(t==k?on:t==E?ln:La)(e)}function fa(e){return e?(e=ma(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function da(e){var t=fa(e),n=t%1;return t==t?n?t-n:t:0}function pa(e){return e?or(da(e),0,d):0}function ma(e){if("number"==typeof e)return e;if(aa(e))return f;if(Xs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Xs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Kt(e);var n=pe.test(e);return n||ge.test(e)?lt(e.slice(2),n?2:8):de.test(e)?f:+e}function ga(e){return Ei(e,$a(e))}function va(e){return null==e?"":si(e)}var ya=Mi((function(e,t){if(xo(t)||Ws(t))Ei(t,Ia(t),e);else for(var n in t)_e.call(t,n)&&Xn(e,n,t[n])})),ba=Mi((function(e,t){Ei(t,$a(t),e)})),wa=Mi((function(e,t,n,r){Ei(t,$a(t),e,r)})),xa=Mi((function(e,t,n,r){Ei(t,Ia(t),e,r)})),ka=Xi(ir),Sa=Jr((function(e,t){e=Ae(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&vo(t[0],t[1],o)&&(r=1);++n1),t})),Ei(e,to(e),n),r&&(n=sr(n,7,Zi));for(var i=t.length;i--;)li(n,t[i]);return n})),Da=Xi((function(e,t){return null==e?{}:function(e,t){return zr(e,t,(function(t,n){return Oa(e,n)}))}(e,t)}));function Ra(e,t){if(null==e)return{};var n=$t(to(e),(function(e){return[e]}));return t=oo(t),zr(e,n,(function(e,n){return t(e,n[0])}))}var Na=Ji(Ia),Ba=Ji($a);function La(e){return null==e?[]:Qt(e,Ia(e))}var Fa=_i((function(e,t,n){return t=t.toLowerCase(),e+(n?Va(t):t)}));function Va(e){return Ga(va(e).toLowerCase())}function za(e){return(e=va(e))&&e.replace(ye,en).replace(Ze,"")}var qa=_i((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ha=_i((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Wa=Ti("toLowerCase"),Ua=_i((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()})),Ja=_i((function(e,t,n){return e+(n?" ":"")+Ga(t)})),Ka=_i((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Ga=Ti("toUpperCase");function Qa(e,t,n){return e=va(e),(t=n?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match(Xe)||[]}(e):function(e){return e.match(le)||[]}(e):e.match(t)||[]}var Za=Jr((function(e,t){try{return St(e,i,t)}catch(e){return Gs(e)?e:new xe(e)}})),Ya=Xi((function(e,t){return Ct(t,(function(t){t=Ro(t),rr(e,t,js(e[t],e))})),e}));function Xa(e){return function(){return e}}var el=Ri(),tl=Ri(!0);function nl(e){return e}function rl(e){return _r("function"==typeof e?e:sr(e,1))}var il=Jr((function(e,t){return function(n){return jr(n,e,t)}})),ol=Jr((function(e,t){return function(n){return jr(e,n,t)}}));function sl(e,t,n){var r=Ia(t),i=wr(t,r);null!=n||Xs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=wr(t,Ia(t)));var o=!(Xs(n)&&"chain"in n&&!n.chain),s=Qs(e);return Ct(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=Oi(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Tt([this.value()],arguments))})})),e}function al(){}var ll=Fi($t),cl=Fi(Et),hl=Fi(Dt);function ul(e){return yo(e)?qt(Ro(e)):function(e){return function(t){return xr(t,e)}}(e)}var fl=zi(),dl=zi(!0);function pl(){return[]}function ml(){return!1}var gl,vl=Li((function(e,t){return e+t}),0),yl=Wi("ceil"),bl=Li((function(e,t){return e/t}),1),wl=Wi("floor"),xl=Li((function(e,t){return e*t}),1),kl=Wi("round"),Sl=Li((function(e,t){return e-t}),0);return Bn.after=function(e,t){if("function"!=typeof t)throw new Ee(o);return e=da(e),function(){if(--e<1)return t.apply(this,arguments)}},Bn.ary=Os,Bn.assign=ya,Bn.assignIn=ba,Bn.assignInWith=wa,Bn.assignWith=xa,Bn.at=ka,Bn.before=Es,Bn.bind=js,Bn.bindAll=Ya,Bn.bindKey=Ms,Bn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return qs(e)?e:[e]},Bn.chain=us,Bn.chunk=function(e,t,n){t=(n?vo(e,t,n):t===i)?1:gn(da(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,l=r(ft(o/t));so?0:o+n),(r=r===i||r>o?o:da(r))<0&&(r+=o),r=n>r?0:pa(r);n>>0)?(e=va(e))&&("string"==typeof t||null!=t&&!ia(t))&&!(t=si(t))&&rn(e)?yi(un(e),0,n):e.split(t,n):[]},Bn.spread=function(e,t){if("function"!=typeof e)throw new Ee(o);return t=null==t?0:gn(da(t),0),Jr((function(n){var r=n[t],i=yi(n,0,t);return r&&Tt(i,r),St(e,this,i)}))},Bn.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},Bn.take=function(e,t,n){return e&&e.length?ei(e,0,(t=n||t===i?1:da(t))<0?0:t):[]},Bn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,(t=r-(t=n||t===i?1:da(t)))<0?0:t,r):[]},Bn.takeRightWhile=function(e,t){return e&&e.length?hi(e,oo(t,3),!1,!0):[]},Bn.takeWhile=function(e,t){return e&&e.length?hi(e,oo(t,3)):[]},Bn.tap=function(e,t){return t(e),e},Bn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Ee(o);return Xs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Is(e,t,{leading:r,maxWait:t,trailing:i})},Bn.thru=fs,Bn.toArray=ua,Bn.toPairs=Na,Bn.toPairsIn=Ba,Bn.toPath=function(e){return qs(e)?$t(e,Ro):aa(e)?[e]:Oi(Do(va(e)))},Bn.toPlainObject=ga,Bn.transform=function(e,t,n){var r=qs(e),i=r||Js(e)||la(e);if(t=oo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Xs(e)&&Qs(o)?Ln(He(e)):{}}return(i?Ct:yr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Bn.unary=function(e){return Os(e,1)},Bn.union=es,Bn.unionBy=ts,Bn.unionWith=ns,Bn.uniq=function(e){return e&&e.length?ai(e):[]},Bn.uniqBy=function(e,t){return e&&e.length?ai(e,oo(t,2)):[]},Bn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ai(e,i,t):[]},Bn.unset=function(e,t){return null==e||li(e,t)},Bn.unzip=rs,Bn.unzipWith=is,Bn.update=function(e,t,n){return null==e?e:ci(e,t,mi(n))},Bn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:ci(e,t,mi(n),r)},Bn.values=La,Bn.valuesIn=function(e){return null==e?[]:Qt(e,$a(e))},Bn.without=os,Bn.words=Qa,Bn.wrap=function(e,t){return Rs(mi(t),e)},Bn.xor=ss,Bn.xorBy=as,Bn.xorWith=ls,Bn.zip=cs,Bn.zipObject=function(e,t){return di(e||[],t||[],Xn)},Bn.zipObjectDeep=function(e,t){return di(e||[],t||[],Qr)},Bn.zipWith=hs,Bn.entries=Na,Bn.entriesIn=Ba,Bn.extend=ba,Bn.extendWith=wa,sl(Bn,Bn),Bn.add=vl,Bn.attempt=Za,Bn.camelCase=Fa,Bn.capitalize=Va,Bn.ceil=yl,Bn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=ma(n))==n?n:0),t!==i&&(t=(t=ma(t))==t?t:0),or(ma(e),t,n)},Bn.clone=function(e){return sr(e,4)},Bn.cloneDeep=function(e){return sr(e,5)},Bn.cloneDeepWith=function(e,t){return sr(e,5,t="function"==typeof t?t:i)},Bn.cloneWith=function(e,t){return sr(e,4,t="function"==typeof t?t:i)},Bn.conformsTo=function(e,t){return null==t||ar(e,t,Ia(t))},Bn.deburr=za,Bn.defaultTo=function(e,t){return null==e||e!=e?t:e},Bn.divide=bl,Bn.endsWith=function(e,t,n){e=va(e),t=si(t);var r=e.length,o=n=n===i?r:or(da(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Bn.eq=Ls,Bn.escape=function(e){return(e=va(e))&&K.test(e)?e.replace(U,tn):e},Bn.escapeRegExp=function(e){return(e=va(e))&&ne.test(e)?e.replace(te,"\\$&"):e},Bn.every=function(e,t,n){var r=qs(e)?Et:fr;return n&&vo(e,t,n)&&(t=i),r(e,oo(t,3))},Bn.find=ms,Bn.findIndex=zo,Bn.findKey=function(e,t){return Nt(e,oo(t,3),yr)},Bn.findLast=gs,Bn.findLastIndex=qo,Bn.findLastKey=function(e,t){return Nt(e,oo(t,3),br)},Bn.floor=wl,Bn.forEach=vs,Bn.forEachRight=ys,Bn.forIn=function(e,t){return null==e?e:gr(e,oo(t,3),$a)},Bn.forInRight=function(e,t){return null==e?e:vr(e,oo(t,3),$a)},Bn.forOwn=function(e,t){return e&&yr(e,oo(t,3))},Bn.forOwnRight=function(e,t){return e&&br(e,oo(t,3))},Bn.get=Ca,Bn.gt=Fs,Bn.gte=Vs,Bn.has=function(e,t){return null!=e&&fo(e,t,Cr)},Bn.hasIn=Oa,Bn.head=Wo,Bn.identity=nl,Bn.includes=function(e,t,n,r){e=Ws(e)?e:La(e),n=n&&!r?da(n):0;var i=e.length;return n<0&&(n=gn(i+n,0)),sa(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Lt(e,t,n)>-1},Bn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:da(n);return i<0&&(i=gn(r+i,0)),Lt(e,t,i)},Bn.inRange=function(e,t,n){return t=fa(t),n===i?(n=t,t=0):n=fa(n),function(e,t,n){return e>=vn(t,n)&&e=-9007199254740991&&e<=u},Bn.isSet=oa,Bn.isString=sa,Bn.isSymbol=aa,Bn.isTypedArray=la,Bn.isUndefined=function(e){return e===i},Bn.isWeakMap=function(e){return ea(e)&&uo(e)==I},Bn.isWeakSet=function(e){return ea(e)&&"[object WeakSet]"==Sr(e)},Bn.join=function(e,t){return null==e?"":Ht.call(e,t)},Bn.kebabCase=qa,Bn.last=Go,Bn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=da(n))<0?gn(r+o,0):vn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Bt(e,Vt,o,!0)},Bn.lowerCase=Ha,Bn.lowerFirst=Wa,Bn.lt=ca,Bn.lte=ha,Bn.max=function(e){return e&&e.length?dr(e,nl,Ar):i},Bn.maxBy=function(e,t){return e&&e.length?dr(e,oo(t,2),Ar):i},Bn.mean=function(e){return zt(e,nl)},Bn.meanBy=function(e,t){return zt(e,oo(t,2))},Bn.min=function(e){return e&&e.length?dr(e,nl,Dr):i},Bn.minBy=function(e,t){return e&&e.length?dr(e,oo(t,2),Dr):i},Bn.stubArray=pl,Bn.stubFalse=ml,Bn.stubObject=function(){return{}},Bn.stubString=function(){return""},Bn.stubTrue=function(){return!0},Bn.multiply=xl,Bn.nth=function(e,t){return e&&e.length?Fr(e,da(t)):i},Bn.noConflict=function(){return ut._===this&&(ut._=Be),this},Bn.noop=al,Bn.now=Cs,Bn.pad=function(e,t,n){e=va(e);var r=(t=da(t))?hn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Vi(dt(i),n)+e+Vi(ft(i),n)},Bn.padEnd=function(e,t,n){e=va(e);var r=(t=da(t))?hn(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=wn();return vn(e+o*(t-e+at("1e-"+((o+"").length-1))),t)}return Wr(e,t)},Bn.reduce=function(e,t,n){var r=qs(e)?_t:Wt,i=arguments.length<3;return r(e,oo(t,4),n,i,hr)},Bn.reduceRight=function(e,t,n){var r=qs(e)?Pt:Wt,i=arguments.length<3;return r(e,oo(t,4),n,i,ur)},Bn.repeat=function(e,t,n){return t=(n?vo(e,t,n):t===i)?1:da(t),Ur(va(e),t)},Bn.replace=function(){var e=arguments,t=va(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Bn.result=function(e,t,n){var r=-1,o=(t=gi(t,e)).length;for(o||(o=1,e=i);++ru)return[];var n=d,r=vn(e,d);t=oo(t),e-=d;for(var i=Jt(r,t);++n=s)return e;var l=n-hn(r);if(l<1)return r;var c=a?yi(a,0,l).join(""):e.slice(0,l);if(o===i)return c+r;if(a&&(l+=c.length-l),ia(o)){if(e.slice(l).search(o)){var h,u=c;for(o.global||(o=Ce(o.source,va(fe.exec(o))+"g")),o.lastIndex=0;h=o.exec(u);)var f=h.index;c=c.slice(0,f===i?l:f)}}else if(e.indexOf(si(o),l)!=l){var d=c.lastIndexOf(o);d>-1&&(c=c.slice(0,d))}return c+r},Bn.unescape=function(e){return(e=va(e))&&J.test(e)?e.replace(W,dn):e},Bn.uniqueId=function(e){var t=++Pe;return va(e)+t},Bn.upperCase=Ka,Bn.upperFirst=Ga,Bn.each=vs,Bn.eachRight=ys,Bn.first=Wo,sl(Bn,(gl={},yr(Bn,(function(e,t){_e.call(Bn.prototype,t)||(gl[t]=e)})),gl),{chain:!1}),Bn.VERSION="4.17.21",Ct(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Bn[e].placeholder=Bn})),Ct(["drop","take"],(function(e,t){zn.prototype[e]=function(n){n=n===i?1:gn(da(n),0);var r=this.__filtered__&&!t?new zn(this):this.clone();return r.__filtered__?r.__takeCount__=vn(n,r.__takeCount__):r.__views__.push({size:vn(n,d),type:e+(r.__dir__<0?"Right":"")}),r},zn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ct(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;zn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:oo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Ct(["head","last"],(function(e,t){var n="take"+(t?"Right":"");zn.prototype[e]=function(){return this[n](1).value()[0]}})),Ct(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");zn.prototype[e]=function(){return this.__filtered__?new zn(this):this[n](1)}})),zn.prototype.compact=function(){return this.filter(nl)},zn.prototype.find=function(e){return this.filter(e).head()},zn.prototype.findLast=function(e){return this.reverse().find(e)},zn.prototype.invokeMap=Jr((function(e,t){return"function"==typeof e?new zn(this):this.map((function(n){return jr(n,e,t)}))})),zn.prototype.reject=function(e){return this.filter(Ps(oo(e)))},zn.prototype.slice=function(e,t){e=da(e);var n=this;return n.__filtered__&&(e>0||t<0)?new zn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=da(t))<0?n.dropRight(-t):n.take(t-e)),n)},zn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},zn.prototype.toArray=function(){return this.take(d)},yr(zn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Bn[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);o&&(Bn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,l=t instanceof zn,c=a[0],h=l||qs(t),u=function(e){var t=o.apply(Bn,Tt([e],a));return r&&f?t[0]:t};h&&n&&"function"==typeof c&&1!=c.length&&(l=h=!1);var f=this.__chain__,d=!!this.__actions__.length,p=s&&!f,m=l&&!d;if(!s&&h){t=m?t:new zn(this);var g=e.apply(t,a);return g.__actions__.push({func:fs,args:[u],thisArg:i}),new Vn(g,f)}return p&&m?e.apply(this,a):(g=this.thru(u),p?r?g.value()[0]:g.value():g)})})),Ct(["pop","push","shift","sort","splice","unshift"],(function(e){var t=je[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Bn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(qs(i)?i:[],e)}return this[n]((function(n){return t.apply(qs(n)?n:[],e)}))}})),yr(zn.prototype,(function(e,t){var n=Bn[t];if(n){var r=n.name+"";_e.call(Mn,r)||(Mn[r]=[]),Mn[r].push({name:t,func:n})}})),Mn[Ni(i,2).name]=[{name:"wrapper",func:i}],zn.prototype.clone=function(){var e=new zn(this.__wrapped__);return e.__actions__=Oi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Oi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Oi(this.__views__),e},zn.prototype.reverse=function(){if(this.__filtered__){var e=new zn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},zn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=qs(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Bn.prototype.plant=function(e){for(var t,n=this;n instanceof Fn;){var r=Bo(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Bn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zn){var t=e;return this.__actions__.length&&(t=new zn(this)),(t=t.reverse()).__actions__.push({func:fs,args:[Xo],thisArg:i}),new Vn(t,this.__chain__)}return this.thru(Xo)},Bn.prototype.toJSON=Bn.prototype.valueOf=Bn.prototype.value=function(){return ui(this.__wrapped__,this.__actions__)},Bn.prototype.first=Bn.prototype.head,Ge&&(Bn.prototype[Ge]=function(){return this}),Bn}();ut._=pn,(r=function(){return pn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},705:e=>{e.exports=function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){if(o)return o(s,!0);throw new Error("Cannot find module '"+s+"'")}a=n[s]={exports:{}},t[s][0].call(a.exports,(function(e){return i(t[s][1][e]||e)}),a,a.exports,e,t,n,r)}return n[s].exports}for(var o=void 0,s=0;s>16),l((65280&r)>>8),l(255&r);return 2==i?l(255&(r=c(e.charAt(n))<<2|c(e.charAt(n+1))>>4)):1==i&&(l((r=c(e.charAt(n))<<10|c(e.charAt(n+1))<<4|c(e.charAt(n+2))>>2)>>8&255),l(255&r)),o},e.fromByteArray=function(e){var t,n,r,i,o=e.length%3,s="";function a(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,r=e.length-o;t>18&63)+a(i>>12&63)+a(i>>6&63)+a(63&i);switch(o){case 1:s=(s+=a((n=e[e.length-1])>>2))+a(n<<4&63)+"==";break;case 2:s=(s=(s+=a((n=(e[e.length-2]<<8)+e[e.length-1])>>10))+a(n>>4&63))+a(n<<2&63)+"="}return s}}(void 0===n?this.base64js={}:n)}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(e,t,n){(function(t,r,i,o,s,a,l,c,h){var u=e("base64-js"),f=e("ieee754");function i(e,t,n){if(!(this instanceof i))return new i(e,t,n);var r,o,s,a,l=typeof e;if("base64"===t&&"string"==l)for(e=(a=e).trim?a.trim():a.replace(/^\s+|\s+$/g,"");e.length%4!=0;)e+="=";if("number"==l)r=E(e);else if("string"==l)r=i.byteLength(e,t);else{if("object"!=l)throw new Error("First argument needs to be a number, array or string.");r=E(e.length)}if(i._useTypedArrays?o=i._augment(new Uint8Array(r)):((o=this).length=r,o._isBuffer=!0),i._useTypedArrays&&"number"==typeof e.byteLength)o._set(e);else if(j(a=e)||i.isBuffer(a)||a&&"object"==typeof a&&"number"==typeof a.length)for(s=0;s>>0)):(t+1>>0),i}function m(e,t,n,r){if(r||(N("boolean"==typeof n,"missing or invalid endian"),N(null!=t,"missing offset"),N(t+1>>8*(r?o:1-o)}function w(e,t,n,r,i){if(i||(N(null!=t,"missing value"),N("boolean"==typeof r,"missing or invalid endian"),N(null!=n,"missing offset"),N(n+3>>8*(r?o:3-o)&255}function x(e,t,n,r,i){i||(N(null!=t,"missing value"),N("boolean"==typeof r,"missing or invalid endian"),N(null!=n,"missing offset"),N(n+1>8,n%=256,r.push(n),r.push(t);return r}(t),e,n,r)}(this,e,t,n);break;default:throw new Error("Unknown encoding")}return o},i.prototype.toString=function(e,t,n){var r,i,o,s,a=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,(n=void 0!==n?Number(n):a.length)===t)return"";switch(e){case"hex":r=function(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||rthis.length&&(r=this.length);var o=(r=e.length-t=this.length))return this[e]},i.prototype.readUInt16LE=function(e,t){return d(this,e,!0,t)},i.prototype.readUInt16BE=function(e,t){return d(this,e,!1,t)},i.prototype.readUInt32LE=function(e,t){return p(this,e,!0,t)},i.prototype.readUInt32BE=function(e,t){return p(this,e,!1,t)},i.prototype.readInt8=function(e,t){if(t||(N(null!=e,"missing offset"),N(e=this.length))return 128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){return m(this,e,!0,t)},i.prototype.readInt16BE=function(e,t){return m(this,e,!1,t)},i.prototype.readInt32LE=function(e,t){return g(this,e,!0,t)},i.prototype.readInt32BE=function(e,t){return g(this,e,!1,t)},i.prototype.readFloatLE=function(e,t){return v(this,e,!0,t)},i.prototype.readFloatBE=function(e,t){return v(this,e,!1,t)},i.prototype.readDoubleLE=function(e,t){return y(this,e,!0,t)},i.prototype.readDoubleBE=function(e,t){return y(this,e,!1,t)},i.prototype.writeUInt8=function(e,t,n){n||(N(null!=e,"missing value"),N(null!=t,"missing offset"),N(t=this.length||(this[t]=e)},i.prototype.writeUInt16LE=function(e,t,n){b(this,e,t,!0,n)},i.prototype.writeUInt16BE=function(e,t,n){b(this,e,t,!1,n)},i.prototype.writeUInt32LE=function(e,t,n){w(this,e,t,!0,n)},i.prototype.writeUInt32BE=function(e,t,n){w(this,e,t,!1,n)},i.prototype.writeInt8=function(e,t,n){n||(N(null!=e,"missing value"),N(null!=t,"missing offset"),N(t=this.length||(0<=e?this.writeUInt8(e,t,n):this.writeUInt8(255+e+1,t,n))},i.prototype.writeInt16LE=function(e,t,n){x(this,e,t,!0,n)},i.prototype.writeInt16BE=function(e,t,n){x(this,e,t,!1,n)},i.prototype.writeInt32LE=function(e,t,n){k(this,e,t,!0,n)},i.prototype.writeInt32BE=function(e,t,n){k(this,e,t,!1,n)},i.prototype.writeFloatLE=function(e,t,n){S(this,e,t,!0,n)},i.prototype.writeFloatBE=function(e,t,n){S(this,e,t,!1,n)},i.prototype.writeDoubleLE=function(e,t,n){A(this,e,t,!0,n)},i.prototype.writeDoubleBE=function(e,t,n){A(this,e,t,!1,n)},i.prototype.fill=function(e,t,n){if(t=t||0,n=n||this.length,N("number"==typeof(e="string"==typeof(e=e||0)?e.charCodeAt(0):e)&&!isNaN(e),"value is not a number"),N(t<=n,"end < start"),n!==t&&0!==this.length){N(0<=t&&t"},i.prototype.toArrayBuffer=function(){if("undefined"==typeof Uint8Array)throw new Error("Buffer.toArrayBuffer not supported in this browser");if(i._useTypedArrays)return new i(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;t=t.length||i>=e.length);i++)t[i+n]=e[i];return i}function _(e){try{return decodeURIComponent(e)}catch(e){return String.fromCharCode(65533)}}function P(e,t){N("number"==typeof e,"cannot write a non-number as a number"),N(0<=e,"specified a negative value for writing an unsigned value"),N(e<=t,"value is larger than maximum value for type"),N(Math.floor(e)===e,"value has a fractional component")}function D(e,t,n){N("number"==typeof e,"cannot write a non-number as a number"),N(e<=t,"value larger than maximum allowed value"),N(n<=e,"value smaller than minimum allowed value"),N(Math.floor(e)===e,"value has a fractional component")}function R(e,t,n){N("number"==typeof e,"cannot write a non-number as a number"),N(e<=t,"value larger than maximum allowed value"),N(n<=e,"value smaller than minimum allowed value")}function N(e,t){if(!e)throw new Error(t||"Failed assertion")}i._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=C.get,e.set=C.set,e.write=C.write,e.toString=C.toString,e.toLocaleString=C.toString,e.toJSON=C.toJSON,e.copy=C.copy,e.slice=C.slice,e.readUInt8=C.readUInt8,e.readUInt16LE=C.readUInt16LE,e.readUInt16BE=C.readUInt16BE,e.readUInt32LE=C.readUInt32LE,e.readUInt32BE=C.readUInt32BE,e.readInt8=C.readInt8,e.readInt16LE=C.readInt16LE,e.readInt16BE=C.readInt16BE,e.readInt32LE=C.readInt32LE,e.readInt32BE=C.readInt32BE,e.readFloatLE=C.readFloatLE,e.readFloatBE=C.readFloatBE,e.readDoubleLE=C.readDoubleLE,e.readDoubleBE=C.readDoubleBE,e.writeUInt8=C.writeUInt8,e.writeUInt16LE=C.writeUInt16LE,e.writeUInt16BE=C.writeUInt16BE,e.writeUInt32LE=C.writeUInt32LE,e.writeUInt32BE=C.writeUInt32BE,e.writeInt8=C.writeInt8,e.writeInt16LE=C.writeInt16LE,e.writeInt16BE=C.writeInt16BE,e.writeInt32LE=C.writeInt32LE,e.writeInt32BE=C.writeInt32BE,e.writeFloatLE=C.writeFloatLE,e.writeFloatBE=C.writeFloatBE,e.writeDoubleLE=C.writeDoubleLE,e.writeDoubleBE=C.writeDoubleBE,e.fill=C.fill,e.inspect=C.inspect,e.toArrayBuffer=C.toArrayBuffer,e}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(e,t,n){(function(n,r,i,o,s,a,l,c,h){i=e("buffer").Buffer;var u=new i(4);u.fill(0),t.exports={hash:function(e,t,n,r){for(var o=t(function(e,t){e.length%4!=0&&(n=e.length+(4-e.length%4),e=i.concat([e,u],n));for(var n,r=[],o=t?e.readInt32BE:e.readInt32LE,s=0;sm?t=e(t):t.length>5]|=128<>>9<<4)]=t;for(var n=1732584193,r=-271733879,i=-1732584194,o=271733878,s=0;s>>32-i,n)}function p(e,t,n,r,i,o,s){return d(t&n|~t&r,e,t,i,o,s)}function m(e,t,n,r,i,o,s){return d(t&r|n&~r,e,t,i,o,s)}function g(e,t,n,r,i,o,s){return d(t^n^r,e,t,i,o,s)}function v(e,t,n,r,i,o,s){return d(n^(t|~r),e,t,i,o,s)}function y(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}t.exports=function(e){return u.hash(e,f,16)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(e,t,n){(function(e,n,r,i,o,s,a,l,c){t.exports=function(e){for(var t,n=new Array(e),r=0;r>>((3&r)<<3)&255;return n}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(e,t,n){(function(n,r,i,o,s,a,l,c,h){var u=e("./helpers");function f(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var n,r,i,o=Array(80),s=1732584193,a=-271733879,l=-1732584194,c=271733878,h=-1009589776,u=0;u>16)+(t>>16)+(n>>16)<<16|65535&n}function p(e,t){return e<>>32-t}t.exports=function(e){return u.hash(e,f,20,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(e,t,n){(function(n,r,i,o,s,a,l,c,h){function u(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function f(e,t){var n,r=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),i=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),o=new Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var s,a,l=0;l>>t|e<<32-t},m=function(e,t){return e>>>t};t.exports=function(e){return d.hash(e,f,32,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(e,t,n){(function(e,t,r,i,o,s,a,l,c){n.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,l=(1<>1,h=-7,u=n?i-1:0,f=n?-1:1;for(i=e[t+u],u+=f,o=i&(1<<-h)-1,i>>=-h,h+=a;0>=-h,h+=r;0>1,u=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,d=r?1:-1;for(o=t<0||0===t&&1/t<0?1:0,t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(r=Math.pow(2,-s))<1&&(s--,r*=2),2<=(t+=1<=s+h?u/r:u*Math.pow(2,1-h))*r&&(s++,r/=2),c<=s+h?(a=0,s=c):1<=s+h?(a=(t*r-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));8<=i;e[n+f]=255&a,f+=d,a/=256,i-=8);for(s=s<1){t[0]=t[0].slice(0,-1);for(var r=t.length-1,i=1;i= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,g=String.fromCharCode;function v(e){throw new RangeError(p[e])}function y(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+function(e,t){for(var n=[],r=e.length;r--;)n[r]=t(e[r]);return n}((e=e.replace(d,".")).split("."),t).join(".")}function b(e){for(var t=[],n=0,r=e.length;n=55296&&i<=56319&&n>1,e+=m(e/t);e>455;r+=h)e=m(e/35);return m(r+36*e/(e+38))},k=function(e){var t,n=[],r=e.length,i=0,o=128,s=72,a=e.lastIndexOf("-");a<0&&(a=0);for(var l=0;l=128&&v("not-basic"),n.push(e.charCodeAt(l));for(var u=a>0?a+1:0;u=r&&v("invalid-input");var g=(t=e.charCodeAt(u++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:h;(g>=h||g>m((c-i)/d))&&v("overflow"),i+=g*d;var y=p<=s?1:p>=s+26?26:p-s;if(gm(c/b)&&v("overflow"),d*=b}var w=n.length+1;s=x(i-f,w,0==f),m(i/w)>c-o&&v("overflow"),o+=m(i/w),i%=w,n.splice(i++,0,o)}return String.fromCodePoint.apply(String,n)},S=function(e){var t=[],n=(e=b(e)).length,r=128,i=0,o=72,s=!0,a=!1,l=void 0;try{for(var u,f=e[Symbol.iterator]();!(s=(u=f.next()).done);s=!0){var d=u.value;d<128&&t.push(g(d))}}catch(e){a=!0,l=e}finally{try{!s&&f.return&&f.return()}finally{if(a)throw l}}var p=t.length,y=p;for(p&&t.push("-");y=r&&jm((c-i)/M)&&v("overflow"),i+=(k-r)*M,r=k;var I=!0,$=!1,T=void 0;try{for(var _,P=e[Symbol.iterator]();!(I=(_=P.next()).done);I=!0){var D=_.value;if(Dc&&v("overflow"),D==r){for(var R=i,N=h;;N+=h){var B=N<=o?1:N>=o+26?26:N-o;if(R>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function E(e){for(var t="",n=0,r=e.length;n=194&&i<224){if(r-n>=6){var o=parseInt(e.substr(n+4,2),16);t+=String.fromCharCode((31&i)<<6|63&o)}else t+=e.substr(n,6);n+=6}else if(i>=224){if(r-n>=9){var s=parseInt(e.substr(n+4,2),16),a=parseInt(e.substr(n+7,2),16);t+=String.fromCharCode((15&i)<<12|(63&s)<<6|63&a)}else t+=e.substr(n,9);n+=9}else t+=e.substr(n,3),n+=3}return t}function j(e,t){function n(e){var n=E(e);return n.match(t.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,n).replace(t.NOT_USERINFO,O).replace(t.PCT_ENCODED,i)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_HOST,O).replace(t.PCT_ENCODED,i)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,n).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,O).replace(t.PCT_ENCODED,i)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,n).replace(t.NOT_QUERY,O).replace(t.PCT_ENCODED,i)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,n).replace(t.NOT_FRAGMENT,O).replace(t.PCT_ENCODED,i)),e}function M(e){return e.replace(/^0*(.*)/,"$1")||"0"}function I(e,t){var n=e.match(t.IPV4ADDRESS)||[],r=l(n,2)[1];return r?r.split(".").map(M).join("."):e}function $(e,t){var n=e.match(t.IPV6ADDRESS)||[],r=l(n,3),i=r[1],o=r[2];if(i){for(var s=i.toLowerCase().split("::").reverse(),a=l(s,2),c=a[0],h=a[1],u=h?h.split(":").map(M):[],f=c.split(":").map(M),d=t.IPV4ADDRESS.test(f[f.length-1]),p=d?7:8,m=f.length-p,g=Array(p),v=0;v1){var w=g.slice(0,y.index),x=g.slice(y.index+y.length);b=w.join(":")+"::"+x.join(":")}else b=g.join(":");return o&&(b+="%"+o),b}return e}var T=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,_=void 0==="".match(/(){0}/)[1];function P(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r=!1!==t.iri?a:s;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var i=e.match(T);if(i){_?(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5])):(n.scheme=i[1]||void 0,n.userinfo=-1!==e.indexOf("@")?i[3]:void 0,n.host=-1!==e.indexOf("//")?i[4]:void 0,n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=-1!==e.indexOf("?")?i[7]:void 0,n.fragment=-1!==e.indexOf("#")?i[8]:void 0,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),n.host&&(n.host=$(I(n.host,r),r)),void 0!==n.scheme||void 0!==n.userinfo||void 0!==n.host||void 0!==n.port||n.path||void 0!==n.query?void 0===n.scheme?n.reference="relative":void 0===n.fragment?n.reference="absolute":n.reference="uri":n.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==n.reference&&(n.error=n.error||"URI is not a "+t.reference+" reference.");var o=C[(t.scheme||n.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)j(n,r);else{if(n.host&&(t.domainHost||o&&o.domainHost))try{n.host=A.toASCII(n.host.replace(r.PCT_ENCODED,E).toLowerCase())}catch(e){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+e}j(n,s)}o&&o.parse&&o.parse(n,t)}else n.error=n.error||"URI can not be parsed.";return n}var D=/^\.\.?\//,R=/^\/\.(\/|$)/,N=/^\/\.\.(\/|$)/,B=/^\/?(?:.|\n)*?(?=\/|$)/;function L(e){for(var t=[];e.length;)if(e.match(D))e=e.replace(D,"");else if(e.match(R))e=e.replace(R,"/");else if(e.match(N))e=e.replace(N,"/"),t.pop();else if("."===e||".."===e)e="";else{var n=e.match(B);if(!n)throw new Error("Unexpected dot segment condition");var r=n[0];e=e.slice(r.length),t.push(r)}return t.join("")}function F(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.iri?a:s,r=[],i=C[(t.scheme||e.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(e,t),e.host)if(n.IPV6ADDRESS.test(e.host));else if(t.domainHost||i&&i.domainHost)try{e.host=t.iri?A.toUnicode(e.host):A.toASCII(e.host.replace(n.PCT_ENCODED,E).toLowerCase())}catch(n){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+n}j(e,n),"suffix"!==t.reference&&e.scheme&&(r.push(e.scheme),r.push(":"));var o=function(e,t){var n=!1!==t.iri?a:s,r=[];return void 0!==e.userinfo&&(r.push(e.userinfo),r.push("@")),void 0!==e.host&&r.push($(I(String(e.host),n),n).replace(n.IPV6ADDRESS,(function(e,t,n){return"["+t+(n?"%25"+n:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(r.push(":"),r.push(String(e.port))),r.length?r.join(""):void 0}(e,t);if(void 0!==o&&("suffix"!==t.reference&&r.push("//"),r.push(o),e.path&&"/"!==e.path.charAt(0)&&r.push("/")),void 0!==e.path){var l=e.path;t.absolutePath||i&&i.absolutePath||(l=L(l)),void 0===o&&(l=l.replace(/^\/\//,"/%2F")),r.push(l)}return void 0!==e.query&&(r.push("?"),r.push(e.query)),void 0!==e.fragment&&(r.push("#"),r.push(e.fragment)),r.join("")}function V(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={};return arguments[3]||(e=P(F(e,n),n),t=P(F(t,n),n)),!(n=n||{}).tolerant&&t.scheme?(r.scheme=t.scheme,r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=L(t.path||""),r.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=L(t.path||""),r.query=t.query):(t.path?("/"===t.path.charAt(0)?r.path=L(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?r.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:r.path=t.path:r.path="/"+t.path,r.path=L(r.path)),r.query=t.query):(r.path=e.path,void 0!==t.query?r.query=t.query:r.query=e.query),r.userinfo=e.userinfo,r.host=e.host,r.port=e.port),r.scheme=e.scheme),r.fragment=t.fragment,r}function z(e,t){return e&&e.toString().replace(t&&t.iri?a.PCT_ENCODED:s.PCT_ENCODED,E)}var q={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var n="https"===String(e.scheme).toLowerCase();return e.port!==(n?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},H={scheme:"https",domainHost:q.domainHost,parse:q.parse,serialize:q.serialize};function W(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var U={scheme:"ws",domainHost:!0,parse:function(e,t){var n=e;return n.secure=W(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=void 0,n.query=void 0,n},serialize:function(e,t){if(e.port!==(W(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var n=e.resourceName.split("?"),r=l(n,2),i=r[0],o=r[1];e.path=i&&"/"!==i?i:void 0,e.query=o,e.resourceName=void 0}return e.fragment=void 0,e}},J={scheme:"wss",domainHost:U.domainHost,parse:U.parse,serialize:U.serialize},K={},G="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Q="[0-9A-Fa-f]",Z=n(n("%[EFef]"+Q+"%"+Q+Q+"%"+Q+Q)+"|"+n("%[89A-Fa-f]"+Q+"%"+Q+Q)+"|"+n("%"+Q+Q)),Y=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),X=new RegExp(G,"g"),ee=new RegExp(Z,"g"),te=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',Y),"g"),ne=new RegExp(t("[^]",G,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),re=ne;function ie(e){var t=E(e);return t.match(X)?t:e}var oe={scheme:"mailto",parse:function(e,t){var n=e,r=n.to=n.path?n.path.split(","):[];if(n.path=void 0,n.query){for(var i=!1,o={},s=n.query.split("&"),a=0,l=s.length;a{var r={"./jsonschema-2019-09-to-2019-09.json":4405,"./jsonschema-2019-09-to-2020-12.json":7377,"./jsonschema-2020-12-to-2020-12.json":4619,"./jsonschema-draft3-to-draft3.json":3825,"./jsonschema-draft3-to-draft4.json":3066,"./jsonschema-draft4-to-draft4.json":9300,"./jsonschema-draft4-to-draft6.json":8790,"./jsonschema-draft6-to-draft6.json":2630,"./jsonschema-draft6-to-draft7.json":6989,"./jsonschema-draft7-to-2019-09.json":9326,"./jsonschema-draft7-to-draft7.json":1747};function i(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=o,e.exports=i,i.id=6085},6218:(e,t,n)=>{var r={"./jsonschema-2019-09.json":2391,"./jsonschema-2020-12.json":3212,"./jsonschema-draft3.json":4413,"./jsonschema-draft4.json":2427,"./jsonschema-draft6.json":9628,"./jsonschema-draft7.json":228};function i(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=o,e.exports=i,i.id=6218},526:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7040),i=n(3642),o=n(729);class s{constructor(e,t,n){this.state=e,this.pos=t,this.explicit=n,this.abortListeners=[]}tokenBefore(e){let t=o.syntaxTree(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(u(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return null==this.abortListeners}addEventListener(e,t){"abort"==e&&this.abortListeners&&this.abortListeners.push(t)}}function a(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function l(e){let t=e.map((e=>"string"==typeof e?{label:e}:e)),[n,r]=t.every((e=>/^\w+$/.test(e.label)))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}class c{constructor(e,t,n){this.completion=e,this.source=t,this.match=n}}function h(e){return e.selection.main.head}function u(e,t){var n;let{source:r}=e,i=t&&"^"!=r[0],o="$"!=r[r.length-1];return i||o?new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}const f=r.Annotation.define();function d(e,t,n,i){return Object.assign(Object.assign({},e.changeByRange((o=>{if(o==e.selection.main)return{changes:{from:n,to:i,insert:t},range:r.EditorSelection.cursor(n+t.length)};let s=i-n;return!o.empty||s&&e.sliceDoc(o.from-s,o.from)!=e.sliceDoc(n,i)?{range:o}:{changes:{from:o.from-s,to:o.from,insert:t},range:r.EditorSelection.cursor(o.from-s+t.length)}}))),{userEvent:"input.complete"})}function p(e,t){const n=t.completion.apply||t.completion.label;let r=t.source;"string"==typeof n?e.dispatch(d(e.state,n,r.from,r.to)):n(e,t.completion,r.from,r.to)}const m=new WeakMap;function g(e){if(!Array.isArray(e))return e;let t=m.get(e);return t||m.set(e,t=l(e)),t}class v{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[];for(let t=0;t=48&&c<=57||c>=97&&c<=122?2:c>=65&&c<=90?1:0:(b=r.fromCodePoint(c))!=b.toLowerCase()?1:b!=b.toUpperCase()?2:0;(!i||1==w&&g||0==y&&0!=w)&&(t[u]==c||n[u]==c&&(f=!0)?s[u++]=i:s.length&&(v=!1)),y=w,i+=r.codePointSize(c)}return u==l&&0==s[0]&&v?this.result((f?-200:0)-100,s,e):d==l&&0==p?[-200-e.length,0,m]:a>-1?[-700-e.length,a,a+this.pattern.length]:d==l?[-900-e.length,p,m]:u==l?this.result((f?-200:0)-100-700+(v?0:-1100),s,e):2==t.length?null:this.result((i[0]?-700:0)-200-1100,i,e)}result(e,t,n){let i=[e-n.length],o=1;for(let e of t){let t=e+(this.astral?r.codePointSize(r.codePointAt(n,e)):1);o>1&&i[o-1]==e?i[o-1]=t:(i[o++]=e,i[o++]=t)}return i}}const y=r.Facet.define({combine:e=>r.combineConfig(e,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],compareCompletions:(e,t)=>e.label.localeCompare(t.label)},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,optionClass:(e,t)=>n=>function(e,t){return e?t?e+" "+t:e:t}(e(n),t(n)),addToOptions:(e,t)=>e.concat(t)})});function b(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}class w{constructor(e,t){this.view=e,this.stateField=t,this.info=null,this.placeInfo={read:()=>this.measureInfo(),write:e=>this.positionInfo(e),key:this};let n=e.state.field(t),{options:r,selected:i}=n.open,o=e.state.facet(y);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map((e=>"cm-completionIcon-"+e))),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n){let r=document.createElement("span");r.className="cm-completionLabel";let{label:i}=e,o=0;for(let e=1;eo&&r.appendChild(document.createTextNode(i.slice(o,t)));let a=r.appendChild(document.createElement("span"));a.appendChild(document.createTextNode(i.slice(t,s))),a.className="cm-completionMatchedText",o=s}return oe.position-t.position)).map((e=>e.render))}(o),this.optionClass=o.optionClass,this.range=b(r.length,i,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.dom.addEventListener("mousedown",(t=>{for(let n,i=t.target;i&&i!=this.dom;i=i.parentNode)if("LI"==i.nodeName&&(n=/-(\d+)$/.exec(i.id))&&+n[1]{this.info&&this.view.requestMeasure(this.placeInfo)}))}mount(){this.updateSel()}update(e){e.state.field(this.stateField)!=e.startState.field(this.stateField)&&this.updateSel()}positioned(){this.info&&this.view.requestMeasure(this.placeInfo)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected=this.range.to)&&(this.range=b(t.options.length,t.selected,this.view.state.facet(y).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t.options,e.id,this.range)),this.list.addEventListener("scroll",(()=>{this.info&&this.view.requestMeasure(this.placeInfo)}))),this.updateSelectedOption(t.selected)){this.info&&(this.info.remove(),this.info=null);let{completion:n}=t.options[t.selected],{info:r}=n;if(!r)return;let o="string"==typeof r?document.createTextNode(r):r(n);if(!o)return;"then"in o?o.then((t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t)})).catch((e=>i.logException(this.view.state,e,"completion info"))):this.addInfoPane(o)}}addInfoPane(e){let t=this.info=document.createElement("div");t.className="cm-tooltip cm-completionInfo",t.appendChild(e),this.dom.appendChild(t),this.view.requestMeasure(this.placeInfo)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected");return t&&function(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.topn.bottom&&(e.scrollTop+=r.bottom-n.bottom)}(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect();if(r.top>Math.min(innerHeight,t.bottom)-10||r.bottom=this.options.length?this:new k(this.options,C(t,e),this.tooltip,this.timestamp,e)}static build(e,t,n,r,i){let o=function(e,t){let n=[],r=0;for(let i of e)if(i.hasResult())if(!1===i.result.filter){let e=i.result.getMatch;for(let t of i.result.options){let o=[1e9-r++];if(e)for(let n of e(t))o.push(n);n.push(new c(t,i,o))}}else{let e,r=new v(t.sliceDoc(i.from,i.to));for(let t of i.result.options)(e=r.match(t.label))&&(null!=t.boost&&(e[0]+=t.boost),n.push(new c(t,i,e)))}let i=[],o=null,s=t.facet(y).compareCompletions;for(let e of n.sort(((e,t)=>t.match[0]-e.match[0]||s(e.completion,t.completion))))!o||o.label!=e.completion.label||o.detail!=e.completion.detail||null!=o.type&&null!=e.completion.type&&o.type!=e.completion.type||o.apply!=e.completion.apply?i.push(e):x(e.completion)>x(o)&&(i[i.length-1]=e),o=e.completion;return i}(e,t);if(!o.length)return null;let s=t.facet(y).selectOnOpen?0:-1;if(r&&r.selected!=s&&-1!=r.selected){let e=r.options[r.selected].completion;for(let t=0;tt.hasResult()?Math.min(e,t.from):e),1e8),create:(a=P,e=>new w(e,a)),above:i.aboveCursor},r?r.timestamp:Date.now(),s);var a}map(e){return new k(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected)}}class S{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new S(O,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(y),r=(n.override||t.languageDataAt("autocomplete",h(t)).map(g)).map((t=>(this.active.find((e=>e.source==t))||new j(t,this.active.some((e=>0!=e.state))?1:0)).update(e,n)));r.length==this.active.length&&r.every(((e,t)=>e==this.active[t]))&&(r=this.active);let i=e.selection||r.some((t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to)))||!function(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n1!=e.state))&&r.some((e=>e.hasResult()))&&(r=r.map((e=>e.hasResult()?new j(e.source,0):e)));for(let t of e.effects)t.is(_)&&(i=i&&i.setSelected(t.value,this.id));return r==this.active&&i==this.open?this:new S(r,this.id,i)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:A}}const A={"aria-autocomplete":"list"};function C(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const O=[];function E(e){return e.isUserEvent("input.type")?"input":e.isUserEvent("delete.backward")?"delete":null}class j{constructor(e,t,n=-1){this.source=e,this.state=t,this.explicitPos=n}hasResult(){return!1}update(e,t){let n=E(e),r=this;n?r=r.handleUserEvent(e,n,t):e.docChanged?r=r.handleChange(e):e.selection&&0!=r.state&&(r=new j(r.source,0));for(let t of e.effects)if(t.is(I))r=new j(r.source,1,t.value?h(e.state):-1);else if(t.is($))r=new j(r.source,0);else if(t.is(T))for(let e of t.value)e.source==r.source&&(r=e);return r}handleUserEvent(e,t,n){return"delete"!=t&&n.activateOnTyping?new j(this.source,1):this.map(e.changes)}handleChange(e){return e.changes.touchesRange(h(e.startState))?new j(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new j(this.source,this.state,e.mapPos(this.explicitPos))}}class M extends j{constructor(e,t,n,r,i){super(e,2,t),this.result=n,this.from=r,this.to=i}hasResult(){return!0}handleUserEvent(e,t,n){var r;let i=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=h(e.state);if((this.explicitPos<0?a<=i:ao||"delete"==t&&h(e.startState)==this.from)return new j(this.source,"input"==t&&n.activateOnTyping?1:0);let l,c=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return function(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return"function"==typeof e?e(i,n,r,t):u(e,!0).test(i)}(this.result.validFor,e.state,i,o)?new M(this.source,c,this.result,i,o):this.result.update&&(l=this.result.update(this.result,i,o,new s(e.state,a,c>=0)))?new M(this.source,c,l,l.from,null!==(r=l.to)&&void 0!==r?r:h(e.state)):new j(this.source,1,c)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new j(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new M(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}const I=r.StateEffect.define(),$=r.StateEffect.define(),T=r.StateEffect.define({map:(e,t)=>e.map((e=>e.map(t)))}),_=r.StateEffect.define(),P=r.StateField.define({create:()=>S.start(),update:(e,t)=>e.update(t),provide:e=>[i.showTooltip.from(e,(e=>e.tooltip)),i.EditorView.contentAttributes.from(e,(e=>e.attrs))]});function D(e,t="option"){return n=>{let r=n.state.field(P,!1);if(!r||!r.open||Date.now()-r.open.timestamp<75)return!1;let o,s=1;"page"==t&&(o=i.getTooltip(n,r.open.tooltip))&&(s=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:a}=r.open.options,l=r.open.selected>-1?r.open.selected+s*(e?1:-1):e?0:a-1;return l<0?l="page"==t?0:a-1:l>=a&&(l="page"==t?a-1:0),n.dispatch({effects:_.of(l)}),!0}}const R=e=>{let t=e.state.field(P,!1);return!(e.state.readOnly||!t||!t.open||Date.now()-t.open.timestamp<75||t.open.selected<0||(p(e,t.open.options[t.open.selected]),0))},N=e=>!!e.state.field(P,!1)&&(e.dispatch({effects:I.of(!0)}),!0),B=e=>{let t=e.state.field(P,!1);return!(!t||!t.active.some((e=>0!=e.state))||(e.dispatch({effects:$.of(null)}),0))};class L{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const F=i.ViewPlugin.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let t of e.state.field(P).active)1==t.state&&this.startQuery(t)}update(e){let t=e.state.field(P);if(!e.selectionSet&&!e.docChanged&&e.startState.field(P)==t)return;let n=e.transactions.some((e=>(e.selection||e.docChanged)&&!E(e)));for(let t=0;t50&&Date.now()-r.time>1e3){for(let e of r.context.abortListeners)try{e()}catch(e){i.logException(this.view.state,e)}r.context.abortListeners=null,this.running.splice(t--,1)}else r.updates.push(...e.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=t.active.some((e=>1==e.state&&!this.running.some((t=>t.active.source==e.source))))?setTimeout((()=>this.startUpdate()),50):-1,0!=this.composing)for(let t of e.transactions)"input"==E(t)?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:e}=this.view,t=e.field(P);for(let e of t.active)1!=e.state||this.running.some((t=>t.active.source==e.source))||this.startQuery(e)}startQuery(e){let{state:t}=this.view,n=h(t),r=new s(t,n,e.explicitPos==n),o=new L(e,r);this.running.push(o),Promise.resolve(e.source(r)).then((e=>{o.context.aborted||(o.done=e||null,this.scheduleAccept())}),(e=>{this.view.dispatch({effects:$.of(null)}),i.logException(this.view.state,e)}))}scheduleAccept(){this.running.every((e=>void 0!==e.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),50))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(y);for(let r=0;re.source==i.active.source));if(o&&1==o.state)if(null==i.done){let e=new j(i.active.source,0);for(let t of i.updates)e=e.update(t,n);1!=e.state&&t.push(e)}else this.startQuery(o)}t.length&&this.view.dispatch({effects:T.of(t)})}},{eventHandlers:{blur(){let e=this.view.state.field(P,!1);e&&e.tooltip&&this.view.state.facet(y).closeOnBlur&&this.view.dispatch({effects:$.of(null)})},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:I.of(!1)})),20),this.composing=0}}}),V=i.EditorView.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer",padding:"1px 3px",lineHeight:1.2}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"300px"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class z{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}}class q{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,r.MapMode.TrackDel),n=e.mapPos(this.to,1,r.MapMode.TrackDel);return null==t||null==n?null:new q(this.field,t,n)}}class H{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],r=[t],i=e.doc.lineAt(t),s=/^\s*/.exec(i.text)[0];for(let i of this.lines){if(n.length){let n=s,a=/^\t*/.exec(i)[0].length;for(let t=0;tnew q(e.field,r[e.line]+e.from,r[e.line]+e.to)));return{text:n,ranges:a}}static parse(e){let t,n=[],r=[],i=[];for(let o of e.split(/\r\n?|\n/)){for(;t=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(o);){let e=t[1]?+t[1]:null,s=t[2]||t[3]||"",a=-1;for(let t=0;t=a&&e.field++}i.push(new z(a,r.length,t.index,t.index+s.length)),o=o.slice(0,t.index)+s+o.slice(t.index+t[0].length)}for(let e;e=/([$#])\\{/.exec(o);){o=o.slice(0,e.index)+e[1]+"{"+o.slice(e.index+e[0].length);for(let t of i)t.line==r.length&&t.from>e.index&&(t.from--,t.to--)}r.push(o)}return new H(r,i)}}let W=i.Decoration.widget({widget:new class extends i.WidgetType{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),U=i.Decoration.mark({class:"cm-snippetField"});class J{constructor(e,t){this.ranges=e,this.active=t,this.deco=i.Decoration.set(e.map((e=>(e.from==e.to?W:U).range(e.from,e.to))))}map(e){let t=[];for(let n of this.ranges){let r=n.map(e);if(!r)return null;t.push(r)}return new J(t,this.active)}selectionInsideField(e){return e.ranges.every((e=>this.ranges.some((t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))))}}const K=r.StateEffect.define({map:(e,t)=>e&&e.map(t)}),G=r.StateEffect.define(),Q=r.StateField.define({create:()=>null,update(e,t){for(let n of t.effects){if(n.is(K))return n.value;if(n.is(G)&&e)return new J(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>i.EditorView.decorations.from(e,(e=>e?e.deco:i.Decoration.none))});function Z(e,t){return r.EditorSelection.create(e.filter((e=>e.field==t)).map((e=>r.EditorSelection.range(e.from,e.to))))}function Y(e){let t=H.parse(e);return(e,n,i,o)=>{let{text:s,ranges:a}=t.instantiate(e.state,i),l={changes:{from:i,to:o,insert:r.Text.of(s)},scrollIntoView:!0};if(a.length&&(l.selection=Z(a,0)),a.length>1){let t=new J(a,0),n=l.effects=[K.of(t)];void 0===e.state.field(Q,!1)&&n.push(r.StateEffect.appendConfig.of([Q,oe,se,V]))}e.dispatch(e.state.update(l))}}function X(e){return({state:t,dispatch:n})=>{let r=t.field(Q,!1);if(!r||e<0&&0==r.active)return!1;let i=r.active+e,o=e>0&&!r.ranges.some((t=>t.field==i+e));return n(t.update({selection:Z(r.ranges,i),effects:K.of(o?null:new J(r.ranges,i))})),!0}}const ee=({state:e,dispatch:t})=>!!e.field(Q,!1)&&(t(e.update({effects:K.of(null)})),!0),te=X(1),ne=X(-1),re=[{key:"Tab",run:te,shift:ne},{key:"Escape",run:ee}],ie=r.Facet.define({combine:e=>e.length?e[0]:re}),oe=r.Prec.highest(i.keymap.compute([ie],(e=>e.facet(ie)))),se=i.EditorView.domEventHandlers({mousedown(e,t){let n,r=t.state.field(Q,!1);if(!r||null==(n=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;let i=r.ranges.find((e=>e.from<=n&&e.to>=n));return!(!i||i.field==r.active||(t.dispatch({selection:Z(r.ranges,i.field),effects:K.of(r.ranges.some((e=>e.field>i.field))?new J(r.ranges,i.field):null)}),0))}});function ae(e,t){return new RegExp(t(e.source),e.unicode?"u":"")}const le=Object.create(null);function ce(e,t,n,r,i){for(let o=e.iterLines(),s=0;!o.next().done;){let e,{value:a}=o;for(t.lastIndex=0;e=t.exec(a);)if(!r[e[0]]&&s+e.index!=i&&(n.push({type:"text",label:e[0]}),r[e[0]]=!0,n.length>=2e3))return;s+=a.length+1}}function he(e,t,n,r,i){let o=e.length>=1e3,s=o&&t.get(e);if(s)return s;let a=[],l=Object.create(null);if(e.children){let o=0;for(let s of e.children){if(s.length>=1e3)for(let e of he(s,t,n,r-o,i-o))l[e.label]||(l[e.label]=!0,a.push(e));else ce(s,n,a,l,i-o);o+=s.length+1}}else ce(e,n,a,l,i);return o&&a.length<2e3&&t.set(e,a),a}const ue={brackets:["(","[","{","'",'"'],before:")]}:;>"},fe=r.StateEffect.define({map(e,t){let n=t.mapPos(e,-1,r.MapMode.TrackAfter);return null==n?void 0:n}}),de=r.StateEffect.define({map:(e,t)=>t.mapPos(e)}),pe=new class extends r.RangeValue{};pe.startSide=1,pe.endSide=-1;const me=r.StateField.define({create:()=>r.RangeSet.empty,update(e,t){if(t.selection){let n=t.state.doc.lineAt(t.selection.main.head).from,i=t.startState.doc.lineAt(t.startState.selection.main.head).from;n!=t.changes.mapPos(i,-1)&&(e=r.RangeSet.empty)}e=e.map(t.changes);for(let n of t.effects)n.is(fe)?e=e.update({add:[pe.range(n.value,n.value+1)]}):n.is(de)&&(e=e.update({filter:e=>e!=n.value}));return e}}),ge="()[]{}<>";function ve(e){for(let t=0;t{if((be?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let o=e.state.selection.main;if(i.length>2||2==i.length&&1==r.codePointSize(r.codePointAt(i,0))||t!=o.from||n!=o.to)return!1;let s=Se(e.state,i);return!!s&&(e.dispatch(s),!0)})),xe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=ye(e,e.selection.main.head).brackets||ue.brackets,i=null,o=e.changeByRange((t=>{if(t.empty){let i=function(e,t){let n=e.sliceString(t-2,t);return r.codePointSize(r.codePointAt(n,0))==n.length?n:n.slice(1)}(e.doc,t.head);for(let o of n)if(o==i&&Ce(e.doc,t.head)==ve(r.codePointAt(o,0)))return{changes:{from:t.head-o.length,to:t.head+o.length},range:r.EditorSelection.cursor(t.head-o.length),userEvent:"delete.backward"}}return{range:i=t}}));return i||t(e.update(o,{scrollIntoView:!0})),!i},ke=[{key:"Backspace",run:xe}];function Se(e,t){let n=ye(e,e.selection.main.head),i=n.brackets||ue.brackets;for(let o of i){let s=ve(r.codePointAt(o,0));if(t==o)return s==o?je(e,o,i.indexOf(o+o+o)>-1):Oe(e,o,s,n.before||ue.before);if(t==s&&Ae(e,e.selection.main.from))return Ee(e,0,s)}return null}function Ae(e,t){let n=!1;return e.field(me).between(0,e.doc.length,(e=>{e==t&&(n=!0)})),n}function Ce(e,t){let n=e.sliceString(t,t+2);return n.slice(0,r.codePointSize(r.codePointAt(n,0)))}function Oe(e,t,n,i){let o=null,s=e.changeByRange((s=>{if(!s.empty)return{changes:[{insert:t,from:s.from},{insert:n,from:s.to}],effects:fe.of(s.to+t.length),range:r.EditorSelection.range(s.anchor+t.length,s.head+t.length)};let a=Ce(e.doc,s.head);return!a||/\s/.test(a)||i.indexOf(a)>-1?{changes:{insert:t+n,from:s.head},effects:fe.of(s.head+t.length),range:r.EditorSelection.cursor(s.head+t.length)}:{range:o=s}}));return o?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Ee(e,t,n){let i=null,o=e.selection.ranges.map((t=>t.empty&&Ce(e.doc,t.head)==n?r.EditorSelection.cursor(t.head+n.length):i=t));return i?null:e.update({selection:r.EditorSelection.create(o,e.selection.mainIndex),scrollIntoView:!0,effects:e.selection.ranges.map((({from:e})=>de.of(e)))})}function je(e,t,n){let i=null,s=e.changeByRange((s=>{if(!s.empty)return{changes:[{insert:t,from:s.from},{insert:t,from:s.to}],effects:fe.of(s.to+t.length),range:r.EditorSelection.range(s.anchor+t.length,s.head+t.length)};let a=s.head,l=Ce(e.doc,a);if(l==t){if(Me(e,a))return{changes:{insert:t+t,from:a},effects:fe.of(a+t.length),range:r.EditorSelection.cursor(a+t.length)};if(Ae(e,a)){let i=n&&e.sliceDoc(a,a+3*t.length)==t+t+t;return{range:r.EditorSelection.cursor(a+t.length*(i?3:1)),effects:de.of(a)}}}else{if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&Me(e,a-2*t.length))return{changes:{insert:t+t+t+t,from:a},effects:fe.of(a+t.length),range:r.EditorSelection.cursor(a+t.length)};if(e.charCategorizer(a)(l)!=r.CharCategory.Word){let n=e.sliceDoc(a-1,a);if(n!=t&&e.charCategorizer(a)(n)!=r.CharCategory.Word&&!function(e,t,n){let r=o.syntaxTree(e).resolveInner(t,-1);for(let i=0;i<5;i++){if(e.sliceDoc(r.from,r.from+n.length)==n){let t=r.firstChild;for(;t&&t.from==r.from&&t.to-t.from>n.length;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let i=r.to==t&&r.parent;if(!i)break;r=i}return!1}(e,a,t))return{changes:{insert:t+t,from:a},effects:fe.of(a+t.length),range:r.EditorSelection.cursor(a+t.length)}}}return{range:i=s}}));return i?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Me(e,t){let n=o.syntaxTree(e).resolveInner(t+1);return n.parent&&n.from==t}const Ie=[{key:"Ctrl-Space",run:N},{key:"Escape",run:B},{key:"ArrowDown",run:D(!0)},{key:"ArrowUp",run:D(!1)},{key:"PageDown",run:D(!0,"page")},{key:"PageUp",run:D(!1,"page")},{key:"Enter",run:R}],$e=r.Prec.highest(i.keymap.computeN([y],(e=>e.facet(y).defaultKeymap?[Ie]:[]))),Te=new WeakMap;t.CompletionContext=s,t.acceptCompletion=R,t.autocompletion=function(e={}){return[P,y.of(e),F,$e,V]},t.clearSnippet=ee,t.closeBrackets=function(){return[we,me]},t.closeBracketsKeymap=ke,t.closeCompletion=B,t.completeAnyWord=e=>{let t=e.state.languageDataAt("wordChars",e.pos).join(""),n=function(e){let t=e.replace(/[\\[.+*?(){|^$]/g,"\\$&");try{return new RegExp(`[\\p{Alphabetic}\\p{Number}_${t}]+`,"ug")}catch(e){return new RegExp(`[w${t}]`,"g")}}(t),r=e.matchBefore(ae(n,(e=>e+"$")));if(!r&&!e.explicit)return null;let i=r?r.from:e.pos,o=he(e.state.doc,function(e){return le[e]||(le[e]=new WeakMap)}(t),n,5e4,i);return{from:i,options:o,validFor:ae(n,(e=>"^"+e))}},t.completeFromList=l,t.completionKeymap=Ie,t.completionStatus=function(e){let t=e.field(P,!1);return t&&t.active.some((e=>1==e.state))?"pending":t&&t.active.some((e=>0!=e.state))?"active":null},t.currentCompletions=function(e){var t;let n=null===(t=e.field(P,!1))||void 0===t?void 0:t.open;if(!n)return[];let r=Te.get(n.options);return r||Te.set(n.options,r=n.options.map((e=>e.completion))),r},t.deleteBracketPair=xe,t.ifIn=function(e,t){return n=>{for(let r=o.syntaxTree(n.state).resolveInner(n.pos,-1);r;r=r.parent)if(e.indexOf(r.name)>-1)return t(n);return null}},t.ifNotIn=function(e,t){return n=>{for(let t=o.syntaxTree(n.state).resolveInner(n.pos,-1);t;t=t.parent)if(e.indexOf(t.name)>-1)return null;return t(n)}},t.insertBracket=Se,t.insertCompletionText=d,t.moveCompletionSelection=D,t.nextSnippetField=te,t.pickedCompletion=f,t.prevSnippetField=ne,t.selectedCompletion=function(e){var t;let n=null===(t=e.field(P,!1))||void 0===t?void 0:t.open;return n&&n.selected>=0?n.options[n.selected].completion:null},t.selectedCompletionIndex=function(e){var t;let n=null===(t=e.field(P,!1))||void 0===t?void 0:t.open;return n&&n.selected>=0?n.selected:null},t.setSelectedCompletion=function(e){return _.of(e)},t.snippet=Y,t.snippetCompletion=function(e,t){return Object.assign(Object.assign({},t),{apply:Y(e)})},t.snippetKeymap=ie,t.startCompletion=N},8561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7040),i=n(3642),o=n(729),s=n(7897);const a=e=>{let t=g(e.state);return t.line?c(e):!!t.block&&m(e)};function l(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return!!i&&(r(n.update(i)),!0)}}const c=l(b,0),h=l(b,1),u=l(b,2),f=l(y,0),d=l(y,1),p=l(y,2),m=l(((e,t)=>y(e,t,function(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to),o=t.length-1;o>=0&&t[o].to>r.from?t[o].to=i.to:t.push({from:r.from,to:i.to})}return t}(t))),0);function g(e,t=e.selection.main.head){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}const v=50;function y(e,t,n=t.selection.ranges){let r=n.map((e=>g(t,e.from).block));if(!r.every((e=>e)))return null;let i=n.map(((e,n)=>function(e,{open:t,close:n},r,i){let o,s,a=e.sliceDoc(r-v,r),l=e.sliceDoc(i,i+v),c=/\s*$/.exec(a)[0].length,h=/^\s*/.exec(l)[0].length,u=a.length-c;if(a.slice(u-t.length,u)==t&&l.slice(h,h+n.length)==n)return{open:{pos:r-c,margin:c&&1},close:{pos:i+h,margin:h&&1}};i-r<=2*v?o=s=e.sliceDoc(r,i):(o=e.sliceDoc(r,r+v),s=e.sliceDoc(i-v,i));let f=/^\s*/.exec(o)[0].length,d=/\s*$/.exec(s)[0].length,p=s.length-d-n.length;return o.slice(f,f+t.length)==t&&s.slice(p,p+n.length)==n?{open:{pos:r+f+t.length,margin:/\s/.test(o.charAt(f+t.length))?1:0},close:{pos:i-d-n.length,margin:/\s/.test(s.charAt(p-1))?1:0}}:null}(t,r[n],e.from,e.to)));if(2!=e&&!i.every((e=>e)))return{changes:t.changes(n.map(((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+" "},{from:e.to,insert:" "+r[t].close}])))};if(1!=e&&i.some((e=>e))){let e=[];for(let t,n=0;ni&&(e==o||o>a.from)){i=a.from;let e=g(t,n).line;if(!e)continue;let o=/^\s*/.exec(a.text)[0].length,l=o==a.length,c=a.text.slice(o,o+e.length)==e?o:-1;oe.comment<0&&(!e.empty||e.single)))){let e=[];for(let{line:t,token:n,indent:i,empty:o,single:s}of r)!s&&o||e.push({from:t.from+i,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&r.some((e=>e.comment>=0))){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,o=r+i.length;" "==t.text[o-t.from]&&o++,e.push({from:r,to:o})}return{changes:e}}return null}const w=r.Annotation.define(),x=r.Annotation.define(),k=r.Facet.define(),S=r.Facet.define({combine:e=>r.combineConfig(e,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min})}),A=r.StateField.define({create:()=>H.empty,update(e,t){let n=t.state.facet(S),i=t.annotation(w);if(i){let o=t.docChanged?r.EditorSelection.single(function(e){let t=0;return e.iterChangedRanges(((e,n)=>t=n)),t}(t.changes)):void 0,s=P.fromTransaction(t,o),a=i.side,l=0==a?e.undone:e.done;return l=s?D(l,l.length,n.minDepth,s):L(l,t.startState.selection),new H(0==a?i.rest:l,0==a?l:i.rest)}let o=t.annotation(x);if("full"!=o&&"before"!=o||(e=e.isolate()),!1===t.annotation(r.Transaction.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let s=P.fromTransaction(t),a=t.annotation(r.Transaction.time),l=t.annotation(r.Transaction.userEvent);return s?e=e.addChanges(s,a,l,n.newGroupDelay,n.minDepth):t.selection&&(e=e.addSelection(t.startState.selection,a,l,n.newGroupDelay)),"full"!=o&&"after"!=o||(e=e.isolate()),e},toJSON:e=>({done:e.done.map((e=>e.toJSON())),undone:e.undone.map((e=>e.toJSON()))}),fromJSON:e=>new H(e.done.map(P.fromJSON),e.undone.map(P.fromJSON))}),C=A;function O(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(A,!1);if(!i)return!1;let o=i.pop(e,n,t);return!!o&&(r(o),!0)}}const E=O(0,!1),j=O(1,!1),M=O(0,!0),I=O(1,!0);function $(e){return function(t){let n=t.field(A,!1);if(!n)return 0;let r=0==e?n.done:n.undone;return r.length-(r.length&&!r[0].changes?1:0)}}const T=$(0),_=$(1);class P{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(e){return new P(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map((e=>e.toJSON()))}}static fromJSON(e){return new P(e.changes&&r.ChangeSet.fromJSON(e.changes),[],e.mapped&&r.ChangeDesc.fromJSON(e.mapped),e.startSelection&&r.EditorSelection.fromJSON(e.startSelection),e.selectionsAfter.map(r.EditorSelection.fromJSON))}static fromTransaction(e,t){let n=N;for(let t of e.startState.facet(k)){let r=t(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new P(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,N)}static selection(e){return new P(void 0,N,void 0,void 0,e)}}function D(e,t,n,r){let i=t+1>n+20?t-n-1:0,o=e.slice(i,t);return o.push(r),o}function R(e,t){return e.length?t.length?e.concat(t):e:t}const N=[],B=200;function L(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-B));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),D(e,e.length-1,1e9,n.setSelAfter(r)))}return[P.selection([t])]}function F(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function V(e,t){if(!e.length)return e;let n=e.length,r=N;for(;n;){let i=z(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[P.selection(r)]:N}function z(e,t,n){let i=R(e.selectionsAfter.length?e.selectionsAfter.map((e=>e.map(t))):N,n);if(!e.changes)return P.selection(i);let o=e.changes.map(t),s=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(s):s;return new P(o,r.StateEffect.mapEffects(e.effects,t),a,e.startSelection.map(s),i)}const q=/^(input\.type|delete)($|\.)/;class H{constructor(e,t,n=0,r=undefined){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new H(this.done,this.undone):this}addChanges(e,t,n,r,i){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&e.changes&&(!n||q.test(n))&&(!s.selectionsAfter.length&&t-this.prevTimen.push(e,t))),t.iterChangedRanges(((e,t,i,o)=>{for(let e=0;e=t&&i<=s&&(r=!0)}})),r}(s.changes,e.changes)||"input.type.compose"==n)?D(o,o.length-1,i,new P(e.changes.compose(s.changes),R(e.effects,s.effects),s.mapped,s.startSelection,N)):D(o,o.length,i,e),new H(o,N,t,n)}addSelection(e,t,n,r){let i=this.done.length?this.done[this.done.length-1].selectionsAfter:N;return i.length>0&&t-this.prevTimee.empty!=s.ranges[t].empty)).length)?this:new H(L(this.done,e),this.undone,t,n);var o,s}addMapping(e){return new H(V(this.done,e),V(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=0==e?this.done:this.undone;if(0==r.length)return null;let i=r[r.length-1];if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:w.of({side:e,rest:F(r)}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(i.changes){let n=1==r.length?N:r.slice(0,r.length-1);return i.mapped&&(n=V(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:w.of({side:e,rest:n}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}H.empty=new H(N,N);const W=[{key:"Mod-z",run:E,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:j,preventDefault:!0},{linux:"Ctrl-Shift-z",run:j,preventDefault:!0},{key:"Mod-u",run:M,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:I,preventDefault:!0}];function U(e,t){return r.EditorSelection.create(e.ranges.map(t),e.mainIndex)}function J(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function K({state:e,dispatch:t},n){let r=U(e.selection,n);return!r.eq(e.selection)&&(t(J(e,r)),!0)}function G(e,t){return r.EditorSelection.cursor(t?e.to:e.from)}function Q(e,t){return K(e,(n=>n.empty?e.moveByChar(n,t):G(n,t)))}function Z(e){return e.textDirectionAt(e.state.selection.main.head)==i.Direction.LTR}const Y=e=>Q(e,!Z(e)),X=e=>Q(e,Z(e));function ee(e,t){return K(e,(n=>n.empty?e.moveByGroup(n,t):G(n,t)))}const te=e=>ee(e,!Z(e)),ne=e=>ee(e,Z(e));function re(e,t,n){let i=e.state.charCategorizer(t.from);return e.moveByChar(t,n,(o=>{let s=r.CharCategory.Space,a=t.from,l=!1,c=!1,h=!1,u=t=>{if(l)return!1;a+=n?t.length:-t.length;let o,u=i(t);if(s==r.CharCategory.Space&&(s=u),s!=u)return!1;if(s==r.CharCategory.Word)if(t.toLowerCase()==t){if(!n&&c)return!1;h=!0}else if(h){if(n)return!1;l=!0}else{if(c&&n&&i(o=e.state.sliceDoc(a,a+1))==r.CharCategory.Word&&o.toLowerCase()==o)return!1;c=!0}return!0};return u(o),u}))}function ie(e,t){return K(e,(n=>n.empty?re(e,n,t):G(n,t)))}function oe(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function se(e,t,n){let i,a,l=o.syntaxTree(e).resolveInner(t.head),c=n?s.NodeProp.closedBy:s.NodeProp.openedBy;for(let r=t.head;;){let t=n?l.childAfter(r):l.childBefore(r);if(!t)break;oe(e,t,c)?l=t:r=n?t.to:t.from}return a=l.type.prop(c)&&(i=n?o.matchBrackets(e,l.from,1):o.matchBrackets(e,l.to,-1))&&i.matched?n?i.end.to:i.end.from:n?l.to:l.from,r.EditorSelection.cursor(a,n?-1:1)}const ae=e=>K(e,(t=>se(e.state,t,!Z(e)))),le=e=>K(e,(t=>se(e.state,t,Z(e))));function ce(e,t){return K(e,(n=>{if(!n.empty)return G(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)}))}const he=e=>ce(e,!1),ue=e=>ce(e,!0);function fe(e){return Math.max(e.defaultLineHeight,Math.min(e.dom.clientHeight,innerHeight)-5)}function de(e,t){let{state:n}=e,r=U(n.selection,(n=>n.empty?e.moveVertically(n,t,fe(e)):G(n,t)));if(r.eq(n.selection))return!1;let o,s=e.coordsAtPos(n.selection.main.head),a=e.scrollDOM.getBoundingClientRect();return s&&s.top>a.top&&s.bottomde(e,!1),me=e=>de(e,!0);function ge(e,t,n){let i=e.lineBlockAt(t.head),o=e.moveToLineBoundary(t,n);if(o.head==t.head&&o.head!=(n?i.to:i.from)&&(o=e.moveToLineBoundary(t,n,!1)),!n&&o.head==i.from&&i.length){let n=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;n&&t.head!=i.from+n&&(o=r.EditorSelection.cursor(i.from+n))}return o}const ve=e=>K(e,(t=>ge(e,t,!0))),ye=e=>K(e,(t=>ge(e,t,!1))),be=e=>K(e,(t=>r.EditorSelection.cursor(e.lineBlockAt(t.head).from,1))),we=e=>K(e,(t=>r.EditorSelection.cursor(e.lineBlockAt(t.head).to,-1)));function xe(e,t,n){let i=!1,s=U(e.selection,(t=>{let s=o.matchBrackets(e,t.head,-1)||o.matchBrackets(e,t.head,1)||t.head>0&&o.matchBrackets(e,t.head-1,1)||t.headxe(e,t,!1);function Se(e,t){let n=U(e.state.selection,(e=>{let n=t(e);return r.EditorSelection.range(e.anchor,n.head,n.goalColumn)}));return!n.eq(e.state.selection)&&(e.dispatch(J(e.state,n)),!0)}function Ae(e,t){return Se(e,(n=>e.moveByChar(n,t)))}const Ce=e=>Ae(e,!Z(e)),Oe=e=>Ae(e,Z(e));function Ee(e,t){return Se(e,(n=>e.moveByGroup(n,t)))}const je=e=>Ee(e,!Z(e)),Me=e=>Ee(e,Z(e));function Ie(e,t){return Se(e,(n=>re(e,n,t)))}const $e=e=>Se(e,(t=>se(e.state,t,!Z(e)))),Te=e=>Se(e,(t=>se(e.state,t,Z(e))));function _e(e,t){return Se(e,(n=>e.moveVertically(n,t)))}const Pe=e=>_e(e,!1),De=e=>_e(e,!0);function Re(e,t){return Se(e,(n=>e.moveVertically(n,t,fe(e))))}const Ne=e=>Re(e,!1),Be=e=>Re(e,!0),Le=e=>Se(e,(t=>ge(e,t,!0))),Fe=e=>Se(e,(t=>ge(e,t,!1))),Ve=e=>Se(e,(t=>r.EditorSelection.cursor(e.lineBlockAt(t.head).from))),ze=e=>Se(e,(t=>r.EditorSelection.cursor(e.lineBlockAt(t.head).to))),qe=({state:e,dispatch:t})=>(t(J(e,{anchor:0})),!0),He=({state:e,dispatch:t})=>(t(J(e,{anchor:e.doc.length})),!0),We=({state:e,dispatch:t})=>(t(J(e,{anchor:e.selection.main.anchor,head:0})),!0),Ue=({state:e,dispatch:t})=>(t(J(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Je=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Ke=({state:e,dispatch:t})=>{let n=ct(e).map((({from:t,to:n})=>r.EditorSelection.range(t,Math.min(n+1,e.doc.length))));return t(e.update({selection:r.EditorSelection.create(n),userEvent:"select"})),!0},Ge=({state:e,dispatch:t})=>{let n=U(e.selection,(t=>{var n;let i=o.syntaxTree(e).resolveInner(t.head,1);for(;!(i.from=t.to||i.to>t.to&&i.from<=t.from)&&(null===(n=i.parent)||void 0===n?void 0:n.parent);)i=i.parent;return r.EditorSelection.range(i.to,i.from)}));return t(J(e,n)),!0},Qe=({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=r.EditorSelection.create([n.main]):n.main.empty||(i=r.EditorSelection.create([r.EditorSelection.cursor(n.main.head)])),!!i&&(t(J(e,i)),!0)};function Ze({state:e,dispatch:t},n){if(e.readOnly)return!1;let o="delete.selection",s=e.changeByRange((e=>{let{from:t,to:i}=e;if(t==i){let e=n(t);et&&(o="delete.forward"),t=Math.min(t,e),i=Math.max(i,e)}return t==i?{range:e}:{changes:{from:t,to:i},range:r.EditorSelection.cursor(t)}}));return!s.changes.empty&&(t(e.update(s,{scrollIntoView:!0,userEvent:o,effects:"delete.selection"==o?i.EditorView.announce.of(e.phrase("Selection deleted")):void 0})),!0)}function Ye(e,t,n){if(e instanceof i.EditorView)for(let r of e.state.facet(i.EditorView.atomicRanges).map((t=>t(e))))r.between(t,t,((e,r)=>{et&&(t=n?r:e)}));return t}const Xe=(e,t)=>Ze(e,(n=>{let i,s,{state:a}=e,l=a.doc.lineAt(n);if(!t&&n>l.from&&nXe(e,!1),tt=e=>Xe(e,!0),nt=(e,t)=>Ze(e,(n=>{let i=n,{state:o}=e,s=o.doc.lineAt(i),a=o.charCategorizer(i);for(let e=null;;){if(i==(t?s.to:s.from)){i==n&&s.number!=(t?o.doc.lines:1)&&(i+=t?1:-1);break}let l=r.findClusterBreak(s.text,i-s.from,t)+s.from,c=s.text.slice(Math.min(i,l)-s.from,Math.max(i,l)-s.from),h=a(c);if(null!=e&&h!=e)break;" "==c&&i==n||(e=h),i=l}return Ye(e,i,t)})),rt=e=>nt(e,!1),it=e=>nt(e,!0),ot=e=>Ze(e,(t=>{let n=e.lineBlockAt(t).to;return Ye(e,tZe(e,(t=>{let n=e.lineBlockAt(t).from;return Ye(e,t>n?n:Math.max(0,t-1),!1)})),at=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:r.Text.of(["",""])},range:r.EditorSelection.cursor(e.from)})));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},lt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange((t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,i=e.doc.lineAt(n),o=n==i.from?n-1:r.findClusterBreak(i.text,n-i.from,!1)+i.from,s=n==i.to?n+1:r.findClusterBreak(i.text,n-i.from,!0)+i.from;return{changes:{from:o,to:s,insert:e.doc.slice(n,s).append(e.doc.slice(o,n))},range:r.EditorSelection.cursor(s)}}));return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function ct(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),o=e.doc.lineAt(r.to);if(r.empty||r.to!=o.from||(o=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=o.to,e.ranges.push(r)}else t.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return t}function ht(e,t,n){if(e.readOnly)return!1;let i=[],o=[];for(let t of ct(e)){if(n?t.to==e.doc.length:0==t.from)continue;let s=e.doc.lineAt(n?t.to+1:t.from-1),a=s.length+1;if(n){i.push({from:t.to,to:s.to},{from:t.from,insert:s.text+e.lineBreak});for(let n of t.ranges)o.push(r.EditorSelection.range(Math.min(e.doc.length,n.anchor+a),Math.min(e.doc.length,n.head+a)))}else{i.push({from:s.from,to:t.from},{from:t.to,insert:e.lineBreak+s.text});for(let e of t.ranges)o.push(r.EditorSelection.range(e.anchor-a,e.head-a))}}return!!i.length&&(t(e.update({changes:i,scrollIntoView:!0,selection:r.EditorSelection.create(o,e.selection.mainIndex),userEvent:"move.line"})),!0)}const ut=({state:e,dispatch:t})=>ht(e,t,!1),ft=({state:e,dispatch:t})=>ht(e,t,!0);function dt(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of ct(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});return t(e.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const pt=({state:e,dispatch:t})=>dt(e,t,!1),mt=({state:e,dispatch:t})=>dt(e,t,!0),gt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(ct(t).map((({from:e,to:n})=>(e>0?e--:ne.moveVertically(t,!0))).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0},vt=bt(!1),yt=bt(!0);function bt(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange((n=>{let{from:i,to:a}=n,l=t.doc.lineAt(i),c=!e&&i==a&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n,r=o.syntaxTree(e).resolveInner(t),i=r.childBefore(t),a=r.childAfter(t);return i&&a&&i.to<=t&&a.from>=t&&(n=i.type.prop(s.NodeProp.closedBy))&&n.indexOf(a.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(a.from).from?{from:i.to,to:a.from}:null}(t,i);e&&(i=a=(a<=l.to?l:t.doc.lineAt(a)).to);let h=new o.IndentContext(t,{simulateBreak:i,simulateDoubleBreak:!!c}),u=o.getIndentation(h,i);for(null==u&&(u=/^\s*/.exec(t.doc.lineAt(i).text)[0].length);al.from&&i{let o=[];for(let r=i.from;r<=i.to;){let s=e.doc.lineAt(r);s.number>n&&(i.empty||i.to>s.from)&&(t(s,o,i),n=s.number),r=s.to+1}let s=e.changes(o);return{changes:o,range:r.EditorSelection.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}}))}const xt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new o.IndentContext(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),i=wt(e,((t,i,s)=>{let a=o.getIndentation(r,t.from);if(null==a)return;/\S/.test(t.text)||(a=0);let l=/^\s*/.exec(t.text)[0],c=o.indentString(e,a);(l!=c||s.from!e.readOnly&&(t(e.update(wt(e,((t,n)=>{n.push({from:t.from,insert:e.facet(o.indentUnit)})})),{userEvent:"input.indent"})),!0),St=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(wt(e,((t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let s=r.countColumn(i,e.tabSize),a=0,l=o.indentString(e,Math.max(0,s-o.getIndentUnit(e)));for(;a({mac:e.key,run:e.run,shift:e.shift})))),Ot=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:ae,shift:$e},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:le,shift:Te},{key:"Alt-ArrowUp",run:ut},{key:"Shift-Alt-ArrowUp",run:pt},{key:"Alt-ArrowDown",run:ft},{key:"Shift-Alt-ArrowDown",run:mt},{key:"Escape",run:Qe},{key:"Mod-Enter",run:yt},{key:"Alt-l",mac:"Ctrl-l",run:Ke},{key:"Mod-i",run:Ge,preventDefault:!0},{key:"Mod-[",run:St},{key:"Mod-]",run:kt},{key:"Mod-Alt-\\",run:xt},{key:"Shift-Mod-k",run:gt},{key:"Shift-Mod-\\",run:ke},{key:"Mod-/",run:a},{key:"Alt-A",run:f}].concat(Ct),Et={key:"Tab",run:kt,shift:St};t.blockComment=d,t.blockUncomment=p,t.copyLineDown=mt,t.copyLineUp=pt,t.cursorCharBackward=e=>Q(e,!1),t.cursorCharForward=e=>Q(e,!0),t.cursorCharLeft=Y,t.cursorCharRight=X,t.cursorDocEnd=He,t.cursorDocStart=qe,t.cursorGroupBackward=e=>ee(e,!1),t.cursorGroupForward=e=>ee(e,!0),t.cursorGroupLeft=te,t.cursorGroupRight=ne,t.cursorLineBoundaryBackward=ye,t.cursorLineBoundaryForward=ve,t.cursorLineDown=ue,t.cursorLineEnd=we,t.cursorLineStart=be,t.cursorLineUp=he,t.cursorMatchingBracket=ke,t.cursorPageDown=me,t.cursorPageUp=pe,t.cursorSubwordBackward=e=>ie(e,!1),t.cursorSubwordForward=e=>ie(e,!0),t.cursorSyntaxLeft=ae,t.cursorSyntaxRight=le,t.defaultKeymap=Ot,t.deleteCharBackward=et,t.deleteCharForward=tt,t.deleteGroupBackward=rt,t.deleteGroupForward=it,t.deleteLine=gt,t.deleteToLineEnd=ot,t.deleteToLineStart=st,t.deleteTrailingWhitespace=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=[];for(let t=0,r="",i=e.doc.iter();;){if(i.next(),i.lineBreak||i.done){let e=r.search(/\s+$/);if(e>-1&&n.push({from:t-(r.length-e),to:t}),i.done)break;r=""}else r=i.value;t+=i.value.length}return!!n.length&&(t(e.update({changes:n,userEvent:"delete"})),!0)},t.emacsStyleKeymap=At,t.history=function(e={}){return[A,S.of(e),i.EditorView.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?E:"historyRedo"==e.inputType?j:null;return!!n&&(e.preventDefault(),n(t))}})]},t.historyField=C,t.historyKeymap=W,t.indentLess=St,t.indentMore=kt,t.indentSelection=xt,t.indentWithTab=Et,t.insertBlankLine=yt,t.insertNewline=({state:e,dispatch:t})=>(t(e.update(e.replaceSelection(e.lineBreak),{scrollIntoView:!0,userEvent:"input"})),!0),t.insertNewlineAndIndent=vt,t.insertTab=({state:e,dispatch:t})=>e.selection.ranges.some((e=>!e.empty))?kt({state:e,dispatch:t}):(t(e.update(e.replaceSelection("\t"),{scrollIntoView:!0,userEvent:"input"})),!0),t.invertedEffects=k,t.isolateHistory=x,t.lineComment=h,t.lineUncomment=u,t.moveLineDown=ft,t.moveLineUp=ut,t.redo=j,t.redoDepth=_,t.redoSelection=I,t.selectAll=Je,t.selectCharBackward=e=>Ae(e,!1),t.selectCharForward=e=>Ae(e,!0),t.selectCharLeft=Ce,t.selectCharRight=Oe,t.selectDocEnd=Ue,t.selectDocStart=We,t.selectGroupBackward=e=>Ee(e,!1),t.selectGroupForward=e=>Ee(e,!0),t.selectGroupLeft=je,t.selectGroupRight=Me,t.selectLine=Ke,t.selectLineBoundaryBackward=Fe,t.selectLineBoundaryForward=Le,t.selectLineDown=De,t.selectLineEnd=ze,t.selectLineStart=Ve,t.selectLineUp=Pe,t.selectMatchingBracket=({state:e,dispatch:t})=>xe(e,t,!0),t.selectPageDown=Be,t.selectPageUp=Ne,t.selectParentSyntax=Ge,t.selectSubwordBackward=e=>Ie(e,!1),t.selectSubwordForward=e=>Ie(e,!0),t.selectSyntaxLeft=$e,t.selectSyntaxRight=Te,t.simplifySelection=Qe,t.splitLine=at,t.standardKeymap=Ct,t.toggleBlockComment=f,t.toggleBlockCommentByLine=m,t.toggleComment=a,t.toggleLineComment=c,t.transposeChars=lt,t.undo=E,t.undoDepth=T,t.undoSelection=M},1184:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9922),i=n(729);const o=i.LRLanguage.define({name:"json",parser:r.parser.configure({props:[i.indentNodeProp.add({Object:i.continuedIndent({except:/^\s*\}/}),Array:i.continuedIndent({except:/^\s*\]/})}),i.foldNodeProp.add({"Object Array":i.foldInside})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});t.json=function(){return new i.LanguageSupport(o)},t.jsonLanguage=o,t.jsonParseLinter=()=>e=>{try{JSON.parse(e.state.doc.toString())}catch(t){if(!(t instanceof SyntaxError))throw t;const n=function(e,t){let n;return(n=e.message.match(/at position (\d+)/))?Math.min(+n[1],t.length):(n=e.message.match(/at line (\d+) column (\d+)/))?Math.min(t.line(+n[1]).from+ +n[2]-1,t.length):0}(t,e.state.doc);return[{from:n,message:t.message,severity:"error",to:n}]}return[]}},729:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(7897),o=n(7040),s=n(3642),a=n(5048),l=n(7223);const c=new i.NodeProp;function h(e){return o.Facet.define({combine:e?t=>t.concat(e):void 0})}class u{constructor(e,t,n=[]){this.data=e,o.EditorState.prototype.hasOwnProperty("tree")||Object.defineProperty(o.EditorState.prototype,"tree",{get(){return p(this)}}),this.parser=t,this.extension=[A.of(this),o.EditorState.languageData.of(((e,t,n)=>e.facet(f(e,t,n))))].concat(n)}isActiveAt(e,t,n=-1){return f(e,t,n)==this.data}findRegions(e){let t=e.facet(A);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(c)==this.data)return void n.push({from:t,to:t+e.length});let o=e.prop(i.NodeProp.mounted);if(o){if(o.tree.prop(c)==this.data){if(o.overlay)for(let e of o.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(o.overlay){let e=n.length;if(r(o.tree,o.overlay[0].from+t),n.length>e)return}}for(let n=0;ne.isTop?t:void 0))]}))}configure(e){return new d(this.data,this.parser.configure(e))}get allowsNesting(){return this.parser.hasWrappers()}}function p(e){let t=e.field(u.state,!1);return t?t.tree:i.Tree.empty}function m(e,t,n=50){var r;let i=null===(r=e.field(u.state,!1))||void 0===r?void 0:r.context;return i&&(i.isDone(t)||i.work(n,t))?i.tree:null}class g{constructor(e,t=e.length){this.doc=e,this.length=t,this.cursorPos=0,this.string="",this.cursor=e.iter()}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let v=null;class y{constructor(e,t,n=[],r,i,o,s,a){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=o,this.skipped=s,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new y(e,t,[],i.Tree.empty,0,n,[],null)}startParse(){return this.parser.startParse(new g(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=i.Tree.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext((()=>{for(;!(t=this.parse.advance()););})),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(i.TreeFragment.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=v;v=this;try{return e()}finally{v=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=b(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:o,viewport:s,skipped:a}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges(((e,n,r,i)=>t.push({fromA:e,toA:n,fromB:r,toB:i}))),n=i.TreeFragment.applyChanges(n,t),r=i.Tree.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){a=[];for(let t of this.skipped){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);ne.from&&(this.fragments=b(this.fragments,n,r),this.skipped.splice(t--,1))}return!(this.skipped.length>=t||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends i.Parser{createParse(t,n,r){let o=r[0].from,s=r[r.length-1].to;return{parsedPos:o,advance(){let t=v;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=s,new i.Tree(i.NodeType.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return v}}function b(e,t,n){return i.TreeFragment.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class w{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new w(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=y.create(e.facet(A).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new w(n)}}u.state=o.StateField.define({create:w.init,update(e,t){for(let e of t.effects)if(e.is(u.setState))return e.value;return t.startState.facet(A)!=t.state.facet(A)?w.init(t.state):e.apply(t)}});let x=e=>{let t=setTimeout((()=>e()),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(x=e=>{let t=-1,n=setTimeout((()=>{t=requestIdleCallback(e,{timeout:400})}),100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const k="undefined"!=typeof navigator&&(null===(r=navigator.scheduling)||void 0===r?void 0:r.isInputPending)?()=>navigator.scheduling.isInputPending():null,S=s.ViewPlugin.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(u.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(u.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=x(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndr+1e3,a=i.context.work((()=>k&&k()||Date.now()>o),r+(s?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:u.setState.of(new w(i.context))})),this.chunkBudget>0&&(!a||s)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then((()=>this.scheduleWork())).catch((e=>s.logException(this.view.state,e))).then((()=>this.workScheduled--)),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),A=o.Facet.define({combine:e=>e.length?e[0]:null,enables:[u.state,S]});class C{constructor(e,t,n,r,i,o=undefined){this.name=e,this.alias=t,this.extensions=n,this.filename=r,this.loadFunc=i,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then((e=>this.support=e),(e=>{throw this.loading=null,e})))}static of(e){let{load:t,support:n}=e;if(!t){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(n)}return new C(e.name,(e.alias||[]).concat(e.name).map((e=>e.toLowerCase())),e.extensions||[],e.filename,t,n)}static matchFilename(e,t){for(let n of e)if(n.filename&&n.filename.test(t))return n;let n=/\.([^.]+)$/.exec(t);if(n)for(let t of e)if(t.extensions.indexOf(n[1])>-1)return t;return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let n of e)if(n.alias.some((e=>e==t)))return n;if(n)for(let n of e)for(let e of n.alias){let r=t.indexOf(e);if(r>-1&&(e.length>2||!/\w/.test(t[r-1])&&!/\w/.test(t[r+e.length])))return n}return null}}const O=o.Facet.define(),E=o.Facet.define({combine:e=>{if(!e.length)return" ";if(!/^(?: +|\t+)$/.test(e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return e[0]}});function j(e){let t=e.facet(E);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function M(e,t){let n="",r=e.tabSize;if(9==e.facet(E).charCodeAt(0))for(;t>=r;)n+="\t",t-=r;for(let e=0;e=n.from&&r<=n.to?i&&r==e?{text:"",from:e}:(t<0?r-1&&(i+=o-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return o.countColumn(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const T=new i.NodeProp;function _(e){let t=e.type.prop(T);if(t)return t;let n,r=e.firstChild;if(r&&(n=r.type.prop(i.NodeProp.closedBy))){let t=e.lastChild,r=t&&n.indexOf(t.name)>-1;return e=>B(e,!0,1,void 0,r&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?D:null}function P(e,t,n){for(;e;e=e.parent){let r=_(e);if(r)return r(R.create(n,t,e))}return null}function D(){return 0}class R extends ${constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.node=n}static create(e,t,n){return new R(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){let e=this.state.doc.lineAt(this.node.from);for(;;){let t=this.node.resolve(e.from);for(;t.parent&&t.parent.from==t.from;)t=t.parent;if(N(t,this.node))break;e=this.state.doc.lineAt(t.from)}return this.lineIndent(e.from)}continue(){let e=this.node.parent;return e?P(e,this.pos,this.base):0}}function N(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function B(e,t,n,r,i){let o=e.textAfter,s=o.match(/^\s*/)[0].length,a=r&&o.slice(s,s+r.length)==r||i==e.pos+s,l=t?function(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),s=null==i||i<=o.from?o.to:Math.min(o.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped)return i.fromn)continue;if(i&&o.from=t&&r.to>n&&(i=r)}}return i}(e,t,n)}function q(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}const H=o.StateEffect.define({map:q}),W=o.StateEffect.define({map:q});function U(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some((e=>e.from<=n&&e.to>=n))||t.push(e.lineBlockAt(n));return t}const J=o.StateField.define({create:()=>s.Decoration.none,update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(H)&&!G(e,n.value.from,n.value.to)?e=e.update({add:[se.range(n.value.from,n.value.to)]}):n.is(W)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));if(t.selection){let n=!1,{head:r}=t.selection.main;e.between(r,r,((e,t)=>{er&&(n=!0)})),n&&(e=e.update({filterFrom:r,filterTo:r,filter:(e,t)=>t<=r||e>=r}))}return e},provide:e=>s.EditorView.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,((e,t)=>{n.push(e,t)})),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{(!i||i.from>e)&&(i={from:e,to:t})})),i}function G(e,t,n){let r=!1;return e.between(t,t,((e,i)=>{e==t&&i==n&&(r=!0)})),r}function Q(e,t){return e.field(J,!1)?t:t.concat(o.StateEffect.appendConfig.of(oe()))}const Z=e=>{for(let t of U(e)){let n=z(e.state,t.from,t.to);if(n)return e.dispatch({effects:Q(e.state,[H.of(n),X(e,n)])}),!0}return!1},Y=e=>{if(!e.state.field(J,!1))return!1;let t=[];for(let n of U(e)){let r=K(e.state,n.from,n.to);r&&t.push(W.of(r),X(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function X(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return s.EditorView.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${e.state.phrase("to")} ${i}.`)}const ee=e=>{let{state:t}=e,n=[];for(let r=0;r{let t=e.state.field(J,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,((e,t)=>{n.push(W.of({from:e,to:t}))})),e.dispatch({effects:n}),!0},ne=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Z},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Y},{key:"Ctrl-Alt-[",run:ee},{key:"Ctrl-Alt-]",run:te}],re={placeholderDOM:null,placeholderText:"…"},ie=o.Facet.define({combine:e=>o.combineConfig(e,re)});function oe(e){let t=[J,ce];return e&&t.push(ie.of(e)),t}const se=s.Decoration.replace({widget:new class extends s.WidgetType{toDOM(e){let{state:t}=e,n=t.facet(ie),r=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=K(e.state,n.from,n.to);r&&e.dispatch({effects:W.of(r)}),t.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(e,r);let i=document.createElement("span");return i.textContent=n.placeholderText,i.setAttribute("aria-label",t.phrase("folded code")),i.title=t.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=r,i}}}),ae={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class le extends s.GutterMarker{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}const ce=s.EditorView.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class he{constructor(e,t){let n;function r(e){let t=l.StyleModule.newName();return(n||(n=Object.create(null)))["."+t]=e,t}const i="string"==typeof t.all?t.all:t.all?r(t.all):void 0,o=t.scope;this.scope=o instanceof u?e=>e.prop(c)==o.data:o?e=>e==o:void 0,this.style=a.tagHighlighter(e.map((e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))}))),{all:i}).style,this.module=n?new l.StyleModule(n):null,this.themeType=t.themeType}static define(e,t){return new he(e,t||{})}}const ue=o.Facet.define(),fe=o.Facet.define({combine:e=>e.length?[e[0]]:null});function de(e){let t=e.facet(ue);return t.length?t:e.facet(fe)}const pe=o.Prec.high(s.ViewPlugin.fromClass(class{constructor(e){this.markCache=Object.create(null),this.tree=p(e.state),this.decorations=this.buildDeco(e,de(e.state))}update(e){let t=p(e.state),n=de(e.state),r=n!=de(e.startState);t.length{n.add(e,t,this.markCache[r]||(this.markCache[r]=s.Decoration.mark({class:r})))}),r,i);return n.finish()}},{decorations:e=>e.decorations})),me=he.define([{tag:a.tags.meta,color:"#7a757a"},{tag:a.tags.link,textDecoration:"underline"},{tag:a.tags.heading,textDecoration:"underline",fontWeight:"bold"},{tag:a.tags.emphasis,fontStyle:"italic"},{tag:a.tags.strong,fontWeight:"bold"},{tag:a.tags.strikethrough,textDecoration:"line-through"},{tag:a.tags.keyword,color:"#708"},{tag:[a.tags.atom,a.tags.bool,a.tags.url,a.tags.contentSeparator,a.tags.labelName],color:"#219"},{tag:[a.tags.literal,a.tags.inserted],color:"#164"},{tag:[a.tags.string,a.tags.deleted],color:"#a11"},{tag:[a.tags.regexp,a.tags.escape,a.tags.special(a.tags.string)],color:"#e40"},{tag:a.tags.definition(a.tags.variableName),color:"#00f"},{tag:a.tags.local(a.tags.variableName),color:"#30a"},{tag:[a.tags.typeName,a.tags.namespace],color:"#085"},{tag:a.tags.className,color:"#167"},{tag:[a.tags.special(a.tags.variableName),a.tags.macroName],color:"#256"},{tag:a.tags.definition(a.tags.propertyName),color:"#00c"},{tag:a.tags.comment,color:"#940"},{tag:a.tags.invalid,color:"#f00"}]),ge=s.EditorView.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),ve="()[]{}",ye=o.Facet.define({combine:e=>o.combineConfig(e,{afterCursor:!0,brackets:ve,maxScanDistance:1e4,renderMatch:xe})}),be=s.Decoration.mark({class:"cm-matchingBracket"}),we=s.Decoration.mark({class:"cm-nonmatchingBracket"});function xe(e){let t=[],n=e.matched?be:we;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}const ke=[o.StateField.define({create:()=>s.Decoration.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],r=t.state.facet(ye);for(let e of t.state.selection.ranges){if(!e.empty)continue;let i=Ae(t.state,e.head,-1,r)||e.head>0&&Ae(t.state,e.head-1,1,r)||r.afterCursor&&(Ae(t.state,e.head,1,r)||e.heads.EditorView.decorations.from(e)}),ge];function Se(e,t,n){let r=e.prop(t<0?i.NodeProp.openedBy:i.NodeProp.closedBy);if(r)return r;if(1==e.name.length){let r=n.indexOf(e.name);if(r>-1&&r%2==(t<0?1:0))return[n[r+t]]}return null}function Ae(e,t,n,r={}){let i=r.maxScanDistance||1e4,o=r.brackets||ve,s=p(e),a=s.resolveInner(t,n);for(let e=a;e;e=e.parent){let t=Se(e.type,n,o);if(t&&e.from0)return null;let c={from:n<0?t-1:t,to:n>0?t+1:t},h=e.doc.iterRange(t,n>0?e.doc.length:0),u=0;for(let e=0;!h.next().done&&e<=o;){let o=h.value;n<0&&(e+=o.length);let a=t+e*n;for(let e=n>0?0:o.length-1,t=n>0?o.length:-1;e!=t;e+=n){let t=s.indexOf(o[e]);if(!(t<0||r.resolveInner(a+e,1).type!=i))if(t%2==0==n>0)u++;else{if(1==u)return{start:c,end:{from:a+e,to:a+e+1},matched:t>>1==l>>1};u--}}n>0&&(e+=o.length)}return h.done?{start:c,matched:!1}:null}(e,t,n,s,a.type,i,o)}function Ce(e,t,n,r,i,o){let s=r.parent,a={from:r.from,to:r.to},l=0,c=null==s?void 0:s.cursor();if(c&&(n<0?c.childBefore(r.from):c.childAfter(r.to)))do{if(n<0?c.to<=r.from:c.from>=r.to){if(0==l&&i.indexOf(c.type.name)>-1&&c.from=this.string.length}sol(){return 0==this.pos}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosn?e.toLowerCase():e;return r(this.string.substr(this.pos,e.length))==r(e)?(!1!==t&&(this.pos+=e.length),!0):null}{let n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}}function je(e){if("object"!=typeof e)return e;let t={};for(let n in e){let r=e[n];t[n]=r instanceof Array?r.slice():r}return t}class Me extends u{constructor(e){let t,n=h(e.languageData),r={token:(o=e).token,blankLine:o.blankLine||(()=>{}),startState:o.startState||(()=>!0),copyState:o.copyState||je,indent:o.indent||(()=>null),languageData:o.languageData||{},tokenTable:o.tokenTable||Pe};var o;super(n,new class extends i.Parser{createParse(e,n,r){return new Te(t,e,n,r)}},[O.of(((e,t)=>this.getIndent(e,t)))]),this.topNode=function(e){let t=i.NodeType.define({id:De.length,name:"Document",props:[c.add((()=>e))]});return De.push(t),t}(n),t=this,this.streamParser=r,this.stateAfter=new i.NodeProp({perNode:!0}),this.tokenTable=e.tokenTable?new Le(r.tokenTable):Fe}static define(e){return new Me(e)}getIndent(e,t){let n=p(e.state),r=n.resolve(t);for(;r&&r.type!=this.topNode;)r=r.parent;if(!r)return null;let i,o,s=Ie(this,n,0,r.from,t);if(s?(o=s.state,i=s.pos+1):(o=this.streamParser.startState(e.unit),i=0),t-i>1e4)return null;for(;i=r&&n+t.length<=o&&t.prop(e.stateAfter);if(s)return{state:e.streamParser.copyState(s),pos:n+t.length};for(let s=t.children.length-1;s>=0;s--){let a=t.children[s],l=n+t.positions[s],c=a instanceof i.Tree&&l=t.length)return t;o||t.type!=e.topNode||(o=!0);for(let s=t.children.length-1;s>=0;s--){let a,l=t.positions[s],c=t.children[s];if(ln&&Ie(e,r.tree,0-r.offset,n,o);if(s&&(t=$e(e,r.tree,n+r.offset,s.pos+r.offset,!1)))return{state:s.state,tree:t}}return{state:e.streamParser.startState(r?j(r):4),tree:i.Tree.empty}}(e,n,s,null==o?void 0:o.state);this.state=a,this.parsedPos=this.chunkStart=s+l.length;for(let e=0;e=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)"\n"==t&&(t="");else{let e=t.indexOf("\n");e>-1&&(t=t.slice(0,e))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),n=e+t.length;for(let e=this.rangeIndex;;){let r=this.ranges[e].to;if(r>=n)break;if(t=t.slice(0,r-(n-t.length)),e++,e==this.ranges.length)break;let i=this.ranges[e].from,o=this.lineAfter(i);t+=o,n=i+o.length}return{line:t,end:n}}skipGapsTo(e,t,n){for(;;){let r=this.ranges[this.rangeIndex].to,i=e+t;if(n>0?r>i:r>=i)break;t+=this.ranges[++this.rangeIndex].from-r}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){t+=i=this.skipGapsTo(t,i,1);let e=this.chunk.length;n+=i=this.skipGapsTo(n,i,-1),r+=this.chunk.length-e}return this.chunk.push(e,t,n,r),i}parseLine(e){let{line:t,end:n}=this.nextLine(),r=0,{streamParser:i}=this.lang,o=new Ee(t,e?e.state.tabSize:4,e?j(e.state):2);if(o.eol())i.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let e=_e(i.token,o,this.state);if(e&&(r=this.emitToken(this.lang.tokenTable.resolve(e),this.parsedPos+o.start,this.parsedPos+o.pos,4,r)),o.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPost.start)return r}throw new Error("Stream parser failed to advance stream.")}const Pe=Object.create(null),De=[i.NodeType.none],Re=new i.NodeSet(De),Ne=[],Be=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Be[e]=ze(Pe,t);class Le{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Be)}resolve(e){return e?this.table[e]||(this.table[e]=ze(this.extra,e)):0}}const Fe=new Le(Pe);function Ve(e,t){Ne.indexOf(e)>-1||(Ne.push(e),console.warn(t))}function ze(e,t){let n=null;for(let r of t.split(".")){let t=e[r]||a.tags[r];t?"function"==typeof t?n?n=t(n):Ve(r,`Modifier ${r} used at start of tag`):n?Ve(r,`Tag ${r} used as modifier`):n=t:Ve(r,`Unknown highlighting tag ${r}`)}if(!n)return 0;let r=t.replace(/ /g,"_"),o=i.NodeType.define({id:De.length,name:r,props:[a.styleTags({[r]:n})]});return De.push(o),o.id}t.HighlightStyle=he,t.IndentContext=$,t.LRLanguage=d,t.Language=u,t.LanguageDescription=C,t.LanguageSupport=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},t.ParseContext=y,t.StreamLanguage=Me,t.StringStream=Ee,t.TreeIndentContext=R,t.bracketMatching=function(e={}){return[ye.of(e),ke]},t.codeFolding=oe,t.continuedIndent=function({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}},t.defaultHighlightStyle=me,t.defineLanguageFacet=h,t.delimitedIndent=function({closing:e,align:t=!0,units:n=1}){return r=>B(r,t,n,e)},t.ensureSyntaxTree=m,t.flatIndent=e=>e.baseIndent,t.foldAll=ee,t.foldCode=Z,t.foldEffect=H,t.foldGutter=function(e={}){let t=Object.assign(Object.assign({},ae),e),n=new le(t,!0),r=new le(t,!1),i=s.ViewPlugin.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(A)!=e.state.facet(A)||e.startState.field(J,!1)!=e.state.field(J,!1)||p(e.startState)!=p(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new o.RangeSetBuilder;for(let i of e.viewportLineBlocks){let o=K(e.state,i.from,i.to)?r:z(e.state,i.from,i.to)?n:null;o&&t.add(i.from,i.from,o)}return t.finish()}}),{domEventHandlers:a}=t;return[i,s.gutter({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(i))||void 0===t?void 0:t.markers)||o.RangeSet.empty},initialSpacer:()=>new le(t,!1),domEventHandlers:Object.assign(Object.assign({},a),{click:(e,t,n)=>{if(a.click&&a.click(e,t,n))return!0;let r=K(e.state,t.from,t.to);if(r)return e.dispatch({effects:W.of(r)}),!0;let i=z(e.state,t.from,t.to);return!!i&&(e.dispatch({effects:H.of(i)}),!0)}})}),oe()]},t.foldInside=function(e){let t=e.firstChild,n=e.lastChild;return t&&t.to{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+200)return e;let o=n.sliceString(i.from,r);if(!t.some((e=>e.test(o))))return e;let{state:s}=e,a=-1,l=[];for(let{head:e}of s.selection.ranges){let t=s.doc.lineAt(e);if(t.from==a)continue;a=t.from;let n=I(s,t.from);if(null==n)continue;let r=/^\s*/.exec(t.text)[0],i=M(s,n);r!=i&&l.push({from:t.from,to:t.from+r.length,insert:i})}return l.length?[e,{changes:l,sequential:!0}]:e}))},t.indentRange=function(e,t,n){let r=Object.create(null),i=new $(e,{overrideIndentation:e=>{var t;return null!==(t=r[e])&&void 0!==t?t:-1}}),o=[];for(let s=t;s<=n;){let t=e.doc.lineAt(s);s=t.to+1;let n=I(i,t.from);if(null==n)continue;/\S/.test(t.text)||(n=0);let a=/^\s*/.exec(t.text)[0],l=M(e,n);a!=l&&(r[t.from]=n,o.push({from:t.from,to:t.from+a.length,insert:l}))}return e.changes(o)},t.indentService=O,t.indentString=M,t.indentUnit=E,t.language=A,t.languageDataProp=c,t.matchBrackets=Ae,t.syntaxHighlighting=function(e,t){let n,r=[pe];return e instanceof he&&(e.module&&r.push(s.EditorView.styleModule.of(e.module)),n=e.themeType),(null==t?void 0:t.fallback)?r.push(fe.of(e)):n?r.push(ue.computeN([s.EditorView.darkTheme],(t=>t.facet(s.EditorView.darkTheme)==("dark"==n)?[e]:[]))):r.push(ue.of(e)),r},t.syntaxParserRunning=function(e){var t;return(null===(t=e.plugin(S))||void 0===t?void 0:t.isWorking())||!1},t.syntaxTree=p,t.syntaxTreeAvailable=function(e,t=e.doc.length){var n;return(null===(n=e.field(u.state,!1))||void 0===n?void 0:n.context.isDone(t))||!1},t.unfoldAll=te,t.unfoldCode=Y,t.unfoldEffect=W},2426:(e,t,n)=>{"use strict";var r=n(3642),i=n(7040),o=n(8513);class s{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class a{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let i=e,o=n.facet(S).markerFilter;o&&(i=o(i));let s=r.Decoration.set(i.map((e=>e.from==e.to||e.from==e.to-1&&n.doc.lineAt(e.from).to==e.from?r.Decoration.widget({widget:new O(e),diagnostic:e}).range(e.from):r.Decoration.mark({attributes:{class:"cm-lintRange cm-lintRange-"+e.severity+(e.markClass?" "+e.markClass:"")},diagnostic:e}).range(e.from,e.to))),!0);return new a(s,t,l(s))}}function l(e,t=null,n=0){let r=null;return e.between(n,1e9,((e,n,{spec:i})=>{if(!t||i.diagnostic==t)return r=new s(e,n,i.diagnostic),!1})),r}function c(e,t){let n=e.startState.doc.lineAt(t.pos);return!(!e.effects.some((e=>e.is(f)))&&!e.changes.touchesRange(n.from,n.to))}function h(e,t){return e.field(m,!1)?t:t.concat(i.StateEffect.appendConfig.of(F))}function u(e,t){return{effects:h(e,[f.of(t)])}}const f=i.StateEffect.define(),d=i.StateEffect.define(),p=i.StateEffect.define(),m=i.StateField.define({create:()=>new a(r.Decoration.none,null,null),update(e,t){if(t.docChanged){let n=e.diagnostics.map(t.changes),r=null;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=l(n,e.selected.diagnostic,i)||l(n,null,i)}e=new a(n,e.panel,r)}for(let n of t.effects)n.is(f)?e=a.init(n.value,e.panel,t.state):n.is(d)?e=new a(e.diagnostics,n.value?j.open:null,e.selected):n.is(p)&&(e=new a(e.diagnostics,e.panel,n.value));return e},provide:e=>[r.showPanel.from(e,(e=>e.panel)),r.EditorView.decorations.from(e,(e=>e.diagnostics))]}),g=r.Decoration.mark({class:"cm-lintRange cm-lintRange-active"});function v(e,t){return o("ul",{class:"cm-tooltip-lint"},t.map((t=>C(e,t,!1))))}const y=e=>{let t=e.state.field(m,!1);t&&t.panel||e.dispatch({effects:h(e.state,[d.of(!0)])});let n=r.getPanel(e,j.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},b=e=>{let t=e.state.field(m,!1);return!(!t||!t.panel||(e.dispatch({effects:d.of(!1)}),0))},w=e=>{let t=e.state.field(m,!1);if(!t)return!1;let n=e.state.selection.main,r=t.diagnostics.iter(n.to+1);return!(!r.value&&(r=t.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)||(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),0))},x=[{key:"Mod-Shift-m",run:y,preventDefault:!0},{key:"F8",run:w}],k=r.ViewPlugin.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(S);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){let e=Date.now();if(ePromise.resolve(e(this.view))))).then((t=>{let n=t.reduce(((e,t)=>e.concat(t)));this.view.state.doc==e.doc&&this.view.dispatch(u(this.view.state,n))}),(e=>{r.logException(this.view.state,e)}))}}update(e){let t=e.state.facet(S);(e.docChanged||t!=e.startState.facet(S)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),S=i.Facet.define({combine:e=>Object.assign({sources:e.map((e=>e.source))},i.combineConfig(e.map((e=>e.config)),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))});function A(e){let t=[];if(e)e:for(let{name:n}of e){for(let e=0;ee.toLowerCase()==r.toLowerCase()))){t.push(r);continue e}}t.push("")}return t}function C(e,t,n){var r;let i=n?A(t.actions):[];return o("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},o("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage():t.message),null===(r=t.actions)||void 0===r?void 0:r.map(((n,r)=>{let s=!1,a=r=>{if(r.preventDefault(),s)return;s=!0;let i=l(e.state.field(m).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:c}=n,h=i[r]?c.indexOf(i[r]):-1,u=h<0?c:[c.slice(0,h),o("u",c.slice(h,h+1)),c.slice(h+1)];return o("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${c}${h<0?"":` (access key "${i[r]})"`}.`},u)})),t.source&&o("div",{class:"cm-diagnosticSource"},t.source))}class O extends r.WidgetType{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return o("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class E{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=C(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class j{constructor(e){this.view=e,this.items=[],this.list=o("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(27==t.keyCode)b(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:n}=this.items[this.selectedIndex],r=A(n.actions);for(let i=0;i{for(let t=0;tb(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(m).selected;if(!e)return-1;for(let t=0;t{let a,l=-1;for(let e=n;en&&(this.items.splice(n,l-n),r=!0)),t&&a.diagnostic==t.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),i=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++}));n({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.topt.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=l(this.view.state.field(m).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:p.of(t)})}static open(e){return new j(e)}}function M(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function I(e){return M(``,'width="6" height="3"')}const $=r.EditorView.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:I("#d11")},".cm-lintRange-warning":{backgroundImage:I("orange")},".cm-lintRange-info":{backgroundImage:I("#999")},".cm-lintRange-hint":{backgroundImage:I("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function T(e){return"error"==e?4:"warning"==e?3:"info"==e?2:1}class _ extends r.GutterMarker{constructor(e){super(),this.diagnostics=e,this.severity=e.reduce(((e,t)=>T(e)function(e,t,n){function r(){let r=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(r.from)&&e.dispatch({effects:N.of({pos:r.from,above:!1,create:()=>({dom:v(e,n),getCoords:()=>t.getBoundingClientRect()})})}),t.onmouseout=t.onmousemove=null,function(e,t){let n=r=>{let i=t.getBoundingClientRect();if(!(r.clientX>i.left-10&&r.clientXi.top-10&&r.clientY{clearTimeout(o),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(o),o=setTimeout(r,i)}}(e,t,n)),t}}function P(e,t){let n=Object.create(null);for(let r of t){let t=e.lineAt(r.from);(n[t.from]||(n[t.from]=[])).push(r)}let r=[];for(let e in n)r.push(new _(n[e]).range(+e));return i.RangeSet.of(r,!0)}const D=r.gutter({class:"cm-gutter-lint",markers:e=>e.state.field(R)}),R=i.StateField.define({create:()=>i.RangeSet.empty,update(e,t){e=e.map(t.changes);let n=t.state.facet(V).markerFilter;for(let r of t.effects)if(r.is(f)){let i=r.value;n&&(i=n(i||[])),e=P(t.state.doc,i.slice(0))}return e}}),N=i.StateEffect.define(),B=i.StateField.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=c(t,e)?null:Object.assign(Object.assign({},e),{pos:t.changes.mapPos(e.pos)})),t.effects.reduce(((e,t)=>t.is(N)?t.value:e),e)),provide:e=>r.showTooltip.from(e)}),L=r.EditorView.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:M('')},".cm-lint-marker-warning":{content:M('')},".cm-lint-marker-error":{content:M('')}}),F=[m,r.EditorView.decorations.compute([m],(e=>{let{selected:t,panel:n}=e.field(m);return t&&n&&t.from!=t.to?r.Decoration.set([g.range(t.from,t.to)]):r.Decoration.none})),r.hoverTooltip((function(e,t,n){let{diagnostics:r}=e.state.field(m),i=[],o=2e8,s=0;r.between(t-(n<0?1:0),t+(n>0?1:0),((e,r,{spec:a})=>{t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t({dom:v(e,i)})}:null}),{hideOn:c}),$],V=i.Facet.define({combine:e=>i.combineConfig(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});t.closeLintPanel=b,t.diagnosticCount=function(e){let t=e.field(m,!1);return t?t.diagnostics.size:0},t.forEachDiagnostic=function(e,t){let n=e.field(m,!1);if(n&&n.diagnostics.size)for(let e=i.RangeSet.iter([n.diagnostics]);e.value;e.next())t(e.value.spec.diagnostic,e.from,e.to)},t.forceLinting=function(e){let t=e.plugin(k);t&&t.force()},t.lintGutter=function(e={}){return[V.of(e),R,D,L,B]},t.lintKeymap=x,t.linter=function(e,t={}){return[S.of({source:e,config:t}),k,F]},t.nextDiagnostic=w,t.openLintPanel=y,t.previousDiagnostic=e=>{let{state:t}=e,n=t.field(m,!1);if(!n)return!1;let r,i,o,s,a=t.selection.main;return n.diagnostics.between(0,t.doc.length,((e,t)=>{to)&&(o=e,s=t)})),null!=o&&(null!=r||o!=a.from)&&(e.dispatch({selection:{anchor:null!=r?r:o,head:null!=i?i:s},scrollIntoView:!0}),!0)},t.setDiagnostics=u,t.setDiagnosticsEffect=f},2502:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3642),i=n(7040);function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(n(8513));const a="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class l{constructor(e,t,n=0,r=e.length,i){this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(a(e)):a,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return i.codePointAt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=i.fromCodePoint(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=i.codePointSize(e);let r=this.normalize(t);for(let e=0,i=n;;e++){let o=r.charCodeAt(e),s=this.match(o,i);if(s)return this.value=s,this;if(e==r.length-1)break;i==n&&ethis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=r+(n==r?1:0),n==this.curLine.length&&this.nextLine(),nthis.value.to)return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=n||r.to<=t){let r=new d(t,e.sliceString(t,n));return f.set(e,r),r}if(r.from==t&&r.to==n)return r;let{text:i,from:o}=r;return o>t&&(i=e.sliceString(t,o)+i,o=t),r.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t&&this.flat.tothis.flat.text.length-10&&(t=null),t){let e=this.flat.from+t.index,n=e+t[0].length;return this.value={from:e,to:n,match:t},this.matchPos=n+(e==n?1:0),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=d.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function m(e){let t=s.default("input",{class:"cm-textfield",name:"line"});function n(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:r}=e,o=r.doc.lineAt(r.selection.main.head),[,s,a,l,c]=n,h=l?+l.slice(1):0,u=a?+a:o.number;if(a&&c){let e=u/100;s&&(e=e*("-"==s?-1:1)+o.number/r.doc.lines),u=Math.round(r.doc.lines*e)}else a&&s&&(u=u*("-"==s?-1:1)+o.number);let f=r.doc.line(Math.max(1,Math.min(r.doc.lines,u)));e.dispatch({effects:g.of(!1),selection:i.EditorSelection.cursor(f.from+Math.max(0,Math.min(h,f.length))),scrollIntoView:!0}),e.focus()}return{dom:s.default("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:g.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),n())},onsubmit:e=>{e.preventDefault(),n()}},s.default("label",e.state.phrase("Go to line"),": ",t)," ",s.default("button",{class:"cm-button",type:"submit"},e.state.phrase("go")))}}"undefined"!=typeof Symbol&&(u.prototype[Symbol.iterator]=p.prototype[Symbol.iterator]=function(){return this});const g=i.StateEffect.define(),v=i.StateField.define({create:()=>!0,update(e,t){for(let n of t.effects)n.is(g)&&(e=n.value);return e},provide:e=>r.showPanel.from(e,(e=>e?m:null))}),y=e=>{let t=r.getPanel(e,m);if(!t){let n=[g.of(!0)];null==e.state.field(v,!1)&&n.push(i.StateEffect.appendConfig.of([v,b])),e.dispatch({effects:n}),t=r.getPanel(e,m)}return t&&t.dom.querySelector("input").focus(),!0},b=r.EditorView.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),w={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},x=i.Facet.define({combine:e=>i.combineConfig(e,w,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),k=r.Decoration.mark({class:"cm-selectionMatch"}),S=r.Decoration.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function A(e,t,n,r){return!(0!=n&&e(t.sliceDoc(n-1,n))==i.CharCategory.Word||r!=t.doc.length&&e(t.sliceDoc(r,r+1))==i.CharCategory.Word)}function C(e,t,n,r){return e(t.sliceDoc(n,n+1))==i.CharCategory.Word&&e(t.sliceDoc(r-1,r))==i.CharCategory.Word}const O=r.ViewPlugin.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(x),{state:n}=e,i=n.selection;if(i.ranges.length>1)return r.Decoration.none;let o,s=i.main,a=null;if(s.empty){if(!t.highlightWordAroundCursor)return r.Decoration.none;let e=n.wordAt(s.head);if(!e)return r.Decoration.none;a=n.charCategorizer(s.head),o=n.sliceDoc(e.from,e.to)}else{let e=s.to-s.from;if(e200)return r.Decoration.none;if(t.wholeWords){if(o=n.sliceDoc(s.from,s.to),a=n.charCategorizer(s.head),!A(a,n,s.from,s.to)||!C(a,n,s.from,s.to))return r.Decoration.none}else if(o=n.sliceDoc(s.from,s.to).trim(),!o)return r.Decoration.none}let c=[];for(let i of e.visibleRanges){let e=new l(n.doc,o,i.from,i.to);for(;!e.next().done;){let{from:i,to:o}=e.value;if((!a||A(a,n,i,o))&&(s.empty&&i<=s.from&&o>=s.to?c.push(S.range(i,o)):(i>=s.to||o<=s.from)&&c.push(k.range(i,o)),c.length>t.maxMatches))return r.Decoration.none}}return r.Decoration.set(c)}},{decorations:e=>e.decorations}),E=r.EditorView.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),j=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some((e=>e.from===e.to)))return(({state:e,dispatch:t})=>{let{selection:n}=e,r=i.EditorSelection.create(n.ranges.map((t=>e.wordAt(t.head)||i.EditorSelection.cursor(t.head))),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)})({state:e,dispatch:t});let o=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some((t=>e.sliceDoc(t.from,t.to)!=o)))return!1;let s=function(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new l(e.doc,t,r[r.length-1].to);;){if(i.next(),!i.done){if(n&&r.some((e=>e.from==i.value.from)))continue;if(o){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}if(n)return null;i=new l(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}}(e,o);return!!s&&(t(e.update({selection:e.selection.addRange(i.EditorSelection.range(s.from,s.to),!1),effects:r.EditorView.scrollIntoView(s.to)})),!0)},M=i.Facet.define({combine(e){var t;return{top:e.reduce(((e,t)=>null!=e?e:t.top),void 0)||!1,caseSensitive:e.reduce(((e,t)=>null!=e?e:t.caseSensitive),void 0)||!1,createPanel:(null===(t=e.find((e=>e.createPanel)))||void 0===t?void 0:t.createPanel)||(e=>new te(e))}}});class I{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,h),!0}catch(e){return!1}}(this.search)),this.unquoted=e.literal?this.search:this.search.replace(/\\([nrt\\])/g,((e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"))}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp}create(){return this.regexp?new D(this):new _(this)}getCursor(e,t=0,n=e.length){return this.regexp?P(this,e,t,n):T(this,e,t,n)}}class ${constructor(e){this.spec=e}}function T(e,t,n,r){return new l(t,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase())}class _ extends ${constructor(e){super(e)}nextMatch(e,t,n){let r=T(this.spec,e,n,e.length).nextOverlapping();return r.done&&(r=T(this.spec,e,0,t).nextOverlapping()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=T(this.spec,e,n,r),o=null;for(;!i.nextOverlapping().done;)o=i.value;if(o)return o;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.length)}getReplacement(e){return this.spec.replace}matchAll(e,t){let n=T(this.spec,e,0,e.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=T(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.length));for(;!i.next().done;)r(i.value.from,i.value.to)}}function P(e,t,n,r){return new u(t,e.search,e.caseSensitive?void 0:{ignoreCase:!0},n,r)}class D extends ${nextMatch(e,t,n){let r=P(this.spec,e,n,e.length).next();return r.done&&(r=P(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-1e4*r),o=P(this.spec,e,i,n),s=null;for(;!o.next().done;)s=o.value;if(s&&(i==t||s.from>i+10))return s;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.length)}getReplacement(e){return this.spec.replace.replace(/\$([$&\d+])/g,((t,n)=>"$"==n?"$":"&"==n?e.match[0]:"0"!=n&&+n=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=P(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.length));for(;!i.next().done;)r(i.value.from,i.value.to)}}const R=i.StateEffect.define(),N=i.StateEffect.define(),B=i.StateField.define({create:e=>new L(Z(e).create(),null),update(e,t){for(let n of t.effects)n.is(R)?e=new L(n.value.create(),e.panel):n.is(N)&&(e=new L(e.query,n.value?Q:null));return e},provide:e=>r.showPanel.from(e,(e=>e.panel))});class L{constructor(e,t){this.query=e,this.panel=t}}const F=r.Decoration.mark({class:"cm-searchMatch"}),V=r.Decoration.mark({class:"cm-searchMatch cm-searchMatch-selected"}),z=r.ViewPlugin.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(B))}update(e){let t=e.state.field(B);(t!=e.startState.field(B)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return r.Decoration.none;let{view:n}=this,o=new i.RangeSetBuilder;for(let t=0,r=n.visibleRanges,i=r.length;tr[t+1].from-500;)a=r[++t].to;e.highlight(n.state.doc,s,a,((e,t)=>{let r=n.state.selection.ranges.some((n=>n.from==e&&n.to==t));o.add(e,t,r?V:F)}))}return o.finish()}},{decorations:e=>e.decorations});function q(e){return t=>{let n=t.state.field(B,!1);return n&&n.query.spec.valid?e(t,n):Y(t)}}const H=q(((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state.doc,n,n);return!!r&&(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:oe(e,r),userEvent:"select.search"}),!0)})),W=q(((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n.doc,r,r);return!!i&&(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:oe(e,i),userEvent:"select.search"}),!0)})),U=q(((e,{query:t})=>{let n=t.matchAll(e.state.doc,1e3);return!(!n||!n.length||(e.dispatch({selection:i.EditorSelection.create(n.map((e=>i.EditorSelection.range(e.from,e.to)))),userEvent:"select.search.matches"}),0))})),J=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:o}=n.main,s=[],a=0;for(let t=new l(e.doc,e.sliceDoc(r,o));!t.next().done;){if(s.length>1e3)return!1;t.value.from==r&&(a=s.length),s.push(i.EditorSelection.range(t.value.from,t.value.to))}return t(e.update({selection:i.EditorSelection.create(s,a),userEvent:"select.search.matches"})),!0},K=q(((e,{query:t})=>{let{state:n}=e,{from:i,to:o}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n.doc,i,i);if(!s)return!1;let a,l,c=[],h=[];if(s.from==i&&s.to==o&&(l=n.toText(t.getReplacement(s)),c.push({from:s.from,to:s.to,insert:l}),s=t.nextMatch(n.doc,s.from,s.to),h.push(r.EditorView.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))),s){let t=0==c.length||c[0].from>=s.to?0:s.to-s.from-l.length;a={anchor:s.from-t,head:s.to-t},h.push(oe(e,s))}return e.dispatch({changes:c,selection:a,scrollIntoView:!!a,effects:h,userEvent:"input.replace"}),!0})),G=q(((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state.doc,1e9).map((e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}}));if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:r.EditorView.announce.of(i),userEvent:"input.replace.all"}),!0}));function Q(e){return e.state.facet(M).createPanel(e)}function Z(e,t){var n;let r=e.selection.main,i=r.empty||r.to>r.from+100?"":e.sliceDoc(r.from,r.to),o=null!==(n=null==t?void 0:t.caseSensitive)&&void 0!==n?n:e.facet(M).caseSensitive;return t&&!i?t:new I({search:i.replace(/\n/g,"\\n"),caseSensitive:o})}const Y=e=>{let t=e.state.field(B,!1);if(t&&t.panel){let n=r.getPanel(e,Q);if(!n)return!1;let i=n.dom.querySelector("[main-field]");if(i&&i!=e.root.activeElement){let n=Z(e.state,t.query.spec);n.valid&&e.dispatch({effects:R.of(n)}),i.focus(),i.select()}}else e.dispatch({effects:[N.of(!0),t?R.of(Z(e.state,t.query.spec)):i.StateEffect.appendConfig.of(ae)]});return!0},X=e=>{let t=e.state.field(B,!1);if(!t||!t.panel)return!1;let n=r.getPanel(e,Q);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:N.of(!1)}),!0},ee=[{key:"Mod-f",run:Y,scope:"editor search-panel"},{key:"F3",run:H,shift:W,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:H,shift:W,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:X,scope:"editor search-panel"},{key:"Mod-Shift-l",run:J},{key:"Alt-g",run:y},{key:"Mod-d",run:j,preventDefault:!0}];class te{constructor(e){this.view=e;let t=this.query=e.state.field(B).query.spec;function n(e,t,n){return s.default("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=s.default("input",{value:t.search,placeholder:ne(e,"Find"),"aria-label":ne(e,"Find"),class:"cm-textfield",name:"search","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=s.default("input",{value:t.replace,placeholder:ne(e,"Replace"),"aria-label":ne(e,"Replace"),class:"cm-textfield",name:"replace",onchange:this.commit,onkeyup:this.commit}),this.caseField=s.default("input",{type:"checkbox",name:"case",checked:t.caseSensitive,onchange:this.commit}),this.reField=s.default("input",{type:"checkbox",name:"re",checked:t.regexp,onchange:this.commit}),this.dom=s.default("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",(()=>H(e)),[ne(e,"next")]),n("prev",(()=>W(e)),[ne(e,"previous")]),n("select",(()=>U(e)),[ne(e,"all")]),s.default("label",null,[this.caseField,ne(e,"match case")]),s.default("label",null,[this.reField,ne(e,"regexp")]),...e.state.readOnly?[]:[s.default("br"),this.replaceField,n("replace",(()=>K(e)),[ne(e,"replace")]),n("replaceAll",(()=>G(e)),[ne(e,"replace all")]),s.default("button",{name:"close",onclick:()=>X(e),"aria-label":ne(e,"close"),type:"button"},["×"])]])}commit(){let e=new I({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:R.of(e)}))}keydown(e){r.runScopeHandlers(this.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?W:H)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),K(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(R)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(M).top}}function ne(e,t){return e.state.phrase(t)}const re=30,ie=/[\s\.,:;?!]/;function oe(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),o=e.state.doc.lineAt(n).to,s=Math.max(i.from,t-re),a=Math.min(o,n+re),l=e.state.sliceDoc(s,a);if(s!=i.from)for(let e=0;el.length-re;e--)if(!ie.test(l[e-1])&&ie.test(l[e])){l=l.slice(0,e);break}return r.EditorView.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${i.number}.`)}const se=r.EditorView.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),ae=[B,i.Prec.lowest(z),se];t.RegExpCursor=u,t.SearchCursor=l,t.SearchQuery=I,t.closeSearchPanel=X,t.findNext=H,t.findPrevious=W,t.getSearchQuery=function(e){let t=e.field(B,!1);return t?t.query.spec:Z(e)},t.gotoLine=y,t.highlightSelectionMatches=function(e){let t=[E,O];return e&&t.push(x.of(e)),t},t.openSearchPanel=Y,t.replaceAll=G,t.replaceNext=K,t.search=function(e){return e?[M.of(e),ae]:ae},t.searchKeymap=ee,t.selectMatches=U,t.selectNextOccurrence=j,t.selectSelectionMatches=J,t.setSearchQuery=R},7040:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n{constructor(){}lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),i.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let n=[];return this.decompose(e,t,n,0),i.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new a(this),i=new a(e);for(let e=t,o=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(o+=r.value.length,r.done||o>=n)return!0}}iter(e=1){return new a(this,e)}iterRange(e,t=this.length){return new l(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new c(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new r(e):i.from(r.split(e,[])):n.empty}}class r extends n{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let o=this.text[i],s=r+o.length;if((t?n:s)>=e)return new h(r,s,n,o);r=s+1,n++}}decompose(e,t,n,i){let a=e<=0&&t>=this.length?this:new r(s(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&i){let e=n.pop(),t=o(a.text,e.text.slice(),0,a.length);if(t.length<=32)n.push(new r(t,e.length+a.length));else{let e=t.length>>1;n.push(new r(t.slice(0,e)),new r(t.slice(e)))}}else n.push(a)}replace(e,t,n){if(!(n instanceof r))return super.replace(e,t,n);let a=o(this.text,o(n.text,s(this.text,0,e)),t),l=this.length+n.length-(t-e);return a.length<=32?new r(a,l):i.from(r.split(a,[]),l)}sliceString(e,t=this.length,n="\n"){let r="";for(let i=0,o=0;i<=t&&oe&&o&&(r+=n),ei&&(r+=s.slice(Math.max(0,e-i),t-i)),i=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let o of e)n.push(o),i+=o.length+1,32==n.length&&(t.push(new r(n,i)),n=[],i=-1);return i>-1&&t.push(new r(n,i)),t}}class i extends n{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let o=this.children[i],s=r+o.length,a=n+o.lines-1;if((t?a:s)>=e)return o.lineInner(e,t,n,r);r=s+1,n=a+1}}decompose(e,t,n,r){for(let i=0,o=0;o<=t&&i=o){let i=r&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!i?n.push(s):s.decompose(e-o,t-o,n,i)}o=a+1}}replace(e,t,n){if(n.lines=o&&t<=a){let l=s.replace(e-o,t-o,n),c=this.lines-s.lines+l.lines;if(l.lines>4&&l.lines>c>>6){let o=this.children.slice();return o[r]=l,new i(o,this.length-(t-e)+n.length)}return super.replace(o,a,l)}o=a+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){let r="";for(let i=0,o=0;ie&&i&&(r+=n),eo&&(r+=s.sliceString(e-o,t-o,n)),o=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof i))return 0;let n=0,[r,o,s,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,o+=t){if(r==s||o==a)return n;let i=this.children[r],l=e.children[o];if(i!=l)return n+i.scanIdentical(l,t);n+=i.length+1}}static from(e,t=e.reduce(((e,t)=>e+t.length+1),-1)){let n=0;for(let t of e)n+=t.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new r(n,t)}let o=Math.max(32,n>>5),s=o<<1,a=o>>1,l=[],c=0,h=-1,u=[];function f(e){let t;if(e.lines>s&&e instanceof i)for(let t of e.children)f(t);else e.lines>a&&(c>a||!c)?(d(),l.push(e)):e instanceof r&&c&&(t=u[u.length-1])instanceof r&&e.lines+t.lines<=32?(c+=e.lines,h+=e.length+1,u[u.length-1]=new r(t.text.concat(e.text),t.length+1+e.length)):(c+e.lines>o&&d(),c+=e.lines,h+=e.length+1,u.push(e))}function d(){0!=c&&(l.push(1==u.length?u[0]:i.from(u,h)),h=-1,c=u.length=0)}for(let t of e)f(t);return d(),1==l.length?l[0]:new i(l,t)}}function o(e,t,n=0,r=1e9){for(let i=0,o=0,s=!0;o=n&&(l>r&&(a=a.slice(0,r-i)),i0?1:(e instanceof r?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],o=this.offsets[n],s=o>>1,a=i instanceof r?i.text.length:i.children.length;if(s==(t>0?a:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&o)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(i instanceof r){let r=i.text[s+(t<0?-1:0)];if(this.offsets[n]+=t,r.length>Math.max(0,e))return this.value=0==e?r:t>0?r.slice(e):r.slice(0,r.length-e),this;e-=r.length}else{let o=i.children[s+(t<0?-1:0)];e>o.length?(e-=o.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(o),this.offsets.push(t>0?1:(o instanceof r?o.text.length:o.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class l{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new a(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class c{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(n.prototype[Symbol.iterator]=function(){return this.iter()},a.prototype[Symbol.iterator]=l.prototype[Symbol.iterator]=c.prototype[Symbol.iterator]=function(){return this});class h{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}}let u="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((e=>e?parseInt(e,36):1));for(let e=1;ee)return u[t-1]<=e;return!1}function d(e){return e>=127462&&e<=127487}const p=8205;function m(e,t,n=!0,r=!0){return(n?g:v)(e,t,r)}function g(e,t,n){if(t==e.length)return t;t&&y(e.charCodeAt(t))&&b(e.charCodeAt(t-1))&&t--;let r=w(e,t);for(t+=x(r);t=0&&d(w(e,r));)n++,r-=2;if(n%2==0)break;t+=2}}}return t}function v(e,t,n){for(;t>0;){let r=g(e,t-2,n);if(r=56320&&e<57344}function b(e){return e>=55296&&e<56320}function w(e,t){let n=e.charCodeAt(t);if(!b(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return y(r)?r-56320+(n-55296<<10)+65536:n}function x(e){return e<65536?1:2}const k=/\r\n?|\n/;var S;t.MapMode=void 0,(S=t.MapMode||(t.MapMode={}))[S.Simple=0]="Simple",S[S.TrackDel=1]="TrackDel",S[S.TrackBefore=2]="TrackBefore",S[S.TrackAfter=3]="TrackAfter";class A{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return o+(e-i);o+=a}else{if(r!=t.MapMode.Simple&&c>=e&&(r==t.MapMode.TrackDel&&ie||r==t.MapMode.TrackBefore&&ie))return null;if(c>e||c==e&&n<0&&!a)return e==i||n<0?o:o+l;o+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return o}touchesRange(e,t=e){for(let n=0,r=0;n=0&&r<=t&&i>=e)return!(rt)||"cover";r=i}return!1}toString(){let e="";for(let t=0;t=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some((e=>"number"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new A(e)}static create(e){return new A(e)}}class C extends A{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return j(this,((t,n,r,i,o)=>e=e.replace(r,r+(n-t),o)),!1),e}mapDesc(e,t=!1){return M(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let i=0,o=0;i=0){t[i]=a,t[i+1]=s;let l=i>>1;for(;r.length0&&E(n,t,i.text),i.forward(e),s+=e}let l=e[o++];for(;s>1].toJSON()))}return e}static of(e,t,r){let i=[],o=[],s=0,a=null;function l(e=!1){if(!e&&!i.length)return;sa||e<0||a>t)throw new RangeError(`Invalid change range ${e} to ${a} (in doc of length ${t})`);let u=h?"string"==typeof h?n.of(h.split(r||k)):h:n.empty,f=u.length;if(e==a&&0==f)return;es&&O(i,e-s,-1),O(i,a-e,f),E(o,i,u),s=a}}(e),l(!a),a}static empty(e){return new C(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],r=[];for(let i=0;it&&"string"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==o.length)t.push(o[0],0);else{for(;r.length=0&&n<=0&&n==e[i+1]?e[i]+=t:0==t&&0==e[i]?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function E(e,t,r){if(0==r.length)return;let i=t.length-2>>1;if(i>1])),!(r||a==e.sections.length||e.sections[a+1]<0);)l=e.sections[a++],c=e.sections[a++];t(o,h,s,u,f),o=h,s=u}}}function M(e,t,n,r=!1){let i=[],o=r?[]:null,s=new $(e),a=new $(t);for(let e=-1;;)if(-1==s.ins&&-1==a.ins){let e=Math.min(s.len,a.len);O(i,e,-1),s.forward(e),a.forward(e)}else if(a.ins>=0&&(s.ins<0||e==s.i||0==s.off&&(a.len=0&&e=0)){if(s.done&&a.done)return o?C.createSet(i,o):A.create(i);throw new Error("Mismatched change set lengths")}{let t=0,n=s.len;for(;n;)if(-1==a.ins){let e=Math.min(n,a.len);t+=e,n-=e,a.forward(e)}else{if(!(0==a.ins&&a.lent||s.ins>=0&&s.len>t)&&(e||r.length>n),o.forward2(t),s.forward(t)}}else O(r,0,s.ins,e),i&&E(i,r,s.text),s.next()}}class ${constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?n.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?n.empty:t[r].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class T{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 16&this.flags?this.to:this.from}get head(){return 16&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 4&this.flags?-1:8&this.flags?1:0}get bidiLevel(){let e=3&this.flags;return 3==e?null:e}get goalColumn(){let e=this.flags>>5;return 33554431==e?void 0:e}map(e,t=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new T(n,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return _.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return _.range(this.anchor,n)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return _.range(e.anchor,e.head)}static create(e,t,n){return new T(e,t,n)}}class _{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:_.create(this.ranges.map((n=>n.map(e,t))),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON())),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new _(e.ranges.map((e=>T.fromJSON(e))),e.main)}static single(e,t=e){return new _([_.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw new RangeError("A selection needs at least one range");for(let n=0,r=0;re?4:0))}static normalized(e,t=0){let n=e[t];e.sort(((e,t)=>e.from-t.from)),t=e.indexOf(n);for(let n=1;nr.head?_.range(s,o):_.range(o,s))}}return new _(e,t)}}function P(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let D=0;class R{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=D++,this.default=e([]),this.extensions="function"==typeof i?i(this):i}static define(e={}){return new R(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:N),!!e.static,e.enables)}of(e){return new B([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new B(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new B(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],(n=>t(n.field(e))))}}function N(e,t){return e==t||e.length==t.length&&e.every(((e,n)=>e===t[n]))}class B{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=D++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,i=this.id,o=e[i]>>1,s=2==this.type,a=!1,l=!1,c=[];for(let n of this.dependencies)"doc"==n?a=!0:"selection"==n?l=!0:0==(1&(null!==(t=e[n.id])&&void 0!==t?t:1))&&c.push(e[n.id]);return{create:e=>(e.values[o]=n(e),1),update(e,t){if(a&&t.docChanged||l&&(t.docChanged||t.selection)||F(e,c)){let t=n(e);if(s?!L(t,e.values[o],r):!r(t,e.values[o]))return e.values[o]=t,1}return 0},reconfigure:(e,t)=>{let a=n(e),l=t.config.address[i];if(null!=l){let n=Z(t,l);if(this.dependencies.every((n=>n instanceof R?t.facet(n)===e.facet(n):!(n instanceof q)||t.field(n,!1)==e.field(n,!1)))||(s?L(a,n,r):r(a,n)))return e.values[o]=n,0}return e.values[o]=a,1}}}}function L(e,t,n){if(e.length!=t.length)return!1;for(let r=0;re[t.id])),i=n.map((e=>e.type)),o=r.filter((e=>!(1&e))),s=e[t.id]>>1;function a(e){let n=[];for(let t=0;te===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(z).find((e=>e.field==this));return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}init(e){return[this,z.of({field:this,create:e})]}get extension(){return this}}function H(e){return t=>new U(t,e)}const W={highest:H(0),high:H(1),default:H(2),low:H(3),lowest:H(4)};class U{constructor(e,t){this.inner=e,this.prec=t}}class J{of(e){return new K(this,e)}reconfigure(e){return J.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class K{constructor(e,t){this.compartment=e,this.inner=t}}class G{constructor(e,t,n,r,i,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let r=[],i=Object.create(null),o=new Map;for(let n of function(e,t,n){let r=[[],[],[],[],[]],i=new Map;return function e(o,s){let a=i.get(o);if(null!=a){if(a<=s)return;let e=r[a].indexOf(o);e>-1&&r[a].splice(e,1),o instanceof K&&n.delete(o.compartment)}if(i.set(o,s),Array.isArray(o))for(let t of o)e(t,s);else if(o instanceof K){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let r=t.get(o.compartment)||o.inner;n.set(o.compartment,r),e(r,s)}else if(o instanceof U)e(o.inner,o.prec);else if(o instanceof q)r[s].push(o),o.provides&&e(o.provides,s);else if(o instanceof B)r[s].push(o),o.facet.extensions&&e(o.facet.extensions,2);else{let t=o.extension;if(!t)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(t,s)}}(e,2),r.reduce(((e,t)=>e.concat(t)))}(e,t,o))n instanceof q?r.push(n):(i[n.facet.id]||(i[n.facet.id]=[])).push(n);let s=Object.create(null),a=[],l=[];for(let e of r)s[e.id]=l.length<<1,l.push((t=>e.slot(t)));let c=null==n?void 0:n.config.facets;for(let e in i){let t=i[e],r=t[0].facet,o=c&&c[e]||[];if(t.every((e=>0==e.type)))if(s[r.id]=a.length<<1|1,N(o,t))a.push(n.facet(r));else{let e=r.combine(t.map((e=>e.value)));a.push(n&&r.compare(e,n.facet(r))?n.facet(r):e)}else{for(let e of t)0==e.type?(s[e.id]=a.length<<1|1,a.push(e.value)):(s[e.id]=l.length<<1,l.push((t=>e.dynamicSlot(t))));s[r.id]=l.length<<1,l.push((e=>V(e,r,t)))}}let h=l.map((e=>e(s)));return new G(e,o,h,s,a,i)}}function Q(e,t){if(1&t)return 2;let n=t>>1,r=e.status[n];if(4==r)throw new Error("Cyclic dependency between fields and/or facets");if(2&r)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function Z(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const Y=R.define(),X=R.define({combine:e=>e.some((e=>e)),static:!0}),ee=R.define({combine:e=>e.length?e[0]:void 0,static:!0}),te=R.define(),ne=R.define(),re=R.define(),ie=R.define({combine:e=>!!e.length&&e[0]});class oe{constructor(e,t){this.type=e,this.value=t}static define(){return new se}}class se{of(e){return new oe(this,e)}}class ae{constructor(e){this.map=e}of(e){return new le(this,e)}}class le{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new le(this.type,t)}is(e){return this.type==e}static define(e={}){return new ae(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}}le.reconfigure=le.define(),le.appendConfig=le.define();class ce{constructor(e,t,n,r,i,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=i,this.scrollIntoView=o,this._doc=null,this._state=null,n&&P(n,t.newLength),i.some((e=>e.type==ce.time))||(this.annotations=i.concat(ce.time.of(Date.now())))}static create(e,t,n,r,i,o){return new ce(e,t,n,r,i,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(ce.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function he(e,t){let n=[];for(let r=0,i=0;;){let o,s;if(r=e[r]))o=e[r++],s=e[r++];else{if(!(i=0;i--){let o=n[i](e);o&&Object.keys(o).length&&(r=ue(e,fe(t,o,e.changes.newLength),!0))}return r==e?e:ce.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}(n?function(e){let t=e.startState,n=!0;for(let r of t.facet(te)){let t=r(e);if(!1===t){n=!1;break}Array.isArray(t)&&(n=!0===n?t:he(n,t))}if(!0!==n){let r,i;if(!1===n)i=e.changes.invertedDesc,r=C.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,i=t.filtered.mapDesc(t.changes).invertedDesc}e=ce.create(t,r,e.selection&&e.selection.map(i),le.mapEffects(e.effects,i),e.annotations,e.scrollIntoView)}let r=t.facet(ne);for(let n=r.length-1;n>=0;n--){let i=r[n](e);e=i instanceof ce?i:Array.isArray(i)&&1==i.length&&i[0]instanceof ce?i[0]:de(t,me(i),!1)}return e}(i):i)}ce.time=oe.define(),ce.userEvent=oe.define(),ce.addToHistory=oe.define(),ce.remote=oe.define();const pe=[];function me(e){return null==e?pe:Array.isArray(e)?e:[e]}var ge;t.CharCategory=void 0,(ge=t.CharCategory||(t.CharCategory={}))[ge.Word=0]="Word",ge[ge.Space=1]="Space",ge[ge.Other=2]="Other";const ve=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let ye;try{ye=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}class be{constructor(e,t,n,r,i,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,o&&(o._state=this);for(let e=0;ei.set(t,e))),n=null),i.set(t.value.compartment,t.value.extension)):t.is(le.reconfigure)?(n=null,r=t.value):t.is(le.appendConfig)&&(n=null,r=me(r).concat(t.value));n?t=e.startState.values.slice():(n=G.resolve(r,i,this),t=new be(n,this.doc,this.selection,n.dynamicSlots.map((()=>null)),((e,t)=>t.reconfigure(e,this)),null).values),new be(n,e.newDoc,e.newSelection,t,((t,n)=>n.update(t,e)),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:e},range:_.cursor(t.from+e.length)})))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],o=me(n.effects);for(let n=1;ni.spec.fromJSON(o,e))))}return be.create({doc:e.doc,selection:_.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=G.resolve(e.extensions||[],new Map),r=e.doc instanceof n?e.doc:n.of((e.doc||"").split(t.staticFacet(be.lineSeparator)||k)),i=e.selection?e.selection instanceof _?e.selection:_.single(e.selection.anchor,e.selection.head):_.single(0);return P(i,r.length),t.staticFacet(X)||(i=i.asSingle()),new be(t,r,i,t.dynamicSlots.map((()=>null)),((e,t)=>t.create(e)),null)}get tabSize(){return this.facet(be.tabSize)}get lineBreak(){return this.facet(be.lineSeparator)||"\n"}get readOnly(){return this.facet(ie)}phrase(e,...t){for(let t of this.facet(be.phrases))if(Object.prototype.hasOwnProperty.call(t,e)){e=t[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,((e,n)=>{if("$"==n)return"$";let r=+(n||1);return!r||r>t.length?e:t[r-1]}))),e}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(Y))for(let o of i(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){return n=this.languageDataAt("wordChars",e).join(""),e=>{if(!/\S/.test(e))return t.CharCategory.Space;if(function(e){if(ye)return ye.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||ve.test(n)))return!0}return!1}(e))return t.CharCategory.Word;for(let r=0;r-1)return t.CharCategory.Word;return t.CharCategory.Other};var n}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),o=this.charCategorizer(e),s=e-r,a=e-r;for(;s>0;){let e=m(n,s,!1);if(o(n.slice(e,s))!=t.CharCategory.Word)break;s=e}for(;ae.length?e[0]:4}),be.lineSeparator=ee,be.readOnly=ie,be.phrases=R.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every((n=>e[n]==t[n]))}}),be.languageData=Y,be.changeFilter=te,be.transactionFilter=ne,be.transactionExtender=re,J.reconfigure=le.define();class we{eq(e){return this==e}range(e,t=e){return xe.create(e,t,this)}}we.prototype.startSide=we.prototype.endSide=0,we.prototype.point=!1,we.prototype.mapMode=t.MapMode.TrackDel;class xe{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new xe(e,t,n)}}function ke(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Se{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let o=r,s=i.length;;){if(o==s)return o;let r=o+s>>1,a=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==o)return a>=0?o:s;a>=0?s=r:o=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,i);ic||l==c&&h.startSide>0&&h.endSide<=0)continue;(c-l||h.endSide-h.startSide)<0||(o<0&&(o=l),h.point&&(s=Math.max(s,c-l)),n.push(h),r.push(l-o),i.push(c-o))}return{mapped:n.length?new Se(r,i,n,s):null,pos:o}}}class Ae{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new Ae(e,t,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:r=0,filterTo:i=this.length}=e,o=e.filter;if(0==t.length&&!o)return this;if(n&&(t=t.slice().sort(ke)),this.isEmpty)return t.length?Ae.of(t):this;let s=new Ee(this,null,-1).goto(0),a=0,l=[],c=new Ce;for(;s.value||a=0){let e=t[a++];c.addInner(e.from,e.to,e.value)||l.push(e)}else 1==s.rangeIndex&&s.chunkIndexthis.chunkEnd(s.chunkIndex)||is.to||i=i&&e<=i+o.length&&!1===o.between(i,e-i,t-i,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return je.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return je.from(e).goto(t)}static compare(e,t,n,r,i=-1){let o=e.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i)),s=t.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i)),a=Oe(o,s,n),l=new Ie(o,a,i),c=new Ie(s,a,i);n.iterGaps(((e,t,n)=>$e(l,e,c,t,n,r))),n.empty&&0==n.length&&$e(l,0,c,0,0,r)}static eq(e,t,n=0,r){null==r&&(r=1e9);let i=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0)),o=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0));if(i.length!=o.length)return!1;if(!i.length)return!0;let s=Oe(i,o),a=new Ie(i,s,0).goto(n),l=new Ie(o,s,0).goto(n);for(;;){if(a.to!=l.to||!Te(a.active,l.active)||a.point&&(!l.point||!a.point.eq(l.point)))return!1;if(a.to>r)return!0;a.next(),l.next()}}static spans(e,t,n,r,i=-1){let o=new Ie(e,null,i).goto(t),s=t,a=o.openStart;for(;;){let e=Math.min(o.to,n);if(o.point?(r.point(s,e,o.point,o.activeForPoint(o.to),a,o.pointRank),a=o.openEnd(e)+(o.to>e?1:0)):e>s&&(r.span(s,e,o.active,a),a=o.openEnd(e)),o.to>n)break;s=o.to,o.next()}return a}static of(e,t=!1){let n=new Ce;for(let r of e instanceof xe?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(ke);t=r}return e}(e):e)n.add(r.from,r.to,r.value);return n.finish()}}Ae.empty=new Ae([],[],null,-1),Ae.empty.nextLayer=Ae.empty;class Ce{constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}finishChunk(e){this.chunks.push(new Se(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new Ce)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),0))}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(Ae.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=Ae.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Oe(e,t,n){let r=new Map;for(let t of e)for(let e=0;e=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&r.push(new Ee(o,t,n,i));return 1==r.length?r[0]:new je(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)Me(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)Me(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Me(this.heap,0)}}}function Me(e,t){for(let n=e[t];;){let r=1+(t<<1);if(r>=e.length)break;let i=e[r];if(r+1=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}class Ie{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=je.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){_e(this.active,e),_e(this.activeTo,e),_e(this.activeRank,e),this.minActive=De(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&_e(n,i)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let i=this.cursor.value;if(i.point){if(!(t&&this.cursor.to==this.to&&this.cursor.frome&&r++,this.cursor.next()}}}if(n){let t=0;for(;t=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function $e(e,t,n,r,i,o){e.goto(t),n.goto(r);let s=r+i,a=r,l=r-t;for(;;){let t=e.to+l-n.to||e.endSide-n.endSide,r=t<0?e.to+l:n.to,i=Math.min(r,s);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&Te(e.activeForPoint(e.to+l),n.activeForPoint(n.to))||o.comparePoint(a,i,e.point,n.point):i>a&&!Te(e.active,n.active)&&o.compareRange(a,i,e.active,n.active),r>s)break;a=r,t<=0&&e.next(),t>=0&&n.next()}}function Te(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;n--)e[n+1]=e[n];e[t]=n}function De(e,t){let n=-1,r=1e9;for(let i=0;i=t)return r;if(r==e.length)break;i+=9==e.charCodeAt(r)?n-i%n:1,r=m(e,r)}return!0===r?-1:e.length},t.fromCodePoint=function(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}},3642:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7040),i=n(7223),o=n(6691);function s(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function a(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function l(e,t){if(!t.anchorNode)return!1;try{return a(e,t.anchorNode)}catch(e){return!1}}function c(e){return 3==e.nodeType?x(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function h(e,t,n,r){return!!n&&(f(e,t,n,r,-1)||f(e,t,n,r,1))}function u(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function f(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:d(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=u(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(i<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=i<0?d(e):0}}}function d(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}const p={left:0,right:0,top:0,bottom:0};function m(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function g(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}class v{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){this.set(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset)}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}let y,b=null;function w(e){if(e.setActive)return e.setActive();if(b)return e.focus(b);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==b?{get preventScroll(){return b={preventScroll:!0},!0}}:void 0),!b){b=!1;for(let e=0;et)return n.domBoundsAround(e,t,l);if(h>=e&&-1==r&&(r=a,i=l),l>t&&n.dom.parentNode==this.dom){o=a,s=c;break}c=h,l=h+n.breakAfter}return{from:i,to:s<0?n+this.length:s,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.dirty|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.dirty|=2),1&t.dirty)return;t.dirty|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.dirty&&this.markParentsDirty(!0))}setDOM(e){this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=C){this.markDirty();for(let n=e;nthis.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function M(e,t,n,r,i,o,s,a,l){let{children:c}=e,h=c.length?c[t]:null,u=o.length?o[o.length-1]:null,f=u?u.breakAfter:s;if(!(t==r&&h&&!s&&!f&&o.length<2&&h.merge(n,i,o.length?u:null,0==n,a,l))){if(r0&&(!s&&o.length&&h.merge(n,h.length,o[0],!1,a,0)?h.breakAfter=o.shift().breakAfter:(n2);var z,q={mac:V||/Mac/.test($.platform),windows:/Win/.test($.platform),linux:/Linux|X11/.test($.platform),ie:R,ie_version:P?T.documentMode||6:D?+D[1]:_?+_[1]:0,gecko:N,gecko_version:N?+(/Firefox\/(\d+)/.exec($.userAgent)||[0,0])[1]:0,chrome:!!B,chrome_version:B?+B[1]:0,ios:V,android:/Android\b/.test($.userAgent),webkit:L,safari:F,webkit_version:L?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=T.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class H extends O{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){3==e.nodeType&&this.createDOM(e)}merge(e,t,n){return(!n||n instanceof H&&!(this.length-(t-e)+n.length>256))&&(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new H(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new A(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return U(this.dom,e,t)}}class W extends O{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let e of t)e.setParent(this)}setAttrs(e){if(S(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.dirty|=6)}sync(e){this.dom?4&this.dirty&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e)}merge(e,t,n,r,i,o){return!(n&&(!(n instanceof W&&n.mark.eq(this.mark))||e&&i<=0||te&&t.push(n=e&&(r=i),n=s,i++}let o=this.length-e;return this.length=e,r>-1&&(this.children.length=r,this.markDirty()),new W(this.mark,t,o)}domAtPos(e){return Y(this.dom,this.children,e)}coordsAt(e,t){return ee(this,e,t)}}function U(e,t,n){let r=e.nodeValue.length;t>r&&(t=r);let i=t,o=t,s=0;0==t&&n<0||t==r&&n>=0?q.chrome||q.gecko||(t?(i--,s=1):o=0)?0:a.length-1];return q.safari&&!s&&0==l.width&&(l=Array.prototype.find.call(a,(e=>e.width))||l),s?m(l,s<0):l||null}class J extends O{constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}static create(e,t,n){return new(e.customView||J)(e,t,n)}split(e){let t=J.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(){this.dom&&this.widget.updateDOM(this.dom)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,n,r,i,o){return!(n&&(!(n instanceof J&&this.widget.compare(n.widget))||e>0&&i<=0||t0?n.length-1:0;r=n[t],!(e>0?0==t:t==n.length-1||r.top0?-1:1);return 0==e&&t>0||e==this.length&&t<=0?r:m(r,0==e)}get isEditable(){return!1}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class K extends J{domAtPos(e){let{topView:t,text:n}=this.widget;return t?G(e,0,t,n,((e,t)=>e.domAtPos(t)),(e=>new A(n,Math.min(e,n.nodeValue.length)))):new A(n,Math.min(e,n.nodeValue.length))}sync(){this.setDOM(this.widget.toDOM())}localPosFromDOM(e,t){let{topView:n,text:r}=this.widget;return n?Q(e,t,n,r):Math.min(t,this.length)}ignoreMutation(){return!1}get overrideDOMText(){return null}coordsAt(e,t){let{topView:n,text:r}=this.widget;return n?G(e,t,n,r,((e,t,n)=>e.coordsAt(t,n)),((e,t)=>U(r,e,t))):U(r,e,t)}destroy(){var e;super.destroy(),null===(e=this.widget.topView)||void 0===e||e.destroy()}get isEditable(){return!0}}function G(e,t,n,r,i,o){if(n instanceof W){for(let s of n.children){let n=a(s.dom,r),l=n?r.nodeValue.length:s.length;if(e=0;)if(t<0?r>0:r0?-1:1);return n&&n.topt.top?{left:t.left,right:t.right,top:n.top,bottom:n.bottom}:t}get overrideDOMText(){return r.Text.empty}}function Y(e,t,n){let r=0;for(let i=0;ri&&n0;r--){let n=t[r-1].dom;if(n.parentNode==e)return A.after(n)}return new A(e,0)}function X(e,t,n){let r,{children:i}=e;n>0&&t instanceof W&&i.length&&(r=i[i.length-1])instanceof W&&r.mark.eq(t.mark)?X(r,t.children[0],n-1):(i.push(t),t.setParent(e)),e.length+=t.length}function ee(e,t,n){for(let r=0,i=0;i0?a>=t:a>t)&&(t0)){let e=0;if(a==r){if(s.getSide()<=0)continue;e=n=-s.getSide()}let i=s.coordsAt(Math.max(0,t-r),n);return e&&i?m(i,n<0):i}r=a}let r=e.dom.lastChild;if(!r)return e.dom.getBoundingClientRect();let i=c(r);return i[i.length-1]||null}function te(e,t){for(let n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}function ne(e,t){if(e==t)return!0;if(!e||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!=r.length)return!1;for(let i of n)if(-1==r.indexOf(i)||e[i]!==t[i])return!1;return!0}function re(e,t,n){let r=null;if(t)for(let i in t)n&&i in n||e.removeAttribute(r=i);if(n)for(let i in n)t&&t[i]==n[i]||e.setAttribute(r=i,n[i]);return!!r}H.prototype.children=J.prototype.children=Z.prototype.children=C;class ie{eq(e){return!1}updateDOM(e){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}ignoreEvent(e){return!0}get customView(){return null}destroy(e){}}t.BlockType=void 0,(z=t.BlockType||(t.BlockType={}))[z.Text=0]="Text",z[z.WidgetBefore=1]="WidgetBefore",z[z.WidgetAfter=2]="WidgetAfter",z[z.WidgetRange=3]="WidgetRange";class oe extends r.RangeValue{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new se(e)}static widget(e){let t=e.side||0,n=!!e.block;return t+=n?t>0?3e8:-4e8:t>0?1e8:-1e8,new le(e,t,t,n,e.widget||null,!1)}static replace(e){let t,n,r=!!e.block;if(e.isBlockGap)t=-5e8,n=4e8;else{let{start:i,end:o}=ce(e,r);t=(i?r?-3e8:-1:5e8)-1,n=1+(o?r?2e8:1:-6e8)}return new le(e,t,n,r,e.widget||null,!0)}static line(e){return new ae(e)}static set(e,t=!1){return r.RangeSet.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}oe.none=r.RangeSet.empty;class se extends oe{constructor(e){let{start:t,end:n}=ce(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){return this==e||e instanceof se&&this.tagName==e.tagName&&this.class==e.class&&ne(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}se.prototype.point=!1;class ae extends oe{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof ae&&ne(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}ae.prototype.mapMode=r.MapMode.TrackBefore,ae.prototype.point=!0;class le extends oe{constructor(e,t,n,i,o,s){super(t,n,o,e),this.block=i,this.isReplace=s,this.mapMode=i?t<=0?r.MapMode.TrackBefore:r.MapMode.TrackAfter:r.MapMode.TrackDel}get type(){return this.startSide=5}eq(e){return e instanceof le&&((t=this.widget)==(n=e.widget)||!!(t&&n&&t.compare(n)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,n}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function ce(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return null==n&&(n=e.inclusive),null==r&&(r=e.inclusive),{start:null!=n?n:t,end:null!=r?r:t}}function he(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}le.prototype.point=!0;class ue extends O{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,n,r,i,o){if(n){if(!(n instanceof ue))return!1;this.dom||n.transferDOM(this)}return r&&this.setDeco(n?n.attrs:null),I(this,e,t,n?n.children:[],i,o),!0}split(e){let t=new ue;if(t.breakAfter=this.breakAfter,0==this.length)return t;let{i:n,off:r}=this.childPos(e);r&&(t.append(this.children[n].split(r),0),this.children[n].merge(r,this.children[n].length,null,!1,0,0),n++);for(let e=n;e0&&0==this.children[n-1].length;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){ne(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){X(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=te(t,this.attrs||{})),n&&(this.attrs=te({class:n},this.attrs||{}))}domAtPos(e){return Y(this.dom,this.children,e)}reuseDOM(e){"DIV"==e.nodeName&&(this.setDOM(e),this.dirty|=6)}sync(e){var t;this.dom?4&this.dirty&&(S(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(re(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e);let n=this.dom.lastChild;for(;n&&O.get(n)instanceof W;)n=n.lastChild;if(!(n&&this.length&&("BR"==n.nodeName||0!=(null===(t=O.get(n))||void 0===t?void 0:t.isEditable)||q.ios&&this.children.some((e=>e instanceof H))))){let e=document.createElement("BR");e.cmIgnore=!0,this.dom.appendChild(e)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let e=0;for(let t of this.children){if(!(t instanceof H)||/[^ -~]/.test(t.text))return null;let n=c(t.dom);if(1!=n.length)return null;e+=n[0].width}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length}:null}coordsAt(e,t){return ee(this,e,t)}become(e){return!1}get type(){return t.BlockType.Text}static find(e,t){for(let n=0,r=0;n=t){if(i instanceof ue)return i;if(o>t)break}r=o+i.breakAfter}return null}}class fe extends O{constructor(e,t,n){super(),this.widget=e,this.length=t,this.type=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,r,i,o){return!(n&&(!(n instanceof fe&&this.widget.compare(n.widget))||e>0&&i<=0||t0;){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skip);if(this.skip=0,r)throw new Error("Ran out of text content when drawing inline views");if(n){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer([]),this.curLine=null,e--;continue}this.text=t,this.textOff=0}let r=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(0,n)),this.getLine().append(pe(new H(this.text.slice(this.textOff,this.textOff+r)),t),n),this.atCursorPos=!0,this.textOff+=r,e-=r,n=0}}span(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}point(e,n,r,i,o,s){if(this.disallowBlockEffectsFor[s]&&r instanceof le){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=n-e;if(r instanceof le)if(r.block){let{type:e}=r;e!=t.BlockType.WidgetAfter||this.posCovered()||this.getLine(),this.addBlockWidget(new fe(r.widget||new me("div"),a,e))}else{let t=J.create(r.widget||new me("span"),a,r.startSide),s=this.atCursorPos&&!t.isEditable&&o<=i.length&&(e0),l=!t.isEditable&&(ee.some((e=>e))});class Se{constructor(e,t="nearest",n="nearest",r=5,i=5){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i}map(e){return e.empty?this:new Se(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const Ae=r.StateEffect.define({map:(e,t)=>e.map(t)});function Ce(e,t,n){let r=e.facet(be);r.length?r[0](t):window.onerror?window.onerror(String(t),n,void 0,void 0,t):n?console.error(n+":",t):console.error(t)}const Oe=r.Facet.define({combine:e=>!e.length||e[0]});let Ee=0;const je=r.Facet.define();class Me{constructor(e,t,n,r){this.id=e,this.create=t,this.domEventHandlers=n,this.extension=r(this)}static define(e,t){const{eventHandlers:n,provide:r,decorations:i}=t||{};return new Me(Ee++,e,n,(e=>{let t=[je.of(e)];return i&&t.push(_e.of((t=>{let n=t.plugin(e);return n?i(n):oe.none}))),r&&t.push(r(e)),t}))}static fromClass(e,t){return Me.define((t=>new e(t)),t)}}class Ie{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(Ce(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Ce(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(t){Ce(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const $e=r.Facet.define(),Te=r.Facet.define(),_e=r.Facet.define(),Pe=r.Facet.define(),De=r.Facet.define(),Re=r.Facet.define();class Ne{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new Ne(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toAc)break;i+=2}if(!a)return n;new Ne(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),o=a.toA,s=a.toB}}}class Be{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=r.ChangeSet.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let i=[];this.changes.iterChangedRanges(((e,t,n,r)=>i.push(new Ne(e,t,n,r)))),this.changedRanges=i;let o=e.hasFocus;o!=e.inputState.notifiedFocused&&(e.inputState.notifiedFocused=o,this.flags|=1)}static create(e,t,n){return new Be(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(10&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((e=>e.selection))}get empty(){return 0==this.flags&&0==this.transactions.length}}var Le;t.Direction=void 0,(Le=t.Direction||(t.Direction={}))[Le.LTR=0]="LTR",Le[Le.RTL=1]="RTL";const Fe=t.Direction.LTR,Ve=t.Direction.RTL;function ze(e){let t=[];for(let n=0;n=t){if(s.level==n)return o;(i<0||(0!=r?r<0?s.fromt:e[i].level>s.level))&&(i=o)}}if(i<0)throw new RangeError("Index out of range");return i}}const Ge=[];function Qe(e,t){let n=e.length,r=t==Fe?1:2,i=t==Fe?2:1;if(!e||1==r&&!Je.test(e))return Ze(n);for(let t=0,i=r,s=r;t=0;e-=3)if(Ue[e+1]==-o){let t=Ue[e+2],n=2&t?r:4&t?1&t?i:r:0;n&&(Ge[a]=Ge[Ue[e]]=n),l=e;break}}else{if(189==Ue.length)break;Ue[l++]=a,Ue[l++]=t,Ue[l++]=c}else if(2==(s=Ge[a])||1==s){let e=s==r;c=e?0:1;for(let t=l-3;t>=0;t-=3){let n=Ue[t+2];if(2&n)break;if(e)Ue[t+2]|=2;else{if(4&n)break;Ue[t+2]|=4}}}for(let e=0;et;){let e=n,r=2!=Ge[--n];for(;n>t&&r==(2!=Ge[n-1]);)n--;s.push(new Ke(n,e,r?2:1))}else s.push(new Ke(t,e,0))}else for(let e=0;e1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=s-1);n=o+s}}readNode(e){if(e.cmIgnore)return;let t=O.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+Math.min(t,n.offset))}}function nt(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}class rt{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class it extends O{constructor(e){super(),this.view=e,this.compositionDeco=oe.none,this.decorations=[],this.dynamicDecorationMap=[],this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new ue],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Ne(0,0,0,e.state.doc.length)],0)}get root(){return this.view.root}get editorView(){return this.view}get length(){return this.view.state.doc.length}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every((({fromA:e,toA:t})=>tthis.minWidthTo))?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.view.inputState.composing<0?this.compositionDeco=oe.none:(e.transactions.length||this.dirty)&&(this.compositionDeco=function(e,t){let n=st(e);if(!n)return oe.none;let{from:r,to:i,node:o,text:s}=n,a=t.mapPos(r,1),l=Math.max(a,t.mapPos(i,-1)),{state:c}=e,h=3==o.nodeType?o.nodeValue:new tt([],c).readRange(o.firstChild,null).text;if(l-a{this.dom.style.height=this.view.viewState.contentHeight+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let e=q.chrome||q.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.sync(e),this.dirty=0,e&&(e.written||n.selectionRange.focusNode!=e.node)&&(this.forceSelection=!0),this.dom.style.height=""}));let r=[];if(this.view.viewport.from||this.view.viewport.to=0?e[t]:null;if(!r)break;let{fromA:i,toA:o,fromB:s,toB:a}=r,{content:l,breakAtStart:c,openStart:h,openEnd:u}=de.build(this.view.state.doc,s,a,this.decorations,this.dynamicDecorationMap),{i:f,off:d}=n.findPos(o,1),{i:p,off:m}=n.findPos(i,-1);M(this,p,m,f,d,l,c,h,u)}}updateSelection(e=!1,t=!1){if(!e&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange(),!t&&!this.mayControlSelection()||q.ios&&this.view.inputState.rapidCompositionStart)return;let n=this.forceSelection;this.forceSelection=!1;let r=this.view.state.selection.main,i=this.domAtPos(r.anchor),o=r.empty?i:this.domAtPos(r.head);if(q.gecko&&r.empty&&1==(a=i).node.nodeType&&a.node.firstChild&&(0==a.offset||"false"==a.node.childNodes[a.offset-1].contentEditable)&&(a.offset==a.node.childNodes.length||"false"==a.node.childNodes[a.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore((()=>i.node.insertBefore(e,i.node.childNodes[i.offset]||null))),i=o=new A(e,0),n=!0}var a;let l=this.view.observer.selectionRange;!n&&l.focusNode&&h(i.node,i.offset,l.anchorNode,l.anchorOffset)&&h(o.node,o.offset,l.focusNode,l.focusOffset)||(this.view.observer.ignore((()=>{q.android&&q.chrome&&this.dom.contains(l.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(l.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let e=s(this.root);if(e)if(r.empty){if(q.gecko){let e=(t=i.node,n=i.offset,1!=t.nodeType?0:(n&&"false"==t.childNodes[n-1].contentEditable?1:0)|(nr.head&&([i,o]=[o,i]),t.setEnd(o.node,o.offset),t.setStart(i.node,i.offset),e.removeAllRanges(),e.addRange(t)}var t,n})),this.view.observer.setSelectionRange(i,o)),this.impreciseAnchor=i.precise?null:new A(l.anchorNode,l.anchorOffset),this.impreciseHead=o.precise?null:new A(l.focusNode,l.focusOffset)}enforceCursorAssoc(){if(this.compositionDeco.size)return;let e=this.view.state.selection.main,t=s(this.root);if(!(t&&e.empty&&e.assoc&&t.modify))return;let n=ue.find(this,e.head);if(!n)return;let r=n.posAtStart;if(e.head==r||e.head==r+n.length)return;let i=this.coordsAt(e.head,-1),o=this.coordsAt(e.head,1);if(!i||!o||i.bottom>o.top)return;let a=this.domAtPos(e.head+e.assoc);t.collapse(a.node,a.offset),t.modify("move",e.assoc<0?"forward":"backward","lineboundary")}mayControlSelection(){let e=this.root.activeElement;return e==this.dom||l(this.dom,this.view.observer.selectionRange)&&!(e&&this.dom.contains(e))}nearest(e){for(let t=e;t;){let e=O.get(t);if(e&&e.rootView==this)return e;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;ts||e==s&&o.type!=t.BlockType.WidgetBefore&&o.type!=t.BlockType.WidgetAfter&&(!i||2==n||this.children[i-1].breakAfter||this.children[i-1].type==t.BlockType.WidgetBefore&&n>-2))return o.coordsAt(e-s,n);r=s}}measureVisibleLineHeights(e){let n=[],{from:r,to:i}=e,o=this.view.contentDOM.clientWidth,s=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==t.Direction.LTR;for(let e=0,t=0;ti)break;if(e>=r){let t=h.dom.getBoundingClientRect();if(n.push(t.height),s){let n=h.dom.lastChild,r=n?c(n):[];if(r.length){let n=r[r.length-1],i=l?n.right-t.left:t.right-n.left;i>a&&(a=i,this.minWidth=o,this.minWidthFrom=e,this.minWidthTo=u)}}}e=u+h.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return"rtl"==getComputedStyle(this.children[n].dom).direction?t.Direction.RTL:t.Direction.LTR}measureTextSize(){for(let e of this.children)if(e instanceof ue){let t=e.measureTextSize();if(t)return t}let e,t,n=document.createElement("div");return n.className="cm-line",n.style.width="99999px",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((()=>{this.dom.appendChild(n);let r=c(n.firstChild)[0];e=n.getBoundingClientRect().height,t=r?r.width/27:7,n.remove()})),{lineHeight:e,charWidth:t}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new j(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],o=i?i.from-1:this.length;if(o>n){let r=t.lineBlockAt(o).bottom-t.lineBlockAt(n).top;e.push(oe.replace({widget:new ot(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!i)break;n=i.to+1}return oe.set(e)}updateDeco(){let e=this.view.state.facet(_e).map(((e,t)=>(this.dynamicDecorationMap[t]="function"==typeof e)?e(this.view):e));for(let t=e.length;tr.anchor?-1:1);if(!i)return;!r.empty&&(n=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(i={left:Math.min(i.left,n.left),top:Math.min(i.top,n.top),right:Math.max(i.right,n.right),bottom:Math.max(i.bottom,n.bottom)});let o=0,s=0,a=0,l=0;for(let e of this.view.state.facet(De).map((e=>e(this.view))))if(e){let{left:t,right:n,top:r,bottom:i}=e;null!=t&&(o=Math.max(o,t)),null!=n&&(s=Math.max(s,n)),null!=r&&(a=Math.max(a,r)),null!=i&&(l=Math.max(l,i))}let c={left:i.left-o,top:i.top-a,right:i.right+s,bottom:i.bottom+l};!function(e,t,n,r,i,o,s,a){let l=e.ownerDocument,c=l.defaultView;for(let h=e;h;)if(1==h.nodeType){let e,u=h==l.body;if(u)e=g(c);else{if(h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.parentNode;continue}let t=h.getBoundingClientRect();e={left:t.left,right:t.left+h.clientWidth,top:t.top,bottom:t.top+h.clientHeight}}let f=0,d=0;if("nearest"==i)t.top0&&t.bottom>e.bottom+d&&(d=t.bottom-e.bottom+d+s)):t.bottom>e.bottom&&(d=t.bottom-e.bottom+s,n<0&&t.top-d0&&t.right>e.right+f&&(f=t.right-e.right+f+o)):t.right>e.right&&(f=t.right-e.right+o,n<0&&t.left0&&n<=0)t=d(e=e.childNodes[t-1]);else{if(!(1==e.nodeType&&t=0))return null;e=e.childNodes[t],t=0}}}class ct{constructor(){this.changes=[]}compareRange(e,t){he(e,t,this.changes)}comparePoint(e,t){he(e,t,this.changes)}}function ht(e,t){return t.left>e?t.left-e:Math.max(0,e-t.right)}function ut(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function ft(e,t){return e.topt.top+1}function dt(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function mt(e,t,n){let r,i,o,s,a,l,h,u;for(let f=e.firstChild;f;f=f.nextSibling){let e=c(f);for(let c=0;cm||s==m&&o>p)&&(r=f,i=d,o=p,s=m),0==p?n>d.bottom&&(!h||h.bottomd.top)&&(l=f,u=d):h&&ft(h,d)?h=pt(h,d.bottom):u&&ft(u,d)&&(u=dt(u,d.top))}}if(h&&h.bottom>=n?(r=a,i=h):u&&u.top<=n&&(r=l,i=u),!r)return{node:e,offset:0};let f=Math.max(i.left,Math.min(i.right,t));return 3==r.nodeType?gt(r,f,n):o||"true"!=r.contentEditable?{node:e,offset:Array.prototype.indexOf.call(e.childNodes,r)+(t>=(i.left+i.right)/2?1:0)}:mt(r,f,n)}function gt(e,t,n){let r=e.nodeValue.length,i=-1,o=1e9,s=0;for(let a=0;an?c.top-n:n-c.bottom)-1;if(c.left-1<=t&&c.right+1>=t&&h=(c.left+c.right)/2,r=n;if((q.chrome||q.gecko)&&x(e,a).getBoundingClientRect().left==c.right&&(r=!n),h<=0)return{node:e,offset:a+(r?1:0)};i=a+(r?1:0),o=h}}}return{node:e,offset:i>-1?i:s>0?e.nodeValue.length:0}}function vt(e,{x:n,y:r},i,o=-1){var s;let a,l=e.contentDOM.getBoundingClientRect(),c=l.top+e.viewState.paddingTop,{docHeight:h}=e.viewState,u=r-c;if(u<0)return 0;if(u>h)return e.state.doc.length;for(let n=e.defaultLineHeight/2,r=!1;a=e.elementAtHeight(u),a.type!=t.BlockType.Text;)for(;u=o>0?a.bottom+n:a.top-n,!(u>=0&&u<=h);){if(r)return i?null:0;r=!0,o=-o}r=c+u;let f=a.from;if(fe.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:i?null:yt(e,l,a,n,r);let d=e.dom.ownerDocument,p=e.root.elementFromPoint?e.root:d,m=p.elementFromPoint(n,r);m&&!e.contentDOM.contains(m)&&(m=null),m||(n=Math.max(l.left+1,Math.min(l.right-1,n)),m=p.elementFromPoint(n,r),m&&!e.contentDOM.contains(m)&&(m=null));let g,v=-1;if(m&&0!=(null===(s=e.docView.nearest(m))||void 0===s?void 0:s.isEditable))if(d.caretPositionFromPoint){let e=d.caretPositionFromPoint(n,r);e&&({offsetNode:g,offset:v}=e)}else if(d.caretRangeFromPoint){let e=d.caretRangeFromPoint(n,r);e&&(({startContainer:g,startOffset:v}=e),(q.safari&&function(e,t,n){let r;if(3!=e.nodeType||t!=(r=e.nodeValue.length))return!1;for(let t=e.nextSibling;t;t=t.nextSibling)if(1!=t.nodeType||"BR"!=t.nodeName)return!1;return x(e,r-1,r).getBoundingClientRect().left>n}(g,v,n)||q.chrome&&function(e,t,n){if(0!=t)return!1;for(let t=e;;){let e=t.parentNode;if(!e||1!=e.nodeType||e.firstChild!=t)return!1;if(e.classList.contains("cm-line"))break;t=e}return n-(1==e.nodeType?e.getBoundingClientRect():x(e,0,Math.max(e.nodeValue.length,1)).getBoundingClientRect()).left>5}(g,v,n))&&(g=void 0))}if(!g||!e.docView.dom.contains(g)){let t=ue.find(e.docView,f);if(!t)return u>a.top+a.height/2?a.to:a.from;({node:g,offset:v}=mt(t.dom,n,r))}return e.docView.posFromDOM(g,v)}function yt(e,t,n,i,o){let s=Math.round((i-t.left)*e.defaultCharacterWidth);e.lineWrapping&&n.height>1.5*e.defaultLineHeight&&(s+=Math.floor((o-n.top)/e.defaultLineHeight)*e.viewState.heightOracle.lineLength);let a=e.state.sliceDoc(n.from,n.to);return n.from+r.findColumn(a,s,e.state.tabSize)}function bt(e,t,n,i){let o=e.state.doc.lineAt(t.head),s=e.bidiSpans(o),a=e.textDirectionAt(o.from);for(let l=t,c=null;;){let t=Xe(o,s,a,l,n),h=Ye;if(!t){if(o.number==(n?e.state.doc.lines:1))return l;h="\n",o=e.state.doc.line(o.number+(n?1:-1)),s=e.bidiSpans(o),t=r.EditorSelection.cursor(n?o.from:o.to)}if(c){if(!c(h))return l}else{if(!i)return t;c=i(h)}l=t}}function wt(e,t,n){let i=e.state.facet(Pe).map((t=>t(e)));for(;;){let e=!1;for(let o of i)o.between(n.from-1,n.from+1,((i,o,s)=>{n.from>i&&n.fromn.from?r.EditorSelection.cursor(i,1):r.EditorSelection.cursor(o,-1),e=!0)}));if(!e)return n}}class xt{constructor(e){this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.chromeScrollHack=-1,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.rapidCompositionStart=!1,this.mouseSelection=null;for(let t in Ot){let n=Ot[t];e.contentDOM.addEventListener(t,(r=>{Ct(e,r)&&!this.ignoreDuringComposition(r)&&("keydown"==t&&this.keydown(e,r)||(this.mustFlushObserver(r)&&e.observer.forceFlush(),this.runCustomHandlers(t,e,r)?r.preventDefault():n(e,r)))}),Et[t]),this.registeredEvents.push(t)}q.chrome&&102==q.chrome_version&&e.scrollDOM.addEventListener("wheel",(()=>{this.chromeScrollHack<0?e.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout((()=>{this.chromeScrollHack=-1,e.contentDOM.style.pointerEvents=""}),100)}),{passive:!0}),this.notifiedFocused=e.hasFocus,q.safari&&e.contentDOM.addEventListener("input",(()=>null))}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e,t){var n;let r;this.customHandlers=[];for(let i of t)if(r=null===(n=i.update(e).spec)||void 0===n?void 0:n.domEventHandlers){this.customHandlers.push({plugin:i.value,handlers:r});for(let t in r)this.registeredEvents.indexOf(t)<0&&"scroll"!=t&&(this.registeredEvents.push(t),e.contentDOM.addEventListener(t,(n=>{Ct(e,n)&&this.runCustomHandlers(t,e,n)&&n.preventDefault()})))}}runCustomHandlers(e,t,n){for(let r of this.customHandlers){let i=r.handlers[e];if(i)try{if(i.call(r.plugin,n,t)||n.defaultPrevented)return!0}catch(e){Ce(t.state,e)}}return!1}runScrollHandlers(e,t){this.lastScrollTop=e.scrollDOM.scrollTop,this.lastScrollLeft=e.scrollDOM.scrollLeft;for(let n of this.customHandlers){let r=n.handlers.scroll;if(r)try{r.call(n.plugin,t,e)}catch(t){Ce(e.state,t)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),9==t.keyCode&&Date.now()e.keyCode==t.keyCode)))||t.ctrlKey||t.altKey||t.metaKey||t.synthetic||(this.pendingIOSKey=n,setTimeout((()=>this.flushIOSKey(e)),250),0))}flushIOSKey(e){let t=this.pendingIOSKey;return!!t&&(this.pendingIOSKey=void 0,k(e.contentDOM,t.key,t.keyCode))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(q.safari&&!q.ios&&Date.now()-this.compositionEndedAt<100)&&(this.compositionEndedAt=0,!0))}mustFlushObserver(e){return"keydown"==e.type&&229!=e.keyCode||"compositionend"==e.type&&!q.ios}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}const kt=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],St=[16,17,18,20,91,92,224,225];class At{constructor(e,t,n,i){this.view=e,this.style=n,this.mustSelect=i,this.lastEvent=t;let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(r.EditorState.allowMultipleSelections)&&function(e,t){let n=e.state.facet(ge);return n.length?n[0](t):q.mac?t.metaKey:t.ctrlKey}(e,t),this.dragMove=function(e,t){let n=e.state.facet(ve);return n.length?n[0](t):q.mac?!t.altKey:!t.ctrlKey}(e,t),this.dragging=!(!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=s(e.root);if(!r||0==r.rangeCount)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}(e,t)||1!=Lt(t))&&null,!1===this.dragging&&(t.preventDefault(),this.select(t))}move(e){if(0==e.buttons)return this.destroy();!1===this.dragging&&this.select(this.lastEvent=e)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}select(e){let t=this.style.get(e,this.extend,this.multiple);!this.mustSelect&&t.eq(this.view.state.selection)&&t.main.assoc==this.view.state.selection.main.assoc||this.view.dispatch({selection:t,userEvent:"select.pointer",scrollIntoView:!0}),this.mustSelect=!1}update(e){e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)&&setTimeout((()=>this.select(this.lastEvent)),20)}}function Ct(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n,r=t.target;r!=e.contentDOM;r=r.parentNode)if(!r||11==r.nodeType||(n=O.get(r))&&n.ignoreEvent(t))return!1;return!0}const Ot=Object.create(null),Et=Object.create(null),jt=q.ie&&q.ie_version<15||q.ios&&q.webkit_version<604;function Mt(e,t){let n,{state:i}=e,o=1,s=i.toText(t),a=s.lines==i.selection.ranges.length;if(null!=Vt&&i.selection.ranges.every((e=>e.empty))&&Vt==s.toString()){let e=-1;n=i.changeByRange((n=>{let l=i.doc.lineAt(n.from);if(l.from==e)return{range:n};e=l.from;let c=i.toText((a?s.line(o++).text:t)+i.lineBreak);return{changes:{from:l.from,insert:c},range:r.EditorSelection.cursor(n.from+c.length)}}))}else n=a?i.changeByRange((e=>{let t=s.line(o++);return{changes:{from:e.from,to:e.to,insert:t.text},range:r.EditorSelection.cursor(e.from+t.length)}})):i.replaceSelection(s);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}function It(e,t,n,i){if(1==i)return r.EditorSelection.cursor(t,n);if(2==i)return function(e,t,n=1){let i=e.charCategorizer(t),o=e.doc.lineAt(t),s=t-o.from;if(0==o.length)return r.EditorSelection.cursor(t);0==s?n=1:s==o.length&&(n=-1);let a=s,l=s;n<0?a=r.findClusterBreak(o.text,s,!1):l=r.findClusterBreak(o.text,s);let c=i(o.text.slice(a,l));for(;a>0;){let e=r.findClusterBreak(o.text,a,!1);if(i(o.text.slice(e,a))!=c)break;a=e}for(;l{e.inputState.setSelectionOrigin("select"),27==t.keyCode?e.inputState.lastEscPress=Date.now():St.indexOf(t.keyCode)<0&&(e.inputState.lastEscPress=0)},Ot.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},Ot.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},Et.touchstart=Et.touchmove={passive:!0},Ot.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3&&1==Lt(t))return;let n=null;for(let r of e.state.facet(ye))if(n=r(e,t),n)break;if(n||0!=t.button||(n=function(e,t){let n=Pt(e,t),i=Lt(t),o=e.state.selection,s=n,a=t;return{update(e){e.docChanged&&(n&&(n.pos=e.changes.mapPos(n.pos)),o=o.map(e.changes),a=null)},get(t,l,c){let h;if(a&&t.clientX==a.clientX&&t.clientY==a.clientY?h=s:(h=s=Pt(e,t),a=t),!h||!n)return o;let u=It(e,h.pos,h.bias,i);if(n.pos!=h.pos&&!l){let t=It(e,n.pos,n.bias,i),o=Math.min(t.from,u.from),s=Math.max(t.to,u.to);u=o1&&o.ranges.some((e=>e.eq(u)))?function(e,t){for(let n=0;;n++)if(e.ranges[n].eq(t))return r.EditorSelection.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}(o,u):c?o.addRange(u):r.EditorSelection.create([u])}}}(e,t)),n){let r=e.root.activeElement!=e.contentDOM;r&&e.observer.ignore((()=>w(e.contentDOM))),e.inputState.startMouseSelection(new At(e,t,n,r))}};let $t=(e,t)=>e>=t.top&&e<=t.bottom,Tt=(e,t,n)=>$t(t,n)&&e>=n.left&&e<=n.right;function _t(e,t,n,r){let i=ue.find(e.docView,t);if(!i)return 1;let o=t-i.posAtStart;if(0==o)return 1;if(o==i.length)return-1;let s=i.coordsAt(o,-1);if(s&&Tt(n,r,s))return-1;let a=i.coordsAt(o,1);return a&&Tt(n,r,a)?1:s&&$t(r,s)?-1:1}function Pt(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:_t(e,n,t.clientX,t.clientY)}}const Dt=q.ie&&q.ie_version<=11;let Rt=null,Nt=0,Bt=0;function Lt(e){if(!Dt)return e.detail;let t=Rt,n=Bt;return Rt=e,Bt=Date.now(),Nt=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(Nt+1)%3:1}function Ft(e,t,n,r){if(!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1);t.preventDefault();let{mouseSelection:o}=e.inputState,s=r&&o&&o.dragging&&o.dragMove?{from:o.dragging.from,to:o.dragging.to}:null,a={from:i,insert:n},l=e.state.changes(s?[s,a]:a);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"})}Ot.dragstart=(e,t)=>{let{selection:{main:n}}=e.state,{mouseSelection:r}=e.inputState;r&&(r.dragging=n),t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(n.from,n.to)),t.dataTransfer.effectAllowed="copyMove")},Ot.drop=(e,t)=>{if(!t.dataTransfer)return;if(e.state.readOnly)return t.preventDefault();let n=t.dataTransfer.files;if(n&&n.length){t.preventDefault();let r=Array(n.length),i=0,o=()=>{++i==n.length&&Ft(e,t,r.filter((e=>null!=e)).join(e.state.lineBreak),!1)};for(let e=0;e{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),o()},t.readAsText(n[e])}}else Ft(e,t,t.dataTransfer.getData("Text"),!0)},Ot.paste=(e,t)=>{if(e.state.readOnly)return t.preventDefault();e.observer.flush();let n=jt?null:t.clipboardData;n?(Mt(e,n.getData("text/plain")),t.preventDefault()):function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((()=>{e.focus(),n.remove(),Mt(e,n.value)}),50)}(e)};let Vt=null;function zt(e){setTimeout((()=>{e.hasFocus!=e.inputState.notifiedFocused&&e.update([])}),10)}function qt(e,t){if(e.docView.compositionDeco.size){e.inputState.rapidCompositionStart=t;try{e.update([])}finally{e.inputState.rapidCompositionStart=!1}}}Ot.copy=Ot.cut=(e,t)=>{let{text:n,ranges:r,linewise:i}=function(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let o=e.doc.lineAt(r);o.number>i&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),i=o.number}r=!0}return{text:t.join(e.lineBreak),ranges:n,linewise:r}}(e.state);if(!n&&!i)return;Vt=i?n:null;let o=jt?null:t.clipboardData;o?(t.preventDefault(),o.clearData(),o.setData("text/plain",n)):function(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout((()=>{r.remove(),e.focus()}),50)}(e,n),"cut"!=t.type||e.state.readOnly||e.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"})},Ot.focus=e=>{e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),zt(e)},Ot.blur=e=>{e.observer.clearSelectionRange(),zt(e)},Ot.compositionstart=Ot.compositionupdate=e=>{null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0,e.docView.compositionDeco.size&&(e.observer.flush(),qt(e,!0)))},Ot.compositionend=e=>{e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionFirstChange=null,setTimeout((()=>{e.inputState.composing<0&&qt(e,!1)}),50)},Ot.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},Ot.beforeinput=(e,t)=>{var n;let r;if(q.chrome&&q.android&&(r=kt.find((e=>e.inputType==t.inputType)))&&(e.observer.delayAndroidKey(r.key,r.keyCode),"Backspace"==r.key||"Delete"==r.key)){let t=(null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0;setTimeout((()=>{var n;((null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())}),100)}};const Ht=["pre-wrap","normal","pre-line","break-spaces"];class Wt{constructor(){this.doc=r.Text.empty,this.lineWrapping=!1,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength)),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Ht.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,s=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.lineLength=r,s){this.heightSamples={};for(let e=0;e0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>Gt&&(e.heightChanged=!0),this.height=t)}replace(e,t,n){return Qt.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this;for(let o=r.length-1;o>=0;o--){let{fromA:s,toA:a,fromB:l,toB:c}=r[o],h=i.lineAt(s,Kt.ByPosNoHeight,t,0,0),u=h.to>=a?h:i.lineAt(a,Kt.ByPosNoHeight,t,0,0);for(c+=u.to-a,a=u.to;o>0&&h.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s2*i){let i=e[t-1];i.break?e.splice(--t,1,i.left,null,i.right):e.splice(--t,1,i.left,i.right),n+=1+i.break,r-=i.size}else{if(!(i>2*r))break;{let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,i-=t.size}}else if(r=i&&o(this.blockAt(0,n,r,i))}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setHeight(e,r.heights[r.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Yt extends Zt{constructor(e,n){super(e,n,t.BlockType.Text),this.collapsed=0,this.widgetHeight=0}replace(e,t,n){let r=n[0];return 1==n.length&&(r instanceof Yt||r instanceof Xt&&4&r.flags)&&Math.abs(this.length-r.length)<10?(r instanceof Xt?r=new Yt(r.length,this.height):r.height=this.height,this.outdated||(r.outdated=!1),r):Qt.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setHeight(e,r.heights[r.index++]):(n||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Xt extends Qt{constructor(e){super(e,0)}lines(e,t){let n=e.lineAt(t).number,r=e.lineAt(t+this.length).number;return{firstLine:n,lastLine:r,lineHeight:this.height/(r-n+1)}}blockAt(e,n,r,i){let{firstLine:o,lastLine:s,lineHeight:a}=this.lines(n,i),l=Math.max(0,Math.min(s-o,Math.floor((e-r)/a))),{from:c,length:h}=n.line(o+l);return new Jt(c,h,r+a*l,a,t.BlockType.Text)}lineAt(e,n,r,i,o){if(n==Kt.ByHeight)return this.blockAt(e,r,i,o);if(n==Kt.ByPosNoHeight){let{from:n,to:i}=r.lineAt(e);return new Jt(n,i-n,0,0,t.BlockType.Text)}let{firstLine:s,lineHeight:a}=this.lines(r,o),{from:l,length:c,number:h}=r.lineAt(e);return new Jt(l,c,i+a*(h-s),a,t.BlockType.Text)}forEachLine(e,n,r,i,o,s){let{firstLine:a,lineHeight:l}=this.lines(r,o);for(let c=Math.max(e,o),h=Math.min(o+this.length,n);c<=h;){let n=r.lineAt(c);c==e&&(i+=l*(n.number-a)),s(new Jt(n.from,n.length,i,l,t.BlockType.Text)),i+=l,c=n.to+1}}replace(e,t,n){let r=this.length-t;if(r>0){let e=n[n.length-1];e instanceof Xt?n[n.length-1]=new Xt(e.length+r):n.push(null,new Xt(r-1))}if(e>0){let t=n[0];t instanceof Xt?n[0]=new Xt(e+t.length):n.unshift(new Xt(e-1),null)}return Qt.of(n)}decomposeLeft(e,t){t.push(new Xt(e-1),null)}decomposeRight(e,t){t.push(null,new Xt(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let i=t+this.length;if(r&&r.from<=t+this.length&&r.more){let n=[],o=Math.max(t,r.from),s=-1,a=e.heightChanged;for(r.from>t&&n.push(new Xt(r.from-t-1).updateHeight(e,t));o<=i&&r.more;){let t=e.doc.lineAt(o).length;n.length&&n.push(null);let i=r.heights[r.index++];-1==s?s=i:Math.abs(i-s)>=Gt&&(s=-2);let a=new Yt(t,i);a.outdated=!1,n.push(a),o+=t+1}o<=i&&n.push(null,new Xt(i-o).updateHeight(e,o));let l=Qt.of(n);return e.heightChanged=a||s<0||Math.abs(l.height-this.height)>=Gt||Math.abs(s-this.lines(e.doc,t).lineHeight)>=Gt,l}return(n||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class en extends Qt{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,r){let i=n+this.left.height;return es))return l;let c=t==Kt.ByPosNoHeight?Kt.ByPosNoHeight:Kt.ByPos;return a?l.join(this.right.lineAt(s,c,n,o,s)):this.left.lineAt(s,c,n,r,i).join(l)}forEachLine(e,t,n,r,i,o){let s=r+this.left.height,a=i+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,n,s,a,o);else{let l=this.lineAt(a,Kt.ByPos,n,r,i);e=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(l.to+1,t,n,s,a,o)}}replace(e,t,n){let r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let o=i.length;for(let e of n)i.push(e);if(e>0&&tn(i,o-1),t=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e2*t.size||t.size>2*e.size?Qt.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:o}=this,s=t+i.length+this.break,a=null;return r&&r.from<=t+i.length&&r.more?a=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=s+o.length&&r.more?a=o=o.updateHeight(e,s,n,r):o.updateHeight(e,s,n),a?this.balanced(i,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function tn(e,t){let n,r;null==e[t]&&(n=e[t-1])instanceof Xt&&(r=e[t+1])instanceof Xt&&e.splice(t-1,3,new Xt(n.length+1+r.length))}class nn{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof Yt?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new Yt(e-this.pos,-1)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e=5)&&this.addLineDeco(r,i)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Yt(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new Xt(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Yt)return e;let t=new Yt(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine(),e.type!=t.BlockType.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,e.type!=t.BlockType.WidgetBefore&&(this.covering=e)}addLineDeco(e,t){let n=this.ensureLine();n.length+=t,n.collapsed+=t,n.widgetHeight=Math.max(n.widgetHeight,e),this.writtenTo=this.pos=this.pos+t}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof Yt||this.isCovered?(this.writtenTon.clientHeight||n.scrollWidth>n.clientWidth)&&"visible"!=a.overflow){let a=n.getBoundingClientRect();r=Math.max(r,a.left),i=Math.min(i,a.right),o=Math.max(o,a.top),s=t==e.parentNode?a.bottom:Math.min(s,a.bottom)}t="absolute"==a.position||"fixed"==a.position?n.offsetParent:n.parentNode}else{if(11!=t.nodeType)break;t=t.host}return{left:r-n.left,right:Math.max(r,i)-n.left,top:o-(n.top+t),bottom:Math.max(o,s)-(n.top+t)}}function sn(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class an{constructor(e,t,n){this.from=e,this.to=t,this.size=n}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n"function"!=typeof e)),this.heightMap=Qt.empty().applyChanges(this.stateDeco,r.Text.empty,this.heightOracle.setDoc(e.doc),[new Ne(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=oe.set(this.lineGaps.map((e=>e.draw(!1)))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some((({from:e,to:t})=>r>=e&&r<=t))){let{from:t,to:n}=this.lineBlockAt(r);e.push(new hn(t,n))}}this.viewports=e.sort(((e,t)=>e.from-t.from)),this.scaler=this.heightMap.height<=7e6?gn:new vn(this.heightOracle.doc,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.state.doc,0,0,(e=>{this.viewportLines.push(1==this.scaler.scale?e:yn(e,this.scaler))}))}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(_e).filter((e=>"function"!=typeof e));let i=e.changedRanges,o=Ne.extendWithRanges(i,function(e,t,n){let i=new rn;return r.RangeSet.compare(e,t,n,i,0),i.changes}(n,this.stateDeco,e?e.changes:r.ChangeSet.empty(this.state.doc.length))),s=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),this.heightMap.height!=s&&(e.flags|=2);let a=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let l=!e.changes.empty||2&e.flags||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),l&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection="rtl"==r.direction?t.Direction.RTL:t.Direction.LTR;let s=this.heightOracle.mustRefreshForWrapping(o),a=s||this.mustMeasureContent||this.contentDOMHeight!=n.clientHeight;this.contentDOMHeight=n.clientHeight,this.mustMeasureContent=!1;let l=0,c=0,h=parseInt(r.paddingTop)||0,u=parseInt(r.paddingBottom)||0;this.paddingTop==h&&this.paddingBottom==u||(this.paddingTop=h,this.paddingBottom=u,l|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,l|=8);let f=(this.printing?sn:on)(n,this.paddingTop),d=f.top-this.pixelViewport.top,p=f.bottom-this.pixelViewport.bottom;this.pixelViewport=f;let m=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(m!=this.inView&&(this.inView=m,m&&(a=!0)),!this.inView)return 0;let g=n.clientWidth;if(this.contentDOMWidth==g&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=g,this.editorHeight=e.scrollDOM.clientHeight,l|=8),a){let t=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(t)&&(s=!0),s||i.lineWrapping&&Math.abs(g-this.contentDOMWidth)>i.charWidth){let{lineHeight:n,charWidth:r}=e.docView.measureTextSize();s=i.refresh(o,n,r,g/r,t),s&&(e.docView.minWidth=0,l|=8)}d>0&&p>0?c=Math.max(d,p):d<0&&p<0&&(c=Math.min(d,p)),i.heightChanged=!1;for(let n of this.viewports){let r=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=this.heightMap.updateHeight(i,0,s,new Ut(n.from,r))}i.heightChanged&&(l|=2)}let v=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return v&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(2&l||v)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps)),l|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),l}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.state.doc,{visibleTop:o,visibleBottom:s}=this,a=new hn(r.lineAt(o-1e3*n,Kt.ByHeight,i,0,0).from,r.lineAt(s+1e3*(1-n),Kt.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(ea.to){let n,o=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),s=r.lineAt(e,Kt.ByPos,i,0,0);n="center"==t.y?(s.top+s.bottom)/2-o/2:"start"==t.y||"nearest"==t.y&&e=s+Math.max(10,Math.min(n,250)))&&r>o-2e3&&it.from&&s.push({from:t.from,to:r}),i=t.from&&a.from<=t.to&&pn(s,a.from-10,a.from+10),!a.empty&&a.to>=t.from&&a.to<=t.to&&pn(s,a.to-10,a.to+10);for(let{from:r,to:i}of s)i-r>1e3&&n.push(mn(e,(e=>e.from>=t.from&&e.to<=t.to&&Math.abs(e.from-r)<1e3&&Math.abs(e.to-i)<1e3))||new an(r,i,this.gapSize(t,r,i,o)))}return n}gapSize(e,t,n,r){let i=dn(r,n)-dn(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){an.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=oe.set(e.map((e=>e.draw(this.heightOracle.lineWrapping)))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];r.RangeSet.spans(e,this.viewport.from,this.viewport.to,{span(e,n){t.push({from:e,to:n})},point(){}},20);let n=t.length!=this.visibleRanges.length||this.visibleRanges.some(((e,n)=>e.from!=t[n].from||e.to!=t[n].to));return this.visibleRanges=t,n?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find((t=>t.from<=e&&t.to>=e))||yn(this.heightMap.lineAt(e,Kt.ByPos,this.state.doc,0,0),this.scaler)}lineBlockAtHeight(e){return yn(this.heightMap.lineAt(this.scaler.fromDOM(e),Kt.ByHeight,this.state.doc,0,0),this.scaler)}elementAtHeight(e){return yn(this.heightMap.blockAt(this.scaler.fromDOM(e),this.state.doc,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class hn{constructor(e,t){this.from=e,this.to=t}}function un(e,t,n){let i=[],o=e,s=0;return r.RangeSet.spans(n,e,t,{span(){},point(e,t){e>o&&(i.push({from:o,to:e}),s+=e-o),o=t}},20),o=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],o=i-n;if(r<=o)return n+r;r-=o}}function dn(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function pn(e,t,n){for(let r=0;rt){let o=[];i.fromn&&o.push({from:n,to:i.to}),e.splice(r,1,...o),r+=o.length-1}}}function mn(e,t){for(let n of e)if(t(n))return n}const gn={toDOM:e=>e,fromDOM:e=>e,scale:1};class vn{constructor(e,t,n){let r=0,i=0,o=0;this.viewports=n.map((({from:n,to:i})=>{let o=t.lineAt(n,Kt.ByPos,e,0,0).top,s=t.lineAt(i,Kt.ByPos,e,0,0).bottom;return r+=s-o,{from:n,to:i,top:o,bottom:s,domTop:0,domBottom:0}})),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=o+(e.top-i)*this.scale,o=e.domBottom=e.domTop+(e.bottom-e.top),i=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=tyn(e,t))):e.type)}const bn=r.Facet.define({combine:e=>e.join(" ")}),wn=r.Facet.define({combine:e=>e.indexOf(!0)>-1}),xn=i.StyleModule.newName(),kn=i.StyleModule.newName(),Sn=i.StyleModule.newName(),An={"&light":"."+kn,"&dark":"."+Sn};function Cn(e,t,n){return new i.StyleModule(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,(t=>{if("&"==t)return e;if(!n||!n[t])throw new RangeError(`Unsupported selector: ${t}`);return n[t]})):e+" "+t})}const On=Cn("."+xn,{"&.cm-editor":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,minHeight:"100%",display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 4px"},".cm-selectionLayer":{zIndex:-1,contain:"size style"},".cm-selectionBackground":{position:"absolute"},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{zIndex:100,contain:"size style",pointerEvents:"none"},"&.cm-focused .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#f3f9ff"},"&dark .cm-activeLine":{backgroundColor:"#223039"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",left:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},An),En={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},jn=q.ie&&q.ie_version<=11;class Mn{constructor(e,t,n){this.view=e,this.onChange=t,this.onScrollChanged=n,this.active=!1,this.selectionRange=new v,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.scrollTargets=[],this.intersection=null,this.resize=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver((t=>{for(let e of t)this.queue.push(e);(q.ie&&q.ie_version<=11||q.ios&&e.composing)&&t.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),jn&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),window.addEventListener("resize",this.onResize=this.onResize.bind(this)),"function"==typeof ResizeObserver&&(this.resize=new ResizeObserver((()=>{this.view.docView.lastUpdate{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))}),{}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange(),this.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=-1,this.view.requestMeasure()}),50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout((()=>{this.view.viewState.printing=!1,this.view.requestMeasure()}),500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some(((t,n)=>t!=e[n])))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:t}=this,n=this.selectionRange;if(t.state.facet(Oe)?t.root.activeElement!=this.dom:!l(t.dom,n))return;let r=n.anchorNode&&t.docView.nearest(n.anchorNode);r&&r.ignoreEvent(e)||((q.ie&&q.ie_version<=11||q.android&&q.chrome)&&!t.state.selection.main.empty&&n.focusNode&&h(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1))}readSelectionRange(){let{view:e}=this,t=q.safari&&11==e.root.nodeType&&function(){let e=document.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}()==this.dom&&function(e){let t=null;function n(e){e.preventDefault(),e.stopImmediatePropagation(),t=e.getTargetRanges()[0]}if(e.contentDOM.addEventListener("beforeinput",n,!0),document.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",n,!0),!t)return null;let r=t.startContainer,i=t.startOffset,o=t.endContainer,s=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor);return h(a.node,a.offset,o,s)&&([r,i,o,s]=[o,s,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}}(this.view)||s(e.root);if(!t||this.selectionRange.eq(t))return!1;let n=l(this.dom,t);return n&&!this.selectionChanged&&this.selectionRange.focusNode&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let e=this.delayedAndroidKey;this.delayedAndroidKey=null,this.delayedFlush=-1,this.flush()||k(this.dom,e.key,e.keyCode)})),this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t})}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=window.setTimeout((()=>{this.delayedFlush=-1,this.flush()}),20))}forceFlush(){this.delayedFlush>=0&&(window.clearTimeout(this.delayedFlush),this.delayedFlush=-1),this.flush()}processRecords(){let e=this.queue;for(let t of this.observer.takeRecords())e.push(t);e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),-1==t?({from:t,to:n}=e):(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return;e&&this.readSelectionRange();let{from:t,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&l(this.dom,this.selectionRange);if(t<0&&!i)return;this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=this.view.state,s=this.onChange(t,n,r);return this.view.state==o&&this.view.update([]),s}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.dirty|=4),"childList"==e.type){let n=In(t,e.previousSibling||e.target.previousSibling,-1),r=In(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}destroy(){var e,t,n;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resize)||void 0===n||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);window.removeEventListener("scroll",this.onScroll),window.removeEventListener("resize",this.onResize),window.removeEventListener("beforeprint",this.onPrint),this.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout)}}function In(e,t,n){for(;t;){let r=O.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}class $n{constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: absolute; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=e.dispatch||(e=>this.update([e])),this.dispatch=this.dispatch.bind(this),this.root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new cn(e.state||r.EditorState.create(e)),this.plugins=this.state.facet(je).map((e=>new Ie(e)));for(let e of this.plugins)e.update(this);this.observer=new Mn(this,((e,t,n)=>function(e,t,n,i){let o,s,l=e.state.selection.main;if(t>-1){let i=e.docView.domBoundsAround(t,n,0);if(!i||e.state.readOnly)return!1;let{from:a,to:c}=i,h=e.docView.impreciseHead||e.docView.impreciseAnchor?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=e.observer.selectionRange;return n&&(t.push(new rt(n,r)),i==n&&o==r||t.push(new rt(i,o))),t}(e),u=new tt(h,e.state);u.readRange(i.startDOM,i.endDOM);let f=l.from,d=null;(8===e.inputState.lastKeyCode&&e.inputState.lastKeyTime>Date.now()-100||q.android&&u.text.length0&&a>0&&e.charCodeAt(s-1)==t.charCodeAt(a-1);)s--,a--;return"end"==r&&(n-=s+Math.max(0,o-Math.min(s,a))-o),s=s?o-n:0,a=o+(a-s),s=o):a=a?o-n:0,s=o+(s-a),a=o),{from:o,toA:s,toB:a}}(e.state.doc.sliceString(a,c,et),u.text,f-a,d);p&&(q.chrome&&13==e.inputState.lastKeyCode&&p.toB==p.from+2&&u.text.slice(p.from,p.toB)==et+et&&p.toB--,o={from:a+p.from,to:a+p.toA,insert:r.Text.of(u.text.slice(p.from,p.toB).split(et))}),s=function(e,t){if(0==e.length)return null;let n=e[0].pos,i=2==e.length?e[1].pos:n;return n>-1&&i>-1?r.EditorSelection.single(n+t,i+t):null}(h,a)}else if(e.hasFocus||!e.state.facet(Oe)){let t=e.observer.selectionRange,{impreciseHead:n,impreciseAnchor:i}=e.docView,o=n&&n.node==t.focusNode&&n.offset==t.focusOffset||!a(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),c=i&&i.node==t.anchorNode&&i.offset==t.anchorOffset||!a(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset);o==l.head&&c==l.anchor||(s=r.EditorSelection.single(c,o))}if(!o&&!s)return!1;if(!o&&i&&!l.empty&&s&&s.main.empty?o={from:l.from,to:l.to,insert:e.state.doc.slice(l.from,l.to)}:o&&o.from>=l.from&&o.to<=l.to&&(o.from!=l.from||o.to!=l.to)&&l.to-l.from-(o.to-o.from)<=4?o={from:l.from,to:l.to,insert:e.state.doc.slice(l.from,o.from).append(o.insert).append(e.state.doc.slice(o.to,l.to))}:(q.mac||q.android)&&o&&o.from==o.to&&o.from==l.head-1&&"."==o.insert.toString()&&(o={from:l.from,to:l.to,insert:r.Text.of([" "])}),o){let t=e.state;if(q.ios&&e.inputState.flushIOSKey(e))return!0;if(q.android&&(o.from==l.from&&o.to==l.to&&1==o.insert.length&&2==o.insert.lines&&k(e.contentDOM,"Enter",13)||o.from==l.from-1&&o.to==l.to&&0==o.insert.length&&k(e.contentDOM,"Backspace",8)||o.from==l.from&&o.to==l.to+1&&0==o.insert.length&&k(e.contentDOM,"Delete",46)))return!0;let n,i=o.insert.toString();if(e.state.facet(xe).some((t=>t(e,o.from,o.to,i))))return!0;if(e.inputState.composing>=0&&e.inputState.composing++,o.from>=l.from&&o.to<=l.to&&o.to-o.from>=(l.to-l.from)/3&&(!s||s.main.empty&&s.main.from==o.from+o.insert.length)&&e.inputState.composing<0){let r=l.fromo.to?t.sliceDoc(o.to,l.to):"";n=t.replaceSelection(e.state.toText(r+o.insert.sliceString(0,void 0,e.state.lineBreak)+i))}else{let i=t.changes(o),a=s&&!t.selection.main.eq(s.main)&&s.main.to<=i.newLength?s.main:void 0;if(t.selection.ranges.length>1&&e.inputState.composing>=0&&o.to<=l.to&&o.to>=l.to-10){let s=e.state.sliceDoc(o.from,o.to),c=st(e)||e.state.doc.lineAt(l.head),h=l.to-o.to,u=l.to-l.from;n=t.changeByRange((n=>{if(n.from==l.from&&n.to==l.to)return{changes:i,range:a||n.map(i)};let f=n.to-h,d=f-s.length;if(n.to-n.from!=u||e.state.sliceDoc(d,f)!=s||c&&n.to>=c.from&&n.from<=c.to)return{range:n};let p=t.changes({from:d,to:f,insert:o.insert}),m=n.to-l.to;return{changes:p,range:a?r.EditorSelection.range(Math.max(0,a.anchor+m),Math.max(0,a.head+m)):n.map(p)}}))}else n={changes:i,selection:a&&t.selection.replaceRange(a)}}let a="input.type";return e.composing&&(a+=".compose",e.inputState.compositionFirstChange&&(a+=".start",e.inputState.compositionFirstChange=!1)),e.dispatch(n,{scrollIntoView:!0,userEvent:a}),!0}if(s&&!s.main.eq(l)){let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),n=e.inputState.lastSelectionOrigin),e.dispatch({selection:s,scrollIntoView:t,userEvent:n}),!0}return!1}(this,e,t,n)),(e=>{this.inputState.runScrollHandlers(this,e),this.observer.intersecting&&this.measure()})),this.inputState=new xt(this),this.inputState.ensureHandlers(this,this.plugins),this.docView=new it(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}dispatch(...e){this._dispatch(1==e.length&&e[0]instanceof r.Transaction?e[0]:this.state.update(...e))}update(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t,n=!1,i=!1,o=this.state;for(let t of e){if(t.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=t.state}if(this.destroyed)return void(this.viewState.state=o);if(this.observer.clear(),o.facet(r.EditorState.phrases)!=this.state.facet(r.EditorState.phrases))return this.setState(o);t=Be.create(this,o,e);let s=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(s&&(s=s.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;s=new Se(e.empty?e:r.EditorSelection.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(Ae)&&(s=e.value)}this.viewState.update(t,s),this.bidiCache=Pn.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),n=this.docView.update(t),this.state.facet(Re)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some((e=>e.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(t.startState.facet(bn)!=t.state.facet(bn)&&(this.viewState.mustMeasureContent=!0),(n||i||s||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!t.empty)for(let e of this.state.facet(we))e(t)}setState(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=e);this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new cn(e),this.plugins=e.facet(je).map((e=>new Ie(e))),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView=new it(this),this.inputState.ensureHandlers(this,this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(je),n=e.state.facet(je);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new Ie(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear(),this.inputState.ensureHandlers(this,this.plugins)}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,{scrollHeight:n,scrollTop:r,clientHeight:i}=this.scrollDOM,o=r>n-i-4?n:r;try{for(let e=0;;e++){this.updateState=1;let n=this.viewport,r=this.viewState.lineBlockAtHeight(o),i=this.viewState.measure(this);if(!i&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let s=[];4&i||([this.measureRequests,s]=[s,this.measureRequests]);let a=s.map((e=>{try{return e.read(this)}catch(e){return Ce(this.state,e),_n}})),l=Be.create(this,this.state,[]),c=!1,h=!1;l.flags|=i,t?t.flags|=i:t=l,this.updateState=2,l.empty||(this.updatePlugins(l),this.inputState.update(l),this.updateAttrs(),c=this.docView.update(l));for(let e=0;e1||e<-1)&&(this.scrollDOM.scrollTop+=e,h=!0)}if(c&&this.docView.updateSelection(!0),this.viewport.from==n.from&&this.viewport.to==n.to&&!h&&0==this.measureRequests.length)break}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(we))e(t)}get themeClasses(){return xn+" "+(this.state.facet(wn)?Sn:kn)+" "+this.state.facet(bn)}updateAttrs(){let e=Dn(this,$e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Oe)?"true":"false",class:"cm-content",style:`${q.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Dn(this,Te,t);let n=this.observer.ignore((()=>{let n=re(this.contentDOM,this.contentAttrs,t),r=re(this.dom,this.editorAttrs,e);return n||r}));return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)e.is($n.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(Re),i.StyleModule.mount(this.root,this.styleModules.concat(On).reverse())}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=requestAnimationFrame((()=>this.measure()))),e){if(null!=e.key)for(let t=0;tt.spec==e))||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return wt(this,e,bt(this,e,t,n))}moveByGroup(e,t){return wt(this,e,bt(this,e,t,(t=>function(e,t,n){let i=e.state.charCategorizer(t),o=i(n);return e=>{let t=i(e);return o==r.CharCategory.Space&&(o=t),o==t}}(this,e.head,t))))}moveToLineBoundary(e,n,i=!0){return function(e,n,i,o){let s=e.state.doc.lineAt(n.head),a=o&&e.lineWrapping?e.coordsAtPos(n.assoc<0&&n.head>s.from?n.head-1:n.head):null;if(a){let n=e.dom.getBoundingClientRect(),o=e.textDirectionAt(s.from),l=e.posAtCoords({x:i==(o==t.Direction.LTR)?n.right-1:n.left+1,y:(a.top+a.bottom)/2});if(null!=l)return r.EditorSelection.cursor(l,i?-1:1)}let l=ue.find(e.docView,n.head),c=l?i?l.posAtEnd:l.posAtStart:i?s.to:s.from;return r.EditorSelection.cursor(c,i?-1:1)}(this,e,n,i)}moveVertically(e,t,n){return wt(this,e,function(e,t,n,i){let o=t.head,s=n?1:-1;if(o==(n?e.state.doc.length:0))return r.EditorSelection.cursor(o,t.assoc);let a,l=t.goalColumn,c=e.contentDOM.getBoundingClientRect(),h=e.coordsAtPos(o),u=e.documentTop;if(h)null==l&&(l=h.left-c.left),a=s<0?h.top:h.bottom;else{let t=e.viewState.lineBlockAt(o);null==l&&(l=Math.min(c.right-c.left,e.defaultCharacterWidth*(o-t.from))),a=(s<0?t.top:t.bottom)+u}let f=c.left+l,d=null!=i?i:e.defaultLineHeight>>1;for(let n=0;;n+=10){let i=a+(d+n)*s,h=vt(e,{x:f,y:i},!1,s);if(ic.bottom||(s<0?ho))return r.EditorSelection.cursor(h,t.assoc,void 0,l)}}(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),vt(this,e,t)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),o=this.bidiSpans(i);return m(r,o[Ke.find(o,e-i.from,-1,n)].dir==t.Direction.LTR==n>0)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(ke)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Tn)return Ze(e.length);let t=this.textDirectionAt(e.from);for(let n of this.bidiCache)if(n.from==e.from&&n.dir==t)return n.order;let n=Qe(e.text,t);return this.bidiCache.push(new Pn(e.from,e.to,t,n)),n}get hasFocus(){var e;return(document.hasFocus()||q.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{w(this.contentDOM),this.docView.updateSelection()}))}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Ae.of(new Se("number"==typeof e?r.EditorSelection.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return Me.define((()=>({})),{eventHandlers:e})}static theme(e,t){let n=i.StyleModule.newName(),r=[bn.of(n),Re.of(Cn(`.${n}`,e))];return t&&t.dark&&r.push(wn.of(!0)),r}static baseTheme(e){return r.Prec.lowest(Re.of(Cn("."+xn,e,An)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&O.get(n)||O.get(e);return(null===(t=null==r?void 0:r.rootView)||void 0===t?void 0:t.view)||null}}$n.styleModule=Re,$n.inputHandler=xe,$n.perLineTextDirection=ke,$n.exceptionSink=be,$n.updateListener=we,$n.editable=Oe,$n.mouseSelectionStyle=ye,$n.dragMovesSelection=ve,$n.clickAddsSelectionRange=ge,$n.decorations=_e,$n.atomicRanges=Pe,$n.scrollMargins=De,$n.darkTheme=wn,$n.contentAttributes=Te,$n.editorAttributes=$e,$n.lineWrapping=$n.contentAttributes.of({class:"cm-lineWrapping"}),$n.announce=r.StateEffect.define();const Tn=4096,_n={};class Pn{constructor(e,t,n,r){this.from=e,this.to=t,this.dir=n,this.order=r}static update(e,n){if(n.empty)return e;let r=[],i=e.length?e[e.length-1].dir:t.Direction.LTR;for(let t=Math.max(0,e.length-10);t=0;i--){let t=r[i],o="function"==typeof t?t(e):t;o&&te(o,n)}return n}const Rn=q.mac?"mac":q.windows?"win":q.linux?"linux":"key";function Nn(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}const Bn=r.Prec.default($n.domEventHandlers({keydown:(e,t)=>Hn(Vn(t.state),e,t,"editor")})),Ln=r.Facet.define({enables:Bn}),Fn=new WeakMap;function Vn(e){let t=e.facet(Ln),n=Fn.get(t);return n||Fn.set(t,n=function(e,t=Rn){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(null==n)r[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},o=(e,r,o,s)=>{let a=n[e]||(n[e]=Object.create(null)),l=r.split(/ (?!$)/).map((e=>function(e,t){const n=e.split(/-(?!$)/);let r,i,o,s,a=n[n.length-1];"Space"==a&&(a=" ");for(let e=0;e{let r=zn={view:t,prefix:n,scope:e};return setTimeout((()=>{zn==r&&(zn=null)}),qn),!0}]})}let c=l.join(" ");i(c,!1);let h=a[c]||(a[c]={preventDefault:!1,commands:[]});h.commands.push(o),s&&(h.preventDefault=!0)};for(let n of e){let e=n[t]||n.key;if(e)for(let t of n.scope?n.scope.split(" "):["editor"])o(t,e,n.run,n.preventDefault),n.shift&&o(t,"Shift-"+e,n.shift,n.preventDefault)}return n}(t.reduce(((e,t)=>e.concat(t)),[]))),n}let zn=null;const qn=4e3;function Hn(e,t,n,i){let s=o.keyName(t),a=r.codePointAt(s,0),l=r.codePointSize(a)==s.length&&" "!=s,c="",h=!1;zn&&zn.view==n&&zn.scope==i&&(c=zn.prefix+" ",(h=St.indexOf(t.keyCode)<0)&&(zn=null));let u,f=e=>{if(e){for(let t of e.commands)if(t(n))return!0;e.preventDefault&&(h=!0)}return!1},d=e[i];if(d){if(f(d[c+Nn(s,t,!l)]))return!0;if(l&&(t.shiftKey||t.altKey||t.metaKey||a>127)&&(u=o.base[t.keyCode])&&u!=s){if(f(d[c+Nn(u,t,!0)]))return!0;if(t.shiftKey&&o.shift[t.keyCode]!=u&&f(d[c+Nn(o.shift[t.keyCode],t,!1)]))return!0}else if(l&&t.shiftKey&&f(d[c+Nn(s,t,!0)]))return!0}return h}const Wn=!q.ios,Un=r.Facet.define({combine:e=>r.combineConfig(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});class Jn{constructor(e,t,n,r,i){this.left=e,this.top=t,this.width=n,this.height=r,this.className=i}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width>=0&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}}const Kn=Me.fromClass(class{constructor(e){this.view=e,this.rangePieces=[],this.cursors=[],this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.selectionLayer=e.scrollDOM.appendChild(document.createElement("div")),this.selectionLayer.className="cm-selectionLayer",this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=e.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),e.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){this.cursorLayer.style.animationDuration=this.view.state.facet(Un).cursorBlinkRate+"ms"}update(e){let t=e.startState.facet(Un)!=e.state.facet(Un);(t||e.selectionSet||e.geometryChanged||e.viewportChanged)&&this.view.requestMeasure(this.measureReq),e.transactions.some((e=>e.scrollIntoView))&&(this.cursorLayer.style.animationName="cm-blink"==this.cursorLayer.style.animationName?"cm-blink2":"cm-blink"),t&&this.setBlinkRate()}readPos(){let{state:e}=this.view,n=e.facet(Un),r=e.selection.ranges.map((e=>e.empty?[]:function(e,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),o=e.textDirection==t.Direction.LTR,s=e.contentDOM,a=s.getBoundingClientRect(),l=Zn(e),c=window.getComputedStyle(s.firstChild),h=a.left+parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)),u=a.right-parseInt(c.paddingRight),f=Xn(e,r),d=Xn(e,i),p=f.type==t.BlockType.Text?f:null,m=d.type==t.BlockType.Text?d:null;if(e.lineWrapping&&(p&&(p=Yn(e,r,p)),m&&(m=Yn(e,i,m))),p&&m&&p.from==m.from)return v(y(n.from,n.to,p));{let r=p?y(n.from,null,p):b(f,!1),i=m?y(null,n.to,m):b(d,!0),o=[];return(p||f).to<(m||d).from-1?o.push(g(h,r.bottom,u,i.top)):r.bottomf&&t.from=o)break;a>i&&c(Math.max(e,i),null==n&&e<=f,Math.min(a,o),null==r&&a>=d,s.dir)}if(i=t.to+1,i>=o)break}return 0==l.length&&c(f,null==n,d,null==r,e.textDirection),{top:s,bottom:a,horizontal:l}}function b(e,t){let n=a.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(this.view,e))).reduce(((e,t)=>e.concat(t))),i=[];for(let t of e.selection.ranges){let r=t==e.selection.main;if(t.empty?!r||Wn:n.drawRangeCursor){let e=er(this.view,t,r);e&&i.push(e)}}return{rangePieces:r,cursors:i}}drawSel({rangePieces:e,cursors:t}){if(e.length!=this.rangePieces.length||e.some(((e,t)=>!e.eq(this.rangePieces[t])))){this.selectionLayer.textContent="";for(let t of e)this.selectionLayer.appendChild(t.draw());this.rangePieces=e}if(t.length!=this.cursors.length||t.some(((e,t)=>!e.eq(this.cursors[t])))){let e=this.cursorLayer.children;if(e.length!==t.length){this.cursorLayer.textContent="";for(const e of t)this.cursorLayer.appendChild(e.draw())}else t.forEach(((t,n)=>t.adjust(e[n])));this.cursors=t}}destroy(){this.selectionLayer.remove(),this.cursorLayer.remove()}}),Gn={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Wn&&(Gn[".cm-line"].caretColor="transparent !important");const Qn=r.Prec.highest($n.theme(Gn));function Zn(e){let n=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==t.Direction.LTR?n.left:n.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft,top:n.top-e.scrollDOM.scrollTop}}function Yn(e,n,i){let o=r.EditorSelection.cursor(n);return{from:Math.max(i.from,e.moveToLineBoundary(o,!1,!0).from),to:Math.min(i.to,e.moveToLineBoundary(o,!0,!0).from),type:t.BlockType.Text}}function Xn(e,n){let r=e.lineBlockAt(n);if(Array.isArray(r.type))for(let e of r.type)if(e.to>n||e.to==n&&(e.to==r.to||e.type==t.BlockType.Text))return e;return r}function er(e,t,n){let r=e.coordsAtPos(t.head,t.assoc||1);if(!r)return null;let i=Zn(e);return new Jn(r.left-i.left,r.top-i.top,-1,r.bottom-r.top,n?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary")}const tr=r.StateEffect.define({map:(e,t)=>null==e?null:t.mapPos(e)}),nr=r.StateField.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce(((e,t)=>t.is(tr)?t.value:e),e))}),rr=Me.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(nr);null==n?null!=this.cursor&&(null===(t=this.cursor)||void 0===t||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(nr)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let e=this.view.state.field(nr),t=null!=e&&this.view.coordsAtPos(e);if(!t)return null;let n=this.view.scrollDOM.getBoundingClientRect();return{left:t.left-n.left+this.view.scrollDOM.scrollLeft,top:t.top-n.top+this.view.scrollDOM.scrollTop,height:t.bottom-t.top}}drawCursor(e){this.cursor&&(e?(this.cursor.style.left=e.left+"px",this.cursor.style.top=e.top+"px",this.cursor.style.height=e.height+"px"):this.cursor.style.left="-100000px")}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(nr)!=e&&this.view.dispatch({effects:tr.of(e)})}},{eventHandlers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function ir(e,t,n,r,i){t.lastIndex=0;for(let o,s=e.iterRange(n,r),a=n;!s.next().done;a+=s.value.length)if(!s.lineBreak)for(;o=t.exec(s.value);)i(a+o.index,o)}class or{constructor(e){const{regexp:t,decoration:n,decorate:r,boundary:i,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(e,t,n,i)=>r(i,n,n+e[0].length,e,t);else{if(!n)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");{let e="function"==typeof n?n:()=>n;this.addMatch=(t,n,r,i)=>i(r,r+t[0].length,e(t,n,r))}}this.boundary=i,this.maxLength=o}createDeco(e){let t=new r.RangeSetBuilder,n=t.add.bind(t);for(let{from:t,to:r}of function(e,t){let n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),o=Math.min(e.state.doc.lineAt(o).to,o+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}(e,this.maxLength))ir(e.state.doc,this.regexp,t,r,((t,r)=>this.addMatch(r,e,t,n)));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges(((t,i,o,s)=>{s>e.view.viewport.from&&o1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let i of e.visibleRanges){let o=Math.max(i.from,n),s=Math.min(i.to,r);if(s>o){let n=e.state.doc.lineAt(o),r=n.ton.from;o--)if(this.boundary.test(n.text[o-1-n.from])){a=o;break}for(;sh.push(n.range(e,t));if(n==r)for(this.regexp.lastIndex=a-n.from;(c=this.regexp.exec(n.text))&&c.indexthis.addMatch(n,e,t,u)));t=t.update({filterFrom:a,filterTo:l,filter:(e,t)=>el,add:h})}}return t}}const sr=null!=/x/.unicode?"gu":"g",ar=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",sr),lr={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let cr=null;const hr=r.Facet.define({combine(e){let t=r.combineConfig(e,{render:null,specialChars:ar,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==cr&&"undefined"!=typeof document&&document.body){let t=document.body.style;cr=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return cr||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,sr)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,sr)),t}});let ur=null;class fr extends ie{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=(n=this.code)>=32?"•":10==n?"␤":String.fromCharCode(9216+n);var n;let r=e.state.phrase("Control character")+" "+(lr[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,t);if(i)return i;let o=document.createElement("span");return o.textContent=t,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class dr extends ie{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}const pr=Me.fromClass(class{constructor(){this.height=1e3,this.attrs={style:"padding-bottom: 1000px"}}update(e){let t=e.view.viewState.editorHeight-e.view.defaultLineHeight;t!=this.height&&(this.height=t,this.attrs={style:`padding-bottom: ${t}px`})}}),mr=oe.line({class:"cm-activeLine"}),gr=Me.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){if(!r.empty)return oe.none;let i=e.lineBlockAt(r.head);i.from>t&&(n.push(mr.range(i.from)),t=i.from)}return oe.set(n)}},{decorations:e=>e.decorations});class vr extends ie{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild("string"==typeof this.content?document.createTextNode(this.content):this.content),"string"==typeof this.content?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}ignoreEvent(){return!1}}const yr=2e3;function br(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),i=e.state.doc.lineAt(n),o=n-i.from,s=o>yr?-1:o==i.length?function(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):r.countColumn(i.text,e.state.tabSize,n-i.from);return{line:i.number,col:s,off:o}}const wr={Alt:[18,e=>e.altKey],Control:[17,e=>e.ctrlKey],Shift:[16,e=>e.shiftKey],Meta:[91,e=>e.metaKey]},xr={style:"cursor: crosshair"},kr="-10000px";class Sr{constructor(e,t,n){this.facet=t,this.createTooltipView=n,this.input=e.state.facet(t),this.tooltips=this.input.filter((e=>e)),this.tooltipViews=this.tooltips.map(n)}update(e){let t=e.state.facet(this.facet),n=t.filter((e=>e));if(t===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let r=[];for(let t=0;t{var t,n,r;return{position:q.ios?"absolute":(null===(t=e.find((e=>e.position)))||void 0===t?void 0:t.position)||"fixed",parent:(null===(n=e.find((e=>e.parent)))||void 0===n?void 0:n.parent)||null,tooltipSpace:(null===(r=e.find((e=>e.tooltipSpace)))||void 0===r?void 0:r.tooltipSpace)||Ar}}}),Or=Me.fromClass(class{constructor(e){var t;this.view=e,this.inView=!0,this.lastTransaction=0,this.measureTimeout=-1;let n=e.state.facet(Cr);this.position=n.position,this.parent=n.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new Sr(e,Mr,(e=>this.createTooltip(e))),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver((e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),null===(t=e.dom.ownerDocument.defaultView)||void 0===t||t.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1,this.maybeMeasure()}),50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(Cr);if(r.position!=this.position){this.position=r.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e){let t=e.create(this.view);if(t.dom.classList.add("cm-tooltip"),e.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",t.dom.appendChild(e)}return t.dom.style.position=this.position,t.dom.style.top=kr,this.container.appendChild(t.dom),t.mount&&t.mount(this.view),t}destroy(){var e,t;null===(e=this.view.dom.ownerDocument.defaultView)||void 0===e||e.removeEventListener("resize",this.measureSoon);for(let{dom:e}of this.manager.tooltipViews)e.remove();null===(t=this.intersectionObserver)||void 0===t||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=this.view.dom.getBoundingClientRect();return{editor:e,parent:this.parent?this.container.getBoundingClientRect():e,pos:this.manager.tooltips.map(((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)})),size:this.manager.tooltipViews.map((({dom:e})=>e.getBoundingClientRect())),space:this.view.state.facet(Cr).tooltipSpace(this.view)}}writeMeasure(e){let{editor:n,space:r}=e,i=[];for(let o=0;o=Math.min(n.bottom,r.bottom)||c.rightMath.min(n.right,r.right)+.1){l.style.top=kr;continue}let u=s.arrow?a.dom.querySelector(".cm-tooltip-arrow"):null,f=u?7:0,d=h.right-h.left,p=h.bottom-h.top,m=a.offset||jr,g=this.view.textDirection==t.Direction.LTR,v=h.width>r.right-r.left?g?r.left:r.right-h.width:g?Math.min(c.left-(u?14:0)+m.x,r.right-d):Math.max(r.left,c.left-d+(u?14:0)-m.x),y=!!s.above;!s.strictSide&&(y?c.top-(h.bottom-h.top)-m.yr.bottom)&&y==r.bottom-c.bottom>c.top-r.top&&(y=!y);let b=y?c.top-p-f-m.y:c.bottom+f+m.y,w=v+d;if(!0!==a.overlap)for(let e of i)e.leftv&&e.topb&&(b=y?e.top-p-2-f:e.bottom+f+2);"absolute"==this.position?(l.style.top=b-e.parent.top+"px",l.style.left=v-e.parent.left+"px"):(l.style.top=b+"px",l.style.left=v+"px"),u&&(u.style.left=c.left+(g?m.x:-m.x)-(v+14-7)+"px"),!0!==a.overlap&&i.push({left:v,top:b,right:w,bottom:b+p}),l.classList.toggle("cm-tooltip-above",y),l.classList.toggle("cm-tooltip-below",!y),a.positioned&&a.positioned()}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=kr}},{eventHandlers:{scroll(){this.maybeMeasure()}}}),Er=$n.baseTheme({".cm-tooltip":{zIndex:100},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),jr={x:0,y:0},Mr=r.Facet.define({enables:[Or,Er]}),Ir=r.Facet.define();class $r{constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Sr(e,Ir,(e=>this.createHostedView(e)))}static create(e){return new $r(e)}createHostedView(e){let t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(t.dom),this.mounted&&t.mount&&t.mount(this.view),t}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(){for(let e of this.manager.tooltipViews)e.positioned&&e.positioned()}update(e){this.manager.update(e)}}const Tr=Mr.compute([Ir],(e=>{let t=e.facet(Ir).filter((e=>e));return 0===t.length?null:{pos:Math.min(...t.map((e=>e.pos))),end:Math.max(...t.filter((e=>null!=e.end)).map((e=>e.end))),create:$r.create,above:t[0].above,arrow:t.some((e=>e.arrow))}}));class _r{constructor(e,t,n,r,i){this.view=e,this.source=t,this.field=n,this.setHover=r,this.hoverTime=i,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout((()=>this.startHover()),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active)return;let e=Date.now()-this.lastMove.time;er.bottom||e.xr.right+this.view.defaultCharacterWidth)return;let i=this.view.bidiSpans(this.view.state.doc.lineAt(n)).find((e=>e.from<=n&&e.to>=n)),o=i&&i.dir==t.Direction.RTL?-1:1,s=this.source(this.view,n,e.x{this.pending==e&&(this.pending=null,t&&this.view.dispatch({effects:this.setHover.of(t)}))}),(e=>Ce(this.view.state,e,"hover tooltip")))}else s&&this.view.dispatch({effects:this.setHover.of(s)})}mousemove(e){var t;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let n=this.active;if(n&&!function(e){for(let t=e;t;t=t.parentNode)if(1==t.nodeType&&t.classList.contains("cm-tooltip"))return!0;return!1}(this.lastMove.target)||this.pending){let{pos:r}=n||this.pending,i=null!==(t=null==n?void 0:n.end)&&void 0!==t?t:r;(r==i?this.view.posAtCoords(this.lastMove)==r:function(e,t,n,r,i,o){let s=document.createRange(),a=e.domAtPos(t),l=e.domAtPos(n);s.setEnd(l.node,l.offset),s.setStart(a.node,a.offset);let c=s.getClientRects();s.detach();for(let e=0;ee)),this.panels=this.specs.map((t=>t(e)));let t=e.state.facet(Rr);this.top=new Br(e,!0,t.topContainer),this.bottom=new Br(e,!1,t.bottomContainer),this.top.sync(this.panels.filter((e=>e.top))),this.bottom.sync(this.panels.filter((e=>!e.top)));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(e){let t=e.state.facet(Rr);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Br(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Br(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(Fr);if(n!=this.input){let t=n.filter((e=>e)),r=[],i=[],o=[],s=[];for(let n of t){let t,a=this.specs.indexOf(n);a<0?(t=n(e.view),s.push(t)):(t=this.panels[a],t.update&&t.update(e)),r.push(t),(t.top?i:o).push(t)}this.specs=t,this.panels=r,this.top.sync(i),this.bottom.sync(o);for(let e of s)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>$n.scrollMargins.of((t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}}))});class Br{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Lr(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Lr(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Lr(e){let t=e.nextSibling;return e.remove(),t}const Fr=r.Facet.define({enables:Nr});class Vr extends r.RangeValue{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Vr.prototype.elementClass="",Vr.prototype.toDOM=void 0,Vr.prototype.mapMode=r.MapMode.TrackBefore,Vr.prototype.startSide=Vr.prototype.endSide=-1,Vr.prototype.point=!0;const zr=r.Facet.define(),qr={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>r.RangeSet.empty,lineMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},Hr=r.Facet.define(),Wr=r.Facet.define({combine:e=>e.some((e=>e))});function Ur(e){let t=[Jr];return e&&!1===e.fixed&&t.push(Wr.of(!0)),t}const Jr=Me.fromClass(class{constructor(e){this.view=e,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight+"px",this.gutters=e.state.facet(Hr).map((t=>new Zr(e,t)));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!e.state.facet(Wr),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<.8*(n.to-n.from))}e.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(Wr)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=e.view.viewport}syncGutters(e){let n=this.dom.nextSibling;e&&this.dom.remove();let i=r.RangeSet.iter(this.view.state.facet(zr),this.view.viewport.from),o=[],s=this.gutters.map((e=>new Qr(e,this.view.viewport,-this.view.documentPadding.top)));for(let e of this.view.viewportLineBlocks){let n;if(Array.isArray(e.type)){for(let r of e.type)if(r.type==t.BlockType.Text){n=r;break}}else n=e.type==t.BlockType.Text?e:void 0;if(n){o.length&&(o=[]),Gr(i,o,e.from);for(let e of s)e.line(this.view,n,o)}}for(let e of s)e.finish();e&&this.view.scrollDOM.insertBefore(this.dom,n)}updateGutters(e){let t=e.startState.facet(Hr),n=e.state.facet(Hr),i=e.docChanged||e.heightChanged||e.viewportChanged||!r.RangeSet.eq(e.startState.facet(zr),e.state.facet(zr),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(i=!0);else{i=!0;let r=[];for(let i of n){let n=t.indexOf(i);n<0?r.push(new Zr(this.view,i)):(this.gutters[n].update(e),r.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),r.indexOf(e)<0&&e.destroy();for(let e of r)this.dom.appendChild(e.dom);this.gutters=r}return i}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove()}},{provide:e=>$n.scrollMargins.of((n=>{let r=n.plugin(e);return r&&0!=r.gutters.length&&r.fixed?n.textDirection==t.Direction.LTR?{left:r.dom.offsetWidth}:{right:r.dom.offsetWidth}:null}))});function Kr(e){return Array.isArray(e)?e:[e]}function Gr(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class Qr{constructor(e,t,n){this.gutter=e,this.height=n,this.localMarkers=[],this.i=0,this.cursor=r.RangeSet.iter(e.markers,t.from)}line(e,t,n){this.localMarkers.length&&(this.localMarkers=[]),Gr(this.cursor,this.localMarkers,t.from);let r=n.length?this.localMarkers.concat(n):this.localMarkers,i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let o=this.gutter;if(0==r.length&&!o.config.renderEmptyElements)return;let s=t.top-this.height;if(this.i==o.elements.length){let n=new Yr(e,t.height,s,r);o.elements.push(n),o.dom.appendChild(n.dom)}else o.elements[this.i].update(e,t.height,s,r);this.height=t.bottom,this.i++}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Zr{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,(r=>{let i=e.lineBlockAtHeight(r.clientY-e.documentTop);t.domEventHandlers[n](e,i,r)&&r.preventDefault()}));this.markers=Kr(t.markers(e)),t.initialSpacer&&(this.spacer=new Yr(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Kr(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!r.RangeSet.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class Yr{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.dom.style.height=(this.height=t)+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),function(e,t){if(e.length!=t.length)return!1;for(let n=0;nr.combineConfig(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})});class ti extends Vr{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function ni(e,t){return e.state.facet(ei).formatNumber(t,e.state)}const ri=Hr.compute([ei],(e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(Xr),lineMarker:(e,t,n)=>n.some((e=>e.toDOM))?null:new ti(ni(e,e.state.doc.lineAt(t.from).number)),lineMarkerChange:e=>e.startState.facet(ei)!=e.state.facet(ei),initialSpacer:e=>new ti(ni(e,ii(e.state.doc.lines))),updateSpacer(e,t){let n=ni(t.view,ii(t.view.state.doc.lines));return n==e.number?e:new ti(n)},domEventHandlers:e.facet(ei).domEventHandlers})));function ii(e){let t=9;for(;t{let t=[],n=-1;for(let r of e.selection.ranges)if(r.empty){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(oi.range(i)))}return r.RangeSet.of(t)})),ai={HeightMap:Qt,HeightOracle:Wt,MeasuredHeights:Ut,QueryType:Kt,ChangedRange:Ne,computeOrder:Qe,moveVisually:Xe};t.BidiSpan=Ke,t.BlockInfo=Jt,t.Decoration=oe,t.EditorView=$n,t.GutterMarker=Vr,t.MatchDecorator=or,t.ViewPlugin=Me,t.ViewUpdate=Be,t.WidgetType=ie,t.__test=ai,t.closeHoverTooltips=Dr,t.crosshairCursor=function(e={}){let[t,n]=wr[e.key||"Alt"],r=Me.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventHandlers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){e.keyCode!=t&&n(e)||this.set(!1)}}});return[r,$n.contentAttributes.of((e=>{var t;return(null===(t=e.plugin(r))||void 0===t?void 0:t.isDown)?xr:null}))]},t.drawSelection=function(e={}){return[Un.of(e),Kn,Qn]},t.dropCursor=function(){return[nr,rr]},t.getPanel=function(e,t){let n=e.plugin(Nr),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null},t.getTooltip=function(e,t){let n=e.plugin(Or);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]},t.gutter=function(e){return[Ur(),Hr.of(Object.assign(Object.assign({},qr),e))]},t.gutterLineClass=zr,t.gutters=Ur,t.hasHoverTooltips=function(e){return e.facet(Ir).some((e=>e))},t.highlightActiveLine=function(){return gr},t.highlightActiveLineGutter=function(){return si},t.highlightSpecialChars=function(e={}){return[hr.of(e),ur||(ur=Me.fromClass(class{constructor(e){this.view=e,this.decorations=oe.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(hr)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new or({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:o}=n.state,s=r.codePointAt(t[0],0);if(9==s){let e=o.lineAt(i),t=n.state.tabSize,s=r.countColumn(e.text,t,i-e.from);return oe.replace({widget:new dr((t-s%t)*this.view.defaultCharacterWidth)})}return this.decorationCache[s]||(this.decorationCache[s]=oe.replace({widget:new fr(e,s)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(hr);e.startState.facet(hr)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]},t.hoverTooltip=function(e,t={}){let n=r.StateEffect.define(),i=r.StateField.define({create:()=>null,update(e,i){if(e&&(t.hideOnChange&&(i.docChanged||i.selection)||t.hideOn&&t.hideOn(i,e)))return null;if(e&&i.docChanged){let t=i.changes.mapPos(e.pos,-1,r.MapMode.TrackDel);if(null==t)return null;let n=Object.assign(Object.create(null),e);n.pos=t,null!=e.end&&(n.end=i.changes.mapPos(e.end)),e=n}for(let t of i.effects)t.is(n)&&(e=t.value),t.is(Pr)&&(e=null);return e},provide:e=>Ir.from(e)});return[i,Me.define((r=>new _r(r,e,i,n,t.hoverTime||300))),Tr]},t.keymap=Ln,t.lineNumberMarkers=Xr,t.lineNumbers=function(e={}){return[ei.of(e),Ur(),ri]},t.logException=Ce,t.panels=function(e){return e?[Rr.of(e)]:[]},t.placeholder=function(e){return Me.fromClass(class{constructor(t){this.view=t,this.placeholder=oe.set([oe.widget({widget:new vr(e),side:1}).range(0)])}get decorations(){return this.view.state.doc.length?oe.none:this.placeholder}},{decorations:e=>e.decorations})},t.rectangularSelection=function(e){let t=(null==e?void 0:e.eventFilter)||(e=>e.altKey&&0==e.button);return $n.mouseSelectionStyle.of(((e,n)=>t(n)?function(e,t){let n=br(e,t),i=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),r=e.state.doc.lineAt(t);n={line:r.number,col:n.col,off:Math.min(n.off,r.length)},i=i.map(e.changes)}},get(t,o,s){let a=br(e,t);if(!a)return i;let l=function(e,t,n){let i=Math.min(t.line,n.line),o=Math.max(t.line,n.line),s=[];if(t.off>yr||n.off>yr||t.col<0||n.col<0){let a=Math.min(t.off,n.off),l=Math.max(t.off,n.off);for(let t=i;t<=o;t++){let n=e.doc.line(t);n.length<=l&&s.push(r.EditorSelection.range(n.from+a,n.to+l))}}else{let a=Math.min(t.col,n.col),l=Math.max(t.col,n.col);for(let t=i;t<=o;t++){let n=e.doc.line(t),i=r.findColumn(n.text,a,e.tabSize,!0);if(i>-1){let t=r.findColumn(n.text,l,e.tabSize);s.push(r.EditorSelection.range(n.from+i,n.from+t))}}}return s}(e.state,n,a);return l.length?s?r.EditorSelection.create(l.concat(i.ranges)):r.EditorSelection.create(l):i}}:null}(e,n):null))},t.repositionTooltips=function(e){var t;null===(t=e.plugin(Or))||void 0===t||t.maybeMeasure()},t.runScopeHandlers=function(e,t,n){return Hn(Vn(e.state),t,e,n)},t.scrollPastEnd=function(){return[pr,Te.of((e=>{var t;return(null===(t=e.plugin(pr))||void 0===t?void 0:t.attrs)||null}))]},t.showPanel=Fr,t.showTooltip=Mr,t.tooltips=function(e={}){return Cr.of(e)}},7897:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=1024;let r=0;class i{constructor(e,t){this.from=e,this.to=t}}class o{constructor(e={}){this.id=r++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=l.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}o.closedBy=new o({deserialize:e=>e.split(" ")}),o.openedBy=new o({deserialize:e=>e.split(" ")}),o.group=new o({deserialize:e=>e.split(" ")}),o.contextHash=new o({perNode:!0}),o.lookAhead=new o({perNode:!0}),o.mounted=new o({perNode:!0});class s{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}}const a=Object.create(null);class l{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):a,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),r=new l(e.name||"",t,e.id,n);if(e.props)for(let n of e.props)if(Array.isArray(n)||(n=n(r)),n){if(n[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[n[0].id]=n[1]}return r}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(o.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(" "))t[r]=e[n];return e=>{for(let n=e.prop(o.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}}l.none=new l("",Object.create(null),0,8);class c{constructor(e){this.types=e;for(let t=0;t=i&&(s.type.isAnonymous||!1!==n(s))){if(s.firstChild())continue;e=!0}for(;e&&r&&!s.type.isAnonymous&&r(s),!s.nextSibling();){if(!s.parent())return;e=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:j(l.none,this.children,this.positions,0,this.children.length,0,this.length,((e,t,n)=>new d(this.type,e,t,n,this.propValues)),e.makeTree||((e,t,n)=>new d(l.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:r,nodeSet:i,maxBufferLength:s=n,reused:a=[],minRepeatType:l=i.types.length}=e,c=Array.isArray(r)?new p(r,r.length):r,h=i.types,u=0,f=0;function g(e,t,n,r,p){let{id:w,start:x,end:k,size:S}=c,A=f;for(;S<0;){if(c.next(),-1==S){let t=a[w];return n.push(t),void r.push(x-e)}if(-3==S)return void(u=w);if(-4==S)return void(f=w);throw new RangeError(`Unrecognized record size: ${S}`)}let C,O,E=h[w],M=x-e;if(k-x<=s&&(O=function(e,t){let n=c.fork(),r=0,i=0,o=0,a=n.end-s,h={size:0,start:0,skip:0};e:for(let s=n.pos-e;n.pos>s;){let e=n.size;if(n.id==t&&e>=0){h.size=r,h.start=i,h.skip=o,o+=4,r+=4,n.next();continue}let c=n.pos-e;if(e<0||c=l?4:0,f=n.start;for(n.next();n.pos>c;){if(n.size<0){if(-3!=n.size)break e;u+=4}else n.id>=l&&(u+=4);n.next()}i=f,r+=e,o+=u}return(t<0||r==e)&&(h.size=r,h.start=i,h.skip=o),h.size>4?h:void 0}(c.pos-t,p))){let t=new Uint16Array(O.size-O.skip),n=c.pos-O.size,r=t.length;for(;c.pos>n;)r=b(O.start,t,r);C=new m(t,k-O.start,i),M=O.start-e}else{let e=c.pos-S;c.next();let t=[],n=[],r=w>=l?w:-1,i=0,a=k;for(;c.pos>e;)r>=0&&c.id==r&&c.size>=0?(c.end<=a-s&&(v(t,n,x,i,c.end,a,r,A),i=t.length,a=c.end),c.next()):g(x,e,t,n,r);if(r>=0&&i>0&&i-1&&i>0){let e=function(e){return(t,n,r)=>{let i,s,a=0,l=t.length-1;if(l>=0&&(i=t[l])instanceof d){if(!l&&i.type==e&&i.length==r)return i;(s=i.prop(o.lookAhead))&&(a=n[l]+i.length+s)}return y(e,t,n,r,a)}}(E);C=j(E,t,n,0,t.length,0,k-x,e,e)}else C=y(E,t,n,k-x,A-k)}n.push(C),r.push(M)}function v(e,t,n,r,o,s,a,l){let c=[],h=[];for(;e.length>r;)c.push(e.pop()),h.push(t.pop()+n-o);e.push(y(i.types[a],c,h,s-o,l-s)),t.push(o-n)}function y(e,t,n,r,i=0,s){if(u){let e=[o.contextHash,u];s=s?[e].concat(s):[e]}if(i>25){let e=[o.lookAhead,i];s=s?[e].concat(s):[e]}return new d(e,t,n,r,s)}function b(e,t,n){let{id:r,start:i,end:o,size:s}=c;if(c.next(),s>=0&&r4){let r=c.pos-(s-4);for(;c.pos>r;)n=b(e,t,n)}t[--n]=a,t[--n]=o-e,t[--n]=i-e,t[--n]=r}else-3==s?u=r:-4==s&&(f=r);return n}let w=[],x=[];for(;c.pos>0;)g(e.start||0,e.bufferStart||0,w,x,-1);let k=null!==(t=e.length)&&void 0!==t?t:w.length?x[0]+w[0].length:0;return new d(h[e.topID],w.reverse(),x.reverse(),k)}(e)}}d.empty=new d(l.none,[],[],0);class p{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new p(this.buffer,this.index)}}class m{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return l.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return s}slice(e,t,n,r){let i=this.buffer,o=new Uint16Array(t-e);for(let r=e,s=0;r=t&&nt;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function v(e,t){let n=e.childBefore(t);for(;n;){let t=n.lastChild;if(!t||t.to!=n.to)break;t.type.isError&&t.from==t.to?(e=n,n=t.prevSibling):n=t}return e}function y(e,n,r,i){for(var o;e.from==e.to||(r<1?e.from>=n:e.from>n)||(r>-1?e.to<=n:e.to0?l.length:-1;e!=h;e+=n){let h=l[e],u=c[e]+a.from;if(g(i,r,u,u+h.length))if(h instanceof m){if(s&t.IterMode.ExcludeBuffers)continue;let o=h.findChild(0,h.buffer.length,n,r-u,i);if(o>-1)return new S(new k(a,h,e,u),null,o)}else if(s&t.IterMode.IncludeAnonymous||!h.type.isAnonymous||C(h)){let l;if(!(s&t.IterMode.IgnoreMounts)&&h.props&&(l=h.prop(o.mounted))&&!l.overlay)return new b(l.tree,u,e,a);let c=new b(h,u,e,a);return s&t.IterMode.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?h.children.length-1:0,n,r,i)}}if(s&t.IterMode.IncludeAnonymous||!a.type.isAnonymous)return null;if(e=a.index>=0?a.index+n:n<0?-1:a._parent._tree.children.length,a=a._parent,!a)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r&t.IterMode.IgnoreOverlays)&&(i=this._tree.prop(o.mounted))&&i.overlay){let t=e-this.from;for(let{from:e,to:r}of i.overlay)if((n>0?e<=t:e=t:r>t))return new b(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(e=0){return new A(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,t=0){return y(this,e,t,!1)}resolveInner(e,t=0){return y(this,e,t,!0)}enterUnfinishedNodesBefore(e){return v(this,e)}getChild(e,t=null,n=null){let r=w(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return w(this,e,t,n)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return x(this,e)}}function w(e,t,n,r){let i=e.cursor(),o=[];if(!i.firstChild())return o;if(null!=n)for(;!i.type.is(n);)if(!i.nextSibling())return o;for(;;){if(null!=r&&i.type.is(r))return o;if(i.type.is(t)&&o.push(i.node),!i.nextSibling())return null==r?o:[]}}function x(e,t,n=t.length-1){for(let r=e.parent;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class k{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class S{constructor(e,t,n){this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}child(e,t,n){let{buffer:r}=this.context,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return i<0?null:new S(this.context,this,i)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&t.IterMode.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return o<0?null:new S(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new S(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new S(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}cursor(e=0){return new A(this,e)}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let o=n.buffer[this.index+1],s=n.buffer[this.index+2];e.push(n.slice(r,i,o,s)),t.push(0)}return new d(this.type,e,t,this.to-this.from)}resolve(e,t=0){return y(this,e,t,!1)}resolveInner(e,t=0){return y(this,e,t,!0)}enterUnfinishedNodesBefore(e){return v(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,n=null){let r=w(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return w(this,e,t,n)}get node(){return this}matchContext(e){return x(this,e)}}class A{constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof b)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}get name(){return this.type.name}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return!!e&&(e instanceof b?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return!(i<0)&&(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?!(r&t.IterMode.ExcludeBuffers)&&this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&t.IterMode.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&t.IterMode.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let i=n+e,o=e<0?-1:r._tree.children.length;i!=o;i+=e){let e=r._tree.children[i];if(this.mode&t.IterMode.IncludeAnonymous||e instanceof m||!e.type.isAnonymous||C(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=i+1;break e}r=this.stack[--i]}for(let e=n;e=0;i--){if(i<0)return x(this.node,e,r);let o=n[t.buffer[this.stack[i]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function C(e){return e.children.some((e=>e instanceof m||!e.type.isAnonymous||C(e)))}const O=new WeakMap;function E(e,t){if(!e.isAnonymous||t instanceof m||t.type!=e)return 1;let n=O.get(t);if(null==n){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof d)){n=1;break}n+=E(e,r)}O.set(t,n)}return n}function j(e,t,n,r,i,o,s,a,l){let c=0;for(let n=r;n=h)break;p+=t}if(c==i+1){if(p>h){let e=n[i];t(e.children,e.positions,0,e.children.length,r[i]+a);continue}u.push(n[i])}else{let t=r[c-1]+n[c-1].length-d;u.push(j(e,n,r,i,c,d,t,null,l))}f.push(d+a-o)}}(t,n,r,i,0),(a||l)(u,f,s)}class M{constructor(e,t,n,r,i=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=(i?1:0)|(o?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let r=[new M(0,e.length,e,0,!1,n)];for(let n of t)n.to>e.length&&r.push(n);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],i=1,o=e.length?e[0]:null;for(let s=0,a=0,l=0;;s++){let c=s=n)for(;o&&o.from=t.from||h<=t.to||l){let e=Math.max(t.from,a)-l,n=Math.min(t.to,h)-l;t=e>=n?null:new M(e,n,t.tree,t.offset+l,s>0,!!c)}if(t&&r.push(t),o.to>h)break;o=ie.frag.from<=o.from&&e.frag.to>=o.to&&e.mount.overlay));if(e)for(let t of e.mount.overlay){let r=t.from+e.pos,i=t.to+e.pos;r>=o.from&&i<=o.to&&!n.ranges.some((e=>e.fromr))&&n.ranges.push({from:r,to:i})}}l=!1}else if(r&&(s=D(r.ranges,o.from,o.to)))l=2!=s;else if(!o.type.isAnonymous&&o.fromnew i(e.from-o.from,e.to-o.from))):null,o.tree,e)),t.overlay?e.length&&(r={ranges:e,depth:0,prev:r}):l=!1}}else n&&(a=n.predicate(o))&&(!0===a&&(a=new i(o.from,o.to)),a.fromnew i(e.from-n.start,e.to-n.start))),n.target,e)),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}}function D(e,t,n){for(let r of e){if(r.from>=n)break;if(r.to>t)return r.from<=t&&r.to>=n?2:1}return 0}function R(e,t,n,r,i,o){if(t=t.to);r++);let s=i.children[r],a=s.buffer;i.children[r]=function e(n,r,i,l,c){let h=n;for(;a[h+2]+o<=t.from;)h=a[h+3];let u=[],f=[];R(s,n,h,u,f,l);let p=a[h+1],m=a[h+2],g=p+o==t.from&&m+o==t.to&&a[h]==t.type.id;return u.push(g?t.toTree():e(h+4,a[h+3],s.set.types[a[h]],p,m-p)),f.push(p-l),R(s,a[h+3],r,u,f,l),new d(i,u,f,c)}(0,a.length,l.none,0,s.length);for(let r=0;r<=n;r++)e.childAfter(t.from)}class B{constructor(e,n){this.offset=n,this.done=!1,this.cursor=e.cursor(t.IterMode.IncludeAnonymous|t.IterMode.IgnoreMounts)}moveTo(e){let{cursor:n}=this,r=e-this.offset;for(;!this.done&&n.from=e&&n.enter(r,1,t.IterMode.IgnoreOverlays|t.IterMode.ExcludeBuffers)||n.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(!(t.children.length&&0==t.positions[0]&&t.children[0]instanceof d))break;t=t.children[0]}return!1}}class L{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=null!==(t=n.tree.prop(_))&&void 0!==t?t:n.to,this.inner=new B(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=null!==(e=t.tree.prop(_))&&void 0!==e?e:t.to,this.inner=new B(t.tree,-t.offset)}}findMounts(e,t){var n;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let e=this.inner.cursor.node;e;e=e.parent){let i=null===(n=e.tree)||void 0===n?void 0:n.prop(o.mounted);if(i&&i.parser==t)for(let t=this.fragI;t=e.to)break;n.tree==this.curFrag.tree&&r.push({frag:n,pos:e.from-n.offset,mount:i})}}}return r}}function F(e,t){let n=null,r=t;for(let o=1,s=0;o=l)break;e.to<=a||(n||(r=n=t.slice()),e.froml&&n.splice(s+1,0,new i(l,e.to))):e.to>l?n[s--]=new i(l,e.to):n.splice(s--,1))}}return r}function V(e,t,n,r){let o=0,s=0,a=!1,l=!1,c=-1e9,h=[];for(;;){let u=o==e.length?1e9:a?e[o].to:e[o].from,f=s==t.length?1e9:l?t[s].to:t[s].from;if(a!=l){let e=Math.max(c,n),t=Math.min(u,f,r);enew i(e.from+r,e.to+r))),l,c);for(let t=0,r=l;;t++){let i=t==a.length,l=i?c:a[t].from;if(l>r&&n.push(new M(r,l,o.tree,-e,s.from>=r,s.to<=l)),i)break;r=a[t].to}}else n.push(new M(l,c,o.tree,-e,s.from>=e,s.to<=a))}return n}t.DefaultBufferLength=n,t.MountedTree=s,t.NodeProp=o,t.NodeSet=c,t.NodeType=l,t.NodeWeakMap=class{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof S?this.setBuffer(e.context.buffer,e.index,t):e instanceof b&&this.map.set(e.tree,t)}get(e){return e instanceof S?this.getBuffer(e.context.buffer,e.index):e instanceof b?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}},t.Parser=class{startParse(e,t,n){return"string"==typeof e&&(e=new I(e)),n=n?n.length?n.map((e=>new i(e.from,e.to))):[new i(0,0)]:[new i(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},t.Tree=d,t.TreeBuffer=m,t.TreeCursor=A,t.TreeFragment=M,t.parseMixed=function(e){return(t,n,r,i)=>new P(t,e,n,r,i)}},5048:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7897);let i=0;class o{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=i++}static define(e){if(null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let t=new o([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new a;return t=>t.modified.indexOf(e)>-1?t:a.get(t.base||t,t.modified.concat(e).sort(((e,t)=>e.id-t.id)))}}let s=0;class a{constructor(){this.instances=[],this.id=s++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find((n=>{return n.base==e&&(r=t,i=n.modified,r.length==i.length&&r.every(((e,t)=>e==i[t])));var r,i}));if(n)return n;let r=[],i=new o(r,e,t);for(let e of t)e.instances.push(i);let s=l(t);for(let t of e.set)for(let e of s)r.push(a.get(t,e));return i}}function l(e){let t=[e];for(let n=0;n{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+" "+r:r;break}}return t},scope:r}}function f(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+" "+e:e)}return n}class d{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,i,o){let{type:s,from:a,to:l}=e;if(a>=n||l<=t)return;s.isTop&&(o=this.highlighters.filter((e=>!e.scope||e.scope(s))));let h=i,u=s.prop(c),d=!1;for(;u;){if(!u.context||e.matchContext(u.context)){let e=f(o,u.tags);e&&(h&&(h+=" "),h+=e,1==u.mode?i+=(i?" ":"")+e:0==u.mode&&(d=!0));break}u=u.next}if(this.startSpan(e.from,h),d)return;let p=e.tree&&e.tree.prop(r.NodeProp.mounted);if(p&&p.overlay){let r=e.node.enter(p.overlay[0].from+a,1),s=this.highlighters.filter((e=>!e.scope||e.scope(p.tree.type))),c=e.firstChild();for(let u=0,f=a;;u++){let d=u=m)&&e.nextSibling()););if(!d||m>n)break;f=d.to+a,f>t&&(this.highlightRange(r.cursor(),Math.max(t,d.from+a),Math.min(n,f),i,s),this.startSpan(f,h))}c&&e.parent()}else if(e.firstChild()){do{if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,i,o),this.startSpan(Math.min(n,e.to),h)}}while(e.nextSibling());e.parent()}}}const p=o.define,m=p(),g=p(),v=p(g),y=p(g),b=p(),w=p(b),x=p(b),k=p(),S=p(k),A=p(),C=p(),O=p(),E=p(O),j=p(),M={comment:m,lineComment:p(m),blockComment:p(m),docComment:p(m),name:g,variableName:p(g),typeName:v,tagName:p(v),propertyName:y,attributeName:p(y),className:p(g),labelName:p(g),namespace:p(g),macroName:p(g),literal:b,string:w,docString:p(w),character:p(w),attributeValue:p(w),number:x,integer:p(x),float:p(x),bool:p(b),regexp:p(b),escape:p(b),color:p(b),url:p(b),keyword:A,self:p(A),null:p(A),atom:p(A),unit:p(A),modifier:p(A),operatorKeyword:p(A),controlKeyword:p(A),definitionKeyword:p(A),moduleKeyword:p(A),operator:C,derefOperator:p(C),arithmeticOperator:p(C),logicOperator:p(C),bitwiseOperator:p(C),compareOperator:p(C),updateOperator:p(C),definitionOperator:p(C),typeOperator:p(C),controlOperator:p(C),punctuation:O,separator:p(O),bracket:E,angleBracket:p(E),squareBracket:p(E),paren:p(E),brace:p(E),content:k,heading:S,heading1:p(S),heading2:p(S),heading3:p(S),heading4:p(S),heading5:p(S),heading6:p(S),contentSeparator:p(k),list:p(k),quote:p(k),emphasis:p(k),strong:p(k),link:p(k),monospace:p(k),strikethrough:p(k),inserted:p(),deleted:p(),changed:p(),invalid:p(),meta:j,documentMeta:p(j),annotation:p(j),processingInstruction:p(j),definition:o.defineModifier(),constant:o.defineModifier(),function:o.defineModifier(),standard:o.defineModifier(),local:o.defineModifier(),special:o.defineModifier()},I=u([{tag:M.link,class:"tok-link"},{tag:M.heading,class:"tok-heading"},{tag:M.emphasis,class:"tok-emphasis"},{tag:M.strong,class:"tok-strong"},{tag:M.keyword,class:"tok-keyword"},{tag:M.atom,class:"tok-atom"},{tag:M.bool,class:"tok-bool"},{tag:M.url,class:"tok-url"},{tag:M.labelName,class:"tok-labelName"},{tag:M.inserted,class:"tok-inserted"},{tag:M.deleted,class:"tok-deleted"},{tag:M.literal,class:"tok-literal"},{tag:M.string,class:"tok-string"},{tag:M.number,class:"tok-number"},{tag:[M.regexp,M.escape,M.special(M.string)],class:"tok-string2"},{tag:M.variableName,class:"tok-variableName"},{tag:M.local(M.variableName),class:"tok-variableName tok-local"},{tag:M.definition(M.variableName),class:"tok-variableName tok-definition"},{tag:M.special(M.variableName),class:"tok-variableName2"},{tag:M.definition(M.propertyName),class:"tok-propertyName tok-definition"},{tag:M.typeName,class:"tok-typeName"},{tag:M.namespace,class:"tok-namespace"},{tag:M.className,class:"tok-className"},{tag:M.macroName,class:"tok-macroName"},{tag:M.propertyName,class:"tok-propertyName"},{tag:M.operator,class:"tok-operator"},{tag:M.comment,class:"tok-comment"},{tag:M.meta,class:"tok-meta"},{tag:M.invalid,class:"tok-invalid"},{tag:M.punctuation,class:"tok-punctuation"}]);t.Tag=o,t.classHighlighter=I,t.highlightTree=function(e,t,n,r=0,i=e.length){let o=new d(r,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),r,i,"",o.highlighters),o.flush(i)},t.styleTags=function(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(" "))if(e){let n=[],i=2,o=e;for(let t=0;;){if("..."==o&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!r)throw new RangeError("Invalid path: "+e);if(n.push("*"==r[0]?"":'"'==r[0][0]?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let s=e[t++];if(t==e.length&&"!"==s){i=0;break}if("/"!=s)throw new RangeError("Invalid path: "+e);o=e.slice(t)}let s=n.length-1,a=n[s];if(!a)throw new RangeError("Invalid path: "+e);let l=new h(r,i,s>0?n.slice(0,s):null);t[a]=l.sort(t[a])}}return c.add(t)},t.tagHighlighter=u,t.tags=M},9922:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5090),i=n(5048);const o=i.styleTags({String:i.tags.string,Number:i.tags.number,"True False":i.tags.bool,PropertyName:i.tags.propertyName,Null:i.tags.null,",":i.tags.separator,"[ ]":i.tags.squareBracket,"{ }":i.tags.brace}),s=r.LRParser.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[o],skippedNodes:[0],repeatNodeCount:2,tokenData:"(p~RaXY!WYZ!W]^!Wpq!Wrs!]|}$i}!O$n!Q!R$w!R![&V![!]&h!}#O&m#P#Q&r#Y#Z&w#b#c'f#h#i'}#o#p(f#q#r(k~!]Oc~~!`Upq!]qr!]rs!rs#O!]#O#P!w#P~!]~!wOe~~!zXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#g~#jR!Q![#s!c!i#s#T#Z#s~#vR!Q![$P!c!i$P#T#Z$P~$SR!Q![$]!c!i$]#T#Z$]~$`R!Q![!]!c!i!]#T#Z!]~$nOh~~$qQ!Q!R$w!R![&V~$|RT~!O!P%V!g!h%k#X#Y%k~%YP!Q![%]~%bRT~!Q![%]!g!h%k#X#Y%k~%nR{|%w}!O%w!Q![%}~%zP!Q![%}~&SPT~!Q![%}~&[ST~!O!P%V!Q![&V!g!h%k#X#Y%k~&mOg~~&rO]~~&wO[~~&zP#T#U&}~'QP#`#a'T~'WP#g#h'Z~'^P#X#Y'a~'fOR~~'iP#i#j'l~'oP#`#a'r~'uP#`#a'x~'}OS~~(QP#f#g(T~(WP#i#j(Z~(^P#X#Y(a~(fOQ~~(kOW~~(pOV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});t.parser=s},5090:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(7897);class o{constructor(e,t,n,r,i,o,s,a,l,c=0,h){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=o,this.buffer=s,this.bufferBase=a,this.curContext=l,this.lookAhead=c,this.parent=h}toString(){return`[${this.stack.filter(((e,t)=>t%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new o(e,[],t,n,n,0,[],0,r?new s(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=65535&e,{parser:r}=this.p,i=r.dynamicPrecedence(n);if(i&&(this.score+=i),0==t)return this.pushState(r.getGoto(this.state,n,!0),this.reducePos),no;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==e.buffer[r-4]&&e.buffer[r-1]>-1){if(t==n)return;if(e.buffer[r-2]>=t)return void(e.buffer[r-2]=n)}}if(i&&this.pos!=n){let i=this.buffer.length;if(i>0&&0!=this.buffer[i-4])for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4);this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}else this.buffer.push(e,t,n,r)}shift(e,t,n){let r=this.pos;if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){let i=e,{parser:o}=this.p;(n>this.pos||t<=o.maxNode)&&(this.pos=n,o.stateFlag(i,1)||(this.reducePos=n)),this.pushState(i,r),this.shiftContext(t,r),t<=o.maxNode&&this.buffer.push(t,r,n,4)}else this.pos=n,this.shiftContext(t,r),t<=this.p.parser.maxNode&&this.buffer.push(t,r,n,4)}apply(e,t,n){65536&e?this.reduce(e):this.shift(e,t,n)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new o(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new a(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==(65536&n))return!0;if(0==n)return!1;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r,i=0;i1&t&&e==r))||n.push(t[e],r)}t=n}let n=[];for(let e=0;e>19,r=65535&e,i=this.stack.length-3*n;if(i<0||t.getGoto(this.stack[i],r,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class s{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}!function(e){e[e.Insert=200]="Insert",e[e.Delete=190]="Delete",e[e.Reduce=100]="Reduce",e[e.MaxNext=4]="MaxNext",e[e.MaxInsertStackDepth=300]="MaxInsertStackDepth",e[e.DampenInsertStackDepth=120]="DampenInsertStackDepth"}(r||(r={}));class a{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,n=e>>19;0==n?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(n-1);let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class l{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new l(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new l(this.stack,this.pos,this.index)}}class c{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const h=new c;class u{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=h,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;in.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}peek(e){let t,n,r=this.chunkOff+e;if(r>=0&&r=this.chunk2Pos&&tr.to&&(this.chunk2=this.chunk2.slice(0,r.to-t)),n=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),n}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=h,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}}class f{constructor(e,t){this.data=e,this.id=t}token(e,t){!function(e,t,n,r){let i=0,o=1<0){let n=e[r];if(a.allows(n)&&(-1==t.token.value||t.token.value==n||s.overrides(n,t.token.value))){t.acceptToken(n);break}}let r=t.next,l=0,c=e[i+2];if(!(t.next<0&&c>l&&65535==e[n+3*c-3])){for(;l>1,s=n+o+(o<<1),a=e[s],h=e[s+1];if(r=h)){i=e[s+2],t.advance();continue e}l=o+1}}break}i=e[n+3*c-1]}}(this.data,e,t,this.id)}}function d(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let r=0,i=0;r=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),o+=i,n)break;o*=46}n?n[i++]=o:n=new t(o)}return n}f.prototype.contextual=f.prototype.fallback=f.prototype.extend=!1;const p="undefined"!=typeof process&&process.env&&/\bparse\b/.test(process.env.LOG);let m=null;var g,v;function y(e,t,n){let r=e.cursor(i.IterMode.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.tot)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}!function(e){e[e.Margin=25]="Margin"}(g||(g={}));class b{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?y(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?y(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=s,null;if(o instanceof i.Tree){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[t]++,this.nextStart=s+o.length}}}class w{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map((e=>new c))}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,o=r.stateSlot(e.state,3),s=e.curContext?e.curContext.hash:0,a=0;for(let r=0;rc.end+25&&(a=Math.max(c.lookAhead,a)),0!=c.value)){let r=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!l.extend&&(n=c,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),n||e.pos!=this.stream.end||(n=new c,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new c,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){if(t.token(this.stream.reset(n.pos,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r=0&&n.p.parser.dialect.allows(i>>1)){0==(1&i)?e.value=i>>1:e.extended=i>>1;break}}}else e.value=0,e.end=Math.min(n.p.stream.end,n.pos+1)}putAction(e,t,n,r){for(let t=0;t4*e.bufferLength?new b(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,r=this.minStackPos,i=this.stacks=[];for(let o=0;or)i.push(s);else{if(this.advanceStack(s,i,n))continue;{e||(e=[],t=[]),e.push(s);let n=this.tokens.getMainToken(s);t.push(n.value,n.end)}}break}}if(!i.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scorethis.stoppedAt?e[0]:this.runRecovery(e,t,i);if(n)return this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(i.length>e)for(i.sort(((e,t)=>t.score-e.score));i.length>e;)i.pop();i.some((e=>e.reducePos>r))&&this.recovering--}else if(i.length>1)e:for(let e=0;e500&&r.buffer.length>500){if(!((t.score-r.score||t.buffer.length-r.buffer.length)>0)){i.splice(e--,1);continue e}i.splice(n--,1)}}}this.minStackPos=i[0].pos;for(let e=1;e ":"";if(null!=this.stoppedAt&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let a=this.fragments.nodeAt(r);a;){let r=this.parser.nodeSet.types[a.type.id]==a.type?o.getGoto(e.state,a.type.id):-1;if(r>-1&&a.length&&(!t||(a.prop(i.NodeProp.contextHash)||0)==n))return e.useNode(a,r),p&&console.log(s+this.stackID(e)+` (via reuse of ${o.getName(a.type.id)})`),!0;if(!(a instanceof i.Tree)||0==a.children.length||a.positions[0]>0)break;let l=a.children[0];if(!(l instanceof i.Tree&&0==a.positions[0]))break;a=l}}let a=o.stateSlot(e.state,4);if(a>0)return e.reduce(a),p&&console.log(s+this.stackID(e)+` (via always-reduce ${o.getName(65535&a)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let i=0;ir?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return k(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let o=0;o ":"";if(s.deadEnd){if(i)continue;if(i=!0,s.restart(),p&&console.log(c+this.stackID(s)+" (restarted)"),this.advanceFully(s,n))continue}let h=s.split(),u=c;for(let e=0;h.forceReduce()&&e<10&&(p&&console.log(u+this.stackID(h)+" (via force-reduce)"),!this.advanceFully(h,n));e++)p&&(u=this.stackID(h)+" -> ");for(let e of s.recoverByInsert(a))p&&console.log(c+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,n);this.stream.end>s.pos?(l==s.pos&&(l++,a=0),s.recoverByDelete(a,l),p&&console.log(c+this.stackID(s)+` (via recover-delete ${this.parser.getName(a)})`),k(s,n)):(!r||r.scoree;class C extends i.Parser{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let n=0;ne.topRules[t][1])),r=[];for(let e=0;e=0)o(r,e,t[n++]);else{let i=t[n+-r];for(let s=-r;s>0;s--)o(t[n++],e,i);n++}}}this.nodeSet=new i.NodeSet(t.map(((t,o)=>i.NodeType.define({name:o>=this.minRepeatTerm?void 0:t,id:o,props:r[o],top:n.indexOf(o)>-1,error:0==o,skipped:e.skippedNodes&&e.skippedNodes.indexOf(o)>-1})))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=i.DefaultBufferLength;let s=d(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e"number"==typeof e?new f(s,e):e)),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new x(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],o=1&t,s=r[i++];if(o&&n)return s;for(let n=i+(t>>1);i0}validAction(e,t){if(t==this.stateSlot(e,4))return!0;for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])return!1;n=O(this.data,n+2)}if(t==O(this.data,n+1))return!0}}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])break;n=O(this.data,n+2)}if(0==(1&this.data[n+2])){let e=this.data[n+1];t.some(((t,n)=>1&n&&t==e))||t.push(this.data[n],e)}}return t}overrides(e,t){let n=E(this.data,this.tokenPrecTable,t);return n<0||E(this.data,this.tokenPrecTable,e){let n=e.tokenizers.find((e=>e.from==t));return n?n.to:t}))),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map(((n,r)=>{let i=e.specializers.find((e=>e.from==n.external));if(!i)return n;let o=Object.assign(Object.assign({},n),{external:i.to});return t.specializers[r]=j(o),o}))),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map((()=>!1));if(e)for(let r of e.split(" ")){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;ee.external(n,r)<<1|t}return e.get}t.ContextTracker=class{constructor(e){this.start=e.start,this.shift=e.shift||A,this.reduce=e.reduce||A,this.reuse=e.reuse||A,this.hash=e.hash||(()=>0),this.strict=!1!==e.strict}},t.ExternalTokenizer=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}},t.InputStream=u,t.LRParser=C,t.Stack=o},9091:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3642),i=n(7040),o=n(729),s=n(8561),a=n(2502),l=n(526),c=n(2426);const h=[r.lineNumbers(),r.highlightActiveLineGutter(),r.highlightSpecialChars(),s.history(),o.foldGutter(),r.drawSelection(),r.dropCursor(),i.EditorState.allowMultipleSelections.of(!0),o.indentOnInput(),o.syntaxHighlighting(o.defaultHighlightStyle,{fallback:!0}),o.bracketMatching(),l.closeBrackets(),l.autocompletion(),r.rectangularSelection(),r.crosshairCursor(),r.highlightActiveLine(),a.highlightSelectionMatches(),r.keymap.of([...l.closeBracketsKeymap,...s.defaultKeymap,...a.searchKeymap,...s.historyKeymap,...o.foldKeymap,...l.completionKeymap,...c.lintKeymap])],u=[r.highlightSpecialChars(),s.history(),r.drawSelection(),o.syntaxHighlighting(o.defaultHighlightStyle,{fallback:!0}),r.keymap.of([...s.defaultKeymap,...s.historyKeymap])];Object.defineProperty(t,"EditorView",{enumerable:!0,get:function(){return r.EditorView}}),t.basicSetup=h,t.minimalSetup=u},8513:e=>{"use strict";function t(e,n){if("string"==typeof n)e.appendChild(document.createTextNode(n));else if(null==n);else if(null!=n.nodeType)e.appendChild(n);else{if(!Array.isArray(n))throw new RangeError("Unsupported child node: "+n);for(var r=0;r{var n="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),r="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{},o=t.StyleModule=function(e,t){this.rules=[];var n=(t||{}).finish;function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,o,s){var a=[],l=/^@(\w+)\b/.exec(e[0]),c=l&&"keyframes"==l[1];if(l&&null==t)return o.push(e[0]+";");for(var h in t){var u=t[h];if(/&/.test(h))i(h.split(/,\s*/).map((function(t){return e.map((function(e){return t.replace(/&/,e)}))})).reduce((function(e,t){return e.concat(t)})),u,o);else if(u&&"object"==typeof u){if(!l)throw new RangeError("The value of a property ("+h+") should be a primitive value.");i(r(h),u,a,c)}else null!=u&&a.push(h.replace(/_.*/,"").replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()}))+": "+u+";")}(a.length||c)&&o.push((!n||l||s?e:e.map(n)).join(", ")+" {"+a.join(" ")+"}")}for(var o in e)i(r(o),e[o],this.rules)};o.prototype.getRules=function(){return this.rules.join("\n")},o.newName=function(){var e=i[n]||1;return i[n]=e+1,"ͼ"+e.toString(36)},o.mount=function(e,t){(e[r]||new a(e)).mount(Array.isArray(t)?t:[t])};var s=null,a=function(e){if(!e.head&&e.adoptedStyleSheets&&"undefined"!=typeof CSSStyleSheet){if(s)return e.adoptedStyleSheets=[s.sheet].concat(e.adoptedStyleSheets),e[r]=s;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),s=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");var t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[r]=this};a.prototype.mount=function(e){for(var t=this.sheet,n=0,r=0,i=0;i-1&&(this.modules.splice(s,1),r--,s=-1),-1==s){if(this.modules.splice(r++,0,o),t)for(var a=0;a{"use strict";Object.defineProperty(t,"__esModule",{value:!0});for(var n={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},r={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},i="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),o="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),s="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),a="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),l="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),c=i&&(a||+i[1]<57)||s&&a,h=0;h<10;h++)n[48+h]=n[96+h]=String(h);for(h=1;h<=24;h++)n[h+111]="F"+h;for(h=65;h<=90;h++)n[h]=String.fromCharCode(h+32),r[h]=String.fromCharCode(h);for(var u in n)r.hasOwnProperty(u)||(r[u]=n[u]);t.base=n,t.keyName=function(e){var t=!(c&&(e.ctrlKey||e.altKey||e.metaKey)||(o||l)&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?r:n)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t},t.shift=r},4226:e=>{"use strict";e.exports=JSON.parse('{"http://json-schema.org/draft-03/schema#":"draft3","http://json-schema.org/draft-04/schema#":"draft4","http://json-schema.org/draft-06/schema#":"draft6","http://json-schema.org/draft-07/schema#":"draft7","https://json-schema.org/draft/2019-09/schema":"2019-09","https://json-schema.org/draft/2020-12/schema":"2020-12"}')},4147:e=>{"use strict";e.exports=JSON.parse('{"name":"alterschema","version":"1.1.3","description":"Convert between schema specifications","main":"bindings/node/index.js","bin":{"alterschema":"bindings/node/cli.js"},"keywords":["json","json-schema","jsonschema","openapi","convert","transform","version"],"repository":{"type":"git","url":"git+https://github.com/sourcemeta/alterschema.git"},"author":"Juan Cruz Viotti ","license":"Apache-2.0","bugs":{"url":"https://github.com/sourcemeta/alterschema/issues"},"devDependencies":{"@codemirror/lang-json":"^6.0.0","@codemirror/lint":"^6.0.0","ajv-cli":"^5.0.0","bootstrap":"^5.2.0","codemirror":"^6.0.1","standard":"^17.0.0","tap":"^18.0.3","webpack":"^5.74.0","webpack-cli":"^5.0.0"},"dependencies":{"@hyperjump/json-schema":"^0.23.5","json-e":"^4.4.3","lodash":"^4.17.21","object-hash":"^3.0.0"}}')},4405:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-2019-09","rules":[{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2019-09/empty-dependent-schemas","type":"object","required":["dependentSchemas"],"properties":{"dependentSchemas":{"const":{}}}},"transform":{"$eval":"omit(schema, \'dependentSchemas\')"}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2019-09/empty-dependent-required","type":"object","required":["dependentRequired"],"properties":{"dependentRequired":{"const":{}}}},"transform":{"$eval":"omit(schema, \'dependentRequired\')"}}]}')},7377:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-2019-09","rules":[{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/upgrade-official-metaschema","type":"object","required":["$schema"],"properties":{"$schema":{"const":"https://json-schema.org/draft/2019-09/schema"}}},"transform":{"$merge":[{"$eval":"schema"},{"$$schema":"https://json-schema.org/draft/2020-12/schema"}]}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/open-tuple","$comment":"https://json-schema.org/draft/2020-12/release-notes.html","type":"object","required":["items"],"properties":{"items":{"type":"array"},"additionalItems":false}},"transform":{"$merge":[{"$eval":"omit(schema, \'items\')"},{"prefixItems":{"$eval":"schema.items"}}]}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/open-tuple-in-ref","$comment":"https://json-schema.org/draft/2020-12/release-notes.html","type":"object","required":["$ref"],"properties":{"$ref":{"type":"string","pattern":"/items/\\\\d+"}}},"transform":{"$merge":[{"$eval":"omit(schema, \'$ref\')"},{"$$ref":{"$eval":"replace(schema[\'$ref\'], \'/items/(\\\\d+)\', \'/prefixItems/$1\')"}}]}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/additional-items-in-ref","$comment":"https://json-schema.org/draft/2020-12/release-notes.html","type":"object","required":["$ref"],"properties":{"$ref":{"type":"string","pattern":"/additionalItems"}}},"transform":{"$merge":[{"$eval":"omit(schema, \'$ref\')"},{"$$ref":{"$eval":"replace(schema[\'$ref\'], \'/additionalItems\', \'/items\')"}}]}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/closed-tuple","$comment":"https://json-schema.org/draft/2020-12/release-notes.html","type":"object","required":["items","additionalItems"],"properties":{"additionalItems":true,"items":{"type":"array"}}},"transform":{"$merge":[{"$eval":"omit(schema, \'additionalItems\')"},{"items":{"$eval":"schema.additionalItems"},"prefixItems":{"$eval":"schema.items"}}]}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/empty-object","const":{}},"transform":{"$eval":"true"}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/negated-empty-object","const":{"not":true}},"transform":{"$eval":"false"}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/enum-to-const","type":"object","required":["enum"],"properties":{"enum":{"type":"array","minItems":1,"maxItems":1}}},"transform":{"$merge":[{"$eval":"omit(schema, \'enum\')"},{"const":{"$eval":"schema.enum[0]"}}]}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/recursive-anchor-false","type":"object","required":["$recursiveAnchor"],"properties":{"$recursiveAnchor":{"const":false}}},"transform":{"$eval":"omit(schema, \'$recursiveAnchor\')"}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/recursive-anchor-true","type":"object","required":["$recursiveAnchor"],"properties":{"$recursiveAnchor":{"const":true}}},"transform":{"$merge":[{"$eval":"omit(schema, \'$recursiveAnchor\')"},{"$$dynamicAnchor":{"$eval":"\'anchor-\' + jsonHash(original)"}}]}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/recursive-ref-empty-fragment","type":"object","required":["$recursiveRef"],"properties":{"$recursiveRef":{"const":"#"}}},"transform":{"$merge":[{"$eval":"omit(schema, \'$recursiveRef\')"},{"$$dynamicRef":{"$if":"hasContext(\'$recursiveAnchor\', true)","then":{"$eval":"\'#anchor-\' + jsonHash(original)"},"else":{"$eval":"schema[\'$recursiveRef\']"}}}]}}]}')},4619:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-2020-12","rules":[]}')},3825:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-draft3","rules":[]}')},3066:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-draft3","rules":[{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft3-to-draft4/upgrade-official-metaschema","type":"object","required":["$schema"],"properties":{"$schema":{"const":"http://json-schema.org/draft-03/schema#"}}},"transform":{"$merge":[{"$eval":"schema"},{"$$schema":"http://json-schema.org/draft-04/schema#"}]}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft3-to-draft4/type-any","type":"object","required":["type"],"properties":{"type":{"const":"any"}}},"transform":{"$eval":"omit(schema, \'type\')"}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft3-to-draft4/type-any-array","type":"object","required":["type"],"properties":{"type":{"type":"array","contains":{"const":"any"}}}},"transform":{"$eval":"omit(schema, \'type\')"}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft3-to-draft4/divisible-by","type":"object","required":["divisibleBy"],"properties":{"divisibleBy":{"type":"number"}}},"transform":{"$merge":[{"$eval":"omit(schema, \'divisibleBy\')"},{"multipleOf":{"$eval":"schema.divisibleBy"}}]}}]}')},9300:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-draft4","rules":[]}')},8790:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-draft4","rules":[{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft4-to-draft6/upgrade-official-metaschema","type":"object","required":["$schema"],"properties":{"$schema":{"const":"http://json-schema.org/draft-04/schema#"}}},"transform":{"$merge":[{"$eval":"schema"},{"$$schema":"http://json-schema.org/draft-06/schema#"}]}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft4-to-draft6/id","type":"object","required":["id"],"properties":{"id":{"type":"string"}}},"transform":{"$merge":[{"$eval":"omit(schema, \'id\')"},{"$$id":{"$eval":"schema.id"}}]}},{"vocabulary":"validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft4-to-draft6/boolean-exclusive-minimum-true","type":"object","required":["minimum","exclusiveMinimum"],"properties":{"minimum":{"type":"number"},"exclusiveMinimum":{"const":true}}},"transform":{"$merge":[{"$eval":"omit(schema, \'minimum\')"},{"exclusiveMinimum":{"$eval":"schema.minimum"}}]}},{"vocabulary":"validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft4-to-draft6/boolean-exclusive-maximum-true","type":"object","required":["maximum","exclusiveMaximum"],"properties":{"maximum":{"type":"number"},"exclusiveMaximum":{"const":true}}},"transform":{"$merge":[{"$eval":"omit(schema, \'maximum\')"},{"exclusiveMaximum":{"$eval":"schema.maximum"}}]}},{"vocabulary":"validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft4-to-draft6/boolean-exclusive-minimum-false","type":"object","required":["minimum","exclusiveMinimum"],"properties":{"minimum":{"type":"number"},"exclusiveMinimum":{"const":false}}},"transform":{"$merge":[{"$eval":"omit(schema, \'exclusiveMinimum\')"}]}},{"vocabulary":"validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft4-to-draft6/boolean-exclusive-maximum-false","type":"object","required":["maximum","exclusiveMaximum"],"properties":{"maximum":{"type":"number"},"exclusiveMaximum":{"const":false}}},"transform":{"$merge":[{"$eval":"omit(schema, \'exclusiveMaximum\')"}]}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft4-to-draft6/empty-object","const":{}},"transform":{"$eval":"true"}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft4-to-draft6/negated-empty-object","const":{"not":true}},"transform":{"$eval":"false"}},{"vocabulary":"validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft4-to-draft6/enum-to-const","type":"object","required":["enum"],"properties":{"enum":{"type":"array","minItems":1,"maxItems":1}}},"transform":{"$merge":[{"$eval":"omit(schema, \'enum\')"},{"const":{"$eval":"schema.enum[0]"}}]}}]}')},2630:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-draft6","rules":[]}')},6989:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-draft6","rules":[{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft6-to-draft7/upgrade-official-metaschema","type":"object","required":["$schema"],"properties":{"$schema":{"const":"http://json-schema.org/draft-06/schema#"}}},"transform":{"$merge":[{"$eval":"schema"},{"$$schema":"http://json-schema.org/draft-07/schema#"}]}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft6-to-draft7/empty-object","const":{}},"transform":{"$eval":"true"}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft6-to-draft7/negated-empty-object","const":{"not":true}},"transform":{"$eval":"false"}},{"vocabulary":"validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft6-to-draft7/enum-to-const","type":"object","required":["enum"],"properties":{"enum":{"type":"array","minItems":1,"maxItems":1}}},"transform":{"$merge":[{"$eval":"omit(schema, \'enum\')"},{"const":{"$eval":"schema.enum[0]"}}]}}]}')},9326:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-draft7","rules":[{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft7-to-2019-09/upgrade-official-metaschema","type":"object","required":["$schema"],"properties":{"$schema":{"const":"http://json-schema.org/draft-07/schema#"}}},"transform":{"$merge":[{"$eval":"schema"},{"$$schema":"https://json-schema.org/draft/2019-09/schema"}]}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft7-to-2019-09/id-anchor","type":"object","required":["$id"],"properties":{"$id":{"type":"string","pattern":"^#"}}},"transform":{"$merge":[{"$eval":"omit(schema, \'$id\')"},{"$$anchor":{"$eval":"schema[\'$id\'][1:]"}}]}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft7-to-2019-09/definitions","type":"object","required":["definitions"],"properties":{"definitions":{"type":"object"}}},"transform":{"$merge":[{"$eval":"omit(schema, \'definitions\')"},{"$$defs":{"$eval":"schema.definitions"}}]}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft7-to-2019-09/definitions-in-ref","type":"object","required":["$ref"],"properties":{"$ref":{"type":"string","pattern":"/definitions/"}}},"transform":{"$merge":[{"$eval":"omit(schema, \'$ref\')"},{"$$ref":{"$eval":"replace(schema[\'$ref\'], \'/definitions/\', \'/$defs/\')"}}]}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft7-to-2019-09/empty-object","const":{}},"transform":{"$eval":"true"}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft7-to-2019-09/negated-empty-object","const":{"not":true}},"transform":{"$eval":"false"}},{"vocabulary":"validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft7-to-2019-09/enum-to-const","type":"object","required":["enum"],"properties":{"enum":{"type":"array","minItems":1,"maxItems":1}}},"transform":{"$merge":[{"$eval":"omit(schema, \'enum\')"},{"const":{"$eval":"schema.enum[0]"}}]}},{"vocabulary":"validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft7-to-2019-09/dependencies","type":"object","required":["dependencies"],"properties":{"dependencies":{"type":"object"}}},"transform":{"$merge":[{"$eval":"omit(schema, \'dependencies\')"},{"dependentRequired":{"$map":{"$eval":"schema.dependencies"},"each(v,k)":{"${k}":{"$if":"typeof(v) == \'array\'","then":{"$eval":"v"}}}}},{"dependentSchemas":{"$map":{"$eval":"schema.dependencies"},"each(v,k)":{"${k}":{"$if":"typeof(v) == \'object\' || typeof(v) == \'boolean\'","then":{"$eval":"v"}}}}}]}}]}')},1747:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-draft7","rules":[]}')},2391:e=>{"use strict";e.exports=JSON.parse('{"$defs":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/core","type":"object","walker":"jsonschema-2019-09"},"allOf":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"array","walker":"jsonschema-2019-09"},"anyOf":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"array","walker":"jsonschema-2019-09"},"oneOf":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"array","walker":"jsonschema-2019-09"},"not":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"value","walker":"jsonschema-2019-09"},"if":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"value","walker":"jsonschema-2019-09"},"then":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"value","walker":"jsonschema-2019-09"},"else":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"value","walker":"jsonschema-2019-09"},"dependentSchemas":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"object","walker":"jsonschema-2019-09"},"items":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":["array","value"],"walker":"jsonschema-2019-09"},"additionalItems":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"value","walker":"jsonschema-2019-09"},"unevaluatedItems":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"value","walker":"jsonschema-2019-09"},"contains":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"value","walker":"jsonschema-2019-09"},"properties":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"object","walker":"jsonschema-2019-09"},"patternProperties":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"object","walker":"jsonschema-2019-09"},"additionalProperties":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"value","walker":"jsonschema-2019-09"},"unevaluatedProperties":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"value","walker":"jsonschema-2019-09"},"propertyNames":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"value","walker":"jsonschema-2019-09"},"contentSchema":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/content","type":"value","walker":"jsonschema-2019-09"}}')},3212:e=>{"use strict";e.exports=JSON.parse('{"$defs":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/core","type":"object","walker":"jsonschema-2020-12"},"allOf":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"array","walker":"jsonschema-2020-12"},"anyOf":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"array","walker":"jsonschema-2020-12"},"oneOf":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"array","walker":"jsonschema-2020-12"},"not":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"value","walker":"jsonschema-2020-12"},"if":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"value","walker":"jsonschema-2020-12"},"then":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"value","walker":"jsonschema-2020-12"},"else":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"value","walker":"jsonschema-2020-12"},"dependentSchemas":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"object","walker":"jsonschema-2020-12"},"prefixItems":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"array","walker":"jsonschema-2020-12"},"items":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"value","walker":"jsonschema-2020-12"},"contains":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"value","walker":"jsonschema-2020-12"},"properties":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"object","walker":"jsonschema-2020-12"},"patternProperties":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"object","walker":"jsonschema-2020-12"},"additionalProperties":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"value","walker":"jsonschema-2020-12"},"propertyNames":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"value","walker":"jsonschema-2020-12"},"unevaluatedItems":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/unevaluated","type":"value","walker":"jsonschema-2020-12"},"unevaluatedProperties":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/unevaluated","type":"value","walker":"jsonschema-2020-12"},"contentSchema":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/content","type":"value","walker":"jsonschema-2020-12"}}')},4413:e=>{"use strict";e.exports=JSON.parse('{"properties":{"vocabulary":"http://json-schema.org/draft-03/schema#","type":"object","walker":"jsonschema-draft3"},"patternProperties":{"vocabulary":"http://json-schema.org/draft-03/schema#","type":"object","walker":"jsonschema-draft3"},"additionalProperties":{"vocabulary":"http://json-schema.org/draft-03/schema#","type":"value","walker":"jsonschema-draft3"},"items":{"vocabulary":"http://json-schema.org/draft-03/schema#","type":["array","value"],"walker":"jsonschema-draft3"},"additionalItems":{"vocabulary":"http://json-schema.org/draft-03/schema#","type":"value","walker":"jsonschema-draft3"},"dependencies":{"vocabulary":"http://json-schema.org/draft-03/schema#","type":"object","walker":"jsonschema-draft3"},"extends":{"vocabulary":"http://json-schema.org/draft-03/schema#","type":["array","value"],"walker":"jsonschema-draft3"}}')},2427:e=>{"use strict";e.exports=JSON.parse('{"items":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":["array","value"],"walker":"jsonschema-draft4"},"additionalItems":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":"value","walker":"jsonschema-draft4"},"properties":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":"object","walker":"jsonschema-draft4"},"patternProperties":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":"object","walker":"jsonschema-draft4"},"additionalProperties":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":"value","walker":"jsonschema-draft4"},"dependencies":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":"object","walker":"jsonschema-draft4"},"allOf":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":"array","walker":"jsonschema-draft4"},"anyOf":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":"array","walker":"jsonschema-draft4"},"oneOf":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":"array","walker":"jsonschema-draft4"},"not":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":"value","walker":"jsonschema-draft4"},"definitions":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":"object","walker":"jsonschema-draft4"}}')},9628:e=>{"use strict";e.exports=JSON.parse('{"items":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":["array","value"],"walker":"jsonschema-draft6"},"additionalItems":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"value","walker":"jsonschema-draft6"},"contains":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"value","walker":"jsonschema-draft6"},"properties":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"object","walker":"jsonschema-draft6"},"patternProperties":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"object","walker":"jsonschema-draft6"},"additionalProperties":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"value","walker":"jsonschema-draft6"},"dependencies":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"object","walker":"jsonschema-draft6"},"propertyNames":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"value","walker":"jsonschema-draft6"},"allOf":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"array","walker":"jsonschema-draft6"},"anyOf":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"array","walker":"jsonschema-draft6"},"oneOf":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"array","walker":"jsonschema-draft6"},"not":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"value","walker":"jsonschema-draft6"},"definitions":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"object","walker":"jsonschema-draft6"}}')},228:e=>{"use strict";e.exports=JSON.parse('{"items":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":["array","value"],"walker":"jsonschema-draft7"},"additionalItems":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"value","walker":"jsonschema-draft7"},"contains":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"value","walker":"jsonschema-draft7"},"properties":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"object","walker":"jsonschema-draft7"},"patternProperties":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"object","walker":"jsonschema-draft7"},"additionalProperties":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"value","walker":"jsonschema-draft7"},"dependencies":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"object","walker":"jsonschema-draft7"},"propertyNames":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"value","walker":"jsonschema-draft7"},"if":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"value","walker":"jsonschema-draft7"},"then":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"value","walker":"jsonschema-draft7"},"else":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"value","walker":"jsonschema-draft7"},"allOf":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"array","walker":"jsonschema-draft7"},"anyOf":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"array","walker":"jsonschema-draft7"},"oneOf":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"array","walker":"jsonschema-draft7"},"not":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"value","walker":"jsonschema-draft7"},"definitions":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"object","walker":"jsonschema-draft7"}}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{const e=n(9091),t=n(1184),r=n(2426),i=n(9960),o=n(8770),s=n(4147),a=n(4226),l={draft3:"Draft 3",draft4:"Draft 4",draft6:"Draft 6",draft7:"Draft 7"};function c(e){try{return JSON.parse(e)}catch(e){return null}}function h(e,t,n,r=!1){const i=document.createElement("option");i.innerText=t,i.setAttribute("value",n),r&&i.setAttribute("selected",""),e.appendChild(i)}function u(e){return-1===e.selectedIndex?null:e.options[e.selectedIndex].value}function f(e,t,n){const r=n||u(e);e.innerHTML="";for(const n of t)h(e,l[n]||n,n,r===n)}const d=document.getElementById("from"),p=document.getElementById("to"),m=document.getElementById("input"),g=document.getElementById("output"),v=document.getElementById("upgrade");function y(e){g.value=`ERROR: ${e.message}`}function b(e){f(d,Object.keys(i.jsonschema),e),d.dispatchEvent(new Event("change"))}const w={id:"http://example.com/schema",$schema:"http://json-schema.org/draft-04/schema#",dependencies:{foo:["bar"]},properties:{foo:{enum:["single-value"]},bar:{type:"number",minimum:5,exclusiveMinimum:!0}}},x=new e.EditorView({doc:JSON.stringify(w,null,2),extensions:[e.basicSetup,t.json(),r.linter(t.jsonParseLinter()),e.EditorView.updateListener.of((e=>{const t=e.transactions.reduce(((e,t)=>{const n=t.annotations.filter((e=>"string"==typeof e.value)).map((e=>e.value));return e.concat(n)}),[]);if(0===t.length)return;if(1===t.length&&("select.pointer"===t[0]||"select"===t[0]))return;const n=c(e.state.doc.toString());if(null===n)return;const r=a[n.$schema];r&&b(r)}))],parent:m});v.addEventListener("click",(()=>{const e=u(d),t=u(p),n=c(x.state.doc.toString());if(null===n)return window.plausible("Invalid"),y(new Error("Invalid input JSON"));window.plausible("Transform",{props:{from:e,to:t}}),o(n,e,t).then((e=>{g.value=JSON.stringify(e,null,2)})).catch(y)})),d.addEventListener("change",(e=>{f(p,Object.keys(i.jsonschema[e.target.value]).reverse())})),document.getElementById("version").innerText=`v${s.version}`,b(a[w.$schema]),x.focus(),v.dispatchEvent(new Event("click"))})()})(); \ No newline at end of file +(()=>{var e={9960:(e,t,n)=>{const r=n(3825),i=n(3066),o=n(9300),s=n(8790),a=n(6989),l=n(2630),c=n(9326),h=n(1747),u=n(7377),f=n(4405),d=n(4619);e.exports={jsonschema:{draft3:{draft4:[r,i,o],draft6:[r,i,o,s,l],draft7:[r,i,o,s,l,a,h],"2019-09":[r,i,o,s,l,a,h,c,f],"2020-12":[r,i,o,s,l,a,h,c,f,u,d]},draft4:{draft6:[o,s,l],draft7:[o,s,l,a,h],"2019-09":[o,s,l,a,h,c,f],"2020-12":[o,s,l,a,h,c,f,u,d]},draft6:{draft7:[l,a,h],"2019-09":[l,a,h,c,f],"2020-12":[l,a,h,c,f,u,d]},draft7:{"2019-09":[h,c,f],"2020-12":[h,c,f,u,d]},"2019-09":{"2020-12":[f,u,d]}}}},8770:(e,t,n)=>{const r=n(6486),i=n(1471),o=n(705),s=n(1178),a=n(3552),l=n(9960);async function c(e,t,n,a,l,h){const u=0===t.length?e:r.get(e,t);for(const f of n)if(await s.matches(f.condition,u)&&s.usesVocabulary(e,u,f.vocabulary)){const d=i(f.transform,{schema:u,original:l,jsonHash:e=>o.sha1(e),hasContext:(t,n)=>{for(const i of a){const o=i.path.concat(t);if(void 0===n&&r.has(e,o))return!0;if(r.isEqual(r.get(e,o),n))return!0;if(r.has(e,i.path.concat(s.getIdProperty(h))))return!1}return!1},omit:(e,t)=>r.omit(e,r.castArray(t)),replace:(e,t,n)=>e.replace(new RegExp(t,"g"),n)});if(await s.matches(f.condition,d))throw new Error("Rule condition must not match after transform");return c(0===t.length?d:r.set(e,t,d),t,n,a,l,h)}return u}e.exports=async(e,t,n)=>{let i=r.cloneDeep(e);if(!l.jsonschema[t])throw new Error(`Invalid "from": ${t}`);if(!l.jsonschema[t][n])throw new Error(`Invalid "to": ${n}`);for(const o of l.jsonschema[t][n]){const n=a(o.walker,i,[]).sort(((e,t)=>t.path.length-e.path.length));for(const s of n){if(s.path.length>0&&!r.has(i,s.path))continue;const a=await c(i,s.path,o.rules,n,e,t);0===s.path.length?i=a:r.set(i,s.path,a)}}return i}},1178:(e,t,n)=>{const r=n(5105),i=n(4226);r.setMetaOutputFormat(r.FLAG),t.implementation=r,t.usesVocabulary=(e,t,n)=>"object"==typeof t&&!Array.isArray(t)&&null!==t,t.getIdProperty=e=>["draft3","draft4"].includes(e)?"id":"$id",t.matches=async(e,n)=>{const o=t.getIdProperty(i[e.$schema]);return r.add(e),(await r.validate(r.get(e[o]),n)).valid}},3552:(e,t,n)=>{const r=n(6486),i=n(1178);e.exports=(t,o,s)=>{const a=0===s.length?o:r.get(o,s);return r.reduce(n(6218)(`./${t}.json`),((t,n,l)=>{if(void 0===a[l]||!i.usesVocabulary(o,a,n.vocabulary))return t;for(const i of r.castArray(n.type))if("array"===i&&Array.isArray(a[l]))for(const[r,i]of a[l].entries())t.push(...e.exports(n.walker,o,s.concat([l,r])));else if("object"===i&&r.isPlainObject(a[l]))for(const r of Object.keys(a[l]))t.push(...e.exports(n.walker,o,s.concat([l,r])));else"value"!==i||Array.isArray(a[l])||"string"==typeof a[l]||t.push(...e.exports(n.walker,o,s.concat([l])));return t}),[{type:t,path:s}])}},5242:(e,t,n)=>{const r=n(3565),i=e=>{if(e.length>0&&"/"!==e[0])throw Error("Invalid JSON Pointer");return e.split("/").slice(1).map(u)},o=(e,t,n,r)=>{if(0===e.length)return n;if(e.length>1){const i=e.shift();return{...t,[i]:o(e,d(t,i,r),n,c(i,r))}}if(Array.isArray(t)){const r=[...t];return r[f(t,e[0])]=n,r}return"object"==typeof t&&null!==t?{...t,[e[0]]:n}:d(t,e[0],r)},s=(e,t,n,r)=>{if(0!==e.length)if(1!==e.length||p(t)){const i=e.shift();s(e,d(t,i,r),n,c(i,r))}else t[f(t,e[0])]=n},a=(e,t,n)=>{if(0!=e.length){if(e.length>1){const r=e.shift(),i=d(t,r,n);return{...t,[r]:a(e,i,c(r,n))}}if(Array.isArray(t))return t.filter(((t,n)=>n!=e[0]));if("object"==typeof t&&null!==t){const{[e[0]]:n,...r}=t;return r}return d(t,e[0],n)}},l=(e,t,n)=>{if(0!==e.length)if(e.length>1){const r=e.shift(),i=d(t,r,n);l(e,i,c(r,n))}else Array.isArray(t)?t.splice(e[0],1):"object"==typeof t&&null!==t?delete t[e[0]]:d(t,e[0],n)},c=r(((e,t)=>t+"/"+h(e))),h=e=>e.toString().replace(/~/g,"~0").replace(/\//g,"~1"),u=e=>e.toString().replace(/~1/g,"/").replace(/~0/g,"~"),f=(e,t)=>Array.isArray(e)&&"-"===t?e.length:t,d=(e,t,n="")=>{if(void 0===e)throw TypeError(`Value at '${n}' is undefined and does not have property '${t}'`);if(null===e)throw TypeError(`Value at '${n}' is null and does not have property '${t}'`);if(p(e))throw TypeError(`Value at '${n}' is a ${typeof e} and does not have property '${t}'`);return e[f(e,t)]},p=e=>null===e||"object"!=typeof e;e.exports={nil:"",append:c,get:(e,t=undefined)=>{const n=i(e),r=e=>n.reduce((([e,t],n)=>[d(e,n,t),c(n,t)]),[e,""])[0];return void 0===t?r:r(t)},set:(e,t=undefined,n=undefined)=>{const s=i(e),a=r(((e,t)=>o(s,e,t,"")));return void 0===t?a:a(t,n)},assign:(e,t=undefined,n=undefined)=>{const o=i(e),a=r(((e,t)=>s(o,e,t,"")));return void 0===t?a:a(t,n)},unset:(e,t=undefined)=>{const n=i(e),r=e=>a(n,e,"");return void 0===t?r:r(t)},remove:(e,t=undefined)=>{const n=i(e),r=e=>l(n,e,"");return void 0===t?r:r(t)}}},9078:(e,t,n)=>{const r=n(540),i={null:e=>null===e,boolean:e=>"boolean"==typeof e,object:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,array:e=>Array.isArray(e),number:e=>"number"==typeof e,integer:e=>Number.isInteger(e),string:e=>"string"==typeof e};e.exports={jsonTypeOf:(e,t)=>i[t](e),resolveUrl:(e,t)=>{const n=r.resolve(e,t,{iri:!0});if(r.resolve(e,"",{iri:!0})&&"file"===r.parse(n).scheme&&"file"!==r.parse(e).scheme)throw Error(`Can't access file '${n}' resource from network context '${e}'`);return n},urlFragment:e=>r.unescapeComponent(r.parse(e).fragment)||"",pathRelative:(e,t)=>{if(e===t)return"";let n=1;const r=e.length-1,i=t.length-n,o=ro){if(47===t.charCodeAt(n+a))return t.slice(n+a+1);if(0===a)return t.slice(n+a)}r>o&&(47===e.charCodeAt(a+1)?s=a:0===o&&(s=0));let l="";for(a=s+2;a<=e.length;++a)a!==e.length&&47!==e.charCodeAt(a)||(l+=0===l.length?"..":"/..");return n+=s,l.length>0?`${l}${t.slice(n,t.length)}`:(47===t.charCodeAt(n)&&++n,t.slice(n,t.length))}}},1434:(e,t,n)=>{const r=n(3565),i=n(1798),{resolveUrl:o}=n(9078),s=n(5043),a=n(6544),l=n(2916),c=n(9952),h=n(4536),u="FLAG",f="BASIC",d="DETAILED",p="VERBOSE";let m=d,g=!0;c.addPlugin("application/schema+json",{parse:async(e,t)=>[await e.json(),t.schema||t.profile],matcher:e=>e.endsWith(".schema.json")});const v=async e=>{const t={metaData:{}};return{ast:t,schemaUri:await C(e,t)}},y=r((({ast:e,schemaUri:t},n,r=u)=>{if(![u,f,d,p].includes(r))throw Error(`The '${r}' error format is not supported`);const o=[],s=i.subscribe("result",b(r,o));return E(t,n,e,{}),i.unsubscribe(s),o[0]})),b=(e,t)=>{const n=[];return(r,i)=>{if("result"===r){const{keyword:e,absoluteKeywordLocation:t,instanceLocation:r,valid:o}=i,s={keyword:e,absoluteKeywordLocation:t,instanceLocation:r,valid:o,errors:[]};n.push(s)}else if("result.start"===r)n.push(r);else if("result.end"===r){const r=n.pop();for(;"result.start"!==n[n.length-1];){const t=n.pop(),i=[t];e===f&&(i.push(...t.errors),delete t.errors),(e===p||e!==u&&!t.valid)&&r.errors.unshift(...i)}n[n.length-1]=r,t[0]=r}}},w={},x=e=>w[e]||h,k=e=>e in w,S={},A={},C=async(e,t)=>{if(e=await O(e),!k(`${e.dialectId}#validate`)){const t=await a.get(e.dialectId);(a.getConfig(t.id,"mandatoryVocabularies")||[]).forEach((e=>{if(!t.vocabulary[e])throw Error(`Vocabulary '${e}' must be explicitly declared and required`)})),Object.entries(t.vocabulary).forEach((([e,n])=>{if(e in S)Object.entries(S[e]).forEach((([e,n])=>{((e,t)=>{w[e]={collectEvaluatedItems:(e,n,r,i,o)=>t.interpret(e,n,r,i,o)&&new Set,collectEvaluatedProperties:(e,n,r,i,o)=>t.interpret(e,n,r,i,o)&&[],...t}})(`${t.id}#${e}`,n)}));else if(n)throw Error(`Missing required vocabulary: ${e}`)}))}if(g&&!e.validated){if(a.markValidated(e.id),!(e.dialectId in A)){const t=await a.get(e.dialectId),n=await v(t);A[t.id]=y(n)}const t=s.cons(e.schema,e.id),n=A[e.dialectId](t,m);if(!n.valid)throw new l(n)}return e.id in t.metaData||(t.metaData[e.id]={id:e.id,dynamicAnchors:e.dynamicAnchors,anchors:e.anchors}),x(`${e.dialectId}#validate`).compile(e,t)},O=async e=>a.typeOf(e,"string")?O(await a.get(a.value(e),e)):e,E=(e,t,n,r)=>{const i=j(e,n),s=o(e,"");return x(i).interpret(e,t,n,{...n.metaData[s].dynamicAnchors,...r})},j=(e,t)=>{if(!(e in t))throw Error(`No schema found at ${e}`);return t[e][0]};e.exports={validate:async(e,t=undefined,n=undefined)=>{const r=await v(e),i=(e,t)=>y(r,s.cons(e),t);return void 0===t?i:i(t,n)},compile:v,interpret:y,setMetaOutputFormat:e=>{m=e},setShouldMetaValidate:e=>{g=e},FLAG:u,BASIC:f,DETAILED:d,VERBOSE:p,add:(e,t="",n="")=>{const r=a.add(e,t,n);delete A[r]},getKeyword:x,hasKeyword:k,defineVocabulary:(e,t)=>{S[e]=t},compileSchema:C,interpretSchema:E,collectEvaluatedProperties:(e,t,n,r,i)=>{const o=j(e,n);return x(o).collectEvaluatedProperties(e,t,n,r,i)},collectEvaluatedItems:(e,t,n,r,i)=>{const o=j(e,n);return x(o).collectEvaluatedItems(e,t,n,r,i)},addMediaTypePlugin:c.addPlugin}},2095:e=>{e.exports=fetch},2735:(e,t,n)=>{const r=n(1434),i=n(6544),o=n(5043),s=n(9897),a=n(3812),l=n(2916);e.exports={Core:r,Schema:i,Instance:o,Reference:s,Keywords:a,InvalidSchemaError:l}},5043:(e,t,n)=>{const r=n(5242),i=n(3565),{resolveUrl:o,jsonTypeOf:s}=n(9078),a=n(9897),l=Object.freeze({id:"",pointer:"",instance:void 0,value:void 0}),c=e=>a.isReference(e.value)?a.value(e.value):e.value,h=i(((e,t)=>s(c(e),t))),u=(e,t)=>Object.freeze({...t,pointer:r.append(e,t.pointer),value:c(t)[e]}),f=i(((e,t)=>c(t).map(((n,r,i,o)=>e(u(r,t),r,i,o))))),d=i(((e,t)=>c(t).forEach(((n,r,i,o)=>e(u(r,t),r,i,o))))),p=i(((e,t)=>c(t).map(((e,n,r,i)=>u(n,t))).filter(((t,n,r,i)=>e(t,n,r,i))))),m=i(((e,t,n)=>c(n).reduce(((t,r,i)=>e(t,u(i,n),i)),t))),g=i(((e,t)=>c(t).every(((n,r,i,o)=>e(u(r,t),r,i,o))))),v=i(((e,t)=>c(t).some(((n,r,i,o)=>e(u(r,t),r,i,o)))));e.exports={nil:l,cons:(e,t="")=>Object.freeze({...l,id:o(t,""),instance:e,value:e}),get:(e,t=l)=>{if(!e.startsWith("#"))throw Error(`No JSON document found at '${e.split("#")[0]}'`);return Object.freeze({...t,pointer:e.substr(1)})},uri:e=>`${e.id}#${encodeURI(e.pointer)}`,value:c,has:(e,t)=>e in c(t),typeOf:h,length:e=>c(e).length,step:u,entries:e=>Object.keys(c(e)).map((t=>[t,u(t,e)])),keys:e=>Object.keys(c(e)),map:f,forEach:d,filter:p,reduce:m,every:g,some:v}},2916:e=>{class t extends Error{constructor(e){super("Invalid Schema"),this.name=this.constructor.name,this.output=e}}e.exports=t},3812:(e,t,n)=>{const r=n(4536),i=n(3867);e.exports={metaData:r,validate:i}},4536:(e,t,n)=>{const r=n(6544);e.exports={compile:e=>r.value(e),interpret:()=>!0}},3867:(e,t,n)=>{const r=n(7833),i=n(1798),o=n(1434),s=n(5043),a=n(6544);e.exports={compile:async(e,t)=>{const n=a.uri(e);if(!(n in t)){t[n]=!1;const i=a.value(e);if(!["object","boolean"].includes(typeof i))throw Error(`No schema found at '${a.uri(e)}'`);t[n]=[`${e.dialectId}#validate`,a.uri(e),"boolean"==typeof i?i:await r.pipeline([a.entries,r.map((([t,n])=>[`${e.dialectId}#${t}`,n])),r.filter((([t])=>t!==`${e.dialectId}#validate`)),r.map((async([n,r])=>{const i=await o.getKeyword(n).compile(r,t,e);return[n,a.uri(r),i]})),r.all],e)]}return n},interpret:(e,t,n,r)=>{const[a,l,c]=n[e];i.publishSync("result.start");const h="boolean"==typeof c?c:c.every((([e,a,l])=>{i.publishSync("result.start");const c=o.getKeyword(e).interpret(l,t,n,r);return i.publishSync("result",{keyword:e,absoluteKeywordLocation:a,instanceLocation:s.uri(t),valid:c,ast:l}),i.publishSync("result.end"),c}));return i.publishSync("result",{keyword:a,absoluteKeywordLocation:l,instanceLocation:s.uri(t),valid:h,ast:e}),i.publishSync("result.end"),h},collectEvaluatedProperties:(e,t,n,r,i=!1)=>{const s=n[e][2];return"boolean"==typeof s?!!s&&[]:s.filter((([e])=>!i||!e.endsWith("#unevaluatedProperties"))).reduce(((e,[i,,s])=>{const a=e&&o.getKeyword(i).collectEvaluatedProperties(s,t,n,r);return!1!==a&&[...e,...a]}),[])},collectEvaluatedItems:(e,t,n,r,i=!1)=>{const s=n[e][2];return"boolean"==typeof s?!!s&&new Set:s.filter((([e])=>!i||!e.endsWith("#unevaluatedItems"))).reduce(((e,[i,,s])=>{const a=!1!==e&&o.getKeyword(i).collectEvaluatedItems(s,t,n,r);return!1!==a&&new Set([...e,...a])}),new Set)}}},9952:(e,t,n)=>{const r=n(7811),i={};e.exports={addPlugin:(e,t)=>{i[e]=t},parse:e=>{const t=r.parse(e.headers.get("content-type"));if(!(t.type in i))throw Error(`${e.url} is not a schema. Found a document with media type: ${t.type}`);return i[t.type].parse(e,t.parameters)},getContentType:e=>{for(const t in i)if(i[t].matcher(e))return t;return"application/octet-stream"}}},9897:e=>{const t=Symbol("$__value"),n=Symbol("$__href");e.exports={cons:(e,r)=>Object.freeze({[n]:e,[t]:r}),isReference:e=>e&&void 0!==e[n],href:e=>e[n],value:e=>e[t]}},6544:(e,t,n)=>{const r=n(3565),i=n(7833),o=n(5242),{jsonTypeOf:s,resolveUrl:a,urlFragment:l,pathRelative:c}=n(9078),h=n(2095),u=n(9897),f=n(9952),d="https://json-schema.org/draft/2019-09/vocab/core",p="https://json-schema.org/draft/2020-12/vocab/core",m={},g={},v=(e,t)=>{const n=g[e];return m[n]?.[t]},y={},b={},w=(e,t="",n="")=>{e=JSON.parse(JSON.stringify(e));const r=a(t,""),i=a(e.$schema||n,"");if(!i)throw Error("Couldn't determine schema dialect");if(delete e.$schema,!(i in g))if(!0===e?.$vocabulary?.[d]&&i===x(e,r,d)[0])g[i]=d;else if(!0===e?.$vocabulary?.[p]&&i===x(e,r,p)[0])g[i]=p;else{const e=y[i];if(!e)throw Error(`Couldn't determine JSON Schema version for dialect: '${i}'`);!0===e.vocabulary[d]?g[i]=d:!0===e.vocabulary[p]?g[i]=p:g[i]=g[e.dialectId]}const[l,c]=x(e,r,g[i]);if(!l)throw Error("Couldn't determine an identifier for the schema");const h=v(i,"baseToken");delete e[h],r&&(b[r]=l);const u=v(i,"anchorToken");c&&h===u&&(e[u]=u!==h?encodeURI(c):`#${encodeURI(c)}`);const f={},m=v(i,"recursiveAnchorToken");let w;!0===e[m]&&(f[""]=`${l}#`,e[u]="",delete e[m]);const S=v(i,"vocabularyToken");s(e[S],"object")?(w=e[S],delete e[S]):w={[g[i]]:!0};const A={"":""};return y[l]={id:l,dialectId:i,schema:k(e,l,i,o.nil,A,f),anchors:A,dynamicAnchors:f,vocabulary:w,validated:!1},l},x=(e,t,n)=>{const r=m[n]?.baseToken,i=a(t,e[r]||"");return[a(i,""),l(i)]},k=(e,t,n,r,i,l)=>{if(s(e,"object")){const s="string"==typeof e.$schema?a(e.$schema,""):n,c=v(s,"embeddedToken"),h=v(s,"anchorToken");if("string"==typeof e[c]&&(c!==h||"#"!==e[c][0])){const r=a(t,e[c]);return e[v(s,"baseToken")]=r,w(e,r,n),u.cons(e[c],e)}const f=v(n,"anchorToken"),d=v(n,"dynamicAnchorToken");"string"==typeof e[d]&&(l[e[d]]=`${t}#${encodeURI(r)}`,i[e[d]]=r,delete e[d]);const p=v(n,"embeddedToken");if("string"==typeof e[f]){const t=f!==p?e[f]:e[f].slice(1);i[t]=r,delete e[f]}const m=v(n,"jrefToken");if("string"==typeof e[m])return u.cons(e[m],e);for(const s in e)e[s]=k(e[s],t,n,o.append(s,r),i,l);return e}return Array.isArray(e)?e.map(((e,s)=>k(e,t,n,o.append(s,r),i,l))):e},S=e=>y[b[e]]||y[e],A=Object.freeze({id:"",dialectId:void 0,vocabulary:{},pointer:o.nil,schema:void 0,value:void 0,anchors:{},dynamicAnchors:{},validated:!0}),C=async(e,t=A)=>{const n=a(j(t),e),r=a(n,""),i=l(n);if(!(e=>e in y||e in b)(r)){const e=await h(r,{headers:{Accept:"application/schema+json"}});if(e.status>=400)throw await e.text(),Error(`Failed to retrieve schema with id: ${r}`);const[t,n]=await f.parse(e);let i;i=t.$schema?a(t.$schema,""):n?a(r,n):"",i&&r!==i&&!(i in g)&&await C(i),w(t,r,i)}const s=S(r),c="/"!==i[0]?E(s,i):i,u=Object.freeze({...s,pointer:c,value:o.get(c,s.schema)});return O(u)},O=e=>u.isReference(e.value)?C(u.href(e.value),e):e,E=(e,t)=>{if(!(t in e.anchors))throw Error(`No such anchor '${encodeURI(e.id)}#${encodeURI(t)}'`);return e.anchors[t]},j=e=>`${e.id}#${encodeURI(e.pointer)}`,M=e=>u.isReference(e.value)?u.value(e.value):e.value,I=(e,t)=>{const n=S(t.id),r=Object.freeze({...t,pointer:o.append(e,t.pointer),value:M(t)[e],validated:n.validated});return O(r)},T=r(((e,t)=>i.pipeline([M,i.map((async(n,r)=>e(await I(r,t),r))),i.all],t))),$={parentId:"",parentDialect:"",includeEmbedded:!0};e.exports={setConfig:(e,t,n)=>{g[e]=e,m[e]||(m[e]={}),m[e][t]=n},getConfig:v,add:w,get:C,markValidated:e=>{y[e].validated=!0},uri:j,value:M,getAnchorPointer:E,typeOf:(e,t)=>s(M(e),t),has:(e,t)=>e in M(t),step:I,keys:e=>Object.keys(M(e)),entries:e=>i.pipeline([M,Object.keys,i.map((async t=>[t,await I(t,e)])),i.all],e),map:T,length:e=>M(e).length,toSchema:(e,t={})=>{const n={...$,...t},r=JSON.parse(JSON.stringify(e.schema,((t,r)=>{if(!u.isReference(r))return r;const i=u.value(r),o="string"==typeof i.$schema?a(i.$schema,""):e.dialectId,s=v(o,"embeddedToken");return!n.includeEmbedded&&s in i?void 0:u.value(r)}))),i=v(e.dialectId,"dynamicAnchorToken");Object.entries(e.dynamicAnchors).forEach((([e,t])=>{const n=o.append(i,l(t));o.assign(n,r,e)}));const s=v(e.dialectId,"anchorToken");Object.entries(e.anchors).filter((([t])=>""!==t&&!(t in e.dynamicAnchors))).forEach((([e,t])=>{const n=o.append(s,t);o.assign(n,r,e)}));const h=v(e.dialectId,"baseToken"),f=((e,t)=>{if(t.startsWith("file://")){const n=e.slice(7,e.lastIndexOf("/"));return""===e?"":c(n,t.slice(7))}return t})(n.parentId,e.id),d=n.parentDialect===e.dialectId?"":e.dialectId;return{...f&&{[h]:f},...d&&{$schema:d},...r}}}},328:e=>{e.exports={isObject:e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,escapeRegExp:e=>e.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&"),splitUrl:e=>{const t=e.indexOf("#"),n=-1===t?e.length:t,r=e.slice(0,n),i=e.slice(n+1);return[decodeURI(r),decodeURI(i)]}}},8907:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=n(2077),s=n(89),a="http://json-schema.org/draft-04/schema";i.setConfig(a,"baseToken","id"),i.setConfig(a,"embeddedToken","id"),i.setConfig(a,"anchorToken","id"),i.setConfig(a,"jrefToken","$ref"),i.add(JSON.parse(s)),r.defineVocabulary(a,{validate:o.validate,additionalItems:o.additionalItems,additionalProperties:o.additionalProperties,allOf:o.allOf,anyOf:o.anyOf,default:o.metaData,definitions:o.definitions,dependencies:o.dependencies,description:o.metaData,enum:o.enum,format:o.metaData,items:o.items,maxItems:o.maxItems,maxLength:o.maxLength,maxProperties:o.maxProperties,maximum:o.maximumExclusiveMaximum,minItems:o.minItems,minLength:o.minLength,minProperties:o.minProperties,minimum:o.minimumExclusiveMinimum,multipleOf:o.multipleOf,not:o.not,oneOf:o.oneOf,pattern:o.pattern,patternProperties:o.patternProperties,properties:o.properties,required:o.required,title:o.metaData,type:o.type,uniqueItems:o.uniqueItems})},8822:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=n(2077),s=n(9403),a="http://json-schema.org/draft-06/schema";i.setConfig(a,"baseToken","$id"),i.setConfig(a,"embeddedToken","$id"),i.setConfig(a,"anchorToken","$id"),i.setConfig(a,"jrefToken","$ref"),i.add(JSON.parse(s)),r.defineVocabulary(a,{validate:o.validate,additionalItems:o.additionalItems6,additionalProperties:o.additionalProperties6,allOf:o.allOf,anyOf:o.anyOf,const:o.const,contains:o.contains,default:o.metaData,definitions:o.definitions,dependencies:o.dependencies,description:o.metaData,enum:o.enum,examples:o.metaData,exclusiveMaximum:o.exclusiveMaximum,exclusiveMinimum:o.exclusiveMinimum,format:o.metaData,items:o.items,maxItems:o.maxItems,maxLength:o.maxLength,maxProperties:o.maxProperties,maximum:o.maximum,minItems:o.minItems,minLength:o.minLength,minProperties:o.minProperties,minimum:o.minimum,multipleOf:o.multipleOf,not:o.not,oneOf:o.oneOf,pattern:o.pattern,patternProperties:o.patternProperties,properties:o.properties,propertyNames:o.propertyNames,required:o.required,title:o.metaData,type:o.type,uniqueItems:o.uniqueItems})},5077:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=n(2077),s=n(2613),a="http://json-schema.org/draft-07/schema";i.setConfig(a,"baseToken","$id"),i.setConfig(a,"embeddedToken","$id"),i.setConfig(a,"anchorToken","$id"),i.setConfig(a,"jrefToken","$ref"),i.add(JSON.parse(s)),r.defineVocabulary(a,{validate:o.validate,additionalItems:o.additionalItems6,additionalProperties:o.additionalProperties6,allOf:o.allOf,anyOf:o.anyOf,const:o.const,contains:o.contains,default:o.metaData,definitions:o.definitions,dependencies:o.dependencies,description:o.metaData,enum:o.enum,exclusiveMaximum:o.exclusiveMaximum,exclusiveMinimum:o.exclusiveMinimum,format:o.metaData,if:o.if,then:o.then,else:o.else,items:o.items,maxItems:o.maxItems,maxLength:o.maxLength,maxProperties:o.maxProperties,maximum:o.maximum,minItems:o.minItems,minLength:o.minLength,minProperties:o.minProperties,minimum:o.minimum,multipleOf:o.multipleOf,not:o.not,oneOf:o.oneOf,pattern:o.pattern,patternProperties:o.patternProperties,properties:o.properties,propertyNames:o.propertyNames,readOnly:o.metaData,required:o.required,title:o.metaData,type:o.type,uniqueItems:o.uniqueItems,writeOnly:o.metaData})},7406:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=n(2077),s=n(6998),a=n(2037),l=n(3334),c=n(9447),h=n(3198),u=n(830),f=n(480),d="https://json-schema.org/draft/2019-09/vocab/core";i.setConfig(d,"baseToken","$id"),i.setConfig(d,"embeddedToken","$id"),i.setConfig(d,"anchorToken","$anchor"),i.setConfig(d,"recursiveAnchorToken","$recursiveAnchor"),i.setConfig(d,"vocabularyToken","$vocabulary"),i.setConfig(d,"mandatoryVocabularies",["https://json-schema.org/draft/2019-09/vocab/core"]),i.add(JSON.parse(s)),i.add(JSON.parse(a)),r.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/core",{validate:o.validate,$defs:o.definitions,$recursiveRef:o.dynamicRef,$ref:o.ref}),i.add(JSON.parse(l)),r.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/applicator",{additionalItems:o.additionalItems6,additionalProperties:o.additionalProperties6,allOf:o.allOf,anyOf:o.anyOf,contains:o.containsMinContainsMaxContains,dependentSchemas:o.dependentSchemas,if:o.if,then:o.then,else:o.else,items:o.items,not:o.not,oneOf:o.oneOf,patternProperties:o.patternProperties,properties:o.properties,propertyNames:o.propertyNames,unevaluatedItems:o.unevaluatedItems,unevaluatedProperties:o.unevaluatedProperties}),i.add(JSON.parse(c)),r.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/validation",{const:o.const,dependentRequired:o.dependentRequired,enum:o.enum,exclusiveMaximum:o.exclusiveMaximum,exclusiveMinimum:o.exclusiveMinimum,maxItems:o.maxItems,maxLength:o.maxLength,maxProperties:o.maxProperties,maximum:o.maximum,minItems:o.minItems,minLength:o.minLength,minProperties:o.minProperties,minimum:o.minimum,multipleOf:o.multipleOf,pattern:o.pattern,required:o.required,type:o.type,uniqueItems:o.uniqueItems}),i.add(JSON.parse(h)),r.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/meta-data",{default:o.metaData,deprecated:o.metaData,description:o.metaData,examples:o.metaData,readOnly:o.metaData,title:o.metaData,writeOnly:o.metaData}),i.add(JSON.parse(u)),i.add(JSON.parse(f)),r.defineVocabulary("https://json-schema.org/draft/2019-09/vocab/content",{contentEncoding:o.metaData,contentMediaType:o.metaData,contentSchema:o.metaData})},6291:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=n(2077),s=n(3024),a=n(9824),l=n(9461),c=n(3512),h=n(4929),u=n(8905),f=n(6646),d=n(7525),p=n(8e3),m="https://json-schema.org/draft/2020-12/vocab/core";i.setConfig(m,"baseToken","$id"),i.setConfig(m,"embeddedToken","$id"),i.setConfig(m,"anchorToken","$anchor"),i.setConfig(m,"dynamicAnchorToken","$dynamicAnchor"),i.setConfig(m,"vocabularyToken","$vocabulary"),i.setConfig(m,"mandatoryVocabularies",["https://json-schema.org/draft/2020-12/vocab/core"]),i.add(JSON.parse(s)),i.add(JSON.parse(a)),r.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/core",{validate:o.validate,$defs:o.definitions,$dynamicRef:o.dynamicRef,$ref:o.ref}),i.add(JSON.parse(l)),r.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/applicator",{additionalProperties:o.additionalProperties6,allOf:o.allOf,anyOf:o.anyOf,contains:o.containsMinContainsMaxContains,dependentSchemas:o.dependentSchemas,if:o.if,then:o.then,else:o.else,items:o.items202012,not:o.not,oneOf:o.oneOf,patternProperties:o.patternProperties,prefixItems:o.tupleItems,properties:o.properties,propertyNames:o.propertyNames}),i.add(JSON.parse(c)),r.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/validation",{const:o.const,dependentRequired:o.dependentRequired,enum:o.enum,exclusiveMaximum:o.exclusiveMaximum,exclusiveMinimum:o.exclusiveMinimum,maxItems:o.maxItems,maxLength:o.maxLength,maxProperties:o.maxProperties,maximum:o.maximum,minItems:o.minItems,minLength:o.minLength,minProperties:o.minProperties,minimum:o.minimum,multipleOf:o.multipleOf,pattern:o.pattern,required:o.required,type:o.type,uniqueItems:o.uniqueItems}),i.add(JSON.parse(h)),r.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/meta-data",{default:o.metaData,deprecated:o.metaData,description:o.metaData,examples:o.metaData,readOnly:o.metaData,title:o.metaData,writeOnly:o.metaData}),i.add(JSON.parse(u)),r.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/format-annotation",{format:o.metaData}),i.add(JSON.parse(f)),i.add(JSON.parse(d)),r.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/content",{contentEncoding:o.metaData,contentMediaType:o.metaData,contentSchema:o.metaData}),i.add(JSON.parse(p)),r.defineVocabulary("https://json-schema.org/draft/2020-12/vocab/unevaluated",{unevaluatedItems:o.unevaluatedItems,unevaluatedProperties:o.unevaluatedProperties})},5105:(e,t,n)=>{const{Core:r,Schema:i,InvalidSchemaError:o}=n(2735),s=n(2077);n(8907),n(8822),n(5077),n(7406),n(6291),e.exports={add:r.add,get:i.get,validate:r.validate,compile:r.compile,interpret:r.interpret,setMetaOutputFormat:r.setMetaOutputFormat,setShouldMetaValidate:r.setShouldMetaValidate,addMediaTypePlugin:r.addMediaTypePlugin,FLAG:r.FLAG,BASIC:r.BASIC,DETAILED:r.DETAILED,VERBOSE:r.VERBOSE,Keywords:s,InvalidSchemaError:o}},6414:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735);e.exports={compile:async(e,t,n)=>{const o=await i.step("items",n),s=i.typeOf(o,"array")?i.length(o):Number.MAX_SAFE_INTEGER;return i.typeOf(e,"boolean")?[s,i.value(e)]:[s,await r.compileSchema(e,t)]},interpret:([e,t],n,i,s)=>!o.typeOf(n,"array")||("string"==typeof t?o.every(((n,o)=>or{const{Core:r,Schema:i,Instance:o}=n(2735),s=([e,t],n,i,s)=>!o.typeOf(n,"array")||o.every(((n,o)=>o{const o=await i.step("items",n);return[i.typeOf(o,"array")?i.length(o):Number.MAX_SAFE_INTEGER,await r.compileSchema(e,t)]},interpret:s,collectEvaluatedItems:(e,t,n,r)=>{if(!s(e,t,n,r))return!1;const i=new Set;for(let n=e[0];n{const{Core:r,Schema:i,Instance:o}=n(2735);e.exports={compile:async(e,t,n)=>{const o=await i.step("properties",n),s=i.typeOf(o,"object")?i.keys(o):[],a=await i.step("patternProperties",n),l=i.typeOf(a,"object")?i.keys(a).map((e=>new RegExp(e))):[];return i.typeOf(e,"boolean")?[s,l,i.value(e)]:[s,l,await r.compileSchema(e,t)]},interpret:([e,t,n],i,s,a)=>{if(!o.typeOf(i,"object"))return!0;const l=o.entries(i).filter((([n])=>!e.includes(n)&&!t.some((e=>e.test(n)))));return"string"==typeof n?l.every((([,e])=>r.interpretSchema(n,e,s,a))):0===l.length||n}}},7461:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=([e,t,n],i,s,a)=>!o.typeOf(i,"object")||o.entries(i).filter((([n])=>!e.includes(n)&&!t.some((e=>e.test(n))))).every((([,e])=>r.interpretSchema(n,e,s,a)));e.exports={compile:async(e,t,n)=>{const o=await i.step("properties",n),s=i.typeOf(o,"object")?i.keys(o):[],a=await i.step("patternProperties",n);return[s,i.typeOf(a,"object")?i.keys(a).map((e=>new RegExp(e))):[],await r.compileSchema(e,t)]},interpret:s,collectEvaluatedProperties:(e,t,n,r)=>s(e,t,n,r)&&[new RegExp("")]}},296:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=n(7833);e.exports={compile:(e,t)=>o.pipeline([i.map((async e=>r.compileSchema(await e,t))),o.all],e),interpret:(e,t,n,i)=>e.every((e=>r.interpretSchema(e,t,n,i))),collectEvaluatedProperties:(e,t,n,i)=>e.reduce(((e,o)=>{const s=e&&r.collectEvaluatedProperties(o,t,n,i);return!1!==s&&[...e,...s]}),[]),collectEvaluatedItems:(e,t,n,i)=>e.reduce(((e,o)=>{const s=!1!==e&&r.collectEvaluatedItems(o,t,n,i);return!1!==s&&new Set([...e,...s])}),new Set)}},7803:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=n(7833);e.exports={compile:(e,t)=>o.pipeline([i.map((async e=>r.compileSchema(await e,t))),o.all],e),interpret:(e,t,n,i)=>e.filter((e=>r.interpretSchema(e,t,n,i))).length>0,collectEvaluatedProperties:(e,t,n,i)=>e.reduce(((e,o)=>{const s=r.collectEvaluatedProperties(o,t,n,i);return!1!==s?[...e||[],...s]:e}),!1),collectEvaluatedItems:(e,t,n,i)=>e.reduce(((e,o)=>{const s=r.collectEvaluatedItems(o,t,n,i);return!1!==s?new Set([...e||[],...s]):e}),!1)}},3840:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735),o=n(1049);e.exports={compile:e=>o(r.value(e)),interpret:(e,t)=>o(i.value(t))===e}},2670:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=({contains:e,minContains:t,maxContains:n},i,s,a)=>{if(!o.typeOf(i,"array"))return!0;const l=o.reduce(((t,n)=>r.interpretSchema(e,n,s,a)?t+1:t),0,i);return l>=t&&l<=n};e.exports={compile:async(e,t,n)=>{const o=await r.compileSchema(e,t),s=await i.step("minContains",n),a=i.typeOf(s,"number")?i.value(s):1,l=await i.step("maxContains",n);return{contains:o,minContains:a,maxContains:i.typeOf(l,"number")?i.value(l):Number.MAX_SAFE_INTEGER}},interpret:s,collectEvaluatedItems:(e,t,n,i)=>s(e,t,n,i)&&o.reduce(((t,o,s)=>r.interpretSchema(e.contains,o,n,i)?t.add(s):t),new Set,t)}},7015:(e,t,n)=>{const{Core:r,Instance:i}=n(2735);e.exports={compile:(e,t)=>r.compileSchema(e,t),interpret:(e,t,n,o)=>!i.typeOf(t,"array")||i.some((t=>r.interpretSchema(e,t,n,o)),t)}},2313:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=n(7833);e.exports={compile:async(e,t)=>{await o.pipeline([i.entries,o.map((([,e])=>r.compileSchema(e,t))),o.all],e)},interpret:()=>!0}},357:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=n(7833);e.exports={compile:(e,t)=>s.pipeline([i.entries,s.map((async([e,n])=>[e,i.typeOf(n,"array")?i.value(n):await r.compileSchema(n,t)])),s.all],e),interpret:(e,t,n,i)=>{const s=o.value(t);return!o.typeOf(t,"object")||e.every((([e,o])=>!(e in s)||(Array.isArray(o)?o.every((e=>e in s)):r.interpretSchema(o,t,n,i))))}}},3832:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735),o=n(7833);e.exports={compile:e=>o.pipeline([r.entries,o.map((([e,t])=>[e,r.value(t)])),o.all],e),interpret:(e,t)=>{const n=i.value(t);return!i.typeOf(t,"object")||e.every((([e,t])=>!(e in n)||t.every((e=>e in n))))}}},5064:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=n(7833);e.exports={compile:(e,t)=>s.pipeline([i.entries,s.map((async([e,n])=>[e,await r.compileSchema(n,t)])),s.all],e),interpret:(e,t,n,i)=>{const s=o.value(t);return!o.typeOf(t,"object")||e.every((([e,o])=>!(e in s)||r.interpretSchema(o,t,n,i)))},collectEvaluatedProperties:(e,t,n,i)=>e.reduce(((e,[s,a])=>{if(!e||!o.has(s,t))return e;const l=r.collectEvaluatedProperties(a,t,n,i);return!1!==l&&e.concat(l)}),[])}},2560:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),{splitUrl:o}=n(328),s=r.collectEvaluatedProperties,a=r.collectEvaluatedItems;e.exports={compile:async(e,t)=>{const[,n]=o(i.value(e)),s=await i.get(i.value(e),e);return await r.compileSchema(s,t),[s.id,n,i.uri(s)]},interpret:([e,t,n],i,o,s)=>t in o.metaData[e].dynamicAnchors?r.interpretSchema(s[t],i,o,s):r.interpretSchema(n,i,o,s),collectEvaluatedProperties:s,collectEvaluatedItems:a}},6324:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=(e,t,n,i)=>{const o=n[e][2];return"boolean"==typeof o?o:o.every((([e,,o])=>r.getKeyword(e).interpret(o,t,n,i)))};e.exports={compile:async(e,t,n)=>{if(i.has("if",n)){const o=await i.step("if",n);return[await r.compileSchema(o,t),await r.compileSchema(e,t)]}return[]},interpret:([e,t],n,i,s)=>void 0===e||o(e,n,i,s)||r.interpretSchema(t,n,i,s),collectEvaluatedProperties:([e,t],n,i,s)=>void 0===e||o(e,n,i,s)?[]:r.collectEvaluatedProperties(t,n,i,s),collectEvaluatedItems:([e,t],n,i,s)=>void 0===e||o(e,n,i,s)?new Set:r.collectEvaluatedItems(t,n,i,s)}},6022:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735),o=n(1049);e.exports={compile:e=>r.value(e).map(o),interpret:(e,t)=>e.some((e=>o(i.value(t))===e))}},1633:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:async e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"number")||i.value(t){const{Schema:r,Instance:i}=n(2735);e.exports={compile:async e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"number")||i.value(t)>e}},7770:(e,t,n)=>{const{Core:r}=n(2735);e.exports={compile:(e,t)=>r.compileSchema(e,t),interpret:(e,t,n,i)=>(r.interpretSchema(e,t,n,i),!0),collectEvaluatedProperties:(e,t,n,i)=>r.collectEvaluatedProperties(e,t,n,i)||[],collectEvaluatedItems:(e,t,n,i)=>r.collectEvaluatedItems(e,t,n,i)||new Set}},2077:(e,t,n)=>{const{Keywords:r}=n(2735);e.exports={additionalItems:n(6414),additionalItems6:n(3521),additionalProperties:n(269),additionalProperties6:n(7461),allOf:n(296),anyOf:n(7803),const:n(3840),contains:n(7015),containsMinContainsMaxContains:n(2670),definitions:n(2313),dependencies:n(357),dependentRequired:n(3832),dependentSchemas:n(5064),enum:n(6022),exclusiveMaximum:n(1633),exclusiveMinimum:n(1743),if:n(7770),then:n(318),else:n(6324),items:n(7777),items202012:n(9156),maxItems:n(2367),maxLength:n(6598),maxProperties:n(5075),maximumExclusiveMaximum:n(5792),maximum:n(3692),metaData:r.metaData,minItems:n(6032),minLength:n(9925),minProperties:n(7302),minimumExclusiveMinimum:n(2526),minimum:n(5715),multipleOf:n(8924),not:n(7166),oneOf:n(231),pattern:n(6371),patternProperties:n(1395),properties:n(8231),propertyNames:n(2028),dynamicRef:n(2560),ref:n(3435),required:n(1137),tupleItems:n(3352),type:n(6380),unevaluatedItems:n(7754),unevaluatedProperties:n(9953),uniqueItems:n(7707),validate:r.validate}},7777:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=(e,t,n,i)=>!o.typeOf(t,"array")||("string"==typeof e?o.every((t=>r.interpretSchema(e,t,n,i)),t):o.every(((t,o)=>!(o in e)||r.interpretSchema(e[o],t,n,i)),t));e.exports={compile:async(e,t)=>{if(i.typeOf(e,"array")){const n=await i.map((e=>r.compileSchema(e,t)),e);return Promise.all(n)}return r.compileSchema(e,t)},interpret:s,collectEvaluatedItems:(e,t,n,r)=>s(e,t,n,r)&&("string"==typeof e?new Set(o.map(((e,t)=>t),t)):new Set(e.map(((e,t)=>t))))}},9156:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=([e,t],n,i,s)=>!o.typeOf(n,"array")||o.every(((n,o)=>o{const o=await i.step("prefixItems",n);return[i.typeOf(o,"array")?i.length(o):0,await r.compileSchema(e,t)]},interpret:s,collectEvaluatedItems:(e,t,n,r)=>s(e,t,n,r)&&new Set(o.map(((e,t)=>t),t))}},2367:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"array")||i.length(t)<=e}},6598:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"string")||[...i.value(t)].length<=e}},5075:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"object")||i.keys(t).length<=e}},5792:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:async(e,t,n)=>{const i=await r.step("exclusiveMaximum",n),o=r.value(i);return[r.value(e),o]},interpret:([e,t],n)=>{if(!i.typeOf(n,"number"))return!0;const r=i.value(n);return t?r{const{Schema:r,Instance:i}=n(2735);e.exports={compile:async e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"number")||i.value(t)<=e}},6032:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"array")||i.length(t)>=e}},9925:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"string")||[...i.value(t)].length>=e}},7302:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"object")||i.keys(t).length>=e}},2526:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:async(e,t,n)=>{const i=await r.step("exclusiveMinimum",n),o=r.value(i);return[r.value(e),o]},interpret:([e,t],n)=>{if(!i.typeOf(n,"number"))return!0;const r=i.value(n);return t?r>e:r>=e}}},5715:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:async e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"number")||i.value(t)>=e}},8924:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735),o=(e,t)=>Math.abs(e-t)<1.1920929e-7;e.exports={compile:e=>r.value(e),interpret:(e,t)=>{if(!i.typeOf(t,"number"))return!0;const n=i.value(t)%e;return o(0,n)||o(e,n)}}},7166:(e,t,n)=>{const{Core:r}=n(2735),i=r.compileSchema;e.exports={compile:i,interpret:(e,t,n,i)=>!r.interpretSchema(e,t,n,i)}},231:(e,t,n)=>{const{Core:r,Schema:i}=n(2735);e.exports={compile:async(e,t)=>{const n=await i.map((e=>r.compileSchema(e,t)),e);return Promise.all(n)},interpret:(e,t,n,i)=>{let o=0;for(const s of e)if(r.interpretSchema(s,t,n,i)&&o++,o>1)break;return 1===o},collectEvaluatedProperties:(e,t,n,i)=>{let o=0;return e.reduce(((e,s)=>{if(o>1)return!1;const a=r.collectEvaluatedProperties(s,t,n,i);return a?0==o++&&a:e}),!1)},collectEvaluatedItems:(e,t,n,i)=>{let o=0;return e.reduce(((e,s)=>{if(o>1)return!1;const a=r.collectEvaluatedItems(s,t,n,i);return a?0==o++&&a:e}),!1)}}},6371:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:e=>new RegExp(r.value(e),"u"),interpret:(e,t)=>!i.typeOf(t,"string")||e.test(i.value(t))}},1395:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=n(7833),a=(e,t,n,i)=>!o.typeOf(t,"object")||e.every((([e,s])=>o.entries(t).filter((([t])=>e.test(t))).every((([,e])=>r.interpretSchema(s,e,n,i)))));e.exports={compile:(e,t)=>s.pipeline([i.entries,s.map((async([e,n])=>[new RegExp(e,"u"),await r.compileSchema(n,t)])),s.all],e),interpret:a,collectEvaluatedProperties:(e,t,n,r)=>a(e,t,n,r)&&e.map((([e])=>e))}},8231:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=n(7833),{escapeRegExp:a}=n(328),l=(e,t,n,i)=>!o.typeOf(t,"object")||o.entries(t).filter((([t])=>t in e)).every((([t,o])=>r.interpretSchema(e[t],o,n,i)));e.exports={compile:(e,t)=>s.pipeline([i.entries,s.reduce((async(e,[n,i])=>(e[n]=await r.compileSchema(i,t),e)),Object.create(null))],e),interpret:l,collectEvaluatedProperties:(e,t,n,r)=>l(e,t,n,r)&&Object.keys(e).map((e=>new RegExp(`^${a(e)}$`)))}},2028:(e,t,n)=>{const{Core:r,Instance:i}=n(2735);e.exports={compile:(e,t)=>r.compileSchema(e,t),interpret:(e,t,n,o)=>!i.typeOf(t,"object")||i.keys(t).every((t=>r.interpretSchema(e,i.cons(t),n,o)))}},3435:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=r.interpretSchema,s=r.collectEvaluatedProperties,a=r.collectEvaluatedItems;e.exports={compile:async(e,t)=>{const n=await i.get(i.value(e),e);return r.compileSchema(n,t)},interpret:o,collectEvaluatedProperties:s,collectEvaluatedItems:a}},1137:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:e=>r.value(e),interpret:(e,t)=>!i.typeOf(t,"object")||e.every((e=>Object.prototype.hasOwnProperty.call(i.value(t),e)))}},318:(e,t,n)=>{const{Core:r,Schema:i}=n(2735),o=(e,t,n,i)=>{const o=n[e][2];return"boolean"==typeof o?o:o.every((([e,,o])=>r.getKeyword(e).interpret(o,t,n,i)))};e.exports={compile:async(e,t,n)=>{if(i.has("if",n)){const o=await i.step("if",n);return[await r.compileSchema(o,t),await r.compileSchema(e,t)]}return[]},interpret:([e,t],n,i,s)=>void 0===e||!o(e,n,i,s)||r.interpretSchema(t,n,i,s),collectEvaluatedProperties:([e,t],n,i,s)=>void 0!==e&&o(e,n,i,s)?r.collectEvaluatedProperties(t,n,i,s):[],collectEvaluatedItems:([e,t],n,i,s)=>void 0!==e&&o(e,n,i,s)?r.collectEvaluatedItems(t,n,i,s):new Set}},3352:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=n(7833),a=(e,t,n,i)=>!o.typeOf(t,"array")||o.every(((t,o)=>!(o in e)||r.interpretSchema(e[o],t,n,i)),t);e.exports={compile:(e,t)=>s.pipeline([i.map((e=>r.compileSchema(e,t))),s.all],e),interpret:a,collectEvaluatedItems:(e,t,n,r)=>a(e,t,n,r)&&new Set(e.map(((e,t)=>t)))}},6380:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735);e.exports={compile:e=>r.value(e),interpret:(e,t)=>"string"==typeof e?i.typeOf(t,e):e.some(i.typeOf(t))}},7754:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=([e,t],n,i,s)=>{if(!o.typeOf(n,"array"))return!0;const a=r.collectEvaluatedItems(e,n,i,s,!0);return!1===a||o.every(((e,l)=>a.has(l)||r.interpretSchema(t,o.step(l,n),i,s)),n)};e.exports={compile:async(e,t,n)=>[i.uri(n),await r.compileSchema(e,t)],interpret:s,collectEvaluatedItems:(e,t,n,r)=>s(e,t,n,r)&&new Set(o.map(((e,t)=>t),t))}},9953:(e,t,n)=>{const{Core:r,Schema:i,Instance:o}=n(2735),s=([e,t],n,i,s)=>{if(!o.typeOf(n,"object"))return!0;const a=r.collectEvaluatedProperties(e,n,i,s,!0);return!a||o.entries(n).filter((([e])=>!a.some((t=>e.match(t))))).every((([,e])=>r.interpretSchema(t,e,i,s)))};e.exports={compile:async(e,t,n)=>[i.uri(n),await r.compileSchema(e,t)],interpret:s,collectEvaluatedProperties:(e,t,n,r)=>s(e,t,n,r)&&[new RegExp("")]}},7707:(e,t,n)=>{const{Schema:r,Instance:i}=n(2735),o=n(1049);e.exports={compile:e=>r.value(e),interpret:(e,t)=>{if(!i.typeOf(t,"array")||!1===e)return!0;const n=i.map((e=>o(i.value(e))),t);return new Set(n).size===n.length}}},89:e=>{e.exports='{\n "id": "http://json-schema.org/draft-04/schema#",\n "$schema": "http://json-schema.org/draft-04/schema#",\n "description": "Core schema meta-schema",\n "definitions": {\n "schemaArray": {\n "type": "array",\n "minItems": 1,\n "items": { "$ref": "#" }\n },\n "positiveInteger": {\n "type": "integer",\n "minimum": 0\n },\n "positiveIntegerDefault0": {\n "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]\n },\n "simpleTypes": {\n "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]\n },\n "stringArray": {\n "type": "array",\n "items": { "type": "string" },\n "minItems": 1,\n "uniqueItems": true\n }\n },\n "type": "object",\n "properties": {\n "id": {\n "type": "string"\n },\n "$schema": {\n "type": "string"\n },\n "title": {\n "type": "string"\n },\n "description": {\n "type": "string"\n },\n "default": {},\n "multipleOf": {\n "type": "number",\n "minimum": 0,\n "exclusiveMinimum": true\n },\n "maximum": {\n "type": "number"\n },\n "exclusiveMaximum": {\n "type": "boolean",\n "default": false\n },\n "minimum": {\n "type": "number"\n },\n "exclusiveMinimum": {\n "type": "boolean",\n "default": false\n },\n "maxLength": { "$ref": "#/definitions/positiveInteger" },\n "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },\n "pattern": {\n "type": "string",\n "format": "regex"\n },\n "additionalItems": {\n "anyOf": [\n { "type": "boolean" },\n { "$ref": "#" }\n ],\n "default": {}\n },\n "items": {\n "anyOf": [\n { "$ref": "#" },\n { "$ref": "#/definitions/schemaArray" }\n ],\n "default": {}\n },\n "maxItems": { "$ref": "#/definitions/positiveInteger" },\n "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },\n "uniqueItems": {\n "type": "boolean",\n "default": false\n },\n "maxProperties": { "$ref": "#/definitions/positiveInteger" },\n "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },\n "required": { "$ref": "#/definitions/stringArray" },\n "additionalProperties": {\n "anyOf": [\n { "type": "boolean" },\n { "$ref": "#" }\n ],\n "default": {}\n },\n "definitions": {\n "type": "object",\n "additionalProperties": { "$ref": "#" },\n "default": {}\n },\n "properties": {\n "type": "object",\n "additionalProperties": { "$ref": "#" },\n "default": {}\n },\n "patternProperties": {\n "type": "object",\n "additionalProperties": { "$ref": "#" },\n "default": {}\n },\n "dependencies": {\n "type": "object",\n "additionalProperties": {\n "anyOf": [\n { "$ref": "#" },\n { "$ref": "#/definitions/stringArray" }\n ]\n }\n },\n "enum": {\n "type": "array",\n "minItems": 1,\n "uniqueItems": true\n },\n "type": {\n "anyOf": [\n { "$ref": "#/definitions/simpleTypes" },\n {\n "type": "array",\n "items": { "$ref": "#/definitions/simpleTypes" },\n "minItems": 1,\n "uniqueItems": true\n }\n ]\n },\n "format": { "type": "string" },\n "allOf": { "$ref": "#/definitions/schemaArray" },\n "anyOf": { "$ref": "#/definitions/schemaArray" },\n "oneOf": { "$ref": "#/definitions/schemaArray" },\n "not": { "$ref": "#" }\n },\n "dependencies": {\n "exclusiveMaximum": [ "maximum" ],\n "exclusiveMinimum": [ "minimum" ]\n },\n "default": {}\n}'},9403:e=>{e.exports='{\n "$schema": "http://json-schema.org/draft-06/schema#",\n "$id": "http://json-schema.org/draft-06/schema#",\n "title": "Core schema meta-schema",\n "definitions": {\n "schemaArray": {\n "type": "array",\n "minItems": 1,\n "items": { "$ref": "#" }\n },\n "nonNegativeInteger": {\n "type": "integer",\n "minimum": 0\n },\n "nonNegativeIntegerDefault0": {\n "allOf": [\n { "$ref": "#/definitions/nonNegativeInteger" },\n { "default": 0 }\n ]\n },\n "simpleTypes": {\n "enum": [\n "array",\n "boolean",\n "integer",\n "null",\n "number",\n "object",\n "string"\n ]\n },\n "stringArray": {\n "type": "array",\n "items": { "type": "string" },\n "uniqueItems": true,\n "default": []\n }\n },\n "type": ["object", "boolean"],\n "properties": {\n "$id": {\n "type": "string",\n "format": "uri-reference"\n },\n "$schema": {\n "type": "string",\n "format": "uri"\n },\n "$ref": {\n "type": "string",\n "format": "uri-reference"\n },\n "title": {\n "type": "string"\n },\n "description": {\n "type": "string"\n },\n "default": {},\n "examples": {\n "type": "array",\n "items": {}\n },\n "multipleOf": {\n "type": "number",\n "exclusiveMinimum": 0\n },\n "maximum": {\n "type": "number"\n },\n "exclusiveMaximum": {\n "type": "number"\n },\n "minimum": {\n "type": "number"\n },\n "exclusiveMinimum": {\n "type": "number"\n },\n "maxLength": { "$ref": "#/definitions/nonNegativeInteger" },\n "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },\n "pattern": {\n "type": "string",\n "format": "regex"\n },\n "additionalItems": { "$ref": "#" },\n "items": {\n "anyOf": [\n { "$ref": "#" },\n { "$ref": "#/definitions/schemaArray" }\n ],\n "default": {}\n },\n "maxItems": { "$ref": "#/definitions/nonNegativeInteger" },\n "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },\n "uniqueItems": {\n "type": "boolean",\n "default": false\n },\n "contains": { "$ref": "#" },\n "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },\n "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },\n "required": { "$ref": "#/definitions/stringArray" },\n "additionalProperties": { "$ref": "#" },\n "definitions": {\n "type": "object",\n "additionalProperties": { "$ref": "#" },\n "default": {}\n },\n "properties": {\n "type": "object",\n "additionalProperties": { "$ref": "#" },\n "default": {}\n },\n "patternProperties": {\n "type": "object",\n "additionalProperties": { "$ref": "#" },\n "default": {}\n },\n "dependencies": {\n "type": "object",\n "additionalProperties": {\n "anyOf": [\n { "$ref": "#" },\n { "$ref": "#/definitions/stringArray" }\n ]\n }\n },\n "propertyNames": { "$ref": "#" },\n "const": {},\n "enum": {\n "type": "array",\n "minItems": 1,\n "uniqueItems": true\n },\n "type": {\n "anyOf": [\n { "$ref": "#/definitions/simpleTypes" },\n {\n "type": "array",\n "items": { "$ref": "#/definitions/simpleTypes" },\n "minItems": 1,\n "uniqueItems": true\n }\n ]\n },\n "format": { "type": "string" },\n "allOf": { "$ref": "#/definitions/schemaArray" },\n "anyOf": { "$ref": "#/definitions/schemaArray" },\n "oneOf": { "$ref": "#/definitions/schemaArray" },\n "not": { "$ref": "#" }\n },\n "default": {}\n}'},2613:e=>{e.exports='{\n "$schema": "http://json-schema.org/draft-07/schema#",\n "$id": "http://json-schema.org/draft-07/schema#",\n "title": "Core schema meta-schema",\n "definitions": {\n "schemaArray": {\n "type": "array",\n "minItems": 1,\n "items": { "$ref": "#" }\n },\n "nonNegativeInteger": {\n "type": "integer",\n "minimum": 0\n },\n "nonNegativeIntegerDefault0": {\n "allOf": [\n { "$ref": "#/definitions/nonNegativeInteger" },\n { "default": 0 }\n ]\n },\n "simpleTypes": {\n "enum": [\n "array",\n "boolean",\n "integer",\n "null",\n "number",\n "object",\n "string"\n ]\n },\n "stringArray": {\n "type": "array",\n "items": { "type": "string" },\n "uniqueItems": true,\n "default": []\n }\n },\n "type": ["object", "boolean"],\n "properties": {\n "$id": {\n "type": "string",\n "format": "uri-reference"\n },\n "$schema": {\n "type": "string",\n "format": "uri"\n },\n "$ref": {\n "type": "string",\n "format": "uri-reference"\n },\n "$comment": {\n "type": "string"\n },\n "title": {\n "type": "string"\n },\n "description": {\n "type": "string"\n },\n "default": true,\n "readOnly": {\n "type": "boolean",\n "default": false\n },\n "writeOnly": {\n "type": "boolean",\n "default": false\n },\n "examples": {\n "type": "array",\n "items": true\n },\n "multipleOf": {\n "type": "number",\n "exclusiveMinimum": 0\n },\n "maximum": {\n "type": "number"\n },\n "exclusiveMaximum": {\n "type": "number"\n },\n "minimum": {\n "type": "number"\n },\n "exclusiveMinimum": {\n "type": "number"\n },\n "maxLength": { "$ref": "#/definitions/nonNegativeInteger" },\n "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },\n "pattern": {\n "type": "string",\n "format": "regex"\n },\n "additionalItems": { "$ref": "#" },\n "items": {\n "anyOf": [\n { "$ref": "#" },\n { "$ref": "#/definitions/schemaArray" }\n ],\n "default": true\n },\n "maxItems": { "$ref": "#/definitions/nonNegativeInteger" },\n "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },\n "uniqueItems": {\n "type": "boolean",\n "default": false\n },\n "contains": { "$ref": "#" },\n "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },\n "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },\n "required": { "$ref": "#/definitions/stringArray" },\n "additionalProperties": { "$ref": "#" },\n "definitions": {\n "type": "object",\n "additionalProperties": { "$ref": "#" },\n "default": {}\n },\n "properties": {\n "type": "object",\n "additionalProperties": { "$ref": "#" },\n "default": {}\n },\n "patternProperties": {\n "type": "object",\n "additionalProperties": { "$ref": "#" },\n "propertyNames": { "format": "regex" },\n "default": {}\n },\n "dependencies": {\n "type": "object",\n "additionalProperties": {\n "anyOf": [\n { "$ref": "#" },\n { "$ref": "#/definitions/stringArray" }\n ]\n }\n },\n "propertyNames": { "$ref": "#" },\n "const": true,\n "enum": {\n "type": "array",\n "items": true,\n "minItems": 1,\n "uniqueItems": true\n },\n "type": {\n "anyOf": [\n { "$ref": "#/definitions/simpleTypes" },\n {\n "type": "array",\n "items": { "$ref": "#/definitions/simpleTypes" },\n "minItems": 1,\n "uniqueItems": true\n }\n ]\n },\n "format": { "type": "string" },\n "contentMediaType": { "type": "string" },\n "contentEncoding": { "type": "string" },\n "if": { "$ref": "#" },\n "then": { "$ref": "#" },\n "else": { "$ref": "#" },\n "allOf": { "$ref": "#/definitions/schemaArray" },\n "anyOf": { "$ref": "#/definitions/schemaArray" },\n "oneOf": { "$ref": "#/definitions/schemaArray" },\n "not": { "$ref": "#" }\n },\n "default": true\n}'},3334:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2019-09/meta/applicator",\n "$schema": "https://json-schema.org/draft/2019-09/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2019-09/vocab/applicator": true\n },\n "$recursiveAnchor": true,\n\n "title": "Applicator vocabulary meta-schema",\n "properties": {\n "additionalItems": { "$recursiveRef": "#" },\n "unevaluatedItems": { "$recursiveRef": "#" },\n "items": {\n "anyOf": [\n { "$recursiveRef": "#" },\n { "$ref": "#/$defs/schemaArray" }\n ]\n },\n "contains": { "$recursiveRef": "#" },\n "additionalProperties": { "$recursiveRef": "#" },\n "unevaluatedProperties": { "$recursiveRef": "#" },\n "properties": {\n "type": "object",\n "additionalProperties": { "$recursiveRef": "#" },\n "default": {}\n },\n "patternProperties": {\n "type": "object",\n "additionalProperties": { "$recursiveRef": "#" },\n "propertyNames": { "format": "regex" },\n "default": {}\n },\n "dependentSchemas": {\n "type": "object",\n "additionalProperties": {\n "$recursiveRef": "#"\n }\n },\n "propertyNames": { "$recursiveRef": "#" },\n "if": { "$recursiveRef": "#" },\n "then": { "$recursiveRef": "#" },\n "else": { "$recursiveRef": "#" },\n "allOf": { "$ref": "#/$defs/schemaArray" },\n "anyOf": { "$ref": "#/$defs/schemaArray" },\n "oneOf": { "$ref": "#/$defs/schemaArray" },\n "not": { "$recursiveRef": "#" }\n },\n "$defs": {\n "schemaArray": {\n "type": "array",\n "minItems": 1,\n "items": { "$recursiveRef": "#" }\n }\n }\n}'},480:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2019-09/meta/content",\n "$schema": "https://json-schema.org/draft/2019-09/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2019-09/vocab/content": true\n },\n "$recursiveAnchor": true,\n\n "title": "Content vocabulary meta-schema",\n\n "type": ["object", "boolean"],\n "properties": {\n "contentMediaType": { "type": "string" },\n "contentEncoding": { "type": "string" },\n "contentSchema": { "$recursiveRef": "#" }\n }\n}'},2037:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2019-09/meta/core",\n "$schema": "https://json-schema.org/draft/2019-09/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2019-09/vocab/core": true\n },\n "$recursiveAnchor": true,\n\n "title": "Core vocabulary meta-schema",\n "type": ["object", "boolean"],\n "properties": {\n "$id": {\n "type": "string",\n "format": "uri-reference",\n "$comment": "Non-empty fragments not allowed.",\n "pattern": "^[^#]*#?$"\n },\n "$schema": {\n "type": "string",\n "format": "uri"\n },\n "$anchor": {\n "type": "string",\n "pattern": "^[A-Za-z][-A-Za-z0-9.:_]*$"\n },\n "$ref": {\n "type": "string",\n "format": "uri-reference"\n },\n "$recursiveRef": {\n "type": "string",\n "format": "uri-reference"\n },\n "$recursiveAnchor": {\n "type": "boolean",\n "default": false\n },\n "$vocabulary": {\n "type": "object",\n "propertyNames": {\n "type": "string",\n "format": "uri"\n },\n "additionalProperties": {\n "type": "boolean"\n }\n },\n "$comment": {\n "type": "string"\n },\n "$defs": {\n "type": "object",\n "additionalProperties": { "$recursiveRef": "#" },\n "default": {}\n }\n }\n}'},830:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2019-09/meta/format",\n "$schema": "https://json-schema.org/draft/2019-09/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2019-09/vocab/format": true\n },\n "$recursiveAnchor": true,\n\n "title": "Format vocabulary meta-schema",\n "type": ["object", "boolean"],\n "properties": {\n "format": { "type": "string" }\n }\n}'},3198:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2019-09/meta/meta-data",\n "$schema": "https://json-schema.org/draft/2019-09/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2019-09/vocab/meta-data": true\n },\n "$recursiveAnchor": true,\n\n "title": "Meta-data vocabulary meta-schema",\n\n "type": ["object", "boolean"],\n "properties": {\n "title": {\n "type": "string"\n },\n "description": {\n "type": "string"\n },\n "default": true,\n "deprecated": {\n "type": "boolean",\n "default": false\n },\n "readOnly": {\n "type": "boolean",\n "default": false\n },\n "writeOnly": {\n "type": "boolean",\n "default": false\n },\n "examples": {\n "type": "array",\n "items": true\n }\n }\n}'},9447:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2019-09/meta/validation",\n "$schema": "https://json-schema.org/draft/2019-09/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2019-09/vocab/validation": true\n },\n "$recursiveAnchor": true,\n\n "title": "Validation vocabulary meta-schema",\n "type": ["object", "boolean"],\n "properties": {\n "multipleOf": {\n "type": "number",\n "exclusiveMinimum": 0\n },\n "maximum": {\n "type": "number"\n },\n "exclusiveMaximum": {\n "type": "number"\n },\n "minimum": {\n "type": "number"\n },\n "exclusiveMinimum": {\n "type": "number"\n },\n "maxLength": { "$ref": "#/$defs/nonNegativeInteger" },\n "minLength": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },\n "pattern": {\n "type": "string",\n "format": "regex"\n },\n "maxItems": { "$ref": "#/$defs/nonNegativeInteger" },\n "minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },\n "uniqueItems": {\n "type": "boolean",\n "default": false\n },\n "maxContains": { "$ref": "#/$defs/nonNegativeInteger" },\n "minContains": {\n "$ref": "#/$defs/nonNegativeInteger",\n "default": 1\n },\n "maxProperties": { "$ref": "#/$defs/nonNegativeInteger" },\n "minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },\n "required": { "$ref": "#/$defs/stringArray" },\n "dependentRequired": {\n "type": "object",\n "additionalProperties": {\n "$ref": "#/$defs/stringArray"\n }\n },\n "const": true,\n "enum": {\n "type": "array",\n "items": true\n },\n "type": {\n "anyOf": [\n { "$ref": "#/$defs/simpleTypes" },\n {\n "type": "array",\n "items": { "$ref": "#/$defs/simpleTypes" },\n "minItems": 1,\n "uniqueItems": true\n }\n ]\n }\n },\n "$defs": {\n "nonNegativeInteger": {\n "type": "integer",\n "minimum": 0\n },\n "nonNegativeIntegerDefault0": {\n "$ref": "#/$defs/nonNegativeInteger",\n "default": 0\n },\n "simpleTypes": {\n "enum": [\n "array",\n "boolean",\n "integer",\n "null",\n "number",\n "object",\n "string"\n ]\n },\n "stringArray": {\n "type": "array",\n "items": { "type": "string" },\n "uniqueItems": true,\n "default": []\n }\n }\n}'},6998:e=>{e.exports='{\n "$schema": "https://json-schema.org/draft/2019-09/schema",\n "$id": "https://json-schema.org/draft/2019-09/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2019-09/vocab/core": true,\n "https://json-schema.org/draft/2019-09/vocab/applicator": true,\n "https://json-schema.org/draft/2019-09/vocab/validation": true,\n "https://json-schema.org/draft/2019-09/vocab/meta-data": true,\n "https://json-schema.org/draft/2019-09/vocab/format": false,\n "https://json-schema.org/draft/2019-09/vocab/content": true\n },\n "$recursiveAnchor": true,\n\n "title": "Core and Validation specifications meta-schema",\n "allOf": [\n {"$ref": "meta/core"},\n {"$ref": "meta/applicator"},\n {"$ref": "meta/validation"},\n {"$ref": "meta/meta-data"},\n {"$ref": "meta/format"},\n {"$ref": "meta/content"}\n ],\n "type": ["object", "boolean"],\n "properties": {\n "definitions": {\n "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",\n "type": "object",\n "additionalProperties": { "$recursiveRef": "#" },\n "default": {}\n },\n "dependencies": {\n "$comment": "\\"dependencies\\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \\"dependentSchemas\\" and \\"dependentRequired\\"",\n "type": "object",\n "additionalProperties": {\n "anyOf": [\n { "$recursiveRef": "#" },\n { "$ref": "meta/validation#/$defs/stringArray" }\n ]\n }\n }\n }\n}'},9461:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2020-12/meta/applicator",\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2020-12/vocab/applicator": true\n },\n "$dynamicAnchor": "meta",\n\n "title": "Applicator vocabulary meta-schema",\n "type": ["object", "boolean"],\n "properties": {\n "prefixItems": { "$ref": "#/$defs/schemaArray" },\n "items": { "$dynamicRef": "#meta" },\n "contains": { "$dynamicRef": "#meta" },\n "additionalProperties": { "$dynamicRef": "#meta" },\n "properties": {\n "type": "object",\n "additionalProperties": { "$dynamicRef": "#meta" },\n "default": {}\n },\n "patternProperties": {\n "type": "object",\n "additionalProperties": { "$dynamicRef": "#meta" },\n "propertyNames": { "format": "regex" },\n "default": {}\n },\n "dependentSchemas": {\n "type": "object",\n "additionalProperties": {\n "$dynamicRef": "#meta"\n }\n },\n "propertyNames": { "$dynamicRef": "#meta" },\n "if": { "$dynamicRef": "#meta" },\n "then": { "$dynamicRef": "#meta" },\n "else": { "$dynamicRef": "#meta" },\n "allOf": { "$ref": "#/$defs/schemaArray" },\n "anyOf": { "$ref": "#/$defs/schemaArray" },\n "oneOf": { "$ref": "#/$defs/schemaArray" },\n "not": { "$dynamicRef": "#meta" }\n },\n "$defs": {\n "schemaArray": {\n "type": "array",\n "minItems": 1,\n "items": { "$dynamicRef": "#meta" }\n }\n }\n}'},7525:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2020-12/meta/content",\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2020-12/vocab/content": true\n },\n "$dynamicAnchor": "meta",\n\n "title": "Content vocabulary meta-schema",\n\n "type": ["object", "boolean"],\n "properties": {\n "contentMediaType": { "type": "string" },\n "contentEncoding": { "type": "string" },\n "contentSchema": { "$dynamicRef": "#meta" }\n }\n}'},9824:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2020-12/meta/core",\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2020-12/vocab/core": true\n },\n "$dynamicAnchor": "meta",\n\n "title": "Core vocabulary meta-schema",\n "type": ["object", "boolean"],\n "properties": {\n "$id": {\n "type": "string",\n "format": "uri-reference",\n "$comment": "Non-empty fragments not allowed.",\n "pattern": "^[^#]*#?$"\n },\n "$schema": {\n "type": "string",\n "format": "uri"\n },\n "$anchor": {\n "type": "string",\n "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$"\n },\n "$ref": {\n "type": "string",\n "format": "uri-reference"\n },\n "$dynamicRef": {\n "type": "string",\n "format": "uri-reference"\n },\n "$dynamicAnchor": {\n "type": "string",\n "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$"\n },\n "$vocabulary": {\n "type": "object",\n "propertyNames": {\n "type": "string",\n "format": "uri"\n },\n "additionalProperties": {\n "type": "boolean"\n }\n },\n "$comment": {\n "type": "string"\n },\n "$defs": {\n "type": "object",\n "additionalProperties": { "$dynamicRef": "#meta" },\n "default": {}\n }\n }\n}'},8905:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2020-12/meta/format-annotation",\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2020-12/vocab/format-annotation": true\n },\n "$dynamicAnchor": "meta",\n\n "title": "Format vocabulary meta-schema for annotation results",\n "type": ["object", "boolean"],\n "properties": {\n "format": { "type": "string" }\n }\n}'},6646:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2020-12/meta/format-assertion",\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2020-12/vocab/format-assertion": true\n },\n "$dynamicAnchor": "meta",\n\n "title": "Format vocabulary meta-schema for assertion results",\n "type": ["object", "boolean"],\n "properties": {\n "format": { "type": "string" }\n }\n}'},4929:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2020-12/meta/meta-data",\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2020-12/vocab/meta-data": true\n },\n "$dynamicAnchor": "meta",\n\n "title": "Meta-data vocabulary meta-schema",\n\n "type": ["object", "boolean"],\n "properties": {\n "title": {\n "type": "string"\n },\n "description": {\n "type": "string"\n },\n "default": true,\n "deprecated": {\n "type": "boolean",\n "default": false\n },\n "readOnly": {\n "type": "boolean",\n "default": false\n },\n "writeOnly": {\n "type": "boolean",\n "default": false\n },\n "examples": {\n "type": "array",\n "items": true\n }\n }\n}'},8e3:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2020-12/meta/unevaluated",\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2020-12/vocab/unevaluated": true\n },\n "$dynamicAnchor": "meta",\n\n "title": "Unevaluated applicator vocabulary meta-schema",\n "type": ["object", "boolean"],\n "properties": {\n "unevaluatedItems": { "$dynamicRef": "#meta" },\n "unevaluatedProperties": { "$dynamicRef": "#meta" }\n }\n}'},3512:e=>{e.exports='{\n "$id": "https://json-schema.org/draft/2020-12/meta/validation",\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2020-12/vocab/validation": true\n },\n "$dynamicAnchor": "meta",\n\n "title": "Validation vocabulary meta-schema",\n "type": ["object", "boolean"],\n "properties": {\n "multipleOf": {\n "type": "number",\n "exclusiveMinimum": 0\n },\n "maximum": {\n "type": "number"\n },\n "exclusiveMaximum": {\n "type": "number"\n },\n "minimum": {\n "type": "number"\n },\n "exclusiveMinimum": {\n "type": "number"\n },\n "maxLength": { "$ref": "#/$defs/nonNegativeInteger" },\n "minLength": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },\n "pattern": {\n "type": "string",\n "format": "regex"\n },\n "maxItems": { "$ref": "#/$defs/nonNegativeInteger" },\n "minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },\n "uniqueItems": {\n "type": "boolean",\n "default": false\n },\n "maxContains": { "$ref": "#/$defs/nonNegativeInteger" },\n "minContains": {\n "$ref": "#/$defs/nonNegativeInteger",\n "default": 1\n },\n "maxProperties": { "$ref": "#/$defs/nonNegativeInteger" },\n "minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },\n "required": { "$ref": "#/$defs/stringArray" },\n "dependentRequired": {\n "type": "object",\n "additionalProperties": {\n "$ref": "#/$defs/stringArray"\n }\n },\n "const": true,\n "enum": {\n "type": "array",\n "items": true\n },\n "type": {\n "anyOf": [\n { "$ref": "#/$defs/simpleTypes" },\n {\n "type": "array",\n "items": { "$ref": "#/$defs/simpleTypes" },\n "minItems": 1,\n "uniqueItems": true\n }\n ]\n }\n },\n "$defs": {\n "nonNegativeInteger": {\n "type": "integer",\n "minimum": 0\n },\n "nonNegativeIntegerDefault0": {\n "$ref": "#/$defs/nonNegativeInteger",\n "default": 0\n },\n "simpleTypes": {\n "enum": [\n "array",\n "boolean",\n "integer",\n "null",\n "number",\n "object",\n "string"\n ]\n },\n "stringArray": {\n "type": "array",\n "items": { "type": "string" },\n "uniqueItems": true,\n "default": []\n }\n }\n}'},3024:e=>{e.exports='{\n "$schema": "https://json-schema.org/draft/2020-12/schema",\n "$id": "https://json-schema.org/draft/2020-12/schema",\n "$vocabulary": {\n "https://json-schema.org/draft/2020-12/vocab/core": true,\n "https://json-schema.org/draft/2020-12/vocab/applicator": true,\n "https://json-schema.org/draft/2020-12/vocab/unevaluated": true,\n "https://json-schema.org/draft/2020-12/vocab/validation": true,\n "https://json-schema.org/draft/2020-12/vocab/meta-data": true,\n "https://json-schema.org/draft/2020-12/vocab/format-annotation": true,\n "https://json-schema.org/draft/2020-12/vocab/content": true\n },\n "$dynamicAnchor": "meta",\n\n "title": "Core and Validation specifications meta-schema",\n "allOf": [\n {"$ref": "meta/core"},\n {"$ref": "meta/applicator"},\n {"$ref": "meta/unevaluated"},\n {"$ref": "meta/validation"},\n {"$ref": "meta/meta-data"},\n {"$ref": "meta/format-annotation"},\n {"$ref": "meta/content"}\n ],\n "type": ["object", "boolean"],\n "properties": {\n "definitions": {\n "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",\n "type": "object",\n "additionalProperties": { "$dynamicRef": "#meta" },\n "default": {}\n },\n "dependencies": {\n "$comment": "\\"dependencies\\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \\"dependentSchemas\\" and \\"dependentRequired\\"",\n "type": "object",\n "additionalProperties": {\n "anyOf": [\n { "$dynamicRef": "#meta" },\n { "$ref": "meta/validation#/$defs/stringArray" }\n ]\n }\n }\n }\n}'},7622:e=>{e.exports=e=>Promise.all(e)},1821:(e,t,n)=>{const r=n(8912),i=n(7453),o=n(8162);e.exports=e=>r([i,o((async(e,[t,n])=>(e[t]=await n,e)),{})],e)},7453:e=>{e.exports=async e=>Object.entries(await e)},9112:(e,t,n)=>{const r=n(3565),i=n(2169);e.exports=r((async(e,t)=>{const n=await i(e,t);return(await Promise.all(n)).every((e=>e))}))},7121:(e,t,n)=>{const r=n(3565),i=n(8162);e.exports=r((async(e,t,n={})=>i((async(t,n)=>await e(n)?t.concat([n]):t),[],t,n)))},7833:(e,t,n)=>{e.exports={entries:n(7453),map:n(2169),filter:n(7121),reduce:n(8162),some:n(5292),every:n(9112),pipeline:n(8912),all:n(7622),allValues:n(1821)}},2169:(e,t,n)=>{const r=n(3565);e.exports=r((async(e,t)=>(await t).map(e)))},8912:(e,t,n)=>{const r=n(3565);e.exports=r(((e,t)=>e.reduce((async(e,t)=>t(await e)),t)))},8162:(e,t,n)=>{const r=n(3565);e.exports=r((async(e,t,n)=>(await n).reduce((async(t,n)=>e(await t,n)),t)))},5292:(e,t,n)=>{const r=n(3565),i=n(2169);e.exports=r((async(e,t)=>{const n=await i(e,t);return(await Promise.all(n)).some((e=>e))}))},7811:(e,t)=>{"use strict";var n=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,i=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,o=/\\([\u000b\u0020-\u00ff])/g,s=/([\\"])/g,a=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function l(e){var t=String(e);if(i.test(t))return t;if(t.length>0&&!r.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(s,"\\$1")+'"'}function c(e){this.parameters=Object.create(null),this.type=e}t.format=function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var t=e.parameters,n=e.type;if(!n||!a.test(n))throw new TypeError("invalid type");var r=n;if(t&&"object"==typeof t)for(var o,s=Object.keys(t).sort(),c=0;c{"use strict";var t=Object.keys,n=JSON.stringify;function r(e,i){var o,s,a,l,c,h,u;if("string"==(u=typeof e))return n(e);if(!0===e)return"true";if(!1===e)return"false";if(null===e)return"null";if(e instanceof Array){for(a="[",s=e.length-1,o=0;o-1&&(a+=r(e[o],!1)),a+"]"}if(e instanceof Object){if("function"==typeof e.toJSON)return r(e.toJSON(),i);for(s=(l=t(e).sort()).length,a="",o=0;o(t.sort(),new m(`Found: ${e.value} token, expected one of: ${t.join(", ")}`,e));let v=e=>e.slice(1,-1);e.Parser=class{constructor(e,t,n=0){this._source=t,this._tokenizer=e,this.current_token=this._tokenizer.next(this._source,n),this.unaryOpTokens=["-","+","!"],this.primitivesTokens=["number","null","true","false","string"],this.operations=[["||"],["&&"],["in"],["==","!="],["<",">","<=",">="],["+","-"],["*","/"],["**"]],this.expectedTokens=["!","(","+","-","[","false","identifier","null","number","string","true","{"]}takeToken(...e){if(null==this.current_token)throw new m("Unexpected end of input");if(e.length>0&&-1===e.indexOf(this.current_token.kind))throw g(this.current_token,e);try{this.current_token=this._tokenizer.next(this._source,this.current_token.end)}catch(e){throw e}}parse(e=0){let t;if(e==this.operations.length-1){t=this.parsePropertyAccessOrFunc();let n=this.current_token;for(;null!=n&&-1!==this.operations[e].indexOf(n.kind);n=this.current_token)this.takeToken(n.kind),t=new l(n,this.parse(e),t)}else{t=this.parse(e+1);let n=this.current_token;for(;null!=n&&-1!==this.operations[e].indexOf(n.kind);n=this.current_token)this.takeToken(n.kind),t=new l(n,t,this.parse(e+1))}return t}parsePropertyAccessOrFunc(){let e,t=this.parseUnit(),n=["[","(","."];for(let r=this.current_token;null!=r&&-1!==n.indexOf(r.kind);r=this.current_token)"["==r.kind?t=this.parseAccessWithBrackets(t):"."==r.kind?(r=this.current_token,this.takeToken("."),e=new c(this.current_token),this.takeToken("identifier"),t=new l(r,t,e)):"("==r.kind&&(t=this.parseFunctionCall(t));return t}parseUnit(){let e,t=this.current_token,n=-1!==this.unaryOpTokens.indexOf(t.kind),r=-1!==this.primitivesTokens.indexOf(t.kind);if(null==this.current_token)throw new m("Unexpected end of input");if(n)this.takeToken(t.kind),e=new a(t,this.parseUnit());else if(r)this.takeToken(t.kind),e=new c(t);else if("identifier"==t.kind)this.takeToken(t.kind),e=new h(t);else if("("==t.kind){if(this.takeToken("("),e=this.parse(),null==e)throw g(this.current_token,this.expectedTokens);this.takeToken(")")}else"["==t.kind?e=this.parseList():"{"==t.kind&&(e=this.parseObject());return e}parseFunctionCall(e){let t,n=this.current_token,r=[];if(this.takeToken("("),")"!=this.current_token.kind)for(t=this.parse(),r.push(t);null!=this.current_token&&","==this.current_token.kind;){if(null==r[r.length-1])throw g(this.current_token,this.expectedTokens);this.takeToken(","),t=this.parse(),r.push(t)}return this.takeToken(")"),t=new u(n,e,r),t}parseList(){let e,t=[],n=this.current_token;if(this.takeToken("["),"]"!=this.current_token.kind)for(e=this.parse(),t.push(e);","==this.current_token.kind;){if(null==t[t.length-1])throw g(this.current_token,this.expectedTokens);this.takeToken(","),e=this.parse(),t.push(e)}return this.takeToken("]"),e=new d(n,t),e}parseAccessWithBrackets(e){let t=null,n=null,r=this.current_token,i=!1;if(this.takeToken("["),"]"==this.current_token.kind)throw g(this.current_token,this.expectedTokens);if(":"!=this.current_token.kind&&(t=this.parse()),":"==this.current_token.kind&&(i=!0,this.takeToken(":")),"]"!=this.current_token.kind&&(n=this.parse()),i&&null==n&&"]"!=this.current_token.kind)throw g(this.current_token,this.expectedTokens);return this.takeToken("]"),new f(r,e,i,t,n)}parseObject(){let e,t,n,r={},i=this.current_token;this.takeToken("{");let o=this.current_token;for(;null!=o&&("string"==o.kind||"identifier"==o.kind);){if(t=o.value,"string"==o.kind&&(t=v(t)),this.takeToken(o.kind),this.takeToken(":"),n=this.parse(),null==n)throw g(this.current_token,this.expectedTokens);if(r[t]=n,null!=this.current_token&&"}"==this.current_token.kind)break;this.takeToken(","),o=this.current_token}return this.takeToken("}"),e=new p(i,r),e}};var{SyntaxError:y}=s;let b=e=>(e=>{if("string"!=typeof e)return!1;try{new RegExp(`^${e}$`)}catch(e){return!1}return!0})(e)&&1===new RegExp(`^(?:|${e})$`).exec("").length,w=(e,t=0)=>{let n=e.length;for(let r=t;r{if(!e)throw new Error("Token configuration is invalid")};var k=class{constructor(e={}){e=Object.assign({},{ignore:null,patterns:{},tokens:[]},e),x(null===e.ignore||b(e.ignore)),x(e.patterns instanceof Object);for(let t of Object.keys(e.patterns))x(b(e.patterns[t]));x(e.tokens instanceof Array),e.tokens.forEach((e=>x("string"==typeof e))),this._tokens=e.tokens,this._hasIgnore=e.ignore?1:0,this._regex=new RegExp("^(?:"+[this._hasIgnore?`(${e.ignore})`:null,...this._tokens.map((t=>{return`(${e.patterns[t]||(n=t,n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))})`;var n}))].filter((e=>null!==e)).join("|")+")")}next(e,t=0){let n,r;do{if(n=this._regex.exec(e.slice(t)),null===n){if(""!==e.slice(t))throw new y(`Unexpected input for '${e}' at '${e.slice(t)}'`,{start:t,end:e.length});return null}r=w(n,1),t+=n[0].length}while(this._hasIgnore&&1===r);return{kind:this._tokens[r-1-this._hasIgnore],value:n[r],start:t-n[0].length,end:t}}tokenize(e,t=0){let n={end:t},r=[];for(;n=this.next(e,n.end);)r.push(n);return r}},S={};let A={isString:e=>"string"==typeof e,isNumber:e=>"number"==typeof e,isInteger:e=>"number"==typeof e&&Number.isInteger(e),isBool:e=>"boolean"==typeof e,isNull:e=>null===e,isArray:e=>e instanceof Array,isObject:e=>e instanceof Object&&!(e instanceof Array)&&!(e instanceof Function),isFunction:e=>e instanceof Function,isTruthy:e=>null!==e&&(A.isArray(e)&&e.length>0||A.isObject(e)&&Object.keys(e).length>0||A.isString(e)&&e.length>0||A.isNumber(e)&&0!==e||A.isBool(e)&&e||A.isFunction(e))};var C=A;const{isFunction:O,isObject:E,isString:j,isArray:M,isNumber:I,isInteger:T,isTruthy:$}=C,{InterpreterError:_}=s;let P=(e,t)=>new _(`${e} expects ${t}`);let D=(e,t)=>{if(M(e)&&M(t)&&e.length===t.length){for(let n=0;n{if("+"===e&&!(I(t)&&I(n)||j(t)&&j(n)))throw P("infix: +","numbers/strings + numbers/strings");if(["-","*","/","**"].some((t=>t===e))&&(!I(t)||!I(n)))throw P(`infix: ${e}`,`number ${e} number`)},N=(e,t,n)=>{if("=="===e||"!="===e)return null;if(![">=","<=","<",">"].some((t=>t===e))||!(I(t)&&I(n)||j(t)&&j(n)))throw P(`infix: ${e}`,`numbers/strings ${e} numbers/strings`)};S.Interpreter=class{constructor(e){this.context=e}visit(e){return this["visit_"+e.constructorName](e)}visit_ASTNode(e){let t;switch(e.token.kind){case"number":return+e.token.value;case"null":return null;case"string":return t=e.token.value.slice(1,-1),t;case"true":return!0;case"false":return!1;case"identifier":return e.token.value}}visit_UnaryOp(e){let t=this.visit(e.expr);switch(e.token.kind){case"+":if(!I(t))throw P("unary +","number");return+t;case"-":if(!I(t))throw P("unary -","number");return-t;case"!":return!$(t)}}visit_BinOp(e){let t,n=this.visit(e.left);switch(e.token.kind){case"||":return $(n)||$(this.visit(e.right));case"&&":return $(n)&&$(this.visit(e.right));default:t=this.visit(e.right)}switch(e.token.kind){case"+":return R("+",n,t),n+t;case"-":return R("-",n,t),n-t;case"/":return R("/",n,t),n/t;case"*":return R("*",n,t),n*t;case">":return N(">",n,t),n>t;case"<":return N("<",n,t),n=":return N(">=",n,t),n>=t;case"<=":return N("<=",n,t),n<=t;case"!=":return N("!=",n,t),!D(n,t);case"==":return N("==",n,t),D(n,t);case"**":return R("**",n,t),Math.pow(t,n);case".":if(E(n)){if(n.hasOwnProperty(t))return n[t];throw new _(`object has no property "${t}"`)}throw P("infix: .","objects");case"in":if(E(t)){if(!j(n))throw P("Infix: in-object","string on left side");t=Object.keys(t)}else{if(j(t)){if(!j(n))throw P("Infix: in-string","string on left side");return-1!==t.indexOf(n)}if(!M(t))throw P("Infix: in","Array, string, or object on right side")}return t.some((e=>D(n,e)))}}visit_List(e){let t=[];return void 0!==e.list[0]&&e.list.forEach((function(e){t.push(this.visit(e))}),this),t}visit_ValueAccess(e){let t=this.visit(e.arr),n=0,r=null;if(e.left&&(n=this.visit(e.left)),e.right&&(r=this.visit(e.right)),n<0&&(n=t.length+n),M(t)||j(t)){if(e.isInterval){if(r=null===r?t.length:r,r<0&&(r=t.length+r,r<0&&(r=0)),n>r&&(n=r),!T(n)||!T(r))throw new _("cannot perform interval access with non-integers");return t.slice(n,r)}if(!T(n))throw new _("should only use integers to access arrays or strings");if(n>=t.length)throw new _("index out of bounds");return t[n]}if(!E(t))throw P('infix: "[..]"',"object, array, or string");if(!j(n))throw new _("object keys must be strings");return t.hasOwnProperty(n)?t[n]:null}visit_ContextValue(e){if(this.context.hasOwnProperty(e.token.value))return this.context[e.token.value];throw new _(`unknown context value ${e.token.value}`)}visit_FunctionCall(e){let t=[],n=this.visit(e.name);if(O(n))return e.args.forEach((function(e){t.push(this.visit(e))}),this),n.hasOwnProperty("jsone_builtin")&&t.unshift(this.context),n.apply(null,t);throw new _(`${n} is not callable`)}visit_Object(e){let t={};for(let n in e.obj)t[n]=this.visit(e.obj[n]);return t}interpret(e){return this.visit(e)}};var B=new RegExp(["^(\\s*(-|\\+))?","(\\s*(\\d+)\\s*y((ears?)|r)?)?","(\\s*(\\d+)\\s*mo(nths?)?)?","(\\s*(\\d+)\\s*w((eeks?)|k)?)?","(\\s*(\\d+)\\s*d(ays?)?)?","(\\s*(\\d+)\\s*h((ours?)|r)?)?","(\\s*(\\d+)\\s*m(in(utes?)?)?)?","(\\s*(\\d+)\\s*s(ec(onds?)?)?)?","\\s*$"].join(""),"i"),L=(e="",t)=>{let n=function(e){var t=B.exec(e||"");if(!t)throw new Error("String: '"+e+"' isn't a time expression");var n="-"===t[2]?-1:1;return{years:parseInt(t[4]||0,10)*n,months:parseInt(t[8]||0,10)*n,weeks:parseInt(t[11]||0,10)*n,days:parseInt(t[15]||0,10)*n,hours:parseInt(t[18]||0,10)*n,minutes:parseInt(t[22]||0,10)*n,seconds:parseInt(t[25]||0,10)*n}}(e);return n.days+=30*n.months,n.days+=365*n.years,t=t?new Date(t):new Date,new Date(t.getTime()+7*n.weeks*24*60*60*1e3+24*n.days*60*60*1e3+60*n.hours*60*1e3+60*n.minutes*1e3+1e3*n.seconds).toJSON()},F=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},V=Object.keys||function(e){var t=Object.prototype.hasOwnProperty||function(){return!0},n=[];for(var r in e)t.call(e,r)&&n.push(r);return n},{BuiltinError:z}=s,q=L,{isString:H,isNumber:W,isBool:U,isArray:J,isObject:K,isNull:G,isFunction:Q}=C;let Z={string:H,number:W,boolean:U,array:J,object:K,null:G,function:Q},Y=e=>new z(`invalid arguments to ${e}`);const{Parser:X}=e,ee=k,{Interpreter:te}=S;var ne=L,re=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var n=t.space||"";"number"==typeof n&&(n=Array(n+1).join(" "));var r,i="boolean"==typeof t.cycles&&t.cycles,o=t.replacer||function(e,t){return t},s=t.cmp&&(r=t.cmp,function(e){return function(t,n){var i={key:t,value:e[t]},o={key:n,value:e[n]};return r(i,o)}}),a=[];return function e(t,r,l,c){var h=n?"\n"+new Array(c+1).join(n):"",u=n?": ":":";if(l&&l.toJSON&&"function"==typeof l.toJSON&&(l=l.toJSON()),void 0!==(l=o.call(t,r,l))){if("object"!=typeof l||null===l)return JSON.stringify(l);if(F(l)){for(var f=[],d=0;d{let t={},n=(e,t,{argumentTests:n=[],minArgs:r=!1,variadic:i=null,needsContext:o=!1,invoke:s})=>(t[e]=(...t)=>{let a=t.shift();if(!i&&t.lengthi))),t.forEach(((t,r)=>{if(!n[r].split("|").some((e=>Z[e](t))))throw Y(`builtin: ${e}`,n[r])})),o?s(a,...t):s(...t)},t[e].jsone_builtin=!0,t[e]);return["max","min"].forEach((e=>{if(null==Math[e])throw new Error(`${e} in Math undefined`);n(e,t,{minArgs:1,variadic:"number",invoke:(...t)=>Math[e](...t)})})),["sqrt","ceil","floor","abs"].forEach((e=>{if(null==Math[e])throw new Error(`${e} in Math undefined`);n(e,t,{argumentTests:["number"],invoke:t=>Math[e](t)})})),n("lowercase",t,{argumentTests:["string"],invoke:e=>e.toLowerCase()}),n("uppercase",t,{argumentTests:["string"],invoke:e=>e.toUpperCase()}),n("str",t,{argumentTests:["string|number|boolean|null"],invoke:e=>null===e?"null":e.toString()}),n("number",t,{argumentTests:["string"],invoke:Number}),n("len",t,{argumentTests:["string|array"],invoke:e=>Array.from(e).length}),n("strip",t,{argumentTests:["string"],invoke:e=>e.trim()}),n("rstrip",t,{argumentTests:["string"],invoke:e=>e.replace(/\s+$/,"")}),n("lstrip",t,{argumentTests:["string"],invoke:e=>e.replace(/^\s+/,"")}),n("split",t,{minArgs:1,variadic:"string|number",invoke:(e,t)=>e.split(t)}),n("join",t,{argumentTests:["array","string|number"],invoke:(e,t)=>e.join(t)}),n("fromNow",t,{variadic:"string",minArgs:1,needsContext:!0,invoke:(e,t,n)=>q(t,n||e.now)}),n("typeof",t,{argumentTests:["string|number|boolean|array|object|null|function"],invoke:e=>{for(let t of["string","number","boolean","array","object","function"])if(Z[t](e))return t;if(Z.null(e))return"null";throw Y("builtin: typeof")}}),n("defined",t,{argumentTests:["string"],needsContext:!0,invoke:(e,t)=>e.hasOwnProperty(t)}),Object.assign({},t,e)},{JSONTemplateError:fe,TemplateError:de,SyntaxError:pe}=s;let me=e=>new pe(`Found: ${e.value} token, expected one of: !=, &&, (, *, **, +, -, ., /, <, <=, ==, >, >=, [, in, ||`);function ge(e,t){var n="",r=new RegExp(t.join("|")+"$");for(var i of Object.keys(e).sort())r.test(i)||(n+=" "+i);if(n)throw new de(t[0].replace("\\","")+" has undefined properties:"+n)}let ve=e=>Array.isArray(e)?[].concat(...e.map(ve)):e,ye=(e,t)=>{let n,r="",i=e;for(;-1!==(n=i.search(/\$?\${/g));)if(r+=i.slice(0,n),"$"!=i[n+1]){let e=Ae(i.slice(n+2),"}",t);if(ae(e.result)||le(e.result)){let t=i.slice(n+2,n+e.offset);throw new de(`interpolation of '${t}' produced an array or object`)}null===e.result?r+="":r+=e.result.toString(),i=i.slice(n+e.offset+1)}else r+="${",i=i.slice(n+3);return r+=i,r},be={},we={$eval:(e,t)=>{if(ge(e,["\\$eval"]),!ie(e.$eval))throw new de("$eval must be given a string expression");return Se(e.$eval,t)},$flatten:(e,t)=>{ge(e,["\\$flatten"]);let n=xe(e.$flatten,t);if(!ae(n))throw new de("$flatten value must evaluate to an array");return n.reduce(((e,t)=>e.concat(t)),[])},$flattenDeep:(e,t)=>{ge(e,["\\$flattenDeep"]);let n=xe(e.$flattenDeep,t);if(!ae(n))throw new de("$flattenDeep value must evaluate to an array");return ve(n)},$fromNow:(e,t)=>{ge(e,["\\$fromNow","from"]);let n=xe(e.$fromNow,t),r=t.now;if(e.from&&(r=xe(e.from,t)),!ie(n))throw new de("$fromNow expects a string");return ne(n,r)},$if:(e,t)=>{if(ge(e,["\\$if","then","else"]),!ie(e.$if))throw new de("$if can evaluate string expressions only");if(ce(Se(e.$if,t))){if(e.hasOwnProperty("$then"))throw new de("$if Syntax error: $then: should be spelled then: (no $)");return e.hasOwnProperty("then")?xe(e.then,t):be}return e.hasOwnProperty("else")?xe(e.else,t):be},$json:(e,t)=>{ge(e,["\\$json"]);const n=xe(e.$json,t);if(Ce(n))throw new de("evaluated template contained uncalled functions");return re(n)},$let:(e,t)=>{if(ge(e,["\\$let","in"]),!le(e.$let))throw new de("$let value must be an object");let n={},r=xe(e.$let,t);if(!le(r))throw new de("$let value must be an object");Object.keys(r).forEach((e=>{if(!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e))throw new de("top level keys of $let must follow /[a-zA-Z_][a-zA-Z0-9_]*/");n[e]=r[e]}));var i=Object.assign(t,n);if(null==e.in)throw new de("$let operator requires an `in` clause");return xe(e.in,i)},$map:(e,t)=>{ge(e,["\\$map","each\\(([a-zA-Z_][a-zA-Z0-9_]*)(,\\s*([a-zA-Z_][a-zA-Z0-9_]*))?\\)"]);let n=xe(e.$map,t);if(!ae(n)&&!le(n))throw new de("$map value must evaluate to an array or object");if(2!==Object.keys(e).length)throw new de("$map must have exactly two properties");let r=Object.keys(e).filter((e=>"$map"!==e))[0],i=/^each\(([a-zA-Z_][a-zA-Z0-9_]*)(,\s*([a-zA-Z_][a-zA-Z0-9_]*))?\)$/.exec(r);if(!i)throw new de("$map requires each(identifier) syntax");let o=i[1],s=i[3],a=e[r];if(le(n)){let e;return n=Object.keys(n).map((e=>({key:e,val:n[e]}))),n=n.map((n=>{let r=void 0!==s?{[o]:n.val,[s]:n.key}:{[o]:n};if(e=xe(a,Object.assign({},t,r)),!le(e))throw new de(`$map on objects expects each(${o}) to evaluate to an object`);return e})).filter((e=>e!==be)),Object.assign({},...n)}return n.map(((e,n)=>{let r=void 0!==s?{[o]:e,[s]:n}:{[o]:e};return xe(a,Object.assign({},t,r))})).filter((e=>e!==be))},$match:(e,t)=>{if(ge(e,["\\$match"]),!le(e.$match))throw new de("$match can evaluate objects only");const n=[],r=e.$match;for(let e of Object.keys(r).sort())ce(Se(e,t))&&n.push(xe(r[e],t));return n},$switch:(e,t)=>{if(ge(e,["\\$switch"]),!le(e.$switch))throw new de("$switch can evaluate objects only");let n=[];const r=e.$switch;for(let e of Object.keys(r).filter((e=>"$default"!==e)).sort())ce(Se(e,t))&&n.push(xe(r[e],t));if(n.length>1)throw new de("$switch can only have one truthy condition");return 0===n.length&&r.$default&&n.push(xe(r.$default,t)),n.length>0?n[0]:be},$merge:(e,t)=>{ge(e,["\\$merge"]);let n=xe(e.$merge,t);if(!ae(n)||n.some((e=>!le(e))))throw new de("$merge value must evaluate to an array of objects");return Object.assign({},...n)},$mergeDeep:(e,t)=>{ge(e,["\\$mergeDeep"]);let n=xe(e.$mergeDeep,t);if(!ae(n)||n.some((e=>!le(e))))throw new de("$mergeDeep value must evaluate to an array of objects");if(0===n.length)return{};let r=(e,t)=>{if(ae(e)&&ae(t))return e.concat(t);if(le(e)&&le(t)){let n=Object.assign({},e);for(let i in t)n[i]=i in e?r(e[i],t[i]):t[i];return n}return t};return n.reduce(r,n.shift())},$reverse:(e,t)=>{ge(e,["\\$reverse"]);let n=xe(e.$reverse,t);if(!ae(n))throw new de("$reverse value must evaluate to an array of objects");return n.reverse()},$sort:(e,t)=>{ge(e,["\\$sort","by\\(([a-zA-Z_][a-zA-Z0-9_]*)\\)"]);let n=xe(e.$sort,t);if(!ae(n))throw new de("$sorted values to be sorted must have the same type");let r,i=Object.keys(e).filter((e=>"$sort"!==e))[0],o=/^by\(([a-zA-Z_][a-zA-Z0-9_]*)\)$/.exec(i);if(o){let n=Object.assign({},t),s=o[1],a=e[i];r=e=>(n[s]=e,Se(a,n))}else{if(n.some((e=>ae(e)||le(e))))throw new de("$sorted values to be sorted must have the same type");r=e=>e}let s=n.map((e=>[r(e),e]));if(s.length>0){let e=typeof s[0][0];if("number"!==e&&"string"!==e||s.some((t=>e!==typeof t[0])))throw new de("$sorted values to be sorted must have the same type")}return s.sort(((e,t)=>(e=e[0])<(t=t[0])?-1:e>t?1:0)).map((e=>e[1]))}},xe=(e,t)=>{if(oe(e)||se(e)||null===e)return e;if(ie(e))return ye(e,t);if(ae(e))return e.map(((e,n)=>{try{return xe(e,t)}catch(e){throw e instanceof fe&&e.add_location(`[${n}]`),e}})).filter((e=>e!==be));let n=Object.keys(we).filter((t=>e.hasOwnProperty(t)));if(n.length>1)throw new de("only one operator allowed");if(1===n.length)return we[n[0]](e,t);let r={};for(let n of Object.keys(e)){let i;try{i=xe(e[n],t)}catch(e){throw e instanceof fe&&(/^[a-zA-Z][a-zA-Z0-9]*$/.test(n)?e.add_location(`.${n}`):e.add_location(`[${JSON.stringify(n)}]`)),e}if(i!==be){if(n.startsWith("$$"))n=n.substr(1);else{if(/^\$[a-zA-Z][a-zA-Z0-9]*$/.test(n))throw new de("$ is reserved; use $$");n=ye(n,t)}r[n]=i}}return r},ke=new ee({ignore:"\\s+",patterns:{number:"[0-9]+(?:\\.[0-9]+)?",identifier:"[a-zA-Z_][a-zA-Z_0-9]*",string:"'[^']*'|\"[^\"]*\"",true:"true(?![a-zA-Z_0-9])",false:"false(?![a-zA-Z_0-9])",in:"in(?![a-zA-Z_0-9])",null:"null(?![a-zA-Z_0-9])"},tokens:["**",..."+-*/[].(){}:,".split(""),">=","<=","<",">","==","!=","!","&&","||","true","false","in","null","number","identifier","string"]}),Se=(e,t)=>{let n=new X(ke,e),r=n.parse();if(null!=n.current_token)throw me(n.current_token);return new te(t).interpret(r)},Ae=(e,t,n)=>{let r=new X(ke,e),i=r.parse(),o=r.current_token;if(!o){let n=e.length;throw new pe(`Found end of string, expected ${t}`,{start:n,end:n})}if(o.kind!==t)throw me(o);return{result:new te(n).interpret(i),offset:o.start+2}},Ce=e=>{if(he(e))return!0;if(Array.isArray(e))return e.some(Ce);if("object"==typeof e&&null!==e){for(const t of Object.keys(e))if(Ce(e[t]))return!0;return!1}return!1};return(e,t={})=>{if("object"!=typeof t)throw new de("context must be an object");if(!Object.keys(t).every((e=>/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e))))throw new de("top level keys of context must follow /[a-zA-Z_][a-zA-Z0-9_]*/");t=ue(Object.assign({},{now:ne("0 seconds")},t));let n=xe(e,t);if(n===be)return null;if(Ce(n))throw new de("evaluated template contained uncalled functions");return n}}()},3565:e=>{e.exports=function(e,t){return function n(){null==t&&(t=e.length);var r=[].slice.call(arguments);return r.length>=t?e.apply(this,r):function(){return n.apply(this,r.concat([].slice.call(arguments)))}}}},6486:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",l=32,c=128,h=1/0,u=9007199254740991,f=NaN,d=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",l],["partialRight",64],["rearg",256]],m="[object Arguments]",g="[object Array]",v="[object Boolean]",y="[object Date]",b="[object Error]",w="[object Function]",x="[object GeneratorFunction]",k="[object Map]",S="[object Number]",A="[object Object]",C="[object Promise]",O="[object RegExp]",E="[object Set]",j="[object String]",M="[object Symbol]",I="[object WeakMap]",T="[object ArrayBuffer]",$="[object DataView]",_="[object Float32Array]",P="[object Float64Array]",D="[object Int8Array]",R="[object Int16Array]",N="[object Int32Array]",B="[object Uint8Array]",L="[object Uint8ClampedArray]",F="[object Uint16Array]",V="[object Uint32Array]",z=/\b__p \+= '';/g,q=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,U=/[&<>"']/g,J=RegExp(W.source),K=RegExp(U.source),G=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,Y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,X=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),re=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,le=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fe=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,ve=/^(?:0|[1-9]\d*)$/,ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,be=/($^)/,we=/['\n\r\u2028\u2029\\]/g,xe="\\ud800-\\udfff",ke="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="\\u2700-\\u27bf",Ae="a-z\\xdf-\\xf6\\xf8-\\xff",Ce="A-Z\\xc0-\\xd6\\xd8-\\xde",Oe="\\ufe0e\\ufe0f",Ee="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",je="["+xe+"]",Me="["+Ee+"]",Ie="["+ke+"]",Te="\\d+",$e="["+Se+"]",_e="["+Ae+"]",Pe="[^"+xe+Ee+Te+Se+Ae+Ce+"]",De="\\ud83c[\\udffb-\\udfff]",Re="[^"+xe+"]",Ne="(?:\\ud83c[\\udde6-\\uddff]){2}",Be="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+Ce+"]",Fe="\\u200d",Ve="(?:"+_e+"|"+Pe+")",ze="(?:"+Le+"|"+Pe+")",qe="(?:['’](?:d|ll|m|re|s|t|ve))?",He="(?:['’](?:D|LL|M|RE|S|T|VE))?",We="(?:"+Ie+"|"+De+")?",Ue="["+Oe+"]?",Je=Ue+We+"(?:"+Fe+"(?:"+[Re,Ne,Be].join("|")+")"+Ue+We+")*",Ke="(?:"+[$e,Ne,Be].join("|")+")"+Je,Ge="(?:"+[Re+Ie+"?",Ie,Ne,Be,je].join("|")+")",Qe=RegExp("['’]","g"),Ze=RegExp(Ie,"g"),Ye=RegExp(De+"(?="+De+")|"+Ge+Je,"g"),Xe=RegExp([Le+"?"+_e+"+"+qe+"(?="+[Me,Le,"$"].join("|")+")",ze+"+"+He+"(?="+[Me,Le+Ve,"$"].join("|")+")",Le+"?"+Ve+"+"+qe,Le+"+"+He,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Te,Ke].join("|"),"g"),et=RegExp("["+Fe+xe+ke+Oe+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,it={};it[_]=it[P]=it[D]=it[R]=it[N]=it[B]=it[L]=it[F]=it[V]=!0,it[m]=it[g]=it[T]=it[v]=it[$]=it[y]=it[b]=it[w]=it[k]=it[S]=it[A]=it[O]=it[E]=it[j]=it[I]=!1;var ot={};ot[m]=ot[g]=ot[T]=ot[$]=ot[v]=ot[y]=ot[_]=ot[P]=ot[D]=ot[R]=ot[N]=ot[k]=ot[S]=ot[A]=ot[O]=ot[E]=ot[j]=ot[M]=ot[B]=ot[L]=ot[F]=ot[V]=!0,ot[b]=ot[w]=ot[I]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,lt=parseInt,ct="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ht="object"==typeof self&&self&&self.Object===Object&&self,ut=ct||ht||Function("return this")(),ft=t&&!t.nodeType&&t,dt=ft&&e&&!e.nodeType&&e,pt=dt&&dt.exports===ft,mt=pt&&ct.process,gt=function(){try{return dt&&dt.require&&dt.require("util").types||mt&&mt.binding&&mt.binding("util")}catch(e){}}(),vt=gt&>.isArrayBuffer,yt=gt&>.isDate,bt=gt&>.isMap,wt=gt&>.isRegExp,xt=gt&>.isSet,kt=gt&>.isTypedArray;function St(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 At(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function It(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function Xt(e,t){for(var n=e.length;n--&&Lt(t,e[n],0)>-1;);return n}var en=Ht({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tn=Ht({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(e){return"\\"+st[e]}function rn(e){return et.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function sn(e,t){return function(n){return e(t(n))}}function an(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"}),pn=function e(t){var n,r=(t=null==t?ut:pn.defaults(ut.Object(),t,pn.pick(ut,nt))).Array,ie=t.Date,xe=t.Error,ke=t.Function,Se=t.Math,Ae=t.Object,Ce=t.RegExp,Oe=t.String,Ee=t.TypeError,je=r.prototype,Me=ke.prototype,Ie=Ae.prototype,Te=t["__core-js_shared__"],$e=Me.toString,_e=Ie.hasOwnProperty,Pe=0,De=(n=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Re=Ie.toString,Ne=$e.call(Ae),Be=ut._,Le=Ce("^"+$e.call(_e).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fe=pt?t.Buffer:i,Ve=t.Symbol,ze=t.Uint8Array,qe=Fe?Fe.allocUnsafe:i,He=sn(Ae.getPrototypeOf,Ae),We=Ae.create,Ue=Ie.propertyIsEnumerable,Je=je.splice,Ke=Ve?Ve.isConcatSpreadable:i,Ge=Ve?Ve.iterator:i,Ye=Ve?Ve.toStringTag:i,et=function(){try{var e=lo(Ae,"defineProperty");return e({},"",{}),e}catch(e){}}(),st=t.clearTimeout!==ut.clearTimeout&&t.clearTimeout,ct=ie&&ie.now!==ut.Date.now&&ie.now,ht=t.setTimeout!==ut.setTimeout&&t.setTimeout,ft=Se.ceil,dt=Se.floor,mt=Ae.getOwnPropertySymbols,gt=Fe?Fe.isBuffer:i,Rt=t.isFinite,Ht=je.join,mn=sn(Ae.keys,Ae),gn=Se.max,vn=Se.min,yn=ie.now,bn=t.parseInt,wn=Se.random,xn=je.reverse,kn=lo(t,"DataView"),Sn=lo(t,"Map"),An=lo(t,"Promise"),Cn=lo(t,"Set"),On=lo(t,"WeakMap"),En=lo(Ae,"create"),jn=On&&new On,Mn={},In=No(kn),Tn=No(Sn),$n=No(An),_n=No(Cn),Pn=No(On),Dn=Ve?Ve.prototype:i,Rn=Dn?Dn.valueOf:i,Nn=Dn?Dn.toString:i;function Bn(e){if(ea(e)&&!qs(e)&&!(e instanceof zn)){if(e instanceof Vn)return e;if(_e.call(e,"__wrapped__"))return Bo(e)}return new Vn(e)}var Ln=function(){function e(){}return function(t){if(!Xs(t))return{};if(We)return We(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Fn(){}function Vn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function zn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function sr(e,t,n,r,o,s){var a,l=1&t,c=2&t,h=4&t;if(n&&(a=o?n(e,r,o,s):n(e)),a!==i)return a;if(!Xs(e))return e;var u=qs(e);if(u){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&_e.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!l)return Oi(e,a)}else{var f=uo(e),d=f==w||f==x;if(Js(e))return wi(e,l);if(f==A||f==m||d&&!o){if(a=c||d?{}:po(e),!l)return c?function(e,t){return Ei(e,ho(e),t)}(e,function(e,t){return e&&Ei(t,Ta(t),e)}(a,e)):function(e,t){return Ei(e,co(e),t)}(e,nr(a,e))}else{if(!ot[f])return o?e:{};a=function(e,t,n){var r,i=e.constructor;switch(t){case T:return xi(e);case v:case y:return new i(+e);case $:return function(e,t){var n=t?xi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case _:case P:case D:case R:case N:case B:case L:case F:case V:return ki(e,n);case k:return new i;case S:case j:return new i(e);case O:return function(e){var t=new e.constructor(e.source,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new i;case M:return r=e,Rn?Ae(Rn.call(r)):{}}}(e,f,l)}}s||(s=new Jn);var p=s.get(e);if(p)return p;s.set(e,a),oa(e)?e.forEach((function(r){a.add(sr(r,t,n,r,e,s))})):ta(e)&&e.forEach((function(r,i){a.set(i,sr(r,t,n,i,e,s))}));var g=u?i:(h?c?to:eo:c?Ta:Ia)(e);return Ct(g||e,(function(r,i){g&&(r=e[i=r]),Xn(a,i,sr(r,t,n,i,e,s))})),a}function ar(e,t,n){var r=n.length;if(null==e)return!r;for(e=Ae(e);r--;){var o=n[r],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function lr(e,t,n){if("function"!=typeof e)throw new Ee(o);return jo((function(){e.apply(i,n)}),t)}function cr(e,t,n,r){var i=-1,o=Mt,s=!0,a=e.length,l=[],c=t.length;if(!a)return l;n&&(t=Tt(t,Gt(n))),r?(o=It,s=!1):t.length>=200&&(o=Zt,s=!1,t=new Un(t));e:for(;++i-1},Hn.prototype.set=function(e,t){var n=this.__data__,r=er(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Wn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(Sn||Hn),string:new qn}},Wn.prototype.delete=function(e){var t=so(this,e).delete(e);return this.size-=t?1:0,t},Wn.prototype.get=function(e){return so(this,e).get(e)},Wn.prototype.has=function(e){return so(this,e).has(e)},Wn.prototype.set=function(e,t){var n=so(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Un.prototype.add=Un.prototype.push=function(e){return this.__data__.set(e,s),this},Un.prototype.has=function(e){return this.__data__.has(e)},Jn.prototype.clear=function(){this.__data__=new Hn,this.size=0},Jn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Jn.prototype.get=function(e){return this.__data__.get(e)},Jn.prototype.has=function(e){return this.__data__.has(e)},Jn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Hn){var r=n.__data__;if(!Sn||r.length<199)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};var hr=Ii(yr),ur=Ii(br,!0);function fr(e,t){var n=!0;return hr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function dr(e,t,n){for(var r=-1,o=e.length;++r0&&n(a)?t>1?mr(a,t-1,n,r,i):$t(i,a):r||(i[i.length]=a)}return i}var gr=Ti(),vr=Ti(!0);function yr(e,t){return e&&gr(e,t,Ia)}function br(e,t){return e&&vr(e,t,Ia)}function wr(e,t){return jt(t,(function(t){return Qs(e[t])}))}function xr(e,t){for(var n=0,r=(t=gi(t,e)).length;null!=e&&nt}function Cr(e,t){return null!=e&&_e.call(e,t)}function Or(e,t){return null!=e&&t in Ae(e)}function Er(e,t,n){for(var o=n?It:Mt,s=e[0].length,a=e.length,l=a,c=r(a),h=1/0,u=[];l--;){var f=e[l];l&&t&&(f=Tt(f,Gt(t))),h=vn(f.length,h),c[l]=!n&&(t||s>=120&&f.length>=120)?new Un(l&&f):i}f=e[0];var d=-1,p=c[0];e:for(;++d=a?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}));r--;)e[r]=e[r].value;return e}(i)}function zr(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)a!==e&&Je.call(a,l,1),Je.call(e,l,1);return e}function Hr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;go(i)?Je.call(e,i,1):li(e,i)}}return e}function Wr(e,t){return e+dt(wn()*(t-e+1))}function Ur(e,t){var n="";if(!e||t<1||t>u)return n;do{t%2&&(n+=e),(t=dt(t/2))&&(e+=e)}while(t);return n}function Jr(e,t){return Mo(Ao(e,t,nl),e+"")}function Kr(e){return Gn(La(e))}function Gr(e,t){var n=La(e);return $o(n,or(t,0,n.length))}function Qr(e,t,n,r){if(!Xs(e))return e;for(var o=-1,s=(t=gi(t,e)).length,a=s-1,l=e;null!=l&&++oo?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=r(o);++i>>1,s=e[o];null!==s&&!aa(s)&&(n?s<=t:s=200){var c=t?null:Ui(e);if(c)return ln(c);s=!1,i=Zt,l=new Un}else l=t?[]:a;e:for(;++r=r?e:ei(e,t,n)}var bi=st||function(e){return ut.clearTimeout(e)};function wi(e,t){if(t)return e.slice();var n=e.length,r=qe?qe(n):new e.constructor(n);return e.copy(r),r}function xi(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function ki(e,t){var n=t?xi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Si(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,s=aa(e),a=t!==i,l=null===t,c=t==t,h=aa(t);if(!l&&!h&&!s&&e>t||s&&a&&c&&!l&&!h||r&&a&&c||!n&&c||!o)return 1;if(!r&&!s&&!h&&e1?n[o-1]:i,a=o>2?n[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&vo(n[0],n[1],a)&&(s=o<3?i:s,o=1),t=Ae(t);++r-1?o[s?t[a]:a]:i}}function Ri(e){return Xi((function(t){var n=t.length,r=n,s=Vn.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new Ee(o);if(s&&!l&&"wrapper"==ro(a))var l=new Vn([],!0)}for(r=l?r:n;++r1&&w.reverse(),d&&ul))return!1;var h=s.get(e),u=s.get(t);if(h&&u)return h==t&&u==e;var f=-1,d=!0,p=2&n?new Un:i;for(s.set(e,t),s.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Ct(p,(function(n){var r="_."+n[0];t&n[1]&&!Mt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ae):[]}(r),n)))}function To(e){var t=0,n=0;return function(){var r=yn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function $o(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,is(e,n)}));function us(e){var t=Bn(e);return t.__chain__=!0,t}function fs(e,t){return t(e)}var ds=Xi((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return ir(t,e)};return!(t>1||this.__actions__.length)&&r instanceof zn&&go(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:fs,args:[o],thisArg:i}),new Vn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),ps=ji((function(e,t,n){_e.call(e,n)?++e[n]:rr(e,n,1)})),ms=Di(zo),gs=Di(qo);function vs(e,t){return(qs(e)?Ct:hr)(e,oo(t,3))}function ys(e,t){return(qs(e)?Ot:ur)(e,oo(t,3))}var bs=ji((function(e,t,n){_e.call(e,n)?e[n].push(t):rr(e,n,[t])})),ws=Jr((function(e,t,n){var i=-1,o="function"==typeof t,s=Ws(e)?r(e.length):[];return hr(e,(function(e){s[++i]=o?St(t,e,n):jr(e,t,n)})),s})),xs=ji((function(e,t,n){rr(e,n,t)}));function ks(e,t){return(qs(e)?Tt:Rr)(e,oo(t,3))}var Ss=ji((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]})),As=Jr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&vo(e,t[0],t[1])?t=[]:n>2&&vo(t[0],t[1],t[2])&&(t=[t[0]]),Vr(e,mr(t,1),[])})),Cs=ct||function(){return ut.Date.now()};function Os(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Ki(e,c,i,i,i,i,t)}function Es(e,t){var n;if("function"!=typeof t)throw new Ee(o);return e=da(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var js=Jr((function(e,t,n){var r=1;if(n.length){var i=an(n,io(js));r|=l}return Ki(e,r,t,n,i)})),Ms=Jr((function(e,t,n){var r=3;if(n.length){var i=an(n,io(Ms));r|=l}return Ki(t,r,e,n,i)}));function Is(e,t,n){var r,s,a,l,c,h,u=0,f=!1,d=!1,p=!0;if("function"!=typeof e)throw new Ee(o);function m(t){var n=r,o=s;return r=s=i,u=t,l=e.apply(o,n)}function g(e){var n=e-h;return h===i||n>=t||n<0||d&&e-u>=a}function v(){var e=Cs();if(g(e))return y(e);c=jo(v,function(e){var n=t-(e-h);return d?vn(n,a-(e-u)):n}(e))}function y(e){return c=i,p&&r?m(e):(r=s=i,l)}function b(){var e=Cs(),n=g(e);if(r=arguments,s=this,h=e,n){if(c===i)return function(e){return u=e,c=jo(v,t),f?m(e):l}(h);if(d)return bi(c),c=jo(v,t),m(h)}return c===i&&(c=jo(v,t)),l}return t=ma(t)||0,Xs(n)&&(f=!!n.leading,a=(d="maxWait"in n)?gn(ma(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),b.cancel=function(){c!==i&&bi(c),u=0,r=h=s=c=i},b.flush=function(){return c===i?l:y(Cs())},b}var Ts=Jr((function(e,t){return lr(e,1,t)})),$s=Jr((function(e,t,n){return lr(e,ma(t)||0,n)}));function _s(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(_s.Cache||Wn),n}function Ps(e){if("function"!=typeof e)throw new Ee(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}_s.Cache=Wn;var Ds=vi((function(e,t){var n=(t=1==t.length&&qs(t[0])?Tt(t[0],Gt(oo())):Tt(mr(t,1),Gt(oo()))).length;return Jr((function(r){for(var i=-1,o=vn(r.length,n);++i=t})),zs=Mr(function(){return arguments}())?Mr:function(e){return ea(e)&&_e.call(e,"callee")&&!Ue.call(e,"callee")},qs=r.isArray,Hs=vt?Gt(vt):function(e){return ea(e)&&Sr(e)==T};function Ws(e){return null!=e&&Ys(e.length)&&!Qs(e)}function Us(e){return ea(e)&&Ws(e)}var Js=gt||ml,Ks=yt?Gt(yt):function(e){return ea(e)&&Sr(e)==y};function Gs(e){if(!ea(e))return!1;var t=Sr(e);return t==b||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ra(e)}function Qs(e){if(!Xs(e))return!1;var t=Sr(e);return t==w||t==x||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Zs(e){return"number"==typeof e&&e==da(e)}function Ys(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function Xs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ea(e){return null!=e&&"object"==typeof e}var ta=bt?Gt(bt):function(e){return ea(e)&&uo(e)==k};function na(e){return"number"==typeof e||ea(e)&&Sr(e)==S}function ra(e){if(!ea(e)||Sr(e)!=A)return!1;var t=He(e);if(null===t)return!0;var n=_e.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&$e.call(n)==Ne}var ia=wt?Gt(wt):function(e){return ea(e)&&Sr(e)==O},oa=xt?Gt(xt):function(e){return ea(e)&&uo(e)==E};function sa(e){return"string"==typeof e||!qs(e)&&ea(e)&&Sr(e)==j}function aa(e){return"symbol"==typeof e||ea(e)&&Sr(e)==M}var la=kt?Gt(kt):function(e){return ea(e)&&Ys(e.length)&&!!it[Sr(e)]},ca=qi(Dr),ha=qi((function(e,t){return e<=t}));function ua(e){if(!e)return[];if(Ws(e))return sa(e)?un(e):Oi(e);if(Ge&&e[Ge])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Ge]());var t=uo(e);return(t==k?on:t==E?ln:La)(e)}function fa(e){return e?(e=ma(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function da(e){var t=fa(e),n=t%1;return t==t?n?t-n:t:0}function pa(e){return e?or(da(e),0,d):0}function ma(e){if("number"==typeof e)return e;if(aa(e))return f;if(Xs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Xs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Kt(e);var n=pe.test(e);return n||ge.test(e)?lt(e.slice(2),n?2:8):de.test(e)?f:+e}function ga(e){return Ei(e,Ta(e))}function va(e){return null==e?"":si(e)}var ya=Mi((function(e,t){if(xo(t)||Ws(t))Ei(t,Ia(t),e);else for(var n in t)_e.call(t,n)&&Xn(e,n,t[n])})),ba=Mi((function(e,t){Ei(t,Ta(t),e)})),wa=Mi((function(e,t,n,r){Ei(t,Ta(t),e,r)})),xa=Mi((function(e,t,n,r){Ei(t,Ia(t),e,r)})),ka=Xi(ir),Sa=Jr((function(e,t){e=Ae(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&vo(t[0],t[1],o)&&(r=1);++n1),t})),Ei(e,to(e),n),r&&(n=sr(n,7,Zi));for(var i=t.length;i--;)li(n,t[i]);return n})),Da=Xi((function(e,t){return null==e?{}:function(e,t){return zr(e,t,(function(t,n){return Oa(e,n)}))}(e,t)}));function Ra(e,t){if(null==e)return{};var n=Tt(to(e),(function(e){return[e]}));return t=oo(t),zr(e,n,(function(e,n){return t(e,n[0])}))}var Na=Ji(Ia),Ba=Ji(Ta);function La(e){return null==e?[]:Qt(e,Ia(e))}var Fa=_i((function(e,t,n){return t=t.toLowerCase(),e+(n?Va(t):t)}));function Va(e){return Ga(va(e).toLowerCase())}function za(e){return(e=va(e))&&e.replace(ye,en).replace(Ze,"")}var qa=_i((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ha=_i((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Wa=$i("toLowerCase"),Ua=_i((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()})),Ja=_i((function(e,t,n){return e+(n?" ":"")+Ga(t)})),Ka=_i((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Ga=$i("toUpperCase");function Qa(e,t,n){return e=va(e),(t=n?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match(Xe)||[]}(e):function(e){return e.match(le)||[]}(e):e.match(t)||[]}var Za=Jr((function(e,t){try{return St(e,i,t)}catch(e){return Gs(e)?e:new xe(e)}})),Ya=Xi((function(e,t){return Ct(t,(function(t){t=Ro(t),rr(e,t,js(e[t],e))})),e}));function Xa(e){return function(){return e}}var el=Ri(),tl=Ri(!0);function nl(e){return e}function rl(e){return _r("function"==typeof e?e:sr(e,1))}var il=Jr((function(e,t){return function(n){return jr(n,e,t)}})),ol=Jr((function(e,t){return function(n){return jr(e,n,t)}}));function sl(e,t,n){var r=Ia(t),i=wr(t,r);null!=n||Xs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=wr(t,Ia(t)));var o=!(Xs(n)&&"chain"in n&&!n.chain),s=Qs(e);return Ct(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=Oi(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,$t([this.value()],arguments))})})),e}function al(){}var ll=Fi(Tt),cl=Fi(Et),hl=Fi(Dt);function ul(e){return yo(e)?qt(Ro(e)):function(e){return function(t){return xr(t,e)}}(e)}var fl=zi(),dl=zi(!0);function pl(){return[]}function ml(){return!1}var gl,vl=Li((function(e,t){return e+t}),0),yl=Wi("ceil"),bl=Li((function(e,t){return e/t}),1),wl=Wi("floor"),xl=Li((function(e,t){return e*t}),1),kl=Wi("round"),Sl=Li((function(e,t){return e-t}),0);return Bn.after=function(e,t){if("function"!=typeof t)throw new Ee(o);return e=da(e),function(){if(--e<1)return t.apply(this,arguments)}},Bn.ary=Os,Bn.assign=ya,Bn.assignIn=ba,Bn.assignInWith=wa,Bn.assignWith=xa,Bn.at=ka,Bn.before=Es,Bn.bind=js,Bn.bindAll=Ya,Bn.bindKey=Ms,Bn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return qs(e)?e:[e]},Bn.chain=us,Bn.chunk=function(e,t,n){t=(n?vo(e,t,n):t===i)?1:gn(da(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,l=r(ft(o/t));so?0:o+n),(r=r===i||r>o?o:da(r))<0&&(r+=o),r=n>r?0:pa(r);n>>0)?(e=va(e))&&("string"==typeof t||null!=t&&!ia(t))&&!(t=si(t))&&rn(e)?yi(un(e),0,n):e.split(t,n):[]},Bn.spread=function(e,t){if("function"!=typeof e)throw new Ee(o);return t=null==t?0:gn(da(t),0),Jr((function(n){var r=n[t],i=yi(n,0,t);return r&&$t(i,r),St(e,this,i)}))},Bn.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},Bn.take=function(e,t,n){return e&&e.length?ei(e,0,(t=n||t===i?1:da(t))<0?0:t):[]},Bn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,(t=r-(t=n||t===i?1:da(t)))<0?0:t,r):[]},Bn.takeRightWhile=function(e,t){return e&&e.length?hi(e,oo(t,3),!1,!0):[]},Bn.takeWhile=function(e,t){return e&&e.length?hi(e,oo(t,3)):[]},Bn.tap=function(e,t){return t(e),e},Bn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Ee(o);return Xs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Is(e,t,{leading:r,maxWait:t,trailing:i})},Bn.thru=fs,Bn.toArray=ua,Bn.toPairs=Na,Bn.toPairsIn=Ba,Bn.toPath=function(e){return qs(e)?Tt(e,Ro):aa(e)?[e]:Oi(Do(va(e)))},Bn.toPlainObject=ga,Bn.transform=function(e,t,n){var r=qs(e),i=r||Js(e)||la(e);if(t=oo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Xs(e)&&Qs(o)?Ln(He(e)):{}}return(i?Ct:yr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Bn.unary=function(e){return Os(e,1)},Bn.union=es,Bn.unionBy=ts,Bn.unionWith=ns,Bn.uniq=function(e){return e&&e.length?ai(e):[]},Bn.uniqBy=function(e,t){return e&&e.length?ai(e,oo(t,2)):[]},Bn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ai(e,i,t):[]},Bn.unset=function(e,t){return null==e||li(e,t)},Bn.unzip=rs,Bn.unzipWith=is,Bn.update=function(e,t,n){return null==e?e:ci(e,t,mi(n))},Bn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:ci(e,t,mi(n),r)},Bn.values=La,Bn.valuesIn=function(e){return null==e?[]:Qt(e,Ta(e))},Bn.without=os,Bn.words=Qa,Bn.wrap=function(e,t){return Rs(mi(t),e)},Bn.xor=ss,Bn.xorBy=as,Bn.xorWith=ls,Bn.zip=cs,Bn.zipObject=function(e,t){return di(e||[],t||[],Xn)},Bn.zipObjectDeep=function(e,t){return di(e||[],t||[],Qr)},Bn.zipWith=hs,Bn.entries=Na,Bn.entriesIn=Ba,Bn.extend=ba,Bn.extendWith=wa,sl(Bn,Bn),Bn.add=vl,Bn.attempt=Za,Bn.camelCase=Fa,Bn.capitalize=Va,Bn.ceil=yl,Bn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=ma(n))==n?n:0),t!==i&&(t=(t=ma(t))==t?t:0),or(ma(e),t,n)},Bn.clone=function(e){return sr(e,4)},Bn.cloneDeep=function(e){return sr(e,5)},Bn.cloneDeepWith=function(e,t){return sr(e,5,t="function"==typeof t?t:i)},Bn.cloneWith=function(e,t){return sr(e,4,t="function"==typeof t?t:i)},Bn.conformsTo=function(e,t){return null==t||ar(e,t,Ia(t))},Bn.deburr=za,Bn.defaultTo=function(e,t){return null==e||e!=e?t:e},Bn.divide=bl,Bn.endsWith=function(e,t,n){e=va(e),t=si(t);var r=e.length,o=n=n===i?r:or(da(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Bn.eq=Ls,Bn.escape=function(e){return(e=va(e))&&K.test(e)?e.replace(U,tn):e},Bn.escapeRegExp=function(e){return(e=va(e))&&ne.test(e)?e.replace(te,"\\$&"):e},Bn.every=function(e,t,n){var r=qs(e)?Et:fr;return n&&vo(e,t,n)&&(t=i),r(e,oo(t,3))},Bn.find=ms,Bn.findIndex=zo,Bn.findKey=function(e,t){return Nt(e,oo(t,3),yr)},Bn.findLast=gs,Bn.findLastIndex=qo,Bn.findLastKey=function(e,t){return Nt(e,oo(t,3),br)},Bn.floor=wl,Bn.forEach=vs,Bn.forEachRight=ys,Bn.forIn=function(e,t){return null==e?e:gr(e,oo(t,3),Ta)},Bn.forInRight=function(e,t){return null==e?e:vr(e,oo(t,3),Ta)},Bn.forOwn=function(e,t){return e&&yr(e,oo(t,3))},Bn.forOwnRight=function(e,t){return e&&br(e,oo(t,3))},Bn.get=Ca,Bn.gt=Fs,Bn.gte=Vs,Bn.has=function(e,t){return null!=e&&fo(e,t,Cr)},Bn.hasIn=Oa,Bn.head=Wo,Bn.identity=nl,Bn.includes=function(e,t,n,r){e=Ws(e)?e:La(e),n=n&&!r?da(n):0;var i=e.length;return n<0&&(n=gn(i+n,0)),sa(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Lt(e,t,n)>-1},Bn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:da(n);return i<0&&(i=gn(r+i,0)),Lt(e,t,i)},Bn.inRange=function(e,t,n){return t=fa(t),n===i?(n=t,t=0):n=fa(n),function(e,t,n){return e>=vn(t,n)&&e=-9007199254740991&&e<=u},Bn.isSet=oa,Bn.isString=sa,Bn.isSymbol=aa,Bn.isTypedArray=la,Bn.isUndefined=function(e){return e===i},Bn.isWeakMap=function(e){return ea(e)&&uo(e)==I},Bn.isWeakSet=function(e){return ea(e)&&"[object WeakSet]"==Sr(e)},Bn.join=function(e,t){return null==e?"":Ht.call(e,t)},Bn.kebabCase=qa,Bn.last=Go,Bn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=da(n))<0?gn(r+o,0):vn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Bt(e,Vt,o,!0)},Bn.lowerCase=Ha,Bn.lowerFirst=Wa,Bn.lt=ca,Bn.lte=ha,Bn.max=function(e){return e&&e.length?dr(e,nl,Ar):i},Bn.maxBy=function(e,t){return e&&e.length?dr(e,oo(t,2),Ar):i},Bn.mean=function(e){return zt(e,nl)},Bn.meanBy=function(e,t){return zt(e,oo(t,2))},Bn.min=function(e){return e&&e.length?dr(e,nl,Dr):i},Bn.minBy=function(e,t){return e&&e.length?dr(e,oo(t,2),Dr):i},Bn.stubArray=pl,Bn.stubFalse=ml,Bn.stubObject=function(){return{}},Bn.stubString=function(){return""},Bn.stubTrue=function(){return!0},Bn.multiply=xl,Bn.nth=function(e,t){return e&&e.length?Fr(e,da(t)):i},Bn.noConflict=function(){return ut._===this&&(ut._=Be),this},Bn.noop=al,Bn.now=Cs,Bn.pad=function(e,t,n){e=va(e);var r=(t=da(t))?hn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Vi(dt(i),n)+e+Vi(ft(i),n)},Bn.padEnd=function(e,t,n){e=va(e);var r=(t=da(t))?hn(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=wn();return vn(e+o*(t-e+at("1e-"+((o+"").length-1))),t)}return Wr(e,t)},Bn.reduce=function(e,t,n){var r=qs(e)?_t:Wt,i=arguments.length<3;return r(e,oo(t,4),n,i,hr)},Bn.reduceRight=function(e,t,n){var r=qs(e)?Pt:Wt,i=arguments.length<3;return r(e,oo(t,4),n,i,ur)},Bn.repeat=function(e,t,n){return t=(n?vo(e,t,n):t===i)?1:da(t),Ur(va(e),t)},Bn.replace=function(){var e=arguments,t=va(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Bn.result=function(e,t,n){var r=-1,o=(t=gi(t,e)).length;for(o||(o=1,e=i);++ru)return[];var n=d,r=vn(e,d);t=oo(t),e-=d;for(var i=Jt(r,t);++n=s)return e;var l=n-hn(r);if(l<1)return r;var c=a?yi(a,0,l).join(""):e.slice(0,l);if(o===i)return c+r;if(a&&(l+=c.length-l),ia(o)){if(e.slice(l).search(o)){var h,u=c;for(o.global||(o=Ce(o.source,va(fe.exec(o))+"g")),o.lastIndex=0;h=o.exec(u);)var f=h.index;c=c.slice(0,f===i?l:f)}}else if(e.indexOf(si(o),l)!=l){var d=c.lastIndexOf(o);d>-1&&(c=c.slice(0,d))}return c+r},Bn.unescape=function(e){return(e=va(e))&&J.test(e)?e.replace(W,dn):e},Bn.uniqueId=function(e){var t=++Pe;return va(e)+t},Bn.upperCase=Ka,Bn.upperFirst=Ga,Bn.each=vs,Bn.eachRight=ys,Bn.first=Wo,sl(Bn,(gl={},yr(Bn,(function(e,t){_e.call(Bn.prototype,t)||(gl[t]=e)})),gl),{chain:!1}),Bn.VERSION="4.17.21",Ct(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Bn[e].placeholder=Bn})),Ct(["drop","take"],(function(e,t){zn.prototype[e]=function(n){n=n===i?1:gn(da(n),0);var r=this.__filtered__&&!t?new zn(this):this.clone();return r.__filtered__?r.__takeCount__=vn(n,r.__takeCount__):r.__views__.push({size:vn(n,d),type:e+(r.__dir__<0?"Right":"")}),r},zn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ct(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;zn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:oo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Ct(["head","last"],(function(e,t){var n="take"+(t?"Right":"");zn.prototype[e]=function(){return this[n](1).value()[0]}})),Ct(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");zn.prototype[e]=function(){return this.__filtered__?new zn(this):this[n](1)}})),zn.prototype.compact=function(){return this.filter(nl)},zn.prototype.find=function(e){return this.filter(e).head()},zn.prototype.findLast=function(e){return this.reverse().find(e)},zn.prototype.invokeMap=Jr((function(e,t){return"function"==typeof e?new zn(this):this.map((function(n){return jr(n,e,t)}))})),zn.prototype.reject=function(e){return this.filter(Ps(oo(e)))},zn.prototype.slice=function(e,t){e=da(e);var n=this;return n.__filtered__&&(e>0||t<0)?new zn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=da(t))<0?n.dropRight(-t):n.take(t-e)),n)},zn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},zn.prototype.toArray=function(){return this.take(d)},yr(zn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Bn[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);o&&(Bn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,l=t instanceof zn,c=a[0],h=l||qs(t),u=function(e){var t=o.apply(Bn,$t([e],a));return r&&f?t[0]:t};h&&n&&"function"==typeof c&&1!=c.length&&(l=h=!1);var f=this.__chain__,d=!!this.__actions__.length,p=s&&!f,m=l&&!d;if(!s&&h){t=m?t:new zn(this);var g=e.apply(t,a);return g.__actions__.push({func:fs,args:[u],thisArg:i}),new Vn(g,f)}return p&&m?e.apply(this,a):(g=this.thru(u),p?r?g.value()[0]:g.value():g)})})),Ct(["pop","push","shift","sort","splice","unshift"],(function(e){var t=je[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Bn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(qs(i)?i:[],e)}return this[n]((function(n){return t.apply(qs(n)?n:[],e)}))}})),yr(zn.prototype,(function(e,t){var n=Bn[t];if(n){var r=n.name+"";_e.call(Mn,r)||(Mn[r]=[]),Mn[r].push({name:t,func:n})}})),Mn[Ni(i,2).name]=[{name:"wrapper",func:i}],zn.prototype.clone=function(){var e=new zn(this.__wrapped__);return e.__actions__=Oi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Oi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Oi(this.__views__),e},zn.prototype.reverse=function(){if(this.__filtered__){var e=new zn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},zn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=qs(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Bn.prototype.plant=function(e){for(var t,n=this;n instanceof Fn;){var r=Bo(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Bn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zn){var t=e;return this.__actions__.length&&(t=new zn(this)),(t=t.reverse()).__actions__.push({func:fs,args:[Xo],thisArg:i}),new Vn(t,this.__chain__)}return this.thru(Xo)},Bn.prototype.toJSON=Bn.prototype.valueOf=Bn.prototype.value=function(){return ui(this.__wrapped__,this.__actions__)},Bn.prototype.first=Bn.prototype.head,Ge&&(Bn.prototype[Ge]=function(){return this}),Bn}();ut._=pn,(r=function(){return pn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},705:e=>{e.exports=function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){if(o)return o(s,!0);throw new Error("Cannot find module '"+s+"'")}a=n[s]={exports:{}},t[s][0].call(a.exports,(function(e){return i(t[s][1][e]||e)}),a,a.exports,e,t,n,r)}return n[s].exports}for(var o=void 0,s=0;s>16),l((65280&r)>>8),l(255&r);return 2==i?l(255&(r=c(e.charAt(n))<<2|c(e.charAt(n+1))>>4)):1==i&&(l((r=c(e.charAt(n))<<10|c(e.charAt(n+1))<<4|c(e.charAt(n+2))>>2)>>8&255),l(255&r)),o},e.fromByteArray=function(e){var t,n,r,i,o=e.length%3,s="";function a(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,r=e.length-o;t>18&63)+a(i>>12&63)+a(i>>6&63)+a(63&i);switch(o){case 1:s=(s+=a((n=e[e.length-1])>>2))+a(n<<4&63)+"==";break;case 2:s=(s=(s+=a((n=(e[e.length-2]<<8)+e[e.length-1])>>10))+a(n>>4&63))+a(n<<2&63)+"="}return s}}(void 0===n?this.base64js={}:n)}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(e,t,n){(function(t,r,i,o,s,a,l,c,h){var u=e("base64-js"),f=e("ieee754");function i(e,t,n){if(!(this instanceof i))return new i(e,t,n);var r,o,s,a,l=typeof e;if("base64"===t&&"string"==l)for(e=(a=e).trim?a.trim():a.replace(/^\s+|\s+$/g,"");e.length%4!=0;)e+="=";if("number"==l)r=E(e);else if("string"==l)r=i.byteLength(e,t);else{if("object"!=l)throw new Error("First argument needs to be a number, array or string.");r=E(e.length)}if(i._useTypedArrays?o=i._augment(new Uint8Array(r)):((o=this).length=r,o._isBuffer=!0),i._useTypedArrays&&"number"==typeof e.byteLength)o._set(e);else if(j(a=e)||i.isBuffer(a)||a&&"object"==typeof a&&"number"==typeof a.length)for(s=0;s>>0)):(t+1>>0),i}function m(e,t,n,r){if(r||(N("boolean"==typeof n,"missing or invalid endian"),N(null!=t,"missing offset"),N(t+1>>8*(r?o:1-o)}function w(e,t,n,r,i){if(i||(N(null!=t,"missing value"),N("boolean"==typeof r,"missing or invalid endian"),N(null!=n,"missing offset"),N(n+3>>8*(r?o:3-o)&255}function x(e,t,n,r,i){i||(N(null!=t,"missing value"),N("boolean"==typeof r,"missing or invalid endian"),N(null!=n,"missing offset"),N(n+1>8,n%=256,r.push(n),r.push(t);return r}(t),e,n,r)}(this,e,t,n);break;default:throw new Error("Unknown encoding")}return o},i.prototype.toString=function(e,t,n){var r,i,o,s,a=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,(n=void 0!==n?Number(n):a.length)===t)return"";switch(e){case"hex":r=function(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||rthis.length&&(r=this.length);var o=(r=e.length-t=this.length))return this[e]},i.prototype.readUInt16LE=function(e,t){return d(this,e,!0,t)},i.prototype.readUInt16BE=function(e,t){return d(this,e,!1,t)},i.prototype.readUInt32LE=function(e,t){return p(this,e,!0,t)},i.prototype.readUInt32BE=function(e,t){return p(this,e,!1,t)},i.prototype.readInt8=function(e,t){if(t||(N(null!=e,"missing offset"),N(e=this.length))return 128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){return m(this,e,!0,t)},i.prototype.readInt16BE=function(e,t){return m(this,e,!1,t)},i.prototype.readInt32LE=function(e,t){return g(this,e,!0,t)},i.prototype.readInt32BE=function(e,t){return g(this,e,!1,t)},i.prototype.readFloatLE=function(e,t){return v(this,e,!0,t)},i.prototype.readFloatBE=function(e,t){return v(this,e,!1,t)},i.prototype.readDoubleLE=function(e,t){return y(this,e,!0,t)},i.prototype.readDoubleBE=function(e,t){return y(this,e,!1,t)},i.prototype.writeUInt8=function(e,t,n){n||(N(null!=e,"missing value"),N(null!=t,"missing offset"),N(t=this.length||(this[t]=e)},i.prototype.writeUInt16LE=function(e,t,n){b(this,e,t,!0,n)},i.prototype.writeUInt16BE=function(e,t,n){b(this,e,t,!1,n)},i.prototype.writeUInt32LE=function(e,t,n){w(this,e,t,!0,n)},i.prototype.writeUInt32BE=function(e,t,n){w(this,e,t,!1,n)},i.prototype.writeInt8=function(e,t,n){n||(N(null!=e,"missing value"),N(null!=t,"missing offset"),N(t=this.length||(0<=e?this.writeUInt8(e,t,n):this.writeUInt8(255+e+1,t,n))},i.prototype.writeInt16LE=function(e,t,n){x(this,e,t,!0,n)},i.prototype.writeInt16BE=function(e,t,n){x(this,e,t,!1,n)},i.prototype.writeInt32LE=function(e,t,n){k(this,e,t,!0,n)},i.prototype.writeInt32BE=function(e,t,n){k(this,e,t,!1,n)},i.prototype.writeFloatLE=function(e,t,n){S(this,e,t,!0,n)},i.prototype.writeFloatBE=function(e,t,n){S(this,e,t,!1,n)},i.prototype.writeDoubleLE=function(e,t,n){A(this,e,t,!0,n)},i.prototype.writeDoubleBE=function(e,t,n){A(this,e,t,!1,n)},i.prototype.fill=function(e,t,n){if(t=t||0,n=n||this.length,N("number"==typeof(e="string"==typeof(e=e||0)?e.charCodeAt(0):e)&&!isNaN(e),"value is not a number"),N(t<=n,"end < start"),n!==t&&0!==this.length){N(0<=t&&t"},i.prototype.toArrayBuffer=function(){if("undefined"==typeof Uint8Array)throw new Error("Buffer.toArrayBuffer not supported in this browser");if(i._useTypedArrays)return new i(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;t=t.length||i>=e.length);i++)t[i+n]=e[i];return i}function _(e){try{return decodeURIComponent(e)}catch(e){return String.fromCharCode(65533)}}function P(e,t){N("number"==typeof e,"cannot write a non-number as a number"),N(0<=e,"specified a negative value for writing an unsigned value"),N(e<=t,"value is larger than maximum value for type"),N(Math.floor(e)===e,"value has a fractional component")}function D(e,t,n){N("number"==typeof e,"cannot write a non-number as a number"),N(e<=t,"value larger than maximum allowed value"),N(n<=e,"value smaller than minimum allowed value"),N(Math.floor(e)===e,"value has a fractional component")}function R(e,t,n){N("number"==typeof e,"cannot write a non-number as a number"),N(e<=t,"value larger than maximum allowed value"),N(n<=e,"value smaller than minimum allowed value")}function N(e,t){if(!e)throw new Error(t||"Failed assertion")}i._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=C.get,e.set=C.set,e.write=C.write,e.toString=C.toString,e.toLocaleString=C.toString,e.toJSON=C.toJSON,e.copy=C.copy,e.slice=C.slice,e.readUInt8=C.readUInt8,e.readUInt16LE=C.readUInt16LE,e.readUInt16BE=C.readUInt16BE,e.readUInt32LE=C.readUInt32LE,e.readUInt32BE=C.readUInt32BE,e.readInt8=C.readInt8,e.readInt16LE=C.readInt16LE,e.readInt16BE=C.readInt16BE,e.readInt32LE=C.readInt32LE,e.readInt32BE=C.readInt32BE,e.readFloatLE=C.readFloatLE,e.readFloatBE=C.readFloatBE,e.readDoubleLE=C.readDoubleLE,e.readDoubleBE=C.readDoubleBE,e.writeUInt8=C.writeUInt8,e.writeUInt16LE=C.writeUInt16LE,e.writeUInt16BE=C.writeUInt16BE,e.writeUInt32LE=C.writeUInt32LE,e.writeUInt32BE=C.writeUInt32BE,e.writeInt8=C.writeInt8,e.writeInt16LE=C.writeInt16LE,e.writeInt16BE=C.writeInt16BE,e.writeInt32LE=C.writeInt32LE,e.writeInt32BE=C.writeInt32BE,e.writeFloatLE=C.writeFloatLE,e.writeFloatBE=C.writeFloatBE,e.writeDoubleLE=C.writeDoubleLE,e.writeDoubleBE=C.writeDoubleBE,e.fill=C.fill,e.inspect=C.inspect,e.toArrayBuffer=C.toArrayBuffer,e}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(e,t,n){(function(n,r,i,o,s,a,l,c,h){i=e("buffer").Buffer;var u=new i(4);u.fill(0),t.exports={hash:function(e,t,n,r){for(var o=t(function(e,t){e.length%4!=0&&(n=e.length+(4-e.length%4),e=i.concat([e,u],n));for(var n,r=[],o=t?e.readInt32BE:e.readInt32LE,s=0;sm?t=e(t):t.length>5]|=128<>>9<<4)]=t;for(var n=1732584193,r=-271733879,i=-1732584194,o=271733878,s=0;s>>32-i,n)}function p(e,t,n,r,i,o,s){return d(t&n|~t&r,e,t,i,o,s)}function m(e,t,n,r,i,o,s){return d(t&r|n&~r,e,t,i,o,s)}function g(e,t,n,r,i,o,s){return d(t^n^r,e,t,i,o,s)}function v(e,t,n,r,i,o,s){return d(n^(t|~r),e,t,i,o,s)}function y(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}t.exports=function(e){return u.hash(e,f,16)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(e,t,n){(function(e,n,r,i,o,s,a,l,c){t.exports=function(e){for(var t,n=new Array(e),r=0;r>>((3&r)<<3)&255;return n}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(e,t,n){(function(n,r,i,o,s,a,l,c,h){var u=e("./helpers");function f(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var n,r,i,o=Array(80),s=1732584193,a=-271733879,l=-1732584194,c=271733878,h=-1009589776,u=0;u>16)+(t>>16)+(n>>16)<<16|65535&n}function p(e,t){return e<>>32-t}t.exports=function(e){return u.hash(e,f,20,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(e,t,n){(function(n,r,i,o,s,a,l,c,h){function u(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function f(e,t){var n,r=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),i=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),o=new Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var s,a,l=0;l>>t|e<<32-t},m=function(e,t){return e>>>t};t.exports=function(e){return d.hash(e,f,32,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(e,t,n){(function(e,t,r,i,o,s,a,l,c){n.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,l=(1<>1,h=-7,u=n?i-1:0,f=n?-1:1;for(i=e[t+u],u+=f,o=i&(1<<-h)-1,i>>=-h,h+=a;0>=-h,h+=r;0>1,u=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,d=r?1:-1;for(o=t<0||0===t&&1/t<0?1:0,t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(r=Math.pow(2,-s))<1&&(s--,r*=2),2<=(t+=1<=s+h?u/r:u*Math.pow(2,1-h))*r&&(s++,r/=2),c<=s+h?(a=0,s=c):1<=s+h?(a=(t*r-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));8<=i;e[n+f]=255&a,f+=d,a/=256,i-=8);for(s=s<1){t[0]=t[0].slice(0,-1);for(var r=t.length-1,i=1;i= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,g=String.fromCharCode;function v(e){throw new RangeError(p[e])}function y(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+function(e,t){for(var n=[],r=e.length;r--;)n[r]=t(e[r]);return n}((e=e.replace(d,".")).split("."),t).join(".")}function b(e){for(var t=[],n=0,r=e.length;n=55296&&i<=56319&&n>1,e+=m(e/t);e>455;r+=h)e=m(e/35);return m(r+36*e/(e+38))},k=function(e){var t,n=[],r=e.length,i=0,o=128,s=72,a=e.lastIndexOf("-");a<0&&(a=0);for(var l=0;l=128&&v("not-basic"),n.push(e.charCodeAt(l));for(var u=a>0?a+1:0;u=r&&v("invalid-input");var g=(t=e.charCodeAt(u++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:h;(g>=h||g>m((c-i)/d))&&v("overflow"),i+=g*d;var y=p<=s?1:p>=s+26?26:p-s;if(gm(c/b)&&v("overflow"),d*=b}var w=n.length+1;s=x(i-f,w,0==f),m(i/w)>c-o&&v("overflow"),o+=m(i/w),i%=w,n.splice(i++,0,o)}return String.fromCodePoint.apply(String,n)},S=function(e){var t=[],n=(e=b(e)).length,r=128,i=0,o=72,s=!0,a=!1,l=void 0;try{for(var u,f=e[Symbol.iterator]();!(s=(u=f.next()).done);s=!0){var d=u.value;d<128&&t.push(g(d))}}catch(e){a=!0,l=e}finally{try{!s&&f.return&&f.return()}finally{if(a)throw l}}var p=t.length,y=p;for(p&&t.push("-");y=r&&jm((c-i)/M)&&v("overflow"),i+=(k-r)*M,r=k;var I=!0,T=!1,$=void 0;try{for(var _,P=e[Symbol.iterator]();!(I=(_=P.next()).done);I=!0){var D=_.value;if(Dc&&v("overflow"),D==r){for(var R=i,N=h;;N+=h){var B=N<=o?1:N>=o+26?26:N-o;if(R>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function E(e){for(var t="",n=0,r=e.length;n=194&&i<224){if(r-n>=6){var o=parseInt(e.substr(n+4,2),16);t+=String.fromCharCode((31&i)<<6|63&o)}else t+=e.substr(n,6);n+=6}else if(i>=224){if(r-n>=9){var s=parseInt(e.substr(n+4,2),16),a=parseInt(e.substr(n+7,2),16);t+=String.fromCharCode((15&i)<<12|(63&s)<<6|63&a)}else t+=e.substr(n,9);n+=9}else t+=e.substr(n,3),n+=3}return t}function j(e,t){function n(e){var n=E(e);return n.match(t.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,n).replace(t.NOT_USERINFO,O).replace(t.PCT_ENCODED,i)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_HOST,O).replace(t.PCT_ENCODED,i)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,n).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,O).replace(t.PCT_ENCODED,i)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,n).replace(t.NOT_QUERY,O).replace(t.PCT_ENCODED,i)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,n).replace(t.NOT_FRAGMENT,O).replace(t.PCT_ENCODED,i)),e}function M(e){return e.replace(/^0*(.*)/,"$1")||"0"}function I(e,t){var n=e.match(t.IPV4ADDRESS)||[],r=l(n,2)[1];return r?r.split(".").map(M).join("."):e}function T(e,t){var n=e.match(t.IPV6ADDRESS)||[],r=l(n,3),i=r[1],o=r[2];if(i){for(var s=i.toLowerCase().split("::").reverse(),a=l(s,2),c=a[0],h=a[1],u=h?h.split(":").map(M):[],f=c.split(":").map(M),d=t.IPV4ADDRESS.test(f[f.length-1]),p=d?7:8,m=f.length-p,g=Array(p),v=0;v1){var w=g.slice(0,y.index),x=g.slice(y.index+y.length);b=w.join(":")+"::"+x.join(":")}else b=g.join(":");return o&&(b+="%"+o),b}return e}var $=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,_=void 0==="".match(/(){0}/)[1];function P(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r=!1!==t.iri?a:s;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var i=e.match($);if(i){_?(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5])):(n.scheme=i[1]||void 0,n.userinfo=-1!==e.indexOf("@")?i[3]:void 0,n.host=-1!==e.indexOf("//")?i[4]:void 0,n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=-1!==e.indexOf("?")?i[7]:void 0,n.fragment=-1!==e.indexOf("#")?i[8]:void 0,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),n.host&&(n.host=T(I(n.host,r),r)),void 0!==n.scheme||void 0!==n.userinfo||void 0!==n.host||void 0!==n.port||n.path||void 0!==n.query?void 0===n.scheme?n.reference="relative":void 0===n.fragment?n.reference="absolute":n.reference="uri":n.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==n.reference&&(n.error=n.error||"URI is not a "+t.reference+" reference.");var o=C[(t.scheme||n.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)j(n,r);else{if(n.host&&(t.domainHost||o&&o.domainHost))try{n.host=A.toASCII(n.host.replace(r.PCT_ENCODED,E).toLowerCase())}catch(e){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+e}j(n,s)}o&&o.parse&&o.parse(n,t)}else n.error=n.error||"URI can not be parsed.";return n}var D=/^\.\.?\//,R=/^\/\.(\/|$)/,N=/^\/\.\.(\/|$)/,B=/^\/?(?:.|\n)*?(?=\/|$)/;function L(e){for(var t=[];e.length;)if(e.match(D))e=e.replace(D,"");else if(e.match(R))e=e.replace(R,"/");else if(e.match(N))e=e.replace(N,"/"),t.pop();else if("."===e||".."===e)e="";else{var n=e.match(B);if(!n)throw new Error("Unexpected dot segment condition");var r=n[0];e=e.slice(r.length),t.push(r)}return t.join("")}function F(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.iri?a:s,r=[],i=C[(t.scheme||e.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(e,t),e.host)if(n.IPV6ADDRESS.test(e.host));else if(t.domainHost||i&&i.domainHost)try{e.host=t.iri?A.toUnicode(e.host):A.toASCII(e.host.replace(n.PCT_ENCODED,E).toLowerCase())}catch(n){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+n}j(e,n),"suffix"!==t.reference&&e.scheme&&(r.push(e.scheme),r.push(":"));var o=function(e,t){var n=!1!==t.iri?a:s,r=[];return void 0!==e.userinfo&&(r.push(e.userinfo),r.push("@")),void 0!==e.host&&r.push(T(I(String(e.host),n),n).replace(n.IPV6ADDRESS,(function(e,t,n){return"["+t+(n?"%25"+n:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(r.push(":"),r.push(String(e.port))),r.length?r.join(""):void 0}(e,t);if(void 0!==o&&("suffix"!==t.reference&&r.push("//"),r.push(o),e.path&&"/"!==e.path.charAt(0)&&r.push("/")),void 0!==e.path){var l=e.path;t.absolutePath||i&&i.absolutePath||(l=L(l)),void 0===o&&(l=l.replace(/^\/\//,"/%2F")),r.push(l)}return void 0!==e.query&&(r.push("?"),r.push(e.query)),void 0!==e.fragment&&(r.push("#"),r.push(e.fragment)),r.join("")}function V(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={};return arguments[3]||(e=P(F(e,n),n),t=P(F(t,n),n)),!(n=n||{}).tolerant&&t.scheme?(r.scheme=t.scheme,r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=L(t.path||""),r.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=L(t.path||""),r.query=t.query):(t.path?("/"===t.path.charAt(0)?r.path=L(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?r.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:r.path=t.path:r.path="/"+t.path,r.path=L(r.path)),r.query=t.query):(r.path=e.path,void 0!==t.query?r.query=t.query:r.query=e.query),r.userinfo=e.userinfo,r.host=e.host,r.port=e.port),r.scheme=e.scheme),r.fragment=t.fragment,r}function z(e,t){return e&&e.toString().replace(t&&t.iri?a.PCT_ENCODED:s.PCT_ENCODED,E)}var q={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var n="https"===String(e.scheme).toLowerCase();return e.port!==(n?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},H={scheme:"https",domainHost:q.domainHost,parse:q.parse,serialize:q.serialize};function W(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var U={scheme:"ws",domainHost:!0,parse:function(e,t){var n=e;return n.secure=W(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=void 0,n.query=void 0,n},serialize:function(e,t){if(e.port!==(W(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var n=e.resourceName.split("?"),r=l(n,2),i=r[0],o=r[1];e.path=i&&"/"!==i?i:void 0,e.query=o,e.resourceName=void 0}return e.fragment=void 0,e}},J={scheme:"wss",domainHost:U.domainHost,parse:U.parse,serialize:U.serialize},K={},G="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Q="[0-9A-Fa-f]",Z=n(n("%[EFef]"+Q+"%"+Q+Q+"%"+Q+Q)+"|"+n("%[89A-Fa-f]"+Q+"%"+Q+Q)+"|"+n("%"+Q+Q)),Y=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),X=new RegExp(G,"g"),ee=new RegExp(Z,"g"),te=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',Y),"g"),ne=new RegExp(t("[^]",G,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),re=ne;function ie(e){var t=E(e);return t.match(X)?t:e}var oe={scheme:"mailto",parse:function(e,t){var n=e,r=n.to=n.path?n.path.split(","):[];if(n.path=void 0,n.query){for(var i=!1,o={},s=n.query.split("&"),a=0,l=s.length;a{var r={"./jsonschema-2019-09.json":2391,"./jsonschema-2020-12.json":3212,"./jsonschema-draft3.json":4413,"./jsonschema-draft4.json":2427,"./jsonschema-draft6.json":9628,"./jsonschema-draft7.json":228};function i(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=o,e.exports=i,i.id=6218},526:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7040),i=n(3642),o=n(729);class s{constructor(e,t,n){this.state=e,this.pos=t,this.explicit=n,this.abortListeners=[]}tokenBefore(e){let t=o.syntaxTree(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(u(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return null==this.abortListeners}addEventListener(e,t){"abort"==e&&this.abortListeners&&this.abortListeners.push(t)}}function a(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function l(e){let t=e.map((e=>"string"==typeof e?{label:e}:e)),[n,r]=t.every((e=>/^\w+$/.test(e.label)))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}class c{constructor(e,t,n){this.completion=e,this.source=t,this.match=n}}function h(e){return e.selection.main.head}function u(e,t){var n;let{source:r}=e,i=t&&"^"!=r[0],o="$"!=r[r.length-1];return i||o?new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}const f=r.Annotation.define();function d(e,t,n,i){return Object.assign(Object.assign({},e.changeByRange((o=>{if(o==e.selection.main)return{changes:{from:n,to:i,insert:t},range:r.EditorSelection.cursor(n+t.length)};let s=i-n;return!o.empty||s&&e.sliceDoc(o.from-s,o.from)!=e.sliceDoc(n,i)?{range:o}:{changes:{from:o.from-s,to:o.from,insert:t},range:r.EditorSelection.cursor(o.from-s+t.length)}}))),{userEvent:"input.complete"})}function p(e,t){const n=t.completion.apply||t.completion.label;let r=t.source;"string"==typeof n?e.dispatch(d(e.state,n,r.from,r.to)):n(e,t.completion,r.from,r.to)}const m=new WeakMap;function g(e){if(!Array.isArray(e))return e;let t=m.get(e);return t||m.set(e,t=l(e)),t}class v{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[];for(let t=0;t=48&&c<=57||c>=97&&c<=122?2:c>=65&&c<=90?1:0:(b=r.fromCodePoint(c))!=b.toLowerCase()?1:b!=b.toUpperCase()?2:0;(!i||1==w&&g||0==y&&0!=w)&&(t[u]==c||n[u]==c&&(f=!0)?s[u++]=i:s.length&&(v=!1)),y=w,i+=r.codePointSize(c)}return u==l&&0==s[0]&&v?this.result((f?-200:0)-100,s,e):d==l&&0==p?[-200-e.length,0,m]:a>-1?[-700-e.length,a,a+this.pattern.length]:d==l?[-900-e.length,p,m]:u==l?this.result((f?-200:0)-100-700+(v?0:-1100),s,e):2==t.length?null:this.result((i[0]?-700:0)-200-1100,i,e)}result(e,t,n){let i=[e-n.length],o=1;for(let e of t){let t=e+(this.astral?r.codePointSize(r.codePointAt(n,e)):1);o>1&&i[o-1]==e?i[o-1]=t:(i[o++]=e,i[o++]=t)}return i}}const y=r.Facet.define({combine:e=>r.combineConfig(e,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],compareCompletions:(e,t)=>e.label.localeCompare(t.label)},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,optionClass:(e,t)=>n=>function(e,t){return e?t?e+" "+t:e:t}(e(n),t(n)),addToOptions:(e,t)=>e.concat(t)})});function b(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}class w{constructor(e,t){this.view=e,this.stateField=t,this.info=null,this.placeInfo={read:()=>this.measureInfo(),write:e=>this.positionInfo(e),key:this};let n=e.state.field(t),{options:r,selected:i}=n.open,o=e.state.facet(y);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map((e=>"cm-completionIcon-"+e))),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n){let r=document.createElement("span");r.className="cm-completionLabel";let{label:i}=e,o=0;for(let e=1;eo&&r.appendChild(document.createTextNode(i.slice(o,t)));let a=r.appendChild(document.createElement("span"));a.appendChild(document.createTextNode(i.slice(t,s))),a.className="cm-completionMatchedText",o=s}return oe.position-t.position)).map((e=>e.render))}(o),this.optionClass=o.optionClass,this.range=b(r.length,i,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.dom.addEventListener("mousedown",(t=>{for(let n,i=t.target;i&&i!=this.dom;i=i.parentNode)if("LI"==i.nodeName&&(n=/-(\d+)$/.exec(i.id))&&+n[1]{this.info&&this.view.requestMeasure(this.placeInfo)}))}mount(){this.updateSel()}update(e){e.state.field(this.stateField)!=e.startState.field(this.stateField)&&this.updateSel()}positioned(){this.info&&this.view.requestMeasure(this.placeInfo)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected=this.range.to)&&(this.range=b(t.options.length,t.selected,this.view.state.facet(y).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t.options,e.id,this.range)),this.list.addEventListener("scroll",(()=>{this.info&&this.view.requestMeasure(this.placeInfo)}))),this.updateSelectedOption(t.selected)){this.info&&(this.info.remove(),this.info=null);let{completion:n}=t.options[t.selected],{info:r}=n;if(!r)return;let o="string"==typeof r?document.createTextNode(r):r(n);if(!o)return;"then"in o?o.then((t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t)})).catch((e=>i.logException(this.view.state,e,"completion info"))):this.addInfoPane(o)}}addInfoPane(e){let t=this.info=document.createElement("div");t.className="cm-tooltip cm-completionInfo",t.appendChild(e),this.dom.appendChild(t),this.view.requestMeasure(this.placeInfo)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected");return t&&function(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.topn.bottom&&(e.scrollTop+=r.bottom-n.bottom)}(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect();if(r.top>Math.min(innerHeight,t.bottom)-10||r.bottom=this.options.length?this:new k(this.options,C(t,e),this.tooltip,this.timestamp,e)}static build(e,t,n,r,i){let o=function(e,t){let n=[],r=0;for(let i of e)if(i.hasResult())if(!1===i.result.filter){let e=i.result.getMatch;for(let t of i.result.options){let o=[1e9-r++];if(e)for(let n of e(t))o.push(n);n.push(new c(t,i,o))}}else{let e,r=new v(t.sliceDoc(i.from,i.to));for(let t of i.result.options)(e=r.match(t.label))&&(null!=t.boost&&(e[0]+=t.boost),n.push(new c(t,i,e)))}let i=[],o=null,s=t.facet(y).compareCompletions;for(let e of n.sort(((e,t)=>t.match[0]-e.match[0]||s(e.completion,t.completion))))!o||o.label!=e.completion.label||o.detail!=e.completion.detail||null!=o.type&&null!=e.completion.type&&o.type!=e.completion.type||o.apply!=e.completion.apply?i.push(e):x(e.completion)>x(o)&&(i[i.length-1]=e),o=e.completion;return i}(e,t);if(!o.length)return null;let s=t.facet(y).selectOnOpen?0:-1;if(r&&r.selected!=s&&-1!=r.selected){let e=r.options[r.selected].completion;for(let t=0;tt.hasResult()?Math.min(e,t.from):e),1e8),create:(a=P,e=>new w(e,a)),above:i.aboveCursor},r?r.timestamp:Date.now(),s);var a}map(e){return new k(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected)}}class S{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new S(O,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(y),r=(n.override||t.languageDataAt("autocomplete",h(t)).map(g)).map((t=>(this.active.find((e=>e.source==t))||new j(t,this.active.some((e=>0!=e.state))?1:0)).update(e,n)));r.length==this.active.length&&r.every(((e,t)=>e==this.active[t]))&&(r=this.active);let i=e.selection||r.some((t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to)))||!function(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n1!=e.state))&&r.some((e=>e.hasResult()))&&(r=r.map((e=>e.hasResult()?new j(e.source,0):e)));for(let t of e.effects)t.is(_)&&(i=i&&i.setSelected(t.value,this.id));return r==this.active&&i==this.open?this:new S(r,this.id,i)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:A}}const A={"aria-autocomplete":"list"};function C(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const O=[];function E(e){return e.isUserEvent("input.type")?"input":e.isUserEvent("delete.backward")?"delete":null}class j{constructor(e,t,n=-1){this.source=e,this.state=t,this.explicitPos=n}hasResult(){return!1}update(e,t){let n=E(e),r=this;n?r=r.handleUserEvent(e,n,t):e.docChanged?r=r.handleChange(e):e.selection&&0!=r.state&&(r=new j(r.source,0));for(let t of e.effects)if(t.is(I))r=new j(r.source,1,t.value?h(e.state):-1);else if(t.is(T))r=new j(r.source,0);else if(t.is($))for(let e of t.value)e.source==r.source&&(r=e);return r}handleUserEvent(e,t,n){return"delete"!=t&&n.activateOnTyping?new j(this.source,1):this.map(e.changes)}handleChange(e){return e.changes.touchesRange(h(e.startState))?new j(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new j(this.source,this.state,e.mapPos(this.explicitPos))}}class M extends j{constructor(e,t,n,r,i){super(e,2,t),this.result=n,this.from=r,this.to=i}hasResult(){return!0}handleUserEvent(e,t,n){var r;let i=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=h(e.state);if((this.explicitPos<0?a<=i:ao||"delete"==t&&h(e.startState)==this.from)return new j(this.source,"input"==t&&n.activateOnTyping?1:0);let l,c=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return function(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return"function"==typeof e?e(i,n,r,t):u(e,!0).test(i)}(this.result.validFor,e.state,i,o)?new M(this.source,c,this.result,i,o):this.result.update&&(l=this.result.update(this.result,i,o,new s(e.state,a,c>=0)))?new M(this.source,c,l,l.from,null!==(r=l.to)&&void 0!==r?r:h(e.state)):new j(this.source,1,c)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new j(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new M(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}const I=r.StateEffect.define(),T=r.StateEffect.define(),$=r.StateEffect.define({map:(e,t)=>e.map((e=>e.map(t)))}),_=r.StateEffect.define(),P=r.StateField.define({create:()=>S.start(),update:(e,t)=>e.update(t),provide:e=>[i.showTooltip.from(e,(e=>e.tooltip)),i.EditorView.contentAttributes.from(e,(e=>e.attrs))]});function D(e,t="option"){return n=>{let r=n.state.field(P,!1);if(!r||!r.open||Date.now()-r.open.timestamp<75)return!1;let o,s=1;"page"==t&&(o=i.getTooltip(n,r.open.tooltip))&&(s=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:a}=r.open.options,l=r.open.selected>-1?r.open.selected+s*(e?1:-1):e?0:a-1;return l<0?l="page"==t?0:a-1:l>=a&&(l="page"==t?a-1:0),n.dispatch({effects:_.of(l)}),!0}}const R=e=>{let t=e.state.field(P,!1);return!(e.state.readOnly||!t||!t.open||Date.now()-t.open.timestamp<75||t.open.selected<0||(p(e,t.open.options[t.open.selected]),0))},N=e=>!!e.state.field(P,!1)&&(e.dispatch({effects:I.of(!0)}),!0),B=e=>{let t=e.state.field(P,!1);return!(!t||!t.active.some((e=>0!=e.state))||(e.dispatch({effects:T.of(null)}),0))};class L{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const F=i.ViewPlugin.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let t of e.state.field(P).active)1==t.state&&this.startQuery(t)}update(e){let t=e.state.field(P);if(!e.selectionSet&&!e.docChanged&&e.startState.field(P)==t)return;let n=e.transactions.some((e=>(e.selection||e.docChanged)&&!E(e)));for(let t=0;t50&&Date.now()-r.time>1e3){for(let e of r.context.abortListeners)try{e()}catch(e){i.logException(this.view.state,e)}r.context.abortListeners=null,this.running.splice(t--,1)}else r.updates.push(...e.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=t.active.some((e=>1==e.state&&!this.running.some((t=>t.active.source==e.source))))?setTimeout((()=>this.startUpdate()),50):-1,0!=this.composing)for(let t of e.transactions)"input"==E(t)?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:e}=this.view,t=e.field(P);for(let e of t.active)1!=e.state||this.running.some((t=>t.active.source==e.source))||this.startQuery(e)}startQuery(e){let{state:t}=this.view,n=h(t),r=new s(t,n,e.explicitPos==n),o=new L(e,r);this.running.push(o),Promise.resolve(e.source(r)).then((e=>{o.context.aborted||(o.done=e||null,this.scheduleAccept())}),(e=>{this.view.dispatch({effects:T.of(null)}),i.logException(this.view.state,e)}))}scheduleAccept(){this.running.every((e=>void 0!==e.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),50))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(y);for(let r=0;re.source==i.active.source));if(o&&1==o.state)if(null==i.done){let e=new j(i.active.source,0);for(let t of i.updates)e=e.update(t,n);1!=e.state&&t.push(e)}else this.startQuery(o)}t.length&&this.view.dispatch({effects:$.of(t)})}},{eventHandlers:{blur(){let e=this.view.state.field(P,!1);e&&e.tooltip&&this.view.state.facet(y).closeOnBlur&&this.view.dispatch({effects:T.of(null)})},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:I.of(!1)})),20),this.composing=0}}}),V=i.EditorView.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer",padding:"1px 3px",lineHeight:1.2}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"300px"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class z{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}}class q{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,r.MapMode.TrackDel),n=e.mapPos(this.to,1,r.MapMode.TrackDel);return null==t||null==n?null:new q(this.field,t,n)}}class H{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],r=[t],i=e.doc.lineAt(t),s=/^\s*/.exec(i.text)[0];for(let i of this.lines){if(n.length){let n=s,a=/^\t*/.exec(i)[0].length;for(let t=0;tnew q(e.field,r[e.line]+e.from,r[e.line]+e.to)));return{text:n,ranges:a}}static parse(e){let t,n=[],r=[],i=[];for(let o of e.split(/\r\n?|\n/)){for(;t=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(o);){let e=t[1]?+t[1]:null,s=t[2]||t[3]||"",a=-1;for(let t=0;t=a&&e.field++}i.push(new z(a,r.length,t.index,t.index+s.length)),o=o.slice(0,t.index)+s+o.slice(t.index+t[0].length)}for(let e;e=/([$#])\\{/.exec(o);){o=o.slice(0,e.index)+e[1]+"{"+o.slice(e.index+e[0].length);for(let t of i)t.line==r.length&&t.from>e.index&&(t.from--,t.to--)}r.push(o)}return new H(r,i)}}let W=i.Decoration.widget({widget:new class extends i.WidgetType{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),U=i.Decoration.mark({class:"cm-snippetField"});class J{constructor(e,t){this.ranges=e,this.active=t,this.deco=i.Decoration.set(e.map((e=>(e.from==e.to?W:U).range(e.from,e.to))))}map(e){let t=[];for(let n of this.ranges){let r=n.map(e);if(!r)return null;t.push(r)}return new J(t,this.active)}selectionInsideField(e){return e.ranges.every((e=>this.ranges.some((t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))))}}const K=r.StateEffect.define({map:(e,t)=>e&&e.map(t)}),G=r.StateEffect.define(),Q=r.StateField.define({create:()=>null,update(e,t){for(let n of t.effects){if(n.is(K))return n.value;if(n.is(G)&&e)return new J(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>i.EditorView.decorations.from(e,(e=>e?e.deco:i.Decoration.none))});function Z(e,t){return r.EditorSelection.create(e.filter((e=>e.field==t)).map((e=>r.EditorSelection.range(e.from,e.to))))}function Y(e){let t=H.parse(e);return(e,n,i,o)=>{let{text:s,ranges:a}=t.instantiate(e.state,i),l={changes:{from:i,to:o,insert:r.Text.of(s)},scrollIntoView:!0};if(a.length&&(l.selection=Z(a,0)),a.length>1){let t=new J(a,0),n=l.effects=[K.of(t)];void 0===e.state.field(Q,!1)&&n.push(r.StateEffect.appendConfig.of([Q,oe,se,V]))}e.dispatch(e.state.update(l))}}function X(e){return({state:t,dispatch:n})=>{let r=t.field(Q,!1);if(!r||e<0&&0==r.active)return!1;let i=r.active+e,o=e>0&&!r.ranges.some((t=>t.field==i+e));return n(t.update({selection:Z(r.ranges,i),effects:K.of(o?null:new J(r.ranges,i))})),!0}}const ee=({state:e,dispatch:t})=>!!e.field(Q,!1)&&(t(e.update({effects:K.of(null)})),!0),te=X(1),ne=X(-1),re=[{key:"Tab",run:te,shift:ne},{key:"Escape",run:ee}],ie=r.Facet.define({combine:e=>e.length?e[0]:re}),oe=r.Prec.highest(i.keymap.compute([ie],(e=>e.facet(ie)))),se=i.EditorView.domEventHandlers({mousedown(e,t){let n,r=t.state.field(Q,!1);if(!r||null==(n=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;let i=r.ranges.find((e=>e.from<=n&&e.to>=n));return!(!i||i.field==r.active||(t.dispatch({selection:Z(r.ranges,i.field),effects:K.of(r.ranges.some((e=>e.field>i.field))?new J(r.ranges,i.field):null)}),0))}});function ae(e,t){return new RegExp(t(e.source),e.unicode?"u":"")}const le=Object.create(null);function ce(e,t,n,r,i){for(let o=e.iterLines(),s=0;!o.next().done;){let e,{value:a}=o;for(t.lastIndex=0;e=t.exec(a);)if(!r[e[0]]&&s+e.index!=i&&(n.push({type:"text",label:e[0]}),r[e[0]]=!0,n.length>=2e3))return;s+=a.length+1}}function he(e,t,n,r,i){let o=e.length>=1e3,s=o&&t.get(e);if(s)return s;let a=[],l=Object.create(null);if(e.children){let o=0;for(let s of e.children){if(s.length>=1e3)for(let e of he(s,t,n,r-o,i-o))l[e.label]||(l[e.label]=!0,a.push(e));else ce(s,n,a,l,i-o);o+=s.length+1}}else ce(e,n,a,l,i);return o&&a.length<2e3&&t.set(e,a),a}const ue={brackets:["(","[","{","'",'"'],before:")]}:;>"},fe=r.StateEffect.define({map(e,t){let n=t.mapPos(e,-1,r.MapMode.TrackAfter);return null==n?void 0:n}}),de=r.StateEffect.define({map:(e,t)=>t.mapPos(e)}),pe=new class extends r.RangeValue{};pe.startSide=1,pe.endSide=-1;const me=r.StateField.define({create:()=>r.RangeSet.empty,update(e,t){if(t.selection){let n=t.state.doc.lineAt(t.selection.main.head).from,i=t.startState.doc.lineAt(t.startState.selection.main.head).from;n!=t.changes.mapPos(i,-1)&&(e=r.RangeSet.empty)}e=e.map(t.changes);for(let n of t.effects)n.is(fe)?e=e.update({add:[pe.range(n.value,n.value+1)]}):n.is(de)&&(e=e.update({filter:e=>e!=n.value}));return e}}),ge="()[]{}<>";function ve(e){for(let t=0;t{if((be?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let o=e.state.selection.main;if(i.length>2||2==i.length&&1==r.codePointSize(r.codePointAt(i,0))||t!=o.from||n!=o.to)return!1;let s=Se(e.state,i);return!!s&&(e.dispatch(s),!0)})),xe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=ye(e,e.selection.main.head).brackets||ue.brackets,i=null,o=e.changeByRange((t=>{if(t.empty){let i=function(e,t){let n=e.sliceString(t-2,t);return r.codePointSize(r.codePointAt(n,0))==n.length?n:n.slice(1)}(e.doc,t.head);for(let o of n)if(o==i&&Ce(e.doc,t.head)==ve(r.codePointAt(o,0)))return{changes:{from:t.head-o.length,to:t.head+o.length},range:r.EditorSelection.cursor(t.head-o.length),userEvent:"delete.backward"}}return{range:i=t}}));return i||t(e.update(o,{scrollIntoView:!0})),!i},ke=[{key:"Backspace",run:xe}];function Se(e,t){let n=ye(e,e.selection.main.head),i=n.brackets||ue.brackets;for(let o of i){let s=ve(r.codePointAt(o,0));if(t==o)return s==o?je(e,o,i.indexOf(o+o+o)>-1):Oe(e,o,s,n.before||ue.before);if(t==s&&Ae(e,e.selection.main.from))return Ee(e,0,s)}return null}function Ae(e,t){let n=!1;return e.field(me).between(0,e.doc.length,(e=>{e==t&&(n=!0)})),n}function Ce(e,t){let n=e.sliceString(t,t+2);return n.slice(0,r.codePointSize(r.codePointAt(n,0)))}function Oe(e,t,n,i){let o=null,s=e.changeByRange((s=>{if(!s.empty)return{changes:[{insert:t,from:s.from},{insert:n,from:s.to}],effects:fe.of(s.to+t.length),range:r.EditorSelection.range(s.anchor+t.length,s.head+t.length)};let a=Ce(e.doc,s.head);return!a||/\s/.test(a)||i.indexOf(a)>-1?{changes:{insert:t+n,from:s.head},effects:fe.of(s.head+t.length),range:r.EditorSelection.cursor(s.head+t.length)}:{range:o=s}}));return o?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Ee(e,t,n){let i=null,o=e.selection.ranges.map((t=>t.empty&&Ce(e.doc,t.head)==n?r.EditorSelection.cursor(t.head+n.length):i=t));return i?null:e.update({selection:r.EditorSelection.create(o,e.selection.mainIndex),scrollIntoView:!0,effects:e.selection.ranges.map((({from:e})=>de.of(e)))})}function je(e,t,n){let i=null,s=e.changeByRange((s=>{if(!s.empty)return{changes:[{insert:t,from:s.from},{insert:t,from:s.to}],effects:fe.of(s.to+t.length),range:r.EditorSelection.range(s.anchor+t.length,s.head+t.length)};let a=s.head,l=Ce(e.doc,a);if(l==t){if(Me(e,a))return{changes:{insert:t+t,from:a},effects:fe.of(a+t.length),range:r.EditorSelection.cursor(a+t.length)};if(Ae(e,a)){let i=n&&e.sliceDoc(a,a+3*t.length)==t+t+t;return{range:r.EditorSelection.cursor(a+t.length*(i?3:1)),effects:de.of(a)}}}else{if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&Me(e,a-2*t.length))return{changes:{insert:t+t+t+t,from:a},effects:fe.of(a+t.length),range:r.EditorSelection.cursor(a+t.length)};if(e.charCategorizer(a)(l)!=r.CharCategory.Word){let n=e.sliceDoc(a-1,a);if(n!=t&&e.charCategorizer(a)(n)!=r.CharCategory.Word&&!function(e,t,n){let r=o.syntaxTree(e).resolveInner(t,-1);for(let i=0;i<5;i++){if(e.sliceDoc(r.from,r.from+n.length)==n){let t=r.firstChild;for(;t&&t.from==r.from&&t.to-t.from>n.length;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let i=r.to==t&&r.parent;if(!i)break;r=i}return!1}(e,a,t))return{changes:{insert:t+t,from:a},effects:fe.of(a+t.length),range:r.EditorSelection.cursor(a+t.length)}}}return{range:i=s}}));return i?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Me(e,t){let n=o.syntaxTree(e).resolveInner(t+1);return n.parent&&n.from==t}const Ie=[{key:"Ctrl-Space",run:N},{key:"Escape",run:B},{key:"ArrowDown",run:D(!0)},{key:"ArrowUp",run:D(!1)},{key:"PageDown",run:D(!0,"page")},{key:"PageUp",run:D(!1,"page")},{key:"Enter",run:R}],Te=r.Prec.highest(i.keymap.computeN([y],(e=>e.facet(y).defaultKeymap?[Ie]:[]))),$e=new WeakMap;t.CompletionContext=s,t.acceptCompletion=R,t.autocompletion=function(e={}){return[P,y.of(e),F,Te,V]},t.clearSnippet=ee,t.closeBrackets=function(){return[we,me]},t.closeBracketsKeymap=ke,t.closeCompletion=B,t.completeAnyWord=e=>{let t=e.state.languageDataAt("wordChars",e.pos).join(""),n=function(e){let t=e.replace(/[\\[.+*?(){|^$]/g,"\\$&");try{return new RegExp(`[\\p{Alphabetic}\\p{Number}_${t}]+`,"ug")}catch(e){return new RegExp(`[w${t}]`,"g")}}(t),r=e.matchBefore(ae(n,(e=>e+"$")));if(!r&&!e.explicit)return null;let i=r?r.from:e.pos,o=he(e.state.doc,function(e){return le[e]||(le[e]=new WeakMap)}(t),n,5e4,i);return{from:i,options:o,validFor:ae(n,(e=>"^"+e))}},t.completeFromList=l,t.completionKeymap=Ie,t.completionStatus=function(e){let t=e.field(P,!1);return t&&t.active.some((e=>1==e.state))?"pending":t&&t.active.some((e=>0!=e.state))?"active":null},t.currentCompletions=function(e){var t;let n=null===(t=e.field(P,!1))||void 0===t?void 0:t.open;if(!n)return[];let r=$e.get(n.options);return r||$e.set(n.options,r=n.options.map((e=>e.completion))),r},t.deleteBracketPair=xe,t.ifIn=function(e,t){return n=>{for(let r=o.syntaxTree(n.state).resolveInner(n.pos,-1);r;r=r.parent)if(e.indexOf(r.name)>-1)return t(n);return null}},t.ifNotIn=function(e,t){return n=>{for(let t=o.syntaxTree(n.state).resolveInner(n.pos,-1);t;t=t.parent)if(e.indexOf(t.name)>-1)return null;return t(n)}},t.insertBracket=Se,t.insertCompletionText=d,t.moveCompletionSelection=D,t.nextSnippetField=te,t.pickedCompletion=f,t.prevSnippetField=ne,t.selectedCompletion=function(e){var t;let n=null===(t=e.field(P,!1))||void 0===t?void 0:t.open;return n&&n.selected>=0?n.options[n.selected].completion:null},t.selectedCompletionIndex=function(e){var t;let n=null===(t=e.field(P,!1))||void 0===t?void 0:t.open;return n&&n.selected>=0?n.selected:null},t.setSelectedCompletion=function(e){return _.of(e)},t.snippet=Y,t.snippetCompletion=function(e,t){return Object.assign(Object.assign({},t),{apply:Y(e)})},t.snippetKeymap=ie,t.startCompletion=N},8561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7040),i=n(3642),o=n(729),s=n(7897);const a=e=>{let t=g(e.state);return t.line?c(e):!!t.block&&m(e)};function l(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return!!i&&(r(n.update(i)),!0)}}const c=l(b,0),h=l(b,1),u=l(b,2),f=l(y,0),d=l(y,1),p=l(y,2),m=l(((e,t)=>y(e,t,function(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to),o=t.length-1;o>=0&&t[o].to>r.from?t[o].to=i.to:t.push({from:r.from,to:i.to})}return t}(t))),0);function g(e,t=e.selection.main.head){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}const v=50;function y(e,t,n=t.selection.ranges){let r=n.map((e=>g(t,e.from).block));if(!r.every((e=>e)))return null;let i=n.map(((e,n)=>function(e,{open:t,close:n},r,i){let o,s,a=e.sliceDoc(r-v,r),l=e.sliceDoc(i,i+v),c=/\s*$/.exec(a)[0].length,h=/^\s*/.exec(l)[0].length,u=a.length-c;if(a.slice(u-t.length,u)==t&&l.slice(h,h+n.length)==n)return{open:{pos:r-c,margin:c&&1},close:{pos:i+h,margin:h&&1}};i-r<=2*v?o=s=e.sliceDoc(r,i):(o=e.sliceDoc(r,r+v),s=e.sliceDoc(i-v,i));let f=/^\s*/.exec(o)[0].length,d=/\s*$/.exec(s)[0].length,p=s.length-d-n.length;return o.slice(f,f+t.length)==t&&s.slice(p,p+n.length)==n?{open:{pos:r+f+t.length,margin:/\s/.test(o.charAt(f+t.length))?1:0},close:{pos:i-d-n.length,margin:/\s/.test(s.charAt(p-1))?1:0}}:null}(t,r[n],e.from,e.to)));if(2!=e&&!i.every((e=>e)))return{changes:t.changes(n.map(((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+" "},{from:e.to,insert:" "+r[t].close}])))};if(1!=e&&i.some((e=>e))){let e=[];for(let t,n=0;ni&&(e==o||o>a.from)){i=a.from;let e=g(t,n).line;if(!e)continue;let o=/^\s*/.exec(a.text)[0].length,l=o==a.length,c=a.text.slice(o,o+e.length)==e?o:-1;oe.comment<0&&(!e.empty||e.single)))){let e=[];for(let{line:t,token:n,indent:i,empty:o,single:s}of r)!s&&o||e.push({from:t.from+i,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&r.some((e=>e.comment>=0))){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,o=r+i.length;" "==t.text[o-t.from]&&o++,e.push({from:r,to:o})}return{changes:e}}return null}const w=r.Annotation.define(),x=r.Annotation.define(),k=r.Facet.define(),S=r.Facet.define({combine:e=>r.combineConfig(e,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min})}),A=r.StateField.define({create:()=>H.empty,update(e,t){let n=t.state.facet(S),i=t.annotation(w);if(i){let o=t.docChanged?r.EditorSelection.single(function(e){let t=0;return e.iterChangedRanges(((e,n)=>t=n)),t}(t.changes)):void 0,s=P.fromTransaction(t,o),a=i.side,l=0==a?e.undone:e.done;return l=s?D(l,l.length,n.minDepth,s):L(l,t.startState.selection),new H(0==a?i.rest:l,0==a?l:i.rest)}let o=t.annotation(x);if("full"!=o&&"before"!=o||(e=e.isolate()),!1===t.annotation(r.Transaction.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let s=P.fromTransaction(t),a=t.annotation(r.Transaction.time),l=t.annotation(r.Transaction.userEvent);return s?e=e.addChanges(s,a,l,n.newGroupDelay,n.minDepth):t.selection&&(e=e.addSelection(t.startState.selection,a,l,n.newGroupDelay)),"full"!=o&&"after"!=o||(e=e.isolate()),e},toJSON:e=>({done:e.done.map((e=>e.toJSON())),undone:e.undone.map((e=>e.toJSON()))}),fromJSON:e=>new H(e.done.map(P.fromJSON),e.undone.map(P.fromJSON))}),C=A;function O(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(A,!1);if(!i)return!1;let o=i.pop(e,n,t);return!!o&&(r(o),!0)}}const E=O(0,!1),j=O(1,!1),M=O(0,!0),I=O(1,!0);function T(e){return function(t){let n=t.field(A,!1);if(!n)return 0;let r=0==e?n.done:n.undone;return r.length-(r.length&&!r[0].changes?1:0)}}const $=T(0),_=T(1);class P{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(e){return new P(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map((e=>e.toJSON()))}}static fromJSON(e){return new P(e.changes&&r.ChangeSet.fromJSON(e.changes),[],e.mapped&&r.ChangeDesc.fromJSON(e.mapped),e.startSelection&&r.EditorSelection.fromJSON(e.startSelection),e.selectionsAfter.map(r.EditorSelection.fromJSON))}static fromTransaction(e,t){let n=N;for(let t of e.startState.facet(k)){let r=t(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new P(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,N)}static selection(e){return new P(void 0,N,void 0,void 0,e)}}function D(e,t,n,r){let i=t+1>n+20?t-n-1:0,o=e.slice(i,t);return o.push(r),o}function R(e,t){return e.length?t.length?e.concat(t):e:t}const N=[],B=200;function L(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-B));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),D(e,e.length-1,1e9,n.setSelAfter(r)))}return[P.selection([t])]}function F(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function V(e,t){if(!e.length)return e;let n=e.length,r=N;for(;n;){let i=z(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[P.selection(r)]:N}function z(e,t,n){let i=R(e.selectionsAfter.length?e.selectionsAfter.map((e=>e.map(t))):N,n);if(!e.changes)return P.selection(i);let o=e.changes.map(t),s=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(s):s;return new P(o,r.StateEffect.mapEffects(e.effects,t),a,e.startSelection.map(s),i)}const q=/^(input\.type|delete)($|\.)/;class H{constructor(e,t,n=0,r=undefined){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new H(this.done,this.undone):this}addChanges(e,t,n,r,i){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&e.changes&&(!n||q.test(n))&&(!s.selectionsAfter.length&&t-this.prevTimen.push(e,t))),t.iterChangedRanges(((e,t,i,o)=>{for(let e=0;e=t&&i<=s&&(r=!0)}})),r}(s.changes,e.changes)||"input.type.compose"==n)?D(o,o.length-1,i,new P(e.changes.compose(s.changes),R(e.effects,s.effects),s.mapped,s.startSelection,N)):D(o,o.length,i,e),new H(o,N,t,n)}addSelection(e,t,n,r){let i=this.done.length?this.done[this.done.length-1].selectionsAfter:N;return i.length>0&&t-this.prevTimee.empty!=s.ranges[t].empty)).length)?this:new H(L(this.done,e),this.undone,t,n);var o,s}addMapping(e){return new H(V(this.done,e),V(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=0==e?this.done:this.undone;if(0==r.length)return null;let i=r[r.length-1];if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:w.of({side:e,rest:F(r)}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(i.changes){let n=1==r.length?N:r.slice(0,r.length-1);return i.mapped&&(n=V(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:w.of({side:e,rest:n}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}H.empty=new H(N,N);const W=[{key:"Mod-z",run:E,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:j,preventDefault:!0},{linux:"Ctrl-Shift-z",run:j,preventDefault:!0},{key:"Mod-u",run:M,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:I,preventDefault:!0}];function U(e,t){return r.EditorSelection.create(e.ranges.map(t),e.mainIndex)}function J(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function K({state:e,dispatch:t},n){let r=U(e.selection,n);return!r.eq(e.selection)&&(t(J(e,r)),!0)}function G(e,t){return r.EditorSelection.cursor(t?e.to:e.from)}function Q(e,t){return K(e,(n=>n.empty?e.moveByChar(n,t):G(n,t)))}function Z(e){return e.textDirectionAt(e.state.selection.main.head)==i.Direction.LTR}const Y=e=>Q(e,!Z(e)),X=e=>Q(e,Z(e));function ee(e,t){return K(e,(n=>n.empty?e.moveByGroup(n,t):G(n,t)))}const te=e=>ee(e,!Z(e)),ne=e=>ee(e,Z(e));function re(e,t,n){let i=e.state.charCategorizer(t.from);return e.moveByChar(t,n,(o=>{let s=r.CharCategory.Space,a=t.from,l=!1,c=!1,h=!1,u=t=>{if(l)return!1;a+=n?t.length:-t.length;let o,u=i(t);if(s==r.CharCategory.Space&&(s=u),s!=u)return!1;if(s==r.CharCategory.Word)if(t.toLowerCase()==t){if(!n&&c)return!1;h=!0}else if(h){if(n)return!1;l=!0}else{if(c&&n&&i(o=e.state.sliceDoc(a,a+1))==r.CharCategory.Word&&o.toLowerCase()==o)return!1;c=!0}return!0};return u(o),u}))}function ie(e,t){return K(e,(n=>n.empty?re(e,n,t):G(n,t)))}function oe(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function se(e,t,n){let i,a,l=o.syntaxTree(e).resolveInner(t.head),c=n?s.NodeProp.closedBy:s.NodeProp.openedBy;for(let r=t.head;;){let t=n?l.childAfter(r):l.childBefore(r);if(!t)break;oe(e,t,c)?l=t:r=n?t.to:t.from}return a=l.type.prop(c)&&(i=n?o.matchBrackets(e,l.from,1):o.matchBrackets(e,l.to,-1))&&i.matched?n?i.end.to:i.end.from:n?l.to:l.from,r.EditorSelection.cursor(a,n?-1:1)}const ae=e=>K(e,(t=>se(e.state,t,!Z(e)))),le=e=>K(e,(t=>se(e.state,t,Z(e))));function ce(e,t){return K(e,(n=>{if(!n.empty)return G(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)}))}const he=e=>ce(e,!1),ue=e=>ce(e,!0);function fe(e){return Math.max(e.defaultLineHeight,Math.min(e.dom.clientHeight,innerHeight)-5)}function de(e,t){let{state:n}=e,r=U(n.selection,(n=>n.empty?e.moveVertically(n,t,fe(e)):G(n,t)));if(r.eq(n.selection))return!1;let o,s=e.coordsAtPos(n.selection.main.head),a=e.scrollDOM.getBoundingClientRect();return s&&s.top>a.top&&s.bottomde(e,!1),me=e=>de(e,!0);function ge(e,t,n){let i=e.lineBlockAt(t.head),o=e.moveToLineBoundary(t,n);if(o.head==t.head&&o.head!=(n?i.to:i.from)&&(o=e.moveToLineBoundary(t,n,!1)),!n&&o.head==i.from&&i.length){let n=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;n&&t.head!=i.from+n&&(o=r.EditorSelection.cursor(i.from+n))}return o}const ve=e=>K(e,(t=>ge(e,t,!0))),ye=e=>K(e,(t=>ge(e,t,!1))),be=e=>K(e,(t=>r.EditorSelection.cursor(e.lineBlockAt(t.head).from,1))),we=e=>K(e,(t=>r.EditorSelection.cursor(e.lineBlockAt(t.head).to,-1)));function xe(e,t,n){let i=!1,s=U(e.selection,(t=>{let s=o.matchBrackets(e,t.head,-1)||o.matchBrackets(e,t.head,1)||t.head>0&&o.matchBrackets(e,t.head-1,1)||t.headxe(e,t,!1);function Se(e,t){let n=U(e.state.selection,(e=>{let n=t(e);return r.EditorSelection.range(e.anchor,n.head,n.goalColumn)}));return!n.eq(e.state.selection)&&(e.dispatch(J(e.state,n)),!0)}function Ae(e,t){return Se(e,(n=>e.moveByChar(n,t)))}const Ce=e=>Ae(e,!Z(e)),Oe=e=>Ae(e,Z(e));function Ee(e,t){return Se(e,(n=>e.moveByGroup(n,t)))}const je=e=>Ee(e,!Z(e)),Me=e=>Ee(e,Z(e));function Ie(e,t){return Se(e,(n=>re(e,n,t)))}const Te=e=>Se(e,(t=>se(e.state,t,!Z(e)))),$e=e=>Se(e,(t=>se(e.state,t,Z(e))));function _e(e,t){return Se(e,(n=>e.moveVertically(n,t)))}const Pe=e=>_e(e,!1),De=e=>_e(e,!0);function Re(e,t){return Se(e,(n=>e.moveVertically(n,t,fe(e))))}const Ne=e=>Re(e,!1),Be=e=>Re(e,!0),Le=e=>Se(e,(t=>ge(e,t,!0))),Fe=e=>Se(e,(t=>ge(e,t,!1))),Ve=e=>Se(e,(t=>r.EditorSelection.cursor(e.lineBlockAt(t.head).from))),ze=e=>Se(e,(t=>r.EditorSelection.cursor(e.lineBlockAt(t.head).to))),qe=({state:e,dispatch:t})=>(t(J(e,{anchor:0})),!0),He=({state:e,dispatch:t})=>(t(J(e,{anchor:e.doc.length})),!0),We=({state:e,dispatch:t})=>(t(J(e,{anchor:e.selection.main.anchor,head:0})),!0),Ue=({state:e,dispatch:t})=>(t(J(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Je=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Ke=({state:e,dispatch:t})=>{let n=ct(e).map((({from:t,to:n})=>r.EditorSelection.range(t,Math.min(n+1,e.doc.length))));return t(e.update({selection:r.EditorSelection.create(n),userEvent:"select"})),!0},Ge=({state:e,dispatch:t})=>{let n=U(e.selection,(t=>{var n;let i=o.syntaxTree(e).resolveInner(t.head,1);for(;!(i.from=t.to||i.to>t.to&&i.from<=t.from)&&(null===(n=i.parent)||void 0===n?void 0:n.parent);)i=i.parent;return r.EditorSelection.range(i.to,i.from)}));return t(J(e,n)),!0},Qe=({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=r.EditorSelection.create([n.main]):n.main.empty||(i=r.EditorSelection.create([r.EditorSelection.cursor(n.main.head)])),!!i&&(t(J(e,i)),!0)};function Ze({state:e,dispatch:t},n){if(e.readOnly)return!1;let o="delete.selection",s=e.changeByRange((e=>{let{from:t,to:i}=e;if(t==i){let e=n(t);et&&(o="delete.forward"),t=Math.min(t,e),i=Math.max(i,e)}return t==i?{range:e}:{changes:{from:t,to:i},range:r.EditorSelection.cursor(t)}}));return!s.changes.empty&&(t(e.update(s,{scrollIntoView:!0,userEvent:o,effects:"delete.selection"==o?i.EditorView.announce.of(e.phrase("Selection deleted")):void 0})),!0)}function Ye(e,t,n){if(e instanceof i.EditorView)for(let r of e.state.facet(i.EditorView.atomicRanges).map((t=>t(e))))r.between(t,t,((e,r)=>{et&&(t=n?r:e)}));return t}const Xe=(e,t)=>Ze(e,(n=>{let i,s,{state:a}=e,l=a.doc.lineAt(n);if(!t&&n>l.from&&nXe(e,!1),tt=e=>Xe(e,!0),nt=(e,t)=>Ze(e,(n=>{let i=n,{state:o}=e,s=o.doc.lineAt(i),a=o.charCategorizer(i);for(let e=null;;){if(i==(t?s.to:s.from)){i==n&&s.number!=(t?o.doc.lines:1)&&(i+=t?1:-1);break}let l=r.findClusterBreak(s.text,i-s.from,t)+s.from,c=s.text.slice(Math.min(i,l)-s.from,Math.max(i,l)-s.from),h=a(c);if(null!=e&&h!=e)break;" "==c&&i==n||(e=h),i=l}return Ye(e,i,t)})),rt=e=>nt(e,!1),it=e=>nt(e,!0),ot=e=>Ze(e,(t=>{let n=e.lineBlockAt(t).to;return Ye(e,tZe(e,(t=>{let n=e.lineBlockAt(t).from;return Ye(e,t>n?n:Math.max(0,t-1),!1)})),at=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:r.Text.of(["",""])},range:r.EditorSelection.cursor(e.from)})));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},lt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange((t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,i=e.doc.lineAt(n),o=n==i.from?n-1:r.findClusterBreak(i.text,n-i.from,!1)+i.from,s=n==i.to?n+1:r.findClusterBreak(i.text,n-i.from,!0)+i.from;return{changes:{from:o,to:s,insert:e.doc.slice(n,s).append(e.doc.slice(o,n))},range:r.EditorSelection.cursor(s)}}));return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function ct(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),o=e.doc.lineAt(r.to);if(r.empty||r.to!=o.from||(o=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=o.to,e.ranges.push(r)}else t.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return t}function ht(e,t,n){if(e.readOnly)return!1;let i=[],o=[];for(let t of ct(e)){if(n?t.to==e.doc.length:0==t.from)continue;let s=e.doc.lineAt(n?t.to+1:t.from-1),a=s.length+1;if(n){i.push({from:t.to,to:s.to},{from:t.from,insert:s.text+e.lineBreak});for(let n of t.ranges)o.push(r.EditorSelection.range(Math.min(e.doc.length,n.anchor+a),Math.min(e.doc.length,n.head+a)))}else{i.push({from:s.from,to:t.from},{from:t.to,insert:e.lineBreak+s.text});for(let e of t.ranges)o.push(r.EditorSelection.range(e.anchor-a,e.head-a))}}return!!i.length&&(t(e.update({changes:i,scrollIntoView:!0,selection:r.EditorSelection.create(o,e.selection.mainIndex),userEvent:"move.line"})),!0)}const ut=({state:e,dispatch:t})=>ht(e,t,!1),ft=({state:e,dispatch:t})=>ht(e,t,!0);function dt(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of ct(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});return t(e.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const pt=({state:e,dispatch:t})=>dt(e,t,!1),mt=({state:e,dispatch:t})=>dt(e,t,!0),gt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(ct(t).map((({from:e,to:n})=>(e>0?e--:ne.moveVertically(t,!0))).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0},vt=bt(!1),yt=bt(!0);function bt(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange((n=>{let{from:i,to:a}=n,l=t.doc.lineAt(i),c=!e&&i==a&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n,r=o.syntaxTree(e).resolveInner(t),i=r.childBefore(t),a=r.childAfter(t);return i&&a&&i.to<=t&&a.from>=t&&(n=i.type.prop(s.NodeProp.closedBy))&&n.indexOf(a.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(a.from).from?{from:i.to,to:a.from}:null}(t,i);e&&(i=a=(a<=l.to?l:t.doc.lineAt(a)).to);let h=new o.IndentContext(t,{simulateBreak:i,simulateDoubleBreak:!!c}),u=o.getIndentation(h,i);for(null==u&&(u=/^\s*/.exec(t.doc.lineAt(i).text)[0].length);al.from&&i{let o=[];for(let r=i.from;r<=i.to;){let s=e.doc.lineAt(r);s.number>n&&(i.empty||i.to>s.from)&&(t(s,o,i),n=s.number),r=s.to+1}let s=e.changes(o);return{changes:o,range:r.EditorSelection.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}}))}const xt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new o.IndentContext(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),i=wt(e,((t,i,s)=>{let a=o.getIndentation(r,t.from);if(null==a)return;/\S/.test(t.text)||(a=0);let l=/^\s*/.exec(t.text)[0],c=o.indentString(e,a);(l!=c||s.from!e.readOnly&&(t(e.update(wt(e,((t,n)=>{n.push({from:t.from,insert:e.facet(o.indentUnit)})})),{userEvent:"input.indent"})),!0),St=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(wt(e,((t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let s=r.countColumn(i,e.tabSize),a=0,l=o.indentString(e,Math.max(0,s-o.getIndentUnit(e)));for(;a({mac:e.key,run:e.run,shift:e.shift})))),Ot=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:ae,shift:Te},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:le,shift:$e},{key:"Alt-ArrowUp",run:ut},{key:"Shift-Alt-ArrowUp",run:pt},{key:"Alt-ArrowDown",run:ft},{key:"Shift-Alt-ArrowDown",run:mt},{key:"Escape",run:Qe},{key:"Mod-Enter",run:yt},{key:"Alt-l",mac:"Ctrl-l",run:Ke},{key:"Mod-i",run:Ge,preventDefault:!0},{key:"Mod-[",run:St},{key:"Mod-]",run:kt},{key:"Mod-Alt-\\",run:xt},{key:"Shift-Mod-k",run:gt},{key:"Shift-Mod-\\",run:ke},{key:"Mod-/",run:a},{key:"Alt-A",run:f}].concat(Ct),Et={key:"Tab",run:kt,shift:St};t.blockComment=d,t.blockUncomment=p,t.copyLineDown=mt,t.copyLineUp=pt,t.cursorCharBackward=e=>Q(e,!1),t.cursorCharForward=e=>Q(e,!0),t.cursorCharLeft=Y,t.cursorCharRight=X,t.cursorDocEnd=He,t.cursorDocStart=qe,t.cursorGroupBackward=e=>ee(e,!1),t.cursorGroupForward=e=>ee(e,!0),t.cursorGroupLeft=te,t.cursorGroupRight=ne,t.cursorLineBoundaryBackward=ye,t.cursorLineBoundaryForward=ve,t.cursorLineDown=ue,t.cursorLineEnd=we,t.cursorLineStart=be,t.cursorLineUp=he,t.cursorMatchingBracket=ke,t.cursorPageDown=me,t.cursorPageUp=pe,t.cursorSubwordBackward=e=>ie(e,!1),t.cursorSubwordForward=e=>ie(e,!0),t.cursorSyntaxLeft=ae,t.cursorSyntaxRight=le,t.defaultKeymap=Ot,t.deleteCharBackward=et,t.deleteCharForward=tt,t.deleteGroupBackward=rt,t.deleteGroupForward=it,t.deleteLine=gt,t.deleteToLineEnd=ot,t.deleteToLineStart=st,t.deleteTrailingWhitespace=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=[];for(let t=0,r="",i=e.doc.iter();;){if(i.next(),i.lineBreak||i.done){let e=r.search(/\s+$/);if(e>-1&&n.push({from:t-(r.length-e),to:t}),i.done)break;r=""}else r=i.value;t+=i.value.length}return!!n.length&&(t(e.update({changes:n,userEvent:"delete"})),!0)},t.emacsStyleKeymap=At,t.history=function(e={}){return[A,S.of(e),i.EditorView.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?E:"historyRedo"==e.inputType?j:null;return!!n&&(e.preventDefault(),n(t))}})]},t.historyField=C,t.historyKeymap=W,t.indentLess=St,t.indentMore=kt,t.indentSelection=xt,t.indentWithTab=Et,t.insertBlankLine=yt,t.insertNewline=({state:e,dispatch:t})=>(t(e.update(e.replaceSelection(e.lineBreak),{scrollIntoView:!0,userEvent:"input"})),!0),t.insertNewlineAndIndent=vt,t.insertTab=({state:e,dispatch:t})=>e.selection.ranges.some((e=>!e.empty))?kt({state:e,dispatch:t}):(t(e.update(e.replaceSelection("\t"),{scrollIntoView:!0,userEvent:"input"})),!0),t.invertedEffects=k,t.isolateHistory=x,t.lineComment=h,t.lineUncomment=u,t.moveLineDown=ft,t.moveLineUp=ut,t.redo=j,t.redoDepth=_,t.redoSelection=I,t.selectAll=Je,t.selectCharBackward=e=>Ae(e,!1),t.selectCharForward=e=>Ae(e,!0),t.selectCharLeft=Ce,t.selectCharRight=Oe,t.selectDocEnd=Ue,t.selectDocStart=We,t.selectGroupBackward=e=>Ee(e,!1),t.selectGroupForward=e=>Ee(e,!0),t.selectGroupLeft=je,t.selectGroupRight=Me,t.selectLine=Ke,t.selectLineBoundaryBackward=Fe,t.selectLineBoundaryForward=Le,t.selectLineDown=De,t.selectLineEnd=ze,t.selectLineStart=Ve,t.selectLineUp=Pe,t.selectMatchingBracket=({state:e,dispatch:t})=>xe(e,t,!0),t.selectPageDown=Be,t.selectPageUp=Ne,t.selectParentSyntax=Ge,t.selectSubwordBackward=e=>Ie(e,!1),t.selectSubwordForward=e=>Ie(e,!0),t.selectSyntaxLeft=Te,t.selectSyntaxRight=$e,t.simplifySelection=Qe,t.splitLine=at,t.standardKeymap=Ct,t.toggleBlockComment=f,t.toggleBlockCommentByLine=m,t.toggleComment=a,t.toggleLineComment=c,t.transposeChars=lt,t.undo=E,t.undoDepth=$,t.undoSelection=M},1184:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9922),i=n(729);const o=i.LRLanguage.define({name:"json",parser:r.parser.configure({props:[i.indentNodeProp.add({Object:i.continuedIndent({except:/^\s*\}/}),Array:i.continuedIndent({except:/^\s*\]/})}),i.foldNodeProp.add({"Object Array":i.foldInside})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});t.json=function(){return new i.LanguageSupport(o)},t.jsonLanguage=o,t.jsonParseLinter=()=>e=>{try{JSON.parse(e.state.doc.toString())}catch(t){if(!(t instanceof SyntaxError))throw t;const n=function(e,t){let n;return(n=e.message.match(/at position (\d+)/))?Math.min(+n[1],t.length):(n=e.message.match(/at line (\d+) column (\d+)/))?Math.min(t.line(+n[1]).from+ +n[2]-1,t.length):0}(t,e.state.doc);return[{from:n,message:t.message,severity:"error",to:n}]}return[]}},729:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(7897),o=n(7040),s=n(3642),a=n(5048),l=n(7223);const c=new i.NodeProp;function h(e){return o.Facet.define({combine:e?t=>t.concat(e):void 0})}class u{constructor(e,t,n=[]){this.data=e,o.EditorState.prototype.hasOwnProperty("tree")||Object.defineProperty(o.EditorState.prototype,"tree",{get(){return p(this)}}),this.parser=t,this.extension=[A.of(this),o.EditorState.languageData.of(((e,t,n)=>e.facet(f(e,t,n))))].concat(n)}isActiveAt(e,t,n=-1){return f(e,t,n)==this.data}findRegions(e){let t=e.facet(A);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(c)==this.data)return void n.push({from:t,to:t+e.length});let o=e.prop(i.NodeProp.mounted);if(o){if(o.tree.prop(c)==this.data){if(o.overlay)for(let e of o.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(o.overlay){let e=n.length;if(r(o.tree,o.overlay[0].from+t),n.length>e)return}}for(let n=0;ne.isTop?t:void 0))]}))}configure(e){return new d(this.data,this.parser.configure(e))}get allowsNesting(){return this.parser.hasWrappers()}}function p(e){let t=e.field(u.state,!1);return t?t.tree:i.Tree.empty}function m(e,t,n=50){var r;let i=null===(r=e.field(u.state,!1))||void 0===r?void 0:r.context;return i&&(i.isDone(t)||i.work(n,t))?i.tree:null}class g{constructor(e,t=e.length){this.doc=e,this.length=t,this.cursorPos=0,this.string="",this.cursor=e.iter()}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let v=null;class y{constructor(e,t,n=[],r,i,o,s,a){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=o,this.skipped=s,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new y(e,t,[],i.Tree.empty,0,n,[],null)}startParse(){return this.parser.startParse(new g(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=i.Tree.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext((()=>{for(;!(t=this.parse.advance()););})),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(i.TreeFragment.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=v;v=this;try{return e()}finally{v=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=b(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:o,viewport:s,skipped:a}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges(((e,n,r,i)=>t.push({fromA:e,toA:n,fromB:r,toB:i}))),n=i.TreeFragment.applyChanges(n,t),r=i.Tree.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){a=[];for(let t of this.skipped){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);ne.from&&(this.fragments=b(this.fragments,n,r),this.skipped.splice(t--,1))}return!(this.skipped.length>=t||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends i.Parser{createParse(t,n,r){let o=r[0].from,s=r[r.length-1].to;return{parsedPos:o,advance(){let t=v;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=s,new i.Tree(i.NodeType.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return v}}function b(e,t,n){return i.TreeFragment.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class w{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new w(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=y.create(e.facet(A).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new w(n)}}u.state=o.StateField.define({create:w.init,update(e,t){for(let e of t.effects)if(e.is(u.setState))return e.value;return t.startState.facet(A)!=t.state.facet(A)?w.init(t.state):e.apply(t)}});let x=e=>{let t=setTimeout((()=>e()),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(x=e=>{let t=-1,n=setTimeout((()=>{t=requestIdleCallback(e,{timeout:400})}),100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const k="undefined"!=typeof navigator&&(null===(r=navigator.scheduling)||void 0===r?void 0:r.isInputPending)?()=>navigator.scheduling.isInputPending():null,S=s.ViewPlugin.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(u.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(u.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=x(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndr+1e3,a=i.context.work((()=>k&&k()||Date.now()>o),r+(s?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:u.setState.of(new w(i.context))})),this.chunkBudget>0&&(!a||s)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then((()=>this.scheduleWork())).catch((e=>s.logException(this.view.state,e))).then((()=>this.workScheduled--)),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),A=o.Facet.define({combine:e=>e.length?e[0]:null,enables:[u.state,S]});class C{constructor(e,t,n,r,i,o=undefined){this.name=e,this.alias=t,this.extensions=n,this.filename=r,this.loadFunc=i,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then((e=>this.support=e),(e=>{throw this.loading=null,e})))}static of(e){let{load:t,support:n}=e;if(!t){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(n)}return new C(e.name,(e.alias||[]).concat(e.name).map((e=>e.toLowerCase())),e.extensions||[],e.filename,t,n)}static matchFilename(e,t){for(let n of e)if(n.filename&&n.filename.test(t))return n;let n=/\.([^.]+)$/.exec(t);if(n)for(let t of e)if(t.extensions.indexOf(n[1])>-1)return t;return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let n of e)if(n.alias.some((e=>e==t)))return n;if(n)for(let n of e)for(let e of n.alias){let r=t.indexOf(e);if(r>-1&&(e.length>2||!/\w/.test(t[r-1])&&!/\w/.test(t[r+e.length])))return n}return null}}const O=o.Facet.define(),E=o.Facet.define({combine:e=>{if(!e.length)return" ";if(!/^(?: +|\t+)$/.test(e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return e[0]}});function j(e){let t=e.facet(E);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function M(e,t){let n="",r=e.tabSize;if(9==e.facet(E).charCodeAt(0))for(;t>=r;)n+="\t",t-=r;for(let e=0;e=n.from&&r<=n.to?i&&r==e?{text:"",from:e}:(t<0?r-1&&(i+=o-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return o.countColumn(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const $=new i.NodeProp;function _(e){let t=e.type.prop($);if(t)return t;let n,r=e.firstChild;if(r&&(n=r.type.prop(i.NodeProp.closedBy))){let t=e.lastChild,r=t&&n.indexOf(t.name)>-1;return e=>B(e,!0,1,void 0,r&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?D:null}function P(e,t,n){for(;e;e=e.parent){let r=_(e);if(r)return r(R.create(n,t,e))}return null}function D(){return 0}class R extends T{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.node=n}static create(e,t,n){return new R(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){let e=this.state.doc.lineAt(this.node.from);for(;;){let t=this.node.resolve(e.from);for(;t.parent&&t.parent.from==t.from;)t=t.parent;if(N(t,this.node))break;e=this.state.doc.lineAt(t.from)}return this.lineIndent(e.from)}continue(){let e=this.node.parent;return e?P(e,this.pos,this.base):0}}function N(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function B(e,t,n,r,i){let o=e.textAfter,s=o.match(/^\s*/)[0].length,a=r&&o.slice(s,s+r.length)==r||i==e.pos+s,l=t?function(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),s=null==i||i<=o.from?o.to:Math.min(o.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped)return i.fromn)continue;if(i&&o.from=t&&r.to>n&&(i=r)}}return i}(e,t,n)}function q(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}const H=o.StateEffect.define({map:q}),W=o.StateEffect.define({map:q});function U(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some((e=>e.from<=n&&e.to>=n))||t.push(e.lineBlockAt(n));return t}const J=o.StateField.define({create:()=>s.Decoration.none,update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(H)&&!G(e,n.value.from,n.value.to)?e=e.update({add:[se.range(n.value.from,n.value.to)]}):n.is(W)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));if(t.selection){let n=!1,{head:r}=t.selection.main;e.between(r,r,((e,t)=>{er&&(n=!0)})),n&&(e=e.update({filterFrom:r,filterTo:r,filter:(e,t)=>t<=r||e>=r}))}return e},provide:e=>s.EditorView.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,((e,t)=>{n.push(e,t)})),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{(!i||i.from>e)&&(i={from:e,to:t})})),i}function G(e,t,n){let r=!1;return e.between(t,t,((e,i)=>{e==t&&i==n&&(r=!0)})),r}function Q(e,t){return e.field(J,!1)?t:t.concat(o.StateEffect.appendConfig.of(oe()))}const Z=e=>{for(let t of U(e)){let n=z(e.state,t.from,t.to);if(n)return e.dispatch({effects:Q(e.state,[H.of(n),X(e,n)])}),!0}return!1},Y=e=>{if(!e.state.field(J,!1))return!1;let t=[];for(let n of U(e)){let r=K(e.state,n.from,n.to);r&&t.push(W.of(r),X(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function X(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return s.EditorView.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${e.state.phrase("to")} ${i}.`)}const ee=e=>{let{state:t}=e,n=[];for(let r=0;r{let t=e.state.field(J,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,((e,t)=>{n.push(W.of({from:e,to:t}))})),e.dispatch({effects:n}),!0},ne=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Z},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Y},{key:"Ctrl-Alt-[",run:ee},{key:"Ctrl-Alt-]",run:te}],re={placeholderDOM:null,placeholderText:"…"},ie=o.Facet.define({combine:e=>o.combineConfig(e,re)});function oe(e){let t=[J,ce];return e&&t.push(ie.of(e)),t}const se=s.Decoration.replace({widget:new class extends s.WidgetType{toDOM(e){let{state:t}=e,n=t.facet(ie),r=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=K(e.state,n.from,n.to);r&&e.dispatch({effects:W.of(r)}),t.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(e,r);let i=document.createElement("span");return i.textContent=n.placeholderText,i.setAttribute("aria-label",t.phrase("folded code")),i.title=t.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=r,i}}}),ae={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class le extends s.GutterMarker{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}const ce=s.EditorView.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class he{constructor(e,t){let n;function r(e){let t=l.StyleModule.newName();return(n||(n=Object.create(null)))["."+t]=e,t}const i="string"==typeof t.all?t.all:t.all?r(t.all):void 0,o=t.scope;this.scope=o instanceof u?e=>e.prop(c)==o.data:o?e=>e==o:void 0,this.style=a.tagHighlighter(e.map((e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))}))),{all:i}).style,this.module=n?new l.StyleModule(n):null,this.themeType=t.themeType}static define(e,t){return new he(e,t||{})}}const ue=o.Facet.define(),fe=o.Facet.define({combine:e=>e.length?[e[0]]:null});function de(e){let t=e.facet(ue);return t.length?t:e.facet(fe)}const pe=o.Prec.high(s.ViewPlugin.fromClass(class{constructor(e){this.markCache=Object.create(null),this.tree=p(e.state),this.decorations=this.buildDeco(e,de(e.state))}update(e){let t=p(e.state),n=de(e.state),r=n!=de(e.startState);t.length{n.add(e,t,this.markCache[r]||(this.markCache[r]=s.Decoration.mark({class:r})))}),r,i);return n.finish()}},{decorations:e=>e.decorations})),me=he.define([{tag:a.tags.meta,color:"#7a757a"},{tag:a.tags.link,textDecoration:"underline"},{tag:a.tags.heading,textDecoration:"underline",fontWeight:"bold"},{tag:a.tags.emphasis,fontStyle:"italic"},{tag:a.tags.strong,fontWeight:"bold"},{tag:a.tags.strikethrough,textDecoration:"line-through"},{tag:a.tags.keyword,color:"#708"},{tag:[a.tags.atom,a.tags.bool,a.tags.url,a.tags.contentSeparator,a.tags.labelName],color:"#219"},{tag:[a.tags.literal,a.tags.inserted],color:"#164"},{tag:[a.tags.string,a.tags.deleted],color:"#a11"},{tag:[a.tags.regexp,a.tags.escape,a.tags.special(a.tags.string)],color:"#e40"},{tag:a.tags.definition(a.tags.variableName),color:"#00f"},{tag:a.tags.local(a.tags.variableName),color:"#30a"},{tag:[a.tags.typeName,a.tags.namespace],color:"#085"},{tag:a.tags.className,color:"#167"},{tag:[a.tags.special(a.tags.variableName),a.tags.macroName],color:"#256"},{tag:a.tags.definition(a.tags.propertyName),color:"#00c"},{tag:a.tags.comment,color:"#940"},{tag:a.tags.invalid,color:"#f00"}]),ge=s.EditorView.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),ve="()[]{}",ye=o.Facet.define({combine:e=>o.combineConfig(e,{afterCursor:!0,brackets:ve,maxScanDistance:1e4,renderMatch:xe})}),be=s.Decoration.mark({class:"cm-matchingBracket"}),we=s.Decoration.mark({class:"cm-nonmatchingBracket"});function xe(e){let t=[],n=e.matched?be:we;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}const ke=[o.StateField.define({create:()=>s.Decoration.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],r=t.state.facet(ye);for(let e of t.state.selection.ranges){if(!e.empty)continue;let i=Ae(t.state,e.head,-1,r)||e.head>0&&Ae(t.state,e.head-1,1,r)||r.afterCursor&&(Ae(t.state,e.head,1,r)||e.heads.EditorView.decorations.from(e)}),ge];function Se(e,t,n){let r=e.prop(t<0?i.NodeProp.openedBy:i.NodeProp.closedBy);if(r)return r;if(1==e.name.length){let r=n.indexOf(e.name);if(r>-1&&r%2==(t<0?1:0))return[n[r+t]]}return null}function Ae(e,t,n,r={}){let i=r.maxScanDistance||1e4,o=r.brackets||ve,s=p(e),a=s.resolveInner(t,n);for(let e=a;e;e=e.parent){let t=Se(e.type,n,o);if(t&&e.from0)return null;let c={from:n<0?t-1:t,to:n>0?t+1:t},h=e.doc.iterRange(t,n>0?e.doc.length:0),u=0;for(let e=0;!h.next().done&&e<=o;){let o=h.value;n<0&&(e+=o.length);let a=t+e*n;for(let e=n>0?0:o.length-1,t=n>0?o.length:-1;e!=t;e+=n){let t=s.indexOf(o[e]);if(!(t<0||r.resolveInner(a+e,1).type!=i))if(t%2==0==n>0)u++;else{if(1==u)return{start:c,end:{from:a+e,to:a+e+1},matched:t>>1==l>>1};u--}}n>0&&(e+=o.length)}return h.done?{start:c,matched:!1}:null}(e,t,n,s,a.type,i,o)}function Ce(e,t,n,r,i,o){let s=r.parent,a={from:r.from,to:r.to},l=0,c=null==s?void 0:s.cursor();if(c&&(n<0?c.childBefore(r.from):c.childAfter(r.to)))do{if(n<0?c.to<=r.from:c.from>=r.to){if(0==l&&i.indexOf(c.type.name)>-1&&c.from=this.string.length}sol(){return 0==this.pos}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosn?e.toLowerCase():e;return r(this.string.substr(this.pos,e.length))==r(e)?(!1!==t&&(this.pos+=e.length),!0):null}{let n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}}function je(e){if("object"!=typeof e)return e;let t={};for(let n in e){let r=e[n];t[n]=r instanceof Array?r.slice():r}return t}class Me extends u{constructor(e){let t,n=h(e.languageData),r={token:(o=e).token,blankLine:o.blankLine||(()=>{}),startState:o.startState||(()=>!0),copyState:o.copyState||je,indent:o.indent||(()=>null),languageData:o.languageData||{},tokenTable:o.tokenTable||Pe};var o;super(n,new class extends i.Parser{createParse(e,n,r){return new $e(t,e,n,r)}},[O.of(((e,t)=>this.getIndent(e,t)))]),this.topNode=function(e){let t=i.NodeType.define({id:De.length,name:"Document",props:[c.add((()=>e))]});return De.push(t),t}(n),t=this,this.streamParser=r,this.stateAfter=new i.NodeProp({perNode:!0}),this.tokenTable=e.tokenTable?new Le(r.tokenTable):Fe}static define(e){return new Me(e)}getIndent(e,t){let n=p(e.state),r=n.resolve(t);for(;r&&r.type!=this.topNode;)r=r.parent;if(!r)return null;let i,o,s=Ie(this,n,0,r.from,t);if(s?(o=s.state,i=s.pos+1):(o=this.streamParser.startState(e.unit),i=0),t-i>1e4)return null;for(;i=r&&n+t.length<=o&&t.prop(e.stateAfter);if(s)return{state:e.streamParser.copyState(s),pos:n+t.length};for(let s=t.children.length-1;s>=0;s--){let a=t.children[s],l=n+t.positions[s],c=a instanceof i.Tree&&l=t.length)return t;o||t.type!=e.topNode||(o=!0);for(let s=t.children.length-1;s>=0;s--){let a,l=t.positions[s],c=t.children[s];if(ln&&Ie(e,r.tree,0-r.offset,n,o);if(s&&(t=Te(e,r.tree,n+r.offset,s.pos+r.offset,!1)))return{state:s.state,tree:t}}return{state:e.streamParser.startState(r?j(r):4),tree:i.Tree.empty}}(e,n,s,null==o?void 0:o.state);this.state=a,this.parsedPos=this.chunkStart=s+l.length;for(let e=0;e=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)"\n"==t&&(t="");else{let e=t.indexOf("\n");e>-1&&(t=t.slice(0,e))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),n=e+t.length;for(let e=this.rangeIndex;;){let r=this.ranges[e].to;if(r>=n)break;if(t=t.slice(0,r-(n-t.length)),e++,e==this.ranges.length)break;let i=this.ranges[e].from,o=this.lineAfter(i);t+=o,n=i+o.length}return{line:t,end:n}}skipGapsTo(e,t,n){for(;;){let r=this.ranges[this.rangeIndex].to,i=e+t;if(n>0?r>i:r>=i)break;t+=this.ranges[++this.rangeIndex].from-r}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){t+=i=this.skipGapsTo(t,i,1);let e=this.chunk.length;n+=i=this.skipGapsTo(n,i,-1),r+=this.chunk.length-e}return this.chunk.push(e,t,n,r),i}parseLine(e){let{line:t,end:n}=this.nextLine(),r=0,{streamParser:i}=this.lang,o=new Ee(t,e?e.state.tabSize:4,e?j(e.state):2);if(o.eol())i.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let e=_e(i.token,o,this.state);if(e&&(r=this.emitToken(this.lang.tokenTable.resolve(e),this.parsedPos+o.start,this.parsedPos+o.pos,4,r)),o.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPost.start)return r}throw new Error("Stream parser failed to advance stream.")}const Pe=Object.create(null),De=[i.NodeType.none],Re=new i.NodeSet(De),Ne=[],Be=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Be[e]=ze(Pe,t);class Le{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Be)}resolve(e){return e?this.table[e]||(this.table[e]=ze(this.extra,e)):0}}const Fe=new Le(Pe);function Ve(e,t){Ne.indexOf(e)>-1||(Ne.push(e),console.warn(t))}function ze(e,t){let n=null;for(let r of t.split(".")){let t=e[r]||a.tags[r];t?"function"==typeof t?n?n=t(n):Ve(r,`Modifier ${r} used at start of tag`):n?Ve(r,`Tag ${r} used as modifier`):n=t:Ve(r,`Unknown highlighting tag ${r}`)}if(!n)return 0;let r=t.replace(/ /g,"_"),o=i.NodeType.define({id:De.length,name:r,props:[a.styleTags({[r]:n})]});return De.push(o),o.id}t.HighlightStyle=he,t.IndentContext=T,t.LRLanguage=d,t.Language=u,t.LanguageDescription=C,t.LanguageSupport=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},t.ParseContext=y,t.StreamLanguage=Me,t.StringStream=Ee,t.TreeIndentContext=R,t.bracketMatching=function(e={}){return[ye.of(e),ke]},t.codeFolding=oe,t.continuedIndent=function({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}},t.defaultHighlightStyle=me,t.defineLanguageFacet=h,t.delimitedIndent=function({closing:e,align:t=!0,units:n=1}){return r=>B(r,t,n,e)},t.ensureSyntaxTree=m,t.flatIndent=e=>e.baseIndent,t.foldAll=ee,t.foldCode=Z,t.foldEffect=H,t.foldGutter=function(e={}){let t=Object.assign(Object.assign({},ae),e),n=new le(t,!0),r=new le(t,!1),i=s.ViewPlugin.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(A)!=e.state.facet(A)||e.startState.field(J,!1)!=e.state.field(J,!1)||p(e.startState)!=p(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new o.RangeSetBuilder;for(let i of e.viewportLineBlocks){let o=K(e.state,i.from,i.to)?r:z(e.state,i.from,i.to)?n:null;o&&t.add(i.from,i.from,o)}return t.finish()}}),{domEventHandlers:a}=t;return[i,s.gutter({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(i))||void 0===t?void 0:t.markers)||o.RangeSet.empty},initialSpacer:()=>new le(t,!1),domEventHandlers:Object.assign(Object.assign({},a),{click:(e,t,n)=>{if(a.click&&a.click(e,t,n))return!0;let r=K(e.state,t.from,t.to);if(r)return e.dispatch({effects:W.of(r)}),!0;let i=z(e.state,t.from,t.to);return!!i&&(e.dispatch({effects:H.of(i)}),!0)}})}),oe()]},t.foldInside=function(e){let t=e.firstChild,n=e.lastChild;return t&&t.to{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+200)return e;let o=n.sliceString(i.from,r);if(!t.some((e=>e.test(o))))return e;let{state:s}=e,a=-1,l=[];for(let{head:e}of s.selection.ranges){let t=s.doc.lineAt(e);if(t.from==a)continue;a=t.from;let n=I(s,t.from);if(null==n)continue;let r=/^\s*/.exec(t.text)[0],i=M(s,n);r!=i&&l.push({from:t.from,to:t.from+r.length,insert:i})}return l.length?[e,{changes:l,sequential:!0}]:e}))},t.indentRange=function(e,t,n){let r=Object.create(null),i=new T(e,{overrideIndentation:e=>{var t;return null!==(t=r[e])&&void 0!==t?t:-1}}),o=[];for(let s=t;s<=n;){let t=e.doc.lineAt(s);s=t.to+1;let n=I(i,t.from);if(null==n)continue;/\S/.test(t.text)||(n=0);let a=/^\s*/.exec(t.text)[0],l=M(e,n);a!=l&&(r[t.from]=n,o.push({from:t.from,to:t.from+a.length,insert:l}))}return e.changes(o)},t.indentService=O,t.indentString=M,t.indentUnit=E,t.language=A,t.languageDataProp=c,t.matchBrackets=Ae,t.syntaxHighlighting=function(e,t){let n,r=[pe];return e instanceof he&&(e.module&&r.push(s.EditorView.styleModule.of(e.module)),n=e.themeType),(null==t?void 0:t.fallback)?r.push(fe.of(e)):n?r.push(ue.computeN([s.EditorView.darkTheme],(t=>t.facet(s.EditorView.darkTheme)==("dark"==n)?[e]:[]))):r.push(ue.of(e)),r},t.syntaxParserRunning=function(e){var t;return(null===(t=e.plugin(S))||void 0===t?void 0:t.isWorking())||!1},t.syntaxTree=p,t.syntaxTreeAvailable=function(e,t=e.doc.length){var n;return(null===(n=e.field(u.state,!1))||void 0===n?void 0:n.context.isDone(t))||!1},t.unfoldAll=te,t.unfoldCode=Y,t.unfoldEffect=W},2426:(e,t,n)=>{"use strict";var r=n(3642),i=n(7040),o=n(8513);class s{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class a{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let i=e,o=n.facet(S).markerFilter;o&&(i=o(i));let s=r.Decoration.set(i.map((e=>e.from==e.to||e.from==e.to-1&&n.doc.lineAt(e.from).to==e.from?r.Decoration.widget({widget:new O(e),diagnostic:e}).range(e.from):r.Decoration.mark({attributes:{class:"cm-lintRange cm-lintRange-"+e.severity+(e.markClass?" "+e.markClass:"")},diagnostic:e}).range(e.from,e.to))),!0);return new a(s,t,l(s))}}function l(e,t=null,n=0){let r=null;return e.between(n,1e9,((e,n,{spec:i})=>{if(!t||i.diagnostic==t)return r=new s(e,n,i.diagnostic),!1})),r}function c(e,t){let n=e.startState.doc.lineAt(t.pos);return!(!e.effects.some((e=>e.is(f)))&&!e.changes.touchesRange(n.from,n.to))}function h(e,t){return e.field(m,!1)?t:t.concat(i.StateEffect.appendConfig.of(F))}function u(e,t){return{effects:h(e,[f.of(t)])}}const f=i.StateEffect.define(),d=i.StateEffect.define(),p=i.StateEffect.define(),m=i.StateField.define({create:()=>new a(r.Decoration.none,null,null),update(e,t){if(t.docChanged){let n=e.diagnostics.map(t.changes),r=null;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=l(n,e.selected.diagnostic,i)||l(n,null,i)}e=new a(n,e.panel,r)}for(let n of t.effects)n.is(f)?e=a.init(n.value,e.panel,t.state):n.is(d)?e=new a(e.diagnostics,n.value?j.open:null,e.selected):n.is(p)&&(e=new a(e.diagnostics,e.panel,n.value));return e},provide:e=>[r.showPanel.from(e,(e=>e.panel)),r.EditorView.decorations.from(e,(e=>e.diagnostics))]}),g=r.Decoration.mark({class:"cm-lintRange cm-lintRange-active"});function v(e,t){return o("ul",{class:"cm-tooltip-lint"},t.map((t=>C(e,t,!1))))}const y=e=>{let t=e.state.field(m,!1);t&&t.panel||e.dispatch({effects:h(e.state,[d.of(!0)])});let n=r.getPanel(e,j.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},b=e=>{let t=e.state.field(m,!1);return!(!t||!t.panel||(e.dispatch({effects:d.of(!1)}),0))},w=e=>{let t=e.state.field(m,!1);if(!t)return!1;let n=e.state.selection.main,r=t.diagnostics.iter(n.to+1);return!(!r.value&&(r=t.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)||(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),0))},x=[{key:"Mod-Shift-m",run:y,preventDefault:!0},{key:"F8",run:w}],k=r.ViewPlugin.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(S);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){let e=Date.now();if(ePromise.resolve(e(this.view))))).then((t=>{let n=t.reduce(((e,t)=>e.concat(t)));this.view.state.doc==e.doc&&this.view.dispatch(u(this.view.state,n))}),(e=>{r.logException(this.view.state,e)}))}}update(e){let t=e.state.facet(S);(e.docChanged||t!=e.startState.facet(S)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),S=i.Facet.define({combine:e=>Object.assign({sources:e.map((e=>e.source))},i.combineConfig(e.map((e=>e.config)),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))});function A(e){let t=[];if(e)e:for(let{name:n}of e){for(let e=0;ee.toLowerCase()==r.toLowerCase()))){t.push(r);continue e}}t.push("")}return t}function C(e,t,n){var r;let i=n?A(t.actions):[];return o("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},o("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage():t.message),null===(r=t.actions)||void 0===r?void 0:r.map(((n,r)=>{let s=!1,a=r=>{if(r.preventDefault(),s)return;s=!0;let i=l(e.state.field(m).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:c}=n,h=i[r]?c.indexOf(i[r]):-1,u=h<0?c:[c.slice(0,h),o("u",c.slice(h,h+1)),c.slice(h+1)];return o("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${c}${h<0?"":` (access key "${i[r]})"`}.`},u)})),t.source&&o("div",{class:"cm-diagnosticSource"},t.source))}class O extends r.WidgetType{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return o("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class E{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=C(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class j{constructor(e){this.view=e,this.items=[],this.list=o("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(27==t.keyCode)b(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:n}=this.items[this.selectedIndex],r=A(n.actions);for(let i=0;i{for(let t=0;tb(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(m).selected;if(!e)return-1;for(let t=0;t{let a,l=-1;for(let e=n;en&&(this.items.splice(n,l-n),r=!0)),t&&a.diagnostic==t.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),i=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++}));n({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.topt.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=l(this.view.state.field(m).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:p.of(t)})}static open(e){return new j(e)}}function M(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function I(e){return M(``,'width="6" height="3"')}const T=r.EditorView.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:I("#d11")},".cm-lintRange-warning":{backgroundImage:I("orange")},".cm-lintRange-info":{backgroundImage:I("#999")},".cm-lintRange-hint":{backgroundImage:I("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function $(e){return"error"==e?4:"warning"==e?3:"info"==e?2:1}class _ extends r.GutterMarker{constructor(e){super(),this.diagnostics=e,this.severity=e.reduce(((e,t)=>$(e)<$(t.severity)?t.severity:e),"hint")}toDOM(e){let t=document.createElement("div");t.className="cm-lint-marker cm-lint-marker-"+this.severity;let n=this.diagnostics,r=e.state.facet(V).tooltipFilter;return r&&(n=r(n)),n.length&&(t.onmouseover=()=>function(e,t,n){function r(){let r=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(r.from)&&e.dispatch({effects:N.of({pos:r.from,above:!1,create:()=>({dom:v(e,n),getCoords:()=>t.getBoundingClientRect()})})}),t.onmouseout=t.onmousemove=null,function(e,t){let n=r=>{let i=t.getBoundingClientRect();if(!(r.clientX>i.left-10&&r.clientXi.top-10&&r.clientY{clearTimeout(o),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(o),o=setTimeout(r,i)}}(e,t,n)),t}}function P(e,t){let n=Object.create(null);for(let r of t){let t=e.lineAt(r.from);(n[t.from]||(n[t.from]=[])).push(r)}let r=[];for(let e in n)r.push(new _(n[e]).range(+e));return i.RangeSet.of(r,!0)}const D=r.gutter({class:"cm-gutter-lint",markers:e=>e.state.field(R)}),R=i.StateField.define({create:()=>i.RangeSet.empty,update(e,t){e=e.map(t.changes);let n=t.state.facet(V).markerFilter;for(let r of t.effects)if(r.is(f)){let i=r.value;n&&(i=n(i||[])),e=P(t.state.doc,i.slice(0))}return e}}),N=i.StateEffect.define(),B=i.StateField.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=c(t,e)?null:Object.assign(Object.assign({},e),{pos:t.changes.mapPos(e.pos)})),t.effects.reduce(((e,t)=>t.is(N)?t.value:e),e)),provide:e=>r.showTooltip.from(e)}),L=r.EditorView.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:M('')},".cm-lint-marker-warning":{content:M('')},".cm-lint-marker-error":{content:M('')}}),F=[m,r.EditorView.decorations.compute([m],(e=>{let{selected:t,panel:n}=e.field(m);return t&&n&&t.from!=t.to?r.Decoration.set([g.range(t.from,t.to)]):r.Decoration.none})),r.hoverTooltip((function(e,t,n){let{diagnostics:r}=e.state.field(m),i=[],o=2e8,s=0;r.between(t-(n<0?1:0),t+(n>0?1:0),((e,r,{spec:a})=>{t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t({dom:v(e,i)})}:null}),{hideOn:c}),T],V=i.Facet.define({combine:e=>i.combineConfig(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});t.closeLintPanel=b,t.diagnosticCount=function(e){let t=e.field(m,!1);return t?t.diagnostics.size:0},t.forEachDiagnostic=function(e,t){let n=e.field(m,!1);if(n&&n.diagnostics.size)for(let e=i.RangeSet.iter([n.diagnostics]);e.value;e.next())t(e.value.spec.diagnostic,e.from,e.to)},t.forceLinting=function(e){let t=e.plugin(k);t&&t.force()},t.lintGutter=function(e={}){return[V.of(e),R,D,L,B]},t.lintKeymap=x,t.linter=function(e,t={}){return[S.of({source:e,config:t}),k,F]},t.nextDiagnostic=w,t.openLintPanel=y,t.previousDiagnostic=e=>{let{state:t}=e,n=t.field(m,!1);if(!n)return!1;let r,i,o,s,a=t.selection.main;return n.diagnostics.between(0,t.doc.length,((e,t)=>{to)&&(o=e,s=t)})),null!=o&&(null!=r||o!=a.from)&&(e.dispatch({selection:{anchor:null!=r?r:o,head:null!=i?i:s},scrollIntoView:!0}),!0)},t.setDiagnostics=u,t.setDiagnosticsEffect=f},2502:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3642),i=n(7040);function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(n(8513));const a="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class l{constructor(e,t,n=0,r=e.length,i){this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(a(e)):a,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return i.codePointAt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=i.fromCodePoint(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=i.codePointSize(e);let r=this.normalize(t);for(let e=0,i=n;;e++){let o=r.charCodeAt(e),s=this.match(o,i);if(s)return this.value=s,this;if(e==r.length-1)break;i==n&&ethis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=r+(n==r?1:0),n==this.curLine.length&&this.nextLine(),nthis.value.to)return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=n||r.to<=t){let r=new d(t,e.sliceString(t,n));return f.set(e,r),r}if(r.from==t&&r.to==n)return r;let{text:i,from:o}=r;return o>t&&(i=e.sliceString(t,o)+i,o=t),r.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t&&this.flat.tothis.flat.text.length-10&&(t=null),t){let e=this.flat.from+t.index,n=e+t[0].length;return this.value={from:e,to:n,match:t},this.matchPos=n+(e==n?1:0),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=d.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function m(e){let t=s.default("input",{class:"cm-textfield",name:"line"});function n(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:r}=e,o=r.doc.lineAt(r.selection.main.head),[,s,a,l,c]=n,h=l?+l.slice(1):0,u=a?+a:o.number;if(a&&c){let e=u/100;s&&(e=e*("-"==s?-1:1)+o.number/r.doc.lines),u=Math.round(r.doc.lines*e)}else a&&s&&(u=u*("-"==s?-1:1)+o.number);let f=r.doc.line(Math.max(1,Math.min(r.doc.lines,u)));e.dispatch({effects:g.of(!1),selection:i.EditorSelection.cursor(f.from+Math.max(0,Math.min(h,f.length))),scrollIntoView:!0}),e.focus()}return{dom:s.default("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:g.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),n())},onsubmit:e=>{e.preventDefault(),n()}},s.default("label",e.state.phrase("Go to line"),": ",t)," ",s.default("button",{class:"cm-button",type:"submit"},e.state.phrase("go")))}}"undefined"!=typeof Symbol&&(u.prototype[Symbol.iterator]=p.prototype[Symbol.iterator]=function(){return this});const g=i.StateEffect.define(),v=i.StateField.define({create:()=>!0,update(e,t){for(let n of t.effects)n.is(g)&&(e=n.value);return e},provide:e=>r.showPanel.from(e,(e=>e?m:null))}),y=e=>{let t=r.getPanel(e,m);if(!t){let n=[g.of(!0)];null==e.state.field(v,!1)&&n.push(i.StateEffect.appendConfig.of([v,b])),e.dispatch({effects:n}),t=r.getPanel(e,m)}return t&&t.dom.querySelector("input").focus(),!0},b=r.EditorView.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),w={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},x=i.Facet.define({combine:e=>i.combineConfig(e,w,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),k=r.Decoration.mark({class:"cm-selectionMatch"}),S=r.Decoration.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function A(e,t,n,r){return!(0!=n&&e(t.sliceDoc(n-1,n))==i.CharCategory.Word||r!=t.doc.length&&e(t.sliceDoc(r,r+1))==i.CharCategory.Word)}function C(e,t,n,r){return e(t.sliceDoc(n,n+1))==i.CharCategory.Word&&e(t.sliceDoc(r-1,r))==i.CharCategory.Word}const O=r.ViewPlugin.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(x),{state:n}=e,i=n.selection;if(i.ranges.length>1)return r.Decoration.none;let o,s=i.main,a=null;if(s.empty){if(!t.highlightWordAroundCursor)return r.Decoration.none;let e=n.wordAt(s.head);if(!e)return r.Decoration.none;a=n.charCategorizer(s.head),o=n.sliceDoc(e.from,e.to)}else{let e=s.to-s.from;if(e200)return r.Decoration.none;if(t.wholeWords){if(o=n.sliceDoc(s.from,s.to),a=n.charCategorizer(s.head),!A(a,n,s.from,s.to)||!C(a,n,s.from,s.to))return r.Decoration.none}else if(o=n.sliceDoc(s.from,s.to).trim(),!o)return r.Decoration.none}let c=[];for(let i of e.visibleRanges){let e=new l(n.doc,o,i.from,i.to);for(;!e.next().done;){let{from:i,to:o}=e.value;if((!a||A(a,n,i,o))&&(s.empty&&i<=s.from&&o>=s.to?c.push(S.range(i,o)):(i>=s.to||o<=s.from)&&c.push(k.range(i,o)),c.length>t.maxMatches))return r.Decoration.none}}return r.Decoration.set(c)}},{decorations:e=>e.decorations}),E=r.EditorView.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),j=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some((e=>e.from===e.to)))return(({state:e,dispatch:t})=>{let{selection:n}=e,r=i.EditorSelection.create(n.ranges.map((t=>e.wordAt(t.head)||i.EditorSelection.cursor(t.head))),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)})({state:e,dispatch:t});let o=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some((t=>e.sliceDoc(t.from,t.to)!=o)))return!1;let s=function(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new l(e.doc,t,r[r.length-1].to);;){if(i.next(),!i.done){if(n&&r.some((e=>e.from==i.value.from)))continue;if(o){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}if(n)return null;i=new l(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}}(e,o);return!!s&&(t(e.update({selection:e.selection.addRange(i.EditorSelection.range(s.from,s.to),!1),effects:r.EditorView.scrollIntoView(s.to)})),!0)},M=i.Facet.define({combine(e){var t;return{top:e.reduce(((e,t)=>null!=e?e:t.top),void 0)||!1,caseSensitive:e.reduce(((e,t)=>null!=e?e:t.caseSensitive),void 0)||!1,createPanel:(null===(t=e.find((e=>e.createPanel)))||void 0===t?void 0:t.createPanel)||(e=>new te(e))}}});class I{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,h),!0}catch(e){return!1}}(this.search)),this.unquoted=e.literal?this.search:this.search.replace(/\\([nrt\\])/g,((e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"))}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp}create(){return this.regexp?new D(this):new _(this)}getCursor(e,t=0,n=e.length){return this.regexp?P(this,e,t,n):$(this,e,t,n)}}class T{constructor(e){this.spec=e}}function $(e,t,n,r){return new l(t,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase())}class _ extends T{constructor(e){super(e)}nextMatch(e,t,n){let r=$(this.spec,e,n,e.length).nextOverlapping();return r.done&&(r=$(this.spec,e,0,t).nextOverlapping()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=$(this.spec,e,n,r),o=null;for(;!i.nextOverlapping().done;)o=i.value;if(o)return o;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.length)}getReplacement(e){return this.spec.replace}matchAll(e,t){let n=$(this.spec,e,0,e.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=$(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.length));for(;!i.next().done;)r(i.value.from,i.value.to)}}function P(e,t,n,r){return new u(t,e.search,e.caseSensitive?void 0:{ignoreCase:!0},n,r)}class D extends T{nextMatch(e,t,n){let r=P(this.spec,e,n,e.length).next();return r.done&&(r=P(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-1e4*r),o=P(this.spec,e,i,n),s=null;for(;!o.next().done;)s=o.value;if(s&&(i==t||s.from>i+10))return s;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.length)}getReplacement(e){return this.spec.replace.replace(/\$([$&\d+])/g,((t,n)=>"$"==n?"$":"&"==n?e.match[0]:"0"!=n&&+n=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=P(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.length));for(;!i.next().done;)r(i.value.from,i.value.to)}}const R=i.StateEffect.define(),N=i.StateEffect.define(),B=i.StateField.define({create:e=>new L(Z(e).create(),null),update(e,t){for(let n of t.effects)n.is(R)?e=new L(n.value.create(),e.panel):n.is(N)&&(e=new L(e.query,n.value?Q:null));return e},provide:e=>r.showPanel.from(e,(e=>e.panel))});class L{constructor(e,t){this.query=e,this.panel=t}}const F=r.Decoration.mark({class:"cm-searchMatch"}),V=r.Decoration.mark({class:"cm-searchMatch cm-searchMatch-selected"}),z=r.ViewPlugin.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(B))}update(e){let t=e.state.field(B);(t!=e.startState.field(B)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return r.Decoration.none;let{view:n}=this,o=new i.RangeSetBuilder;for(let t=0,r=n.visibleRanges,i=r.length;tr[t+1].from-500;)a=r[++t].to;e.highlight(n.state.doc,s,a,((e,t)=>{let r=n.state.selection.ranges.some((n=>n.from==e&&n.to==t));o.add(e,t,r?V:F)}))}return o.finish()}},{decorations:e=>e.decorations});function q(e){return t=>{let n=t.state.field(B,!1);return n&&n.query.spec.valid?e(t,n):Y(t)}}const H=q(((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state.doc,n,n);return!!r&&(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:oe(e,r),userEvent:"select.search"}),!0)})),W=q(((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n.doc,r,r);return!!i&&(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:oe(e,i),userEvent:"select.search"}),!0)})),U=q(((e,{query:t})=>{let n=t.matchAll(e.state.doc,1e3);return!(!n||!n.length||(e.dispatch({selection:i.EditorSelection.create(n.map((e=>i.EditorSelection.range(e.from,e.to)))),userEvent:"select.search.matches"}),0))})),J=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:o}=n.main,s=[],a=0;for(let t=new l(e.doc,e.sliceDoc(r,o));!t.next().done;){if(s.length>1e3)return!1;t.value.from==r&&(a=s.length),s.push(i.EditorSelection.range(t.value.from,t.value.to))}return t(e.update({selection:i.EditorSelection.create(s,a),userEvent:"select.search.matches"})),!0},K=q(((e,{query:t})=>{let{state:n}=e,{from:i,to:o}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n.doc,i,i);if(!s)return!1;let a,l,c=[],h=[];if(s.from==i&&s.to==o&&(l=n.toText(t.getReplacement(s)),c.push({from:s.from,to:s.to,insert:l}),s=t.nextMatch(n.doc,s.from,s.to),h.push(r.EditorView.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))),s){let t=0==c.length||c[0].from>=s.to?0:s.to-s.from-l.length;a={anchor:s.from-t,head:s.to-t},h.push(oe(e,s))}return e.dispatch({changes:c,selection:a,scrollIntoView:!!a,effects:h,userEvent:"input.replace"}),!0})),G=q(((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state.doc,1e9).map((e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}}));if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:r.EditorView.announce.of(i),userEvent:"input.replace.all"}),!0}));function Q(e){return e.state.facet(M).createPanel(e)}function Z(e,t){var n;let r=e.selection.main,i=r.empty||r.to>r.from+100?"":e.sliceDoc(r.from,r.to),o=null!==(n=null==t?void 0:t.caseSensitive)&&void 0!==n?n:e.facet(M).caseSensitive;return t&&!i?t:new I({search:i.replace(/\n/g,"\\n"),caseSensitive:o})}const Y=e=>{let t=e.state.field(B,!1);if(t&&t.panel){let n=r.getPanel(e,Q);if(!n)return!1;let i=n.dom.querySelector("[main-field]");if(i&&i!=e.root.activeElement){let n=Z(e.state,t.query.spec);n.valid&&e.dispatch({effects:R.of(n)}),i.focus(),i.select()}}else e.dispatch({effects:[N.of(!0),t?R.of(Z(e.state,t.query.spec)):i.StateEffect.appendConfig.of(ae)]});return!0},X=e=>{let t=e.state.field(B,!1);if(!t||!t.panel)return!1;let n=r.getPanel(e,Q);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:N.of(!1)}),!0},ee=[{key:"Mod-f",run:Y,scope:"editor search-panel"},{key:"F3",run:H,shift:W,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:H,shift:W,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:X,scope:"editor search-panel"},{key:"Mod-Shift-l",run:J},{key:"Alt-g",run:y},{key:"Mod-d",run:j,preventDefault:!0}];class te{constructor(e){this.view=e;let t=this.query=e.state.field(B).query.spec;function n(e,t,n){return s.default("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=s.default("input",{value:t.search,placeholder:ne(e,"Find"),"aria-label":ne(e,"Find"),class:"cm-textfield",name:"search","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=s.default("input",{value:t.replace,placeholder:ne(e,"Replace"),"aria-label":ne(e,"Replace"),class:"cm-textfield",name:"replace",onchange:this.commit,onkeyup:this.commit}),this.caseField=s.default("input",{type:"checkbox",name:"case",checked:t.caseSensitive,onchange:this.commit}),this.reField=s.default("input",{type:"checkbox",name:"re",checked:t.regexp,onchange:this.commit}),this.dom=s.default("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",(()=>H(e)),[ne(e,"next")]),n("prev",(()=>W(e)),[ne(e,"previous")]),n("select",(()=>U(e)),[ne(e,"all")]),s.default("label",null,[this.caseField,ne(e,"match case")]),s.default("label",null,[this.reField,ne(e,"regexp")]),...e.state.readOnly?[]:[s.default("br"),this.replaceField,n("replace",(()=>K(e)),[ne(e,"replace")]),n("replaceAll",(()=>G(e)),[ne(e,"replace all")]),s.default("button",{name:"close",onclick:()=>X(e),"aria-label":ne(e,"close"),type:"button"},["×"])]])}commit(){let e=new I({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:R.of(e)}))}keydown(e){r.runScopeHandlers(this.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?W:H)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),K(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(R)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(M).top}}function ne(e,t){return e.state.phrase(t)}const re=30,ie=/[\s\.,:;?!]/;function oe(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),o=e.state.doc.lineAt(n).to,s=Math.max(i.from,t-re),a=Math.min(o,n+re),l=e.state.sliceDoc(s,a);if(s!=i.from)for(let e=0;el.length-re;e--)if(!ie.test(l[e-1])&&ie.test(l[e])){l=l.slice(0,e);break}return r.EditorView.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${i.number}.`)}const se=r.EditorView.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),ae=[B,i.Prec.lowest(z),se];t.RegExpCursor=u,t.SearchCursor=l,t.SearchQuery=I,t.closeSearchPanel=X,t.findNext=H,t.findPrevious=W,t.getSearchQuery=function(e){let t=e.field(B,!1);return t?t.query.spec:Z(e)},t.gotoLine=y,t.highlightSelectionMatches=function(e){let t=[E,O];return e&&t.push(x.of(e)),t},t.openSearchPanel=Y,t.replaceAll=G,t.replaceNext=K,t.search=function(e){return e?[M.of(e),ae]:ae},t.searchKeymap=ee,t.selectMatches=U,t.selectNextOccurrence=j,t.selectSelectionMatches=J,t.setSearchQuery=R},7040:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n{constructor(){}lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),i.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let n=[];return this.decompose(e,t,n,0),i.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new a(this),i=new a(e);for(let e=t,o=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(o+=r.value.length,r.done||o>=n)return!0}}iter(e=1){return new a(this,e)}iterRange(e,t=this.length){return new l(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new c(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new r(e):i.from(r.split(e,[])):n.empty}}class r extends n{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let o=this.text[i],s=r+o.length;if((t?n:s)>=e)return new h(r,s,n,o);r=s+1,n++}}decompose(e,t,n,i){let a=e<=0&&t>=this.length?this:new r(s(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&i){let e=n.pop(),t=o(a.text,e.text.slice(),0,a.length);if(t.length<=32)n.push(new r(t,e.length+a.length));else{let e=t.length>>1;n.push(new r(t.slice(0,e)),new r(t.slice(e)))}}else n.push(a)}replace(e,t,n){if(!(n instanceof r))return super.replace(e,t,n);let a=o(this.text,o(n.text,s(this.text,0,e)),t),l=this.length+n.length-(t-e);return a.length<=32?new r(a,l):i.from(r.split(a,[]),l)}sliceString(e,t=this.length,n="\n"){let r="";for(let i=0,o=0;i<=t&&oe&&o&&(r+=n),ei&&(r+=s.slice(Math.max(0,e-i),t-i)),i=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let o of e)n.push(o),i+=o.length+1,32==n.length&&(t.push(new r(n,i)),n=[],i=-1);return i>-1&&t.push(new r(n,i)),t}}class i extends n{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let o=this.children[i],s=r+o.length,a=n+o.lines-1;if((t?a:s)>=e)return o.lineInner(e,t,n,r);r=s+1,n=a+1}}decompose(e,t,n,r){for(let i=0,o=0;o<=t&&i=o){let i=r&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!i?n.push(s):s.decompose(e-o,t-o,n,i)}o=a+1}}replace(e,t,n){if(n.lines=o&&t<=a){let l=s.replace(e-o,t-o,n),c=this.lines-s.lines+l.lines;if(l.lines>4&&l.lines>c>>6){let o=this.children.slice();return o[r]=l,new i(o,this.length-(t-e)+n.length)}return super.replace(o,a,l)}o=a+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){let r="";for(let i=0,o=0;ie&&i&&(r+=n),eo&&(r+=s.sliceString(e-o,t-o,n)),o=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof i))return 0;let n=0,[r,o,s,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,o+=t){if(r==s||o==a)return n;let i=this.children[r],l=e.children[o];if(i!=l)return n+i.scanIdentical(l,t);n+=i.length+1}}static from(e,t=e.reduce(((e,t)=>e+t.length+1),-1)){let n=0;for(let t of e)n+=t.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new r(n,t)}let o=Math.max(32,n>>5),s=o<<1,a=o>>1,l=[],c=0,h=-1,u=[];function f(e){let t;if(e.lines>s&&e instanceof i)for(let t of e.children)f(t);else e.lines>a&&(c>a||!c)?(d(),l.push(e)):e instanceof r&&c&&(t=u[u.length-1])instanceof r&&e.lines+t.lines<=32?(c+=e.lines,h+=e.length+1,u[u.length-1]=new r(t.text.concat(e.text),t.length+1+e.length)):(c+e.lines>o&&d(),c+=e.lines,h+=e.length+1,u.push(e))}function d(){0!=c&&(l.push(1==u.length?u[0]:i.from(u,h)),h=-1,c=u.length=0)}for(let t of e)f(t);return d(),1==l.length?l[0]:new i(l,t)}}function o(e,t,n=0,r=1e9){for(let i=0,o=0,s=!0;o=n&&(l>r&&(a=a.slice(0,r-i)),i0?1:(e instanceof r?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],o=this.offsets[n],s=o>>1,a=i instanceof r?i.text.length:i.children.length;if(s==(t>0?a:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&o)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(i instanceof r){let r=i.text[s+(t<0?-1:0)];if(this.offsets[n]+=t,r.length>Math.max(0,e))return this.value=0==e?r:t>0?r.slice(e):r.slice(0,r.length-e),this;e-=r.length}else{let o=i.children[s+(t<0?-1:0)];e>o.length?(e-=o.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(o),this.offsets.push(t>0?1:(o instanceof r?o.text.length:o.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class l{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new a(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class c{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(n.prototype[Symbol.iterator]=function(){return this.iter()},a.prototype[Symbol.iterator]=l.prototype[Symbol.iterator]=c.prototype[Symbol.iterator]=function(){return this});class h{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}}let u="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((e=>e?parseInt(e,36):1));for(let e=1;ee)return u[t-1]<=e;return!1}function d(e){return e>=127462&&e<=127487}const p=8205;function m(e,t,n=!0,r=!0){return(n?g:v)(e,t,r)}function g(e,t,n){if(t==e.length)return t;t&&y(e.charCodeAt(t))&&b(e.charCodeAt(t-1))&&t--;let r=w(e,t);for(t+=x(r);t=0&&d(w(e,r));)n++,r-=2;if(n%2==0)break;t+=2}}}return t}function v(e,t,n){for(;t>0;){let r=g(e,t-2,n);if(r=56320&&e<57344}function b(e){return e>=55296&&e<56320}function w(e,t){let n=e.charCodeAt(t);if(!b(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return y(r)?r-56320+(n-55296<<10)+65536:n}function x(e){return e<65536?1:2}const k=/\r\n?|\n/;var S;t.MapMode=void 0,(S=t.MapMode||(t.MapMode={}))[S.Simple=0]="Simple",S[S.TrackDel=1]="TrackDel",S[S.TrackBefore=2]="TrackBefore",S[S.TrackAfter=3]="TrackAfter";class A{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return o+(e-i);o+=a}else{if(r!=t.MapMode.Simple&&c>=e&&(r==t.MapMode.TrackDel&&ie||r==t.MapMode.TrackBefore&&ie))return null;if(c>e||c==e&&n<0&&!a)return e==i||n<0?o:o+l;o+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return o}touchesRange(e,t=e){for(let n=0,r=0;n=0&&r<=t&&i>=e)return!(rt)||"cover";r=i}return!1}toString(){let e="";for(let t=0;t=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some((e=>"number"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new A(e)}static create(e){return new A(e)}}class C extends A{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return j(this,((t,n,r,i,o)=>e=e.replace(r,r+(n-t),o)),!1),e}mapDesc(e,t=!1){return M(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let i=0,o=0;i=0){t[i]=a,t[i+1]=s;let l=i>>1;for(;r.length0&&E(n,t,i.text),i.forward(e),s+=e}let l=e[o++];for(;s>1].toJSON()))}return e}static of(e,t,r){let i=[],o=[],s=0,a=null;function l(e=!1){if(!e&&!i.length)return;sa||e<0||a>t)throw new RangeError(`Invalid change range ${e} to ${a} (in doc of length ${t})`);let u=h?"string"==typeof h?n.of(h.split(r||k)):h:n.empty,f=u.length;if(e==a&&0==f)return;es&&O(i,e-s,-1),O(i,a-e,f),E(o,i,u),s=a}}(e),l(!a),a}static empty(e){return new C(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],r=[];for(let i=0;it&&"string"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==o.length)t.push(o[0],0);else{for(;r.length=0&&n<=0&&n==e[i+1]?e[i]+=t:0==t&&0==e[i]?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function E(e,t,r){if(0==r.length)return;let i=t.length-2>>1;if(i>1])),!(r||a==e.sections.length||e.sections[a+1]<0);)l=e.sections[a++],c=e.sections[a++];t(o,h,s,u,f),o=h,s=u}}}function M(e,t,n,r=!1){let i=[],o=r?[]:null,s=new T(e),a=new T(t);for(let e=-1;;)if(-1==s.ins&&-1==a.ins){let e=Math.min(s.len,a.len);O(i,e,-1),s.forward(e),a.forward(e)}else if(a.ins>=0&&(s.ins<0||e==s.i||0==s.off&&(a.len=0&&e=0)){if(s.done&&a.done)return o?C.createSet(i,o):A.create(i);throw new Error("Mismatched change set lengths")}{let t=0,n=s.len;for(;n;)if(-1==a.ins){let e=Math.min(n,a.len);t+=e,n-=e,a.forward(e)}else{if(!(0==a.ins&&a.lent||s.ins>=0&&s.len>t)&&(e||r.length>n),o.forward2(t),s.forward(t)}}else O(r,0,s.ins,e),i&&E(i,r,s.text),s.next()}}class T{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?n.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?n.empty:t[r].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class ${constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 16&this.flags?this.to:this.from}get head(){return 16&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 4&this.flags?-1:8&this.flags?1:0}get bidiLevel(){let e=3&this.flags;return 3==e?null:e}get goalColumn(){let e=this.flags>>5;return 33554431==e?void 0:e}map(e,t=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new $(n,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return _.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return _.range(this.anchor,n)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return _.range(e.anchor,e.head)}static create(e,t,n){return new $(e,t,n)}}class _{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:_.create(this.ranges.map((n=>n.map(e,t))),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON())),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new _(e.ranges.map((e=>$.fromJSON(e))),e.main)}static single(e,t=e){return new _([_.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw new RangeError("A selection needs at least one range");for(let n=0,r=0;re?4:0))}static normalized(e,t=0){let n=e[t];e.sort(((e,t)=>e.from-t.from)),t=e.indexOf(n);for(let n=1;nr.head?_.range(s,o):_.range(o,s))}}return new _(e,t)}}function P(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let D=0;class R{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=D++,this.default=e([]),this.extensions="function"==typeof i?i(this):i}static define(e={}){return new R(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:N),!!e.static,e.enables)}of(e){return new B([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new B(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new B(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],(n=>t(n.field(e))))}}function N(e,t){return e==t||e.length==t.length&&e.every(((e,n)=>e===t[n]))}class B{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=D++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,i=this.id,o=e[i]>>1,s=2==this.type,a=!1,l=!1,c=[];for(let n of this.dependencies)"doc"==n?a=!0:"selection"==n?l=!0:0==(1&(null!==(t=e[n.id])&&void 0!==t?t:1))&&c.push(e[n.id]);return{create:e=>(e.values[o]=n(e),1),update(e,t){if(a&&t.docChanged||l&&(t.docChanged||t.selection)||F(e,c)){let t=n(e);if(s?!L(t,e.values[o],r):!r(t,e.values[o]))return e.values[o]=t,1}return 0},reconfigure:(e,t)=>{let a=n(e),l=t.config.address[i];if(null!=l){let n=Z(t,l);if(this.dependencies.every((n=>n instanceof R?t.facet(n)===e.facet(n):!(n instanceof q)||t.field(n,!1)==e.field(n,!1)))||(s?L(a,n,r):r(a,n)))return e.values[o]=n,0}return e.values[o]=a,1}}}}function L(e,t,n){if(e.length!=t.length)return!1;for(let r=0;re[t.id])),i=n.map((e=>e.type)),o=r.filter((e=>!(1&e))),s=e[t.id]>>1;function a(e){let n=[];for(let t=0;te===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(z).find((e=>e.field==this));return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}init(e){return[this,z.of({field:this,create:e})]}get extension(){return this}}function H(e){return t=>new U(t,e)}const W={highest:H(0),high:H(1),default:H(2),low:H(3),lowest:H(4)};class U{constructor(e,t){this.inner=e,this.prec=t}}class J{of(e){return new K(this,e)}reconfigure(e){return J.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class K{constructor(e,t){this.compartment=e,this.inner=t}}class G{constructor(e,t,n,r,i,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let r=[],i=Object.create(null),o=new Map;for(let n of function(e,t,n){let r=[[],[],[],[],[]],i=new Map;return function e(o,s){let a=i.get(o);if(null!=a){if(a<=s)return;let e=r[a].indexOf(o);e>-1&&r[a].splice(e,1),o instanceof K&&n.delete(o.compartment)}if(i.set(o,s),Array.isArray(o))for(let t of o)e(t,s);else if(o instanceof K){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let r=t.get(o.compartment)||o.inner;n.set(o.compartment,r),e(r,s)}else if(o instanceof U)e(o.inner,o.prec);else if(o instanceof q)r[s].push(o),o.provides&&e(o.provides,s);else if(o instanceof B)r[s].push(o),o.facet.extensions&&e(o.facet.extensions,2);else{let t=o.extension;if(!t)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(t,s)}}(e,2),r.reduce(((e,t)=>e.concat(t)))}(e,t,o))n instanceof q?r.push(n):(i[n.facet.id]||(i[n.facet.id]=[])).push(n);let s=Object.create(null),a=[],l=[];for(let e of r)s[e.id]=l.length<<1,l.push((t=>e.slot(t)));let c=null==n?void 0:n.config.facets;for(let e in i){let t=i[e],r=t[0].facet,o=c&&c[e]||[];if(t.every((e=>0==e.type)))if(s[r.id]=a.length<<1|1,N(o,t))a.push(n.facet(r));else{let e=r.combine(t.map((e=>e.value)));a.push(n&&r.compare(e,n.facet(r))?n.facet(r):e)}else{for(let e of t)0==e.type?(s[e.id]=a.length<<1|1,a.push(e.value)):(s[e.id]=l.length<<1,l.push((t=>e.dynamicSlot(t))));s[r.id]=l.length<<1,l.push((e=>V(e,r,t)))}}let h=l.map((e=>e(s)));return new G(e,o,h,s,a,i)}}function Q(e,t){if(1&t)return 2;let n=t>>1,r=e.status[n];if(4==r)throw new Error("Cyclic dependency between fields and/or facets");if(2&r)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function Z(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const Y=R.define(),X=R.define({combine:e=>e.some((e=>e)),static:!0}),ee=R.define({combine:e=>e.length?e[0]:void 0,static:!0}),te=R.define(),ne=R.define(),re=R.define(),ie=R.define({combine:e=>!!e.length&&e[0]});class oe{constructor(e,t){this.type=e,this.value=t}static define(){return new se}}class se{of(e){return new oe(this,e)}}class ae{constructor(e){this.map=e}of(e){return new le(this,e)}}class le{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new le(this.type,t)}is(e){return this.type==e}static define(e={}){return new ae(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}}le.reconfigure=le.define(),le.appendConfig=le.define();class ce{constructor(e,t,n,r,i,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=i,this.scrollIntoView=o,this._doc=null,this._state=null,n&&P(n,t.newLength),i.some((e=>e.type==ce.time))||(this.annotations=i.concat(ce.time.of(Date.now())))}static create(e,t,n,r,i,o){return new ce(e,t,n,r,i,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(ce.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function he(e,t){let n=[];for(let r=0,i=0;;){let o,s;if(r=e[r]))o=e[r++],s=e[r++];else{if(!(i=0;i--){let o=n[i](e);o&&Object.keys(o).length&&(r=ue(e,fe(t,o,e.changes.newLength),!0))}return r==e?e:ce.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}(n?function(e){let t=e.startState,n=!0;for(let r of t.facet(te)){let t=r(e);if(!1===t){n=!1;break}Array.isArray(t)&&(n=!0===n?t:he(n,t))}if(!0!==n){let r,i;if(!1===n)i=e.changes.invertedDesc,r=C.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,i=t.filtered.mapDesc(t.changes).invertedDesc}e=ce.create(t,r,e.selection&&e.selection.map(i),le.mapEffects(e.effects,i),e.annotations,e.scrollIntoView)}let r=t.facet(ne);for(let n=r.length-1;n>=0;n--){let i=r[n](e);e=i instanceof ce?i:Array.isArray(i)&&1==i.length&&i[0]instanceof ce?i[0]:de(t,me(i),!1)}return e}(i):i)}ce.time=oe.define(),ce.userEvent=oe.define(),ce.addToHistory=oe.define(),ce.remote=oe.define();const pe=[];function me(e){return null==e?pe:Array.isArray(e)?e:[e]}var ge;t.CharCategory=void 0,(ge=t.CharCategory||(t.CharCategory={}))[ge.Word=0]="Word",ge[ge.Space=1]="Space",ge[ge.Other=2]="Other";const ve=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let ye;try{ye=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}class be{constructor(e,t,n,r,i,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,o&&(o._state=this);for(let e=0;ei.set(t,e))),n=null),i.set(t.value.compartment,t.value.extension)):t.is(le.reconfigure)?(n=null,r=t.value):t.is(le.appendConfig)&&(n=null,r=me(r).concat(t.value));n?t=e.startState.values.slice():(n=G.resolve(r,i,this),t=new be(n,this.doc,this.selection,n.dynamicSlots.map((()=>null)),((e,t)=>t.reconfigure(e,this)),null).values),new be(n,e.newDoc,e.newSelection,t,((t,n)=>n.update(t,e)),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:e},range:_.cursor(t.from+e.length)})))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],o=me(n.effects);for(let n=1;ni.spec.fromJSON(o,e))))}return be.create({doc:e.doc,selection:_.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=G.resolve(e.extensions||[],new Map),r=e.doc instanceof n?e.doc:n.of((e.doc||"").split(t.staticFacet(be.lineSeparator)||k)),i=e.selection?e.selection instanceof _?e.selection:_.single(e.selection.anchor,e.selection.head):_.single(0);return P(i,r.length),t.staticFacet(X)||(i=i.asSingle()),new be(t,r,i,t.dynamicSlots.map((()=>null)),((e,t)=>t.create(e)),null)}get tabSize(){return this.facet(be.tabSize)}get lineBreak(){return this.facet(be.lineSeparator)||"\n"}get readOnly(){return this.facet(ie)}phrase(e,...t){for(let t of this.facet(be.phrases))if(Object.prototype.hasOwnProperty.call(t,e)){e=t[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,((e,n)=>{if("$"==n)return"$";let r=+(n||1);return!r||r>t.length?e:t[r-1]}))),e}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(Y))for(let o of i(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){return n=this.languageDataAt("wordChars",e).join(""),e=>{if(!/\S/.test(e))return t.CharCategory.Space;if(function(e){if(ye)return ye.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||ve.test(n)))return!0}return!1}(e))return t.CharCategory.Word;for(let r=0;r-1)return t.CharCategory.Word;return t.CharCategory.Other};var n}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),o=this.charCategorizer(e),s=e-r,a=e-r;for(;s>0;){let e=m(n,s,!1);if(o(n.slice(e,s))!=t.CharCategory.Word)break;s=e}for(;ae.length?e[0]:4}),be.lineSeparator=ee,be.readOnly=ie,be.phrases=R.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every((n=>e[n]==t[n]))}}),be.languageData=Y,be.changeFilter=te,be.transactionFilter=ne,be.transactionExtender=re,J.reconfigure=le.define();class we{eq(e){return this==e}range(e,t=e){return xe.create(e,t,this)}}we.prototype.startSide=we.prototype.endSide=0,we.prototype.point=!1,we.prototype.mapMode=t.MapMode.TrackDel;class xe{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new xe(e,t,n)}}function ke(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Se{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let o=r,s=i.length;;){if(o==s)return o;let r=o+s>>1,a=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==o)return a>=0?o:s;a>=0?s=r:o=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,i);ic||l==c&&h.startSide>0&&h.endSide<=0)continue;(c-l||h.endSide-h.startSide)<0||(o<0&&(o=l),h.point&&(s=Math.max(s,c-l)),n.push(h),r.push(l-o),i.push(c-o))}return{mapped:n.length?new Se(r,i,n,s):null,pos:o}}}class Ae{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new Ae(e,t,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:r=0,filterTo:i=this.length}=e,o=e.filter;if(0==t.length&&!o)return this;if(n&&(t=t.slice().sort(ke)),this.isEmpty)return t.length?Ae.of(t):this;let s=new Ee(this,null,-1).goto(0),a=0,l=[],c=new Ce;for(;s.value||a=0){let e=t[a++];c.addInner(e.from,e.to,e.value)||l.push(e)}else 1==s.rangeIndex&&s.chunkIndexthis.chunkEnd(s.chunkIndex)||is.to||i=i&&e<=i+o.length&&!1===o.between(i,e-i,t-i,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return je.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return je.from(e).goto(t)}static compare(e,t,n,r,i=-1){let o=e.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i)),s=t.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i)),a=Oe(o,s,n),l=new Ie(o,a,i),c=new Ie(s,a,i);n.iterGaps(((e,t,n)=>Te(l,e,c,t,n,r))),n.empty&&0==n.length&&Te(l,0,c,0,0,r)}static eq(e,t,n=0,r){null==r&&(r=1e9);let i=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0)),o=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0));if(i.length!=o.length)return!1;if(!i.length)return!0;let s=Oe(i,o),a=new Ie(i,s,0).goto(n),l=new Ie(o,s,0).goto(n);for(;;){if(a.to!=l.to||!$e(a.active,l.active)||a.point&&(!l.point||!a.point.eq(l.point)))return!1;if(a.to>r)return!0;a.next(),l.next()}}static spans(e,t,n,r,i=-1){let o=new Ie(e,null,i).goto(t),s=t,a=o.openStart;for(;;){let e=Math.min(o.to,n);if(o.point?(r.point(s,e,o.point,o.activeForPoint(o.to),a,o.pointRank),a=o.openEnd(e)+(o.to>e?1:0)):e>s&&(r.span(s,e,o.active,a),a=o.openEnd(e)),o.to>n)break;s=o.to,o.next()}return a}static of(e,t=!1){let n=new Ce;for(let r of e instanceof xe?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(ke);t=r}return e}(e):e)n.add(r.from,r.to,r.value);return n.finish()}}Ae.empty=new Ae([],[],null,-1),Ae.empty.nextLayer=Ae.empty;class Ce{constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}finishChunk(e){this.chunks.push(new Se(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new Ce)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),0))}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(Ae.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=Ae.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Oe(e,t,n){let r=new Map;for(let t of e)for(let e=0;e=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&r.push(new Ee(o,t,n,i));return 1==r.length?r[0]:new je(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)Me(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)Me(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Me(this.heap,0)}}}function Me(e,t){for(let n=e[t];;){let r=1+(t<<1);if(r>=e.length)break;let i=e[r];if(r+1=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}class Ie{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=je.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){_e(this.active,e),_e(this.activeTo,e),_e(this.activeRank,e),this.minActive=De(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&_e(n,i)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let i=this.cursor.value;if(i.point){if(!(t&&this.cursor.to==this.to&&this.cursor.frome&&r++,this.cursor.next()}}}if(n){let t=0;for(;t=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function Te(e,t,n,r,i,o){e.goto(t),n.goto(r);let s=r+i,a=r,l=r-t;for(;;){let t=e.to+l-n.to||e.endSide-n.endSide,r=t<0?e.to+l:n.to,i=Math.min(r,s);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&$e(e.activeForPoint(e.to+l),n.activeForPoint(n.to))||o.comparePoint(a,i,e.point,n.point):i>a&&!$e(e.active,n.active)&&o.compareRange(a,i,e.active,n.active),r>s)break;a=r,t<=0&&e.next(),t>=0&&n.next()}}function $e(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;n--)e[n+1]=e[n];e[t]=n}function De(e,t){let n=-1,r=1e9;for(let i=0;i=t)return r;if(r==e.length)break;i+=9==e.charCodeAt(r)?n-i%n:1,r=m(e,r)}return!0===r?-1:e.length},t.fromCodePoint=function(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}},3642:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7040),i=n(7223),o=n(6691);function s(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function a(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function l(e,t){if(!t.anchorNode)return!1;try{return a(e,t.anchorNode)}catch(e){return!1}}function c(e){return 3==e.nodeType?x(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function h(e,t,n,r){return!!n&&(f(e,t,n,r,-1)||f(e,t,n,r,1))}function u(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function f(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:d(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=u(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(i<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=i<0?d(e):0}}}function d(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}const p={left:0,right:0,top:0,bottom:0};function m(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function g(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}class v{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){this.set(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset)}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}let y,b=null;function w(e){if(e.setActive)return e.setActive();if(b)return e.focus(b);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==b?{get preventScroll(){return b={preventScroll:!0},!0}}:void 0),!b){b=!1;for(let e=0;et)return n.domBoundsAround(e,t,l);if(h>=e&&-1==r&&(r=a,i=l),l>t&&n.dom.parentNode==this.dom){o=a,s=c;break}c=h,l=h+n.breakAfter}return{from:i,to:s<0?n+this.length:s,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.dirty|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.dirty|=2),1&t.dirty)return;t.dirty|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.dirty&&this.markParentsDirty(!0))}setDOM(e){this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=C){this.markDirty();for(let n=e;nthis.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function M(e,t,n,r,i,o,s,a,l){let{children:c}=e,h=c.length?c[t]:null,u=o.length?o[o.length-1]:null,f=u?u.breakAfter:s;if(!(t==r&&h&&!s&&!f&&o.length<2&&h.merge(n,i,o.length?u:null,0==n,a,l))){if(r0&&(!s&&o.length&&h.merge(n,h.length,o[0],!1,a,0)?h.breakAfter=o.shift().breakAfter:(n2);var z,q={mac:V||/Mac/.test(T.platform),windows:/Win/.test(T.platform),linux:/Linux|X11/.test(T.platform),ie:R,ie_version:P?$.documentMode||6:D?+D[1]:_?+_[1]:0,gecko:N,gecko_version:N?+(/Firefox\/(\d+)/.exec(T.userAgent)||[0,0])[1]:0,chrome:!!B,chrome_version:B?+B[1]:0,ios:V,android:/Android\b/.test(T.userAgent),webkit:L,safari:F,webkit_version:L?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=$.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class H extends O{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){3==e.nodeType&&this.createDOM(e)}merge(e,t,n){return(!n||n instanceof H&&!(this.length-(t-e)+n.length>256))&&(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new H(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new A(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return U(this.dom,e,t)}}class W extends O{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let e of t)e.setParent(this)}setAttrs(e){if(S(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.dirty|=6)}sync(e){this.dom?4&this.dirty&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e)}merge(e,t,n,r,i,o){return!(n&&(!(n instanceof W&&n.mark.eq(this.mark))||e&&i<=0||te&&t.push(n=e&&(r=i),n=s,i++}let o=this.length-e;return this.length=e,r>-1&&(this.children.length=r,this.markDirty()),new W(this.mark,t,o)}domAtPos(e){return Y(this.dom,this.children,e)}coordsAt(e,t){return ee(this,e,t)}}function U(e,t,n){let r=e.nodeValue.length;t>r&&(t=r);let i=t,o=t,s=0;0==t&&n<0||t==r&&n>=0?q.chrome||q.gecko||(t?(i--,s=1):o=0)?0:a.length-1];return q.safari&&!s&&0==l.width&&(l=Array.prototype.find.call(a,(e=>e.width))||l),s?m(l,s<0):l||null}class J extends O{constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}static create(e,t,n){return new(e.customView||J)(e,t,n)}split(e){let t=J.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(){this.dom&&this.widget.updateDOM(this.dom)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,n,r,i,o){return!(n&&(!(n instanceof J&&this.widget.compare(n.widget))||e>0&&i<=0||t0?n.length-1:0;r=n[t],!(e>0?0==t:t==n.length-1||r.top0?-1:1);return 0==e&&t>0||e==this.length&&t<=0?r:m(r,0==e)}get isEditable(){return!1}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class K extends J{domAtPos(e){let{topView:t,text:n}=this.widget;return t?G(e,0,t,n,((e,t)=>e.domAtPos(t)),(e=>new A(n,Math.min(e,n.nodeValue.length)))):new A(n,Math.min(e,n.nodeValue.length))}sync(){this.setDOM(this.widget.toDOM())}localPosFromDOM(e,t){let{topView:n,text:r}=this.widget;return n?Q(e,t,n,r):Math.min(t,this.length)}ignoreMutation(){return!1}get overrideDOMText(){return null}coordsAt(e,t){let{topView:n,text:r}=this.widget;return n?G(e,t,n,r,((e,t,n)=>e.coordsAt(t,n)),((e,t)=>U(r,e,t))):U(r,e,t)}destroy(){var e;super.destroy(),null===(e=this.widget.topView)||void 0===e||e.destroy()}get isEditable(){return!0}}function G(e,t,n,r,i,o){if(n instanceof W){for(let s of n.children){let n=a(s.dom,r),l=n?r.nodeValue.length:s.length;if(e=0;)if(t<0?r>0:r0?-1:1);return n&&n.topt.top?{left:t.left,right:t.right,top:n.top,bottom:n.bottom}:t}get overrideDOMText(){return r.Text.empty}}function Y(e,t,n){let r=0;for(let i=0;ri&&n0;r--){let n=t[r-1].dom;if(n.parentNode==e)return A.after(n)}return new A(e,0)}function X(e,t,n){let r,{children:i}=e;n>0&&t instanceof W&&i.length&&(r=i[i.length-1])instanceof W&&r.mark.eq(t.mark)?X(r,t.children[0],n-1):(i.push(t),t.setParent(e)),e.length+=t.length}function ee(e,t,n){for(let r=0,i=0;i0?a>=t:a>t)&&(t0)){let e=0;if(a==r){if(s.getSide()<=0)continue;e=n=-s.getSide()}let i=s.coordsAt(Math.max(0,t-r),n);return e&&i?m(i,n<0):i}r=a}let r=e.dom.lastChild;if(!r)return e.dom.getBoundingClientRect();let i=c(r);return i[i.length-1]||null}function te(e,t){for(let n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}function ne(e,t){if(e==t)return!0;if(!e||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!=r.length)return!1;for(let i of n)if(-1==r.indexOf(i)||e[i]!==t[i])return!1;return!0}function re(e,t,n){let r=null;if(t)for(let i in t)n&&i in n||e.removeAttribute(r=i);if(n)for(let i in n)t&&t[i]==n[i]||e.setAttribute(r=i,n[i]);return!!r}H.prototype.children=J.prototype.children=Z.prototype.children=C;class ie{eq(e){return!1}updateDOM(e){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}ignoreEvent(e){return!0}get customView(){return null}destroy(e){}}t.BlockType=void 0,(z=t.BlockType||(t.BlockType={}))[z.Text=0]="Text",z[z.WidgetBefore=1]="WidgetBefore",z[z.WidgetAfter=2]="WidgetAfter",z[z.WidgetRange=3]="WidgetRange";class oe extends r.RangeValue{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new se(e)}static widget(e){let t=e.side||0,n=!!e.block;return t+=n?t>0?3e8:-4e8:t>0?1e8:-1e8,new le(e,t,t,n,e.widget||null,!1)}static replace(e){let t,n,r=!!e.block;if(e.isBlockGap)t=-5e8,n=4e8;else{let{start:i,end:o}=ce(e,r);t=(i?r?-3e8:-1:5e8)-1,n=1+(o?r?2e8:1:-6e8)}return new le(e,t,n,r,e.widget||null,!0)}static line(e){return new ae(e)}static set(e,t=!1){return r.RangeSet.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}oe.none=r.RangeSet.empty;class se extends oe{constructor(e){let{start:t,end:n}=ce(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){return this==e||e instanceof se&&this.tagName==e.tagName&&this.class==e.class&&ne(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}se.prototype.point=!1;class ae extends oe{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof ae&&ne(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}ae.prototype.mapMode=r.MapMode.TrackBefore,ae.prototype.point=!0;class le extends oe{constructor(e,t,n,i,o,s){super(t,n,o,e),this.block=i,this.isReplace=s,this.mapMode=i?t<=0?r.MapMode.TrackBefore:r.MapMode.TrackAfter:r.MapMode.TrackDel}get type(){return this.startSide=5}eq(e){return e instanceof le&&((t=this.widget)==(n=e.widget)||!!(t&&n&&t.compare(n)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,n}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function ce(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return null==n&&(n=e.inclusive),null==r&&(r=e.inclusive),{start:null!=n?n:t,end:null!=r?r:t}}function he(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}le.prototype.point=!0;class ue extends O{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,n,r,i,o){if(n){if(!(n instanceof ue))return!1;this.dom||n.transferDOM(this)}return r&&this.setDeco(n?n.attrs:null),I(this,e,t,n?n.children:[],i,o),!0}split(e){let t=new ue;if(t.breakAfter=this.breakAfter,0==this.length)return t;let{i:n,off:r}=this.childPos(e);r&&(t.append(this.children[n].split(r),0),this.children[n].merge(r,this.children[n].length,null,!1,0,0),n++);for(let e=n;e0&&0==this.children[n-1].length;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){ne(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){X(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=te(t,this.attrs||{})),n&&(this.attrs=te({class:n},this.attrs||{}))}domAtPos(e){return Y(this.dom,this.children,e)}reuseDOM(e){"DIV"==e.nodeName&&(this.setDOM(e),this.dirty|=6)}sync(e){var t;this.dom?4&this.dirty&&(S(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(re(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e);let n=this.dom.lastChild;for(;n&&O.get(n)instanceof W;)n=n.lastChild;if(!(n&&this.length&&("BR"==n.nodeName||0!=(null===(t=O.get(n))||void 0===t?void 0:t.isEditable)||q.ios&&this.children.some((e=>e instanceof H))))){let e=document.createElement("BR");e.cmIgnore=!0,this.dom.appendChild(e)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let e=0;for(let t of this.children){if(!(t instanceof H)||/[^ -~]/.test(t.text))return null;let n=c(t.dom);if(1!=n.length)return null;e+=n[0].width}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length}:null}coordsAt(e,t){return ee(this,e,t)}become(e){return!1}get type(){return t.BlockType.Text}static find(e,t){for(let n=0,r=0;n=t){if(i instanceof ue)return i;if(o>t)break}r=o+i.breakAfter}return null}}class fe extends O{constructor(e,t,n){super(),this.widget=e,this.length=t,this.type=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,r,i,o){return!(n&&(!(n instanceof fe&&this.widget.compare(n.widget))||e>0&&i<=0||t0;){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skip);if(this.skip=0,r)throw new Error("Ran out of text content when drawing inline views");if(n){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer([]),this.curLine=null,e--;continue}this.text=t,this.textOff=0}let r=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(0,n)),this.getLine().append(pe(new H(this.text.slice(this.textOff,this.textOff+r)),t),n),this.atCursorPos=!0,this.textOff+=r,e-=r,n=0}}span(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}point(e,n,r,i,o,s){if(this.disallowBlockEffectsFor[s]&&r instanceof le){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=n-e;if(r instanceof le)if(r.block){let{type:e}=r;e!=t.BlockType.WidgetAfter||this.posCovered()||this.getLine(),this.addBlockWidget(new fe(r.widget||new me("div"),a,e))}else{let t=J.create(r.widget||new me("span"),a,r.startSide),s=this.atCursorPos&&!t.isEditable&&o<=i.length&&(e0),l=!t.isEditable&&(ee.some((e=>e))});class Se{constructor(e,t="nearest",n="nearest",r=5,i=5){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i}map(e){return e.empty?this:new Se(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const Ae=r.StateEffect.define({map:(e,t)=>e.map(t)});function Ce(e,t,n){let r=e.facet(be);r.length?r[0](t):window.onerror?window.onerror(String(t),n,void 0,void 0,t):n?console.error(n+":",t):console.error(t)}const Oe=r.Facet.define({combine:e=>!e.length||e[0]});let Ee=0;const je=r.Facet.define();class Me{constructor(e,t,n,r){this.id=e,this.create=t,this.domEventHandlers=n,this.extension=r(this)}static define(e,t){const{eventHandlers:n,provide:r,decorations:i}=t||{};return new Me(Ee++,e,n,(e=>{let t=[je.of(e)];return i&&t.push(_e.of((t=>{let n=t.plugin(e);return n?i(n):oe.none}))),r&&t.push(r(e)),t}))}static fromClass(e,t){return Me.define((t=>new e(t)),t)}}class Ie{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(Ce(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Ce(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(t){Ce(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Te=r.Facet.define(),$e=r.Facet.define(),_e=r.Facet.define(),Pe=r.Facet.define(),De=r.Facet.define(),Re=r.Facet.define();class Ne{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new Ne(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toAc)break;i+=2}if(!a)return n;new Ne(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),o=a.toA,s=a.toB}}}class Be{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=r.ChangeSet.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let i=[];this.changes.iterChangedRanges(((e,t,n,r)=>i.push(new Ne(e,t,n,r)))),this.changedRanges=i;let o=e.hasFocus;o!=e.inputState.notifiedFocused&&(e.inputState.notifiedFocused=o,this.flags|=1)}static create(e,t,n){return new Be(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(10&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((e=>e.selection))}get empty(){return 0==this.flags&&0==this.transactions.length}}var Le;t.Direction=void 0,(Le=t.Direction||(t.Direction={}))[Le.LTR=0]="LTR",Le[Le.RTL=1]="RTL";const Fe=t.Direction.LTR,Ve=t.Direction.RTL;function ze(e){let t=[];for(let n=0;n=t){if(s.level==n)return o;(i<0||(0!=r?r<0?s.fromt:e[i].level>s.level))&&(i=o)}}if(i<0)throw new RangeError("Index out of range");return i}}const Ge=[];function Qe(e,t){let n=e.length,r=t==Fe?1:2,i=t==Fe?2:1;if(!e||1==r&&!Je.test(e))return Ze(n);for(let t=0,i=r,s=r;t=0;e-=3)if(Ue[e+1]==-o){let t=Ue[e+2],n=2&t?r:4&t?1&t?i:r:0;n&&(Ge[a]=Ge[Ue[e]]=n),l=e;break}}else{if(189==Ue.length)break;Ue[l++]=a,Ue[l++]=t,Ue[l++]=c}else if(2==(s=Ge[a])||1==s){let e=s==r;c=e?0:1;for(let t=l-3;t>=0;t-=3){let n=Ue[t+2];if(2&n)break;if(e)Ue[t+2]|=2;else{if(4&n)break;Ue[t+2]|=4}}}for(let e=0;et;){let e=n,r=2!=Ge[--n];for(;n>t&&r==(2!=Ge[n-1]);)n--;s.push(new Ke(n,e,r?2:1))}else s.push(new Ke(t,e,0))}else for(let e=0;e1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=s-1);n=o+s}}readNode(e){if(e.cmIgnore)return;let t=O.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+Math.min(t,n.offset))}}function nt(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}class rt{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class it extends O{constructor(e){super(),this.view=e,this.compositionDeco=oe.none,this.decorations=[],this.dynamicDecorationMap=[],this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new ue],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Ne(0,0,0,e.state.doc.length)],0)}get root(){return this.view.root}get editorView(){return this.view}get length(){return this.view.state.doc.length}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every((({fromA:e,toA:t})=>tthis.minWidthTo))?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.view.inputState.composing<0?this.compositionDeco=oe.none:(e.transactions.length||this.dirty)&&(this.compositionDeco=function(e,t){let n=st(e);if(!n)return oe.none;let{from:r,to:i,node:o,text:s}=n,a=t.mapPos(r,1),l=Math.max(a,t.mapPos(i,-1)),{state:c}=e,h=3==o.nodeType?o.nodeValue:new tt([],c).readRange(o.firstChild,null).text;if(l-a{this.dom.style.height=this.view.viewState.contentHeight+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let e=q.chrome||q.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.sync(e),this.dirty=0,e&&(e.written||n.selectionRange.focusNode!=e.node)&&(this.forceSelection=!0),this.dom.style.height=""}));let r=[];if(this.view.viewport.from||this.view.viewport.to=0?e[t]:null;if(!r)break;let{fromA:i,toA:o,fromB:s,toB:a}=r,{content:l,breakAtStart:c,openStart:h,openEnd:u}=de.build(this.view.state.doc,s,a,this.decorations,this.dynamicDecorationMap),{i:f,off:d}=n.findPos(o,1),{i:p,off:m}=n.findPos(i,-1);M(this,p,m,f,d,l,c,h,u)}}updateSelection(e=!1,t=!1){if(!e&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange(),!t&&!this.mayControlSelection()||q.ios&&this.view.inputState.rapidCompositionStart)return;let n=this.forceSelection;this.forceSelection=!1;let r=this.view.state.selection.main,i=this.domAtPos(r.anchor),o=r.empty?i:this.domAtPos(r.head);if(q.gecko&&r.empty&&1==(a=i).node.nodeType&&a.node.firstChild&&(0==a.offset||"false"==a.node.childNodes[a.offset-1].contentEditable)&&(a.offset==a.node.childNodes.length||"false"==a.node.childNodes[a.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore((()=>i.node.insertBefore(e,i.node.childNodes[i.offset]||null))),i=o=new A(e,0),n=!0}var a;let l=this.view.observer.selectionRange;!n&&l.focusNode&&h(i.node,i.offset,l.anchorNode,l.anchorOffset)&&h(o.node,o.offset,l.focusNode,l.focusOffset)||(this.view.observer.ignore((()=>{q.android&&q.chrome&&this.dom.contains(l.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(l.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let e=s(this.root);if(e)if(r.empty){if(q.gecko){let e=(t=i.node,n=i.offset,1!=t.nodeType?0:(n&&"false"==t.childNodes[n-1].contentEditable?1:0)|(nr.head&&([i,o]=[o,i]),t.setEnd(o.node,o.offset),t.setStart(i.node,i.offset),e.removeAllRanges(),e.addRange(t)}var t,n})),this.view.observer.setSelectionRange(i,o)),this.impreciseAnchor=i.precise?null:new A(l.anchorNode,l.anchorOffset),this.impreciseHead=o.precise?null:new A(l.focusNode,l.focusOffset)}enforceCursorAssoc(){if(this.compositionDeco.size)return;let e=this.view.state.selection.main,t=s(this.root);if(!(t&&e.empty&&e.assoc&&t.modify))return;let n=ue.find(this,e.head);if(!n)return;let r=n.posAtStart;if(e.head==r||e.head==r+n.length)return;let i=this.coordsAt(e.head,-1),o=this.coordsAt(e.head,1);if(!i||!o||i.bottom>o.top)return;let a=this.domAtPos(e.head+e.assoc);t.collapse(a.node,a.offset),t.modify("move",e.assoc<0?"forward":"backward","lineboundary")}mayControlSelection(){let e=this.root.activeElement;return e==this.dom||l(this.dom,this.view.observer.selectionRange)&&!(e&&this.dom.contains(e))}nearest(e){for(let t=e;t;){let e=O.get(t);if(e&&e.rootView==this)return e;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;ts||e==s&&o.type!=t.BlockType.WidgetBefore&&o.type!=t.BlockType.WidgetAfter&&(!i||2==n||this.children[i-1].breakAfter||this.children[i-1].type==t.BlockType.WidgetBefore&&n>-2))return o.coordsAt(e-s,n);r=s}}measureVisibleLineHeights(e){let n=[],{from:r,to:i}=e,o=this.view.contentDOM.clientWidth,s=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==t.Direction.LTR;for(let e=0,t=0;ti)break;if(e>=r){let t=h.dom.getBoundingClientRect();if(n.push(t.height),s){let n=h.dom.lastChild,r=n?c(n):[];if(r.length){let n=r[r.length-1],i=l?n.right-t.left:t.right-n.left;i>a&&(a=i,this.minWidth=o,this.minWidthFrom=e,this.minWidthTo=u)}}}e=u+h.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return"rtl"==getComputedStyle(this.children[n].dom).direction?t.Direction.RTL:t.Direction.LTR}measureTextSize(){for(let e of this.children)if(e instanceof ue){let t=e.measureTextSize();if(t)return t}let e,t,n=document.createElement("div");return n.className="cm-line",n.style.width="99999px",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((()=>{this.dom.appendChild(n);let r=c(n.firstChild)[0];e=n.getBoundingClientRect().height,t=r?r.width/27:7,n.remove()})),{lineHeight:e,charWidth:t}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new j(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],o=i?i.from-1:this.length;if(o>n){let r=t.lineBlockAt(o).bottom-t.lineBlockAt(n).top;e.push(oe.replace({widget:new ot(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!i)break;n=i.to+1}return oe.set(e)}updateDeco(){let e=this.view.state.facet(_e).map(((e,t)=>(this.dynamicDecorationMap[t]="function"==typeof e)?e(this.view):e));for(let t=e.length;tr.anchor?-1:1);if(!i)return;!r.empty&&(n=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(i={left:Math.min(i.left,n.left),top:Math.min(i.top,n.top),right:Math.max(i.right,n.right),bottom:Math.max(i.bottom,n.bottom)});let o=0,s=0,a=0,l=0;for(let e of this.view.state.facet(De).map((e=>e(this.view))))if(e){let{left:t,right:n,top:r,bottom:i}=e;null!=t&&(o=Math.max(o,t)),null!=n&&(s=Math.max(s,n)),null!=r&&(a=Math.max(a,r)),null!=i&&(l=Math.max(l,i))}let c={left:i.left-o,top:i.top-a,right:i.right+s,bottom:i.bottom+l};!function(e,t,n,r,i,o,s,a){let l=e.ownerDocument,c=l.defaultView;for(let h=e;h;)if(1==h.nodeType){let e,u=h==l.body;if(u)e=g(c);else{if(h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.parentNode;continue}let t=h.getBoundingClientRect();e={left:t.left,right:t.left+h.clientWidth,top:t.top,bottom:t.top+h.clientHeight}}let f=0,d=0;if("nearest"==i)t.top0&&t.bottom>e.bottom+d&&(d=t.bottom-e.bottom+d+s)):t.bottom>e.bottom&&(d=t.bottom-e.bottom+s,n<0&&t.top-d0&&t.right>e.right+f&&(f=t.right-e.right+f+o)):t.right>e.right&&(f=t.right-e.right+o,n<0&&t.left0&&n<=0)t=d(e=e.childNodes[t-1]);else{if(!(1==e.nodeType&&t=0))return null;e=e.childNodes[t],t=0}}}class ct{constructor(){this.changes=[]}compareRange(e,t){he(e,t,this.changes)}comparePoint(e,t){he(e,t,this.changes)}}function ht(e,t){return t.left>e?t.left-e:Math.max(0,e-t.right)}function ut(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function ft(e,t){return e.topt.top+1}function dt(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function mt(e,t,n){let r,i,o,s,a,l,h,u;for(let f=e.firstChild;f;f=f.nextSibling){let e=c(f);for(let c=0;cm||s==m&&o>p)&&(r=f,i=d,o=p,s=m),0==p?n>d.bottom&&(!h||h.bottomd.top)&&(l=f,u=d):h&&ft(h,d)?h=pt(h,d.bottom):u&&ft(u,d)&&(u=dt(u,d.top))}}if(h&&h.bottom>=n?(r=a,i=h):u&&u.top<=n&&(r=l,i=u),!r)return{node:e,offset:0};let f=Math.max(i.left,Math.min(i.right,t));return 3==r.nodeType?gt(r,f,n):o||"true"!=r.contentEditable?{node:e,offset:Array.prototype.indexOf.call(e.childNodes,r)+(t>=(i.left+i.right)/2?1:0)}:mt(r,f,n)}function gt(e,t,n){let r=e.nodeValue.length,i=-1,o=1e9,s=0;for(let a=0;an?c.top-n:n-c.bottom)-1;if(c.left-1<=t&&c.right+1>=t&&h=(c.left+c.right)/2,r=n;if((q.chrome||q.gecko)&&x(e,a).getBoundingClientRect().left==c.right&&(r=!n),h<=0)return{node:e,offset:a+(r?1:0)};i=a+(r?1:0),o=h}}}return{node:e,offset:i>-1?i:s>0?e.nodeValue.length:0}}function vt(e,{x:n,y:r},i,o=-1){var s;let a,l=e.contentDOM.getBoundingClientRect(),c=l.top+e.viewState.paddingTop,{docHeight:h}=e.viewState,u=r-c;if(u<0)return 0;if(u>h)return e.state.doc.length;for(let n=e.defaultLineHeight/2,r=!1;a=e.elementAtHeight(u),a.type!=t.BlockType.Text;)for(;u=o>0?a.bottom+n:a.top-n,!(u>=0&&u<=h);){if(r)return i?null:0;r=!0,o=-o}r=c+u;let f=a.from;if(fe.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:i?null:yt(e,l,a,n,r);let d=e.dom.ownerDocument,p=e.root.elementFromPoint?e.root:d,m=p.elementFromPoint(n,r);m&&!e.contentDOM.contains(m)&&(m=null),m||(n=Math.max(l.left+1,Math.min(l.right-1,n)),m=p.elementFromPoint(n,r),m&&!e.contentDOM.contains(m)&&(m=null));let g,v=-1;if(m&&0!=(null===(s=e.docView.nearest(m))||void 0===s?void 0:s.isEditable))if(d.caretPositionFromPoint){let e=d.caretPositionFromPoint(n,r);e&&({offsetNode:g,offset:v}=e)}else if(d.caretRangeFromPoint){let e=d.caretRangeFromPoint(n,r);e&&(({startContainer:g,startOffset:v}=e),(q.safari&&function(e,t,n){let r;if(3!=e.nodeType||t!=(r=e.nodeValue.length))return!1;for(let t=e.nextSibling;t;t=t.nextSibling)if(1!=t.nodeType||"BR"!=t.nodeName)return!1;return x(e,r-1,r).getBoundingClientRect().left>n}(g,v,n)||q.chrome&&function(e,t,n){if(0!=t)return!1;for(let t=e;;){let e=t.parentNode;if(!e||1!=e.nodeType||e.firstChild!=t)return!1;if(e.classList.contains("cm-line"))break;t=e}return n-(1==e.nodeType?e.getBoundingClientRect():x(e,0,Math.max(e.nodeValue.length,1)).getBoundingClientRect()).left>5}(g,v,n))&&(g=void 0))}if(!g||!e.docView.dom.contains(g)){let t=ue.find(e.docView,f);if(!t)return u>a.top+a.height/2?a.to:a.from;({node:g,offset:v}=mt(t.dom,n,r))}return e.docView.posFromDOM(g,v)}function yt(e,t,n,i,o){let s=Math.round((i-t.left)*e.defaultCharacterWidth);e.lineWrapping&&n.height>1.5*e.defaultLineHeight&&(s+=Math.floor((o-n.top)/e.defaultLineHeight)*e.viewState.heightOracle.lineLength);let a=e.state.sliceDoc(n.from,n.to);return n.from+r.findColumn(a,s,e.state.tabSize)}function bt(e,t,n,i){let o=e.state.doc.lineAt(t.head),s=e.bidiSpans(o),a=e.textDirectionAt(o.from);for(let l=t,c=null;;){let t=Xe(o,s,a,l,n),h=Ye;if(!t){if(o.number==(n?e.state.doc.lines:1))return l;h="\n",o=e.state.doc.line(o.number+(n?1:-1)),s=e.bidiSpans(o),t=r.EditorSelection.cursor(n?o.from:o.to)}if(c){if(!c(h))return l}else{if(!i)return t;c=i(h)}l=t}}function wt(e,t,n){let i=e.state.facet(Pe).map((t=>t(e)));for(;;){let e=!1;for(let o of i)o.between(n.from-1,n.from+1,((i,o,s)=>{n.from>i&&n.fromn.from?r.EditorSelection.cursor(i,1):r.EditorSelection.cursor(o,-1),e=!0)}));if(!e)return n}}class xt{constructor(e){this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.chromeScrollHack=-1,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.rapidCompositionStart=!1,this.mouseSelection=null;for(let t in Ot){let n=Ot[t];e.contentDOM.addEventListener(t,(r=>{Ct(e,r)&&!this.ignoreDuringComposition(r)&&("keydown"==t&&this.keydown(e,r)||(this.mustFlushObserver(r)&&e.observer.forceFlush(),this.runCustomHandlers(t,e,r)?r.preventDefault():n(e,r)))}),Et[t]),this.registeredEvents.push(t)}q.chrome&&102==q.chrome_version&&e.scrollDOM.addEventListener("wheel",(()=>{this.chromeScrollHack<0?e.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout((()=>{this.chromeScrollHack=-1,e.contentDOM.style.pointerEvents=""}),100)}),{passive:!0}),this.notifiedFocused=e.hasFocus,q.safari&&e.contentDOM.addEventListener("input",(()=>null))}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e,t){var n;let r;this.customHandlers=[];for(let i of t)if(r=null===(n=i.update(e).spec)||void 0===n?void 0:n.domEventHandlers){this.customHandlers.push({plugin:i.value,handlers:r});for(let t in r)this.registeredEvents.indexOf(t)<0&&"scroll"!=t&&(this.registeredEvents.push(t),e.contentDOM.addEventListener(t,(n=>{Ct(e,n)&&this.runCustomHandlers(t,e,n)&&n.preventDefault()})))}}runCustomHandlers(e,t,n){for(let r of this.customHandlers){let i=r.handlers[e];if(i)try{if(i.call(r.plugin,n,t)||n.defaultPrevented)return!0}catch(e){Ce(t.state,e)}}return!1}runScrollHandlers(e,t){this.lastScrollTop=e.scrollDOM.scrollTop,this.lastScrollLeft=e.scrollDOM.scrollLeft;for(let n of this.customHandlers){let r=n.handlers.scroll;if(r)try{r.call(n.plugin,t,e)}catch(t){Ce(e.state,t)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),9==t.keyCode&&Date.now()e.keyCode==t.keyCode)))||t.ctrlKey||t.altKey||t.metaKey||t.synthetic||(this.pendingIOSKey=n,setTimeout((()=>this.flushIOSKey(e)),250),0))}flushIOSKey(e){let t=this.pendingIOSKey;return!!t&&(this.pendingIOSKey=void 0,k(e.contentDOM,t.key,t.keyCode))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(q.safari&&!q.ios&&Date.now()-this.compositionEndedAt<100)&&(this.compositionEndedAt=0,!0))}mustFlushObserver(e){return"keydown"==e.type&&229!=e.keyCode||"compositionend"==e.type&&!q.ios}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}const kt=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],St=[16,17,18,20,91,92,224,225];class At{constructor(e,t,n,i){this.view=e,this.style=n,this.mustSelect=i,this.lastEvent=t;let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(r.EditorState.allowMultipleSelections)&&function(e,t){let n=e.state.facet(ge);return n.length?n[0](t):q.mac?t.metaKey:t.ctrlKey}(e,t),this.dragMove=function(e,t){let n=e.state.facet(ve);return n.length?n[0](t):q.mac?!t.altKey:!t.ctrlKey}(e,t),this.dragging=!(!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=s(e.root);if(!r||0==r.rangeCount)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}(e,t)||1!=Lt(t))&&null,!1===this.dragging&&(t.preventDefault(),this.select(t))}move(e){if(0==e.buttons)return this.destroy();!1===this.dragging&&this.select(this.lastEvent=e)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}select(e){let t=this.style.get(e,this.extend,this.multiple);!this.mustSelect&&t.eq(this.view.state.selection)&&t.main.assoc==this.view.state.selection.main.assoc||this.view.dispatch({selection:t,userEvent:"select.pointer",scrollIntoView:!0}),this.mustSelect=!1}update(e){e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)&&setTimeout((()=>this.select(this.lastEvent)),20)}}function Ct(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n,r=t.target;r!=e.contentDOM;r=r.parentNode)if(!r||11==r.nodeType||(n=O.get(r))&&n.ignoreEvent(t))return!1;return!0}const Ot=Object.create(null),Et=Object.create(null),jt=q.ie&&q.ie_version<15||q.ios&&q.webkit_version<604;function Mt(e,t){let n,{state:i}=e,o=1,s=i.toText(t),a=s.lines==i.selection.ranges.length;if(null!=Vt&&i.selection.ranges.every((e=>e.empty))&&Vt==s.toString()){let e=-1;n=i.changeByRange((n=>{let l=i.doc.lineAt(n.from);if(l.from==e)return{range:n};e=l.from;let c=i.toText((a?s.line(o++).text:t)+i.lineBreak);return{changes:{from:l.from,insert:c},range:r.EditorSelection.cursor(n.from+c.length)}}))}else n=a?i.changeByRange((e=>{let t=s.line(o++);return{changes:{from:e.from,to:e.to,insert:t.text},range:r.EditorSelection.cursor(e.from+t.length)}})):i.replaceSelection(s);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}function It(e,t,n,i){if(1==i)return r.EditorSelection.cursor(t,n);if(2==i)return function(e,t,n=1){let i=e.charCategorizer(t),o=e.doc.lineAt(t),s=t-o.from;if(0==o.length)return r.EditorSelection.cursor(t);0==s?n=1:s==o.length&&(n=-1);let a=s,l=s;n<0?a=r.findClusterBreak(o.text,s,!1):l=r.findClusterBreak(o.text,s);let c=i(o.text.slice(a,l));for(;a>0;){let e=r.findClusterBreak(o.text,a,!1);if(i(o.text.slice(e,a))!=c)break;a=e}for(;l{e.inputState.setSelectionOrigin("select"),27==t.keyCode?e.inputState.lastEscPress=Date.now():St.indexOf(t.keyCode)<0&&(e.inputState.lastEscPress=0)},Ot.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},Ot.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},Et.touchstart=Et.touchmove={passive:!0},Ot.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3&&1==Lt(t))return;let n=null;for(let r of e.state.facet(ye))if(n=r(e,t),n)break;if(n||0!=t.button||(n=function(e,t){let n=Pt(e,t),i=Lt(t),o=e.state.selection,s=n,a=t;return{update(e){e.docChanged&&(n&&(n.pos=e.changes.mapPos(n.pos)),o=o.map(e.changes),a=null)},get(t,l,c){let h;if(a&&t.clientX==a.clientX&&t.clientY==a.clientY?h=s:(h=s=Pt(e,t),a=t),!h||!n)return o;let u=It(e,h.pos,h.bias,i);if(n.pos!=h.pos&&!l){let t=It(e,n.pos,n.bias,i),o=Math.min(t.from,u.from),s=Math.max(t.to,u.to);u=o1&&o.ranges.some((e=>e.eq(u)))?function(e,t){for(let n=0;;n++)if(e.ranges[n].eq(t))return r.EditorSelection.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}(o,u):c?o.addRange(u):r.EditorSelection.create([u])}}}(e,t)),n){let r=e.root.activeElement!=e.contentDOM;r&&e.observer.ignore((()=>w(e.contentDOM))),e.inputState.startMouseSelection(new At(e,t,n,r))}};let Tt=(e,t)=>e>=t.top&&e<=t.bottom,$t=(e,t,n)=>Tt(t,n)&&e>=n.left&&e<=n.right;function _t(e,t,n,r){let i=ue.find(e.docView,t);if(!i)return 1;let o=t-i.posAtStart;if(0==o)return 1;if(o==i.length)return-1;let s=i.coordsAt(o,-1);if(s&&$t(n,r,s))return-1;let a=i.coordsAt(o,1);return a&&$t(n,r,a)?1:s&&Tt(r,s)?-1:1}function Pt(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:_t(e,n,t.clientX,t.clientY)}}const Dt=q.ie&&q.ie_version<=11;let Rt=null,Nt=0,Bt=0;function Lt(e){if(!Dt)return e.detail;let t=Rt,n=Bt;return Rt=e,Bt=Date.now(),Nt=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(Nt+1)%3:1}function Ft(e,t,n,r){if(!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1);t.preventDefault();let{mouseSelection:o}=e.inputState,s=r&&o&&o.dragging&&o.dragMove?{from:o.dragging.from,to:o.dragging.to}:null,a={from:i,insert:n},l=e.state.changes(s?[s,a]:a);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"})}Ot.dragstart=(e,t)=>{let{selection:{main:n}}=e.state,{mouseSelection:r}=e.inputState;r&&(r.dragging=n),t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(n.from,n.to)),t.dataTransfer.effectAllowed="copyMove")},Ot.drop=(e,t)=>{if(!t.dataTransfer)return;if(e.state.readOnly)return t.preventDefault();let n=t.dataTransfer.files;if(n&&n.length){t.preventDefault();let r=Array(n.length),i=0,o=()=>{++i==n.length&&Ft(e,t,r.filter((e=>null!=e)).join(e.state.lineBreak),!1)};for(let e=0;e{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),o()},t.readAsText(n[e])}}else Ft(e,t,t.dataTransfer.getData("Text"),!0)},Ot.paste=(e,t)=>{if(e.state.readOnly)return t.preventDefault();e.observer.flush();let n=jt?null:t.clipboardData;n?(Mt(e,n.getData("text/plain")),t.preventDefault()):function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((()=>{e.focus(),n.remove(),Mt(e,n.value)}),50)}(e)};let Vt=null;function zt(e){setTimeout((()=>{e.hasFocus!=e.inputState.notifiedFocused&&e.update([])}),10)}function qt(e,t){if(e.docView.compositionDeco.size){e.inputState.rapidCompositionStart=t;try{e.update([])}finally{e.inputState.rapidCompositionStart=!1}}}Ot.copy=Ot.cut=(e,t)=>{let{text:n,ranges:r,linewise:i}=function(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let o=e.doc.lineAt(r);o.number>i&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),i=o.number}r=!0}return{text:t.join(e.lineBreak),ranges:n,linewise:r}}(e.state);if(!n&&!i)return;Vt=i?n:null;let o=jt?null:t.clipboardData;o?(t.preventDefault(),o.clearData(),o.setData("text/plain",n)):function(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout((()=>{r.remove(),e.focus()}),50)}(e,n),"cut"!=t.type||e.state.readOnly||e.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"})},Ot.focus=e=>{e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),zt(e)},Ot.blur=e=>{e.observer.clearSelectionRange(),zt(e)},Ot.compositionstart=Ot.compositionupdate=e=>{null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0,e.docView.compositionDeco.size&&(e.observer.flush(),qt(e,!0)))},Ot.compositionend=e=>{e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionFirstChange=null,setTimeout((()=>{e.inputState.composing<0&&qt(e,!1)}),50)},Ot.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},Ot.beforeinput=(e,t)=>{var n;let r;if(q.chrome&&q.android&&(r=kt.find((e=>e.inputType==t.inputType)))&&(e.observer.delayAndroidKey(r.key,r.keyCode),"Backspace"==r.key||"Delete"==r.key)){let t=(null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0;setTimeout((()=>{var n;((null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())}),100)}};const Ht=["pre-wrap","normal","pre-line","break-spaces"];class Wt{constructor(){this.doc=r.Text.empty,this.lineWrapping=!1,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength)),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Ht.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,s=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.lineLength=r,s){this.heightSamples={};for(let e=0;e0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>Gt&&(e.heightChanged=!0),this.height=t)}replace(e,t,n){return Qt.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this;for(let o=r.length-1;o>=0;o--){let{fromA:s,toA:a,fromB:l,toB:c}=r[o],h=i.lineAt(s,Kt.ByPosNoHeight,t,0,0),u=h.to>=a?h:i.lineAt(a,Kt.ByPosNoHeight,t,0,0);for(c+=u.to-a,a=u.to;o>0&&h.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s2*i){let i=e[t-1];i.break?e.splice(--t,1,i.left,null,i.right):e.splice(--t,1,i.left,i.right),n+=1+i.break,r-=i.size}else{if(!(i>2*r))break;{let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,i-=t.size}}else if(r=i&&o(this.blockAt(0,n,r,i))}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setHeight(e,r.heights[r.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Yt extends Zt{constructor(e,n){super(e,n,t.BlockType.Text),this.collapsed=0,this.widgetHeight=0}replace(e,t,n){let r=n[0];return 1==n.length&&(r instanceof Yt||r instanceof Xt&&4&r.flags)&&Math.abs(this.length-r.length)<10?(r instanceof Xt?r=new Yt(r.length,this.height):r.height=this.height,this.outdated||(r.outdated=!1),r):Qt.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setHeight(e,r.heights[r.index++]):(n||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Xt extends Qt{constructor(e){super(e,0)}lines(e,t){let n=e.lineAt(t).number,r=e.lineAt(t+this.length).number;return{firstLine:n,lastLine:r,lineHeight:this.height/(r-n+1)}}blockAt(e,n,r,i){let{firstLine:o,lastLine:s,lineHeight:a}=this.lines(n,i),l=Math.max(0,Math.min(s-o,Math.floor((e-r)/a))),{from:c,length:h}=n.line(o+l);return new Jt(c,h,r+a*l,a,t.BlockType.Text)}lineAt(e,n,r,i,o){if(n==Kt.ByHeight)return this.blockAt(e,r,i,o);if(n==Kt.ByPosNoHeight){let{from:n,to:i}=r.lineAt(e);return new Jt(n,i-n,0,0,t.BlockType.Text)}let{firstLine:s,lineHeight:a}=this.lines(r,o),{from:l,length:c,number:h}=r.lineAt(e);return new Jt(l,c,i+a*(h-s),a,t.BlockType.Text)}forEachLine(e,n,r,i,o,s){let{firstLine:a,lineHeight:l}=this.lines(r,o);for(let c=Math.max(e,o),h=Math.min(o+this.length,n);c<=h;){let n=r.lineAt(c);c==e&&(i+=l*(n.number-a)),s(new Jt(n.from,n.length,i,l,t.BlockType.Text)),i+=l,c=n.to+1}}replace(e,t,n){let r=this.length-t;if(r>0){let e=n[n.length-1];e instanceof Xt?n[n.length-1]=new Xt(e.length+r):n.push(null,new Xt(r-1))}if(e>0){let t=n[0];t instanceof Xt?n[0]=new Xt(e+t.length):n.unshift(new Xt(e-1),null)}return Qt.of(n)}decomposeLeft(e,t){t.push(new Xt(e-1),null)}decomposeRight(e,t){t.push(null,new Xt(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let i=t+this.length;if(r&&r.from<=t+this.length&&r.more){let n=[],o=Math.max(t,r.from),s=-1,a=e.heightChanged;for(r.from>t&&n.push(new Xt(r.from-t-1).updateHeight(e,t));o<=i&&r.more;){let t=e.doc.lineAt(o).length;n.length&&n.push(null);let i=r.heights[r.index++];-1==s?s=i:Math.abs(i-s)>=Gt&&(s=-2);let a=new Yt(t,i);a.outdated=!1,n.push(a),o+=t+1}o<=i&&n.push(null,new Xt(i-o).updateHeight(e,o));let l=Qt.of(n);return e.heightChanged=a||s<0||Math.abs(l.height-this.height)>=Gt||Math.abs(s-this.lines(e.doc,t).lineHeight)>=Gt,l}return(n||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class en extends Qt{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,r){let i=n+this.left.height;return es))return l;let c=t==Kt.ByPosNoHeight?Kt.ByPosNoHeight:Kt.ByPos;return a?l.join(this.right.lineAt(s,c,n,o,s)):this.left.lineAt(s,c,n,r,i).join(l)}forEachLine(e,t,n,r,i,o){let s=r+this.left.height,a=i+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,n,s,a,o);else{let l=this.lineAt(a,Kt.ByPos,n,r,i);e=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(l.to+1,t,n,s,a,o)}}replace(e,t,n){let r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let o=i.length;for(let e of n)i.push(e);if(e>0&&tn(i,o-1),t=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e2*t.size||t.size>2*e.size?Qt.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:o}=this,s=t+i.length+this.break,a=null;return r&&r.from<=t+i.length&&r.more?a=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=s+o.length&&r.more?a=o=o.updateHeight(e,s,n,r):o.updateHeight(e,s,n),a?this.balanced(i,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function tn(e,t){let n,r;null==e[t]&&(n=e[t-1])instanceof Xt&&(r=e[t+1])instanceof Xt&&e.splice(t-1,3,new Xt(n.length+1+r.length))}class nn{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof Yt?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new Yt(e-this.pos,-1)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e=5)&&this.addLineDeco(r,i)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Yt(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new Xt(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Yt)return e;let t=new Yt(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine(),e.type!=t.BlockType.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,e.type!=t.BlockType.WidgetBefore&&(this.covering=e)}addLineDeco(e,t){let n=this.ensureLine();n.length+=t,n.collapsed+=t,n.widgetHeight=Math.max(n.widgetHeight,e),this.writtenTo=this.pos=this.pos+t}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof Yt||this.isCovered?(this.writtenTon.clientHeight||n.scrollWidth>n.clientWidth)&&"visible"!=a.overflow){let a=n.getBoundingClientRect();r=Math.max(r,a.left),i=Math.min(i,a.right),o=Math.max(o,a.top),s=t==e.parentNode?a.bottom:Math.min(s,a.bottom)}t="absolute"==a.position||"fixed"==a.position?n.offsetParent:n.parentNode}else{if(11!=t.nodeType)break;t=t.host}return{left:r-n.left,right:Math.max(r,i)-n.left,top:o-(n.top+t),bottom:Math.max(o,s)-(n.top+t)}}function sn(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class an{constructor(e,t,n){this.from=e,this.to=t,this.size=n}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n"function"!=typeof e)),this.heightMap=Qt.empty().applyChanges(this.stateDeco,r.Text.empty,this.heightOracle.setDoc(e.doc),[new Ne(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=oe.set(this.lineGaps.map((e=>e.draw(!1)))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some((({from:e,to:t})=>r>=e&&r<=t))){let{from:t,to:n}=this.lineBlockAt(r);e.push(new hn(t,n))}}this.viewports=e.sort(((e,t)=>e.from-t.from)),this.scaler=this.heightMap.height<=7e6?gn:new vn(this.heightOracle.doc,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.state.doc,0,0,(e=>{this.viewportLines.push(1==this.scaler.scale?e:yn(e,this.scaler))}))}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(_e).filter((e=>"function"!=typeof e));let i=e.changedRanges,o=Ne.extendWithRanges(i,function(e,t,n){let i=new rn;return r.RangeSet.compare(e,t,n,i,0),i.changes}(n,this.stateDeco,e?e.changes:r.ChangeSet.empty(this.state.doc.length))),s=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),this.heightMap.height!=s&&(e.flags|=2);let a=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let l=!e.changes.empty||2&e.flags||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),l&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection="rtl"==r.direction?t.Direction.RTL:t.Direction.LTR;let s=this.heightOracle.mustRefreshForWrapping(o),a=s||this.mustMeasureContent||this.contentDOMHeight!=n.clientHeight;this.contentDOMHeight=n.clientHeight,this.mustMeasureContent=!1;let l=0,c=0,h=parseInt(r.paddingTop)||0,u=parseInt(r.paddingBottom)||0;this.paddingTop==h&&this.paddingBottom==u||(this.paddingTop=h,this.paddingBottom=u,l|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,l|=8);let f=(this.printing?sn:on)(n,this.paddingTop),d=f.top-this.pixelViewport.top,p=f.bottom-this.pixelViewport.bottom;this.pixelViewport=f;let m=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(m!=this.inView&&(this.inView=m,m&&(a=!0)),!this.inView)return 0;let g=n.clientWidth;if(this.contentDOMWidth==g&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=g,this.editorHeight=e.scrollDOM.clientHeight,l|=8),a){let t=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(t)&&(s=!0),s||i.lineWrapping&&Math.abs(g-this.contentDOMWidth)>i.charWidth){let{lineHeight:n,charWidth:r}=e.docView.measureTextSize();s=i.refresh(o,n,r,g/r,t),s&&(e.docView.minWidth=0,l|=8)}d>0&&p>0?c=Math.max(d,p):d<0&&p<0&&(c=Math.min(d,p)),i.heightChanged=!1;for(let n of this.viewports){let r=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=this.heightMap.updateHeight(i,0,s,new Ut(n.from,r))}i.heightChanged&&(l|=2)}let v=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return v&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(2&l||v)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps)),l|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),l}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.state.doc,{visibleTop:o,visibleBottom:s}=this,a=new hn(r.lineAt(o-1e3*n,Kt.ByHeight,i,0,0).from,r.lineAt(s+1e3*(1-n),Kt.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(ea.to){let n,o=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),s=r.lineAt(e,Kt.ByPos,i,0,0);n="center"==t.y?(s.top+s.bottom)/2-o/2:"start"==t.y||"nearest"==t.y&&e=s+Math.max(10,Math.min(n,250)))&&r>o-2e3&&it.from&&s.push({from:t.from,to:r}),i=t.from&&a.from<=t.to&&pn(s,a.from-10,a.from+10),!a.empty&&a.to>=t.from&&a.to<=t.to&&pn(s,a.to-10,a.to+10);for(let{from:r,to:i}of s)i-r>1e3&&n.push(mn(e,(e=>e.from>=t.from&&e.to<=t.to&&Math.abs(e.from-r)<1e3&&Math.abs(e.to-i)<1e3))||new an(r,i,this.gapSize(t,r,i,o)))}return n}gapSize(e,t,n,r){let i=dn(r,n)-dn(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){an.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=oe.set(e.map((e=>e.draw(this.heightOracle.lineWrapping)))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];r.RangeSet.spans(e,this.viewport.from,this.viewport.to,{span(e,n){t.push({from:e,to:n})},point(){}},20);let n=t.length!=this.visibleRanges.length||this.visibleRanges.some(((e,n)=>e.from!=t[n].from||e.to!=t[n].to));return this.visibleRanges=t,n?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find((t=>t.from<=e&&t.to>=e))||yn(this.heightMap.lineAt(e,Kt.ByPos,this.state.doc,0,0),this.scaler)}lineBlockAtHeight(e){return yn(this.heightMap.lineAt(this.scaler.fromDOM(e),Kt.ByHeight,this.state.doc,0,0),this.scaler)}elementAtHeight(e){return yn(this.heightMap.blockAt(this.scaler.fromDOM(e),this.state.doc,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class hn{constructor(e,t){this.from=e,this.to=t}}function un(e,t,n){let i=[],o=e,s=0;return r.RangeSet.spans(n,e,t,{span(){},point(e,t){e>o&&(i.push({from:o,to:e}),s+=e-o),o=t}},20),o=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],o=i-n;if(r<=o)return n+r;r-=o}}function dn(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function pn(e,t,n){for(let r=0;rt){let o=[];i.fromn&&o.push({from:n,to:i.to}),e.splice(r,1,...o),r+=o.length-1}}}function mn(e,t){for(let n of e)if(t(n))return n}const gn={toDOM:e=>e,fromDOM:e=>e,scale:1};class vn{constructor(e,t,n){let r=0,i=0,o=0;this.viewports=n.map((({from:n,to:i})=>{let o=t.lineAt(n,Kt.ByPos,e,0,0).top,s=t.lineAt(i,Kt.ByPos,e,0,0).bottom;return r+=s-o,{from:n,to:i,top:o,bottom:s,domTop:0,domBottom:0}})),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=o+(e.top-i)*this.scale,o=e.domBottom=e.domTop+(e.bottom-e.top),i=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=tyn(e,t))):e.type)}const bn=r.Facet.define({combine:e=>e.join(" ")}),wn=r.Facet.define({combine:e=>e.indexOf(!0)>-1}),xn=i.StyleModule.newName(),kn=i.StyleModule.newName(),Sn=i.StyleModule.newName(),An={"&light":"."+kn,"&dark":"."+Sn};function Cn(e,t,n){return new i.StyleModule(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,(t=>{if("&"==t)return e;if(!n||!n[t])throw new RangeError(`Unsupported selector: ${t}`);return n[t]})):e+" "+t})}const On=Cn("."+xn,{"&.cm-editor":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,minHeight:"100%",display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 4px"},".cm-selectionLayer":{zIndex:-1,contain:"size style"},".cm-selectionBackground":{position:"absolute"},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{zIndex:100,contain:"size style",pointerEvents:"none"},"&.cm-focused .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#f3f9ff"},"&dark .cm-activeLine":{backgroundColor:"#223039"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",left:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},An),En={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},jn=q.ie&&q.ie_version<=11;class Mn{constructor(e,t,n){this.view=e,this.onChange=t,this.onScrollChanged=n,this.active=!1,this.selectionRange=new v,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.scrollTargets=[],this.intersection=null,this.resize=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver((t=>{for(let e of t)this.queue.push(e);(q.ie&&q.ie_version<=11||q.ios&&e.composing)&&t.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),jn&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),window.addEventListener("resize",this.onResize=this.onResize.bind(this)),"function"==typeof ResizeObserver&&(this.resize=new ResizeObserver((()=>{this.view.docView.lastUpdate{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))}),{}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange(),this.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=-1,this.view.requestMeasure()}),50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout((()=>{this.view.viewState.printing=!1,this.view.requestMeasure()}),500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some(((t,n)=>t!=e[n])))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:t}=this,n=this.selectionRange;if(t.state.facet(Oe)?t.root.activeElement!=this.dom:!l(t.dom,n))return;let r=n.anchorNode&&t.docView.nearest(n.anchorNode);r&&r.ignoreEvent(e)||((q.ie&&q.ie_version<=11||q.android&&q.chrome)&&!t.state.selection.main.empty&&n.focusNode&&h(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1))}readSelectionRange(){let{view:e}=this,t=q.safari&&11==e.root.nodeType&&function(){let e=document.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}()==this.dom&&function(e){let t=null;function n(e){e.preventDefault(),e.stopImmediatePropagation(),t=e.getTargetRanges()[0]}if(e.contentDOM.addEventListener("beforeinput",n,!0),document.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",n,!0),!t)return null;let r=t.startContainer,i=t.startOffset,o=t.endContainer,s=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor);return h(a.node,a.offset,o,s)&&([r,i,o,s]=[o,s,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}}(this.view)||s(e.root);if(!t||this.selectionRange.eq(t))return!1;let n=l(this.dom,t);return n&&!this.selectionChanged&&this.selectionRange.focusNode&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let e=this.delayedAndroidKey;this.delayedAndroidKey=null,this.delayedFlush=-1,this.flush()||k(this.dom,e.key,e.keyCode)})),this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t})}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=window.setTimeout((()=>{this.delayedFlush=-1,this.flush()}),20))}forceFlush(){this.delayedFlush>=0&&(window.clearTimeout(this.delayedFlush),this.delayedFlush=-1),this.flush()}processRecords(){let e=this.queue;for(let t of this.observer.takeRecords())e.push(t);e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),-1==t?({from:t,to:n}=e):(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return;e&&this.readSelectionRange();let{from:t,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&l(this.dom,this.selectionRange);if(t<0&&!i)return;this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=this.view.state,s=this.onChange(t,n,r);return this.view.state==o&&this.view.update([]),s}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.dirty|=4),"childList"==e.type){let n=In(t,e.previousSibling||e.target.previousSibling,-1),r=In(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}destroy(){var e,t,n;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resize)||void 0===n||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);window.removeEventListener("scroll",this.onScroll),window.removeEventListener("resize",this.onResize),window.removeEventListener("beforeprint",this.onPrint),this.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout)}}function In(e,t,n){for(;t;){let r=O.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}class Tn{constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: absolute; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=e.dispatch||(e=>this.update([e])),this.dispatch=this.dispatch.bind(this),this.root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new cn(e.state||r.EditorState.create(e)),this.plugins=this.state.facet(je).map((e=>new Ie(e)));for(let e of this.plugins)e.update(this);this.observer=new Mn(this,((e,t,n)=>function(e,t,n,i){let o,s,l=e.state.selection.main;if(t>-1){let i=e.docView.domBoundsAround(t,n,0);if(!i||e.state.readOnly)return!1;let{from:a,to:c}=i,h=e.docView.impreciseHead||e.docView.impreciseAnchor?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=e.observer.selectionRange;return n&&(t.push(new rt(n,r)),i==n&&o==r||t.push(new rt(i,o))),t}(e),u=new tt(h,e.state);u.readRange(i.startDOM,i.endDOM);let f=l.from,d=null;(8===e.inputState.lastKeyCode&&e.inputState.lastKeyTime>Date.now()-100||q.android&&u.text.length0&&a>0&&e.charCodeAt(s-1)==t.charCodeAt(a-1);)s--,a--;return"end"==r&&(n-=s+Math.max(0,o-Math.min(s,a))-o),s=s?o-n:0,a=o+(a-s),s=o):a=a?o-n:0,s=o+(s-a),a=o),{from:o,toA:s,toB:a}}(e.state.doc.sliceString(a,c,et),u.text,f-a,d);p&&(q.chrome&&13==e.inputState.lastKeyCode&&p.toB==p.from+2&&u.text.slice(p.from,p.toB)==et+et&&p.toB--,o={from:a+p.from,to:a+p.toA,insert:r.Text.of(u.text.slice(p.from,p.toB).split(et))}),s=function(e,t){if(0==e.length)return null;let n=e[0].pos,i=2==e.length?e[1].pos:n;return n>-1&&i>-1?r.EditorSelection.single(n+t,i+t):null}(h,a)}else if(e.hasFocus||!e.state.facet(Oe)){let t=e.observer.selectionRange,{impreciseHead:n,impreciseAnchor:i}=e.docView,o=n&&n.node==t.focusNode&&n.offset==t.focusOffset||!a(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),c=i&&i.node==t.anchorNode&&i.offset==t.anchorOffset||!a(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset);o==l.head&&c==l.anchor||(s=r.EditorSelection.single(c,o))}if(!o&&!s)return!1;if(!o&&i&&!l.empty&&s&&s.main.empty?o={from:l.from,to:l.to,insert:e.state.doc.slice(l.from,l.to)}:o&&o.from>=l.from&&o.to<=l.to&&(o.from!=l.from||o.to!=l.to)&&l.to-l.from-(o.to-o.from)<=4?o={from:l.from,to:l.to,insert:e.state.doc.slice(l.from,o.from).append(o.insert).append(e.state.doc.slice(o.to,l.to))}:(q.mac||q.android)&&o&&o.from==o.to&&o.from==l.head-1&&"."==o.insert.toString()&&(o={from:l.from,to:l.to,insert:r.Text.of([" "])}),o){let t=e.state;if(q.ios&&e.inputState.flushIOSKey(e))return!0;if(q.android&&(o.from==l.from&&o.to==l.to&&1==o.insert.length&&2==o.insert.lines&&k(e.contentDOM,"Enter",13)||o.from==l.from-1&&o.to==l.to&&0==o.insert.length&&k(e.contentDOM,"Backspace",8)||o.from==l.from&&o.to==l.to+1&&0==o.insert.length&&k(e.contentDOM,"Delete",46)))return!0;let n,i=o.insert.toString();if(e.state.facet(xe).some((t=>t(e,o.from,o.to,i))))return!0;if(e.inputState.composing>=0&&e.inputState.composing++,o.from>=l.from&&o.to<=l.to&&o.to-o.from>=(l.to-l.from)/3&&(!s||s.main.empty&&s.main.from==o.from+o.insert.length)&&e.inputState.composing<0){let r=l.fromo.to?t.sliceDoc(o.to,l.to):"";n=t.replaceSelection(e.state.toText(r+o.insert.sliceString(0,void 0,e.state.lineBreak)+i))}else{let i=t.changes(o),a=s&&!t.selection.main.eq(s.main)&&s.main.to<=i.newLength?s.main:void 0;if(t.selection.ranges.length>1&&e.inputState.composing>=0&&o.to<=l.to&&o.to>=l.to-10){let s=e.state.sliceDoc(o.from,o.to),c=st(e)||e.state.doc.lineAt(l.head),h=l.to-o.to,u=l.to-l.from;n=t.changeByRange((n=>{if(n.from==l.from&&n.to==l.to)return{changes:i,range:a||n.map(i)};let f=n.to-h,d=f-s.length;if(n.to-n.from!=u||e.state.sliceDoc(d,f)!=s||c&&n.to>=c.from&&n.from<=c.to)return{range:n};let p=t.changes({from:d,to:f,insert:o.insert}),m=n.to-l.to;return{changes:p,range:a?r.EditorSelection.range(Math.max(0,a.anchor+m),Math.max(0,a.head+m)):n.map(p)}}))}else n={changes:i,selection:a&&t.selection.replaceRange(a)}}let a="input.type";return e.composing&&(a+=".compose",e.inputState.compositionFirstChange&&(a+=".start",e.inputState.compositionFirstChange=!1)),e.dispatch(n,{scrollIntoView:!0,userEvent:a}),!0}if(s&&!s.main.eq(l)){let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),n=e.inputState.lastSelectionOrigin),e.dispatch({selection:s,scrollIntoView:t,userEvent:n}),!0}return!1}(this,e,t,n)),(e=>{this.inputState.runScrollHandlers(this,e),this.observer.intersecting&&this.measure()})),this.inputState=new xt(this),this.inputState.ensureHandlers(this,this.plugins),this.docView=new it(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}dispatch(...e){this._dispatch(1==e.length&&e[0]instanceof r.Transaction?e[0]:this.state.update(...e))}update(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t,n=!1,i=!1,o=this.state;for(let t of e){if(t.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=t.state}if(this.destroyed)return void(this.viewState.state=o);if(this.observer.clear(),o.facet(r.EditorState.phrases)!=this.state.facet(r.EditorState.phrases))return this.setState(o);t=Be.create(this,o,e);let s=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(s&&(s=s.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;s=new Se(e.empty?e:r.EditorSelection.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(Ae)&&(s=e.value)}this.viewState.update(t,s),this.bidiCache=Pn.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),n=this.docView.update(t),this.state.facet(Re)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some((e=>e.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(t.startState.facet(bn)!=t.state.facet(bn)&&(this.viewState.mustMeasureContent=!0),(n||i||s||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!t.empty)for(let e of this.state.facet(we))e(t)}setState(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=e);this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new cn(e),this.plugins=e.facet(je).map((e=>new Ie(e))),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView=new it(this),this.inputState.ensureHandlers(this,this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(je),n=e.state.facet(je);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new Ie(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear(),this.inputState.ensureHandlers(this,this.plugins)}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,{scrollHeight:n,scrollTop:r,clientHeight:i}=this.scrollDOM,o=r>n-i-4?n:r;try{for(let e=0;;e++){this.updateState=1;let n=this.viewport,r=this.viewState.lineBlockAtHeight(o),i=this.viewState.measure(this);if(!i&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let s=[];4&i||([this.measureRequests,s]=[s,this.measureRequests]);let a=s.map((e=>{try{return e.read(this)}catch(e){return Ce(this.state,e),_n}})),l=Be.create(this,this.state,[]),c=!1,h=!1;l.flags|=i,t?t.flags|=i:t=l,this.updateState=2,l.empty||(this.updatePlugins(l),this.inputState.update(l),this.updateAttrs(),c=this.docView.update(l));for(let e=0;e1||e<-1)&&(this.scrollDOM.scrollTop+=e,h=!0)}if(c&&this.docView.updateSelection(!0),this.viewport.from==n.from&&this.viewport.to==n.to&&!h&&0==this.measureRequests.length)break}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(we))e(t)}get themeClasses(){return xn+" "+(this.state.facet(wn)?Sn:kn)+" "+this.state.facet(bn)}updateAttrs(){let e=Dn(this,Te,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Oe)?"true":"false",class:"cm-content",style:`${q.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Dn(this,$e,t);let n=this.observer.ignore((()=>{let n=re(this.contentDOM,this.contentAttrs,t),r=re(this.dom,this.editorAttrs,e);return n||r}));return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)e.is(Tn.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(Re),i.StyleModule.mount(this.root,this.styleModules.concat(On).reverse())}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=requestAnimationFrame((()=>this.measure()))),e){if(null!=e.key)for(let t=0;tt.spec==e))||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return wt(this,e,bt(this,e,t,n))}moveByGroup(e,t){return wt(this,e,bt(this,e,t,(t=>function(e,t,n){let i=e.state.charCategorizer(t),o=i(n);return e=>{let t=i(e);return o==r.CharCategory.Space&&(o=t),o==t}}(this,e.head,t))))}moveToLineBoundary(e,n,i=!0){return function(e,n,i,o){let s=e.state.doc.lineAt(n.head),a=o&&e.lineWrapping?e.coordsAtPos(n.assoc<0&&n.head>s.from?n.head-1:n.head):null;if(a){let n=e.dom.getBoundingClientRect(),o=e.textDirectionAt(s.from),l=e.posAtCoords({x:i==(o==t.Direction.LTR)?n.right-1:n.left+1,y:(a.top+a.bottom)/2});if(null!=l)return r.EditorSelection.cursor(l,i?-1:1)}let l=ue.find(e.docView,n.head),c=l?i?l.posAtEnd:l.posAtStart:i?s.to:s.from;return r.EditorSelection.cursor(c,i?-1:1)}(this,e,n,i)}moveVertically(e,t,n){return wt(this,e,function(e,t,n,i){let o=t.head,s=n?1:-1;if(o==(n?e.state.doc.length:0))return r.EditorSelection.cursor(o,t.assoc);let a,l=t.goalColumn,c=e.contentDOM.getBoundingClientRect(),h=e.coordsAtPos(o),u=e.documentTop;if(h)null==l&&(l=h.left-c.left),a=s<0?h.top:h.bottom;else{let t=e.viewState.lineBlockAt(o);null==l&&(l=Math.min(c.right-c.left,e.defaultCharacterWidth*(o-t.from))),a=(s<0?t.top:t.bottom)+u}let f=c.left+l,d=null!=i?i:e.defaultLineHeight>>1;for(let n=0;;n+=10){let i=a+(d+n)*s,h=vt(e,{x:f,y:i},!1,s);if(ic.bottom||(s<0?ho))return r.EditorSelection.cursor(h,t.assoc,void 0,l)}}(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),vt(this,e,t)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),o=this.bidiSpans(i);return m(r,o[Ke.find(o,e-i.from,-1,n)].dir==t.Direction.LTR==n>0)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(ke)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>$n)return Ze(e.length);let t=this.textDirectionAt(e.from);for(let n of this.bidiCache)if(n.from==e.from&&n.dir==t)return n.order;let n=Qe(e.text,t);return this.bidiCache.push(new Pn(e.from,e.to,t,n)),n}get hasFocus(){var e;return(document.hasFocus()||q.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{w(this.contentDOM),this.docView.updateSelection()}))}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Ae.of(new Se("number"==typeof e?r.EditorSelection.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return Me.define((()=>({})),{eventHandlers:e})}static theme(e,t){let n=i.StyleModule.newName(),r=[bn.of(n),Re.of(Cn(`.${n}`,e))];return t&&t.dark&&r.push(wn.of(!0)),r}static baseTheme(e){return r.Prec.lowest(Re.of(Cn("."+xn,e,An)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&O.get(n)||O.get(e);return(null===(t=null==r?void 0:r.rootView)||void 0===t?void 0:t.view)||null}}Tn.styleModule=Re,Tn.inputHandler=xe,Tn.perLineTextDirection=ke,Tn.exceptionSink=be,Tn.updateListener=we,Tn.editable=Oe,Tn.mouseSelectionStyle=ye,Tn.dragMovesSelection=ve,Tn.clickAddsSelectionRange=ge,Tn.decorations=_e,Tn.atomicRanges=Pe,Tn.scrollMargins=De,Tn.darkTheme=wn,Tn.contentAttributes=$e,Tn.editorAttributes=Te,Tn.lineWrapping=Tn.contentAttributes.of({class:"cm-lineWrapping"}),Tn.announce=r.StateEffect.define();const $n=4096,_n={};class Pn{constructor(e,t,n,r){this.from=e,this.to=t,this.dir=n,this.order=r}static update(e,n){if(n.empty)return e;let r=[],i=e.length?e[e.length-1].dir:t.Direction.LTR;for(let t=Math.max(0,e.length-10);t=0;i--){let t=r[i],o="function"==typeof t?t(e):t;o&&te(o,n)}return n}const Rn=q.mac?"mac":q.windows?"win":q.linux?"linux":"key";function Nn(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}const Bn=r.Prec.default(Tn.domEventHandlers({keydown:(e,t)=>Hn(Vn(t.state),e,t,"editor")})),Ln=r.Facet.define({enables:Bn}),Fn=new WeakMap;function Vn(e){let t=e.facet(Ln),n=Fn.get(t);return n||Fn.set(t,n=function(e,t=Rn){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(null==n)r[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},o=(e,r,o,s)=>{let a=n[e]||(n[e]=Object.create(null)),l=r.split(/ (?!$)/).map((e=>function(e,t){const n=e.split(/-(?!$)/);let r,i,o,s,a=n[n.length-1];"Space"==a&&(a=" ");for(let e=0;e{let r=zn={view:t,prefix:n,scope:e};return setTimeout((()=>{zn==r&&(zn=null)}),qn),!0}]})}let c=l.join(" ");i(c,!1);let h=a[c]||(a[c]={preventDefault:!1,commands:[]});h.commands.push(o),s&&(h.preventDefault=!0)};for(let n of e){let e=n[t]||n.key;if(e)for(let t of n.scope?n.scope.split(" "):["editor"])o(t,e,n.run,n.preventDefault),n.shift&&o(t,"Shift-"+e,n.shift,n.preventDefault)}return n}(t.reduce(((e,t)=>e.concat(t)),[]))),n}let zn=null;const qn=4e3;function Hn(e,t,n,i){let s=o.keyName(t),a=r.codePointAt(s,0),l=r.codePointSize(a)==s.length&&" "!=s,c="",h=!1;zn&&zn.view==n&&zn.scope==i&&(c=zn.prefix+" ",(h=St.indexOf(t.keyCode)<0)&&(zn=null));let u,f=e=>{if(e){for(let t of e.commands)if(t(n))return!0;e.preventDefault&&(h=!0)}return!1},d=e[i];if(d){if(f(d[c+Nn(s,t,!l)]))return!0;if(l&&(t.shiftKey||t.altKey||t.metaKey||a>127)&&(u=o.base[t.keyCode])&&u!=s){if(f(d[c+Nn(u,t,!0)]))return!0;if(t.shiftKey&&o.shift[t.keyCode]!=u&&f(d[c+Nn(o.shift[t.keyCode],t,!1)]))return!0}else if(l&&t.shiftKey&&f(d[c+Nn(s,t,!0)]))return!0}return h}const Wn=!q.ios,Un=r.Facet.define({combine:e=>r.combineConfig(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});class Jn{constructor(e,t,n,r,i){this.left=e,this.top=t,this.width=n,this.height=r,this.className=i}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width>=0&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}}const Kn=Me.fromClass(class{constructor(e){this.view=e,this.rangePieces=[],this.cursors=[],this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.selectionLayer=e.scrollDOM.appendChild(document.createElement("div")),this.selectionLayer.className="cm-selectionLayer",this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=e.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),e.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){this.cursorLayer.style.animationDuration=this.view.state.facet(Un).cursorBlinkRate+"ms"}update(e){let t=e.startState.facet(Un)!=e.state.facet(Un);(t||e.selectionSet||e.geometryChanged||e.viewportChanged)&&this.view.requestMeasure(this.measureReq),e.transactions.some((e=>e.scrollIntoView))&&(this.cursorLayer.style.animationName="cm-blink"==this.cursorLayer.style.animationName?"cm-blink2":"cm-blink"),t&&this.setBlinkRate()}readPos(){let{state:e}=this.view,n=e.facet(Un),r=e.selection.ranges.map((e=>e.empty?[]:function(e,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),o=e.textDirection==t.Direction.LTR,s=e.contentDOM,a=s.getBoundingClientRect(),l=Zn(e),c=window.getComputedStyle(s.firstChild),h=a.left+parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)),u=a.right-parseInt(c.paddingRight),f=Xn(e,r),d=Xn(e,i),p=f.type==t.BlockType.Text?f:null,m=d.type==t.BlockType.Text?d:null;if(e.lineWrapping&&(p&&(p=Yn(e,r,p)),m&&(m=Yn(e,i,m))),p&&m&&p.from==m.from)return v(y(n.from,n.to,p));{let r=p?y(n.from,null,p):b(f,!1),i=m?y(null,n.to,m):b(d,!0),o=[];return(p||f).to<(m||d).from-1?o.push(g(h,r.bottom,u,i.top)):r.bottomf&&t.from=o)break;a>i&&c(Math.max(e,i),null==n&&e<=f,Math.min(a,o),null==r&&a>=d,s.dir)}if(i=t.to+1,i>=o)break}return 0==l.length&&c(f,null==n,d,null==r,e.textDirection),{top:s,bottom:a,horizontal:l}}function b(e,t){let n=a.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(this.view,e))).reduce(((e,t)=>e.concat(t))),i=[];for(let t of e.selection.ranges){let r=t==e.selection.main;if(t.empty?!r||Wn:n.drawRangeCursor){let e=er(this.view,t,r);e&&i.push(e)}}return{rangePieces:r,cursors:i}}drawSel({rangePieces:e,cursors:t}){if(e.length!=this.rangePieces.length||e.some(((e,t)=>!e.eq(this.rangePieces[t])))){this.selectionLayer.textContent="";for(let t of e)this.selectionLayer.appendChild(t.draw());this.rangePieces=e}if(t.length!=this.cursors.length||t.some(((e,t)=>!e.eq(this.cursors[t])))){let e=this.cursorLayer.children;if(e.length!==t.length){this.cursorLayer.textContent="";for(const e of t)this.cursorLayer.appendChild(e.draw())}else t.forEach(((t,n)=>t.adjust(e[n])));this.cursors=t}}destroy(){this.selectionLayer.remove(),this.cursorLayer.remove()}}),Gn={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Wn&&(Gn[".cm-line"].caretColor="transparent !important");const Qn=r.Prec.highest(Tn.theme(Gn));function Zn(e){let n=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==t.Direction.LTR?n.left:n.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft,top:n.top-e.scrollDOM.scrollTop}}function Yn(e,n,i){let o=r.EditorSelection.cursor(n);return{from:Math.max(i.from,e.moveToLineBoundary(o,!1,!0).from),to:Math.min(i.to,e.moveToLineBoundary(o,!0,!0).from),type:t.BlockType.Text}}function Xn(e,n){let r=e.lineBlockAt(n);if(Array.isArray(r.type))for(let e of r.type)if(e.to>n||e.to==n&&(e.to==r.to||e.type==t.BlockType.Text))return e;return r}function er(e,t,n){let r=e.coordsAtPos(t.head,t.assoc||1);if(!r)return null;let i=Zn(e);return new Jn(r.left-i.left,r.top-i.top,-1,r.bottom-r.top,n?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary")}const tr=r.StateEffect.define({map:(e,t)=>null==e?null:t.mapPos(e)}),nr=r.StateField.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce(((e,t)=>t.is(tr)?t.value:e),e))}),rr=Me.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(nr);null==n?null!=this.cursor&&(null===(t=this.cursor)||void 0===t||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(nr)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let e=this.view.state.field(nr),t=null!=e&&this.view.coordsAtPos(e);if(!t)return null;let n=this.view.scrollDOM.getBoundingClientRect();return{left:t.left-n.left+this.view.scrollDOM.scrollLeft,top:t.top-n.top+this.view.scrollDOM.scrollTop,height:t.bottom-t.top}}drawCursor(e){this.cursor&&(e?(this.cursor.style.left=e.left+"px",this.cursor.style.top=e.top+"px",this.cursor.style.height=e.height+"px"):this.cursor.style.left="-100000px")}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(nr)!=e&&this.view.dispatch({effects:tr.of(e)})}},{eventHandlers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function ir(e,t,n,r,i){t.lastIndex=0;for(let o,s=e.iterRange(n,r),a=n;!s.next().done;a+=s.value.length)if(!s.lineBreak)for(;o=t.exec(s.value);)i(a+o.index,o)}class or{constructor(e){const{regexp:t,decoration:n,decorate:r,boundary:i,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(e,t,n,i)=>r(i,n,n+e[0].length,e,t);else{if(!n)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");{let e="function"==typeof n?n:()=>n;this.addMatch=(t,n,r,i)=>i(r,r+t[0].length,e(t,n,r))}}this.boundary=i,this.maxLength=o}createDeco(e){let t=new r.RangeSetBuilder,n=t.add.bind(t);for(let{from:t,to:r}of function(e,t){let n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),o=Math.min(e.state.doc.lineAt(o).to,o+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}(e,this.maxLength))ir(e.state.doc,this.regexp,t,r,((t,r)=>this.addMatch(r,e,t,n)));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges(((t,i,o,s)=>{s>e.view.viewport.from&&o1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let i of e.visibleRanges){let o=Math.max(i.from,n),s=Math.min(i.to,r);if(s>o){let n=e.state.doc.lineAt(o),r=n.ton.from;o--)if(this.boundary.test(n.text[o-1-n.from])){a=o;break}for(;sh.push(n.range(e,t));if(n==r)for(this.regexp.lastIndex=a-n.from;(c=this.regexp.exec(n.text))&&c.indexthis.addMatch(n,e,t,u)));t=t.update({filterFrom:a,filterTo:l,filter:(e,t)=>el,add:h})}}return t}}const sr=null!=/x/.unicode?"gu":"g",ar=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",sr),lr={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let cr=null;const hr=r.Facet.define({combine(e){let t=r.combineConfig(e,{render:null,specialChars:ar,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==cr&&"undefined"!=typeof document&&document.body){let t=document.body.style;cr=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return cr||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,sr)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,sr)),t}});let ur=null;class fr extends ie{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=(n=this.code)>=32?"•":10==n?"␤":String.fromCharCode(9216+n);var n;let r=e.state.phrase("Control character")+" "+(lr[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,t);if(i)return i;let o=document.createElement("span");return o.textContent=t,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class dr extends ie{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}const pr=Me.fromClass(class{constructor(){this.height=1e3,this.attrs={style:"padding-bottom: 1000px"}}update(e){let t=e.view.viewState.editorHeight-e.view.defaultLineHeight;t!=this.height&&(this.height=t,this.attrs={style:`padding-bottom: ${t}px`})}}),mr=oe.line({class:"cm-activeLine"}),gr=Me.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){if(!r.empty)return oe.none;let i=e.lineBlockAt(r.head);i.from>t&&(n.push(mr.range(i.from)),t=i.from)}return oe.set(n)}},{decorations:e=>e.decorations});class vr extends ie{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild("string"==typeof this.content?document.createTextNode(this.content):this.content),"string"==typeof this.content?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}ignoreEvent(){return!1}}const yr=2e3;function br(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),i=e.state.doc.lineAt(n),o=n-i.from,s=o>yr?-1:o==i.length?function(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):r.countColumn(i.text,e.state.tabSize,n-i.from);return{line:i.number,col:s,off:o}}const wr={Alt:[18,e=>e.altKey],Control:[17,e=>e.ctrlKey],Shift:[16,e=>e.shiftKey],Meta:[91,e=>e.metaKey]},xr={style:"cursor: crosshair"},kr="-10000px";class Sr{constructor(e,t,n){this.facet=t,this.createTooltipView=n,this.input=e.state.facet(t),this.tooltips=this.input.filter((e=>e)),this.tooltipViews=this.tooltips.map(n)}update(e){let t=e.state.facet(this.facet),n=t.filter((e=>e));if(t===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let r=[];for(let t=0;t{var t,n,r;return{position:q.ios?"absolute":(null===(t=e.find((e=>e.position)))||void 0===t?void 0:t.position)||"fixed",parent:(null===(n=e.find((e=>e.parent)))||void 0===n?void 0:n.parent)||null,tooltipSpace:(null===(r=e.find((e=>e.tooltipSpace)))||void 0===r?void 0:r.tooltipSpace)||Ar}}}),Or=Me.fromClass(class{constructor(e){var t;this.view=e,this.inView=!0,this.lastTransaction=0,this.measureTimeout=-1;let n=e.state.facet(Cr);this.position=n.position,this.parent=n.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new Sr(e,Mr,(e=>this.createTooltip(e))),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver((e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),null===(t=e.dom.ownerDocument.defaultView)||void 0===t||t.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1,this.maybeMeasure()}),50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(Cr);if(r.position!=this.position){this.position=r.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e){let t=e.create(this.view);if(t.dom.classList.add("cm-tooltip"),e.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",t.dom.appendChild(e)}return t.dom.style.position=this.position,t.dom.style.top=kr,this.container.appendChild(t.dom),t.mount&&t.mount(this.view),t}destroy(){var e,t;null===(e=this.view.dom.ownerDocument.defaultView)||void 0===e||e.removeEventListener("resize",this.measureSoon);for(let{dom:e}of this.manager.tooltipViews)e.remove();null===(t=this.intersectionObserver)||void 0===t||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=this.view.dom.getBoundingClientRect();return{editor:e,parent:this.parent?this.container.getBoundingClientRect():e,pos:this.manager.tooltips.map(((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)})),size:this.manager.tooltipViews.map((({dom:e})=>e.getBoundingClientRect())),space:this.view.state.facet(Cr).tooltipSpace(this.view)}}writeMeasure(e){let{editor:n,space:r}=e,i=[];for(let o=0;o=Math.min(n.bottom,r.bottom)||c.rightMath.min(n.right,r.right)+.1){l.style.top=kr;continue}let u=s.arrow?a.dom.querySelector(".cm-tooltip-arrow"):null,f=u?7:0,d=h.right-h.left,p=h.bottom-h.top,m=a.offset||jr,g=this.view.textDirection==t.Direction.LTR,v=h.width>r.right-r.left?g?r.left:r.right-h.width:g?Math.min(c.left-(u?14:0)+m.x,r.right-d):Math.max(r.left,c.left-d+(u?14:0)-m.x),y=!!s.above;!s.strictSide&&(y?c.top-(h.bottom-h.top)-m.yr.bottom)&&y==r.bottom-c.bottom>c.top-r.top&&(y=!y);let b=y?c.top-p-f-m.y:c.bottom+f+m.y,w=v+d;if(!0!==a.overlap)for(let e of i)e.leftv&&e.topb&&(b=y?e.top-p-2-f:e.bottom+f+2);"absolute"==this.position?(l.style.top=b-e.parent.top+"px",l.style.left=v-e.parent.left+"px"):(l.style.top=b+"px",l.style.left=v+"px"),u&&(u.style.left=c.left+(g?m.x:-m.x)-(v+14-7)+"px"),!0!==a.overlap&&i.push({left:v,top:b,right:w,bottom:b+p}),l.classList.toggle("cm-tooltip-above",y),l.classList.toggle("cm-tooltip-below",!y),a.positioned&&a.positioned()}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=kr}},{eventHandlers:{scroll(){this.maybeMeasure()}}}),Er=Tn.baseTheme({".cm-tooltip":{zIndex:100},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),jr={x:0,y:0},Mr=r.Facet.define({enables:[Or,Er]}),Ir=r.Facet.define();class Tr{constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Sr(e,Ir,(e=>this.createHostedView(e)))}static create(e){return new Tr(e)}createHostedView(e){let t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(t.dom),this.mounted&&t.mount&&t.mount(this.view),t}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(){for(let e of this.manager.tooltipViews)e.positioned&&e.positioned()}update(e){this.manager.update(e)}}const $r=Mr.compute([Ir],(e=>{let t=e.facet(Ir).filter((e=>e));return 0===t.length?null:{pos:Math.min(...t.map((e=>e.pos))),end:Math.max(...t.filter((e=>null!=e.end)).map((e=>e.end))),create:Tr.create,above:t[0].above,arrow:t.some((e=>e.arrow))}}));class _r{constructor(e,t,n,r,i){this.view=e,this.source=t,this.field=n,this.setHover=r,this.hoverTime=i,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout((()=>this.startHover()),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active)return;let e=Date.now()-this.lastMove.time;er.bottom||e.xr.right+this.view.defaultCharacterWidth)return;let i=this.view.bidiSpans(this.view.state.doc.lineAt(n)).find((e=>e.from<=n&&e.to>=n)),o=i&&i.dir==t.Direction.RTL?-1:1,s=this.source(this.view,n,e.x{this.pending==e&&(this.pending=null,t&&this.view.dispatch({effects:this.setHover.of(t)}))}),(e=>Ce(this.view.state,e,"hover tooltip")))}else s&&this.view.dispatch({effects:this.setHover.of(s)})}mousemove(e){var t;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let n=this.active;if(n&&!function(e){for(let t=e;t;t=t.parentNode)if(1==t.nodeType&&t.classList.contains("cm-tooltip"))return!0;return!1}(this.lastMove.target)||this.pending){let{pos:r}=n||this.pending,i=null!==(t=null==n?void 0:n.end)&&void 0!==t?t:r;(r==i?this.view.posAtCoords(this.lastMove)==r:function(e,t,n,r,i,o){let s=document.createRange(),a=e.domAtPos(t),l=e.domAtPos(n);s.setEnd(l.node,l.offset),s.setStart(a.node,a.offset);let c=s.getClientRects();s.detach();for(let e=0;ee)),this.panels=this.specs.map((t=>t(e)));let t=e.state.facet(Rr);this.top=new Br(e,!0,t.topContainer),this.bottom=new Br(e,!1,t.bottomContainer),this.top.sync(this.panels.filter((e=>e.top))),this.bottom.sync(this.panels.filter((e=>!e.top)));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(e){let t=e.state.facet(Rr);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Br(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Br(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(Fr);if(n!=this.input){let t=n.filter((e=>e)),r=[],i=[],o=[],s=[];for(let n of t){let t,a=this.specs.indexOf(n);a<0?(t=n(e.view),s.push(t)):(t=this.panels[a],t.update&&t.update(e)),r.push(t),(t.top?i:o).push(t)}this.specs=t,this.panels=r,this.top.sync(i),this.bottom.sync(o);for(let e of s)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Tn.scrollMargins.of((t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}}))});class Br{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Lr(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Lr(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Lr(e){let t=e.nextSibling;return e.remove(),t}const Fr=r.Facet.define({enables:Nr});class Vr extends r.RangeValue{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Vr.prototype.elementClass="",Vr.prototype.toDOM=void 0,Vr.prototype.mapMode=r.MapMode.TrackBefore,Vr.prototype.startSide=Vr.prototype.endSide=-1,Vr.prototype.point=!0;const zr=r.Facet.define(),qr={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>r.RangeSet.empty,lineMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},Hr=r.Facet.define(),Wr=r.Facet.define({combine:e=>e.some((e=>e))});function Ur(e){let t=[Jr];return e&&!1===e.fixed&&t.push(Wr.of(!0)),t}const Jr=Me.fromClass(class{constructor(e){this.view=e,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight+"px",this.gutters=e.state.facet(Hr).map((t=>new Zr(e,t)));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!e.state.facet(Wr),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<.8*(n.to-n.from))}e.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(Wr)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=e.view.viewport}syncGutters(e){let n=this.dom.nextSibling;e&&this.dom.remove();let i=r.RangeSet.iter(this.view.state.facet(zr),this.view.viewport.from),o=[],s=this.gutters.map((e=>new Qr(e,this.view.viewport,-this.view.documentPadding.top)));for(let e of this.view.viewportLineBlocks){let n;if(Array.isArray(e.type)){for(let r of e.type)if(r.type==t.BlockType.Text){n=r;break}}else n=e.type==t.BlockType.Text?e:void 0;if(n){o.length&&(o=[]),Gr(i,o,e.from);for(let e of s)e.line(this.view,n,o)}}for(let e of s)e.finish();e&&this.view.scrollDOM.insertBefore(this.dom,n)}updateGutters(e){let t=e.startState.facet(Hr),n=e.state.facet(Hr),i=e.docChanged||e.heightChanged||e.viewportChanged||!r.RangeSet.eq(e.startState.facet(zr),e.state.facet(zr),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(i=!0);else{i=!0;let r=[];for(let i of n){let n=t.indexOf(i);n<0?r.push(new Zr(this.view,i)):(this.gutters[n].update(e),r.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),r.indexOf(e)<0&&e.destroy();for(let e of r)this.dom.appendChild(e.dom);this.gutters=r}return i}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove()}},{provide:e=>Tn.scrollMargins.of((n=>{let r=n.plugin(e);return r&&0!=r.gutters.length&&r.fixed?n.textDirection==t.Direction.LTR?{left:r.dom.offsetWidth}:{right:r.dom.offsetWidth}:null}))});function Kr(e){return Array.isArray(e)?e:[e]}function Gr(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class Qr{constructor(e,t,n){this.gutter=e,this.height=n,this.localMarkers=[],this.i=0,this.cursor=r.RangeSet.iter(e.markers,t.from)}line(e,t,n){this.localMarkers.length&&(this.localMarkers=[]),Gr(this.cursor,this.localMarkers,t.from);let r=n.length?this.localMarkers.concat(n):this.localMarkers,i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let o=this.gutter;if(0==r.length&&!o.config.renderEmptyElements)return;let s=t.top-this.height;if(this.i==o.elements.length){let n=new Yr(e,t.height,s,r);o.elements.push(n),o.dom.appendChild(n.dom)}else o.elements[this.i].update(e,t.height,s,r);this.height=t.bottom,this.i++}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Zr{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,(r=>{let i=e.lineBlockAtHeight(r.clientY-e.documentTop);t.domEventHandlers[n](e,i,r)&&r.preventDefault()}));this.markers=Kr(t.markers(e)),t.initialSpacer&&(this.spacer=new Yr(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Kr(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!r.RangeSet.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class Yr{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.dom.style.height=(this.height=t)+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),function(e,t){if(e.length!=t.length)return!1;for(let n=0;nr.combineConfig(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})});class ti extends Vr{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function ni(e,t){return e.state.facet(ei).formatNumber(t,e.state)}const ri=Hr.compute([ei],(e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(Xr),lineMarker:(e,t,n)=>n.some((e=>e.toDOM))?null:new ti(ni(e,e.state.doc.lineAt(t.from).number)),lineMarkerChange:e=>e.startState.facet(ei)!=e.state.facet(ei),initialSpacer:e=>new ti(ni(e,ii(e.state.doc.lines))),updateSpacer(e,t){let n=ni(t.view,ii(t.view.state.doc.lines));return n==e.number?e:new ti(n)},domEventHandlers:e.facet(ei).domEventHandlers})));function ii(e){let t=9;for(;t{let t=[],n=-1;for(let r of e.selection.ranges)if(r.empty){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(oi.range(i)))}return r.RangeSet.of(t)})),ai={HeightMap:Qt,HeightOracle:Wt,MeasuredHeights:Ut,QueryType:Kt,ChangedRange:Ne,computeOrder:Qe,moveVisually:Xe};t.BidiSpan=Ke,t.BlockInfo=Jt,t.Decoration=oe,t.EditorView=Tn,t.GutterMarker=Vr,t.MatchDecorator=or,t.ViewPlugin=Me,t.ViewUpdate=Be,t.WidgetType=ie,t.__test=ai,t.closeHoverTooltips=Dr,t.crosshairCursor=function(e={}){let[t,n]=wr[e.key||"Alt"],r=Me.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventHandlers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){e.keyCode!=t&&n(e)||this.set(!1)}}});return[r,Tn.contentAttributes.of((e=>{var t;return(null===(t=e.plugin(r))||void 0===t?void 0:t.isDown)?xr:null}))]},t.drawSelection=function(e={}){return[Un.of(e),Kn,Qn]},t.dropCursor=function(){return[nr,rr]},t.getPanel=function(e,t){let n=e.plugin(Nr),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null},t.getTooltip=function(e,t){let n=e.plugin(Or);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]},t.gutter=function(e){return[Ur(),Hr.of(Object.assign(Object.assign({},qr),e))]},t.gutterLineClass=zr,t.gutters=Ur,t.hasHoverTooltips=function(e){return e.facet(Ir).some((e=>e))},t.highlightActiveLine=function(){return gr},t.highlightActiveLineGutter=function(){return si},t.highlightSpecialChars=function(e={}){return[hr.of(e),ur||(ur=Me.fromClass(class{constructor(e){this.view=e,this.decorations=oe.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(hr)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new or({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:o}=n.state,s=r.codePointAt(t[0],0);if(9==s){let e=o.lineAt(i),t=n.state.tabSize,s=r.countColumn(e.text,t,i-e.from);return oe.replace({widget:new dr((t-s%t)*this.view.defaultCharacterWidth)})}return this.decorationCache[s]||(this.decorationCache[s]=oe.replace({widget:new fr(e,s)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(hr);e.startState.facet(hr)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]},t.hoverTooltip=function(e,t={}){let n=r.StateEffect.define(),i=r.StateField.define({create:()=>null,update(e,i){if(e&&(t.hideOnChange&&(i.docChanged||i.selection)||t.hideOn&&t.hideOn(i,e)))return null;if(e&&i.docChanged){let t=i.changes.mapPos(e.pos,-1,r.MapMode.TrackDel);if(null==t)return null;let n=Object.assign(Object.create(null),e);n.pos=t,null!=e.end&&(n.end=i.changes.mapPos(e.end)),e=n}for(let t of i.effects)t.is(n)&&(e=t.value),t.is(Pr)&&(e=null);return e},provide:e=>Ir.from(e)});return[i,Me.define((r=>new _r(r,e,i,n,t.hoverTime||300))),$r]},t.keymap=Ln,t.lineNumberMarkers=Xr,t.lineNumbers=function(e={}){return[ei.of(e),Ur(),ri]},t.logException=Ce,t.panels=function(e){return e?[Rr.of(e)]:[]},t.placeholder=function(e){return Me.fromClass(class{constructor(t){this.view=t,this.placeholder=oe.set([oe.widget({widget:new vr(e),side:1}).range(0)])}get decorations(){return this.view.state.doc.length?oe.none:this.placeholder}},{decorations:e=>e.decorations})},t.rectangularSelection=function(e){let t=(null==e?void 0:e.eventFilter)||(e=>e.altKey&&0==e.button);return Tn.mouseSelectionStyle.of(((e,n)=>t(n)?function(e,t){let n=br(e,t),i=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),r=e.state.doc.lineAt(t);n={line:r.number,col:n.col,off:Math.min(n.off,r.length)},i=i.map(e.changes)}},get(t,o,s){let a=br(e,t);if(!a)return i;let l=function(e,t,n){let i=Math.min(t.line,n.line),o=Math.max(t.line,n.line),s=[];if(t.off>yr||n.off>yr||t.col<0||n.col<0){let a=Math.min(t.off,n.off),l=Math.max(t.off,n.off);for(let t=i;t<=o;t++){let n=e.doc.line(t);n.length<=l&&s.push(r.EditorSelection.range(n.from+a,n.to+l))}}else{let a=Math.min(t.col,n.col),l=Math.max(t.col,n.col);for(let t=i;t<=o;t++){let n=e.doc.line(t),i=r.findColumn(n.text,a,e.tabSize,!0);if(i>-1){let t=r.findColumn(n.text,l,e.tabSize);s.push(r.EditorSelection.range(n.from+i,n.from+t))}}}return s}(e.state,n,a);return l.length?s?r.EditorSelection.create(l.concat(i.ranges)):r.EditorSelection.create(l):i}}:null}(e,n):null))},t.repositionTooltips=function(e){var t;null===(t=e.plugin(Or))||void 0===t||t.maybeMeasure()},t.runScopeHandlers=function(e,t,n){return Hn(Vn(e.state),t,e,n)},t.scrollPastEnd=function(){return[pr,$e.of((e=>{var t;return(null===(t=e.plugin(pr))||void 0===t?void 0:t.attrs)||null}))]},t.showPanel=Fr,t.showTooltip=Mr,t.tooltips=function(e={}){return Cr.of(e)}},7897:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=1024;let r=0;class i{constructor(e,t){this.from=e,this.to=t}}class o{constructor(e={}){this.id=r++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=l.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}o.closedBy=new o({deserialize:e=>e.split(" ")}),o.openedBy=new o({deserialize:e=>e.split(" ")}),o.group=new o({deserialize:e=>e.split(" ")}),o.contextHash=new o({perNode:!0}),o.lookAhead=new o({perNode:!0}),o.mounted=new o({perNode:!0});class s{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}}const a=Object.create(null);class l{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):a,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),r=new l(e.name||"",t,e.id,n);if(e.props)for(let n of e.props)if(Array.isArray(n)||(n=n(r)),n){if(n[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[n[0].id]=n[1]}return r}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(o.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(" "))t[r]=e[n];return e=>{for(let n=e.prop(o.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}}l.none=new l("",Object.create(null),0,8);class c{constructor(e){this.types=e;for(let t=0;t=i&&(s.type.isAnonymous||!1!==n(s))){if(s.firstChild())continue;e=!0}for(;e&&r&&!s.type.isAnonymous&&r(s),!s.nextSibling();){if(!s.parent())return;e=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:j(l.none,this.children,this.positions,0,this.children.length,0,this.length,((e,t,n)=>new d(this.type,e,t,n,this.propValues)),e.makeTree||((e,t,n)=>new d(l.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:r,nodeSet:i,maxBufferLength:s=n,reused:a=[],minRepeatType:l=i.types.length}=e,c=Array.isArray(r)?new p(r,r.length):r,h=i.types,u=0,f=0;function g(e,t,n,r,p){let{id:w,start:x,end:k,size:S}=c,A=f;for(;S<0;){if(c.next(),-1==S){let t=a[w];return n.push(t),void r.push(x-e)}if(-3==S)return void(u=w);if(-4==S)return void(f=w);throw new RangeError(`Unrecognized record size: ${S}`)}let C,O,E=h[w],M=x-e;if(k-x<=s&&(O=function(e,t){let n=c.fork(),r=0,i=0,o=0,a=n.end-s,h={size:0,start:0,skip:0};e:for(let s=n.pos-e;n.pos>s;){let e=n.size;if(n.id==t&&e>=0){h.size=r,h.start=i,h.skip=o,o+=4,r+=4,n.next();continue}let c=n.pos-e;if(e<0||c=l?4:0,f=n.start;for(n.next();n.pos>c;){if(n.size<0){if(-3!=n.size)break e;u+=4}else n.id>=l&&(u+=4);n.next()}i=f,r+=e,o+=u}return(t<0||r==e)&&(h.size=r,h.start=i,h.skip=o),h.size>4?h:void 0}(c.pos-t,p))){let t=new Uint16Array(O.size-O.skip),n=c.pos-O.size,r=t.length;for(;c.pos>n;)r=b(O.start,t,r);C=new m(t,k-O.start,i),M=O.start-e}else{let e=c.pos-S;c.next();let t=[],n=[],r=w>=l?w:-1,i=0,a=k;for(;c.pos>e;)r>=0&&c.id==r&&c.size>=0?(c.end<=a-s&&(v(t,n,x,i,c.end,a,r,A),i=t.length,a=c.end),c.next()):g(x,e,t,n,r);if(r>=0&&i>0&&i-1&&i>0){let e=function(e){return(t,n,r)=>{let i,s,a=0,l=t.length-1;if(l>=0&&(i=t[l])instanceof d){if(!l&&i.type==e&&i.length==r)return i;(s=i.prop(o.lookAhead))&&(a=n[l]+i.length+s)}return y(e,t,n,r,a)}}(E);C=j(E,t,n,0,t.length,0,k-x,e,e)}else C=y(E,t,n,k-x,A-k)}n.push(C),r.push(M)}function v(e,t,n,r,o,s,a,l){let c=[],h=[];for(;e.length>r;)c.push(e.pop()),h.push(t.pop()+n-o);e.push(y(i.types[a],c,h,s-o,l-s)),t.push(o-n)}function y(e,t,n,r,i=0,s){if(u){let e=[o.contextHash,u];s=s?[e].concat(s):[e]}if(i>25){let e=[o.lookAhead,i];s=s?[e].concat(s):[e]}return new d(e,t,n,r,s)}function b(e,t,n){let{id:r,start:i,end:o,size:s}=c;if(c.next(),s>=0&&r4){let r=c.pos-(s-4);for(;c.pos>r;)n=b(e,t,n)}t[--n]=a,t[--n]=o-e,t[--n]=i-e,t[--n]=r}else-3==s?u=r:-4==s&&(f=r);return n}let w=[],x=[];for(;c.pos>0;)g(e.start||0,e.bufferStart||0,w,x,-1);let k=null!==(t=e.length)&&void 0!==t?t:w.length?x[0]+w[0].length:0;return new d(h[e.topID],w.reverse(),x.reverse(),k)}(e)}}d.empty=new d(l.none,[],[],0);class p{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new p(this.buffer,this.index)}}class m{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return l.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return s}slice(e,t,n,r){let i=this.buffer,o=new Uint16Array(t-e);for(let r=e,s=0;r=t&&nt;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function v(e,t){let n=e.childBefore(t);for(;n;){let t=n.lastChild;if(!t||t.to!=n.to)break;t.type.isError&&t.from==t.to?(e=n,n=t.prevSibling):n=t}return e}function y(e,n,r,i){for(var o;e.from==e.to||(r<1?e.from>=n:e.from>n)||(r>-1?e.to<=n:e.to0?l.length:-1;e!=h;e+=n){let h=l[e],u=c[e]+a.from;if(g(i,r,u,u+h.length))if(h instanceof m){if(s&t.IterMode.ExcludeBuffers)continue;let o=h.findChild(0,h.buffer.length,n,r-u,i);if(o>-1)return new S(new k(a,h,e,u),null,o)}else if(s&t.IterMode.IncludeAnonymous||!h.type.isAnonymous||C(h)){let l;if(!(s&t.IterMode.IgnoreMounts)&&h.props&&(l=h.prop(o.mounted))&&!l.overlay)return new b(l.tree,u,e,a);let c=new b(h,u,e,a);return s&t.IterMode.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?h.children.length-1:0,n,r,i)}}if(s&t.IterMode.IncludeAnonymous||!a.type.isAnonymous)return null;if(e=a.index>=0?a.index+n:n<0?-1:a._parent._tree.children.length,a=a._parent,!a)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r&t.IterMode.IgnoreOverlays)&&(i=this._tree.prop(o.mounted))&&i.overlay){let t=e-this.from;for(let{from:e,to:r}of i.overlay)if((n>0?e<=t:e=t:r>t))return new b(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(e=0){return new A(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,t=0){return y(this,e,t,!1)}resolveInner(e,t=0){return y(this,e,t,!0)}enterUnfinishedNodesBefore(e){return v(this,e)}getChild(e,t=null,n=null){let r=w(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return w(this,e,t,n)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return x(this,e)}}function w(e,t,n,r){let i=e.cursor(),o=[];if(!i.firstChild())return o;if(null!=n)for(;!i.type.is(n);)if(!i.nextSibling())return o;for(;;){if(null!=r&&i.type.is(r))return o;if(i.type.is(t)&&o.push(i.node),!i.nextSibling())return null==r?o:[]}}function x(e,t,n=t.length-1){for(let r=e.parent;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class k{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class S{constructor(e,t,n){this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}child(e,t,n){let{buffer:r}=this.context,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return i<0?null:new S(this.context,this,i)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&t.IterMode.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return o<0?null:new S(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new S(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new S(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}cursor(e=0){return new A(this,e)}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let o=n.buffer[this.index+1],s=n.buffer[this.index+2];e.push(n.slice(r,i,o,s)),t.push(0)}return new d(this.type,e,t,this.to-this.from)}resolve(e,t=0){return y(this,e,t,!1)}resolveInner(e,t=0){return y(this,e,t,!0)}enterUnfinishedNodesBefore(e){return v(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,n=null){let r=w(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return w(this,e,t,n)}get node(){return this}matchContext(e){return x(this,e)}}class A{constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof b)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}get name(){return this.type.name}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return!!e&&(e instanceof b?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return!(i<0)&&(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?!(r&t.IterMode.ExcludeBuffers)&&this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&t.IterMode.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&t.IterMode.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let i=n+e,o=e<0?-1:r._tree.children.length;i!=o;i+=e){let e=r._tree.children[i];if(this.mode&t.IterMode.IncludeAnonymous||e instanceof m||!e.type.isAnonymous||C(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=i+1;break e}r=this.stack[--i]}for(let e=n;e=0;i--){if(i<0)return x(this.node,e,r);let o=n[t.buffer[this.stack[i]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function C(e){return e.children.some((e=>e instanceof m||!e.type.isAnonymous||C(e)))}const O=new WeakMap;function E(e,t){if(!e.isAnonymous||t instanceof m||t.type!=e)return 1;let n=O.get(t);if(null==n){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof d)){n=1;break}n+=E(e,r)}O.set(t,n)}return n}function j(e,t,n,r,i,o,s,a,l){let c=0;for(let n=r;n=h)break;p+=t}if(c==i+1){if(p>h){let e=n[i];t(e.children,e.positions,0,e.children.length,r[i]+a);continue}u.push(n[i])}else{let t=r[c-1]+n[c-1].length-d;u.push(j(e,n,r,i,c,d,t,null,l))}f.push(d+a-o)}}(t,n,r,i,0),(a||l)(u,f,s)}class M{constructor(e,t,n,r,i=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=(i?1:0)|(o?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let r=[new M(0,e.length,e,0,!1,n)];for(let n of t)n.to>e.length&&r.push(n);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],i=1,o=e.length?e[0]:null;for(let s=0,a=0,l=0;;s++){let c=s=n)for(;o&&o.from=t.from||h<=t.to||l){let e=Math.max(t.from,a)-l,n=Math.min(t.to,h)-l;t=e>=n?null:new M(e,n,t.tree,t.offset+l,s>0,!!c)}if(t&&r.push(t),o.to>h)break;o=ie.frag.from<=o.from&&e.frag.to>=o.to&&e.mount.overlay));if(e)for(let t of e.mount.overlay){let r=t.from+e.pos,i=t.to+e.pos;r>=o.from&&i<=o.to&&!n.ranges.some((e=>e.fromr))&&n.ranges.push({from:r,to:i})}}l=!1}else if(r&&(s=D(r.ranges,o.from,o.to)))l=2!=s;else if(!o.type.isAnonymous&&o.fromnew i(e.from-o.from,e.to-o.from))):null,o.tree,e)),t.overlay?e.length&&(r={ranges:e,depth:0,prev:r}):l=!1}}else n&&(a=n.predicate(o))&&(!0===a&&(a=new i(o.from,o.to)),a.fromnew i(e.from-n.start,e.to-n.start))),n.target,e)),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}}function D(e,t,n){for(let r of e){if(r.from>=n)break;if(r.to>t)return r.from<=t&&r.to>=n?2:1}return 0}function R(e,t,n,r,i,o){if(t=t.to);r++);let s=i.children[r],a=s.buffer;i.children[r]=function e(n,r,i,l,c){let h=n;for(;a[h+2]+o<=t.from;)h=a[h+3];let u=[],f=[];R(s,n,h,u,f,l);let p=a[h+1],m=a[h+2],g=p+o==t.from&&m+o==t.to&&a[h]==t.type.id;return u.push(g?t.toTree():e(h+4,a[h+3],s.set.types[a[h]],p,m-p)),f.push(p-l),R(s,a[h+3],r,u,f,l),new d(i,u,f,c)}(0,a.length,l.none,0,s.length);for(let r=0;r<=n;r++)e.childAfter(t.from)}class B{constructor(e,n){this.offset=n,this.done=!1,this.cursor=e.cursor(t.IterMode.IncludeAnonymous|t.IterMode.IgnoreMounts)}moveTo(e){let{cursor:n}=this,r=e-this.offset;for(;!this.done&&n.from=e&&n.enter(r,1,t.IterMode.IgnoreOverlays|t.IterMode.ExcludeBuffers)||n.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(!(t.children.length&&0==t.positions[0]&&t.children[0]instanceof d))break;t=t.children[0]}return!1}}class L{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=null!==(t=n.tree.prop(_))&&void 0!==t?t:n.to,this.inner=new B(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=null!==(e=t.tree.prop(_))&&void 0!==e?e:t.to,this.inner=new B(t.tree,-t.offset)}}findMounts(e,t){var n;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let e=this.inner.cursor.node;e;e=e.parent){let i=null===(n=e.tree)||void 0===n?void 0:n.prop(o.mounted);if(i&&i.parser==t)for(let t=this.fragI;t=e.to)break;n.tree==this.curFrag.tree&&r.push({frag:n,pos:e.from-n.offset,mount:i})}}}return r}}function F(e,t){let n=null,r=t;for(let o=1,s=0;o=l)break;e.to<=a||(n||(r=n=t.slice()),e.froml&&n.splice(s+1,0,new i(l,e.to))):e.to>l?n[s--]=new i(l,e.to):n.splice(s--,1))}}return r}function V(e,t,n,r){let o=0,s=0,a=!1,l=!1,c=-1e9,h=[];for(;;){let u=o==e.length?1e9:a?e[o].to:e[o].from,f=s==t.length?1e9:l?t[s].to:t[s].from;if(a!=l){let e=Math.max(c,n),t=Math.min(u,f,r);enew i(e.from+r,e.to+r))),l,c);for(let t=0,r=l;;t++){let i=t==a.length,l=i?c:a[t].from;if(l>r&&n.push(new M(r,l,o.tree,-e,s.from>=r,s.to<=l)),i)break;r=a[t].to}}else n.push(new M(l,c,o.tree,-e,s.from>=e,s.to<=a))}return n}t.DefaultBufferLength=n,t.MountedTree=s,t.NodeProp=o,t.NodeSet=c,t.NodeType=l,t.NodeWeakMap=class{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof S?this.setBuffer(e.context.buffer,e.index,t):e instanceof b&&this.map.set(e.tree,t)}get(e){return e instanceof S?this.getBuffer(e.context.buffer,e.index):e instanceof b?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}},t.Parser=class{startParse(e,t,n){return"string"==typeof e&&(e=new I(e)),n=n?n.length?n.map((e=>new i(e.from,e.to))):[new i(0,0)]:[new i(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},t.Tree=d,t.TreeBuffer=m,t.TreeCursor=A,t.TreeFragment=M,t.parseMixed=function(e){return(t,n,r,i)=>new P(t,e,n,r,i)}},5048:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7897);let i=0;class o{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=i++}static define(e){if(null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let t=new o([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new a;return t=>t.modified.indexOf(e)>-1?t:a.get(t.base||t,t.modified.concat(e).sort(((e,t)=>e.id-t.id)))}}let s=0;class a{constructor(){this.instances=[],this.id=s++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find((n=>{return n.base==e&&(r=t,i=n.modified,r.length==i.length&&r.every(((e,t)=>e==i[t])));var r,i}));if(n)return n;let r=[],i=new o(r,e,t);for(let e of t)e.instances.push(i);let s=l(t);for(let t of e.set)for(let e of s)r.push(a.get(t,e));return i}}function l(e){let t=[e];for(let n=0;n{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+" "+r:r;break}}return t},scope:r}}function f(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+" "+e:e)}return n}class d{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,i,o){let{type:s,from:a,to:l}=e;if(a>=n||l<=t)return;s.isTop&&(o=this.highlighters.filter((e=>!e.scope||e.scope(s))));let h=i,u=s.prop(c),d=!1;for(;u;){if(!u.context||e.matchContext(u.context)){let e=f(o,u.tags);e&&(h&&(h+=" "),h+=e,1==u.mode?i+=(i?" ":"")+e:0==u.mode&&(d=!0));break}u=u.next}if(this.startSpan(e.from,h),d)return;let p=e.tree&&e.tree.prop(r.NodeProp.mounted);if(p&&p.overlay){let r=e.node.enter(p.overlay[0].from+a,1),s=this.highlighters.filter((e=>!e.scope||e.scope(p.tree.type))),c=e.firstChild();for(let u=0,f=a;;u++){let d=u=m)&&e.nextSibling()););if(!d||m>n)break;f=d.to+a,f>t&&(this.highlightRange(r.cursor(),Math.max(t,d.from+a),Math.min(n,f),i,s),this.startSpan(f,h))}c&&e.parent()}else if(e.firstChild()){do{if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,i,o),this.startSpan(Math.min(n,e.to),h)}}while(e.nextSibling());e.parent()}}}const p=o.define,m=p(),g=p(),v=p(g),y=p(g),b=p(),w=p(b),x=p(b),k=p(),S=p(k),A=p(),C=p(),O=p(),E=p(O),j=p(),M={comment:m,lineComment:p(m),blockComment:p(m),docComment:p(m),name:g,variableName:p(g),typeName:v,tagName:p(v),propertyName:y,attributeName:p(y),className:p(g),labelName:p(g),namespace:p(g),macroName:p(g),literal:b,string:w,docString:p(w),character:p(w),attributeValue:p(w),number:x,integer:p(x),float:p(x),bool:p(b),regexp:p(b),escape:p(b),color:p(b),url:p(b),keyword:A,self:p(A),null:p(A),atom:p(A),unit:p(A),modifier:p(A),operatorKeyword:p(A),controlKeyword:p(A),definitionKeyword:p(A),moduleKeyword:p(A),operator:C,derefOperator:p(C),arithmeticOperator:p(C),logicOperator:p(C),bitwiseOperator:p(C),compareOperator:p(C),updateOperator:p(C),definitionOperator:p(C),typeOperator:p(C),controlOperator:p(C),punctuation:O,separator:p(O),bracket:E,angleBracket:p(E),squareBracket:p(E),paren:p(E),brace:p(E),content:k,heading:S,heading1:p(S),heading2:p(S),heading3:p(S),heading4:p(S),heading5:p(S),heading6:p(S),contentSeparator:p(k),list:p(k),quote:p(k),emphasis:p(k),strong:p(k),link:p(k),monospace:p(k),strikethrough:p(k),inserted:p(),deleted:p(),changed:p(),invalid:p(),meta:j,documentMeta:p(j),annotation:p(j),processingInstruction:p(j),definition:o.defineModifier(),constant:o.defineModifier(),function:o.defineModifier(),standard:o.defineModifier(),local:o.defineModifier(),special:o.defineModifier()},I=u([{tag:M.link,class:"tok-link"},{tag:M.heading,class:"tok-heading"},{tag:M.emphasis,class:"tok-emphasis"},{tag:M.strong,class:"tok-strong"},{tag:M.keyword,class:"tok-keyword"},{tag:M.atom,class:"tok-atom"},{tag:M.bool,class:"tok-bool"},{tag:M.url,class:"tok-url"},{tag:M.labelName,class:"tok-labelName"},{tag:M.inserted,class:"tok-inserted"},{tag:M.deleted,class:"tok-deleted"},{tag:M.literal,class:"tok-literal"},{tag:M.string,class:"tok-string"},{tag:M.number,class:"tok-number"},{tag:[M.regexp,M.escape,M.special(M.string)],class:"tok-string2"},{tag:M.variableName,class:"tok-variableName"},{tag:M.local(M.variableName),class:"tok-variableName tok-local"},{tag:M.definition(M.variableName),class:"tok-variableName tok-definition"},{tag:M.special(M.variableName),class:"tok-variableName2"},{tag:M.definition(M.propertyName),class:"tok-propertyName tok-definition"},{tag:M.typeName,class:"tok-typeName"},{tag:M.namespace,class:"tok-namespace"},{tag:M.className,class:"tok-className"},{tag:M.macroName,class:"tok-macroName"},{tag:M.propertyName,class:"tok-propertyName"},{tag:M.operator,class:"tok-operator"},{tag:M.comment,class:"tok-comment"},{tag:M.meta,class:"tok-meta"},{tag:M.invalid,class:"tok-invalid"},{tag:M.punctuation,class:"tok-punctuation"}]);t.Tag=o,t.classHighlighter=I,t.highlightTree=function(e,t,n,r=0,i=e.length){let o=new d(r,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),r,i,"",o.highlighters),o.flush(i)},t.styleTags=function(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(" "))if(e){let n=[],i=2,o=e;for(let t=0;;){if("..."==o&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!r)throw new RangeError("Invalid path: "+e);if(n.push("*"==r[0]?"":'"'==r[0][0]?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let s=e[t++];if(t==e.length&&"!"==s){i=0;break}if("/"!=s)throw new RangeError("Invalid path: "+e);o=e.slice(t)}let s=n.length-1,a=n[s];if(!a)throw new RangeError("Invalid path: "+e);let l=new h(r,i,s>0?n.slice(0,s):null);t[a]=l.sort(t[a])}}return c.add(t)},t.tagHighlighter=u,t.tags=M},9922:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5090),i=n(5048);const o=i.styleTags({String:i.tags.string,Number:i.tags.number,"True False":i.tags.bool,PropertyName:i.tags.propertyName,Null:i.tags.null,",":i.tags.separator,"[ ]":i.tags.squareBracket,"{ }":i.tags.brace}),s=r.LRParser.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[o],skippedNodes:[0],repeatNodeCount:2,tokenData:"(p~RaXY!WYZ!W]^!Wpq!Wrs!]|}$i}!O$n!Q!R$w!R![&V![!]&h!}#O&m#P#Q&r#Y#Z&w#b#c'f#h#i'}#o#p(f#q#r(k~!]Oc~~!`Upq!]qr!]rs!rs#O!]#O#P!w#P~!]~!wOe~~!zXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#g~#jR!Q![#s!c!i#s#T#Z#s~#vR!Q![$P!c!i$P#T#Z$P~$SR!Q![$]!c!i$]#T#Z$]~$`R!Q![!]!c!i!]#T#Z!]~$nOh~~$qQ!Q!R$w!R![&V~$|RT~!O!P%V!g!h%k#X#Y%k~%YP!Q![%]~%bRT~!Q![%]!g!h%k#X#Y%k~%nR{|%w}!O%w!Q![%}~%zP!Q![%}~&SPT~!Q![%}~&[ST~!O!P%V!Q![&V!g!h%k#X#Y%k~&mOg~~&rO]~~&wO[~~&zP#T#U&}~'QP#`#a'T~'WP#g#h'Z~'^P#X#Y'a~'fOR~~'iP#i#j'l~'oP#`#a'r~'uP#`#a'x~'}OS~~(QP#f#g(T~(WP#i#j(Z~(^P#X#Y(a~(fOQ~~(kOW~~(pOV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});t.parser=s},5090:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(7897);class o{constructor(e,t,n,r,i,o,s,a,l,c=0,h){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=o,this.buffer=s,this.bufferBase=a,this.curContext=l,this.lookAhead=c,this.parent=h}toString(){return`[${this.stack.filter(((e,t)=>t%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new o(e,[],t,n,n,0,[],0,r?new s(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=65535&e,{parser:r}=this.p,i=r.dynamicPrecedence(n);if(i&&(this.score+=i),0==t)return this.pushState(r.getGoto(this.state,n,!0),this.reducePos),no;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==e.buffer[r-4]&&e.buffer[r-1]>-1){if(t==n)return;if(e.buffer[r-2]>=t)return void(e.buffer[r-2]=n)}}if(i&&this.pos!=n){let i=this.buffer.length;if(i>0&&0!=this.buffer[i-4])for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4);this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}else this.buffer.push(e,t,n,r)}shift(e,t,n){let r=this.pos;if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){let i=e,{parser:o}=this.p;(n>this.pos||t<=o.maxNode)&&(this.pos=n,o.stateFlag(i,1)||(this.reducePos=n)),this.pushState(i,r),this.shiftContext(t,r),t<=o.maxNode&&this.buffer.push(t,r,n,4)}else this.pos=n,this.shiftContext(t,r),t<=this.p.parser.maxNode&&this.buffer.push(t,r,n,4)}apply(e,t,n){65536&e?this.reduce(e):this.shift(e,t,n)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new o(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new a(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==(65536&n))return!0;if(0==n)return!1;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r,i=0;i1&t&&e==r))||n.push(t[e],r)}t=n}let n=[];for(let e=0;e>19,r=65535&e,i=this.stack.length-3*n;if(i<0||t.getGoto(this.stack[i],r,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class s{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}!function(e){e[e.Insert=200]="Insert",e[e.Delete=190]="Delete",e[e.Reduce=100]="Reduce",e[e.MaxNext=4]="MaxNext",e[e.MaxInsertStackDepth=300]="MaxInsertStackDepth",e[e.DampenInsertStackDepth=120]="DampenInsertStackDepth"}(r||(r={}));class a{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,n=e>>19;0==n?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(n-1);let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class l{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new l(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new l(this.stack,this.pos,this.index)}}class c{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const h=new c;class u{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=h,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;in.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}peek(e){let t,n,r=this.chunkOff+e;if(r>=0&&r=this.chunk2Pos&&tr.to&&(this.chunk2=this.chunk2.slice(0,r.to-t)),n=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),n}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=h,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}}class f{constructor(e,t){this.data=e,this.id=t}token(e,t){!function(e,t,n,r){let i=0,o=1<0){let n=e[r];if(a.allows(n)&&(-1==t.token.value||t.token.value==n||s.overrides(n,t.token.value))){t.acceptToken(n);break}}let r=t.next,l=0,c=e[i+2];if(!(t.next<0&&c>l&&65535==e[n+3*c-3])){for(;l>1,s=n+o+(o<<1),a=e[s],h=e[s+1];if(r=h)){i=e[s+2],t.advance();continue e}l=o+1}}break}i=e[n+3*c-1]}}(this.data,e,t,this.id)}}function d(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let r=0,i=0;r=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),o+=i,n)break;o*=46}n?n[i++]=o:n=new t(o)}return n}f.prototype.contextual=f.prototype.fallback=f.prototype.extend=!1;const p="undefined"!=typeof process&&process.env&&/\bparse\b/.test(process.env.LOG);let m=null;var g,v;function y(e,t,n){let r=e.cursor(i.IterMode.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.tot)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}!function(e){e[e.Margin=25]="Margin"}(g||(g={}));class b{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?y(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?y(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=s,null;if(o instanceof i.Tree){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[t]++,this.nextStart=s+o.length}}}class w{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map((e=>new c))}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,o=r.stateSlot(e.state,3),s=e.curContext?e.curContext.hash:0,a=0;for(let r=0;rc.end+25&&(a=Math.max(c.lookAhead,a)),0!=c.value)){let r=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!l.extend&&(n=c,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),n||e.pos!=this.stream.end||(n=new c,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new c,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){if(t.token(this.stream.reset(n.pos,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r=0&&n.p.parser.dialect.allows(i>>1)){0==(1&i)?e.value=i>>1:e.extended=i>>1;break}}}else e.value=0,e.end=Math.min(n.p.stream.end,n.pos+1)}putAction(e,t,n,r){for(let t=0;t4*e.bufferLength?new b(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,r=this.minStackPos,i=this.stacks=[];for(let o=0;or)i.push(s);else{if(this.advanceStack(s,i,n))continue;{e||(e=[],t=[]),e.push(s);let n=this.tokens.getMainToken(s);t.push(n.value,n.end)}}break}}if(!i.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scorethis.stoppedAt?e[0]:this.runRecovery(e,t,i);if(n)return this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(i.length>e)for(i.sort(((e,t)=>t.score-e.score));i.length>e;)i.pop();i.some((e=>e.reducePos>r))&&this.recovering--}else if(i.length>1)e:for(let e=0;e500&&r.buffer.length>500){if(!((t.score-r.score||t.buffer.length-r.buffer.length)>0)){i.splice(e--,1);continue e}i.splice(n--,1)}}}this.minStackPos=i[0].pos;for(let e=1;e ":"";if(null!=this.stoppedAt&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let a=this.fragments.nodeAt(r);a;){let r=this.parser.nodeSet.types[a.type.id]==a.type?o.getGoto(e.state,a.type.id):-1;if(r>-1&&a.length&&(!t||(a.prop(i.NodeProp.contextHash)||0)==n))return e.useNode(a,r),p&&console.log(s+this.stackID(e)+` (via reuse of ${o.getName(a.type.id)})`),!0;if(!(a instanceof i.Tree)||0==a.children.length||a.positions[0]>0)break;let l=a.children[0];if(!(l instanceof i.Tree&&0==a.positions[0]))break;a=l}}let a=o.stateSlot(e.state,4);if(a>0)return e.reduce(a),p&&console.log(s+this.stackID(e)+` (via always-reduce ${o.getName(65535&a)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let i=0;ir?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return k(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let o=0;o ":"";if(s.deadEnd){if(i)continue;if(i=!0,s.restart(),p&&console.log(c+this.stackID(s)+" (restarted)"),this.advanceFully(s,n))continue}let h=s.split(),u=c;for(let e=0;h.forceReduce()&&e<10&&(p&&console.log(u+this.stackID(h)+" (via force-reduce)"),!this.advanceFully(h,n));e++)p&&(u=this.stackID(h)+" -> ");for(let e of s.recoverByInsert(a))p&&console.log(c+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,n);this.stream.end>s.pos?(l==s.pos&&(l++,a=0),s.recoverByDelete(a,l),p&&console.log(c+this.stackID(s)+` (via recover-delete ${this.parser.getName(a)})`),k(s,n)):(!r||r.scoree;class C extends i.Parser{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let n=0;ne.topRules[t][1])),r=[];for(let e=0;e=0)o(r,e,t[n++]);else{let i=t[n+-r];for(let s=-r;s>0;s--)o(t[n++],e,i);n++}}}this.nodeSet=new i.NodeSet(t.map(((t,o)=>i.NodeType.define({name:o>=this.minRepeatTerm?void 0:t,id:o,props:r[o],top:n.indexOf(o)>-1,error:0==o,skipped:e.skippedNodes&&e.skippedNodes.indexOf(o)>-1})))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=i.DefaultBufferLength;let s=d(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e"number"==typeof e?new f(s,e):e)),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new x(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],o=1&t,s=r[i++];if(o&&n)return s;for(let n=i+(t>>1);i0}validAction(e,t){if(t==this.stateSlot(e,4))return!0;for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])return!1;n=O(this.data,n+2)}if(t==O(this.data,n+1))return!0}}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])break;n=O(this.data,n+2)}if(0==(1&this.data[n+2])){let e=this.data[n+1];t.some(((t,n)=>1&n&&t==e))||t.push(this.data[n],e)}}return t}overrides(e,t){let n=E(this.data,this.tokenPrecTable,t);return n<0||E(this.data,this.tokenPrecTable,e){let n=e.tokenizers.find((e=>e.from==t));return n?n.to:t}))),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map(((n,r)=>{let i=e.specializers.find((e=>e.from==n.external));if(!i)return n;let o=Object.assign(Object.assign({},n),{external:i.to});return t.specializers[r]=j(o),o}))),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map((()=>!1));if(e)for(let r of e.split(" ")){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;ee.external(n,r)<<1|t}return e.get}t.ContextTracker=class{constructor(e){this.start=e.start,this.shift=e.shift||A,this.reduce=e.reduce||A,this.reuse=e.reuse||A,this.hash=e.hash||(()=>0),this.strict=!1!==e.strict}},t.ExternalTokenizer=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}},t.InputStream=u,t.LRParser=C,t.Stack=o},9091:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3642),i=n(7040),o=n(729),s=n(8561),a=n(2502),l=n(526),c=n(2426);const h=[r.lineNumbers(),r.highlightActiveLineGutter(),r.highlightSpecialChars(),s.history(),o.foldGutter(),r.drawSelection(),r.dropCursor(),i.EditorState.allowMultipleSelections.of(!0),o.indentOnInput(),o.syntaxHighlighting(o.defaultHighlightStyle,{fallback:!0}),o.bracketMatching(),l.closeBrackets(),l.autocompletion(),r.rectangularSelection(),r.crosshairCursor(),r.highlightActiveLine(),a.highlightSelectionMatches(),r.keymap.of([...l.closeBracketsKeymap,...s.defaultKeymap,...a.searchKeymap,...s.historyKeymap,...o.foldKeymap,...l.completionKeymap,...c.lintKeymap])],u=[r.highlightSpecialChars(),s.history(),r.drawSelection(),o.syntaxHighlighting(o.defaultHighlightStyle,{fallback:!0}),r.keymap.of([...s.defaultKeymap,...s.historyKeymap])];Object.defineProperty(t,"EditorView",{enumerable:!0,get:function(){return r.EditorView}}),t.basicSetup=h,t.minimalSetup=u},8513:e=>{"use strict";function t(e,n){if("string"==typeof n)e.appendChild(document.createTextNode(n));else if(null==n);else if(null!=n.nodeType)e.appendChild(n);else{if(!Array.isArray(n))throw new RangeError("Unsupported child node: "+n);for(var r=0;r{var n="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),r="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{},o=t.StyleModule=function(e,t){this.rules=[];var n=(t||{}).finish;function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,o,s){var a=[],l=/^@(\w+)\b/.exec(e[0]),c=l&&"keyframes"==l[1];if(l&&null==t)return o.push(e[0]+";");for(var h in t){var u=t[h];if(/&/.test(h))i(h.split(/,\s*/).map((function(t){return e.map((function(e){return t.replace(/&/,e)}))})).reduce((function(e,t){return e.concat(t)})),u,o);else if(u&&"object"==typeof u){if(!l)throw new RangeError("The value of a property ("+h+") should be a primitive value.");i(r(h),u,a,c)}else null!=u&&a.push(h.replace(/_.*/,"").replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()}))+": "+u+";")}(a.length||c)&&o.push((!n||l||s?e:e.map(n)).join(", ")+" {"+a.join(" ")+"}")}for(var o in e)i(r(o),e[o],this.rules)};o.prototype.getRules=function(){return this.rules.join("\n")},o.newName=function(){var e=i[n]||1;return i[n]=e+1,"ͼ"+e.toString(36)},o.mount=function(e,t){(e[r]||new a(e)).mount(Array.isArray(t)?t:[t])};var s=null,a=function(e){if(!e.head&&e.adoptedStyleSheets&&"undefined"!=typeof CSSStyleSheet){if(s)return e.adoptedStyleSheets=[s.sheet].concat(e.adoptedStyleSheets),e[r]=s;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),s=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");var t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[r]=this};a.prototype.mount=function(e){for(var t=this.sheet,n=0,r=0,i=0;i-1&&(this.modules.splice(s,1),r--,s=-1),-1==s){if(this.modules.splice(r++,0,o),t)for(var a=0;a{"use strict";Object.defineProperty(t,"__esModule",{value:!0});for(var n={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},r={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},i="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),o="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),s="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),a="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),l="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),c=i&&(a||+i[1]<57)||s&&a,h=0;h<10;h++)n[48+h]=n[96+h]=String(h);for(h=1;h<=24;h++)n[h+111]="F"+h;for(h=65;h<=90;h++)n[h]=String.fromCharCode(h+32),r[h]=String.fromCharCode(h);for(var u in n)r.hasOwnProperty(u)||(r[u]=n[u]);t.base=n,t.keyName=function(e){var t=!(c&&(e.ctrlKey||e.altKey||e.metaKey)||(o||l)&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?r:n)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t},t.shift=r},4226:e=>{"use strict";e.exports=JSON.parse('{"http://json-schema.org/draft-03/schema#":"draft3","http://json-schema.org/draft-04/schema#":"draft4","http://json-schema.org/draft-06/schema#":"draft6","http://json-schema.org/draft-07/schema#":"draft7","https://json-schema.org/draft/2019-09/schema":"2019-09","https://json-schema.org/draft/2020-12/schema":"2020-12"}')},4147:e=>{"use strict";e.exports=JSON.parse('{"name":"alterschema","version":"1.1.3","description":"Convert between schema specifications","main":"bindings/node/index.js","bin":{"alterschema":"bindings/node/cli.js"},"keywords":["json","json-schema","jsonschema","openapi","convert","transform","version"],"repository":{"type":"git","url":"git+https://github.com/sourcemeta/alterschema.git"},"author":"Juan Cruz Viotti ","license":"Apache-2.0","bugs":{"url":"https://github.com/sourcemeta/alterschema/issues"},"devDependencies":{"@codemirror/lang-json":"^6.0.0","@codemirror/lint":"^6.0.0","ajv-cli":"^5.0.0","bootstrap":"^5.2.0","codemirror":"^6.0.1","standard":"^17.0.0","tap":"^18.0.3","webpack":"^5.74.0","webpack-cli":"^5.0.0"},"dependencies":{"@hyperjump/json-schema":"^0.23.5","json-e":"^4.4.3","lodash":"^4.17.21","object-hash":"^3.0.0"}}')},4405:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-2019-09","rules":[{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2019-09/empty-dependent-schemas","type":"object","required":["dependentSchemas"],"properties":{"dependentSchemas":{"const":{}}}},"transform":{"$eval":"omit(schema, \'dependentSchemas\')"}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2019-09/empty-dependent-required","type":"object","required":["dependentRequired"],"properties":{"dependentRequired":{"const":{}}}},"transform":{"$eval":"omit(schema, \'dependentRequired\')"}}]}')},7377:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-2019-09","rules":[{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/upgrade-official-metaschema","type":"object","required":["$schema"],"properties":{"$schema":{"const":"https://json-schema.org/draft/2019-09/schema"}}},"transform":{"$merge":[{"$eval":"schema"},{"$$schema":"https://json-schema.org/draft/2020-12/schema"}]}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/open-tuple","$comment":"https://json-schema.org/draft/2020-12/release-notes.html","type":"object","required":["items"],"properties":{"items":{"type":"array"},"additionalItems":false}},"transform":{"$merge":[{"$eval":"omit(schema, \'items\')"},{"prefixItems":{"$eval":"schema.items"}}]}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/open-tuple-in-ref","$comment":"https://json-schema.org/draft/2020-12/release-notes.html","type":"object","required":["$ref"],"properties":{"$ref":{"type":"string","pattern":"/items/\\\\d+"}}},"transform":{"$merge":[{"$eval":"omit(schema, \'$ref\')"},{"$$ref":{"$eval":"replace(schema[\'$ref\'], \'/items/(\\\\d+)\', \'/prefixItems/$1\')"}}]}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/additional-items-in-ref","$comment":"https://json-schema.org/draft/2020-12/release-notes.html","type":"object","required":["$ref"],"properties":{"$ref":{"type":"string","pattern":"/additionalItems"}}},"transform":{"$merge":[{"$eval":"omit(schema, \'$ref\')"},{"$$ref":{"$eval":"replace(schema[\'$ref\'], \'/additionalItems\', \'/items\')"}}]}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/closed-tuple","$comment":"https://json-schema.org/draft/2020-12/release-notes.html","type":"object","required":["items","additionalItems"],"properties":{"additionalItems":true,"items":{"type":"array"}}},"transform":{"$merge":[{"$eval":"omit(schema, \'additionalItems\')"},{"items":{"$eval":"schema.additionalItems"},"prefixItems":{"$eval":"schema.items"}}]}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/empty-object","const":{}},"transform":{"$eval":"true"}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/negated-empty-object","const":{"not":true}},"transform":{"$eval":"false"}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/enum-to-const","type":"object","required":["enum"],"properties":{"enum":{"type":"array","minItems":1,"maxItems":1}}},"transform":{"$merge":[{"$eval":"omit(schema, \'enum\')"},{"const":{"$eval":"schema.enum[0]"}}]}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/recursive-anchor-false","type":"object","required":["$recursiveAnchor"],"properties":{"$recursiveAnchor":{"const":false}}},"transform":{"$eval":"omit(schema, \'$recursiveAnchor\')"}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/recursive-anchor-true","type":"object","required":["$recursiveAnchor"],"properties":{"$recursiveAnchor":{"const":true}}},"transform":{"$merge":[{"$eval":"omit(schema, \'$recursiveAnchor\')"},{"$$dynamicAnchor":{"$eval":"\'anchor-\' + jsonHash(original)"}}]}},{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-2019-09-to-2020-12/recursive-ref-empty-fragment","type":"object","required":["$recursiveRef"],"properties":{"$recursiveRef":{"const":"#"}}},"transform":{"$merge":[{"$eval":"omit(schema, \'$recursiveRef\')"},{"$$dynamicRef":{"$if":"hasContext(\'$recursiveAnchor\', true)","then":{"$eval":"\'#anchor-\' + jsonHash(original)"},"else":{"$eval":"schema[\'$recursiveRef\']"}}}]}}]}')},4619:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-2020-12","rules":[]}')},3825:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-draft3","rules":[]}')},3066:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-draft3","rules":[{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft3-to-draft4/upgrade-official-metaschema","type":"object","required":["$schema"],"properties":{"$schema":{"const":"http://json-schema.org/draft-03/schema#"}}},"transform":{"$merge":[{"$eval":"schema"},{"$$schema":"http://json-schema.org/draft-04/schema#"}]}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft3-to-draft4/type-any","type":"object","required":["type"],"properties":{"type":{"const":"any"}}},"transform":{"$eval":"omit(schema, \'type\')"}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft3-to-draft4/type-any-array","type":"object","required":["type"],"properties":{"type":{"type":"array","contains":{"const":"any"}}}},"transform":{"$eval":"omit(schema, \'type\')"}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft3-to-draft4/divisible-by","type":"object","required":["divisibleBy"],"properties":{"divisibleBy":{"type":"number"}}},"transform":{"$merge":[{"$eval":"omit(schema, \'divisibleBy\')"},{"multipleOf":{"$eval":"schema.divisibleBy"}}]}}]}')},9300:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-draft4","rules":[]}')},8790:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-draft4","rules":[{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft4-to-draft6/upgrade-official-metaschema","type":"object","required":["$schema"],"properties":{"$schema":{"const":"http://json-schema.org/draft-04/schema#"}}},"transform":{"$merge":[{"$eval":"schema"},{"$$schema":"http://json-schema.org/draft-06/schema#"}]}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft4-to-draft6/id","type":"object","required":["id"],"properties":{"id":{"type":"string"}}},"transform":{"$merge":[{"$eval":"omit(schema, \'id\')"},{"$$id":{"$eval":"schema.id"}}]}},{"vocabulary":"validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft4-to-draft6/boolean-exclusive-minimum-true","type":"object","required":["minimum","exclusiveMinimum"],"properties":{"minimum":{"type":"number"},"exclusiveMinimum":{"const":true}}},"transform":{"$merge":[{"$eval":"omit(schema, \'minimum\')"},{"exclusiveMinimum":{"$eval":"schema.minimum"}}]}},{"vocabulary":"validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft4-to-draft6/boolean-exclusive-maximum-true","type":"object","required":["maximum","exclusiveMaximum"],"properties":{"maximum":{"type":"number"},"exclusiveMaximum":{"const":true}}},"transform":{"$merge":[{"$eval":"omit(schema, \'maximum\')"},{"exclusiveMaximum":{"$eval":"schema.maximum"}}]}},{"vocabulary":"validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft4-to-draft6/boolean-exclusive-minimum-false","type":"object","required":["minimum","exclusiveMinimum"],"properties":{"minimum":{"type":"number"},"exclusiveMinimum":{"const":false}}},"transform":{"$merge":[{"$eval":"omit(schema, \'exclusiveMinimum\')"}]}},{"vocabulary":"validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft4-to-draft6/boolean-exclusive-maximum-false","type":"object","required":["maximum","exclusiveMaximum"],"properties":{"maximum":{"type":"number"},"exclusiveMaximum":{"const":false}}},"transform":{"$merge":[{"$eval":"omit(schema, \'exclusiveMaximum\')"}]}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft4-to-draft6/empty-object","const":{}},"transform":{"$eval":"true"}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft4-to-draft6/negated-empty-object","const":{"not":true}},"transform":{"$eval":"false"}},{"vocabulary":"validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft4-to-draft6/enum-to-const","type":"object","required":["enum"],"properties":{"enum":{"type":"array","minItems":1,"maxItems":1}}},"transform":{"$merge":[{"$eval":"omit(schema, \'enum\')"},{"const":{"$eval":"schema.enum[0]"}}]}}]}')},2630:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-draft6","rules":[]}')},6989:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-draft6","rules":[{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft6-to-draft7/upgrade-official-metaschema","type":"object","required":["$schema"],"properties":{"$schema":{"const":"http://json-schema.org/draft-06/schema#"}}},"transform":{"$merge":[{"$eval":"schema"},{"$$schema":"http://json-schema.org/draft-07/schema#"}]}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft6-to-draft7/empty-object","const":{}},"transform":{"$eval":"true"}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft6-to-draft7/negated-empty-object","const":{"not":true}},"transform":{"$eval":"false"}},{"vocabulary":"validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft6-to-draft7/enum-to-const","type":"object","required":["enum"],"properties":{"enum":{"type":"array","minItems":1,"maxItems":1}}},"transform":{"$merge":[{"$eval":"omit(schema, \'enum\')"},{"const":{"$eval":"schema.enum[0]"}}]}}]}')},9326:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-draft7","rules":[{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft7-to-2019-09/upgrade-official-metaschema","type":"object","required":["$schema"],"properties":{"$schema":{"const":"http://json-schema.org/draft-07/schema#"}}},"transform":{"$merge":[{"$eval":"schema"},{"$$schema":"https://json-schema.org/draft/2019-09/schema"}]}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft7-to-2019-09/id-anchor","type":"object","required":["$id"],"properties":{"$id":{"type":"string","pattern":"^#"}}},"transform":{"$merge":[{"$eval":"omit(schema, \'$id\')"},{"$$anchor":{"$eval":"schema[\'$id\'][1:]"}}]}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft7-to-2019-09/definitions","type":"object","required":["definitions"],"properties":{"definitions":{"type":"object"}}},"transform":{"$merge":[{"$eval":"omit(schema, \'definitions\')"},{"$$defs":{"$eval":"schema.definitions"}}]}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft7-to-2019-09/definitions-in-ref","type":"object","required":["$ref"],"properties":{"$ref":{"type":"string","pattern":"/definitions/"}}},"transform":{"$merge":[{"$eval":"omit(schema, \'$ref\')"},{"$$ref":{"$eval":"replace(schema[\'$ref\'], \'/definitions/\', \'/$defs/\')"}}]}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft7-to-2019-09/empty-object","const":{}},"transform":{"$eval":"true"}},{"vocabulary":"core","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft7-to-2019-09/negated-empty-object","const":{"not":true}},"transform":{"$eval":"false"}},{"vocabulary":"validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft7-to-2019-09/enum-to-const","type":"object","required":["enum"],"properties":{"enum":{"type":"array","minItems":1,"maxItems":1}}},"transform":{"$merge":[{"$eval":"omit(schema, \'enum\')"},{"const":{"$eval":"schema.enum[0]"}}]}},{"vocabulary":"validation","condition":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/sourcemeta/alterschema/rules/jsonschema-draft7-to-2019-09/dependencies","type":"object","required":["dependencies"],"properties":{"dependencies":{"type":"object"}}},"transform":{"$merge":[{"$eval":"omit(schema, \'dependencies\')"},{"dependentRequired":{"$map":{"$eval":"schema.dependencies"},"each(v,k)":{"${k}":{"$if":"typeof(v) == \'array\'","then":{"$eval":"v"}}}}},{"dependentSchemas":{"$map":{"$eval":"schema.dependencies"},"each(v,k)":{"${k}":{"$if":"typeof(v) == \'object\' || typeof(v) == \'boolean\'","then":{"$eval":"v"}}}}}]}}]}')},1747:e=>{"use strict";e.exports=JSON.parse('{"walker":"jsonschema-draft7","rules":[]}')},2391:e=>{"use strict";e.exports=JSON.parse('{"$defs":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/core","type":"object","walker":"jsonschema-2019-09"},"allOf":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"array","walker":"jsonschema-2019-09"},"anyOf":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"array","walker":"jsonschema-2019-09"},"oneOf":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"array","walker":"jsonschema-2019-09"},"not":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"value","walker":"jsonschema-2019-09"},"if":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"value","walker":"jsonschema-2019-09"},"then":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"value","walker":"jsonschema-2019-09"},"else":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"value","walker":"jsonschema-2019-09"},"dependentSchemas":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"object","walker":"jsonschema-2019-09"},"items":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":["array","value"],"walker":"jsonschema-2019-09"},"additionalItems":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"value","walker":"jsonschema-2019-09"},"unevaluatedItems":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"value","walker":"jsonschema-2019-09"},"contains":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"value","walker":"jsonschema-2019-09"},"properties":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"object","walker":"jsonschema-2019-09"},"patternProperties":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"object","walker":"jsonschema-2019-09"},"additionalProperties":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"value","walker":"jsonschema-2019-09"},"unevaluatedProperties":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"value","walker":"jsonschema-2019-09"},"propertyNames":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/applicator","type":"value","walker":"jsonschema-2019-09"},"contentSchema":{"vocabulary":"https://json-schema.org/draft/2019-09/vocab/content","type":"value","walker":"jsonschema-2019-09"}}')},3212:e=>{"use strict";e.exports=JSON.parse('{"$defs":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/core","type":"object","walker":"jsonschema-2020-12"},"allOf":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"array","walker":"jsonschema-2020-12"},"anyOf":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"array","walker":"jsonschema-2020-12"},"oneOf":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"array","walker":"jsonschema-2020-12"},"not":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"value","walker":"jsonschema-2020-12"},"if":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"value","walker":"jsonschema-2020-12"},"then":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"value","walker":"jsonschema-2020-12"},"else":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"value","walker":"jsonschema-2020-12"},"dependentSchemas":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"object","walker":"jsonschema-2020-12"},"prefixItems":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"array","walker":"jsonschema-2020-12"},"items":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"value","walker":"jsonschema-2020-12"},"contains":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"value","walker":"jsonschema-2020-12"},"properties":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"object","walker":"jsonschema-2020-12"},"patternProperties":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"object","walker":"jsonschema-2020-12"},"additionalProperties":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"value","walker":"jsonschema-2020-12"},"propertyNames":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/applicator","type":"value","walker":"jsonschema-2020-12"},"unevaluatedItems":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/unevaluated","type":"value","walker":"jsonschema-2020-12"},"unevaluatedProperties":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/unevaluated","type":"value","walker":"jsonschema-2020-12"},"contentSchema":{"vocabulary":"https://json-schema.org/draft/2020-12/vocab/content","type":"value","walker":"jsonschema-2020-12"}}')},4413:e=>{"use strict";e.exports=JSON.parse('{"properties":{"vocabulary":"http://json-schema.org/draft-03/schema#","type":"object","walker":"jsonschema-draft3"},"patternProperties":{"vocabulary":"http://json-schema.org/draft-03/schema#","type":"object","walker":"jsonschema-draft3"},"additionalProperties":{"vocabulary":"http://json-schema.org/draft-03/schema#","type":"value","walker":"jsonschema-draft3"},"items":{"vocabulary":"http://json-schema.org/draft-03/schema#","type":["array","value"],"walker":"jsonschema-draft3"},"additionalItems":{"vocabulary":"http://json-schema.org/draft-03/schema#","type":"value","walker":"jsonschema-draft3"},"dependencies":{"vocabulary":"http://json-schema.org/draft-03/schema#","type":"object","walker":"jsonschema-draft3"},"extends":{"vocabulary":"http://json-schema.org/draft-03/schema#","type":["array","value"],"walker":"jsonschema-draft3"}}')},2427:e=>{"use strict";e.exports=JSON.parse('{"items":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":["array","value"],"walker":"jsonschema-draft4"},"additionalItems":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":"value","walker":"jsonschema-draft4"},"properties":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":"object","walker":"jsonschema-draft4"},"patternProperties":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":"object","walker":"jsonschema-draft4"},"additionalProperties":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":"value","walker":"jsonschema-draft4"},"dependencies":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":"object","walker":"jsonschema-draft4"},"allOf":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":"array","walker":"jsonschema-draft4"},"anyOf":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":"array","walker":"jsonschema-draft4"},"oneOf":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":"array","walker":"jsonschema-draft4"},"not":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":"value","walker":"jsonschema-draft4"},"definitions":{"vocabulary":"http://json-schema.org/draft-04/schema#","type":"object","walker":"jsonschema-draft4"}}')},9628:e=>{"use strict";e.exports=JSON.parse('{"items":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":["array","value"],"walker":"jsonschema-draft6"},"additionalItems":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"value","walker":"jsonschema-draft6"},"contains":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"value","walker":"jsonschema-draft6"},"properties":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"object","walker":"jsonschema-draft6"},"patternProperties":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"object","walker":"jsonschema-draft6"},"additionalProperties":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"value","walker":"jsonschema-draft6"},"dependencies":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"object","walker":"jsonschema-draft6"},"propertyNames":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"value","walker":"jsonschema-draft6"},"allOf":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"array","walker":"jsonschema-draft6"},"anyOf":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"array","walker":"jsonschema-draft6"},"oneOf":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"array","walker":"jsonschema-draft6"},"not":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"value","walker":"jsonschema-draft6"},"definitions":{"vocabulary":"http://json-schema.org/draft-06/schema#","type":"object","walker":"jsonschema-draft6"}}')},228:e=>{"use strict";e.exports=JSON.parse('{"items":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":["array","value"],"walker":"jsonschema-draft7"},"additionalItems":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"value","walker":"jsonschema-draft7"},"contains":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"value","walker":"jsonschema-draft7"},"properties":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"object","walker":"jsonschema-draft7"},"patternProperties":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"object","walker":"jsonschema-draft7"},"additionalProperties":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"value","walker":"jsonschema-draft7"},"dependencies":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"object","walker":"jsonschema-draft7"},"propertyNames":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"value","walker":"jsonschema-draft7"},"if":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"value","walker":"jsonschema-draft7"},"then":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"value","walker":"jsonschema-draft7"},"else":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"value","walker":"jsonschema-draft7"},"allOf":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"array","walker":"jsonschema-draft7"},"anyOf":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"array","walker":"jsonschema-draft7"},"oneOf":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"array","walker":"jsonschema-draft7"},"not":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"value","walker":"jsonschema-draft7"},"definitions":{"vocabulary":"http://json-schema.org/draft-07/schema#","type":"object","walker":"jsonschema-draft7"}}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{const e=n(9091),t=n(1184),r=n(2426),i=n(9960),o=n(8770),s=n(4147),a=n(4226),l={draft3:"Draft 3",draft4:"Draft 4",draft6:"Draft 6",draft7:"Draft 7"};function c(e){try{return JSON.parse(e)}catch(e){return null}}function h(e,t,n,r=!1){const i=document.createElement("option");i.innerText=t,i.setAttribute("value",n),r&&i.setAttribute("selected",""),e.appendChild(i)}function u(e){return-1===e.selectedIndex?null:e.options[e.selectedIndex].value}function f(e,t,n){const r=n||u(e);e.innerHTML="";for(const n of t)h(e,l[n]||n,n,r===n)}const d=document.getElementById("from"),p=document.getElementById("to"),m=document.getElementById("input"),g=document.getElementById("output"),v=document.getElementById("upgrade");function y(e){g.value=`ERROR: ${e.message}`}function b(e){f(d,Object.keys(i.jsonschema),e),d.dispatchEvent(new Event("change"))}const w={id:"http://example.com/schema",$schema:"http://json-schema.org/draft-04/schema#",dependencies:{foo:["bar"]},properties:{foo:{enum:["single-value"]},bar:{type:"number",minimum:5,exclusiveMinimum:!0}}},x=new e.EditorView({doc:JSON.stringify(w,null,2),extensions:[e.basicSetup,t.json(),r.linter(t.jsonParseLinter()),e.EditorView.updateListener.of((e=>{const t=e.transactions.reduce(((e,t)=>{const n=t.annotations.filter((e=>"string"==typeof e.value)).map((e=>e.value));return e.concat(n)}),[]);if(0===t.length)return;if(1===t.length&&("select.pointer"===t[0]||"select"===t[0]))return;const n=c(e.state.doc.toString());if(null===n)return;const r=a[n.$schema];r&&b(r)}))],parent:m});v.addEventListener("click",(()=>{const e=u(d),t=u(p),n=c(x.state.doc.toString());if(null===n)return window.plausible("Invalid"),y(new Error("Invalid input JSON"));window.plausible("Transform",{props:{from:e,to:t}}),o(n,e,t).then((e=>{g.value=JSON.stringify(e,null,2)})).catch(y)})),d.addEventListener("change",(e=>{f(p,Object.keys(i.jsonschema[e.target.value]).reverse())})),document.getElementById("version").innerText=`v${s.version}`,b(a[w.$schema]),x.focus(),v.dispatchEvent(new Event("click"))})()})(); \ No newline at end of file