slice-machine-ui 1.22.3-beta.2 → 1.22.3-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ChangesEmptyState/AuthErrorPage.tsx +7 -5
- package/components/ChangesEmptyState/OfflinePage.tsx +4 -1
- package/out/404.html +1 -1
- package/out/_next/static/{2SXh8a0HZLb2Awmhh2xob → M42mNVfKil-bxhOYNDdOm}/_buildManifest.js +1 -1
- package/out/_next/static/chunks/18539003-7b2711e6c51d6fac.js +97 -0
- package/out/_next/static/chunks/pages/{_app-49f29218569a926a.js → _app-b0c43816b02da519.js} +106 -104
- package/out/_next/static/chunks/pages/changes-2a9c3aeb3b079662.js +1 -0
- package/out/_next/static/css/{1bbf650dfd37ce69.css → 1aa04669758c24f4.css} +1 -1
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +6 -6
- package/out/_next/static/chunks/18539003-4460ccbfe3109578.js +0 -97
- package/out/_next/static/chunks/pages/changes-6f62ae7b6243a1c7.js +0 -1
- /package/out/_next/static/{2SXh8a0HZLb2Awmhh2xob → M42mNVfKil-bxhOYNDdOm}/_ssgManifest.js +0 -0
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[851],{71463:function(t,n,r){r.d(n,{kS:function(){return ecp}});var i,o=r(2784),a=r(98863),u=r(22715),s=r(74217),c=r(50054),l=r(86579),f=r(1611),d=r(17329),p=r(32184),h=r(87322),m=r(16247),g=r(661),y=r(52393),v=r(28316),b=r(87598),x=Object.defineProperty,M=(t,n,r)=>n in t?x(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,T=(t,n,r)=>(M(t,"symbol"!=typeof n?n+"":n,r),r),S="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{};function w(t){if(t.__esModule)return t;var n=t.default;if("function"==typeof n){var r=function t(){if(this instanceof t){var r=[null];return r.push.apply(r,arguments),new(Function.bind.apply(n,r))}return n.apply(this,arguments)};r.prototype=n.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var _,I,O,k={},C={get exports(){return k},set exports(e){k=e}},N={};(_=C).exports=function(){if(qg)return N;qg=1;var t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function u(n,o,u){var s,c={},l=null,f=null;for(s in void 0!==u&&(l=""+u),void 0!==o.key&&(l=""+o.key),void 0!==o.ref&&(f=o.ref),o)r.call(o,s)&&!a.hasOwnProperty(s)&&(c[s]=o[s]);if(n&&n.defaultProps)for(s in o=n.defaultProps)void 0===c[s]&&(c[s]=o[s]);return{$$typeof:t,type:n,key:l,ref:f,props:c,_owner:i.current}}return N.Fragment=n,N.jsx=u,N.jsxs=u,N}(),(I=qy||(qy={})).assertEqual=t=>t,I.assertIs=function(t){},I.assertNever=function(t){throw Error()},I.arrayToEnum=t=>{let n={};for(let r of t)n[r]=r;return n},I.getValidEnumValues=t=>{let n=I.objectKeys(t).filter(n=>"number"!=typeof t[t[n]]),r={};for(let i of n)r[i]=t[i];return I.objectValues(r)},I.objectValues=t=>I.objectKeys(t).map(function(n){return t[n]}),I.objectKeys="function"==typeof Object.keys?t=>Object.keys(t):t=>{let n=[];for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.push(r);return n},I.find=(t,n)=>{for(let r of t)if(n(r))return r},I.isInteger="function"==typeof Number.isInteger?t=>Number.isInteger(t):t=>"number"==typeof t&&isFinite(t)&&Math.floor(t)===t,I.joinValues=function(t,n=" | "){return t.map(t=>"string"==typeof t?`'${t}'`:t).join(n)},I.jsonStringifyReplacer=(t,n)=>"bigint"==typeof n?n.toString():n,(O=qv||(qv={})).mergeShapes=(t,n)=>({...t,...n});let j=qy.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),E=t=>{switch(typeof t){case"undefined":return j.undefined;case"string":return j.string;case"number":return isNaN(t)?j.nan:j.number;case"boolean":return j.boolean;case"function":return j.function;case"bigint":return j.bigint;case"symbol":return j.symbol;case"object":return Array.isArray(t)?j.array:null===t?j.null:t.then&&"function"==typeof t.then&&t.catch&&"function"==typeof t.catch?j.promise:"u">typeof Map&&t instanceof Map?j.map:"u">typeof Set&&t instanceof Set?j.set:"u">typeof Date&&t instanceof Date?j.date:j.object;default:return j.unknown}},R=qy.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),D=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class A extends Error{constructor(t){super(),this.issues=[],this.addIssue=t=>{this.issues=[...this.issues,t]},this.addIssues=(t=[])=>{this.issues=[...this.issues,...t]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let n=t||function(t){return t.message},r={_errors:[]},i=t=>{for(let o of t.issues)if("invalid_union"===o.code)o.unionErrors.map(i);else if("invalid_return_type"===o.code)i(o.returnTypeError);else if("invalid_arguments"===o.code)i(o.argumentsError);else if(0===o.path.length)r._errors.push(n(o));else{let a=r,u=0;for(;u<o.path.length;){let s=o.path[u];u===o.path.length-1?(a[s]=a[s]||{_errors:[]},a[s]._errors.push(n(o))):a[s]=a[s]||{_errors:[]},a=a[s],u++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,qy.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(t=t=>t.message){let n={},r=[];for(let i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}A.create=t=>new A(t);let L=(t,n)=>{let r;switch(t.code){case R.invalid_type:r=t.received===j.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case R.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,qy.jsonStringifyReplacer)}`;break;case R.unrecognized_keys:r=`Unrecognized key(s) in object: ${qy.joinValues(t.keys,", ")}`;break;case R.invalid_union:r="Invalid input";break;case R.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${qy.joinValues(t.options)}`;break;case R.invalid_enum_value:r=`Invalid enum value. Expected ${qy.joinValues(t.options)}, received '${t.received}'`;break;case R.invalid_arguments:r="Invalid function arguments";break;case R.invalid_return_type:r="Invalid function return type";break;case R.invalid_date:r="Invalid date";break;case R.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:qy.assertNever(t.validation):r="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case R.too_small:r="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case R.too_big:r="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case R.custom:r="Invalid input";break;case R.invalid_intersection_types:r="Intersection results could not be merged";break;case R.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case R.not_finite:r="Number must be finite";break;default:r=n.defaultError,qy.assertNever(t)}return{message:r}},P=L;function F(t){P=t}function z(){return P}let U=t=>{let{data:n,path:r,errorMaps:i,issueData:o}=t,a=[...r,...o.path||[]],u={...o,path:a},s="",c=i.filter(t=>!!t).slice().reverse();for(let l of c)s=l(u,{data:n,defaultError:s}).message;return{...o,path:a,message:o.message||s}};function W(t,n){let r=U({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,P,L].filter(t=>!!t)});t.common.issues.push(r)}class B{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(t,n){let r=[];for(let i of n){if("aborted"===i.status)return V;"dirty"===i.status&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){let r=[];for(let i of n)r.push({key:await i.key,value:await i.value});return B.mergeObjectSync(t,r)}static mergeObjectSync(t,n){let r={};for(let i of n){let{key:o,value:a}=i;if("aborted"===o.status||"aborted"===a.status)return V;"dirty"===o.status&&t.dirty(),"dirty"===a.status&&t.dirty(),("u">typeof a.value||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}let V=Object.freeze({status:"aborted"}),$=t=>({status:"dirty",value:t}),K=t=>({status:"valid",value:t}),Y=t=>"aborted"===t.status,q=t=>"dirty"===t.status,G=t=>"valid"===t.status,Z=t=>"u">typeof Promise&&t instanceof Promise;(tV=qb||(qb={})).errToObj=t=>"string"==typeof t?{message:t}:t||{},tV.toString=t=>"string"==typeof t?t:null==t?void 0:t.message;class Q{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let H=(t,n)=>{if(G(n))return{success:!0,data:n.value};if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new A(t.common.issues);return this._error=r,this._error}}};function J(t){if(!t)return{};let{errorMap:n,invalid_type_error:r,required_error:i,description:o}=t;if(n&&(r||i))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return n?{errorMap:n,description:o}:{errorMap:(t,n)=>"invalid_type"!==t.code?{message:n.defaultError}:typeof n.data>"u"?{message:i??n.defaultError}:{message:r??n.defaultError},description:o}}class X{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return E(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:E(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new B,ctx:{common:t.parent.common,data:t.data,parsedType:E(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(Z(n))throw Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;let i={common:{issues:[],async:null!==(r=null==n?void 0:n.async)&&void 0!==r&&r,contextualErrorMap:null==n?void 0:n.errorMap},path:(null==n?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:E(t)},o=this._parseSync({data:t,path:i.path,parent:i});return H(i,o)}async parseAsync(t,n){let r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){let r={common:{issues:[],contextualErrorMap:null==n?void 0:n.errorMap,async:!0},path:(null==n?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:E(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await (Z(i)?i:Promise.resolve(i));return H(r,o)}refine(t,n){let r=t=>"string"==typeof n||typeof n>"u"?{message:n}:"function"==typeof n?n(t):n;return this._refinement((n,i)=>{let o=t(n),a=()=>i.addIssue({code:R.custom,...r(n)});return"u">typeof Promise&&o instanceof Promise?o.then(t=>!!t||(a(),!1)):!!o||(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>!!t(r)||(i.addIssue("function"==typeof n?n(r,i):n),!1))}_refinement(t){return new eU({schema:this,typeName:qx.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return eW.create(this,this._def)}nullable(){return eB.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return eS.create(this,this._def)}promise(){return ez.create(this,this._def)}or(t){return e_.create([this,t],this._def)}and(t){return ek.create(this,t,this._def)}transform(t){return new eU({...J(this._def),schema:this,typeName:qx.ZodEffects,effect:{type:"transform",transform:t}})}default(t){return new eV({...J(this._def),innerType:this,defaultValue:"function"==typeof t?t:()=>t,typeName:qx.ZodDefault})}brand(){return new eq({typeName:qx.ZodBranded,type:this,...J(this._def)})}catch(t){return new e$({...J(this._def),innerType:this,catchValue:"function"==typeof t?t:()=>t,typeName:qx.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return eG.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let ee=/^c[^\s-]{8,}$/i,et=/^[a-z][a-z0-9]*$/,en=/[0-9A-HJKMNP-TV-Z]{26}/,er=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,ei=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/,eo=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,ea=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,eu=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,es=t=>t.precision?t.offset?RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):0===t.precision?t.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function ec(t,n){return!!(("v4"===n||!n)&&ea.test(t)||("v6"===n||!n)&&eu.test(t))}class el extends X{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(n=>t.test(n),{validation:n,code:R.invalid_string,...qb.errToObj(r)}),this.nonempty=t=>this.min(1,qb.errToObj(t)),this.trim=()=>new el({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new el({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new el({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==j.string){let n=this._getOrReturnCtx(t);return W(n,{code:R.invalid_type,expected:j.string,received:n.parsedType}),V}let r=new B,i;for(let o of this._def.checks)if("min"===o.kind)t.data.length<o.value&&(W(i=this._getOrReturnCtx(t,i),{code:R.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if("max"===o.kind)t.data.length>o.value&&(W(i=this._getOrReturnCtx(t,i),{code:R.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if("length"===o.kind){let a=t.data.length>o.value,u=t.data.length<o.value;(a||u)&&(i=this._getOrReturnCtx(t,i),a?W(i,{code:R.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&W(i,{code:R.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if("email"===o.kind)ei.test(t.data)||(W(i=this._getOrReturnCtx(t,i),{validation:"email",code:R.invalid_string,message:o.message}),r.dirty());else if("emoji"===o.kind)eo.test(t.data)||(W(i=this._getOrReturnCtx(t,i),{validation:"emoji",code:R.invalid_string,message:o.message}),r.dirty());else if("uuid"===o.kind)er.test(t.data)||(W(i=this._getOrReturnCtx(t,i),{validation:"uuid",code:R.invalid_string,message:o.message}),r.dirty());else if("cuid"===o.kind)ee.test(t.data)||(W(i=this._getOrReturnCtx(t,i),{validation:"cuid",code:R.invalid_string,message:o.message}),r.dirty());else if("cuid2"===o.kind)et.test(t.data)||(W(i=this._getOrReturnCtx(t,i),{validation:"cuid2",code:R.invalid_string,message:o.message}),r.dirty());else if("ulid"===o.kind)en.test(t.data)||(W(i=this._getOrReturnCtx(t,i),{validation:"ulid",code:R.invalid_string,message:o.message}),r.dirty());else if("url"===o.kind)try{new URL(t.data)}catch{W(i=this._getOrReturnCtx(t,i),{validation:"url",code:R.invalid_string,message:o.message}),r.dirty()}else"regex"===o.kind?(o.regex.lastIndex=0,o.regex.test(t.data)||(W(i=this._getOrReturnCtx(t,i),{validation:"regex",code:R.invalid_string,message:o.message}),r.dirty())):"trim"===o.kind?t.data=t.data.trim():"includes"===o.kind?t.data.includes(o.value,o.position)||(W(i=this._getOrReturnCtx(t,i),{code:R.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):"toLowerCase"===o.kind?t.data=t.data.toLowerCase():"toUpperCase"===o.kind?t.data=t.data.toUpperCase():"startsWith"===o.kind?t.data.startsWith(o.value)||(W(i=this._getOrReturnCtx(t,i),{code:R.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):"endsWith"===o.kind?t.data.endsWith(o.value)||(W(i=this._getOrReturnCtx(t,i),{code:R.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):"datetime"===o.kind?es(o).test(t.data)||(W(i=this._getOrReturnCtx(t,i),{code:R.invalid_string,validation:"datetime",message:o.message}),r.dirty()):"ip"===o.kind?ec(t.data,o.version)||(W(i=this._getOrReturnCtx(t,i),{validation:"ip",code:R.invalid_string,message:o.message}),r.dirty()):qy.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new el({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...qb.errToObj(t)})}url(t){return this._addCheck({kind:"url",...qb.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...qb.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...qb.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...qb.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...qb.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...qb.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...qb.errToObj(t)})}datetime(t){var n;return"string"==typeof t?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(null==t?void 0:t.precision)>"u"?null:null==t?void 0:t.precision,offset:null!==(n=null==t?void 0:t.offset)&&void 0!==n&&n,...qb.errToObj(null==t?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...qb.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:null==n?void 0:n.position,...qb.errToObj(null==n?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...qb.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...qb.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...qb.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...qb.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...qb.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>"datetime"===t.kind)}get isEmail(){return!!this._def.checks.find(t=>"email"===t.kind)}get isURL(){return!!this._def.checks.find(t=>"url"===t.kind)}get isEmoji(){return!!this._def.checks.find(t=>"emoji"===t.kind)}get isUUID(){return!!this._def.checks.find(t=>"uuid"===t.kind)}get isCUID(){return!!this._def.checks.find(t=>"cuid"===t.kind)}get isCUID2(){return!!this._def.checks.find(t=>"cuid2"===t.kind)}get isULID(){return!!this._def.checks.find(t=>"ulid"===t.kind)}get isIP(){return!!this._def.checks.find(t=>"ip"===t.kind)}get minLength(){let t=null;for(let n of this._def.checks)"min"===n.kind&&(null===t||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return t}}function ef(t,n){let r=(t.toString().split(".")[1]||"").length,i=(n.toString().split(".")[1]||"").length,o=r>i?r:i,a=parseInt(t.toFixed(o).replace(".","")),u=parseInt(n.toFixed(o).replace(".",""));return a%u/Math.pow(10,o)}el.create=t=>{var n;return new el({checks:[],typeName:qx.ZodString,coerce:null!==(n=null==t?void 0:t.coerce)&&void 0!==n&&n,...J(t)})};class ed extends X{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==j.number){let n=this._getOrReturnCtx(t);return W(n,{code:R.invalid_type,expected:j.number,received:n.parsedType}),V}let r,i=new B;for(let o of this._def.checks)"int"===o.kind?qy.isInteger(t.data)||(W(r=this._getOrReturnCtx(t,r),{code:R.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):"min"===o.kind?(o.inclusive?t.data<o.value:t.data<=o.value)&&(W(r=this._getOrReturnCtx(t,r),{code:R.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):"max"===o.kind?(o.inclusive?t.data>o.value:t.data>=o.value)&&(W(r=this._getOrReturnCtx(t,r),{code:R.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):"multipleOf"===o.kind?0!==ef(t.data,o.value)&&(W(r=this._getOrReturnCtx(t,r),{code:R.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):"finite"===o.kind?Number.isFinite(t.data)||(W(r=this._getOrReturnCtx(t,r),{code:R.not_finite,message:o.message}),i.dirty()):qy.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,qb.toString(n))}gt(t,n){return this.setLimit("min",t,!1,qb.toString(n))}lte(t,n){return this.setLimit("max",t,!0,qb.toString(n))}lt(t,n){return this.setLimit("max",t,!1,qb.toString(n))}setLimit(t,n,r,i){return new ed({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:qb.toString(i)}]})}_addCheck(t){return new ed({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:qb.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:qb.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:qb.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:qb.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:qb.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:qb.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:qb.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:qb.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:qb.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)"min"===n.kind&&(null===t||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>"int"===t.kind||"multipleOf"===t.kind&&qy.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===n||r.value>n)&&(n=r.value):"max"===r.kind&&(null===t||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}ed.create=t=>new ed({checks:[],typeName:qx.ZodNumber,coerce:(null==t?void 0:t.coerce)||!1,...J(t)});class ep extends X{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==j.bigint){let n=this._getOrReturnCtx(t);return W(n,{code:R.invalid_type,expected:j.bigint,received:n.parsedType}),V}let r,i=new B;for(let o of this._def.checks)"min"===o.kind?(o.inclusive?t.data<o.value:t.data<=o.value)&&(W(r=this._getOrReturnCtx(t,r),{code:R.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):"max"===o.kind?(o.inclusive?t.data>o.value:t.data>=o.value)&&(W(r=this._getOrReturnCtx(t,r),{code:R.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):"multipleOf"===o.kind?t.data%o.value!==BigInt(0)&&(W(r=this._getOrReturnCtx(t,r),{code:R.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):qy.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,qb.toString(n))}gt(t,n){return this.setLimit("min",t,!1,qb.toString(n))}lte(t,n){return this.setLimit("max",t,!0,qb.toString(n))}lt(t,n){return this.setLimit("max",t,!1,qb.toString(n))}setLimit(t,n,r,i){return new ep({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:qb.toString(i)}]})}_addCheck(t){return new ep({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:qb.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:qb.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:qb.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:qb.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:qb.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)"min"===n.kind&&(null===t||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return t}}ep.create=t=>{var n;return new ep({checks:[],typeName:qx.ZodBigInt,coerce:null!==(n=null==t?void 0:t.coerce)&&void 0!==n&&n,...J(t)})};class eh extends X{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==j.boolean){let n=this._getOrReturnCtx(t);return W(n,{code:R.invalid_type,expected:j.boolean,received:n.parsedType}),V}return K(t.data)}}eh.create=t=>new eh({typeName:qx.ZodBoolean,coerce:(null==t?void 0:t.coerce)||!1,...J(t)});class em extends X{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==j.date){let n=this._getOrReturnCtx(t);return W(n,{code:R.invalid_type,expected:j.date,received:n.parsedType}),V}if(isNaN(t.data.getTime())){let r=this._getOrReturnCtx(t);return W(r,{code:R.invalid_date}),V}let i=new B,o;for(let a of this._def.checks)"min"===a.kind?t.data.getTime()<a.value&&(W(o=this._getOrReturnCtx(t,o),{code:R.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),i.dirty()):"max"===a.kind?t.data.getTime()>a.value&&(W(o=this._getOrReturnCtx(t,o),{code:R.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),i.dirty()):qy.assertNever(a);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new em({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:qb.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:qb.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)"min"===n.kind&&(null===t||n.value>t)&&(t=n.value);return null!=t?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)"max"===n.kind&&(null===t||n.value<t)&&(t=n.value);return null!=t?new Date(t):null}}em.create=t=>new em({checks:[],coerce:(null==t?void 0:t.coerce)||!1,typeName:qx.ZodDate,...J(t)});class eg extends X{_parse(t){if(this._getType(t)!==j.symbol){let n=this._getOrReturnCtx(t);return W(n,{code:R.invalid_type,expected:j.symbol,received:n.parsedType}),V}return K(t.data)}}eg.create=t=>new eg({typeName:qx.ZodSymbol,...J(t)});class ey extends X{_parse(t){if(this._getType(t)!==j.undefined){let n=this._getOrReturnCtx(t);return W(n,{code:R.invalid_type,expected:j.undefined,received:n.parsedType}),V}return K(t.data)}}ey.create=t=>new ey({typeName:qx.ZodUndefined,...J(t)});class ev extends X{_parse(t){if(this._getType(t)!==j.null){let n=this._getOrReturnCtx(t);return W(n,{code:R.invalid_type,expected:j.null,received:n.parsedType}),V}return K(t.data)}}ev.create=t=>new ev({typeName:qx.ZodNull,...J(t)});class eb extends X{constructor(){super(...arguments),this._any=!0}_parse(t){return K(t.data)}}eb.create=t=>new eb({typeName:qx.ZodAny,...J(t)});class ex extends X{constructor(){super(...arguments),this._unknown=!0}_parse(t){return K(t.data)}}ex.create=t=>new ex({typeName:qx.ZodUnknown,...J(t)});class eM extends X{_parse(t){let n=this._getOrReturnCtx(t);return W(n,{code:R.invalid_type,expected:j.never,received:n.parsedType}),V}}eM.create=t=>new eM({typeName:qx.ZodNever,...J(t)});class eT extends X{_parse(t){if(this._getType(t)!==j.undefined){let n=this._getOrReturnCtx(t);return W(n,{code:R.invalid_type,expected:j.void,received:n.parsedType}),V}return K(t.data)}}eT.create=t=>new eT({typeName:qx.ZodVoid,...J(t)});class eS extends X{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==j.array)return W(n,{code:R.invalid_type,expected:j.array,received:n.parsedType}),V;if(null!==i.exactLength){let o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(W(n,{code:o?R.too_big:R.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(null!==i.minLength&&n.data.length<i.minLength.value&&(W(n,{code:R.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),null!==i.maxLength&&n.data.length>i.maxLength.value&&(W(n,{code:R.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((t,r)=>i.type._parseAsync(new Q(n,t,n.path,r)))).then(t=>B.mergeArray(r,t));let u=[...n.data].map((t,r)=>i.type._parseSync(new Q(n,t,n.path,r)));return B.mergeArray(r,u)}get element(){return this._def.type}min(t,n){return new eS({...this._def,minLength:{value:t,message:qb.toString(n)}})}max(t,n){return new eS({...this._def,maxLength:{value:t,message:qb.toString(n)}})}length(t,n){return new eS({...this._def,exactLength:{value:t,message:qb.toString(n)}})}nonempty(t){return this.min(1,t)}}eS.create=(t,n)=>new eS({type:t,minLength:null,maxLength:null,exactLength:null,typeName:qx.ZodArray,...J(n)});class ew extends X{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let t=this._def.shape(),n=qy.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==j.object){let n=this._getOrReturnCtx(t);return W(n,{code:R.invalid_type,expected:j.object,received:n.parsedType}),V}let{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof eM&&"strip"===this._def.unknownKeys))for(let s in i.data)a.includes(s)||u.push(s);let c=[];for(let l of a){let f=o[l],d=i.data[l];c.push({key:{status:"valid",value:l},value:f._parse(new Q(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof eM){let p=this._def.unknownKeys;if("passthrough"===p)for(let h of u)c.push({key:{status:"valid",value:h},value:{status:"valid",value:i.data[h]}});else if("strict"===p)u.length>0&&(W(i,{code:R.unrecognized_keys,keys:u}),r.dirty());else if("strip"!==p)throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let g of u){let y=i.data[g];c.push({key:{status:"valid",value:g},value:m._parse(new Q(i,y,i.path,g)),alwaysSet:g in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let t=[];for(let n of c){let r=await n.key;t.push({key:r,value:await n.value,alwaysSet:n.alwaysSet})}return t}).then(t=>B.mergeObjectSync(r,t)):B.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return qb.errToObj,new ew({...this._def,unknownKeys:"strict",...void 0!==t?{errorMap:(n,r)=>{var i,o,a,u;let s=null!==(a=null===(o=(i=this._def).errorMap)||void 0===o?void 0:o.call(i,n,r).message)&&void 0!==a?a:r.defaultError;return"unrecognized_keys"===n.code?{message:null!==(u=qb.errToObj(t).message)&&void 0!==u?u:s}:{message:s}}}:{}})}strip(){return new ew({...this._def,unknownKeys:"strip"})}passthrough(){return new ew({...this._def,unknownKeys:"passthrough"})}extend(t){return new ew({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ew({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:qx.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new ew({...this._def,catchall:t})}pick(t){let n={};return qy.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new ew({...this._def,shape:()=>n})}omit(t){let n={};return qy.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new ew({...this._def,shape:()=>n})}deepPartial(){return function t(n){if(!(n instanceof ew))return n instanceof eS?new eS({...n._def,type:t(n.element)}):n instanceof eW?eW.create(t(n.unwrap())):n instanceof eB?eB.create(t(n.unwrap())):n instanceof eC?eC.create(n.items.map(n=>t(n))):n;{let r={};for(let i in n.shape){let o=n.shape[i];r[i]=eW.create(t(o))}return new ew({...n._def,shape:()=>r})}}(this)}partial(t){let n={};return qy.objectKeys(this.shape).forEach(r=>{let i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new ew({...this._def,shape:()=>n})}required(t){let n={};return qy.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof eW;)i=i._def.innerType;n[r]=i}}),new ew({...this._def,shape:()=>n})}keyof(){return eL(qy.objectKeys(this.shape))}}ew.create=(t,n)=>new ew({shape:()=>t,unknownKeys:"strip",catchall:eM.create(),typeName:qx.ZodObject,...J(n)}),ew.strictCreate=(t,n)=>new ew({shape:()=>t,unknownKeys:"strict",catchall:eM.create(),typeName:qx.ZodObject,...J(n)}),ew.lazycreate=(t,n)=>new ew({shape:t,unknownKeys:"strip",catchall:eM.create(),typeName:qx.ZodObject,...J(n)});class e_ extends X{_parse(t){let{ctx:n}=this._processInputParams(t),r=this._def.options;if(n.common.async)return Promise.all(r.map(async t=>{let r={...n,common:{...n.common,issues:[]},parent:null};return{result:await t._parseAsync({data:n.data,path:n.path,parent:r}),ctx:r}})).then(function(t){for(let r of t)if("valid"===r.result.status)return r.result;for(let i of t)if("dirty"===i.result.status)return n.common.issues.push(...i.ctx.common.issues),i.result;let o=t.map(t=>new A(t.ctx.common.issues));return W(n,{code:R.invalid_union,unionErrors:o}),V});{let i,o=[];for(let a of r){let u={...n,common:{...n.common,issues:[]},parent:null},s=a._parseSync({data:n.data,path:n.path,parent:u});if("valid"===s.status)return s;"dirty"!==s.status||i||(i={result:s,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let c=o.map(t=>new A(t));return W(n,{code:R.invalid_union,unionErrors:c}),V}}get options(){return this._def.options}}e_.create=(t,n)=>new e_({options:t,typeName:qx.ZodUnion,...J(n)});let eI=t=>t instanceof eD?eI(t.schema):t instanceof eU?eI(t.innerType()):t instanceof eA?[t.value]:t instanceof eP?t.options:t instanceof eF?Object.keys(t.enum):t instanceof eV?eI(t._def.innerType):t instanceof ey?[void 0]:t instanceof ev?[null]:null;class eO extends X{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==j.object)return W(n,{code:R.invalid_type,expected:j.object,received:n.parsedType}),V;let r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(W(n,{code:R.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),V)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let o of n){let a=eI(o.shape[t]);if(!a)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let u of a){if(i.has(u))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);i.set(u,o)}}return new eO({typeName:qx.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...J(r)})}}class ek extends X{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=(t,i)=>{if(Y(t)||Y(i))return V;let o=function t(n,r){let i=E(n),o=E(r);if(n===r)return{valid:!0,data:n};if(i===j.object&&o===j.object){let a=qy.objectKeys(r),u=qy.objectKeys(n).filter(t=>-1!==a.indexOf(t)),s={...n,...r};for(let c of u){let l=t(n[c],r[c]);if(!l.valid)return{valid:!1};s[c]=l.data}return{valid:!0,data:s}}if(i!==j.array||o!==j.array)return i===j.date&&o===j.date&&+n==+r?{valid:!0,data:n}:{valid:!1};{if(n.length!==r.length)return{valid:!1};let f=[];for(let d=0;d<n.length;d++){let p=n[d],h=r[d],m=t(p,h);if(!m.valid)return{valid:!1};f.push(m.data)}return{valid:!0,data:f}}}(t.value,i.value);return o.valid?((q(t)||q(i))&&n.dirty(),{status:n.value,value:o.data}):(W(r,{code:R.invalid_intersection_types}),V)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([t,n])=>i(t,n)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ek.create=(t,n,r)=>new ek({left:t,right:n,typeName:qx.ZodIntersection,...J(r)});class eC extends X{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==j.array)return W(r,{code:R.invalid_type,expected:j.array,received:r.parsedType}),V;if(r.data.length<this._def.items.length)return W(r,{code:R.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),V;!this._def.rest&&r.data.length>this._def.items.length&&(W(r,{code:R.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...r.data].map((t,n)=>{let i=this._def.items[n]||this._def.rest;return i?i._parse(new Q(r,t,r.path,n)):null}).filter(t=>!!t);return r.common.async?Promise.all(i).then(t=>B.mergeArray(n,t)):B.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new eC({...this._def,rest:t})}}eC.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new eC({items:t,typeName:qx.ZodTuple,rest:null,...J(n)})};class eN extends X{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==j.object)return W(r,{code:R.invalid_type,expected:j.object,received:r.parsedType}),V;let i=[],o=this._def.keyType,a=this._def.valueType;for(let u in r.data)i.push({key:o._parse(new Q(r,u,r.path,u)),value:a._parse(new Q(r,r.data[u],r.path,u))});return r.common.async?B.mergeObjectAsync(n,i):B.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return new eN(n instanceof X?{keyType:t,valueType:n,typeName:qx.ZodRecord,...J(r)}:{keyType:el.create(),valueType:t,typeName:qx.ZodRecord,...J(n)})}}class ej extends X{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==j.map)return W(r,{code:R.invalid_type,expected:j.map,received:r.parsedType}),V;let i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([t,n],a)=>({key:i._parse(new Q(r,t,r.path,[a,"key"])),value:o._parse(new Q(r,n,r.path,[a,"value"]))}));if(r.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let t of a){let r=await t.key,i=await t.value;if("aborted"===r.status||"aborted"===i.status)return V;("dirty"===r.status||"dirty"===i.status)&&n.dirty(),u.set(r.value,i.value)}return{status:n.value,value:u}})}{let s=new Map;for(let c of a){let l=c.key,f=c.value;if("aborted"===l.status||"aborted"===f.status)return V;("dirty"===l.status||"dirty"===f.status)&&n.dirty(),s.set(l.value,f.value)}return{status:n.value,value:s}}}}ej.create=(t,n,r)=>new ej({valueType:n,keyType:t,typeName:qx.ZodMap,...J(r)});class eE extends X{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==j.set)return W(r,{code:R.invalid_type,expected:j.set,received:r.parsedType}),V;let i=this._def;null!==i.minSize&&r.data.size<i.minSize.value&&(W(r,{code:R.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),null!==i.maxSize&&r.data.size>i.maxSize.value&&(W(r,{code:R.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());let o=this._def.valueType;function a(t){let r=new Set;for(let i of t){if("aborted"===i.status)return V;"dirty"===i.status&&n.dirty(),r.add(i.value)}return{status:n.value,value:r}}let u=[...r.data.values()].map((t,n)=>o._parse(new Q(r,t,r.path,n)));return r.common.async?Promise.all(u).then(t=>a(t)):a(u)}min(t,n){return new eE({...this._def,minSize:{value:t,message:qb.toString(n)}})}max(t,n){return new eE({...this._def,maxSize:{value:t,message:qb.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}eE.create=(t,n)=>new eE({valueType:t,minSize:null,maxSize:null,typeName:qx.ZodSet,...J(n)});class eR extends X{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==j.function)return W(n,{code:R.invalid_type,expected:j.function,received:n.parsedType}),V;function r(t,r){return U({data:t,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,P,L].filter(t=>!!t),issueData:{code:R.invalid_arguments,argumentsError:r}})}function i(t,r){return U({data:t,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,P,L].filter(t=>!!t),issueData:{code:R.invalid_return_type,returnTypeError:r}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof ez?K(async(...t)=>{let n=new A([]),u=await this._def.args.parseAsync(t,o).catch(i=>{throw n.addIssue(r(t,i)),n}),s=await a(...u);return await this._def.returns._def.type.parseAsync(s,o).catch(t=>{throw n.addIssue(i(s,t)),n})}):K((...t)=>{let n=this._def.args.safeParse(t,o);if(!n.success)throw new A([r(t,n.error)]);let u=a(...n.data),s=this._def.returns.safeParse(u,o);if(!s.success)throw new A([i(u,s.error)]);return s.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new eR({...this._def,args:eC.create(t).rest(ex.create())})}returns(t){return new eR({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new eR({args:t||eC.create([]).rest(ex.create()),returns:n||ex.create(),typeName:qx.ZodFunction,...J(r)})}}class eD extends X{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}eD.create=(t,n)=>new eD({getter:t,typeName:qx.ZodLazy,...J(n)});class eA extends X{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return W(n,{received:n.data,code:R.invalid_literal,expected:this._def.value}),V}return{status:"valid",value:t.data}}get value(){return this._def.value}}function eL(t,n){return new eP({values:t,typeName:qx.ZodEnum,...J(n)})}eA.create=(t,n)=>new eA({value:t,typeName:qx.ZodLiteral,...J(n)});class eP extends X{_parse(t){if("string"!=typeof t.data){let n=this._getOrReturnCtx(t),r=this._def.values;return W(n,{expected:qy.joinValues(r),received:n.parsedType,code:R.invalid_type}),V}if(-1===this._def.values.indexOf(t.data)){let i=this._getOrReturnCtx(t),o=this._def.values;return W(i,{received:i.data,code:R.invalid_enum_value,options:o}),V}return K(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t){return eP.create(t)}exclude(t){return eP.create(this.options.filter(n=>!t.includes(n)))}}eP.create=eL;class eF extends X{_parse(t){let n=qy.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==j.string&&r.parsedType!==j.number){let i=qy.objectValues(n);return W(r,{expected:qy.joinValues(i),received:r.parsedType,code:R.invalid_type}),V}if(-1===n.indexOf(t.data)){let o=qy.objectValues(n);return W(r,{received:r.data,code:R.invalid_enum_value,options:o}),V}return K(t.data)}get enum(){return this._def.values}}eF.create=(t,n)=>new eF({values:t,typeName:qx.ZodNativeEnum,...J(n)});class ez extends X{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==j.promise&&!1===n.common.async)return W(n,{code:R.invalid_type,expected:j.promise,received:n.parsedType}),V;let r=n.parsedType===j.promise?n.data:Promise.resolve(n.data);return K(r.then(t=>this._def.type.parseAsync(t,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ez.create=(t,n)=>new ez({type:t,typeName:qx.ZodPromise,...J(n)});class eU extends X{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===qx.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null;if("preprocess"===i.type){let o=i.transform(r.data);return r.common.async?Promise.resolve(o).then(t=>this._def.schema._parseAsync({data:t,path:r.path,parent:r})):this._def.schema._parseSync({data:o,path:r.path,parent:r})}let a={addIssue(t){W(r,t),t.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),"refinement"===i.type){let u=t=>{let n=i.refinement(t,a);if(r.common.async)return Promise.resolve(n);if(n instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return t};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(t=>"aborted"===t.status?V:("dirty"===t.status&&n.dirty(),u(t.value).then(()=>({status:n.value,value:t.value}))));{let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===s.status?V:("dirty"===s.status&&n.dirty(),u(s.value),{status:n.value,value:s.value})}}if("transform"===i.type){if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(t=>G(t)?Promise.resolve(i.transform(t.value,a)).then(t=>({status:n.value,value:t})):t);{let c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!G(c))return c;let l=i.transform(c.value,a);if(l instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}}qy.assertNever(i)}}eU.create=(t,n,r)=>new eU({schema:t,typeName:qx.ZodEffects,effect:n,...J(r)}),eU.createWithPreprocess=(t,n,r)=>new eU({schema:n,effect:{type:"preprocess",transform:t},typeName:qx.ZodEffects,...J(r)});class eW extends X{_parse(t){return this._getType(t)===j.undefined?K(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}eW.create=(t,n)=>new eW({innerType:t,typeName:qx.ZodOptional,...J(n)});class eB extends X{_parse(t){return this._getType(t)===j.null?K(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}eB.create=(t,n)=>new eB({innerType:t,typeName:qx.ZodNullable,...J(n)});class eV extends X{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===j.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}eV.create=(t,n)=>new eV({innerType:t,typeName:qx.ZodDefault,defaultValue:"function"==typeof n.default?n.default:()=>n.default,...J(n)});class e$ extends X{_parse(t){let{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Z(i)?i.then(t=>({status:"valid",value:"valid"===t.status?t.value:this._def.catchValue({get error(){return new A(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new A(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}e$.create=(t,n)=>new e$({innerType:t,typeName:qx.ZodCatch,catchValue:"function"==typeof n.catch?n.catch:()=>n.catch,...J(n)});class eK extends X{_parse(t){if(this._getType(t)!==j.nan){let n=this._getOrReturnCtx(t);return W(n,{code:R.invalid_type,expected:j.nan,received:n.parsedType}),V}return{status:"valid",value:t.data}}}eK.create=t=>new eK({typeName:qx.ZodNaN,...J(t)});let eY=Symbol("zod_brand");class eq extends X{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class eG extends X{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let t=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===t.status?V:"dirty"===t.status?(n.dirty(),$(t.value)):this._def.out._parseAsync({data:t.value,path:r.path,parent:r})})();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===i.status?V:"dirty"===i.status?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new eG({in:t,out:n,typeName:qx.ZodPipeline})}}let eZ=(t,n={},r)=>t?eb.create().superRefine((i,o)=>{var a,u;if(!t(i)){let s="function"==typeof n?n(i):"string"==typeof n?{message:n}:n,c=null===(u=null!==(a=s.fatal)&&void 0!==a?a:r)||void 0===u||u;o.addIssue({code:"custom",..."string"==typeof s?{message:s}:s,fatal:c})}}):eb.create(),eQ={object:ew.lazycreate};(t$=qx||(qx={})).ZodString="ZodString",t$.ZodNumber="ZodNumber",t$.ZodNaN="ZodNaN",t$.ZodBigInt="ZodBigInt",t$.ZodBoolean="ZodBoolean",t$.ZodDate="ZodDate",t$.ZodSymbol="ZodSymbol",t$.ZodUndefined="ZodUndefined",t$.ZodNull="ZodNull",t$.ZodAny="ZodAny",t$.ZodUnknown="ZodUnknown",t$.ZodNever="ZodNever",t$.ZodVoid="ZodVoid",t$.ZodArray="ZodArray",t$.ZodObject="ZodObject",t$.ZodUnion="ZodUnion",t$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t$.ZodIntersection="ZodIntersection",t$.ZodTuple="ZodTuple",t$.ZodRecord="ZodRecord",t$.ZodMap="ZodMap",t$.ZodSet="ZodSet",t$.ZodFunction="ZodFunction",t$.ZodLazy="ZodLazy",t$.ZodLiteral="ZodLiteral",t$.ZodEnum="ZodEnum",t$.ZodEffects="ZodEffects",t$.ZodNativeEnum="ZodNativeEnum",t$.ZodOptional="ZodOptional",t$.ZodNullable="ZodNullable",t$.ZodDefault="ZodDefault",t$.ZodCatch="ZodCatch",t$.ZodPromise="ZodPromise",t$.ZodBranded="ZodBranded",t$.ZodPipeline="ZodPipeline";let eH=(t,n={message:`Input not instance of ${t.name}`})=>eZ(n=>n instanceof t,n),eJ=el.create,eX=ed.create,e0=eK.create,e1=ep.create,e2=eh.create,e4=em.create,e3=eg.create,e5=ey.create,e9=ev.create,e8=eb.create,e6=ex.create,e7=eM.create,te=eT.create,tt=eS.create,tn=ew.create,tr=ew.strictCreate,ti=e_.create,to=eO.create,ta=ek.create,tu=eC.create,ts=eN.create,tc=ej.create,tl=eE.create,tf=eR.create,td=eD.create,tp=eA.create,th=eP.create,tm=eF.create,tg=ez.create,ty=eU.create,tv=eW.create,tb=eB.create,tx=eU.createWithPreprocess,tM=eG.create,tT=()=>eJ().optional(),tS=()=>eX().optional(),tw=()=>e2().optional();var t_=Object.freeze({__proto__:null,defaultErrorMap:L,setErrorMap:F,getErrorMap:z,makeIssue:U,EMPTY_PATH:[],addIssueToContext:W,ParseStatus:B,INVALID:V,DIRTY:$,OK:K,isAborted:Y,isDirty:q,isValid:G,isAsync:Z,get util(){return qy},get objectUtil(){return qv},ZodParsedType:j,getParsedType:E,ZodType:X,ZodString:el,ZodNumber:ed,ZodBigInt:ep,ZodBoolean:eh,ZodDate:em,ZodSymbol:eg,ZodUndefined:ey,ZodNull:ev,ZodAny:eb,ZodUnknown:ex,ZodNever:eM,ZodVoid:eT,ZodArray:eS,ZodObject:ew,ZodUnion:e_,ZodDiscriminatedUnion:eO,ZodIntersection:ek,ZodTuple:eC,ZodRecord:eN,ZodMap:ej,ZodSet:eE,ZodFunction:eR,ZodLazy:eD,ZodLiteral:eA,ZodEnum:eP,ZodNativeEnum:eF,ZodPromise:ez,ZodEffects:eU,ZodTransformer:eU,ZodOptional:eW,ZodNullable:eB,ZodDefault:eV,ZodCatch:e$,ZodNaN:eK,BRAND:eY,ZodBranded:eq,ZodPipeline:eG,custom:eZ,Schema:X,ZodSchema:X,late:eQ,get ZodFirstPartyTypeKind(){return qx},coerce:{string:t=>el.create({...t,coerce:!0}),number:t=>ed.create({...t,coerce:!0}),boolean:t=>eh.create({...t,coerce:!0}),bigint:t=>ep.create({...t,coerce:!0}),date:t=>em.create({...t,coerce:!0})},any:e8,array:tt,bigint:e1,boolean:e2,date:e4,discriminatedUnion:to,effect:ty,enum:th,function:tf,instanceof:eH,intersection:ta,lazy:td,literal:tp,map:tc,nan:e0,nativeEnum:tm,never:e7,null:e9,nullable:tb,number:eX,object:tn,oboolean:tw,onumber:tS,optional:tv,ostring:tT,pipeline:tM,preprocess:tx,promise:tg,record:ts,set:tl,strictObject:tr,string:eJ,symbol:e3,transformer:ty,tuple:tu,undefined:e5,union:ti,unknown:e6,void:te,NEVER:V,ZodIssueCode:R,quotelessJson:D,ZodError:A});let tI=(0,o.createContext)(void 0);function tO(){let t=(0,o.useContext)(tI);if(!t)throw Error("Missing EditorConfigContext.Provider");return t}class tk extends Error{}function tC(t){throw new tk(`Missing EditorConfig.${t}`)}let tN=tn({id:eJ(),kind:eJ(),extension:eJ(),filename:eJ(),width:eX().optional(),height:eX().optional(),last_modified:eX(),url:eJ(),alt:eJ().optional(),size:eX()}),tj=tn({total:eX(),cursor:eJ().optional(),items:tt(tN)});function tE(t,n,r,i="all",o){let a=new URLSearchParams({assetType:i,limit:"30",...o&&{cursor:o}});return(0,f.WY)(`${t}?${a.toString()}`,{headers:{repository:n},credentials:(0,f.xb)(r),okType:tj})}function tR(t){let{assetType:n}=t,r=tO(),[i,a]=(0,o.useState)(),[u,s]=(0,o.useState)([]),[c,l]=(0,o.useState)(u);r.mediaLibrary||tC("mediaLibrary");let{assetsUrl:f,repository:p}=r,h=(0,d.QT)(tE,[f,p,r.env,n,i]);return c!==h.items&&(l(h.items),s(t=>[...t,...h.items])),{media:u,limit:30,onHasReachedBottom:function(){0!==h.total&&a(h.cursor)},response:h,updateMedia:function(t){let o=[...t,...u];s([]),(0,d.VA)(tE,[f,p,r.env,n,i],{total:o.length,items:o,cursor:void 0})}}}d.Fs.registerFetcherConfig(tE,{cacheCapacity:100,revalidationStrategy:{type:"never"}});let tD=(0,o.createContext)(void 0);function tA(t){let{children:n,assetType:r="all"}=t,[i,a]=(0,o.useState)(new Set),[u,s]=(0,o.useTransition)(),{media:c,onHasReachedBottom:l}=tR({assetType:r});return k.jsx(tD.Provider,{value:{isFetchingMedia:u,media:c,selectedMediaIds:i,onScrollToBottom:function(){s(l)}},children:n})}function tL(){let t=(0,o.useContext)(tD);if(!t)throw Error("useMediaLibrary must be used within a MediaLibraryProvider");return t}function tP(){let{isFetchingMedia:t}=tL();return k.jsx(u.FN,{anchor:k.jsx(u.xu,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),loadingIndicator:!0,open:t,title:"Loading more media ...",seconds:1})}function tF(){let{onScrollToBottom:t,media:n}=tL();return k.jsx(u.xr,{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 250px), 1fr))",gap:16,paddingBottom:16,position:"relative"},onScrollToBottom:t,treshold:500,children:null==n?void 0:n.map(t=>k.jsx(u.PB,{...t},t.id))})}function tz(){return k.jsxs(u.xu,{display:"grid",alignItems:"center",gridColumn:"1fr",gridTemplateRows:"1fr 1fr 1fr",children:[k.jsx(u.xu,{gridColumn:"1",gridRow:"1 / 3",children:k.jsx(u.Ee,{sizing:"contain",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzODUiIGhlaWdodD0iNDg1IiB2aWV3Qm94PSIwIDAgMzg1IDQ4NSIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00MTMuNTQgNDUuNjA4NEw0MDQuNjMzIDUwLjc1NDZMMzE3LjUyIDAuNDc5NDkySDMxNS4zNDFMNDAzLjU0MyA1MS4zODM5TDI5My4yNCAxMTUuMTFMMTgyLjUwNyA1MS4yMDI5TDI3MC4zMDQgMC40Nzk0OTJIMjY4LjEyNkwxODEuNDE4IDUwLjU3NDFMOTQuNjE3OSAwLjQ3OTQ5Mkg5Mi40MzgyTDE4MC4zMjggNTEuMjAzNEw3MC4wMjUxIDExNC45M0wtNDAuNzA4MSA1MS4wMjI0TDQ2Ljc3NjMgMC40Nzk0OTJINDQuNTk4M0wtNDEuNzk3NiA1MC4zOTM1TC01MC41NjA1IDQ1LjMzNjJWNDYuNTk0MkwtNDIuODg2OSA1MS4wMjI5TC01MC41NjA1IDU1LjQ1NjJWNTYuNzE0NUwtNDEuNzk3MyA1MS42NTE3TDY4LjkzNTggMTE1LjU1OUwtNDEuMzY3NSAxNzkuMjg1TC01MC41NjA1IDE3My45OFYxNzUuMjM4TC00Mi40NTY4IDE3OS45MTRMLTUwLjU2MDUgMTg0LjU5NlYxODUuODU1TC00MS4zNjcyIDE4MC41NDNMNjkuMzY1OSAyNDQuNDUxTC00MC45MzczIDMwOC4xNzdMLTUwLjU2MDUgMzAyLjYyM1YzMDMuODgxTC00Mi4wMjY2IDMwOC44MDZMLTUwLjU2MDUgMzEzLjczNlYzMTQuOTk1TC00MC45MzcgMzA5LjQzNUw2OS43OTYxIDM3My4zNDJMLTQwLjUwNzEgNDM3LjA2OEwtNTAuNTYwNSA0MzEuMjY2VjQzMi41MjRMLTQxLjU5NjQgNDM3LjY5OEwtNTAuNTYwNSA0NDIuODc2VjQ0NC4xMzVMLTQwLjUwNjkgNDM4LjMyNkwzOS4wNTgyIDQ4NC4yNDZINDEuMjM3OUwtMzkuNDE3NiA0MzcuNjk3TDcwLjg4NTYgMzczLjk3MUwxODEuNjE5IDQzNy44NzhMMTAxLjM2MiA0ODQuMjQ2SDEwMy41MzlMMTgyLjcwOCA0MzguNTA3TDI2MS45NiA0ODQuMjQ2SDI2NC4xNEwxODMuNzk4IDQzNy44NzhMMjk0LjEwMSAzNzQuMTUxTDQxMy41NCA0NDMuMDgzVjQ0MS44MjVMMjk1LjE5IDM3My41MjJMNDA1LjQ5MyAzMDkuNzk2TDQxMy41NCAzMTQuNDRWMzEzLjE4Mkw0MDYuNTgzIDMwOS4xNjdMNDEzLjU0IDMwNS4xNDdWMzAzLjg4OUw0MDUuNDkzIDMwOC41MzhMMjk0Ljc2IDI0NC42MzFMNDA1LjA2MyAxODAuOTA0TDQxMy41NCAxODUuNzk3VjE4NC41MzlMNDA2LjE1MiAxODAuMjc1TDQxMy41NCAxNzYuMDA3VjE3NC43NDlMNDA1LjA2MyAxNzkuNjQ2TDI5NC4zMyAxMTUuNzM5TDQwNC42MzMgNTIuMDEyN0w0MTMuNTQgNTcuMTUzM1Y1NS44OTU0TDQwNS43MjIgNTEuMzgzNUw0MTMuNTQgNDYuODY2OFY0NS42MDg0Wk0yOTIuMTUxIDExNS43MzlMMTgxLjg0OCAxNzkuNDY2TDcxLjExNDYgMTE1LjU1OEwxODEuNDE4IDUxLjgzMjJMMjkyLjE1MSAxMTUuNzM5Wk03MC4wMjU0IDExNi4xODhMMTgwLjc1OCAxODAuMDk1TDcwLjQ1NTIgMjQzLjgyMUwtNDAuMjc3OSAxNzkuOTE0TDcwLjAyNTQgMTE2LjE4OFpNMTgxLjg0OCAxODAuNzI0TDcxLjU0NDggMjQ0LjQ1TDE4Mi4yNzggMzA4LjM1N0wyOTIuNTgxIDI0NC42MzFMMTgxLjg0OCAxODAuNzI0Wk0tMzkuODQ3NyAzMDguODA2TDcwLjQ1NTUgMjQ1LjA3OUwxODEuMTg5IDMwOC45ODdMNzAuODg1NCAzNzIuNzEzTC0zOS44NDc3IDMwOC44MDZaTTE4Mi4yNzggMzA5LjYxNUwyOTMuMDExIDM3My41MjNMMTgyLjcwOCA0MzcuMjQ5TDcxLjk3NDkgMzczLjM0MkwxODIuMjc4IDMwOS42MTVaTTQwNC40MDQgMzA5LjE2N0wyOTMuNjcxIDI0NS4yNkwxODMuMzY3IDMwOC45ODZMMjk0LjEgMzcyLjg5M0w0MDQuNDA0IDMwOS4xNjdaTTE4Mi45MzcgMTgwLjA5NEwyOTMuNjcgMjQ0LjAwMkw0MDMuOTc0IDE4MC4yNzZMMjkzLjI0MSAxMTYuMzY4TDE4Mi45MzcgMTgwLjA5NFoiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl8xNjYyMF82NjEzKSIvPgogIDxwYXRoIGQ9Ik00MTMuNTQgNDQ1LjA3N1Y0NDMuODE5TDM0My41NjYgNDg0LjI0NkgzNDUuNzQ0TDQxMy41NCA0NDUuMDc3WiIgZmlsbD0idXJsKCNwYWludDFfbGluZWFyXzE2NjIwXzY2MTMpIi8+CiAgPGRlZnM+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfMTY2MjBfNjYxMyIgeDE9IjE4MS40OSIgeTE9IjAuNDc5NDkyIiB4Mj0iMTgxIiB5Mj0iNjI0IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CiAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiNFREVDRUUiIHN0b3Atb3BhY2l0eT0iMCIvPgogICAgICA8c3RvcCBvZmZzZXQ9IjAuNTQzMDM1IiBzdG9wLWNvbG9yPSIjRURFQ0VFIi8+CiAgICAgIDxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0VERUNFRSIgc3RvcC1vcGFjaXR5PSIwIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDFfbGluZWFyXzE2NjIwXzY2MTMiIHgxPSIxODEuNDkiIHkxPSIwLjQ3OTQ5MiIgeDI9IjE4MSIgeTI9IjYyNCIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgogICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjRURFQ0VFIiBzdG9wLW9wYWNpdHk9IjAiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIwLjU0MzAzNSIgc3RvcC1jb2xvcj0iI0VERUNFRSIvPgogICAgICA8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNFREVDRUUiIHN0b3Atb3BhY2l0eT0iMCIvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICA8L2RlZnM+Cjwvc3ZnPg==",alt:"media placeholder"})}),k.jsx(u.xu,{gridColumn:"1",gridRow:"1",flexDirection:"column",justifyContent:"end",height:"100%",padding:16,children:k.jsx(u.Ee,{sizing:"contain",src:"data:image/svg+xml;base64,Cjxzdmcgd2lkdGg9IjM0NSIgaGVpZ2h0PSIxMjMiIHZpZXdCb3g9IjAgMCAzNDUgMTIzIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8ZyBvcGFjaXR5PSIwLjYiPgo8ZWxsaXBzZSBjeD0iMTcyLjUiIGN5PSI3Mi41IiByeD0iMTcyLjUiIHJ5PSI1MC41IiBmaWxsPSIjNkY2RTc3Ii8+CjxwYXRoIGQ9Ik0zNDQuNSA2MkMzNDQuNSA2OC4zNjc0IDMzOS44NTcgNzQuNTUwNCAzMzEuMTY5IDgwLjI2NjFDMzIyLjUwMiA4NS45Njg0IDMwOS45MjYgOTEuMTIyOSAyOTQuMzQyIDk1LjQ1OTRDMjYzLjE4IDEwNC4xMyAyMjAuMTAzIDEwOS41IDE3Mi41IDEwOS41QzEyNC44OTcgMTA5LjUgODEuODE5NiAxMDQuMTMgNTAuNjU4MSA5NS40NTk0QzM1LjA3MzkgOTEuMTIyOSAyMi40OTg0IDg1Ljk2ODQgMTMuODMwNyA4MC4yNjYxQzUuMTQyODIgNzQuNTUwNCAwLjUgNjguMzY3NCAwLjUgNjJDMC41IDU1LjYzMjYgNS4xNDI4MiA0OS40NDk2IDEzLjgzMDcgNDMuNzMzOUMyMi40OTg0IDM4LjAzMTYgMzUuMDczOSAzMi44NzcxIDUwLjY1ODEgMjguNTQwNkM4MS44MTk2IDE5Ljg2OTUgMTI0Ljg5NyAxNC41IDE3Mi41IDE0LjVDMjIwLjEwMyAxNC41IDI2My4xOCAxOS44Njk1IDI5NC4zNDIgMjguNTQwNkMzMDkuOTI2IDMyLjg3NzEgMzIyLjUwMiAzOC4wMzE2IDMzMS4xNjkgNDMuNzMzOUMzMzkuODU3IDQ5LjQ0OTYgMzQ0LjUgNTUuNjMyNiAzNDQuNSA2MloiIGZpbGw9IiNGNEYyRjQiIHN0cm9rZT0iIzZGNkU3NyIvPgo8bWFzayBpZD0icGF0aC0zLWluc2lkZS0xXzE2NjIwXzY2MTciIGZpbGw9IndoaXRlIj4KPHBhdGggZD0iTTEzOS40OTQgOTMuODI0Mkw2Mi4yNCA0OS4yMjE1VjU3LjA4NjJMMTM5LjQ5NCAxMDEuNjg5VjkzLjgyNDJaIi8+CjwvbWFzaz4KPHBhdGggZD0iTTEzOS40OTQgOTMuODI0Mkw2Mi4yNCA0OS4yMjE1VjU3LjA4NjJMMTM5LjQ5NCAxMDEuNjg5VjkzLjgyNDJaIiBmaWxsPSIjNkY2RTc3Ii8+CjxwYXRoIGQ9Ik02Mi4yNCA1Ny4wODYyVjU4LjIwMTNMNjEuMjc0NCA1Ny42NDM3VjU2LjUyODdMNjIuMjQgNTcuMDg2MlpNMTM5LjQ5NCAxMDEuNjg5TDE0MC40NiAxMDIuMjQ2VjEwMy4zNjFMMTM5LjQ5NCAxMDIuODA0VjEwMS42ODlaTTYzLjIwNTcgNDkuNzc5MVY1Ny42NDM3TDYxLjI3NDQgNTYuNTI4N1Y0OC42NjRMNjMuMjA1NyA0OS43NzkxWk02Mi4yNCA1NS45NzExTDEzOS40OTQgMTAwLjU3NFYxMDIuODA0TDYyLjI0IDU4LjIwMTNWNTUuOTcxMVpNMTM4LjUyOCAxMDEuMTMxTDEzOC41MjggOTMuMjY2N0wxNDAuNDYgOTQuMzgxOFYxMDIuMjQ2TDEzOC41MjggMTAxLjEzMVoiIGZpbGw9IiM2RjZFNzciIG1hc2s9InVybCgjcGF0aC0zLWluc2lkZS0xXzE2NjIwXzY2MTcpIi8+CjxyZWN0IHk9IjAuNTU3NTM0IiB3aWR0aD0iNjEuMzI4NyIgaGVpZ2h0PSI4OC4wOTAzIiB0cmFuc2Zvcm09Im1hdHJpeCgtMC44NjYwMjUgMC41IDAuODY2MDI1IDAuNSAxMTUuNTk1IDE4LjI3ODgpIiBmaWxsPSIjRjRGMkY0IiBzdHJva2U9IiM2RjZFNzciIHN0cm9rZS13aWR0aD0iMS4xMTUwNyIvPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDBfMTY2MjBfNjYxNykiPgo8cGF0aCBkPSJNMTUyLjU0MyA3MC4zMjk1TDE2OS4zNTMgNjAuNDI4OEwxNzIuNzQ5IDYyLjM0OTlMMTU1LjkzOSA3Mi4yNTA2TDE1Mi41NDMgNzAuMzI5NVpNMTI4Ljg3NCA2OC41ODUzTDE1NS43NjkgNTIuNzQ0MkwxNTkuMTY1IDU0LjY2NTNMMTMyLjI3IDcwLjUwNjRMMTI4Ljg3NCA2OC41ODUzWk0xNjUuOTU3IDU4LjUwNzZMMTM5LjA2MiA3NC4zNDg3TDEzNS42NjYgNzIuNDI3NkwxNjIuNTYxIDU2LjU4NjVMMTY1Ljk1NyA1OC41MDc2Wk0xNDguOTc3IDQ4LjkwMTlMMTUyLjM3MyA1MC44MjNMMTI1LjQ3OCA2Ni42NjQxTDEyMi4wODIgNjQuNzQzTDE0OC45NzcgNDguOTAxOVoiIGZpbGw9IiM2RjZFNzciLz4KPC9nPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDFfMTY2MjBfNjYxNykiPgo8cGF0aCBkPSJNMTcyLjI1MyA2MS44MTUyTDE2OS4zNTYgNjAuMTc1OEwxNTMuMDM5IDY5Ljc4NjFMMTU1LjkzNyA3MS40MjU0TDE3Mi4yNTMgNjEuODE1MlpNMTU4LjY3IDU0LjEzMDZMMTU1Ljc3MiA1Mi40OTEyTDEyOS4zNyA2OC4wNDE5TDEzMi4yNjggNjkuNjgxMkwxNTguNjcgNTQuMTMwNlpNMTM2LjE2MiA3MS44ODQyTDEzOS4wNiA3My41MjM1TDE2NS40NjIgNTcuOTcyOUwxNjIuNTY0IDU2LjMzMzVMMTM2LjE2MiA3MS44ODQyWk0xMjUuNDc2IDY1LjgzODlMMTUxLjg3OCA1MC4yODgzTDE0OC45OCA0OC42NDg5TDEyMi41NzggNjQuMTk5NkwxMjUuNDc2IDY1LjgzODlaIiBmaWxsPSIjRjRGMkY0IiBzdHJva2U9IiM2RjZFNzciIHN0cm9rZS13aWR0aD0iMC41NzIzMzUiLz4KPC9nPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDJfMTY2MjBfNjYxNykiPgo8cGF0aCBkPSJNMTI0LjgxNiA1NC45NTU5TDE0MS42MjUgNDUuMDU1MkwxNDUuMDIxIDQ2Ljk3NjRMMTI4LjIxMiA1Ni44NzcxTDEyNC44MTYgNTQuOTU1OVpNMTAxLjE0NiA1My4yMTE3TDEyOC4wNDEgMzcuMzcwNkwxMzEuNDM3IDM5LjI5MThMMTA0LjU0MiA1NS4xMzI5TDEwMS4xNDYgNTMuMjExN1pNMTM4LjIyOSA0My4xMzQxTDExMS4zMzQgNTguOTc1MkwxMDcuOTM4IDU3LjA1NEwxMzQuODMzIDQxLjIxMjlMMTM4LjIyOSA0My4xMzQxWk0xMjEuMjUgMzMuNTI4M0wxMjQuNjQ1IDM1LjQ0OTVMOTcuNzUwNCA1MS4yOTA2TDk0LjM1NDQgNDkuMzY5NEwxMjEuMjUgMzMuNTI4M1oiIGZpbGw9IiM2RjZFNzciLz4KPC9nPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDNfMTY2MjBfNjYxNykiPgo8cGF0aCBkPSJNMTQ0LjUyNSA0Ni40Mzc3TDE0MS42MjggNDQuNzk4NEwxMjUuMzExIDU0LjQwODZMMTI4LjIwOSA1Ni4wNDhMMTQ0LjUyNSA0Ni40Mzc3Wk0xMzAuOTQyIDM4Ljc1MzFMMTI4LjA0NCAzNy4xMTM4TDEwMS42NDIgNTIuNjY0NEwxMDQuNTQgNTQuMzAzOEwxMzAuOTQyIDM4Ljc1MzFaTTEwOC40MzQgNTYuNTA2N0wxMTEuMzMyIDU4LjE0NjFMMTM3LjczNCA0Mi41OTU0TDEzNC44MzYgNDAuOTU2MUwxMDguNDM0IDU2LjUwNjdaTTk3Ljc0NzkgNTAuNDYxNUwxMjQuMTUgMzQuOTEwOEwxMjEuMjUyIDMzLjI3MTVMOTQuODUwMSA0OC44MjIxTDk3Ljc0NzkgNTAuNDYxNVoiIGZpbGw9IiNGNEYyRjQiIHN0cm9rZT0iIzZGNkU3NyIgc3Ryb2tlLXdpZHRoPSIwLjU3MjMzNSIvPgo8L2c+CjxyZWN0IHg9Ii0wLjQ4MjgzOCIgeT0iMC44MzYzIiB3aWR0aD0iNjEuMjA2IiBoZWlnaHQ9IjQuNjAxMDkiIHRyYW5zZm9ybT0ibWF0cml4KC0wLjg2NjAyNSAwLjUgMCAxIDE5Mi40MzEgNjIuODQzNSkiIGZpbGw9IiM2RjZFNzciIHN0cm9rZT0iIzZGNkU3NyIgc3Ryb2tlLXdpZHRoPSIxLjExNTA3Ii8+CjxtYXNrIGlkPSJwYXRoLTExLWluc2lkZS0yXzE2NjIwXzY2MTciIGZpbGw9IndoaXRlIj4KPHBhdGggZD0iTTIzOS4yNTQgOTQuNjU3MkwxNjIgNDUuNDQ3NVY1My4xNDgxTDIzOS4yNTQgMTAyLjM1OFY5NC42NTcyWiIvPgo8L21hc2s+CjxwYXRoIGQ9Ik0yMzkuMjU0IDk0LjY1NzJMMTYyIDQ1LjQ0NzVWNTMuMTQ4MUwyMzkuMjU0IDEwMi4zNThWOTQuNjU3MloiIGZpbGw9IiNGNEYyRjQiLz4KPHBhdGggZD0iTTE2MiA1My4xNDgxVjU0LjI2MzJMMTYxLjA2IDUzLjY2NDFWNTIuNTQ5MUwxNjIgNTMuMTQ4MVpNMjM5LjI1NCAxMDIuMzU4TDI0MC4xOTUgMTAyLjk1N1YxMDQuMDcyTDIzOS4yNTQgMTAzLjQ3M1YxMDIuMzU4Wk0xNjIuOTQxIDQ2LjA0NjZWNTMuNzQ3MkwxNjEuMDYgNTIuNTQ5MVY0NC44NDg1TDE2Mi45NDEgNDYuMDQ2NlpNMTYyIDUyLjAzMzFMMjM5LjI1NCAxMDEuMjQzVjEwMy40NzNMMTYyIDU0LjI2MzJWNTIuMDMzMVpNMjM4LjMxNCAxMDEuNzU5Vjk0LjA1ODJMMjQwLjE5NSA5NS4yNTYzVjEwMi45NTdMMjM4LjMxNCAxMDEuNzU5WiIgZmlsbD0iIzZGNkU3NyIgbWFzaz0idXJsKCNwYXRoLTExLWluc2lkZS0yXzE2NjIwXzY2MTcpIi8+CjxyZWN0IHk9IjAuNTk5MDY4IiB3aWR0aD0iNjMuMDAyIiBoZWlnaHQ9IjkwLjQ4MDgiIHRyYW5zZm9ybT0ibWF0cml4KC0wLjg0MzQyNCAwLjUzNzI0OCAwLjg0MzQyNCAwLjUzNzI0OCAyMTUuNjQ3IDExLjI3NzIpIiBmaWxsPSIjRjRGMkY0IiBzdHJva2U9IiM2RjZFNzciIHN0cm9rZS13aWR0aD0iMS4xMTUwNyIvPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDRfMTY2MjBfNjYxNykiPgo8cGF0aCBkPSJNMjAwLjgyNCA0My40NzQ2TDIwNy4xMSAzOS40MTQ1TDIwNy4wOTggMzcuNDA1N0wyMTEuODEyIDM0LjM2MDdDMjEyLjY3NyAzMy44MDI1IDIxNC4wODggMzMuNzk4IDIxNC45NTggMzQuMzQ0NUwyMjQuNDYxIDQwLjMwMkMyMjUuMzMxIDQwLjg0ODYgMjI1LjMzNiA0MS43NTI1IDIyNC40NzIgNDIuMzEwOEwyMTEuMjk2IDUwLjgyMTZDMjEwLjc2MiA1MS4xNjY3IDIwOS44ODcgNTEuMTY3NiAyMDkuMzU3IDUwLjgzNDdMMjAwLjgzNSA0NS40ODMzQzE5OS45NjUgNDQuOTM2OCAxOTkuOTYgNDQuMDMyOCAyMDAuODI0IDQzLjQ3NDZaTTIxMC4zMTkgNDkuNDM3MUwyMjIuODkgNDEuMzE3TDIxMy4zOTUgMzUuMzU0NUwyMDkuMzMzIDM3Ljk3ODNMMjA5LjM0NCAzOS45ODdMMjAyLjQwNyA0NC40NjgzTDIxMC4zMTkgNDkuNDM3MVpNMjA3LjUzNCA0Mi45MjExTDIxNC4xMTYgMzguODkzNEwyMTQuOTg5IDM4LjM1N0wyMDcuMDk4IDQzLjIwNzNMMjA3LjUzNCA0Mi45MjExWk0yMTMuODMgNDMuNDkzNUwyMTguMTUzIDQwLjYzMThMMjE4LjE1MyA0MC4zNDQ1TDIxMy4yNTcgNDMuMjA3M0wyMTMuODMgNDMuNDkzNVoiIGZpbGw9IiM2RjZFNzciLz4KPC9nPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDVfMTY2MjBfNjYxNykiPgo8cGF0aCBkPSJNMjA3LjQ1IDM4Ljg2OTdMMjA3LjQ1MSAzOC45NTk4TDIwNy4zNTEgMzkuMDI0MUwyMDEuMDY2IDQzLjA4NDJDMjAwLjMzNCA0My41NTY2IDIwMC4zMzkgNDQuMzIyOSAyMDEuMDc1IDQ0Ljc4NTVMMjA5LjU5NyA1MC4xMzY5QzIwOS45OTUgNTAuMzg2NiAyMTAuNjU0IDUwLjM4NTUgMjExLjA1NCA1MC4xMjdMMjI0LjIzIDQxLjYxNjJDMjI0Ljk2MSA0MS4xNDM3IDIyNC45NTcgNDAuMzc3NSAyMjQuMjIgMzkuOTE0OUMyMjQuMjIgMzkuOTE0OSAyMjQuMjIgMzkuOTE0OSAyMjQuMjIgMzkuOTE0OUwyMTQuNzE4IDMzLjk1NzVMMjE0LjcxNyAzMy45NTc0QzIxMy45NzkgMzMuNDkzOSAyMTIuNzg0IDMzLjQ5ODkgMjEyLjA1NCAzMy45NzAzTDIwNy40NCAzNi45NTFMMjA3LjQ1IDM4Ljg2OTdaTTIxMC41NjEgNDkuMDQ2N0wyMTAuMzIgNDkuMjAyMUwyMTAuMDc4IDQ5LjA1TDIwMi4xNjYgNDQuMDgxMkwyMDEuOTIzIDQzLjkyOTFMMjAyLjE2NCA0My43NzM3TDIwOS4wMDIgMzkuMzU2OEwyMDguOTkxIDM3LjQzODFMMjA4Ljk5MSAzNy4zNDhMMjA5LjA5IDM3LjI4MzdMMjEzLjE1MiAzNC42NTk5TDIxMy4zOTMgMzQuNTA0NUwyMTMuNjM1IDM0LjY1NjZMMjIzLjEzIDQwLjYxOTJMMjIzLjM3MiA0MC43NzEzTDIyMy4xMzEgNDAuOTI2NkwyMTAuNTYxIDQ5LjA0NjdaTTIwNy4xNDEgNDQuNTkwOUwyMTYuMDg4IDM4LjgxMTVMMjE0Ljk5IDM4LjEyMkwyMDYuMDQzIDQzLjkwMTNMMjA3LjE0MSA0NC41OTA5Wk0yMTkuMjUzIDQwLjc5OUwyMTguMTU1IDQwLjEwOTVMMjEyLjM1IDQzLjg1ODhMMjEzLjQ0OCA0NC41NDg0TDIxOS4yNTMgNDAuNzk5WiIgZmlsbD0iI0Y0RjJGNCIgc3Ryb2tlPSIjNkY2RTc3IiBzdHJva2Utd2lkdGg9IjAuNTcyMzM1Ii8+CjwvZz4KPHJlY3QgeD0iLTAuNDcwMjM3IiB5PSIwLjg1NzA2OCIgd2lkdGg9IjYyLjg3NjEiIGhlaWdodD0iNi43NDA5MiIgdHJhbnNmb3JtPSJtYXRyaXgoLTAuODQzNDI0IDAuNTM3MjQ4IDAgMSAyOTIuMjI1IDYwLjQ2MjYpIiBmaWxsPSIjNkY2RTc3IiBzdHJva2U9IiM2RjZFNzciIHN0cm9rZS13aWR0aD0iMS4xMTUwNyIvPgo8bWFzayBpZD0icGF0aC0xNy1pbnNpZGUtM18xNjYyMF82NjE3IiBmaWxsPSJ3aGl0ZSI+CjxwYXRoIGQ9Ik0xNDIuNjQ4IDEwMC40MDFMMjA5LjQyIDM1Ljk4MzVMMjEwLjc3OCA0My40MjI5TDE0NC4wMDYgMTA3Ljg0TDE0Mi42NDggMTAwLjQwMVoiLz4KPC9tYXNrPgo8cGF0aCBkPSJNMTQyLjY0OCAxMDAuNDAxTDIwOS40MiAzNS45ODM1TDIxMC43NzggNDMuNDIyOUwxNDQuMDA2IDEwNy44NEwxNDIuNjQ4IDEwMC40MDFaIiBmaWxsPSIjRjRGMkY0Ii8+CjxwYXRoIGQ9Ik0yMTAuNzc4IDQzLjQyMjlMMjEwLjk3OCA0NC41MTk4TDIxMS43ODEgNDMuNzQ1NkwyMTEuNTggNDIuNjQ4N0wyMTAuNzc4IDQzLjQyMjlaTTE0NC4wMDYgMTA3Ljg0TDE0My4yMDMgMTA4LjYxNEwxNDMuNDA0IDEwOS43MTFMMTQ0LjIwNiAxMDguOTM3TDE0NC4wMDYgMTA3Ljg0Wk0yMDguNjE3IDM2Ljc1NzdMMjA5Ljk3NSA0NC4xOTcxTDIxMS41OCA0Mi42NDg3TDIxMC4yMjIgMzUuMjA5M0wyMDguNjE3IDM2Ljc1NzdaTTIxMC41NzggNDIuMzI1OUwxNDMuODA2IDEwNi43NDNMMTQ0LjIwNiAxMDguOTM3TDIxMC45NzggNDQuNTE5OEwyMTAuNTc4IDQyLjMyNTlaTTE0NC44MDggMTA3LjA2NkwxNDMuNDUgOTkuNjI2N0wxNDEuODQ1IDEwMS4xNzVMMTQzLjIwMyAxMDguNjE0TDE0NC44MDggMTA3LjA2NloiIGZpbGw9IiM2RjZFNzciIG1hc2s9InVybCgjcGF0aC0xNy1pbnNpZGUtM18xNjYyMF82NjE3KSIvPgo8cmVjdCB4PSIwLjExMDg4NiIgeT0iMC42MDc0NjkiIHdpZHRoPSI2My44MzA4IiBoZWlnaHQ9IjkxLjY2NDgiIHRyYW5zZm9ybT0ibWF0cml4KDAuOTE4NTY5IDAuMzk1MjYxIC0wLjcxOTY4MiAwLjY5NDMwNCAxNTAuNDQ1IDEwLjQxMDQpIiBmaWxsPSIjRjRGMkY0IiBzdHJva2U9IiM2RjZFNzciIHN0cm9rZS13aWR0aD0iMS4xMTUwNyIvPgo8ZyBjbGlwLXBhdGg9InVybCgjY2xpcDZfMTY2MjBfNjYxNykiPgo8cGF0aCBkPSJNMTcyLjUyMiAzNy42MjM3TDE2Mi44ODIgNDYuNzUyMUwxNTAuNzcxIDQxLjQwODNMMTYwLjQxMSAzMi4yNzk5TDE3Mi41MjIgMzcuNjIzN1pNMTczLjg5OSAzNi4zMTk2TDE2MS43ODkgMzAuOTc1OEMxNjAuODM3IDMwLjU1NTkgMTU5LjQzOSAzMC43OTkyIDE1OC42ODEgMzEuNTE2NUwxNDkuMDQxIDQwLjY0NDlDMTQ4LjI4NCA0MS4zNjIxIDE0OC40NDMgNDIuMjkyNSAxNDkuMzk0IDQyLjcxMjRMMTYxLjUwNSA0OC4wNTYyQzE2Mi40NTYgNDguNDc2IDE2My44NTQgNDguMjMyNyAxNjQuNjEyIDQ3LjUxNTVMMTc0LjI1MiAzOC4zODcxQzE3NS4wMSAzNy42Njk4IDE3NC44NTEgMzYuNzM5NSAxNzMuODk5IDM2LjMxOTZaIiBmaWxsPSIjNkY2RTc3Ii8+CjxwYXRoIGQ9Ik0xNTguMTY2IDQxLjI4NTNMMTYzLjMyIDQwLjA3OUwxNjMuMzk2IDQ0LjczNTRMMTUyLjgwNyA0MC4wNjMyTDE1Ny45NTYgMzguODYzTDE1OC4xNjYgNDEuMjg1M1oiIGZpbGw9IiM2RjZFNzciLz4KPHBhdGggZD0iTTE3Mi43MzggMzcuMTk5N0wxNzIuOTQ0IDM3LjAwNUwxNzIuNjggMzYuODg4NEwxNjAuNTY5IDMxLjU0NDdMMTYwLjMwNSAzMS40MjgxTDE2MC4xIDMxLjYyMjhMMTUwLjQ1OSA0MC43NTEyTDE1MC4yNTQgNDAuOTQ1OUwxNTAuNTE4IDQxLjA2MjVMMTYyLjYyOCA0Ni40MDYzTDE2Mi44OTMgNDYuNTIyOEwxNjMuMDk4IDQ2LjMyODFMMTcyLjczOCAzNy4xOTk3Wk0xNTMuNzA0IDM5Ljk4NTdMMTU3Ljg5MiAzOC44OTIxTDE1Ny45NTIgNDEuMTExTDE1Ny45NiA0MS4zOThMMTU4LjM3MyA0MS4yODk4TDE2My4xOTkgNDAuMDI1MUwxNjMuMDMgNDQuMTAwOUwxNTMuNzA0IDM5Ljk4NTdaTTE2MS41MzUgMzAuNjNMMTczLjY0NiAzNS45NzM4QzE3NC40NDYgMzYuMzI2OCAxNzQuNTg4IDM3LjExNjEgMTczLjk0IDM3LjczTDE2NC4zIDQ2Ljg1ODRDMTYzLjY1MiA0Ny40NzIzIDE2Mi40NjMgNDcuNjc0IDE2MS42NjIgNDcuMzIwOUwxNDkuNTUyIDQxLjk3NzFDMTQ4Ljc1MiA0MS42MjQxIDE0OC42MDkgNDAuODM0OCAxNDkuMjU3IDQwLjIyMDlMMTU4Ljg5OCAzMS4wOTI1QzE1OS41NDYgMzAuNDc4NiAxNjAuNzM1IDMwLjI3NjkgMTYxLjUzNSAzMC42M1oiIGZpbGw9IiNGNEYyRjQiIHN0cm9rZT0iIzZGNkU3NyIgc3Ryb2tlLXdpZHRoPSIwLjU3MjMzNSIvPgo8L2c+CjxyZWN0IHg9IjAuNjEyMjUiIHk9IjAuNzY4ODQyIiB3aWR0aD0iNjMuNzAzMyIgaGVpZ2h0PSI2LjYwOTUiIHRyYW5zZm9ybT0ibWF0cml4KDAuOTE4NTY5IDAuMzk1MjYxIDAuMTc5NTcxIDAuOTgzNzQ1IDgzLjEzODQgNzQuNDU3KSIgZmlsbD0iIzZGNkU3NyIgc3Ryb2tlPSIjNkY2RTc3IiBzdHJva2Utd2lkdGg9IjEuMTE1MDciLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF8xNjYyMF82NjE3Ij4KPHJlY3Qgd2lkdGg9IjQ2LjgyMDMiIGhlaWdodD0iNDYuODIwMyIgZmlsbD0id2hpdGUiIHRyYW5zZm9ybT0ibWF0cml4KC0wLjg2MTY0NyAwLjUwNzUwOCAwLjg3MDM3NSAwLjQ5MjM4OSAxNDcuMjExIDQwLjEzOTIpIi8+CjwvY2xpcFBhdGg+CjxjbGlwUGF0aCBpZD0iY2xpcDFfMTY2MjBfNjYxNyI+CjxyZWN0IHdpZHRoPSI0Ni44MjAzIiBoZWlnaHQ9IjQ2LjgyMDMiIGZpbGw9IndoaXRlIiB0cmFuc2Zvcm09Im1hdHJpeCgtMC44NjE2NDcgMC41MDc1MDggMC44NzAzNzUgMC40OTIzODkgMTQ3LjIxMSAzOS42MDAxKSIvPgo8L2NsaXBQYXRoPgo8Y2xpcFBhdGggaWQ9ImNsaXAyXzE2NjIwXzY2MTciPgo8cmVjdCB3aWR0aD0iNDYuODIwMyIgaGVpZ2h0PSI0Ni44MjAzIiBmaWxsPSJ3aGl0ZSIgdHJhbnNmb3JtPSJtYXRyaXgoLTAuODYxNjQ3IDAuNTA3NTA4IDAuODcwMzc1IDAuNDkyMzg5IDExOS40ODMgMjQuNzY1NikiLz4KPC9jbGlwUGF0aD4KPGNsaXBQYXRoIGlkPSJjbGlwM18xNjYyMF82NjE3Ij4KPHJlY3Qgd2lkdGg9IjQ2LjgyMDMiIGhlaWdodD0iNDYuODIwMyIgZmlsbD0id2hpdGUiIHRyYW5zZm9ybT0ibWF0cml4KC0wLjg2MTY0NyAwLjUwNzUwOCAwLjg3MDM3NSAwLjQ5MjM4OSAxMTkuNDgzIDI0LjIyMjcpIi8+CjwvY2xpcFBhdGg+CjxjbGlwUGF0aCBpZD0iY2xpcDRfMTY2MjBfNjYxNyI+CjxyZWN0IHdpZHRoPSIyMi40MzU4IiBoZWlnaHQ9IjIyLjQzNTgiIGZpbGw9IndoaXRlIiB0cmFuc2Zvcm09Im1hdHJpeCgtMC44NDA0NTQgMC41NDI4ODkgMC44NDY0MDIgMC41MzE1MiAyMTEuNzkgMzAuOTE1NSkiLz4KPC9jbGlwUGF0aD4KPGNsaXBQYXRoIGlkPSJjbGlwNV8xNjYyMF82NjE3Ij4KPHJlY3Qgd2lkdGg9IjIyLjQzNTgiIGhlaWdodD0iMjIuNDM1OCIgZmlsbD0id2hpdGUiIHRyYW5zZm9ybT0ibWF0cml4KC0wLjg0MDQ1NCAwLjU0Mjg4OSAwLjg0NjQwMiAwLjUzMTUyIDIxMS43OSAyOS44MDAzKSIvPgo8L2NsaXBQYXRoPgo8Y2xpcFBhdGggaWQ9ImNsaXA2XzE2NjIwXzY2MTciPgo8cmVjdCB3aWR0aD0iMjIuNDkyMSIgaGVpZ2h0PSIyMy4wMDIiIGZpbGw9IndoaXRlIiB0cmFuc2Zvcm09Im1hdHJpeCgwLjkyMzAzNSAwLjQwNzI4OSAtMC43MTg0NjcgMC42ODAzMjEgMTU5LjQ4MSAyNi41NzA4KSIvPgo8L2NsaXBQYXRoPgo8L2RlZnM+Cjwvc3ZnPgo=",alt:"media placeholder"})}),k.jsx(u.xu,{gridColumn:"1",gridRow:"2",flexDirection:"column",padding:16,children:k.jsx(u.xu,{flexDirection:"column",alignItems:"center",children:k.jsxs(u.xv,{color:"grey12",variant:"h5",children:["Select a media or ",k.jsx(u.iC,{buttonText:"upload",inline:!0})," new ones."]})})})]})}function tU(){let{selectedMediaIds:t}=tL();return k.jsx(u.xu,{overflow:"hidden",borderStyle:"dashed",border:{top:!0,right:!0,left:!0,bottom:!1},borderRadius:{topRight:8,topLeft:8},gridColumn:"2",gridRow:"1 / -1",children:0===t.size&&k.jsx(tz,{})})}function tW(t){let{assetType:n}=t;return k.jsx(u.SV,{renderError:()=>k.jsx(u.xu,{minHeight:"100vh",children:"Error"}),children:k.jsx(o.Suspense,{children:k.jsx(tA,{assetType:n,children:k.jsx(tB,{})})})})}function tB(){let{media:t}=tL();return k.jsxs(u.xu,{display:"grid",gridTemplateRows:"1fr 1fr",gridTemplateColumns:"1fr 292px",width:"100%",gap:16,children:[k.jsxs(u.xu,{position:"relative",display:"grid",gap:16,overflow:"hidden",gridColumn:"1",gridRow:"1 / -1",children:[k.jsx(u.xu,{width:"100%",children:k.jsxs(u.xv,{variant:"bold",children:[t.length," Medias"]})}),k.jsx(u.SV,{renderError:()=>k.jsx(u.xu,{minHeight:"100vh",children:"Error"}),children:k.jsx(o.Suspense,{children:k.jsx(tF,{})})}),k.jsx(tP,{})]}),k.jsx(tU,{})]})}var tV,t$,tK,tY,tq,tG,tZ,tQ,tH,tJ,tX,t0,t1,t2,t4,t3,t5,t9,t8,t6,t7,ne,nt,nn,nr,ni,no,na,nu,ns,nc,nl,nf={},nd={};tK={get exports(){return nd},set exports(e){nd=e}},function(t){var n="object"==typeof S?S:"object"==typeof self?self:"object"==typeof this?this:{};function r(t,r){return t!==n&&("function"==typeof Object.create?Object.defineProperty(t,"__esModule",{value:!0}):t.__esModule=!0),function(n,i){return t[n]=r?r(n,i):i}}t(r(n,r(tK.exports)))}(function(t){var n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])};tY=function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}n(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)},tq=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t},tG=function(t,n){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&0>n.indexOf(i)&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,i=Object.getOwnPropertySymbols(t);o<i.length;o++)0>n.indexOf(i[o])&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(r[i[o]]=t[i[o]]);return r},tZ=function(t,n,r,i){var o,a=arguments.length,u=a<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(t,n,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(u=(a<3?o(u):a>3?o(n,r,u):o(n,r))||u);return a>3&&u&&Object.defineProperty(n,r,u),u},tQ=function(t,n){return function(r,i){n(r,i,t)}},tH=function(t,n,r,i,o,a){function u(t){if(void 0!==t&&"function"!=typeof t)throw TypeError("Function expected");return t}for(var s,c=i.kind,l="getter"===c?"get":"setter"===c?"set":"value",f=!n&&t?i.static?t:t.prototype:null,d=n||(f?Object.getOwnPropertyDescriptor(f,i.name):{}),p=!1,h=r.length-1;h>=0;h--){var m={};for(var g in i)m[g]="access"===g?{}:i[g];for(var g in i.access)m.access[g]=i.access[g];m.addInitializer=function(t){if(p)throw TypeError("Cannot add initializers after decoration has completed");a.push(u(t||null))};var y=(0,r[h])("accessor"===c?{get:d.get,set:d.set}:d[l],m);if("accessor"===c){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw TypeError("Object expected");(s=u(y.get))&&(d.get=s),(s=u(y.set))&&(d.set=s),(s=u(y.init))&&o.push(s)}else(s=u(y))&&("field"===c?o.push(s):d[l]=s)}f&&Object.defineProperty(f,i.name,d),p=!0},tJ=function(t,n,r){for(var i=arguments.length>2,o=0;o<n.length;o++)r=i?n[o].call(t,r):n[o].call(t);return i?r:void 0},tX=function(t){return"symbol"==typeof t?t:"".concat(t)},t0=function(t,n,r){return"symbol"==typeof n&&(n=n.description?"[".concat(n.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",n):n})},t1=function(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)},t2=function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{c(i.next(t))}catch(n){a(n)}}function s(t){try{c(i.throw(t))}catch(n){a(n)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}c((i=i.apply(t,n||[])).next())})},t4=function(t,n){var r,i,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(u=0)),u;)try{if(r=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return u.label++,{value:s[1],done:!1};case 5:u.label++,i=s[1],s=[0];continue;case 7:s=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){u=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){u.label=s[1];break}if(6===s[0]&&u.label<o[1]){u.label=o[1],o=s;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(s);break}o[2]&&u.ops.pop(),u.trys.pop();continue}s=n.call(t,u)}catch(c){s=[6,c],i=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},t3=function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||nl(n,t,r)},nl=Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]},t5=function(t){var n="function"==typeof Symbol&&Symbol.iterator,r=n&&t[n],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")},t9=function(t,n){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,o,a=r.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(i=a.next()).done;)u.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return u},t8=function(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(t9(arguments[n]));return t},t6=function(){for(var t=0,n=0,r=arguments.length;n<r;n++)t+=arguments[n].length;for(var i=Array(t),o=0,n=0;n<r;n++)for(var a=arguments[n],u=0,s=a.length;u<s;u++,o++)i[o]=a[u];return i},t7=function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},ne=function(t){return this instanceof ne?(this.v=t,this):new ne(t)},nt=function(t,n,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var i,o=r.apply(t,n||[]),a=[];return i={},u("next"),u("throw"),u("return"),i[Symbol.asyncIterator]=function(){return this},i;function u(t){o[t]&&(i[t]=function(n){return new Promise(function(r,i){a.push([t,n,r,i])>1||s(t,n)})})}function s(t,n){try{var r;r=o[t](n),r.value instanceof ne?Promise.resolve(r.value.v).then(c,l):f(a[0][2],r)}catch(i){f(a[0][3],i)}}function c(t){s("next",t)}function l(t){s("throw",t)}function f(t,n){t(n),a.shift(),a.length&&s(a[0][0],a[0][1])}},nn=function(t){var n,r;return n={},i("next"),i("throw",function(t){throw t}),i("return"),n[Symbol.iterator]=function(){return this},n;function i(i,o){n[i]=t[i]?function(n){return(r=!r)?{value:ne(t[i](n)),done:!1}:o?o(n):n}:o}},nr=function(t){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,r=t[Symbol.asyncIterator];return r?r.call(t):(t="function"==typeof t5?t5(t):t[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(r){n[r]=t[r]&&function(n){return new Promise(function(i,o){(function(t,n,r,i){Promise.resolve(i).then(function(n){t({value:n,done:r})},n)})(i,o,(n=t[r](n)).done,n.value)})}}},ni=function(t,n){return Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,t};var r=Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n};no=function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&nl(n,t,i);return r(n,t),n},na=function(t){return t&&t.__esModule?t:{default:t}},nu=function(t,n,r,i){if("a"===r&&!i)throw TypeError("Private accessor was defined without a getter");if("function"==typeof n?t!==n||!i:!n.has(t))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(t):i?i.value:n.get(t)},ns=function(t,n,r,i,o){if("m"===i)throw TypeError("Private method is not writable");if("a"===i&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof n?t!==n||!o:!n.has(t))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,r):o?o.value=r:n.set(t,r),r},nc=function(t,n){if(null===n||"object"!=typeof n&&"function"!=typeof n)throw TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?n===t:t.has(n)},t("__extends",tY),t("__assign",tq),t("__rest",tG),t("__decorate",tZ),t("__param",tQ),t("__esDecorate",tH),t("__runInitializers",tJ),t("__propKey",tX),t("__setFunctionName",t0),t("__metadata",t1),t("__awaiter",t2),t("__generator",t4),t("__exportStar",t3),t("__createBinding",nl),t("__values",t5),t("__read",t9),t("__spread",t8),t("__spreadArrays",t6),t("__spreadArray",t7),t("__await",ne),t("__asyncGenerator",nt),t("__asyncDelegator",nn),t("__asyncValues",nr),t("__makeTemplateObject",ni),t("__importStar",no),t("__importDefault",na),t("__classPrivateFieldGet",nu),t("__classPrivateFieldSet",ns),t("__classPrivateFieldIn",nc)});var np={};function nh(t){return function(n){return function(r){return r.reduce(function(n,r){return t.alt(n,function(){return r})},n)}}}let nm=Object.freeze(Object.defineProperty({__proto__:null,altAll:nh},Symbol.toStringTag,{value:"Module"})),ng=Object.freeze(Object.defineProperty({__proto__:null,altAll:function(t){return nh(t)(t.zero())}},Symbol.toStringTag,{value:"Module"}));var ny=function(t){return function(){return{meet:function(n,r){return function(i){return t.meet(n(i),r(i))}},join:function(n,r){return function(i){return t.join(n(i),r(i))}},zero:function(){return t.zero},one:function(){return t.one},implies:function(n,r){return function(i){return t.implies(n(i),r(i))}},not:function(n){return function(r){return t.not(n(r))}}}}},nv=function(t){return function(){return{concat:function(n,r){return function(i){return t.concat(n(i),r(i))}}}}},nb=function(t){var n=nv(t);return function(){return{concat:n().concat,empty:function(){return t.empty}}}},nx=function(t){return{add:function(n,r){return function(i){return t.add(n(i),r(i))}},zero:function(){return t.zero},mul:function(n,r){return function(i){return t.mul(n(i),r(i))}},one:function(){return t.one}}},nM=function(t){var n=nx(t);return{add:n.add,mul:n.mul,one:n.one,zero:n.zero,sub:function(n,r){return function(i){return t.sub(n(i),r(i))}}}},nT=function(t){return function(n){return n(t)}};function nS(t){return t}function nw(t){return function(){return t}}var n_=nw(!0),nI=nw(!1),nO=nw(null),nk=nw(void 0);function nC(t,n,r,i,o,a,u,s,c){switch(arguments.length){case 1:return t;case 2:return function(){return n(t.apply(this,arguments))};case 3:return function(){return r(n(t.apply(this,arguments)))};case 4:return function(){return i(r(n(t.apply(this,arguments))))};case 5:return function(){return o(i(r(n(t.apply(this,arguments)))))};case 6:return function(){return a(o(i(r(n(t.apply(this,arguments))))))};case 7:return function(){return u(a(o(i(r(n(t.apply(this,arguments)))))))};case 8:return function(){return s(u(a(o(i(r(n(t.apply(this,arguments))))))))};case 9:return function(){return c(s(u(a(o(i(r(n(t.apply(this,arguments)))))))))}}}function nN(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t}function nj(t){return t+1}function nE(t){return t-1}function nR(t){throw Error("Called `absurd` function which should be uncallable")}function nD(t,n,r,i,o,a,u,s,c){switch(arguments.length){case 1:return t;case 2:return n(t);case 3:return r(n(t));case 4:return i(r(n(t)));case 5:return o(i(r(n(t))));case 6:return a(o(i(r(n(t)))));case 7:return u(a(o(i(r(n(t))))));case 8:return s(u(a(o(i(r(n(t)))))));case 9:return c(s(u(a(o(i(r(n(t))))))));default:for(var l=arguments[0],f=1;f<arguments.length;f++)l=arguments[f](l);return l}}var nA=function(t,n){return n},nL=function(){return{concat:function(t,n){return nC(t,n)},empty:nS}};let nP=Object.freeze(Object.defineProperty({__proto__:null,SK:nA,absurd:nR,apply:nT,constFalse:nI,constNull:nO,constTrue:n_,constUndefined:nk,constVoid:nk,constant:nw,decrement:nE,flip:function(t){return function(n,r){return t(r,n)}},flow:nC,getBooleanAlgebra:ny,getEndomorphismMonoid:nL,getMonoid:nb,getRing:nM,getSemigroup:nv,getSemiring:nx,hole:nR,identity:nS,increment:nj,not:function(t){return function(n){return!t(n)}},pipe:nD,tuple:nN,tupled:function(t){return function(n){return t.apply(void 0,n)}},unsafeCoerce:nS,untupled:function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(n)}}},Symbol.toStringTag,{value:"Module"}));var nF=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},nz=function(t){return"None"===t._tag},nU=function(t){return"Some"===t._tag},nW={_tag:"None"},nB=function(t){return{_tag:"Some",value:t}},nV=function(t){return"Left"===t._tag},n$=function(t){return"Right"===t._tag},nK=function(t){return{_tag:"Left",left:t}},nY=function(t){return{_tag:"Right",right:t}},nq=function(t){return[t]},nG=function(t){return t.length>0},nZ=function(t){return t[0]},nQ=function(t){return t.slice(1)},nH=[],nJ={},nX=Object.prototype.hasOwnProperty,n0=function(t){return nF([t[0]],t.slice(1),!0)};function n1(t,n){return function(r){return function(i){return t.ap(t.map(i,function(t){return function(r){return n.ap(t,r)}}),r)}}}function n2(t){return function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}}}function n4(t){return function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}function n3(t){return function(n,r){return function(i){return t.ap(t.map(i,function(t){return function(r){var i;return Object.assign({},t,((i={})[n]=r,i))}}),r)}}}function n5(t){return function(n){return{concat:function(r,i){return t.ap(t.map(r,function(t){return function(r){return n.concat(t,r)}}),i)}}}}function n9(t,n,r){return function(i){for(var o=Array(r.length+1),a=0;a<r.length;a++)o[a]=r[a];return o[r.length]=i,0===n?t.apply(null,o):n9(t,n-1,o)}}var n8={1:function(t){return[t]},2:function(t){return function(n){return[t,n]}},3:function(t){return function(n){return function(r){return[t,n,r]}}},4:function(t){return function(n){return function(r){return function(i){return[t,n,r,i]}}}},5:function(t){return function(n){return function(r){return function(i){return function(o){return[t,n,r,i,o]}}}}}};function n6(t){return nX.call(n8,t)||(n8[t]=n9(nN,t-1,[])),n8[t]}function n7(t){var n=t.length;switch(n){case 1:return function(n){var r;return(r={})[t[0]]=n,r};case 2:return function(n){return function(r){var i;return(i={})[t[0]]=n,i[t[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return(o={})[t[0]]=n,o[t[1]]=r,o[t[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return(a={})[t[0]]=n,a[t[1]]=r,a[t[2]]=i,a[t[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return(u={})[t[0]]=n,u[t[1]]=r,u[t[2]]=i,u[t[3]]=o,u[t[4]]=a,u}}}}};default:return n9(function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];for(var o={},a=0;a<n;a++)o[t[a]]=r[a];return o},n-1,[])}}let re=Object.freeze(Object.defineProperty({__proto__:null,ap:n1,apFirst:n2,apS:n3,apSecond:n4,getApplySemigroup:n5,sequenceS:function(t){return function(n){for(var r=Object.keys(n),i=r.length,o=n7(r),a=t.map(n[r[0]],o),u=1;u<i;u++)a=t.ap(a,n[r[u]]);return a}},sequenceT:function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=n.length,o=n6(i),a=t.map(n[0],o),u=1;u<i;u++)a=t.ap(a,n[u]);return a}}},Symbol.toStringTag,{value:"Module"}));function rt(t,n){return function(r){return function(i){return t.map(i,function(t){return n.map(t,r)})}}}function rn(t){return function(n){return function(r){return t.map(r,function(t){return t(n)})}}}function rr(t){return function(n){return function(r){return t.map(r,function(t){var r;return(r={})[n]=t,r})}}}function ri(t,n){var r=rt(t,n);return{map:function(t,n){return nD(t,r(n))}}}let ro=Object.freeze(Object.defineProperty({__proto__:null,bindTo:rr,flap:rn,getFunctorComposition:ri,map:rt},Symbol.toStringTag,{value:"Module"}));function ra(t){var n=n5(t);return function(r){return{concat:n(r).concat,empty:t.of(r.empty)}}}function ru(t,n){var r=ri(t,n).map,i=n1(t,n);return{map:r,of:function(r){return t.of(n.of(r))},ap:function(t,n){return nD(t,i(n))}}}let rs=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeComposition:ru,getApplicativeMonoid:ra},Symbol.toStringTag,{value:"Module"}));function rc(t){return function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}}}function rl(t){return function(n,r){return function(i){return t.chain(i,function(i){return t.map(r(i),function(t){var r;return Object.assign({},i,((r={})[n]=t,r))})})}}}let rf=Object.freeze(Object.defineProperty({__proto__:null,bind:rl,chainFirst:rc},Symbol.toStringTag,{value:"Module"}));function rd(t){return function(n){return function(r){return t.fromEither(nz(r)?nK(n()):nY(r.value))}}}function rp(t){return function(n,r){return function(i){return t.fromEither(n(i)?nY(i):nK(r(i)))}}}function rh(t){var n=rd(t);return function(t){var r=n(t);return function(t){return nC(t,r)}}}function rm(t,n){var r=rh(t);return function(t){var i=r(t);return function(t){return function(r){return n.chain(r,i(t))}}}}function rg(t){return function(n){return nC(n,t.fromEither)}}function ry(t,n){var r=rg(t);return function(t){return function(i){return n.chain(i,r(t))}}}function rv(t,n){return nC(rg(t),rc(n))}function rb(t,n){return function(r,i){return function(o){return n.chain(o,function(n){return t.fromEither(r(n)?nY(n):nK(i(n)))})}}}let rx=Object.freeze(Object.defineProperty({__proto__:null,chainEitherK:ry,chainFirstEitherK:rv,chainOptionK:rm,filterOrElse:rb,fromEitherK:rg,fromOption:rd,fromOptionK:rh,fromPredicate:rp},Symbol.toStringTag,{value:"Module"}));var rM=function(t){return{equals:function(n,r){return n===r||t(n,r)}}},rT=function(t){return rM(function(n,r){for(var i in t)if(!t[i].equals(n[i],r[i]))return!1;return!0})},rS=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return rM(function(n,r){return t.every(function(t,i){return t.equals(n[i],r[i])})})},rw=function(t){return function(n){return rM(function(r,i){return n.equals(t(r),t(i))})}},r_={equals:function(t,n){return t===n}},rI={equals:function(){return!0}},rO=function(){return{concat:function(t,n){return rM(function(r,i){return t.equals(r,i)&&n.equals(r,i)})}}},rk=function(){return{concat:rO().concat,empty:rI}},rC={URI:"Eq",contramap:function(t,n){return nD(t,rw(n))}},rN=r_.equals;let rj=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:rC,URI:"Eq",contramap:rw,eq:rC,eqBoolean:r_,eqDate:{equals:function(t,n){return t.valueOf()===n.valueOf()}},eqNumber:r_,eqStrict:r_,eqString:r_,fromEquals:rM,getMonoid:rk,getSemigroup:rO,getStructEq:rT,getTupleEq:rS,strictEqual:rN,struct:rT,tuple:rS},Symbol.toStringTag,{value:"Module"}));var rE=function(t){return function(n,r){return n===r||0===t(n,r)}},rR=function(t){return{equals:rE(t),compare:function(n,r){return n===r?0:t(n,r)}}},rD=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return rR(function(n,r){for(var i=0;i<t.length-1;i++){var o=t[i].compare(n[i],r[i]);if(0!==o)return o}return t[i].compare(n[i],r[i])})},rA=function(t){return rR(function(n,r){return t.compare(r,n)})},rL=function(t){return function(n){return rR(function(r,i){return n.compare(t(r),t(i))})}},rP=function(){return{concat:function(t,n){return rR(function(r,i){var o=t.compare(r,i);return 0!==o?o:n.compare(r,i)})}}},rF=function(){return{concat:rP().concat,empty:rR(function(){return 0})}},rz={URI:"Ord",contramap:function(t,n){return nD(t,rL(n))}},rU={equals:n_,compare:nw(0)},rW=function(t){return function(n){return function(r){return r===n||0===t.compare(r,n)}}},rB=function(t){return function(n,r){return -1===t.compare(n,r)}},rV=function(t){return function(n,r){return 1===t.compare(n,r)}},r$=function(t){return function(n,r){return 1!==t.compare(n,r)}},rK=function(t){return function(n,r){return -1!==t.compare(n,r)}},rY=function(t){return function(n,r){return n===r||1>t.compare(n,r)?n:r}},rq=function(t){return function(n,r){return n===r||t.compare(n,r)>-1?n:r}},rG=function(t){var n=rY(t),r=rq(t);return function(t,i){return function(o){return r(n(o,i),t)}}},rZ=function(t){var n=rB(t),r=rV(t);return function(t,i){return function(o){return!(n(o,t)||r(o,i))}}},rQ={equals:r_.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},rH=nD(rQ,rL(function(t){return t.valueOf()}));let rJ=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:rz,URI:"Ord",between:rZ,clamp:rG,contramap:rL,equals:rW,equalsDefault:rE,fromCompare:rR,geq:rK,getDualOrd:rA,getMonoid:rF,getSemigroup:rP,getTupleOrd:rD,gt:rV,leq:r$,lt:rB,max:rq,min:rY,ord:rz,ordBoolean:rQ,ordDate:rH,ordNumber:rQ,ordString:rQ,reverse:rA,trivial:rU,tuple:rD},Symbol.toStringTag,{value:"Module"}));var rX=function(t){return{concat:function(n,r){return t.concat(r,n)}}},r0=function(t){return function(n){return{concat:function(r,i){return t(r)?n.concat(r,i):i}}}},r1=function(t){return function(n){return{concat:function(r,i){return t(i)?n.concat(r,i):r}}}},r2=function(t){return function(n){return{concat:function(r,i){return n.concat(t(r),t(i))}}}},r4=function(t){return function(n){return function(r){return r.reduce(function(n,r){return t.concat(n,r)},n)}}};let r3=Object.freeze(Object.defineProperty({__proto__:null,concatAll:r4,endo:r2,filterFirst:r0,filterSecond:r1,reverse:rX},Symbol.toStringTag,{value:"Module"}));var r5=function(t){return{concat:rY(t)}},r9=function(t){return{concat:rq(t)}},r8=function(t){return{concat:function(){return t}}},r6=function(t){return{concat:function(n,r){var i={};for(var o in t)nX.call(t,o)&&(i[o]=t[o].concat(n[o],r[o]));return i}}},r7=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{concat:function(n,r){return t.map(function(t,i){return t.concat(n[i],r[i])})}}},ie=function(t){return function(n){return{concat:function(r,i){return n.concat(r,n.concat(t,i))}}}},it=function(){return{concat:nS}},ir=function(){return{concat:function(t,n){return n}}},ii=r8(void 0),io=function(){return{concat:function(t,n){return Object.assign({},t,n)}}},ia={concat:function(t,n){return t&&n}},iu={concat:function(t,n){return t||n}},is={concat:function(t,n){return t+n}},ic={concat:function(t,n){return t+n}},il={concat:function(t,n){return t*n}};let id=Object.freeze(Object.defineProperty({__proto__:null,concatAll:r4,constant:r8,first:it,fold:function(t){var n=r4(t);return function(t,r){return void 0===r?n(t):n(t)(r)}},getDualSemigroup:rX,getFirstSemigroup:it,getFunctionSemigroup:nv,getIntercalateSemigroup:ie,getJoinSemigroup:r9,getLastSemigroup:ir,getMeetSemigroup:r5,getObjectSemigroup:io,getStructSemigroup:r6,getTupleSemigroup:r7,intercalate:ie,last:ir,max:r9,min:r5,reverse:rX,semigroupAll:ia,semigroupAny:iu,semigroupProduct:il,semigroupString:is,semigroupSum:ic,semigroupVoid:ii,struct:r6,tuple:r7},Symbol.toStringTag,{value:"Module"}));var ip=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},ih=function(t,n){return t<0||t>=n.length},im=function(t){return function(n){return ip([t],n,!0)}},ig=function(t){return function(n){return ip(ip([],n,!0),[t],!1)}},iy=function(t,n,r){if(nG(r)){var i=n0(r);return i.splice(t,0,n),i}return[n]},iv=function(t,n,r){if(r[t]===n)return r;var i=n0(r);return i[t]=n,i},ib=function(t){return function(n){if(1===n.length)return n;for(var r=[oj(n)],i=oE(n),o=function(n){r.every(function(r){return!t.equals(r,n)})&&r.push(n)},a=0;a<i.length;a++)o(i[a]);return r}},ix=function(t){if(nG(t)){var n=rF();return iA(t.reduce(n.concat,n.empty))}return nS},iM=function(t){var n=ib(t);return function(t){return function(r){return n(nD(r,ij(t)))}}},iT=function(t){return function(n){var r=n.length,i=Math.round(t)%r;if(ih(Math.abs(i),n)||0===i)return n;if(!(i<0))return iT(i-r)(n);var o=i$(-i)(n),a=o[0];return nD(o[1],ij(a))}},iS=function(t){return nG(t)?nB(t):nW},iw=function(t){return function(n){for(var r=Math.max(0,Math.floor(n)),i=[t(0)],o=1;o<r;o++)i.push(t(o));return i}},i_=function(t){return iw(function(){return t})},iI=function(t,n){return t<=n?iw(function(n){return t+n})(n-t+1):[t]},iO=function(t){return[oj(t),oE(t)]},ik=function(t){return[oD(t),oR(t)]},iC=function(t){return iS(t.slice())};function iN(t){return function(n){return n.concat(t)}}function ij(t,n){return n?t.concat(n):function(n){return n.concat(t)}}var iE=function(t){return 1===t.length?t:ip([oR(t)],t.slice(0,-1).reverse(),!0)};function iR(t){return function(n){var r=n.length;if(0===r)return nH;for(var i=[],o=n[0],a=[o],u=1;u<r;u++){var s=n[u];t.equals(s,o)?a.push(s):(i.push(a),a=[o=s])}return i.push(a),i}}var iD=function(t){return function(n){for(var r={},i=0;i<n.length;i++){var o=n[i],a=t(o);nX.call(r,a)?r[a].push(o):r[a]=[o]}return r}},iA=function(t){return function(n){return 1===n.length?n:n.slice().sort(t.compare)}},iL=function(t,n){return iP(t,function(){return n})},iP=function(t,n){return function(r){return ih(t,r)?nW:nB(iv(t,n(r[t]),r))}},iF=function(t,n,r){for(var i=[r(t[0],n[0])],o=Math.min(t.length,n.length),a=1;a<o;a++)i[a]=r(t[a],n[a]);return i},iz=function(t){for(var n=[t[0][0]],r=[t[0][1]],i=1;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},iU=function(t){return function(n){for(var r=[t,n[0]],i=1;i<n.length;i++)r.push(t,n[i]);return r}},iW=function(t){return function(n){var r=oE(n);return nG(r)?nD(r,iU(t),im(oj(n))):n}},iB=function(t){return function(n){for(var r=n0(t(0,oj(n))),i=1;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},iV=function(t){return function(n){for(var r=t(n),i=r[0],o=r[1],a=[i],u=o;nG(u);){var s=t(u),c=s[0],l=s[1];a.push(c),u=l}return a}},i$=function(t){return function(n){var r=Math.max(1,t);return r>=n.length?[n,nH]:[nD(n.slice(1,r),im(oj(n))),n.slice(r)]}},iK=function(t){return iV(i$(t))},iY=function(t,n){return nD(t,or(n))},iq=function(t,n){return nD(t,oi(n))},iG=function(t,n){return nD(t,i6(n))},iZ=function(t,n){return nD(t,i7(n))},iQ=function(t,n){return nD(t,oe(n))},iH=function(t,n,r){return nD(t,oo(n,r))},iJ=function(t){var n=oa(t);return function(t,r){return nD(t,n(r))}},iX=function(t,n,r){return nD(t,ou(n,r))},i0=function(t){var n=od(t);return function(t,r){return nD(t,n(r))}},i1=function(t,n){return nD(t,i8(n))},i2=function(t,n,r){return nD(t,oc(n,r))},i4=function(t){var n=ol(t);return function(t,r){return nD(t,n(r))}},i3=function(t,n,r){return nD(t,of(n,r))},i5=function(t){var n=oh(t);return function(t,r){return nD(t,n(r))}},i9=function(t){return function(n){return nD(n,iN(t()))}},i8=i9,i6=function(t){return i7(function(n){return nD(t,or(n))})},i7=function(t){return iB(function(n,r){return t(r)})},oe=function(t){return function(n){for(var r=oE(n),i=[t(n)];nG(r);)i.push(t(r)),r=oE(r);return i}},ot=oe(nS),on=i7(nS),or=function(t){return oi(function(n,r){return t(r)})},oi=function(t){return function(n){for(var r=[t(0,oj(n))],i=1;i<n.length;i++)r.push(t(i,n[i]));return r}},oo=function(t,n){return oc(t,function(t,r,i){return n(r,i)})},oa=function(t){return function(n){return function(r){return r.slice(1).reduce(function(r,i){return t.concat(r,n(i))},n(r[0]))}}},ou=function(t,n){return of(t,function(t,r,i){return n(r,i)})},oc=function(t,n){return function(r){return r.reduce(function(t,r,i){return n(i,t,r)},t)}},ol=function(t){return function(n){return function(r){return r.slice(1).reduce(function(r,i,o){return t.concat(r,n(o+1,i))},n(0,r[0]))}}},of=function(t,n){return function(r){return r.reduceRight(function(t,r,i){return n(i,r,t)},t)}},od=function(t){var n=oh(t);return function(t){return n(function(n,r){return t(r)})}},op=function(t){return oh(t)(nA)},oh=function(t){return function(n){return function(r){for(var i=t.map(n(0,oj(r)),nq),o=1;o<r.length;o++)i=t.ap(t.map(i,function(t){return function(n){return nD(t,ig(n))}}),n(o,r[o]));return i}}},om="ReadonlyNonEmptyArray",og=function(t){return{show:function(n){return"[".concat(n.map(t.show).join(", "),"]")}}},oy=function(){return{concat:ij}},ov=function(t){return rM(function(n,r){return n.length===r.length&&n.every(function(n,i){return t.equals(n,r[i])})})},ob=function(t){var n=iM(t);return{concat:function(t,r){return n(r)(t)}}},ox={URI:om,map:iY},oM=rn(ox),oT={URI:om,map:iY,ap:iG},oS=n2(oT),ow=n4(oT),o_={URI:om,map:iY,ap:iG,chain:iZ},oI=rc(o_),oO=nq(nJ),ok=rr(ox),oC=rl(o_),oN=n3(oT),oj=nZ,oE=nQ,oR=function(t){return t[t.length-1]},oD=function(t){return t.slice(0,-1)},oA=function(t){var n=r5(t);return function(t){return t.reduce(n.concat)}},oL=function(t){var n=r9(t);return function(t){return t.reduce(n.concat)}},oP=function(t){return function(n){return n.reduce(t.concat)}},oF=function(t){return function(n){return t(oj(n),oE(n))}},oz=function(t){return function(n){return t(oD(n),oR(n))}},oU=function(t){return function(n){return ip([t(oj(n))],oE(n),!0)}},oW=function(t){return oU(function(){return t})},oB=function(t){return function(n){return nD(oD(n),ig(t(oR(n))))}},oV=function(t){return oB(function(){return t})},o$=function(t){var n=oP(t);return function(t){return nC(iW(t),n)}},oK=function(t){return function(n){return iS(n.filter(function(n,r){return t(r,n)}))}};function oY(t,n){return void 0===n?im(t):nD(n,im(t))}var oq=function(t,n){return nD(t,ij([n]))},oG=function(t,n){return function(r){return t<0||t>r.length?nW:nB(iy(t,n,r))}};let oZ=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:om,map:iY,alt:i1},Applicative:{URI:om,map:iY,ap:iG,of:nq},Apply:oT,Chain:o_,Comonad:{URI:om,map:iY,extend:iQ,extract:nZ},Do:oO,Foldable:{URI:om,reduce:iH,foldMap:iJ,reduceRight:iX},FoldableWithIndex:{URI:om,reduce:iH,foldMap:iJ,reduceRight:iX,reduceWithIndex:i2,foldMapWithIndex:i4,reduceRightWithIndex:i3},Functor:ox,FunctorWithIndex:{URI:om,map:iY,mapWithIndex:iq},Monad:{URI:om,map:iY,ap:iG,of:nq,chain:iZ},Pointed:{URI:om,of:nq},Traversable:{URI:om,map:iY,reduce:iH,foldMap:iJ,reduceRight:iX,traverse:i0,sequence:op},TraversableWithIndex:{URI:om,map:iY,mapWithIndex:iq,reduce:iH,foldMap:iJ,reduceRight:iX,traverse:i0,sequence:op,reduceWithIndex:i2,foldMapWithIndex:i4,reduceRightWithIndex:i3,traverseWithIndex:i5},URI:om,alt:i8,altW:i9,ap:i6,apFirst:oS,apS:oN,apSecond:ow,append:ig,appendW:ig,bind:oC,bindTo:ok,chain:i7,chainFirst:oI,chainWithIndex:iB,chop:iV,chunksOf:iK,concat:ij,concatAll:oP,concatW:iN,cons:oY,duplicate:ot,empty:nH,extend:oe,extract:nZ,filter:function(t){return oK(function(n,r){return t(r)})},filterWithIndex:oK,flap:oM,flatten:on,fold:oP,foldMap:oa,foldMapWithIndex:ol,fromArray:iC,fromReadonlyArray:iS,getEq:ov,getSemigroup:oy,getShow:og,getUnionSemigroup:ob,group:iR,groupBy:iD,groupSort:function(t){var n=iA(t),r=iR(t);return function(t){return nG(t)?r(n(t)):nH}},head:oj,init:oD,insertAt:oG,intercalate:o$,intersperse:iW,isNonEmpty:nG,isOutOfBound:ih,last:oR,makeBy:iw,map:or,mapWithIndex:oi,matchLeft:oF,matchRight:oz,max:oL,min:oA,modifyAt:iP,modifyHead:oU,modifyLast:oB,of:nq,prepend:im,prependAll:iU,prependToAll:iU,prependW:im,range:iI,readonlyNonEmptyArray:{URI:om,of:nq,map:iY,mapWithIndex:iq,ap:iG,chain:iZ,extend:iQ,extract:nZ,reduce:iH,foldMap:iJ,reduceRight:iX,traverse:i0,sequence:op,reduceWithIndex:i2,foldMapWithIndex:i4,reduceRightWithIndex:i3,traverseWithIndex:i5,alt:i1},reduce:oo,reduceRight:ou,reduceRightWithIndex:of,reduceWithIndex:oc,replicate:i_,reverse:iE,rotate:iT,sequence:op,snoc:oq,sort:iA,sortBy:ix,splitAt:i$,tail:oE,traverse:od,traverseWithIndex:oh,unappend:ik,uncons:iO,union:iM,uniq:ib,unprepend:iO,unsafeInsertAt:iy,unsafeUpdateAt:iv,unsnoc:ik,unzip:iz,updateAt:iL,updateHead:oW,updateLast:oV,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:iF(n,r,function(t,n){return[t,n]})},zipWith:iF},Symbol.toStringTag,{value:"Module"}));var oQ=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},oH=function(t){return t.length>0},oJ=function(t,n){return t<0||t>=n.length},oX=function(t){return function(n){return oQ([t],n,!0)}},o0=function(t){return function(n){return oQ(oQ([],n,!0),[t],!1)}},o1=function(t,n,r){if(oH(r)){var i=o8(r);return i.splice(t,0,n),i}return[n]},o2=function(t,n,r){var i=o8(r);return i[t]=n,i},o4=function(t){return function(n){if(1===n.length)return ap(n);for(var r=[ur(n)],i=ui(n),o=function(n){r.every(function(r){return!t.equals(r,n)})&&r.push(n)},a=0;a<i.length;a++)o(i[a]);return r}},o3=function(t){if(oH(t)){var n=rF();return ac(t.reduce(n.concat,n.empty))}return ap},o5=function(t){var n=o4(t);return function(t){return function(r){return n(nD(r,ao(t)))}}},o9=function(t){return function(n){var r=n.length,i=Math.round(t)%r;if(oJ(Math.abs(i),n)||0===i)return ap(n);if(!(i<0))return o9(i-r)(n);var o=aM(-i)(n),a=o[0];return nD(o[1],ao(a))}},o8=n0,o6=function(t){return oH(t)?nB(t):nW},o7=function(t){return function(n){for(var r=Math.max(0,Math.floor(n)),i=[t(0)],o=1;o<r;o++)i.push(t(o));return i}},ae=function(t){return o7(function(){return t})},at=function(t,n){return t<=n?o7(function(n){return t+n})(n-t+1):[t]},an=function(t){return[ur(t),ui(t)]},ar=function(t){return[ua(t),uo(t)]};function ai(t){return function(n){return n.concat(t)}}function ao(t,n){return n?t.concat(n):function(n){return n.concat(t)}}var aa=function(t){return oQ([uo(t)],t.slice(0,-1).reverse(),!0)};function au(t){return function(n){var r=n.length;if(0===r)return[];for(var i=[],o=n[0],a=[o],u=1;u<r;u++){var s=n[u];t.equals(s,o)?a.push(s):(i.push(a),a=[o=s])}return i.push(a),i}}var as=function(t){return function(n){for(var r={},i=0;i<n.length;i++){var o=n[i],a=t(o);nX.call(r,a)?r[a].push(o):r[a]=[o]}return r}},ac=function(t){return function(n){return n.slice().sort(t.compare)}},al=function(t,n){return function(r){return t<0||t>r.length?nW:nB(o1(t,n,r))}},af=function(t,n){return ad(t,function(){return n})},ad=function(t,n){return function(r){return oJ(t,r)?nW:nB(o2(t,n(r[t]),r))}},ap=o8,ah=function(t){return[t]},am=function(t,n,r){for(var i=[r(t[0],n[0])],o=Math.min(t.length,n.length),a=1;a<o;a++)i[a]=r(t[a],n[a]);return i},ag=function(t){for(var n=[t[0][0]],r=[t[0][1]],i=1;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},ay=function(t){return function(n){for(var r=[t,n[0]],i=1;i<n.length;i++)r.push(t,n[i]);return r}},av=function(t){return function(n){var r=ui(n);return oH(r)?nD(r,ay(t),oX(ur(n))):ap(n)}},ab=function(t){return function(n){for(var r=o8(t(0,ur(n))),i=1;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},ax=function(t){return function(n){for(var r=t(n),i=r[0],o=r[1],a=[i],u=o;oH(u);){var s=t(u),c=s[0],l=s[1];a.push(c),u=l}return a}},aM=function(t){return function(n){var r=Math.max(1,t);return r>=n.length?[ap(n),[]]:[nD(n.slice(1,r),oX(ur(n))),n.slice(r)]}},aT=function(t){return ax(aM(t))},aS=function(t,n){return nD(t,a$(n))},aw=function(t,n){return nD(t,aK(n))},a_=function(t,n){return nD(t,az(n))},aI=function(t,n){return nD(t,aU(n))},aO=function(t,n){return nD(t,aW(n))},ak=function(t,n,r){return nD(t,aY(n,r))},aC=function(t){var n=oa(t);return function(t,r){return nD(t,n(r))}},aN=function(t,n,r){return nD(t,aG(n,r))},aj=function(t){var n=aQ(t);return function(t,r){return nD(t,n(r))}},aE=function(t,n){return nD(t,aF(n))},aR=function(t,n,r){return nD(t,aq(n,r))},aD=function(t){var n=ol(t);return function(t,r){return nD(t,n(r))}},aA=function(t,n,r){return nD(t,aZ(n,r))},aL=function(t){var n=aJ(t);return function(t,r){return nD(t,n(r))}},aP=function(t){return function(n){return nD(n,ai(t()))}},aF=aP,az=function(t){return aU(function(n){return nD(t,a$(n))})},aU=function(t){return ab(function(n,r){return t(r)})},aW=function(t){return function(n){for(var r=ui(n),i=[t(n)];oH(r);)i.push(t(r)),r=ui(r);return i}},aB=aW(nS),aV=aU(nS),a$=function(t){return aK(function(n,r){return t(r)})},aK=function(t){return function(n){for(var r=[t(0,ur(n))],i=1;i<n.length;i++)r.push(t(i,n[i]));return r}},aY=oo,aq=oc,aG=ou,aZ=of,aQ=function(t){var n=aJ(t);return function(t){return n(function(n,r){return t(r)})}},aH=function(t){return aJ(t)(function(t,n){return n})},aJ=function(t){return function(n){return function(r){for(var i=t.map(n(0,ur(r)),ah),o=1;o<r.length;o++)i=t.ap(t.map(i,function(t){return function(n){return nD(t,o0(n))}}),n(o,r[o]));return i}}},aX="NonEmptyArray",a0=function(){return{concat:ao}},a1=function(t){var n=o5(t);return{concat:function(t,r){return n(r)(t)}}},a2={URI:aX,map:aS},a4=rn(a2),a3={URI:aX,map:aS,ap:a_},a5=n2(a3),a9=n4(a3),a8={URI:aX,map:aS,ap:a_,chain:aI},a6=rc(a8),a7=ah(nJ),ue=rr(a2),ut=rl(a8),un=n3(a3),ur=oj,ui=function(t){return t.slice(1)},uo=oR,ua=function(t){return t.slice(0,-1)},uu=function(t){return function(n){return n.reduce(t.concat)}},us=function(t){return function(n){return t(ur(n),ui(n))}},uc=function(t){return function(n){return t(ua(n),uo(n))}},ul=function(t){return function(n){return oQ([t(ur(n))],ui(n),!0)}},uf=function(t){return ul(function(){return t})},ud=function(t){return function(n){return nD(ua(n),o0(t(uo(n))))}},up=function(t){return ud(function(){return t})},uh=function(t){return function(n){return o6(n.filter(function(n,r){return t(r,n)}))}};function um(t,n){return void 0===n?oX(t):nD(n,oX(t))}var ug=function(t,n){return nD(t,o0(n))};let uy=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:aX,map:aS,alt:aE},Applicative:{URI:aX,map:aS,ap:a_,of:ah},Apply:a3,Chain:a8,Comonad:{URI:aX,map:aS,extend:aO,extract:oj},Do:a7,Foldable:{URI:aX,reduce:ak,foldMap:aC,reduceRight:aN},FoldableWithIndex:{URI:aX,reduce:ak,foldMap:aC,reduceRight:aN,reduceWithIndex:aR,foldMapWithIndex:aD,reduceRightWithIndex:aA},Functor:a2,FunctorWithIndex:{URI:aX,map:aS,mapWithIndex:aw},Monad:{URI:aX,map:aS,ap:a_,of:ah,chain:aI},Pointed:{URI:aX,of:ah},Traversable:{URI:aX,map:aS,reduce:ak,foldMap:aC,reduceRight:aN,traverse:aj,sequence:aH},TraversableWithIndex:{URI:aX,map:aS,mapWithIndex:aw,reduce:ak,foldMap:aC,reduceRight:aN,traverse:aj,sequence:aH,reduceWithIndex:aR,foldMapWithIndex:aD,reduceRightWithIndex:aA,traverseWithIndex:aL},URI:aX,alt:aF,altW:aP,ap:az,apFirst:a5,apS:un,apSecond:a9,append:o0,appendW:o0,bind:ut,bindTo:ue,chain:aU,chainFirst:a6,chainWithIndex:ab,chop:ax,chunksOf:aT,concat:ao,concatAll:uu,concatW:ai,cons:um,copy:ap,duplicate:aB,extend:aW,extract:oj,filter:function(t){return uh(function(n,r){return t(r)})},filterWithIndex:uh,flap:a4,flatten:aV,fold:oP,foldMap:oa,foldMapWithIndex:ol,fromArray:o6,fromReadonlyNonEmptyArray:o8,getEq:ov,getSemigroup:a0,getShow:og,getUnionSemigroup:a1,group:au,groupBy:as,groupSort:function(t){var n=ac(t),r=au(t);return function(t){return oH(t)?r(n(t)):[]}},head:ur,init:ua,insertAt:al,intercalate:o$,intersperse:av,isNonEmpty:oH,isOutOfBound:oJ,last:uo,makeBy:o7,map:a$,mapWithIndex:aK,matchLeft:us,matchRight:uc,max:oL,min:oA,modifyAt:ad,modifyHead:ul,modifyLast:ud,nonEmptyArray:{URI:aX,of:ah,map:aS,mapWithIndex:aw,ap:a_,chain:aI,extend:aO,extract:oj,reduce:ak,foldMap:aC,reduceRight:aN,traverse:aj,sequence:aH,reduceWithIndex:aR,foldMapWithIndex:aD,reduceRightWithIndex:aA,traverseWithIndex:aL,alt:aE},of:ah,prepend:oX,prependAll:ay,prependToAll:ay,prependW:oX,range:at,reduce:aY,reduceRight:aG,reduceRightWithIndex:aZ,reduceWithIndex:aq,replicate:ae,reverse:aa,rotate:o9,sequence:aH,snoc:ug,sort:ac,sortBy:o3,splitAt:aM,tail:ui,traverse:aQ,traverseWithIndex:aJ,unappend:ar,uncons:an,union:o5,uniq:o4,unprepend:an,unsafeInsertAt:o1,unsafeUpdateAt:o2,unsnoc:ar,unzip:ag,updateAt:af,updateHead:uf,updateLast:up,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:am(n,r,function(t,n){return[t,n]})},zipWith:am},Symbol.toStringTag,{value:"Module"}));var uv=function(t){return"number"==typeof t},ub={equals:function(t,n){return t===n}},ux={equals:ub.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},uM={equals:ub.equals,compare:ux.compare,top:1/0,bottom:-1/0},uT={concat:function(t,n){return t-n}},uS={concat:function(t,n){return t+n}},uw={concat:function(t,n){return t*n}},u_={concat:uS.concat,empty:0},uI={concat:uw.concat,empty:1},uO={add:uS.concat,zero:0,mul:uw.concat,one:1,sub:uT.concat,degree:function(t){return 1},div:function(t,n){return t/n},mod:function(t,n){return t%n}};let uk=Object.freeze(Object.defineProperty({__proto__:null,Bounded:uM,Eq:ub,Field:uO,MagmaSub:uT,MonoidProduct:uI,MonoidSum:u_,Ord:ux,SemigroupProduct:uw,SemigroupSum:uS,Show:{show:function(t){return JSON.stringify(t)}},isNumber:uv},Symbol.toStringTag,{value:"Module"}));var uC=function(t,n){return{left:t,right:n}},uN=function(t,n){return nD(t,uR(n))},uj=function(t,n,r){return nD(t,uD(n,r))},uE=function(t){return function(n){return uC(uF(n),t(uz(n)))}},uR=function(t){return function(n){return uC(t(uF(n)),uz(n))}},uD=function(t,n){return function(r){return uC(t(uF(r)),n(uz(r)))}},uA="Separated",uL={URI:uA,map:function(t,n){return nD(t,uE(n))}},uP=rn(uL),uF=function(t){return t.left},uz=function(t){return t.right};let uU=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:uA,mapLeft:uN,bimap:uj},Functor:uL,URI:uA,bimap:uD,flap:uP,left:uF,map:uE,mapLeft:uR,right:uz,separated:uC},Symbol.toStringTag,{value:"Module"}));function uW(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.separate)}}}function uB(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.compact)}}}function uV(t){return function(n){var r=t.wither(n);return function(t){return function(i){return r(i,function(r){return n.map(t(r),function(t){return t?nB(r):nW})})}}}}let u$=Object.freeze(Object.defineProperty({__proto__:null,filterE:uV,wiltDefault:uW,witherDefault:uB},Symbol.toStringTag,{value:"Module"}));function uK(t,n){return function(r){return r?n.of(void 0):t.zero()}}let uY=Object.freeze(Object.defineProperty({__proto__:null,guard:uK},Symbol.toStringTag,{value:"Module"}));var uq=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},uG=function(t){return 0===t.length},uZ=function(t,n){return t<=0?c6:iw(n)(t)},uQ=function(t,n){return uZ(t,function(){return n})},uH=function(t){return nz(t)?c6:[t.value]},uJ=function(t){return nV(t)?c6:[t.right]},uX=function(t,n){return function(r){return nG(r)?n(r):t()}},u0=function(t,n){return function(r){return nG(r)?n(oj(r),oE(r)):t()}},u1=function(t,n){return function(r){return nG(r)?n(oD(r),oR(r)):t()}},u2=function(t){return function(n){if(uG(n))return c6;for(var r=[],i=0;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},u4=function(t,n){return function(r){var i=r.length,o=Array(i+1);o[0]=t;for(var a=0;a<i;a++)o[a+1]=n(o[a],r[a]);return o}},u3=function(t,n){return function(r){var i=r.length,o=Array(i+1);o[i]=t;for(var a=i-1;a>=0;a--)o[a]=n(r[a],o[a+1]);return o}},u5=function(t){return t.length};function u9(t,n){return void 0===n?function(n){return u9(t,n)}:ih(t,n)?nW:nB(n[t])}var u8=function(t){return nG(t)?nB(oj(t)):nW},u6=function(t){return nG(t)?nB(oR(t)):nW},u7=function(t){return nG(t)?nB(oE(t)):nW},se=function(t){return nG(t)?nB(oD(t)):nW},st=function(t){return function(n){return ih(t,n)?n:0===t?c6:n.slice(0,t)}},sn=function(t){return function(n){return ih(t,n)?n:0===t?c6:n.slice(-t)}},sr=function(t,n){for(var r=t.length,i=0;i<r&&n(t[i]);i++);return i},si=function(t){return function(n){return t<=0||uG(n)?n:t>=n.length?c6:n.slice(t,n.length)}},so=function(t){return function(n){return t<=0||uG(n)?n:t>=n.length?c6:n.slice(0,n.length-t)}},sa=function(t){return function(n){for(var r=0;r<n.length;r++)if(t(n[r]))return nB(r);return nW}};function su(t){return function(n){for(var r=0;r<n.length;r++)if(t(n[r]))return nB(n[r]);return nW}}var ss=function(t){return function(n){for(var r=0;r<n.length;r++){var i=t(n[r]);if(nU(i))return i}return nW}};function sc(t){return function(n){for(var r=n.length-1;r>=0;r--)if(t(n[r]))return nB(n[r]);return nW}}var sl=function(t){return function(n){for(var r=n.length-1;r>=0;r--){var i=t(n[r]);if(nU(i))return i}return nW}},sf=function(t){return function(n){for(var r=n.length-1;r>=0;r--)if(t(n[r]))return nB(r);return nW}},sd=function(t,n){return function(r){return t<0||t>r.length?nW:nB(iy(t,n,r))}},sp=function(t,n){return sm(t,function(){return n})},sh=function(t){return function(n){return ih(t,n)?nW:nB(c5(t,n))}},sm=function(t,n){return function(r){return ih(t,r)?nW:nB(c3(t,n(r[t]),r))}},sg=function(t){return t.length<=1?t:t.slice().reverse()},sy=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Right"===i._tag&&n.push(i.right)}return n},sv=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Left"===i._tag&&n.push(i.left)}return n},sb=function(t){return function(n){return n.length<=1?n:n.slice().sort(t.compare)}},sx=function(t,n,r){for(var i=[],o=Math.min(t.length,n.length),a=0;a<o;a++)i[a]=r(t[a],n[a]);return i},sM=function(t){for(var n=[],r=[],i=0;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},sT=function(t){var n=iU(t);return function(t){return nG(t)?n(t):t}},sS=function(t){var n=iW(t);return function(t){return nG(t)?n(t):t}},sw=function(t){var n=iT(t);return function(t){return nG(t)?n(t):t}};function s_(t){return function(n,r){if(void 0===r){var i,o=s_(t);return function(t){return o(n,t)}}for(var a=0;a<r.length;a++)if(i=r[a],t.equals(i,n))return!0;return!1}}var sI=function(t){var n=ib(t);return function(t){return nG(t)?n(t):t}},sO=function(t){var n=ix(t);return function(t){return nG(t)?n(t):t}},sk=function(t){var n=iV(t);return function(t){return nG(t)?n(t):c6}},sC=function(t){return function(n){return t>=1&&nG(n)?i$(t)(n):uG(n)?[n,c6]:[c6,n]}},sN=function(t){var n=iK(t);return function(t){return nG(t)?n(t):c6}},sj=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return uH(t.apply(void 0,n))}},sE=function(t){return function(n){return uG(n)?t:uG(t)?n:n.concat(t)}};function sR(t){var n=iM(t);return function(r,i){if(void 0===i){var o=sR(t);return function(t){return o(t,r)}}return nG(r)&&nG(i)?n(i)(r):nG(r)?r:i}}function sD(t){var n=s_(t);return function(r,i){if(void 0===i){var o=sD(t);return function(t){return o(t,r)}}return r.filter(function(t){return n(t,i)})}}function sA(t){var n=s_(t);return function(r,i){if(void 0===i){var o=sA(t);return function(t){return o(t,r)}}return r.filter(function(t){return!n(t,i)})}}var sL=function(t,n){return nD(t,cn(n))},sP=function(t,n){return nD(t,cr(n))},sF=function(t,n){return nD(t,s7(n))},sz=function(t,n){return nD(t,ce(n))},sU=function(t,n){return nD(t,co(n))},sW=function(t,n){return nD(t,cu(n))},sB=function(t,n){return nD(t,cc(n))},sV=function(t,n){return nD(t,cf(n))},s$=function(t,n){return nD(t,cl(n))},sK=function(t,n){return nD(t,cd(n))},sY=function(t,n){return nD(t,s6(n))},sq=function(t,n,r){return nD(t,cy(n,r))},sG=function(t){var n=cv(t);return function(t,r){return nD(t,n(r))}},sZ=function(t,n,r){return nD(t,cx(n,r))},sQ=function(t,n,r){return nD(t,cb(n,r))},sH=function(t){var n=cg(t);return function(t,r){return nD(t,n(r))}},sJ=function(t,n,r){return nD(t,cM(n,r))},sX=function(t,n){return nD(t,ca(n))},s0=function(t,n){return nD(t,cp(n))},s1=function(t,n){return nD(t,ch(n))},s2=function(t){var n=cT(t);return function(t,r){return nD(t,n(r))}},s4=function(t){var n=cw(t);return function(t,r){return nD(t,n(r))}},s3=function(t,n){return nD(t,cQ(n))},s5=function(t,n){return nD(t,cH(n))},s9=function(){return c6},s8=function(t){return function(n){return n.concat(t())}},s6=s8,s7=function(t){return ce(function(n){return nD(t,cn(n))})},ce=function(t){return function(n){return nD(n,u2(function(n,r){return t(r)}))}},ct=ce(nS),cn=function(t){return function(n){return n.map(function(n){return t(n)})}},cr=function(t){return function(n){return n.map(function(n,r){return t(r,n)})}},ci=function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];"Left"===o._tag?n.push(o.left):r.push(o.right)}return uC(n,r)},co=function(t){return function(n){return n.filter(t)}},ca=function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=t(i,n[i]);nU(o)&&r.push(o.value)}return r}},cu=function(t){return ca(function(n,r){return t(r)})},cs=cu(nS),cc=function(t){return cl(function(n,r){return t(r)})},cl=function(t){return function(n){for(var r=[],i=[],o=0;o<n.length;o++){var a=n[o];t(o,a)?i.push(a):r.push(a)}return uC(r,i)}},cf=function(t){return cd(function(n,r){return t(r)})},cd=function(t){return function(n){for(var r=[],i=[],o=0;o<n.length;o++){var a=t(o,n[o]);"Left"===a._tag?r.push(a.left):i.push(a.right)}return uC(r,i)}},cp=function(t){return function(n){return n.filter(function(n,r){return t(r,n)})}},ch=function(t){return function(n){return n.map(function(r,i){return t(n.slice(i))})}},cm=ch(nS),cg=function(t){return function(n){return function(r){return r.reduce(function(r,i,o){return t.concat(r,n(o,i))},t.empty)}}},cy=function(t,n){return cb(t,function(t,r,i){return n(r,i)})},cv=function(t){var n=cg(t);return function(t){return n(function(n,r){return t(r)})}},cb=function(t,n){return function(r){for(var i=r.length,o=t,a=0;a<i;a++)o=n(a,o,r[a]);return o}},cx=function(t,n){return cM(t,function(t,r,i){return n(r,i)})},cM=function(t,n){return function(r){return r.reduceRight(function(t,r,i){return n(i,r,t)},t)}},cT=function(t){var n=cw(t);return function(t){return n(function(n,r){return t(r)})}},cS=function(t){return function(n){return sq(n,t.of(s9()),function(n,r){return t.ap(t.map(n,function(t){return function(n){return nD(t,ig(n))}}),r)})}},cw=function(t){return function(n){return cb(t.of(s9()),function(r,i,o){return t.ap(t.map(i,function(t){return function(n){return nD(t,ig(n))}}),n(r,o))})}},c_=function(t){var n=cJ(t);return function(t){return function(r){return n(r,t)}}},cI=function(t){var n=cX(t);return function(t){return function(r){return n(r,t)}}},cO=function(t,n){for(var r=[],i=t;;){var o=n(i);if(nU(o)){var a=o.value,u=a[0],s=a[1];r.push(u),i=s}else break}return r},ck="ReadonlyArray",cC=function(t){return{show:function(n){return"[".concat(n.map(t.show).join(", "),"]")}}},cN=function(){return{concat:function(t,n){return uG(t)?n:uG(n)?t:t.concat(n)}}},cj=function(){return{concat:cN().concat,empty:c6}},cE=function(t){return rM(function(n,r){return n.length===r.length&&n.every(function(n,i){return t.equals(n,r[i])})})},cR=function(t){return rR(function(n,r){for(var i=n.length,o=r.length,a=Math.min(i,o),u=0;u<a;u++){var s=t.compare(n[u],r[u]);if(0!==s)return s}return ux.compare(i,o)})},cD=function(t){var n=sR(t);return{concat:function(t,r){return n(r)(t)}}},cA=function(t){return{concat:cD(t).concat,empty:c6}},cL=function(t){var n=sD(t);return{concat:function(t,r){return n(r)(t)}}},cP=function(t){var n=sA(t);return{concat:function(t,r){return n(r)(t)}}},cF={URI:ck,map:sL},cz=rn(cF),cU={URI:ck,of:nq},cW={URI:ck,map:sL,ap:sF},cB=n2(cW),cV=n4(cW),c$={URI:ck,map:sL,ap:sF,chain:sz},cK=rc(c$),cY={URI:ck,zero:s9},cq=uK(cY,cU),cG={URI:ck,compact:cs,separate:ci},cZ={URI:ck,map:sL,reduce:sq,foldMap:sG,reduceRight:sZ,traverse:s2,sequence:cS},cQ=function(t){return function(n){for(var r=uq([],t(n),!0),i=[];r.length>0;){var o=r.shift();nV(o)?r.unshift.apply(r,t(o.left)):i.push(o.right)}return i}},cH=function(t){return function(n){var r=t(n),i=[],o=[];function a(n){nV(n)?t(n.left).forEach(function(t){return i.push(t)}):o.push(n.right)}for(var u=0;u<r.length;u++)a(r[u]);for(;i.length>0;)a(i.shift());return o}},cJ=uB(cZ,cG),cX=uW(cZ,cG),c0={URI:ck,map:sL,compact:cs,separate:ci,filter:sU,filterMap:sW,partition:sB,partitionMap:sV,reduce:sq,foldMap:sG,reduceRight:sZ,traverse:s2,sequence:cS,wither:cJ,wilt:cX},c1=uV(c0),c2={URI:ck,fromEither:uJ},c4=rg(c2),c3=function(t,n,r){return nG(r)?iv(t,n,r):r},c5=function(t,n){var r=n.slice();return r.splice(t,1),r},c9=function(t){return t.slice()},c8=function(t){return uG(t)?c6:t.slice()},c6=nH;function c7(t){return function(n){return n.every(t)}}var le=function(t){return function(n){return n.some(t)}},lt=function(t){var n=o$(t);return function(r){return uX(function(){return t.empty},n(r))}},ln=nq(nJ),lr=rr(cF),li=rl(c$),lo=n3(cW);let la=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:ck,map:sL,alt:sY},Alternative:{URI:ck,map:sL,ap:sF,of:nq,alt:sY,zero:s9},Applicative:{URI:ck,map:sL,ap:sF,of:nq},Apply:cW,Chain:c$,ChainRecBreadthFirst:{URI:ck,map:sL,ap:sF,chain:sz,chainRec:s5},ChainRecDepthFirst:{URI:ck,map:sL,ap:sF,chain:sz,chainRec:s3},Compactable:cG,Do:ln,Extend:{URI:ck,map:sL,extend:s1},Filterable:{URI:ck,map:sL,compact:cs,separate:ci,filter:sU,filterMap:sW,partition:sB,partitionMap:sV},FilterableWithIndex:{URI:ck,map:sL,mapWithIndex:sP,compact:cs,separate:ci,filter:sU,filterMap:sW,partition:sB,partitionMap:sV,partitionMapWithIndex:sK,partitionWithIndex:s$,filterMapWithIndex:sX,filterWithIndex:s0},Foldable:{URI:ck,reduce:sq,foldMap:sG,reduceRight:sZ},FoldableWithIndex:{URI:ck,reduce:sq,foldMap:sG,reduceRight:sZ,reduceWithIndex:sQ,foldMapWithIndex:sH,reduceRightWithIndex:sJ},FromEither:c2,Functor:cF,FunctorWithIndex:{URI:ck,map:sL,mapWithIndex:sP},Monad:{URI:ck,map:sL,ap:sF,of:nq,chain:sz},Pointed:cU,Traversable:cZ,TraversableWithIndex:{URI:ck,map:sL,mapWithIndex:sP,reduce:sq,foldMap:sG,reduceRight:sZ,reduceWithIndex:sQ,foldMapWithIndex:sH,reduceRightWithIndex:sJ,traverse:s2,sequence:cS,traverseWithIndex:s4},URI:ck,Unfoldable:{URI:ck,unfold:cO},Witherable:c0,Zero:cY,_chainRecBreadthFirst:s5,_chainRecDepthFirst:s3,alt:s6,altW:s8,ap:s7,apFirst:cB,apS:lo,apSecond:cV,append:ig,appendW:ig,bind:li,bindTo:lr,chain:ce,chainFirst:cK,chainRecBreadthFirst:cH,chainRecDepthFirst:cQ,chainWithIndex:u2,chop:sk,chunksOf:sN,compact:cs,comprehension:function(t,n,r){void 0===r&&(r=function(){return!0});var i=function(t,o){return nG(o)?nD(oj(o),ce(function(n){return i(nD(t,ig(n)),oE(o))})):r.apply(void 0,t)?[n.apply(void 0,t)]:c6};return i(c6,t)},concat:sE,concatW:sE,cons:oY,deleteAt:sh,difference:sA,dropLeft:si,dropLeftWhile:function(t){return function(n){var r=sr(n,t);return 0===r?n:r===n.length?c6:n.slice(r)}},dropRight:so,duplicate:cm,elem:s_,empty:c6,every:c7,exists:le,extend:ch,filter:co,filterE:c1,filterMap:cu,filterMapWithIndex:ca,filterWithIndex:cp,findFirst:su,findFirstMap:ss,findIndex:sa,findLast:sc,findLastIndex:sf,findLastMap:sl,flap:cz,flatten:ct,foldLeft:u0,foldMap:cv,foldMapWithIndex:cg,foldRight:u1,fromArray:c8,fromEither:uJ,fromEitherK:c4,fromOption:uH,fromOptionK:sj,fromPredicate:function(t){return function(n){return t(n)?[n]:c6}},getDifferenceMagma:cP,getEq:cE,getIntersectionSemigroup:cL,getMonoid:cj,getOrd:cR,getSemigroup:cN,getShow:cC,getUnionMonoid:cA,getUnionSemigroup:cD,guard:cq,head:u8,init:se,insertAt:sd,intercalate:lt,intersection:sD,intersperse:sS,isEmpty:uG,isNonEmpty:nG,isOutOfBound:ih,last:u6,lefts:sv,lookup:u9,makeBy:uZ,map:cn,mapWithIndex:cr,match:uX,matchLeft:u0,matchLeftW:u0,matchRight:u1,matchRightW:u1,matchW:uX,modifyAt:sm,of:nq,partition:cc,partitionMap:cf,partitionMapWithIndex:cd,partitionWithIndex:cl,prepend:im,prependAll:sT,prependToAll:sT,prependW:im,range:iI,readonlyArray:{URI:ck,compact:cs,separate:ci,map:sL,ap:sF,of:nq,chain:sz,filter:sU,filterMap:sW,partition:sB,partitionMap:sV,mapWithIndex:sP,partitionMapWithIndex:sK,partitionWithIndex:s$,filterMapWithIndex:sX,filterWithIndex:s0,alt:sY,zero:s9,unfold:cO,reduce:sq,foldMap:sG,reduceRight:sZ,traverse:s2,sequence:cS,reduceWithIndex:sQ,foldMapWithIndex:sH,reduceRightWithIndex:sJ,traverseWithIndex:s4,extend:s1,wither:cJ,wilt:cX},reduce:cy,reduceRight:cx,reduceRightWithIndex:cM,reduceWithIndex:cb,replicate:uQ,reverse:sg,rights:sy,rotate:sw,scanLeft:u4,scanRight:u3,separate:ci,sequence:cS,size:u5,snoc:oq,some:le,sort:sb,sortBy:sO,spanLeft:function(t){return function(n){var r,i=sC(sr(n,t))(n);return{init:i[0],rest:i[1]}}},splitAt:sC,tail:u7,takeLeft:st,takeLeftWhile:function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=n[i];if(!t(o))break;r.push(o)}var a=r.length;return a===n.length?n:0===a?c6:r}},takeRight:sn,toArray:c9,traverse:cT,traverseWithIndex:cw,unfold:cO,union:sR,uniq:sI,unsafeDeleteAt:c5,unsafeInsertAt:iy,unsafeUpdateAt:c3,unzip:sM,updateAt:sp,wilt:cI,wither:c_,zero:s9,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:sx(n,r,function(t,n){return[t,n]})},zipWith:sx},Symbol.toStringTag,{value:"Module"}));var lu=function(t){return 0===t.length},ls=function(t,n){return t<=0?[]:o7(n)(t)},lc=function(t,n){return ls(t,function(){return n})},ll=function(t){return nz(t)?[]:[t.value]},lf=function(t){return nV(t)?[]:[t.right]},ld=function(t,n){return function(r){return oH(r)?n(r):t()}},lp=function(t,n){return function(r){return oH(r)?n(ur(r),ui(r)):t()}},lh=function(t,n){return function(r){return oH(r)?n(ua(r),uo(r)):t()}},lm=function(t){return function(n){for(var r=[],i=0;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},lg=function(t,n){return function(r){var i=r.length,o=Array(i+1);o[0]=t;for(var a=0;a<i;a++)o[a+1]=n(o[a],r[a]);return o}},ly=function(t,n){return function(r){var i=r.length,o=Array(i+1);o[i]=t;for(var a=i-1;a>=0;a--)o[a]=n(r[a],o[a+1]);return o}},lv=function(t){return t.length},lb=function(t){return oH(t)?nB(ui(t)):nW},lx=function(t){return oH(t)?nB(ua(t)):nW},lM=function(t){return function(n){return oJ(t,n)?lk(n):n.slice(0,t)}},lT=function(t){return function(n){return oJ(t,n)?lk(n):0===t?[]:n.slice(-t)}},lS=function(t,n){for(var r=t.length,i=0;i<r&&n(t[i]);i++);return i},lw=function(t){return function(n){return t<=0||lu(n)?lk(n):t>=n.length?[]:n.slice(t,n.length)}},l_=function(t){return function(n){return t<=0||lu(n)?lk(n):t>=n.length?[]:n.slice(0,n.length-t)}};function lI(t){return su(t)}function lO(t){return sc(t)}var lk=function(t){return t.slice()},lC=function(t,n){return function(r){return t<0||t>r.length?nW:nB(di(t,n,r))}},lN=function(t,n){return lE(t,function(){return n})},lj=function(t){return function(n){return oJ(t,n)?nW:nB(du(t,n))}},lE=function(t,n){return function(r){return oJ(t,r)?nW:nB(da(t,n(r[t]),r))}},lR=function(t){return lu(t)?[]:t.slice().reverse()},lD=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Right"===i._tag&&n.push(i.right)}return n},lA=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Left"===i._tag&&n.push(i.left)}return n},lL=function(t){return function(n){return n.length<=1?lk(n):n.slice().sort(t.compare)}},lP=function(t,n,r){for(var i=[],o=Math.min(t.length,n.length),a=0;a<o;a++)i[a]=r(t[a],n[a]);return i},lF=function(t){for(var n=[],r=[],i=0;i<t.length;i++)n[i]=t[i][0],r[i]=t[i][1];return[n,r]},lz=function(t){var n=ay(t);return function(t){return oH(t)?n(t):[]}},lU=function(t){var n=av(t);return function(t){return oH(t)?n(t):lk(t)}},lW=function(t){var n=o9(t);return function(t){return oH(t)?n(t):lk(t)}},lB=function(t){var n=o4(t);return function(t){return oH(t)?n(t):lk(t)}},lV=function(t){var n=o3(t);return function(t){return oH(t)?n(t):lk(t)}},l$=function(t){var n=ax(t);return function(t){return oH(t)?n(t):[]}},lK=function(t){return function(n){return t>=1&&oH(n)?aM(t)(n):lu(n)?[lk(n),[]]:[[],lk(n)]}},lY=function(t){var n=aT(t);return function(t){return oH(t)?n(t):[]}},lq=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return ll(t.apply(void 0,n))}},lG=function(t){return function(n){return lu(n)?lk(t):lu(t)?lk(n):n.concat(t)}};function lZ(t){var n=o5(t);return function(r,i){if(void 0===i){var o=lZ(t);return function(t){return o(t,r)}}return oH(r)&&oH(i)?n(i)(r):oH(r)?lk(r):lk(i)}}function lQ(t){var n=s_(t);return function(r,i){if(void 0===i){var o=lQ(t);return function(t){return o(t,r)}}return r.filter(function(t){return n(t,i)})}}function lH(t){var n=s_(t);return function(r,i){if(void 0===i){var o=lH(t);return function(t){return o(t,r)}}return r.filter(function(t){return!n(t,i)})}}var lJ=function(t,n){return nD(t,ff(n))},lX=function(t,n){return nD(t,fm(n))},l0=function(t,n){return nD(t,fd(n))},l1=function(t,n){return nD(t,fp(n))},l2=function(t,n){return nD(t,fx(n))},l4=function(t,n){return nD(t,fy(n))},l3=function(t,n){return nD(t,fM(n))},l5=function(t,n){return nD(t,fS(n))},l9=function(t,n){return nD(t,fT(n))},l8=function(t,n){return nD(t,fw(n))},l6=function(t,n){return nD(t,fI(n))},l7=function(t,n,r){return nD(t,fE(n,r))},fe=function(t){var n=fN(t);return function(t,r){return nD(t,n(r))}},ft=function(t,n,r){return nD(t,fD(n,r))},fn=function(t,n,r){return nD(t,fR(n,r))},fr=function(t){var n=fj(t);return function(t,r){return nD(t,n(r))}},fi=function(t,n,r){return nD(t,fA(n,r))},fo=function(t,n){return nD(t,fg(n))},fa=function(t,n){return nD(t,fO(n))},fu=function(t,n){return nD(t,fk(n))},fs=function(t){var n=fL(t);return function(t,r){return nD(t,n(r))}},fc=function(t){var n=fF(t);return function(t,r){return nD(t,n(r))}},fl=function(){return[]},ff=function(t){return function(n){return n.map(function(n){return t(n)})}},fd=function(t){return fp(function(n){return nD(t,ff(n))})},fp=function(t){return function(n){return nD(n,lm(function(n,r){return t(r)}))}},fh=fp(nS),fm=function(t){return function(n){return n.map(function(n,r){return t(r,n)})}},fg=function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=t(i,n[i]);nU(o)&&r.push(o.value)}return r}},fy=function(t){return fg(function(n,r){return t(r)})},fv=fy(nS),fb=function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];"Left"===o._tag?n.push(o.left):r.push(o.right)}return uC(n,r)},fx=function(t){return function(n){return n.filter(t)}},fM=function(t){return fT(function(n,r){return t(r)})},fT=function(t){return function(n){for(var r=[],i=[],o=0;o<n.length;o++){var a=n[o];t(o,a)?i.push(a):r.push(a)}return uC(r,i)}},fS=function(t){return fw(function(n,r){return t(r)})},fw=function(t){return function(n){for(var r=[],i=[],o=0;o<n.length;o++){var a=t(o,n[o]);"Left"===a._tag?r.push(a.left):i.push(a.right)}return uC(r,i)}},f_=function(t){return function(n){return n.concat(t())}},fI=f_,fO=function(t){return function(n){return n.filter(function(n,r){return t(r,n)})}},fk=function(t){return function(n){return n.map(function(r,i){return t(n.slice(i))})}},fC=fk(nS),fN=cv,fj=cg,fE=cy,fR=cb,fD=cx,fA=cM,fL=function(t){var n=fF(t);return function(t){return n(function(n,r){return t(r)})}},fP=function(t){return function(n){return l7(n,t.of(fl()),function(n,r){return t.ap(t.map(n,function(t){return function(n){return nD(t,o0(n))}}),r)})}},fF=function(t){return function(n){return fR(t.of(fl()),function(r,i,o){return t.ap(t.map(i,function(t){return function(n){return nD(t,o0(n))}}),n(r,o))})}},fz=function(t){var n=f6(t);return function(t){return function(r){return n(r,t)}}},fU=function(t){var n=f7(t);return function(t){return function(r){return n(r,t)}}},fW=function(t,n){for(var r=[],i=t;;){var o=n(i);if(nU(o)){var a=o.value,u=a[0],s=a[1];r.push(u),i=s}else break}return r},fB="Array",fV=function(){return{concat:function(t,n){return t.concat(n)}}},f$=function(){return{concat:fV().concat,empty:[]}},fK=function(t){var n=lZ(t);return{concat:function(t,r){return n(r)(t)}}},fY=function(t){return{concat:fK(t).concat,empty:[]}},fq=function(t){var n=lQ(t);return{concat:function(t,r){return n(r)(t)}}},fG=function(t){var n=lH(t);return{concat:function(t,r){return n(r)(t)}}},fZ={URI:fB,map:lJ},fQ=rn(fZ),fH={URI:fB,of:ah},fJ={URI:fB,map:lJ,ap:l0},fX=n2(fJ),f0=n4(fJ),f1={URI:fB,map:lJ,ap:l0,chain:l1},f2=rc(f1),f4={URI:fB,zero:fl},f3=uK(f4,fH),f5={URI:fB,compact:fv,separate:fb},f9={URI:fB,reduce:l7,foldMap:fe,reduceRight:ft},f8={URI:fB,map:lJ,reduce:l7,foldMap:fe,reduceRight:ft,traverse:fs,sequence:fP},f6=uB(f8,f5),f7=uW(f8,f5),de={URI:fB,map:lJ,compact:fv,separate:fb,filter:l2,filterMap:l4,partition:l3,partitionMap:l5,reduce:l7,foldMap:fe,reduceRight:ft,traverse:fs,sequence:fP,wither:f6,wilt:f7},dt=uV(de),dn={URI:fB,fromEither:lf},dr=rg(dn),di=o1,da=function(t,n,r){return oH(r)?o2(t,n,r):[]},du=function(t,n){var r=n.slice();return r.splice(t,1),r},ds=function(t){return function(n){return n.some(t)}},dc=ah(nJ),dl=rr(fZ),df=rl(f1),dd=n3(fJ);let dp=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:fB,map:lJ,alt:l6},Alternative:{URI:fB,map:lJ,ap:l0,of:ah,alt:l6,zero:fl},Applicative:{URI:fB,map:lJ,ap:l0,of:ah},Apply:fJ,Chain:f1,ChainRecBreadthFirst:{URI:fB,map:lJ,ap:l0,chain:l1,chainRec:s5},ChainRecDepthFirst:{URI:fB,map:lJ,ap:l0,chain:l1,chainRec:s3},Compactable:f5,Do:dc,Extend:{URI:fB,map:lJ,extend:fu},Filterable:{URI:fB,map:lJ,compact:fv,separate:fb,filter:l2,filterMap:l4,partition:l3,partitionMap:l5},FilterableWithIndex:{URI:fB,map:lJ,mapWithIndex:lX,compact:fv,separate:fb,filter:l2,filterMap:l4,partition:l3,partitionMap:l5,partitionMapWithIndex:l8,partitionWithIndex:l9,filterMapWithIndex:fo,filterWithIndex:fa},Foldable:f9,FoldableWithIndex:{URI:fB,reduce:l7,foldMap:fe,reduceRight:ft,reduceWithIndex:fn,foldMapWithIndex:fr,reduceRightWithIndex:fi},FromEither:dn,Functor:fZ,FunctorWithIndex:{URI:fB,map:lJ,mapWithIndex:lX},Monad:{URI:fB,map:lJ,ap:l0,of:ah,chain:l1},Pointed:fH,Traversable:f8,TraversableWithIndex:{URI:fB,map:lJ,mapWithIndex:lX,reduce:l7,foldMap:fe,reduceRight:ft,reduceWithIndex:fn,foldMapWithIndex:fr,reduceRightWithIndex:fi,traverse:fs,sequence:fP,traverseWithIndex:fc},URI:fB,Unfoldable:{URI:fB,unfold:fW},Witherable:de,Zero:f4,alt:fI,altW:f_,ap:fd,apFirst:fX,apS:dd,apSecond:f0,append:o0,appendW:o0,array:{URI:fB,compact:fv,separate:fb,map:lJ,ap:l0,of:ah,chain:l1,filter:l2,filterMap:l4,partition:l3,partitionMap:l5,mapWithIndex:lX,partitionMapWithIndex:l8,partitionWithIndex:l9,filterMapWithIndex:fo,filterWithIndex:fa,alt:l6,zero:fl,unfold:fW,reduce:l7,foldMap:fe,reduceRight:ft,traverse:fs,sequence:fP,reduceWithIndex:fn,foldMapWithIndex:fr,reduceRightWithIndex:fi,traverseWithIndex:fc,extend:fu,wither:f6,wilt:f7},bind:df,bindTo:dl,chain:fp,chainFirst:f2,chainRecBreadthFirst:cH,chainRecDepthFirst:cQ,chainWithIndex:lm,chop:l$,chunksOf:lY,compact:fv,comprehension:function(t,n,r){void 0===r&&(r=function(){return!0});var i=function(t,o){return oH(o)?nD(ur(o),fp(function(n){return i(nD(t,o0(n)),ui(o))})):r.apply(void 0,t)?[n.apply(void 0,t)]:[]};return i([],t)},concat:lG,concatW:lG,cons:um,copy:lk,deleteAt:lj,difference:lH,dropLeft:lw,dropLeftWhile:function(t){return function(n){return n.slice(lS(n,t))}},dropRight:l_,duplicate:fC,elem:s_,empty:[],every:c7,exists:ds,extend:fk,filter:fx,filterE:dt,filterMap:fy,filterMapWithIndex:fg,filterWithIndex:fO,findFirst:lI,findFirstMap:ss,findIndex:sa,findLast:lO,findLastIndex:sf,findLastMap:sl,flap:fQ,flatten:fh,foldLeft:lp,foldMap:fN,foldMapWithIndex:fj,foldRight:lh,fromEither:lf,fromEitherK:dr,fromOption:ll,fromOptionK:lq,fromPredicate:function(t){return function(n){return t(n)?[n]:[]}},getDifferenceMagma:fG,getEq:cE,getIntersectionSemigroup:fq,getMonoid:f$,getOrd:cR,getSemigroup:fV,getShow:cC,getUnionMonoid:fY,getUnionSemigroup:fK,guard:f3,head:u8,init:lx,insertAt:lC,intercalate:lt,intersection:lQ,intersperse:lU,isEmpty:lu,isNonEmpty:oH,isOutOfBound:oJ,last:u6,lefts:lA,lookup:u9,makeBy:ls,map:ff,mapWithIndex:fm,match:ld,matchLeft:lp,matchLeftW:lp,matchRight:lh,matchRightW:lh,matchW:ld,modifyAt:lE,of:ah,partition:fM,partitionMap:fS,partitionMapWithIndex:fw,partitionWithIndex:fT,prepend:oX,prependAll:lz,prependToAll:lz,prependW:oX,range:at,reduce:fE,reduceRight:fD,reduceRightWithIndex:fA,reduceWithIndex:fR,replicate:lc,reverse:lR,rights:lD,rotate:lW,scanLeft:lg,scanRight:ly,separate:fb,sequence:fP,size:lv,snoc:ug,some:ds,sort:lL,sortBy:lV,spanLeft:function(t){return function(n){var r,i=lK(lS(n,t))(n);return{init:i[0],rest:i[1]}}},splitAt:lK,tail:lb,takeLeft:lM,takeLeftWhile:function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=n[i];if(!t(o))break;r.push(o)}return r}},takeRight:lT,traverse:fL,traverseWithIndex:fF,unfold:fW,union:lZ,uniq:lB,unsafeDeleteAt:du,unsafeInsertAt:di,unsafeUpdateAt:da,unzip:lF,updateAt:lN,wilt:fU,wither:fz,zero:fl,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:lP(n,r,function(t,n){return[t,n]})},zipWith:lP},Symbol.toStringTag,{value:"Module"})),dh=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var dm=function(t){return"boolean"==typeof t},dg=function(t,n){return function(r){return r?n():t()}},dy={equals:function(t,n){return t===n}},dv={concat:function(t,n){return t&&n}},db={concat:function(t,n){return t||n}},dx={concat:dv.concat,empty:!0},dM={concat:db.concat,empty:!1},dT={equals:dy.equals,compare:function(t,n){return t<n?-1:t>n?1:0}};let dS=Object.freeze(Object.defineProperty({__proto__:null,BooleanAlgebra:{meet:function(t,n){return t&&n},join:function(t,n){return t||n},zero:!1,one:!0,implies:function(t,n){return!t||n},not:function(t){return!t}},Eq:dy,MonoidAll:dx,MonoidAny:dM,Ord:dT,SemigroupAll:dv,SemigroupAny:db,Show:{show:function(t){return JSON.stringify(t)}},fold:dg,foldW:dg,isBoolean:dm,match:dg,matchW:dg},Symbol.toStringTag,{value:"Module"}));var dw=function(t){return{meet:function(n,r){return t.join(n,r)},join:function(n,r){return t.meet(n,r)},zero:t.one,one:t.zero,implies:function(n,r){return t.join(t.not(n),r)},not:t.not}};let d_=Object.freeze(Object.defineProperty({__proto__:null,booleanAlgebraBoolean:{meet:function(t,n){return t&&n},join:function(t,n){return t||n},zero:!1,one:!0,implies:function(t,n){return!t||n},not:function(t){return!t}},booleanAlgebraVoid:{meet:function(){},join:function(){},zero:void 0,one:void 0,implies:function(){},not:function(){}},getDualBooleanAlgebra:dw,getFunctionBooleanAlgebra:ny,reverse:dw},Symbol.toStringTag,{value:"Module"}));var dI=function(t){return rG(t)(t.bottom,t.top)},dO=function(t){var n=rA(t);return{equals:n.equals,compare:n.compare,top:t.bottom,bottom:t.top}},dk={equals:rQ.equals,compare:rQ.compare,top:1/0,bottom:-1/0};let dC=Object.freeze(Object.defineProperty({__proto__:null,boundedNumber:dk,clamp:dI,reverse:dO},Symbol.toStringTag,{value:"Module"}));function dN(t){return{meet:rY(t),join:rq(t)}}let dj=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:dN},Symbol.toStringTag,{value:"Module"})),dE=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:function(t){var n=dN(t);return function(t,r){return{join:n.join,meet:n.meet,zero:t,one:r}}}},Symbol.toStringTag,{value:"Module"})),dR=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),dD=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),dA=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),dL=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var dP=function(t,n){for(var r=n(t);"Left"===r._tag;)r=n(r.left);return r.right};let dF=Object.freeze(Object.defineProperty({__proto__:null,tailRec:dP},Symbol.toStringTag,{value:"Module"}));function dz(t,n){return function(r,i){return n.compose(t.right(i),t.left(r))}}function dU(t,n){var r=dz(t,n);return function(i,o){return n.compose(t.promap(n.id(),function(t){return"Left"===t._tag?t.left:t.right},nS),r(i,o))}}let dW=Object.freeze(Object.defineProperty({__proto__:null,fanIn:dU,fanin:function(t){return dU(t,t)},split:dz,splitChoice:function(t){return dz(t,t)}},Symbol.toStringTag,{value:"Module"})),dB=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var dV=function(t,n){return nD(t,d$(n))},d$=function(t){return function(n){return nC(t,n)}},dK="Predicate",dY=function(){return{concat:function(t,n){return nD(t,dH(n))}}},dq=function(){return{concat:dY().concat,empty:nI}},dG=function(){return{concat:function(t,n){return nD(t,dJ(n))}}},dZ=function(){return{concat:dG().concat,empty:n_}},dQ=function(t){return function(n){return!t(n)}},dH=function(t){return function(n){return function(r){return n(r)||t(r)}}},dJ=function(t){return function(n){return function(r){return n(r)&&t(r)}}};let dX=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:{URI:dK,contramap:dV},URI:dK,and:dJ,contramap:d$,getMonoidAll:dZ,getMonoidAny:dq,getSemigroupAll:dG,getSemigroupAny:dY,not:dQ,or:dH},Symbol.toStringTag,{value:"Module"}));function d0(t){return function(n){return t(n)?nB(n):nW}}var d1=function(t){return"Right"===t._tag?nW:nB(t.left)},d2=function(t){return"Left"===t._tag?nW:nB(t.right)},d4=function(t,n){return nD(t,pf(n))},d3=function(t,n){return nD(t,ph(n))},d5=function(t,n){return nD(t,py(n))},d9=function(t,n,r){return nD(t,pb(n,r))},d8=function(t){var n=px(t);return function(t,r){return nD(t,n(r))}},d6=function(t,n,r){return nD(t,pM(n,r))},d7=function(t){var n=pP(t);return function(t,r){return nD(t,n(r))}},pe=function(t,n){return nD(t,pS(n))},pt=function(t,n){return nD(t,pE(n))},pn=function(t,n){return nD(t,pR(n))},pr=function(t,n){return nD(t,pO(n))},pi=function(t,n){return nD(t,pD(n))},po=function(t,n){return nD(t,pA(n))},pa="Option",pu=function(t){return{show:function(n){return pq(n)?"none":"some(".concat(t.show(n.value),")")}}},ps=function(t){return{equals:function(n,r){return n===r||(pq(n)?pq(r):!pq(r)&&t.equals(n.value,r.value))}}},pc=function(t){return{equals:ps(t).equals,compare:function(n,r){return n===r?0:pY(n)?pY(r)?t.compare(n.value,r.value):1:-1}}},pl=function(t){return{concat:function(n,r){return pq(n)?r:pq(r)?n:nB(t.concat(n.value,r.value))},empty:nW}},pf=function(t){return function(n){return pq(n)?nW:nB(t(n.value))}},pd={URI:pa,map:d4},pp={URI:pa,of:nB},ph=function(t){return function(n){return pq(n)||pq(t)?nW:nB(n.value(t.value))}},pm={URI:pa,map:d4,ap:d3},pg={URI:pa,map:d4,ap:d3,of:nB},py=function(t){return function(n){return pq(n)?nW:t(n.value)}},pv={URI:pa,map:d4,ap:d3,chain:d5},pb=function(t,n){return function(r){return pq(r)?t:n(t,r.value)}},px=function(t){return function(n){return function(r){return pq(r)?t.empty:n(r.value)}}},pM=function(t,n){return function(r){return pq(r)?t:n(r.value,t)}},pT=function(t){return function(n){return pq(n)?t():n}},pS=pT,pw=function(){return nW},p_={URI:pa,zero:pw},pI=uK(p_,pp),pO=function(t){return function(n){return pq(n)?nW:nB(t(n))}},pk=py(nS),pC=uC(nW,nW),pN=function(t){return pq(t)?pC:uC(d1(t.value),d2(t.value))},pj={URI:pa,compact:pk,separate:pN},pE=function(t){return function(n){return pq(n)?nW:t(n.value)?n:nW}},pR=function(t){return function(n){return pq(n)?nW:t(n.value)}},pD=function(t){return function(n){return uC(pt(n,dQ(t)),pt(n,t))}},pA=function(t){return nC(pf(t),pN)},pL={URI:pa,map:d4,compact:pk,separate:pN,filter:pt,filterMap:pn,partition:pi,partitionMap:po},pP=function(t){return function(n){return function(r){return pq(r)?t.of(nW):t.map(n(r.value),nB)}}},pF=function(t){return function(n){return pq(n)?t.of(nW):t.map(n.value,nB)}},pz={URI:pa,map:d4,reduce:d9,foldMap:d8,reduceRight:d6,traverse:d7,sequence:pF},pU=uB(pz,pj),pW=uW(pz,pj),pB=function(t){var n=pU(t);return function(t){return function(r){return n(r,t)}}},pV=function(t){var n=pW(t);return function(t){return function(r){return n(r,t)}}},p$=function(){return nW},pK={URI:pa,fromEither:d2},pY=nU,pq=function(t){return"None"===t._tag},pG=function(t,n){return function(r){return pq(r)?t():n(r.value)}},pZ=function(t){return function(n){return pq(n)?t():n.value}},pQ=rn(pd),pH=n2(pm),pJ=n4(pm),pX=rc(pv),p0=pO(nS),p1=rg(pK),p2=ry(pK,pv),p4=rv(pK,pv),p3=function(t){return null==t?nW:nB(t)},p5=function(t){try{return nB(t())}catch{return nW}},p9=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return p5(function(){return t.apply(void 0,n)})}},p8=function(t){return nC(t,p3)},p6=function(t){return function(n){return pq(n)?nW:p3(t(n.value))}},p7=pG(nO,nS),he=pG(nk,nS),ht=function(t){return function(n){return!pq(n)&&t(n.value)}},hn=nB(nJ),hr=rr(pd),hi=rl(pv),ho=n3(pm),ha=nB(nH),hu=function(t){return function(n){var r=t(0,nZ(n));if(pq(r))return nW;for(var i=[r.value],o=1;o<n.length;o++){var a=t(o,n[o]);if(pq(a))return nW;i.push(a.value)}return nB(i)}},hs=function(t){var n=hu(t);return function(t){return nG(t)?n(t):ha}},hc=function(t){return hs(function(n,r){return t(r)})},hl=hc(nS),hf={URI:pa,map:d4,of:nB,ap:d3,chain:d5,reduce:d9,foldMap:d8,reduceRight:d6,traverse:d7,sequence:pF,zero:pw,alt:pe,extend:pr,compact:pk,separate:pN,filter:pt,filterMap:pn,partition:pi,partitionMap:po,wither:pU,wilt:pW,throwError:p$},hd=n5(pm),hp=ra(pg),hh=function(){return pl(it())},hm=function(){return pl(ir())};let hg=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:pa,map:d4,alt:pe},Alternative:{URI:pa,map:d4,ap:d3,of:nB,alt:pe,zero:pw},ApT:ha,Applicative:pg,Apply:pm,Chain:pv,Compactable:pj,Do:hn,Extend:{URI:pa,map:d4,extend:pr},Filterable:pL,Foldable:{URI:pa,reduce:d9,foldMap:d8,reduceRight:d6},FromEither:pK,Functor:pd,Monad:{URI:pa,map:d4,ap:d3,of:nB,chain:d5},MonadThrow:{URI:pa,map:d4,ap:d3,of:nB,chain:d5,throwError:p$},Pointed:pp,Traversable:pz,URI:pa,Witherable:{URI:pa,map:d4,reduce:d9,foldMap:d8,reduceRight:d6,traverse:d7,sequence:pF,compact:pk,separate:pN,filter:pt,filterMap:pn,partition:pi,partitionMap:po,wither:pU,wilt:pW},Zero:p_,alt:pS,altW:pT,ap:ph,apFirst:pH,apS:ho,apSecond:pJ,bind:hi,bindTo:hr,chain:py,chainEitherK:p2,chainFirst:pX,chainFirstEitherK:p4,chainNullableK:p6,compact:pk,duplicate:p0,elem:function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!pq(i)&&n.equals(r,i.value)}},exists:ht,extend:pO,filter:pE,filterMap:pR,flap:pQ,flatten:pk,fold:pG,foldMap:px,foldW:pG,fromEither:d2,fromEitherK:p1,fromNullable:p3,fromNullableK:p8,fromPredicate:d0,getApplyMonoid:hp,getApplySemigroup:hd,getEq:ps,getFirstMonoid:hh,getLastMonoid:hm,getLeft:d1,getMonoid:pl,getOrElse:pZ,getOrElseW:pZ,getOrd:pc,getRefinement:function(t){return function(n){return pY(t(n))}},getRight:d2,getShow:pu,guard:pI,isNone:pq,isSome:pY,map:pf,mapNullable:p6,match:pG,matchW:pG,none:nW,of:nB,option:hf,partition:pD,partitionMap:pA,reduce:pb,reduceRight:pM,separate:pN,sequence:pF,sequenceArray:hl,some:nB,throwError:p$,toNullable:p7,toUndefined:he,traverse:pP,traverseArray:hc,traverseArrayWithIndex:hs,traverseReadonlyArrayWithIndex:hs,traverseReadonlyNonEmptyArrayWithIndex:hu,tryCatch:p5,tryCatchK:p9,wilt:pV,wither:pB,zero:pw},Symbol.toStringTag,{value:"Module"}));function hy(t,n){return function(r){return t.map(r,n.compact)}}function hv(t,n,r){var i=hy(t,n),o=rt(t,r);return function(t){return uC(i(nD(t,o(d1))),i(nD(t,o(d2))))}}let hb=Object.freeze(Object.defineProperty({__proto__:null,compact:hy,getCompactableComposition:function(t,n){return{map:ri(t,n).map,compact:hy(t,n),separate:hv(t,n,n)}},separate:hv},Symbol.toStringTag,{value:"Module"}));var hx=function(t){return function(){return console.log(t)}},hM=function(t){return function(){return console.warn(t)}},hT=function(t){return function(){return console.error(t)}},hS=function(t){return function(){return console.info(t)}};let hw=Object.freeze(Object.defineProperty({__proto__:null,error:hT,info:hS,log:hx,warn:hM},Symbol.toStringTag,{value:"Module"}));function h_(t){return{URI:hA,_E:void 0,map:hk,ap:function(n,r){return nS(t.concat(n,r))}}}function hI(t){var n=h_(t);return{URI:hA,_E:void 0,map:n.map,ap:n.ap,of:function(){return nS(t.empty)}}}var hO=function(t,n){return nD(t,hj())},hk=function(t,n){return nD(t,hE())},hC=function(t,n,r){return nD(t,hR(n))},hN=function(t,n){return nD(t,hD(n))},hj=function(){return nS},hE=function(){return nS},hR=function(t){return function(n){return nS(t(n))}},hD=function(t){return function(n){return nS(t(n))}},hA="Const",hL={URI:hA,map:hk},hP=rn(hL);let hF=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:hA,bimap:hC,mapLeft:hN},Contravariant:{URI:hA,contramap:hO},Functor:hL,URI:hA,bimap:hR,const_:{URI:hA,map:hk,contramap:hO,bimap:hC,mapLeft:hN},contramap:hj,flap:hP,getApplicative:hI,getApply:h_,getBooleanAlgebra:nS,getBounded:nS,getEq:nS,getHeytingAlgebra:nS,getMonoid:nS,getOrd:nS,getRing:nS,getSemigroup:nS,getSemiring:nS,getShow:function(t){return{show:function(n){return"make(".concat(t.show(n),")")}}},make:nS,map:hE,mapLeft:hD},Symbol.toStringTag,{value:"Module"})),hz=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var hU=nD(ux,rL(function(t){return t.valueOf()})),hW=function(){return new Date},hB=function(){return new Date().getTime()};let hV=Object.freeze(Object.defineProperty({__proto__:null,Eq:{equals:function(t,n){return t.valueOf()===n.valueOf()}},Ord:hU,create:hW,eqDate:{equals:function(t,n){return t.getDate()===n.getDate()}},eqMonth:{equals:function(t,n){return t.getMonth()===n.getMonth()}},eqYear:{equals:function(t,n){return t.getFullYear()===n.getFullYear()}},now:hB},Symbol.toStringTag,{value:"Module"}));var h$=function(t,n){return nD(t,mt(n))},hK=function(t,n){return nD(t,mo(n))},hY=function(t,n){return nD(t,mc(n))},hq=function(t,n,r){return nD(t,mf(n,r))},hG=function(t){return function(n,r){var i=md(t);return nD(n,i(r))}},hZ=function(t,n,r){return nD(t,mp(n,r))},hQ=function(t){var n=mh(t);return function(t,r){return nD(t,n(r))}},hH=function(t,n,r){return nD(t,my(n,r))},hJ=function(t,n){return nD(t,mv(n))},hX=function(t,n){return nD(t,mx(n))},h0=function(t,n){return nD(t,mM(n))},h1=function(t,n){return dP(n(t),function(t){return m_(t)?nY(nK(t.left)):m_(t.right)?nK(n(t.right.left)):nY(nY(t.right.right))})},h2="Either",h4=function(t,n){return{show:function(r){return m_(r)?"left(".concat(t.show(r.left),")"):"right(".concat(n.show(r.right),")")}}},h3=function(t,n){return{equals:function(r,i){return r===i||(m_(r)?m_(i)&&t.equals(r.left,i.left):mI(i)&&n.equals(r.right,i.right))}}},h5=function(t){return{concat:function(n,r){return m_(r)?n:m_(n)?r:nY(t.concat(n.right,r.right))}}},h9=function(t){var n=nK(t.empty);return{URI:h2,_E:void 0,compact:function(t){return m_(t)?t:"None"===t.right._tag?n:nY(t.right.value)},separate:function(t){return m_(t)?uC(t,t):m_(t.right)?uC(nY(t.right.left),n):uC(n,nY(t.right.right))}}},h8=function(t){var n,r=nK(t.empty),i=h9(t),o=i.compact;return{URI:h2,_E:void 0,map:h$,compact:o,separate:i.separate,filter:function(t,n){return m_(t)||n(t.right)?t:r},filterMap:function(t,n){if(m_(t))return t;var i=n(t.right);return"None"===i._tag?r:nY(i.value)},partition:function(t,n){return m_(t)?uC(t,t):n(t.right)?uC(r,nY(t.right)):uC(nY(t.right),r)},partitionMap:function(t,n){if(m_(t))return uC(t,t);var i=n(t.right);return m_(i)?uC(nY(i.left),r):uC(r,nY(i.right))}}},h6=function(t){var n=h8(t),r=h9(t);return{URI:h2,_E:void 0,map:h$,compact:n.compact,separate:n.separate,filter:n.filter,filterMap:n.filterMap,partition:n.partition,partitionMap:n.partitionMap,traverse:hQ,sequence:mm,reduce:hq,foldMap:hG,reduceRight:hZ,wither:uB(mg,r),wilt:uW(mg,r)}},h7=function(t){return{URI:h2,_E:void 0,map:h$,ap:function(n,r){return m_(n)?m_(r)?nK(t.concat(n.left,r.left)):n:m_(r)?r:nY(n.right(r.right))},of:mr}},me=function(t){return{URI:h2,_E:void 0,map:h$,alt:function(n,r){if(mI(n))return n;var i=r();return m_(i)?nK(t.concat(n.left,i.left)):i}}},mt=function(t){return function(n){return m_(n)?n:nY(t(n.right))}},mn={URI:h2,map:h$},mr=nY,mi=function(t){return function(n){return m_(n)?n:m_(t)?t:nY(n.right(t.right))}},mo=mi,ma={URI:h2,map:h$,ap:hK},mu={URI:h2,map:h$,ap:hK,of:mr},ms=function(t){return function(n){return m_(n)?n:t(n.right)}},mc=ms,ml={URI:h2,map:h$,ap:hK,chain:hY},mf=function(t,n){return function(r){return m_(r)?t:n(t,r.right)}},md=function(t){return function(n){return function(r){return m_(r)?t.empty:n(r.right)}}},mp=function(t,n){return function(r){return m_(r)?t:n(r.right,t)}},mh=function(t){return function(n){return function(r){return m_(r)?t.of(nK(r.left)):t.map(n(r.right),nY)}}},mm=function(t){return function(n){return m_(n)?t.of(nK(n.left)):t.map(n.right,nY)}},mg={URI:h2,map:h$,reduce:hq,foldMap:hG,reduceRight:hZ,traverse:hQ,sequence:mm},my=function(t,n){return function(r){return m_(r)?nK(t(r.left)):nY(n(r.right))}},mv=function(t){return function(n){return m_(n)?nK(t(n.left)):n}},mb=function(t){return function(n){return m_(n)?t():n}},mx=mb,mM=function(t){return function(n){return m_(n)?n:nY(t(n))}},mT={URI:h2,fromEither:nS},mS=rp(mT),mw=rd(mT),m_=nV,mI=n$,mO=function(t,n){return function(r){return m_(r)?t(r.left):n(r.right)}},mk=function(t){return function(n){return m_(n)?t(n.left):n.right}},mC=rn(mn),mN=n2(ma),mj=n4(ma),mE=rc(ml),mR=ms(nS),mD=mM(nS),mA=rh(mT),mL=rm(mT,ml),mP=rb(mT,ml),mF=function(t){return m_(t)?nY(t.left):nK(t.right)},mz=function(t){return function(n){return m_(n)?t(n.left):n}},mU=function(t){return function(n){return null==n?nK(t):nY(n)}},mW=function(t,n){try{return nY(t())}catch(r){return nK(n(r))}},mB=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return mW(function(){return t.apply(void 0,r)},n)}},mV=function(t){var n=mU(t);return function(t){return nC(t,n)}},m$=function(t){var n=mV(t);return function(t){return mc(n(t))}},mK=mO(nS,nS),mY=function(t){return function(n){return!m_(n)&&t(n.right)}},mq=mr(nJ),mG=rr(mn),mZ=rl(ml),mQ=n3(ma),mH=mr(nH),mJ=function(t){return function(n){var r=t(0,nZ(n));if(m_(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o]);if(m_(a))return a;i.push(a.right)}return nY(i)}},mX=function(t){var n=mJ(t);return function(t){return nG(t)?n(t):mH}},m0=function(t){return mX(function(n,r){return t(r)})},m1=m0(nS),m2=function(t,n){return mW(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},n)},m4=n5(ma),m3=ra(mu),m5=function(t,n){return n5(h7(t))(n)},m9=function(t,n){return ra(h7(t))(n)};let m8=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:h2,map:h$,alt:hX},ApT:mH,Applicative:mu,Apply:ma,Bifunctor:{URI:h2,bimap:hH,mapLeft:hJ},Chain:ml,ChainRec:{URI:h2,map:h$,ap:hK,chain:hY,chainRec:h1},Do:mq,Extend:{URI:h2,map:h$,extend:h0},Foldable:{URI:h2,reduce:hq,foldMap:hG,reduceRight:hZ},FromEither:mT,Functor:mn,Monad:{URI:h2,map:h$,ap:hK,of:mr,chain:hY},MonadThrow:{URI:h2,map:h$,ap:hK,of:mr,chain:hY,throwError:nK},Pointed:{URI:h2,of:mr},Traversable:mg,URI:h2,alt:mx,altW:mb,ap:mo,apFirst:mN,apFirstW:mN,apS:mQ,apSW:mQ,apSecond:mj,apSecondW:mj,apW:mi,bimap:my,bind:mZ,bindTo:mG,bindW:mZ,chain:mc,chainFirst:mE,chainFirstW:mE,chainNullableK:m$,chainOptionK:mL,chainW:ms,duplicate:mD,either:{URI:h2,map:h$,of:mr,ap:hK,chain:hY,reduce:hq,foldMap:hG,reduceRight:hZ,traverse:hQ,sequence:mm,bimap:hH,mapLeft:hJ,alt:hX,extend:h0,chainRec:h1,throwError:nK},elem:function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!m_(i)&&n.equals(r,i.right)}},exists:mY,extend:mM,filterOrElse:mP,filterOrElseW:mP,flap:mC,flatten:mR,flattenW:mR,fold:mO,foldMap:md,foldW:mO,fromNullable:mU,fromNullableK:mV,fromOption:mw,fromOptionK:mA,fromPredicate:mS,getAltValidation:me,getApplicativeValidation:h7,getApplyMonoid:m3,getApplySemigroup:m4,getCompactable:h9,getEq:h3,getFilterable:h8,getOrElse:mk,getOrElseW:mk,getSemigroup:h5,getShow:h4,getValidation:function(t){var n=h7(t).ap,r=me(t).alt;return{URI:h2,_E:void 0,map:h$,of:mr,chain:hY,bimap:hH,mapLeft:hJ,reduce:hq,foldMap:hG,reduceRight:hZ,extend:h0,traverse:hQ,sequence:mm,chainRec:h1,throwError:nK,ap:n,alt:r}},getValidationMonoid:m9,getValidationSemigroup:m5,getWitherable:h6,isLeft:m_,isRight:mI,left:nK,map:mt,mapLeft:mv,match:mO,matchW:mO,of:mr,orElse:mz,orElseW:mz,parseJSON:function(t,n){return mW(function(){return JSON.parse(t)},n)},reduce:mf,reduceRight:mp,right:nY,sequence:mm,sequenceArray:m1,stringifyJSON:m2,swap:mF,throwError:nK,toError:function(t){return t instanceof Error?t:Error(String(t))},toUnion:mK,traverse:mh,traverseArray:m0,traverseArrayWithIndex:mX,traverseReadonlyArrayWithIndex:mX,traverseReadonlyNonEmptyArrayWithIndex:mJ,tryCatch:mW,tryCatchK:mB},Symbol.toStringTag,{value:"Module"}));function m6(t){return nC(nY,t.of)}function m7(t){return nC(nK,t.of)}function ge(t){return function(n){return t.map(n,nY)}}function gt(t){return function(n){return t.map(n,nK)}}function gn(t){return function(n){return nC(mU(n),t.of)}}function gr(t){var n=gn(t);return function(t){var r=n(t);return function(t){return nC(t,r)}}}function gi(t){var n=gu(t),r=gr(t);return function(t){var i=r(t);return function(t){return n(i(t))}}}function go(t){return rt(t,mn)}function ga(t){return n1(t,ma)}function gu(t){return function(n){return function(r){return t.chain(r,function(r){return m_(r)?t.of(r):n(r.right)})}}}function gs(t){return function(n){return function(r){return t.chain(r,function(r){return m_(r)?n():t.of(r)})}}}function gc(t){return function(n,r){return function(i){return t.map(i,my(n,r))}}}function gl(t){return function(n){return function(r){return t.map(r,mv(n))}}}function gf(t,n){return function(r){return function(i){return t.chain(i,mO(function(i){return t.map(r(),mv(function(t){return n.concat(i,t)}))},m6(t)))}}}function gd(t){return function(n,r){return function(i){return t.map(i,mO(n,r))}}}function gp(t){return function(n,r){return function(i){return t.chain(i,mO(n,r))}}}function gh(t){return function(n){return function(r){return t.chain(r,mO(n,t.of))}}}function gm(t){return function(n){return function(r){return t.chain(r,function(r){return m_(r)?n(r.left):t.of(r)})}}}function gg(t){var n=gm(t);return function(r){return n(function(n){return t.map(r(n),function(t){return m_(t)?t:nK(n)})})}}function gy(t){return function(n){return function(r){return t.chain(r,mO(function(r){return t.map(n(r),nK)},function(n){return t.of(nY(n))}))}}}function gv(t){return function(n){return t.map(n,mF)}}function gb(t){return function(n){return t.map(n,mK)}}let gx=Object.freeze(Object.defineProperty({__proto__:null,alt:gs,altValidation:gf,ap:ga,bimap:gc,chain:gu,chainNullableK:gi,fromNullable:gn,fromNullableK:gr,getEitherM:function(t){var n=ga(t),r=go(t),i=gu(t),o=gs(t),a=gc(t),u=gl(t),s=gp(t),c=gh(t),l=gm(t);return{map:function(t,n){return nD(t,r(n))},ap:function(t,r){return nD(t,n(r))},of:m6(t),chain:function(t,n){return nD(t,i(n))},alt:function(t,n){return nD(t,o(n))},bimap:function(t,n,r){return nD(t,a(n,r))},mapLeft:function(t,n){return nD(t,u(n))},fold:function(t,n,r){return nD(t,s(n,r))},getOrElse:function(t,n){return nD(t,c(n))},orElse:function(t,n){return nD(t,l(n))},swap:gv(t),rightM:ge(t),leftM:gt(t),left:m7(t)}},getOrElse:gh,left:m7,leftF:gt,map:go,mapLeft:gl,match:gd,matchE:gp,orElse:gm,orElseFirst:gg,orLeft:gy,right:m6,rightF:ge,swap:gv,toUnion:gb},Symbol.toStringTag,{value:"Module"}));var gM=function(){return{concat:function(t,n){return nC(t,n)}}},gT=function(){return{concat:gM().concat,empty:nS}};let gS=Object.freeze(Object.defineProperty({__proto__:null,URI:"Endomorphism",getMonoid:gT,getSemigroup:gM},Symbol.toStringTag,{value:"Module"})),gw=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function g_(t,n){var r=n.zero,i=function(o,a){return t.equals(a,r)?o:i(a,n.mod(o,a))};return i}let gI=Object.freeze(Object.defineProperty({__proto__:null,fieldNumber:{add:function(t,n){return t+n},zero:0,mul:function(t,n){return t*n},one:1,sub:function(t,n){return t-n},degree:function(t){return 1},div:function(t,n){return t/n},mod:function(t,n){return t%n}},gcd:g_,lcm:function(t,n){var r=n.zero,i=g_(t,n);return function(o,a){return t.equals(o,r)||t.equals(a,r)?r:n.div(n.mul(o,a),i(o,a))}}},Symbol.toStringTag,{value:"Module"}));function gO(t,n){return function(r){return function(i){return t.map(i,function(t){return n.filter(t,r)})}}}function gk(t,n){return function(r){return function(i){return t.map(i,function(t){return n.filterMap(t,r)})}}}function gC(t,n){var r=gO(t,n);return function(t){var n=r(dQ(t)),i=r(t);return function(t){return uC(n(t),i(t))}}}function gN(t,n){var r=gk(t,n);return function(t){return function(n){return uC(nD(n,r(function(n){return d1(t(n))})),nD(n,r(function(n){return d2(t(n))})))}}}let gj=Object.freeze(Object.defineProperty({__proto__:null,filter:gO,filterMap:gk,getFilterableComposition:function(t,n){var r=ri(t,n).map,i=hy(t,n),o=hv(t,n,n),a=gO(t,n),u=gk(t,n),s=gC(t,n),c=gN(t,n);return{map:r,compact:i,separate:o,filter:function(t,n){return nD(t,a(n))},filterMap:function(t,n){return nD(t,u(n))},partition:function(t,n){return nD(t,s(n))},partitionMap:function(t,n){return nD(t,c(n))}}},partition:gC,partitionMap:gN},Symbol.toStringTag,{value:"Module"})),gE=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function gR(t,n){return function(r,i){return function(o){return t.reduce(o,r,function(t,r){return n.reduce(r,t,i)})}}}function gD(t,n){return function(r){var i=t.foldMap(r),o=n.foldMap(r);return function(t){return function(n){return i(n,function(n){return o(n,t)})}}}}function gA(t,n){return function(r,i){return function(o){return t.reduceRight(o,r,function(t,r){return n.reduceRight(t,r,i)})}}}function gL(t){return function(n){return t.reduce(n,[],function(t,n){return t.push(n),t})}}function gP(t,n){var r=gR(t,n),i=gD(t,n),o=gA(t,n);return{reduce:function(t,n,i){return nD(t,r(n,i))},foldMap:function(t){var n=i(t);return function(t,r){return nD(t,n(r))}},reduceRight:function(t,n,r){return nD(t,o(n,r))}}}let gF=Object.freeze(Object.defineProperty({__proto__:null,foldM:function(t,n){return function(r,i,o){return n.reduce(r,t.of(i),function(n,r){return t.chain(n,function(t){return o(t,r)})})}},foldMap:gD,getFoldableComposition:gP,intercalate:function(t,n){return function(r,i){var o=function(n,i){var o=n.init,a=n.acc;return o?{init:!1,acc:i}:{init:!1,acc:t.concat(t.concat(a,r),i)}};return n.reduce(i,{init:!0,acc:t.empty},o).acc}},reduce:gR,reduceM:function(t,n){return function(r,i){return function(o){return n.reduce(o,t.of(r),function(n,r){return t.chain(n,function(t){return i(t,r)})})}}},reduceRight:gA,toArray:gL,toReadonlyArray:gL,traverse_:function(t,n){var r=t.of(void 0);return function(i,o){return n.reduce(i,r,function(n,r){var i,a;return a=o(r),t.ap(t.map(n,nw),a)})}}},Symbol.toStringTag,{value:"Module"}));function gz(t,n){return function(r,i){return function(o){return t.reduceWithIndex(o,r,function(t,r,o){return n.reduceWithIndex(o,r,function(n,r,o){return i([t,n],r,o)})})}}}function gU(t,n){return function(r){var i=t.foldMapWithIndex(r),o=n.foldMapWithIndex(r);return function(t){return function(n){return i(n,function(n,r){return o(r,function(r,i){return t([n,r],i)})})}}}}function gW(t,n){return function(r,i){return function(o){return t.reduceRightWithIndex(o,r,function(t,r,o){return n.reduceRightWithIndex(r,o,function(n,r,o){return i([t,n],r,o)})})}}}let gB=Object.freeze(Object.defineProperty({__proto__:null,foldMapWithIndex:gU,getFoldableWithIndexComposition:function(t,n){var r=gP(t,n),i=gz(t,n),o=gU(t,n),a=gW(t,n);return{reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,reduceWithIndex:function(t,n,r){return nD(t,i(n,r))},foldMapWithIndex:function(t){var n=o(t);return function(t,r){return nD(t,n(r))}},reduceRightWithIndex:function(t,n,r){return nD(t,a(n,r))}}},reduceRightWithIndex:gW,reduceWithIndex:gz},Symbol.toStringTag,{value:"Module"}));function gV(t){return function(n){return nC(n,t.fromIO)}}function g$(t,n){return function(r){var i=nC(r,t.fromIO);return function(t){return n.chain(t,i)}}}function gK(t,n){var r=rc(n);return function(n){return r(nC(n,t.fromIO))}}let gY=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:gK,chainIOK:g$,fromIOK:gV},Symbol.toStringTag,{value:"Module"}));var gq=function(){return nS},gG=function(t){return function(n){return function(r){return n(t(r))}}},gZ=function(t){return function(n){return t(n)(n)}},gQ=function(t,n){return nD(t,g1(n))},gH=function(t,n){return nD(t,g4(n))},gJ=function(t,n){return nD(t,g5(n))},gX=function(t,n){return nD(t,g8(n))},g0=function(t,n,r){return nD(t,g6(n,r))},g1=function(t){return function(n){return function(r){return t(n(r))}}},g2=function(t){return function(n){return function(r){return n(r)(t(r))}}},g4=g2,g3=function(t){return function(n){return function(r){return t(n(r))(r)}}},g5=g3,g9=g3(nS),g8=function(t){return function(n){return nC(t,n)}},g6=function(t,n){return function(r){return function(i){return n(r(t(i)))}}},g7=function(){return nS},ye=function(t){return function(n){var r=n[0],i=n[1];return[t(r),i]}},yt=function(t){return function(n){var r;return[n[0],t(n[1])]}},yn=function(t){return mO(function(n){return nK(t(n))},nY)},yr=function(t){return mO(nK,function(n){return nY(t(n))})},yi="Reader",yo={URI:yi,map:gQ},ya=rn(yo),yu={URI:yi,of:nw},ys={URI:yi,map:gQ,ap:gH},yc=n2(ys),yl=n4(ys),yf={URI:yi,map:gQ,ap:gH,of:nw},yd={URI:yi,map:gQ,ap:gH,chain:gJ},yp={URI:yi,map:gQ,of:nw,ap:gH,chain:gJ},yh=rc(yd),ym=rr(yo),yg=rl(yd),yy=nw(nJ),yv=n3(ys),yb=nw(nH),yx=function(t){return function(n){return function(r){for(var i=[t(0,nZ(n))(r)],o=1;o<n.length;o++)i.push(t(o,n[o])(r));return i}}},yM=function(t){var n=yx(t);return function(t){return nG(t)?n(t):yb}},yT=function(t){return yM(function(n,r){return t(r)})},yS=yT(nS),yw=n5(ys),y_=ra(yf);let yI=Object.freeze(Object.defineProperty({__proto__:null,ApT:yb,Applicative:yf,Apply:ys,Category:{URI:yi,compose:gX,id:g7},Chain:yd,Choice:{URI:yi,map:gQ,promap:g0,left:yn,right:yr},Do:yy,Functor:yo,Monad:yp,Pointed:yu,Profunctor:{URI:yi,map:gQ,promap:g0},Strong:{URI:yi,map:gQ,promap:g0,first:ye,second:yt},URI:yi,ap:g4,apFirst:yc,apFirstW:yc,apS:yv,apSW:yv,apSecond:yl,apSecondW:yl,apW:g2,ask:gq,asks:nS,asksReader:gZ,asksReaderW:gZ,bind:yg,bindTo:ym,bindW:yg,chain:g5,chainFirst:yh,chainFirstW:yh,chainW:g3,compose:g8,first:ye,flap:ya,flatten:g9,flattenW:g9,getMonoid:y_,getSemigroup:yw,id:g7,left:yn,local:gG,map:g1,of:nw,promap:g6,reader:{URI:yi,map:gQ,of:nw,ap:gH,chain:gJ,promap:g0,compose:gX,id:g7,first:ye,second:yt,left:yn,right:yr},right:yr,second:yt,sequenceArray:yS,traverseArray:yT,traverseArrayWithIndex:yM,traverseReadonlyArrayWithIndex:yM,traverseReadonlyNonEmptyArrayWithIndex:yx},Symbol.toStringTag,{value:"Module"}));function yO(t){return function(){return t.fromReader(gq())}}function yk(t){return t.fromReader}function yC(t){return function(n){return nC(n,t.fromReader)}}function yN(t,n){var r=yC(t);return function(t){return function(i){return n.chain(i,r(t))}}}function yj(t,n){return nC(yC(t),rc(n))}let yE=Object.freeze(Object.defineProperty({__proto__:null,ask:yO,asks:yk,chainFirstReaderK:yj,chainReaderK:yN,fromReaderK:yC},Symbol.toStringTag,{value:"Module"}));var yR=function(){return function(t){return[t,t]}},yD=function(t){return function(){return[void 0,t]}},yA=function(t){return function(n){return[void 0,t(n)]}},yL=function(t){return function(n){return[t(n),n]}},yP=function(t,n){return nD(t,yU(n))},yF=function(t,n){return nD(t,yW(n))},yz=function(t,n){return nD(t,yV(n))},yU=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=i[1];return[t(o),a]}}},yW=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=t(i[1]),u=a[0],s=a[1];return[o(u),s]}}},yB=function(t){return function(n){return[t,n]}},yV=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=i[1];return t(o)(a)}}},y$=yV(nS),yK="State",yY={URI:yK,map:yP},yq=rn(yY),yG={URI:yK,map:yP,ap:yF},yZ=n2(yG),yQ=n4(yG),yH={URI:yK,map:yP,ap:yF,chain:yz},yJ={URI:yK,map:yP,ap:yF,of:yB,chain:yz},yX=rc(yH),y0=function(t){return function(n){return n(t)[0]}},y1=function(t){return function(n){return n(t)[1]}},y2=rr(yY),y4=rl(yH),y3=n3(yG),y5=function(t){return function(n){return function(r){for(var i=t(0,nZ(n))(r),o=i[0],a=i[1],u=[o],s=a,c=1;c<n.length;c++){var l=t(c,n[c])(s),f=l[0],d=l[1];u.push(f),s=d}return[u,s]}}},y9=function(t){var n=y5(t);return function(t){return nG(t)?n(t):yB(nH)}},y8=function(t){return y9(function(n,r){return t(r)})},y6=y8(nS),y7=function(t,n){return t(n)[0]},ve=function(t,n){return t(n)[1]};let vt=Object.freeze(Object.defineProperty({__proto__:null,Applicative:{URI:yK,map:yP,ap:yF,of:yB},Apply:yG,Chain:yH,FromState:{URI:yK,fromState:nS},Functor:yY,Monad:yJ,Pointed:{URI:yK,of:yB},URI:yK,ap:yW,apFirst:yZ,apS:y3,apSecond:yQ,bind:y4,bindTo:y2,chain:yV,chainFirst:yX,evalState:y7,evaluate:y0,execState:ve,execute:y1,flap:yq,flatten:y$,get:yR,gets:yL,map:yU,modify:yA,of:yB,put:yD,sequenceArray:y6,state:yJ,traverseArray:y8,traverseArrayWithIndex:y9,traverseReadonlyArrayWithIndex:y9,traverseReadonlyNonEmptyArrayWithIndex:y5},Symbol.toStringTag,{value:"Module"}));function vn(t){return function(){return t.fromState(yR())}}function vr(t){return function(n){return t.fromState(yD(n))}}function vi(t){return nC(yA,t.fromState)}function vo(t){return nC(yL,t.fromState)}function va(t){return function(n){return nC(n,t.fromState)}}function vu(t,n){var r=va(t);return function(t){return function(i){return n.chain(i,r(t))}}}let vs=Object.freeze(Object.defineProperty({__proto__:null,chainStateK:vu,fromStateK:va,get:vn,gets:vo,modify:vi,put:vr},Symbol.toStringTag,{value:"Module"}));function vc(t){return function(n){return nC(n,t.fromTask)}}function vl(t,n){return function(r){var i=nC(r,t.fromTask);return function(t){return n.chain(t,i)}}}function vf(t,n){var r=rc(n);return function(n){return r(nC(n,t.fromTask))}}let vd=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:vf,chainTaskK:vl,fromTaskK:vc},Symbol.toStringTag,{value:"Module"}));function vp(t){return function(n){return nC(n,t.fromThese)}}let vh=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:vp},Symbol.toStringTag,{value:"Module"}));function vm(t,n){return function(r){return function(i){return t.mapWithIndex(i,function(t,i){return n.mapWithIndex(i,function(n,i){return r([t,n],i)})})}}}let vg=Object.freeze(Object.defineProperty({__proto__:null,getFunctorWithIndexComposition:function(t,n){var r=ri(t,n).map,i=vm(t,n);return{map:r,mapWithIndex:function(t,n){return nD(t,i(n))}}},mapWithIndex:vm},Symbol.toStringTag,{value:"Module"})),vy=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),vv=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),vb=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var vx=function(t,n){return nD(t,vC(n))},vM=function(t,n){return nD(t,vN(n))},vT=function(t,n){return nD(t,vj(n))},vS=function(t,n,r){return nD(t,vA(n,r))},vw=function(t){return function(t,n){return nD(t,vL()(n))}},v_=function(t,n,r){return nD(t,vP(n,r))},vI=function(t,n){return nD(t,vW())},vO=function(t,n){return nD(t,vE(n))},vk=function(t){var n=vF(t);return function(t,r){return nD(t,n(r))}},vC=function(t){return function(n){return t(n)}},vN=function(t){return function(n){return n(t)}},vj=function(t){return function(n){return t(n)}},vE=function(t){return function(n){return t(n)}},vR=vE(nS),vD=vj(nS),vA=function(t,n){return function(r){return n(t,r)}},vL=function(){return function(t){return function(n){return t(n)}}},vP=function(t,n){return function(r){return n(r,t)}},vF=function(t){return function(n){return function(r){return t.map(n(r),nS)}}},vz=function(t){return function(n){return t.map(n,nS)}},vU=function(){return nS},vW=vU,vB="Identity",vV={URI:vB,map:vx},v$=rn(vV),vK={URI:vB,map:vx,ap:vM},vY=n2(vK),vq=n4(vK),vG={URI:vB,map:vx,ap:vM,chain:vT},vZ=rc(vG),vQ=nS(nJ),vH=rr(vV),vJ=rl(vG),vX=n3(vK);let v0=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:vB,map:vx,alt:vI},Applicative:{URI:vB,map:vx,ap:vM,of:nS},Apply:vK,Chain:vG,ChainRec:{URI:vB,map:vx,ap:vM,chain:vT,chainRec:dP},Comonad:{URI:vB,map:vx,extend:vO,extract:nS},Do:vQ,Foldable:{URI:vB,reduce:vS,foldMap:vw,reduceRight:v_},Functor:vV,Monad:{URI:vB,map:vx,ap:vM,of:nS,chain:vT},Pointed:{URI:vB,of:nS},Traversable:{URI:vB,map:vx,reduce:vS,foldMap:vw,reduceRight:v_,traverse:vk,sequence:vz},URI:vB,alt:vW,altW:vU,ap:vN,apFirst:vY,apS:vX,apSecond:vq,bind:vJ,bindTo:vH,chain:vj,chainFirst:vZ,duplicate:vR,extend:vE,extract:nS,flap:v$,flatten:vD,foldMap:vL,getEq:nS,getShow:nS,identity:{URI:vB,map:vx,ap:vM,of:nS,chain:vT,reduce:vS,foldMap:vw,reduceRight:v_,traverse:vk,sequence:vz,alt:vI,extract:nS,extend:vO,chainRec:dP},map:vC,of:nS,reduce:vA,reduceRight:vP,sequence:vz,traverse:vF},Symbol.toStringTag,{value:"Module"})),v1=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var v2=function(t,n){return function(){return n(t())}},v4=function(t,n){return function(){return t()(n())}},v3=function(t,n){return function(){return n(t())()}},v5=function(t,n){return function(){for(var r=n(t)();"Left"===r._tag;)r=n(r.left)();return r.right}},v9=function(t){return function(n){return v2(n,t)}},v8=function(t){return function(n){return v4(n,t)}},v6=function(t){return function(n){return v3(n,t)}},v7=v6(nS),be={URI:"IO",map:v2},bt=rn(be),bn={URI:"IO",of:nw},br={URI:"IO",map:v2,ap:v4},bi=n2(br),bo=n4(br),ba={URI:"IO",map:v2,ap:v4,of:nw},bu={URI:"IO",map:v2,ap:v4,chain:v3},bs={URI:"IO",map:v2,ap:v4,of:nw,chain:v3},bc=rc(bu),bl=nw(nJ),bf=rr(be),bd=rl(bu),bp=n3(br),bh=nw(nH),bm=function(t){return function(n){return function(){for(var r=[t(0,nZ(n))()],i=1;i<n.length;i++)r.push(t(i,n[i])());return r}}},bg=function(t){var n=bm(t);return function(t){return nG(t)?n(t):bh}},by=function(t){return bg(function(n,r){return t(r)})},bv=by(nS),bb=n5(br),bx=ra(ba);let bM=Object.freeze(Object.defineProperty({__proto__:null,ApT:bh,Applicative:ba,Apply:br,Chain:bu,ChainRec:{URI:"IO",map:v2,ap:v4,chain:v3,chainRec:v5},Do:bl,FromIO:{URI:"IO",fromIO:nS},Functor:be,Monad:bs,MonadIO:{URI:"IO",map:v2,ap:v4,of:nw,chain:v3,fromIO:nS},Pointed:bn,URI:"IO",ap:v8,apFirst:bi,apS:bp,apSecond:bo,bind:bd,bindTo:bf,chain:v6,chainFirst:bc,flap:bt,flatten:v7,fromIO:nS,getMonoid:bx,getSemigroup:bb,io:{URI:"IO",map:v2,of:nw,ap:v4,chain:v3,fromIO:nS,chainRec:v5},map:v9,of:nw,sequenceArray:bv,traverseArray:by,traverseArrayWithIndex:bg,traverseReadonlyArrayWithIndex:bg,traverseReadonlyNonEmptyArrayWithIndex:bm},Symbol.toStringTag,{value:"Module"}));var bT=m7(bn),bS=m6(bn),bw=ge(be),b_=gt(be),bI=gd(be),bO=gp(bs),bk=gh(bs),bC=function(t,n){return function(){return mW(t,n)}},bN=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return bC(function(){return t.apply(void 0,r)},n)}},bj=gb(be),bE=gm(bs),bR=gg(bs),bD=function(t){return bR(xe(t))},bA=gy(bs),bL=gv(be),bP=function(t,n){return nD(t,b$(n))},bF=function(t,n){return nD(t,bq(n))},bz=function(t,n){return nD(t,bG(function(t){return nD(n,b$(t))}))},bU=function(t,n){return nD(t,bG(n))},bW=function(t,n,r){return nD(t,bK(n,r))},bB=function(t,n){return nD(t,bY(n))},bV=function(t,n){return nD(t,bQ(n))},b$=go(be),bK=gc(be),bY=gl(be),bq=ga(br),bG=gu(bs),bZ=bG(nS),bQ=gs(bs),bH="IOEither";function bJ(t){var n=n1(br,h7(t));return{URI:bH,_E:void 0,map:bP,ap:function(t,r){return nD(t,n(r))},of:bS}}function bX(t){var n=gf(bs,t);return{URI:bH,_E:void 0,map:bP,alt:function(t,r){return nD(t,n(r))}}}var b0=function(t){var n=h9(t);return{URI:bH,_E:void 0,compact:hy(be,n),separate:hv(be,n,mn)}},b1={URI:bH,map:bP},b2=rn(b1),b4={URI:bH,map:bP,ap:bF},b3=n2(b4),b5=n4(b4),b9={URI:bH,map:bP,ap:bF,of:bS},b8={URI:bH,map:bP,ap:bF,chain:bU},b6=rc(b8),b7={URI:bH,fromIO:bw},xe=gV(b7),xt=g$(b7,b8),xn=gK(b7,b8),xr={URI:bH,fromEither:nw},xi=rd(xr),xo=rh(xr),xa=rm(xr,b8),xu=ry(xr,b8),xs=rv(xr,b8),xc=rp(xr),xl=rb(xr,b8),xf=rg(xr),xd=function(t,n,r){return xp(t,n,r)},xp=function(t,n,r){return nD(t,bG(function(t){return nD(n(t),v6(function(n){return nD(r(t,n),bG(function(){return nw(n)}))}))}))},xh=bS(nJ),xm=rr(b1),xg=rl(b8),xy=n3(b4),xv=bS(nH),xb=function(t){return nC(bm(t),v9(mJ(nA)))},xx=function(t){var n=xb(t);return function(t){return nG(t)?n(t):xv}},xM=function(t){return function(n){return function(){var r=t(0,nZ(n))();if(nV(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o])();if(nV(a))return a;i.push(a.right)}return nY(i)}}},xT=function(t){var n=xM(t);return function(t){return nG(t)?n(t):xv}},xS=function(t){return xx(function(n,r){return t(r)})},xw=xS(nS),x_=function(t){return xT(function(n,r){return t(r)})},xI=x_(nS),xO=n5(b4),xk=ra(b9),xC=function(t){return n5(br)(h5(t))};let xN=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:bH,map:bP,alt:bV},ApT:xv,Applicative:b9,ApplicativePar:b9,ApplicativeSeq:{URI:bH,map:bP,ap:bz,of:bS},ApplyPar:b4,Bifunctor:{URI:bH,bimap:bW,mapLeft:bB},Chain:b8,Do:xh,FromEither:xr,FromIO:b7,Functor:b1,Monad:{URI:bH,map:bP,ap:bF,of:bS,chain:bU},MonadIO:{URI:bH,map:bP,ap:bF,of:bS,chain:bU,fromIO:bw},MonadThrow:{URI:bH,map:bP,ap:bF,of:bS,chain:bU,throwError:bT},Pointed:{URI:bH,of:bS},URI:bH,alt:bQ,altW:bQ,ap:bq,apFirst:b3,apFirstW:b3,apS:xy,apSW:xy,apSecond:b5,apSecondW:b5,apW:bq,bimap:bK,bind:xg,bindTo:xm,bindW:xg,bracket:xd,bracketW:xp,chain:bG,chainEitherK:xu,chainEitherKW:xu,chainFirst:b6,chainFirstEitherK:xs,chainFirstEitherKW:xs,chainFirstIOK:xn,chainFirstW:b6,chainIOK:xt,chainOptionK:xa,chainW:bG,filterOrElse:xl,filterOrElseW:xl,flap:b2,flatten:bZ,flattenW:bZ,fold:bO,foldW:bO,fromEither:nw,fromEitherK:xf,fromIO:bw,fromIOK:xe,fromOption:xi,fromOptionK:xo,fromPredicate:xc,getAltIOValidation:bX,getApplicativeIOValidation:bJ,getApplyMonoid:xk,getApplySemigroup:xO,getCompactable:b0,getFilterable:function(t){var n=h8(t),r=b0(t),i=gO(be,n),o=gk(be,n),a=gC(be,n),u=gN(be,n);return{URI:bH,_E:void 0,map:bP,compact:r.compact,separate:r.separate,filter:function(t,n){return nD(t,i(n))},filterMap:function(t,n){return nD(t,o(n))},partition:function(t,n){return nD(t,a(n))},partitionMap:function(t,n){return nD(t,u(n))}}},getIOValidation:function(t){var n=bJ(t),r=bX(t);return{URI:bH,_E:void 0,map:bP,ap:n.ap,of:bS,chain:bU,bimap:bW,mapLeft:bB,alt:r.alt,fromIO:bw,throwError:bT}},getOrElse:bk,getOrElseW:bk,getSemigroup:xC,ioEither:{URI:bH,bimap:bW,mapLeft:bB,map:bP,of:bS,ap:bF,chain:bU,alt:bV,fromIO:bw,throwError:bT},left:bT,leftIO:b_,map:b$,mapLeft:bY,match:bI,matchE:bO,matchEW:bO,matchW:bI,of:bS,orElse:bE,orElseFirst:bR,orElseFirstIOK:bD,orElseFirstW:bR,orElseW:bE,orLeft:bA,right:bS,rightIO:bw,sequenceArray:xw,sequenceSeqArray:xI,swap:bL,throwError:bT,toUnion:bj,traverseArray:xS,traverseArrayWithIndex:xx,traverseReadonlyArrayWithIndex:xx,traverseReadonlyArrayWithIndexSeq:xT,traverseReadonlyNonEmptyArrayWithIndex:xb,traverseReadonlyNonEmptyArrayWithIndexSeq:xM,traverseSeqArray:x_,traverseSeqArrayWithIndex:xT,tryCatch:bC,tryCatchK:bN},Symbol.toStringTag,{value:"Module"}));function xj(t){return nC(nB,t.of)}function xE(t){return nw(t.of(nW))}function xR(t){return function(n){return t.map(n,nB)}}function xD(t){return nC(p3,t.of)}function xA(t){var n=xD(t);return function(t){return nC(t,n)}}function xL(t){var n=xY(t),r=xA(t);return function(t){return n(r(t))}}function xP(t){return function(n){return nC(n,t.of)}}function xF(t){var n=xY(t),r=xP(t);return function(t){return n(r(t))}}function xz(t){return function(n){return function(r){return t.of(d0(n)(r))}}}function xU(t){return nC(d2,t.of)}function xW(t){return function(n,r){return function(i){return t.map(i,pG(n,r))}}}function xB(t){return function(n,r){return function(i){return t.chain(i,pG(n,r))}}}function xV(t){return function(n){return function(r){return t.chain(r,pG(n,t.of))}}}function x$(t){return rt(t,pd)}function xK(t){return n1(t,pm)}function xY(t){var n=xE(t);return function(r){return function(i){return t.chain(i,pG(function(){return n()},r))}}}function xq(t){var n=xj(t);return function(r){return function(i){return t.chain(i,pG(r,n))}}}let xG=Object.freeze(Object.defineProperty({__proto__:null,alt:xq,ap:xK,chain:xY,chainNullableK:xL,chainOptionK:xF,fromEither:xU,fromF:xR,fromNullable:xD,fromNullableK:xA,fromOptionK:xP,fromPredicate:xz,getOptionM:function(t){var n=xK(t),r=x$(t),i=xY(t),o=xq(t),a=xB(t),u=xV(t),s=xE(t);return{map:function(t,n){return nD(t,r(n))},ap:function(t,r){return nD(t,n(r))},of:xj(t),chain:function(t,n){return nD(t,i(n))},alt:function(t,n){return nD(t,o(n))},fold:function(t,n,r){return nD(t,a(n,r))},getOrElse:function(t,n){return nD(t,u(n))},fromM:xR(t),none:function(){return s()}}},getOrElse:xV,map:x$,match:xW,matchE:xB,some:xj,zero:xE},Symbol.toStringTag,{value:"Module"}));var xZ=xj(bn),xQ=xz(bn),xH=xU(bn),xJ=xR(be),xX=v9(d2),x0=xW(be),x1=xB(bu),x2=xV(bs),x4=v9(he),x3=v9(p7),x5=xD(bn),x9=xA(bn),x8=xL(bs),x6=xP(bn),x7=xF(bs),Me=x$(be),Mt=xK(br),Mn=xY(bs),Mr=Mn(nS),Mi=xq(bs),Mo=xE(bn),Ma=Mo(),Mu=hy(be,pj),Ms=hv(be,pj,pd),Mc=gO(be,pL),Ml=gk(be,pL),Mf=gC(be,pL),Md=gN(be,pL),Mp=function(t,n){return nD(t,Me(n))},Mh=function(t,n){return nD(t,Mt(n))},Mm=function(t,n){return nD(t,Mn(n))},Mg=function(t,n){return nD(t,Mi(n))},My=function(t,n){return nD(t,Mc(n))},Mv=function(t,n){return nD(t,Ml(n))},Mb=function(t,n){return nD(t,Mf(n))},Mx=function(t,n){return nD(t,Md(n))},MM="IOOption",MT={URI:MM,map:Mp},MS=rn(MT),Mw={URI:MM,of:xZ},M_={URI:MM,map:Mp,ap:Mh},MI=n2(M_),MO=n4(M_),Mk={URI:MM,map:Mp,ap:Mh,chain:Mm},MC=rc(Mk),MN={URI:MM,zero:Mo},Mj=uK(MN,Mw),ME={URI:MM,fromIO:xJ},MR=gV(ME),MD=g$(ME,Mk),MA=gK(ME,Mk),ML={URI:MM,fromEither:xH},MP=rg(ML),MF=ry(ML,Mk),Mz=rv(ML,Mk),MU=xZ(nJ),MW=rr(MT),MB=rl(Mk),MV=n3(M_),M$=xZ(nH),MK=function(t){return nC(bm(t),v9(hu(nA)))},MY=function(t){var n=MK(t);return function(t){return nG(t)?n(t):M$}};let Mq=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:MM,map:Mp,alt:Mg},Alternative:{URI:MM,map:Mp,ap:Mh,of:xZ,alt:Mg,zero:Mo},ApT:M$,Applicative:{URI:MM,map:Mp,ap:Mh,of:xZ},Apply:M_,Chain:Mk,Compactable:{URI:MM,compact:Mu,separate:Ms},Do:MU,Filterable:{URI:MM,map:Mp,compact:Mu,separate:Ms,filter:My,filterMap:Mv,partition:Mb,partitionMap:Mx},FromEither:ML,FromIO:ME,Functor:MT,Monad:{URI:MM,map:Mp,ap:Mh,of:xZ,chain:Mm},MonadIO:{URI:MM,map:Mp,ap:Mh,of:xZ,chain:Mm,fromIO:xJ},Pointed:Mw,Zero:MN,alt:Mi,altW:Mi,ap:Mt,apFirst:MI,apS:MV,apSecond:MO,bind:MB,bindTo:MW,chain:Mn,chainEitherK:MF,chainFirst:MC,chainFirstEitherK:Mz,chainFirstIOK:MA,chainIOK:MD,chainNullableK:x8,chainOptionK:x7,compact:Mu,filter:Mc,filterMap:Ml,flap:MS,flatten:Mr,fold:x1,fromEither:xH,fromEitherK:MP,fromIO:xJ,fromIOEither:xX,fromIOK:MR,fromNullable:x5,fromNullableK:x9,fromOption:nw,fromOptionK:x6,fromPredicate:xQ,getOrElse:x2,getOrElseW:x2,guard:Mj,map:Me,match:x0,matchE:x1,matchEW:x1,matchW:x0,none:Ma,of:xZ,partition:Mf,partitionMap:Md,separate:Ms,some:xZ,toNullable:x3,toUndefined:x4,traverseReadonlyArrayWithIndex:MY,traverseReadonlyNonEmptyArrayWithIndex:MK,zero:Mo},Symbol.toStringTag,{value:"Module"}));var MG=function(){function t(t){var n=this;this.value=t,this.read=function(){return n.value},this.write=this.write.bind(this),this.modify=this.modify.bind(this)}return t.prototype.write=function(t){var n=this;return function(){n.value=t}},t.prototype.modify=function(t){var n=this;return function(){n.value=t(n.value)}},t}();let MZ=Object.freeze(Object.defineProperty({__proto__:null,IORef:MG,newIORef:function(t){return function(){return new MG(t)}}},Symbol.toStringTag,{value:"Module"})),MQ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var MH=function(t){return mW(function(){return JSON.parse(t)},nS)},MJ=function(t){return mW(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},nS)};let MX=Object.freeze(Object.defineProperty({__proto__:null,parse:MH,stringify:MJ},Symbol.toStringTag,{value:"Module"})),M0=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var M1=function(t){return new Map(t)};function M2(t,n){return{show:function(r){var i=[];return r.forEach(function(r,o){i.push("[".concat(t.show(o),", ").concat(n.show(r),"]"))}),"new Map([".concat(i.sort().join(", "),"])")}}}var M4=function(t){return t.size},M3=function(t){return 0===t.size};function M5(t){var n=Ta(t);return function(r,i){if(void 0===i){var o=M5(t);return function(t){return o(r,t)}}return nU(n(r,i))}}function M9(t){return function(n,r){if(void 0===r){var i=M9(t);return function(t){return i(n,t)}}for(var o,a=r.values();!(o=a.next()).done;){var u=o.value;if(t.equals(n,u))return!0}return!1}}var M8=function(t){return function(n){return Array.from(n.keys()).sort(t.compare)}},M6=function(t){return function(n){return Array.from(n.values()).sort(t.compare)}};function M7(t){var n=M8(t);return function(t){return function(r){for(var i=[],o=n(r),a=0;a<o.length;a++){var u=o[a];i.push(t(u,r.get(u)))}return i}}}var Te=function(t){return M7(t)(function(t,n){return[t,n]})},Tt=function(t){var n=To(t);return function(t,r){var i=n(t);return function(n){var o=i(n);if(nz(o)){var a=new Map(n);return a.set(t,r),a}if(o.value[1]!==r){var a=new Map(n);return a.set(o.value[0],r),a}return n}}},Tn=function(t){var n=To(t);return function(t){return function(r){var i=n(t,r);if(nU(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},Tr=function(t){var n=Ti(t);return function(t,r){return n(t,function(){return r})}},Ti=function(t){var n=To(t);return function(t,r){return function(i){var o=n(t,i);if(nz(o))return nW;var a=o.value,u=a[0],s=a[1],c=r(s);if(c===s)return nB(i);var l=new Map(i);return l.set(u,c),nB(l)}}};function To(t){return function(n,r){if(void 0===r){var i=To(t);return function(t){return i(n,t)}}for(var o,a=r.entries();!(o=a.next()).done;){var u=o.value,s=u[0],c=u[1];if(t.equals(s,n))return nB([s,c])}return nW}}function Ta(t){var n=To(t);return function(r,i){if(void 0===i){var o=Ta(t);return function(t){return o(r,t)}}return nD(n(r,i),pf(function(t){return t[0],t[1]}))}}function Tu(t,n){var r=To(t);return function(i,o){if(void 0===o){var a=Tu(t,n);return function(t){return a(t,i)}}for(var u,s=i.entries();!(u=s.next()).done;){var c=u.value,l=c[0],f=c[1],d=r(l,o);if(nz(d)||!t.equals(l,d.value[0])||!n.equals(f,d.value[1]))return!1}return!0}}var Ts=new Map;function Tc(t,n){var r=Tu(t,n);return rM(function(t,n){return r(t,n)&&r(n,t)})}var Tl=function(t,n){return new Map([[t,n]])},Tf=function(t,n){for(var r,i=new Map,o=t.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];i.set(u,n(u,s))}return i},Td=function(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=t(s,u[1]);nV(c)?i.set(s,c.left):o.set(s,c.right)}return uC(i,o)}};function Tp(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=u[1];t(s,c)?o.set(s,c):i.set(s,c)}return uC(i,o)}}var Th=function(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=t(u,a[1]);nU(s)&&i.set(u,s.value)}return i}};function Tm(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];t(u,s)&&i.set(u,s)}return i}}var Tg=function(t,n){return Tf(t,function(t,r){return n(r)})},Ty=function(t,n){return TM(t,function(t,r){return n(r)})},Tv=function(t,n){return TT(t,function(t,r){return n(r)})},Tb=function(t,n){return TS(t,function(t,r){return n(r)})},Tx=function(t,n){return Tw(t,function(t,r){return n(r)})},TM=function(t,n){return nD(t,Tm(n))},TT=function(t,n){return nD(t,Th(n))},TS=function(t,n){return nD(t,Tp(n))},Tw=function(t,n){return nD(t,Td(n))},T_=function(t){for(var n,r=new Map,i=t.entries();!(n=i.next()).done;){var o=n.value,a=o[0],u=o[1];nU(u)&&r.set(a,u.value)}return r},TI=function(t){return function(n){return Ty(n,t)}},TO=function(t){return function(n){return Tv(n,t)}},Tk=function(t){return function(n){return Tg(n,t)}},TC=function(t){return function(n){return Tf(n,t)}},TN=function(t){return function(n){return Tb(n,t)}},Tj=function(t){return function(n){return Tx(n,t)}},TE=function(t){for(var n,r=new Map,i=new Map,o=t.entries();!(n=o.next()).done;){var a=n.value,u=a[0],s=a[1];nV(s)?r.set(u,s.left):i.set(u,s.right)}return uC(r,i)},TR="ReadonlyMap",TD=function(t,n){var r=TJ(t,n);return{concat:function(t,n){return r(n)(t)}}},TA=function(t,n){return{concat:TD(t,n).concat,empty:Ts}},TL=function(t,n){var r=TX(t,n);return{concat:function(t,n){return r(n)(t)}}},TP=function(t){return function(){var n=T0(t);return{concat:function(t,r){return n(r)(t)}}}},TF={URI:TR,map:Tg},Tz=rn(TF),TU=function(){return{URI:TR,_E:void 0,map:Tg,mapWithIndex:Tf}},TW={URI:TR,compact:T_,separate:TE},TB=function(t){var n=TY(t);return function(t,r){return n(t,function(t,n,i){return r(n,i)})}},TV=function(t){var n=Tq(t);return function(t){var r=n(t);return function(t){return r(function(n,r){return t(r)})}}},T$=function(t){var n=TG(t);return function(t,r){return n(t,function(t,n,i){return r(n,i)})}},TK=function(t){var n=TB(t),r=TV(t),i=T$(t);return{URI:TR,_E:void 0,reduce:function(t,r,i){return nD(t,n(r,i))},foldMap:function(t){var n=r(t);return function(t,r){return nD(t,n(r))}},reduceRight:function(t,n,r){return nD(t,i(n,r))}}},TY=function(t){var n=M8(t);return function(t,r){return function(i){for(var o=t,a=0,u=n(i);a<u.length;a++){var s=u[a];o=r(s,o,i.get(s))}return o}}},Tq=function(t){var n=M8(t);return function(t){return function(r){return function(i){for(var o=t.empty,a=0,u=n(i);a<u.length;a++){var s=u[a];o=t.concat(o,r(s,i.get(s)))}return o}}}},TG=function(t){var n=M8(t);return function(t,r){return function(i){for(var o=t,a=n(i),u=a.length,s=u-1;s>=0;s--){var c=a[s];o=r(c,i.get(c),o)}return o}}},TZ=function(t){var n=TK(t),r=TY(t),i=Tq(t),o=TG(t);return{URI:TR,_E:void 0,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(t,n,i){return nD(t,r(n,i))},foldMapWithIndex:function(t){var n=i(t);return function(t,r){return nD(t,n(r))}},reduceRightWithIndex:function(t,n,r){return nD(t,o(n,r))}}},TQ=function(t){var n=TH(t),r=TK(t);return{URI:TR,_E:void 0,map:Tg,reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,traverse:n.traverse,sequence:n.sequence}},TH=function(t){var n=TZ(t),r=M8(t),i=function(t){return function(n,i){for(var o=t.of(new Map),a=r(n),u=a.length,s=0;s<u;s++)!function(r){var u=a[r],s=n.get(u);o=t.ap(t.map(o,function(t){return function(n){return t.set(u,n)}}),i(u,s))}(s);return o}},o=function(t){var n=i(t);return function(t,r){return n(t,function(t,n){return r(n)})}},a=function(t){var n=i(t);return function(t){return n(t,nA)}};return{URI:TR,_E:void 0,map:Tg,mapWithIndex:Tf,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverse:o,sequence:a,traverseWithIndex:i}},TJ=function(t,n){var r=Ta(t);return function(t){return function(i){if(M3(i))return t;if(M3(t))return i;for(var o,a=new Map,u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],f=r(c)(t);nU(f)?a.set(c,n.concat(l,f.value)):a.set(c,l)}for(var d=t.entries();!(o=d.next()).done;){var p=o.value,c=p[0],l=p[1],f=r(c)(a);nz(f)&&a.set(c,l)}return a}}},TX=function(t,n){var r=Ta(t);return function(t){return function(i){if(M3(i)||M3(t))return Ts;for(var o,a=new Map,u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],f=r(c)(t);nU(f)&&a.set(c,n.concat(l,f.value))}return a}}},T0=function(t){var n=M5(t);return function(t){return function(r){if(M3(r))return t;if(M3(t))return r;for(var i,o=new Map,a=r.entries();!(i=a.next()).done;){var u=i.value,s=u[0],c=u[1];n(s)(t)||o.set(s,c)}for(var l=t.entries();!(i=l.next()).done;){var f=i.value,s=f[0],c=f[1];n(s)(r)||o.set(s,c)}return o}}};let T1=Object.freeze(Object.defineProperty({__proto__:null,Compactable:TW,Filterable:{URI:TR,map:Tg,compact:T_,separate:TE,filter:Ty,filterMap:Tv,partition:Tb,partitionMap:Tx},Functor:TF,URI:TR,collect:M7,compact:T_,deleteAt:Tn,difference:T0,elem:M9,empty:Ts,filter:TI,filterMap:TO,filterMapWithIndex:Th,filterWithIndex:Tm,flap:Tz,foldMap:TV,foldMapWithIndex:Tq,fromFoldable:function(t,n,r){return function(i){var o=To(t);return r.reduce(i,new Map,function(t,r){var i=r[0],a=r[1],u=o(i,t);return nU(u)?t.set(u.value[0],n.concat(u.value[1],a)):t.set(i,a),t})}},fromMap:M1,getDifferenceMagma:TP,getEq:Tc,getFilterableWithIndex:function(){return{URI:TR,_E:void 0,map:Tg,mapWithIndex:Tf,compact:T_,separate:TE,filter:Ty,filterMap:Tv,partition:Tb,partitionMap:Tx,partitionMapWithIndex:Tw,partitionWithIndex:TS,filterMapWithIndex:TT,filterWithIndex:TM}},getFoldable:TK,getFoldableWithIndex:TZ,getFunctorWithIndex:TU,getIntersectionSemigroup:TL,getMonoid:function(t,n){var r=To(t);return{concat:function(t,i){if(M3(t))return i;if(M3(i))return t;for(var o,a=new Map(t),u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],f=r(c,t);nU(f)?a.set(f.value[0],n.concat(f.value[1],l)):a.set(c,l)}return a},empty:Ts}},getShow:M2,getTraversable:TQ,getTraversableWithIndex:TH,getUnionMonoid:TA,getUnionSemigroup:TD,getWitherable:function(t){var n=TH(t);return{URI:TR,_E:void 0,map:Tg,compact:T_,separate:TE,filter:Ty,filterMap:Tv,partition:Tb,partitionMap:Tx,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:n.traverse,sequence:n.sequence,mapWithIndex:Tf,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverseWithIndex:n.traverseWithIndex,wilt:uW(n,TW),wither:uB(n,TW)}},insertAt:Tt,intersection:TX,isEmpty:M3,isSubmap:Tu,keys:M8,lookup:Ta,lookupWithKey:To,map:Tk,mapWithIndex:TC,member:M5,modifyAt:Ti,partition:TN,partitionMap:Tj,partitionMapWithIndex:Td,partitionWithIndex:Tp,pop:function(t){var n=Ta(t),r=Tn(t);return function(t){var i=r(t);return function(r){return nD(n(t,r),pf(function(t){return[t,i(r)]}))}}},readonlyMap:{URI:TR,map:Tg,compact:T_,separate:TE,filter:Ty,filterMap:Tv,partition:Tb,partitionMap:Tx},reduce:TB,reduceRight:T$,reduceRightWithIndex:TG,reduceWithIndex:TY,separate:TE,singleton:Tl,size:M4,toMap:function(t){return new Map(t)},toReadonlyArray:Te,toUnfoldable:function(t,n){var r=Te(t);return function(t){var i=r(t),o=i.length;return n.unfold(0,function(t){return t<o?nB([i[t],t+1]):nW})}},union:TJ,updateAt:Tr,upsertAt:Tt,values:M6},Symbol.toStringTag,{value:"Module"}));var T2=globalThis&&globalThis.__assign||function(){return(T2=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},T4=function(t){return function(n){return Array.from(n.keys()).sort(t.compare)}},T3=function(t){return function(n){return Array.from(n.values()).sort(t.compare)}};function T5(t){var n=T4(t);return function(t){return function(r){for(var i=[],o=n(r),a=0;a<o.length;a++){var u=o[a];i.push(t(u,r.get(u)))}return i}}}function T9(t){return T5(t)(function(t,n){return[t,n]})}var T8=function(t){var n=St(t);return function(t,r){var i=n(t);return function(n){var o=i(n);if(nz(o)){var a=new Map(n);return a.set(t,r),a}if(o.value[1]!==r){var a=new Map(n);return a.set(o.value[0],r),a}return n}}},T6=function(t){var n=St(t);return function(t){return function(r){var i=n(t,r);if(nU(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},T7=function(t){var n=Se(t);return function(t,r){return n(t,function(){return r})}},Se=function(t){var n=St(t);return function(t,r){return function(i){var o=n(t,i);if(nz(o))return nW;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),nB(a)}}};function St(t){return function(n,r){if(void 0===r){var i=St(t);return function(t){return i(n,t)}}for(var o,a=r.entries();!(o=a.next()).done;){var u=o.value,s=u[0],c=u[1];if(t.equals(s,n))return nB([s,c])}return nW}}var Sn=function(t,n){return new Map([[t,n]])},Sr=function(t,n){for(var r,i=new Map,o=t.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];i.set(u,n(u,s))}return i},Si=function(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=t(s,u[1]);nV(c)?i.set(s,c.left):o.set(s,c.right)}return uC(i,o)}};function So(t){return function(n){for(var r,i=new Map,o=new Map,a=n.entries();!(r=a.next()).done;){var u=r.value,s=u[0],c=u[1];t(s,c)?o.set(s,c):i.set(s,c)}return uC(i,o)}}var Sa=function(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=t(u,a[1]);nU(s)&&i.set(u,s.value)}return i}};function Su(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=a[1];t(u,s)&&i.set(u,s)}return i}}var Ss=function(t,n){return Sr(t,function(t,r){return n(r)})},Sc=function(t,n){return Sp(t,function(t,r){return n(r)})},Sl=function(t,n){return Sh(t,function(t,r){return n(r)})},Sf=function(t,n){return Sm(t,function(t,r){return n(r)})},Sd=function(t,n){return Sg(t,function(t,r){return n(r)})},Sp=function(t,n){return nD(t,Su(n))},Sh=function(t,n){return nD(t,Sa(n))},Sm=function(t,n){return nD(t,So(n))},Sg=function(t,n){return nD(t,Si(n))},Sy=function(t){for(var n,r=new Map,i=t.entries();!(n=i.next()).done;){var o=n.value,a=o[0],u=o[1];nU(u)&&r.set(a,u.value)}return r},Sv=function(t){return function(n){return Sc(n,t)}},Sb=function(t){return function(n){return Sl(n,t)}},Sx=function(t){return function(n){return Ss(n,t)}},SM=function(t){return function(n){return Sr(n,t)}},ST=function(t){return function(n){return Sf(n,t)}},SS=function(t){return function(n){return Sd(n,t)}},Sw=function(t){for(var n,r=new Map,i=new Map,o=t.entries();!(n=o.next()).done;){var a=n.value,u=a[0],s=a[1];nV(s)?r.set(u,s.left):i.set(u,s.right)}return uC(r,i)},S_=function(t,n){var r=SP(t,n);return{concat:function(t,n){return r(n)(t)}}},SI=function(t,n){return{concat:S_(t,n).concat,empty:new Map}},SO=function(t,n){var r=SF(t,n);return{concat:function(t,n){return r(n)(t)}}},Sk=function(t){return function(){var n=Sz(t);return{concat:function(t,r){return n(r)(t)}}}},SC=function(t){return T2(T2({},TK(t)),{URI:"Map"})},SN=function(t){return T2(T2({},TZ(t)),{URI:"Map"})},Sj=function(t){var n=SN(t),r=T4(t),i=function(t){return function(n,i){for(var o=t.of(new Map),a=r(n),u=a.length,s=0;s<u;s++)!function(r){var u=a[r],s=n.get(u);o=t.ap(t.map(o,function(t){return function(n){return t.set(u,n)}}),i(u,s))}(s);return o}},o=function(t){var n=i(t);return function(t,r){return n(t,function(t,n){return r(n)})}},a=function(t){var n=i(t);return function(t){return n(t,function(t,n){return n})}};return{URI:"Map",_E:void 0,map:Ss,mapWithIndex:Sr,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverse:o,sequence:a,traverseWithIndex:i}},SE={URI:"Map",map:Ss},SR=rn(SE),SD={URI:"Map",compact:Sy,separate:Sw},SA={URI:"Map",map:Ss,compact:Sy,separate:Sw,filter:Sc,filterMap:Sl,partition:Sf,partitionMap:Sd},SL=function(t){return new Map(t)},SP=function(t,n){var r=TJ(t,n);return function(t){return function(n){return M3(n)?SL(t):M3(t)?SL(n):r(t)(n)}}},SF=function(t,n){var r=TX(t,n);return function(t){return function(n){return M3(n)||M3(t)?new Map:r(t)(n)}}},Sz=function(t){var n=T0(t);return function(t){return function(r){return M3(r)?SL(t):M3(t)?SL(r):n(t)(r)}}},SU=new Map;let SW=Object.freeze(Object.defineProperty({__proto__:null,Compactable:SD,Filterable:SA,Functor:SE,URI:"Map",collect:T5,compact:Sy,deleteAt:T6,difference:Sz,elem:M9,empty:SU,filter:Sv,filterMap:Sb,filterMapWithIndex:Sa,filterWithIndex:Su,flap:SR,foldMap:TV,foldMapWithIndex:Tq,fromFoldable:function(t,n,r){return function(i){var o=St(t);return r.reduce(i,new Map,function(t,r){var i=r[0],a=r[1],u=o(i,t);return nU(u)?t.set(u.value[0],n.concat(u.value[1],a)):t.set(i,a),t})}},getDifferenceMagma:Sk,getEq:Tc,getFilterableWithIndex:function(){return{URI:"Map",_E:void 0,map:Ss,mapWithIndex:Sr,compact:Sy,separate:Sw,filter:Sc,filterMap:Sl,partition:Sf,partitionMap:Sd,partitionMapWithIndex:Sg,partitionWithIndex:Sm,filterMapWithIndex:Sh,filterWithIndex:Sp}},getFoldable:SC,getFoldableWithIndex:SN,getIntersectionSemigroup:SO,getMonoid:function(t,n){var r=St(t);return{concat:function(t,i){if(M3(t))return i;if(M3(i))return t;for(var o,a=new Map(t),u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],f=r(c,t);nU(f)?a.set(f.value[0],n.concat(f.value[1],l)):a.set(c,l)}return a},empty:new Map}},getShow:M2,getTraversableWithIndex:Sj,getUnionMonoid:SI,getUnionSemigroup:S_,getWitherable:function(t){var n=Sj(t);return{URI:"Map",_E:void 0,map:Ss,compact:Sy,separate:Sw,filter:Sc,filterMap:Sl,partition:Sf,partitionMap:Sd,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:n.traverse,sequence:n.sequence,mapWithIndex:Sr,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverseWithIndex:n.traverseWithIndex,wilt:uW(n,SD),wither:uB(n,SD)}},insertAt:T8,intersection:SF,isEmpty:M3,isSubmap:Tu,keys:T4,lookup:Ta,lookupWithKey:St,map:Sx,mapWithIndex:SM,map_:SA,member:M5,modifyAt:Se,partition:ST,partitionMap:SS,partitionMapWithIndex:Si,partitionWithIndex:So,pop:function(t){var n=Ta(t),r=T6(t);return function(t){var i=r(t);return function(r){return nD(n(t,r),pf(function(t){return[t,i(r)]}))}}},reduce:TB,reduceRight:T$,reduceRightWithIndex:TG,reduceWithIndex:TY,separate:Sw,singleton:Sn,size:M4,toArray:T9,toUnfoldable:function(t,n){var r=T9(t);return function(t){var i=r(t),o=i.length;return n.unfold(0,function(t){return t<o?nB([i[t],t+1]):nW})}},union:SP,updateAt:T7,upsertAt:T8,values:T3},Symbol.toStringTag,{value:"Module"})),SB=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),SV=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),S$=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),SK=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),SY=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Sq=function(t){return{concat:r5(t).concat,empty:t.top}},SG=function(t){return{concat:r9(t).concat,empty:t.bottom}},SZ=function(t){return{concat:rX(t).concat,empty:t.empty}},SQ=function(t){var n={};for(var r in t)nX.call(t,r)&&(n[r]=t[r].empty);return{concat:r6(t).concat,empty:n}},SH=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{concat:r7.apply(id,t).concat,empty:t.map(function(t){return t.empty})}},SJ=function(t){return r4(t)(t.empty)},SX={concat:ii.concat,empty:void 0},S0={concat:ia.concat,empty:!0},S1={concat:iu.concat,empty:!1},S2=function(){return SZ(gT())},S4={concat:is.concat,empty:""},S3={concat:ic.concat,empty:0},S5={concat:il.concat,empty:1};let S9=Object.freeze(Object.defineProperty({__proto__:null,concatAll:SJ,fold:SJ,getDualMonoid:SZ,getEndomorphismMonoid:S2,getFunctionMonoid:nb,getJoinMonoid:SG,getMeetMonoid:Sq,getStructMonoid:SQ,getTupleMonoid:SH,max:SG,min:Sq,monoidAll:S0,monoidAny:S1,monoidProduct:S5,monoidString:S4,monoidSum:S3,monoidVoid:SX,reverse:SZ,struct:SQ,tuple:SH},Symbol.toStringTag,{value:"Module"})),S8=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var S6=function(t,n,r){return function(i){return -1===i?t():0===i?n():r()}},S7=function(t){return -1===t?1:1===t?-1:0},we={equals:function(t,n){return t===n}},wt={concat:function(t,n){return 0!==t?t:n}},wn={concat:wt.concat,empty:0},wr=function(t){return t<=-1?-1:t>=1?1:0};let wi=Object.freeze(Object.defineProperty({__proto__:null,Eq:we,Monoid:wn,Semigroup:wt,eqOrdering:we,invert:S7,match:S6,matchW:S6,monoidOrdering:wn,reverse:S7,semigroupOrdering:wt,sign:wr},Symbol.toStringTag,{value:"Module"})),wo=Object.freeze(Object.defineProperty({__proto__:null,pipe:nD,pipeable:function(t){var n,r,i,o,a,u,s,c,l,f,d,p,h,m,g,y={};if("function"==typeof t.map){var v=function(n){return function(r){return t.map(r,n)}};y.map=v}if("function"==typeof t.contramap){var b=function(n){return function(r){return t.contramap(r,n)}};y.contramap=b}if("function"==typeof t.mapWithIndex){var x=function(n){return function(r){return t.mapWithIndex(r,n)}};y.mapWithIndex=x}if("function"==typeof t.ap){var M=function(n){return function(r){return t.ap(r,n)}},T=function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}};y.ap=M,y.apFirst=T,y.apSecond=function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}if("function"==typeof t.chain){var S=function(n){return function(r){return t.chain(r,n)}},w=function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}},_=function(n){return t.chain(n,nS)};y.chain=S,y.chainFirst=w,y.flatten=_}if("function"==typeof t.bimap){var I=function(n,r){return function(i){return t.bimap(i,n,r)}},O=function(n){return function(r){return t.mapLeft(r,n)}};y.bimap=I,y.mapLeft=O}if("function"==typeof t.extend){var k=function(n){return function(r){return t.extend(r,n)}},C=function(n){return t.extend(n,nS)};y.extend=k,y.duplicate=C}if("function"==typeof t.reduce){var N=function(n,r){return function(i){return t.reduce(i,n,r)}},j=function(n){var r=t.foldMap(n);return function(t){return function(n){return r(n,t)}}},E=function(n,r){return function(i){return t.reduceRight(i,n,r)}};y.reduce=N,y.foldMap=j,y.reduceRight=E}if("function"==typeof t.reduceWithIndex){var R=function(n,r){return function(i){return t.reduceWithIndex(i,n,r)}},D=function(n){var r=t.foldMapWithIndex(n);return function(t){return function(n){return r(n,t)}}},A=function(n,r){return function(i){return t.reduceRightWithIndex(i,n,r)}};y.reduceWithIndex=R,y.foldMapWithIndex=D,y.reduceRightWithIndex=A}if("function"==typeof t.alt){var L=function(n){return function(r){return t.alt(r,n)}};y.alt=L}if("function"==typeof t.compact&&(y.compact=t.compact,y.separate=t.separate),"function"==typeof t.filter){var P=function(n){return function(r){return t.filter(r,n)}},F=function(n){return function(r){return t.filterMap(r,n)}},z=function(n){return function(r){return t.partition(r,n)}},U=function(n){return function(r){return t.partitionMap(r,n)}};y.filter=P,y.filterMap=F,y.partition=z,y.partitionMap=U}if("function"==typeof t.filterWithIndex){var W=function(n){return function(r){return t.filterWithIndex(r,n)}},B=function(n){return function(r){return t.filterMapWithIndex(r,n)}},V=function(n){return function(r){return t.partitionWithIndex(r,n)}},$=function(n){return function(r){return t.partitionMapWithIndex(r,n)}};y.filterWithIndex=W,y.filterMapWithIndex=B,y.partitionWithIndex=V,y.partitionMapWithIndex=$}if("function"==typeof t.promap){var K=function(n,r){return function(i){return t.promap(i,n,r)}};y.promap=K}if("function"==typeof t.compose){var Y=function(n){return function(r){return t.compose(r,n)}};y.compose=Y}if("function"==typeof t.throwError){var q=function(n){return function(r){return"None"===r._tag?t.throwError(n()):t.of(r.value)}},G=function(n){return"Left"===n._tag?t.throwError(n.left):t.of(n.right)},Z=function(n,r){return function(i){return n(i)?t.of(i):t.throwError(r(i))}},Q=function(n,r){return function(i){return t.chain(i,function(i){return n(i)?t.of(i):t.throwError(r(i))})}};y.fromOption=q,y.fromEither=G,y.fromPredicate=Z,y.filterOrElse=Q}return y}},Symbol.toStringTag,{value:"Module"})),wa=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),wu=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var ws=function(){return Math.random()};function wc(t,n){return nD(ws,v9(function(r){return Math.floor((n-t+1)*r+t)}))}var wl=nD(ws,v9(function(t){return t<.5})),wf=function(t){return nD(wc(0,t.length-1),v9(function(n){return t[n]}))};let wd=Object.freeze(Object.defineProperty({__proto__:null,random:ws,randomBool:wl,randomElem:wf,randomInt:wc,randomRange:function(t,n){return nD(ws,v9(function(r){return(n-t)*r+t}))}},Symbol.toStringTag,{value:"Module"}));var wp=m7(yu),wh=m6(yu),wm=ge(yo),wg=gt(yo),wy=gd(yo),wv=gp(yp),wb=gh(yp),wx=gb(yo),wM=gm(yp),wT=gg(yp),wS=gy(yp),ww=gv(yo),w_=function(t,n){return nD(t,wj(n))},wI=function(t,n,r){return nD(t,wE(n,r))},wO=function(t,n){return nD(t,wR(n))},wk=function(t,n){return nD(t,wD(n))},wC=function(t,n){return nD(t,wA(n))},wN=function(t,n){return nD(t,wP(n))},wj=go(yo),wE=gc(yo),wR=gl(yo),wD=ga(ys),wA=gu(yp),wL=wA(nS),wP=gs(yp),wF="ReaderEither",wz=function(t){var n=h9(t);return{URI:wF,_E:void 0,compact:hy(yo,n),separate:hv(yo,n,mn)}};function wU(t){var n=n1(ys,h7(t));return{URI:wF,_E:void 0,map:w_,ap:function(t,r){return nD(t,n(r))},of:wh}}function wW(t){var n=gf(yp,t);return{URI:wF,_E:void 0,map:w_,alt:function(t,r){return nD(t,n(r))}}}var wB={URI:wF,map:w_},wV=rn(wB),w$={URI:wF,map:w_,ap:wk},wK=n2(w$),wY=n4(w$),wq={URI:wF,map:w_,ap:wk,of:wh},wG={URI:wF,map:w_,ap:wk,chain:wC},wZ=rc(wG),wQ={URI:wF,fromReader:wm},wH=yO(wQ),wJ=yk(wQ),wX=yC(wQ),w0=yN(wQ,wG),w1=yj(wQ,wG),w2={URI:wF,fromEither:nw},w4=rd(w2),w3=rh(w2),w5=rm(w2,wG),w9=ry(w2,wG),w8=rv(w2,wG),w6=rp(w2),w7=rb(w2,wG),_e=rg(w2),_t=wh(nJ),_n=rr(wB),_r=rl(wG),_i=n3(w$),_o=wh(nH),_a=function(t){return nC(yx(t),g1(mJ(nA)))},_u=function(t){var n=_a(t);return function(t){return nG(t)?n(t):_o}},_s=function(t){return _u(function(n,r){return t(r)})},_c=_s(nS),_l=n5(w$),_f=ra(wq),_d=function(t){return n5(ys)(h5(t))};let _p=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:wF,map:w_,alt:wN},ApT:_o,Applicative:wq,Apply:w$,Bifunctor:{URI:wF,bimap:wI,mapLeft:wO},Chain:wG,Do:_t,FromEither:w2,FromReader:wQ,Functor:wB,Monad:{URI:wF,map:w_,ap:wk,of:wh,chain:wC},MonadThrow:{URI:wF,map:w_,ap:wk,of:wh,chain:wC,throwError:wp},Pointed:{URI:wF,of:wh},URI:wF,alt:wP,altW:wP,ap:wD,apFirst:wK,apFirstW:wK,apS:_i,apSW:_i,apSecond:wY,apSecondW:wY,apW:wD,ask:wH,asks:wJ,asksReaderEither:gZ,asksReaderEitherW:gZ,bimap:wE,bind:_r,bindTo:_n,bindW:_r,chain:wA,chainEitherK:w9,chainEitherKW:w9,chainFirst:wZ,chainFirstEitherK:w8,chainFirstEitherKW:w8,chainFirstReaderK:w1,chainFirstReaderKW:w1,chainFirstW:wZ,chainOptionK:w5,chainReaderK:w0,chainReaderKW:w0,chainW:wA,filterOrElse:w7,filterOrElseW:w7,flap:wV,flatten:wL,flattenW:wL,fold:wv,foldW:wv,fromEither:nw,fromEitherK:_e,fromOption:w4,fromOptionK:w3,fromPredicate:w6,fromReader:wm,fromReaderK:wX,getAltReaderValidation:wW,getApplicativeReaderValidation:wU,getApplyMonoid:_f,getApplySemigroup:_l,getCompactable:wz,getFilterable:function(t){var n=h8(t),r=wz(t),i=gO(yo,n),o=gk(yo,n),a=gC(yo,n),u=gN(yo,n);return{URI:wF,_E:void 0,map:w_,compact:r.compact,separate:r.separate,filter:function(t,n){return nD(t,i(n))},filterMap:function(t,n){return nD(t,o(n))},partition:function(t,n){return nD(t,a(n))},partitionMap:function(t,n){return nD(t,u(n))}}},getOrElse:wb,getOrElseW:wb,getReaderValidation:function(t){var n=wU(t),r=wW(t);return{URI:wF,_E:void 0,map:w_,ap:n.ap,of:wh,chain:wC,bimap:wI,mapLeft:wO,alt:r.alt,throwError:wp}},getSemigroup:_d,left:wp,leftReader:wg,local:gG,map:wj,mapLeft:wR,match:wy,matchE:wv,matchEW:wv,matchW:wy,of:wh,orElse:wM,orElseFirst:wT,orElseFirstW:wT,orElseW:wM,orLeft:wS,readerEither:{URI:wF,bimap:wI,mapLeft:wO,map:w_,of:wh,ap:wk,chain:wC,alt:wN,throwError:wp},right:wh,rightReader:wm,sequenceArray:_c,swap:ww,throwError:wp,toUnion:wx,traverseArray:_s,traverseArrayWithIndex:_u,traverseReadonlyArrayWithIndex:_u,traverseReadonlyNonEmptyArrayWithIndex:_a},Symbol.toStringTag,{value:"Module"}));function _h(t){return function(n){return function(){return t.of(n)}}}function _m(t){return function(n){return function(r){return function(i){return t.map(r(i),n)}}}}function _g(t){return function(n){return function(r){return function(i){return t.ap(r(i),n(i))}}}}function _y(t){return function(n){return function(r){return function(i){return t.chain(r(i),function(t){return n(t)(i)})}}}}function _v(t){return function(n){return nC(n,t.of)}}let _b=Object.freeze(Object.defineProperty({__proto__:null,ap:_g,chain:_y,fromNaturalTransformation:function(t){return function(n){return nC(n,t)}},fromReader:_v,getReaderM:function(t){var n=_g(t),r=_m(t),i=_y(t);return{map:function(t,n){return nD(t,r(n))},ap:function(t,r){return nD(t,n(r))},of:_h(t),chain:function(t,n){return nD(t,i(n))},ask:function(){return t.of},asks:function(n){return nC(n,t.of)},local:function(t,n){return function(r){return t(n(r))}},fromReader:_v(t),fromM:function(t){return function(){return t}}}},map:_m,of:_h},Symbol.toStringTag,{value:"Module"}));var _x=function(t){return function(){return Promise.resolve().then(t)}},_M=function(t,n){return nD(t,__(n))},_T=function(t,n){return nD(t,_I(n))},_S=function(t,n){return nD(t,_k(function(t){return nD(n,__(t))}))},_w=function(t,n){return nD(t,_k(n))},__=function(t){return function(n){return function(){return Promise.resolve().then(n).then(t)}}},_I=function(t){return function(n){return function(){return Promise.all([Promise.resolve().then(n),Promise.resolve().then(t)]).then(function(t){var n;return(0,t[0])(t[1])})}}},_O=function(t){return function(){return Promise.resolve(t)}},_k=function(t){return function(n){return function(){return Promise.resolve().then(n).then(function(n){return t(n)()})}}},_C=_k(nS),_N="Task",_j={URI:_N,map:_M},_E=rn(_j),_R={URI:_N,of:_O},_D={URI:_N,map:_M,ap:_T},_A=n2(_D),_L=n4(_D),_P={URI:_N,map:_M,ap:_T,of:_O},_F={URI:_N,map:_M,ap:_S},_z={URI:_N,map:_M,ap:_S,of:_O},_U={URI:_N,map:_M,ap:_T,chain:_w},_W={URI:_N,map:_M,of:_O,ap:_T,chain:_w},_B=rc(_U),_V={URI:_N,fromIO:_x},_$=gV(_V),_K=g$(_V,_U),_Y=gK(_V,_U),_q=function(){return new Promise(function(t){})},_G=_O(nJ),_Z=rr(_j),_Q=rl(_U),_H=n3(_D),_J=_O(nH),_X=function(t){return function(n){return function(){return Promise.all(n.map(function(n,r){return Promise.resolve().then(function(){return t(r,n)()})}))}}},_0=function(t){var n=_X(t);return function(t){return nG(t)?n(t):_J}},_1=function(t){return function(n){return function(){return nQ(n).reduce(function(n,r,i){return n.then(function(n){return Promise.resolve().then(t(i+1,r)).then(function(t){return n.push(t),n})})},Promise.resolve().then(t(0,nZ(n))).then(nq))}}},_2=function(t){var n=_1(t);return function(t){return nG(t)?n(t):_J}},_4=function(t){return _0(function(n,r){return t(r)})},_3=_4(nS),_5=function(t){return _2(function(n,r){return t(r)})},_9=_5(nS),_8=n5(_F),_6=ra(_z);let _7=Object.freeze(Object.defineProperty({__proto__:null,ApT:_J,ApplicativePar:_P,ApplicativeSeq:_z,ApplyPar:_D,ApplySeq:_F,Chain:_U,Do:_G,FromIO:_V,FromTask:{URI:_N,fromIO:_x,fromTask:nS},Functor:_j,Monad:_W,MonadIO:{URI:_N,map:_M,of:_O,ap:_T,chain:_w,fromIO:_x},MonadTask:{URI:_N,map:_M,of:_O,ap:_T,chain:_w,fromIO:_x,fromTask:nS},Pointed:_R,URI:_N,ap:_I,apFirst:_A,apS:_H,apSecond:_L,bind:_Q,bindTo:_Z,chain:_k,chainFirst:_B,chainFirstIOK:_Y,chainIOK:_K,delay:function(t){return function(n){return function(){return new Promise(function(r){setTimeout(function(){Promise.resolve().then(n).then(r)},t)})}}},flap:_E,flatten:_C,fromIO:_x,fromIOK:_$,fromTask:nS,getMonoid:_6,getRaceMonoid:function(){return{concat:function(t,n){return function(){return Promise.race([Promise.resolve().then(t),Promise.resolve().then(n)])}},empty:_q}},getSemigroup:_8,map:__,never:_q,of:_O,sequenceArray:_3,sequenceSeqArray:_9,task:{URI:_N,map:_M,of:_O,ap:_T,chain:_w,fromIO:_x,fromTask:nS},taskSeq:{URI:_N,map:_M,of:_O,ap:_S,chain:_w,fromIO:_x,fromTask:nS},traverseArray:_4,traverseArrayWithIndex:_0,traverseReadonlyArrayWithIndex:_0,traverseReadonlyArrayWithIndexSeq:_2,traverseReadonlyNonEmptyArrayWithIndex:_X,traverseReadonlyNonEmptyArrayWithIndexSeq:_1,traverseSeqArray:_5,traverseSeqArrayWithIndex:_2},Symbol.toStringTag,{value:"Module"}));var Ie=_v(_R),It=nC(_x,nw),In=function(t,n){return nD(t,Ia(n))},Ir=function(t,n){return nD(t,Iu(n))},Ii=function(t,n){return nD(t,Ic(function(t){return nD(n,Ia(t))}))},Io=function(t,n){return nD(t,Ic(n))},Ia=_m(_j),Iu=_g(_D),Is=_h(_R),Ic=_y(_W),Il=Ic(nS),If="ReaderTask",Id={URI:If,map:In},Ip=rn(Id),Ih={URI:If,of:Is},Im={URI:If,map:In,ap:Ir},Ig=n2(Im),Iy=n4(Im),Iv={URI:If,map:In,ap:Ii},Ib={URI:If,map:In,ap:Ii,of:Is},Ix={URI:If,map:In,ap:Ir,chain:Io},IM={URI:If,map:In,of:Is,ap:Ir,chain:Io},IT=rc(Ix),IS={URI:If,fromIO:It},Iw=gV(IS),I_=g$(IS,Ix),II=gK(IS,Ix),IO={URI:If,fromReader:Ie},Ik=yO(IO),IC=yk(IO),IN=yC(IO),Ij=yN(IO,Ix),IE=yj(IO,Ix),IR={URI:If,fromIO:It,fromTask:nw},ID=vc(IR),IA=vl(IR,Ix),IL=vf(IR,Ix),IP=Is(nJ),IF=rr(Id),Iz=rl(Ix),IU=n3(Im),IW=Is(nH),IB=function(t){return nC(yx(t),g1(_X(nA)))},IV=function(t){var n=IB(t);return function(t){return nG(t)?n(t):IW}},I$=function(t){return nC(yx(t),g1(_1(nA)))},IK=function(t){var n=I$(t);return function(t){return nG(t)?n(t):IW}},IY=function(t){return IV(function(n,r){return t(r)})},Iq=IY(nS),IG=function(t){return IK(function(n,r){return t(r)})},IZ=IG(nS),IQ=n5(Iv),IH=ra(Ib);function IJ(t,n){return t(n)()}let IX=Object.freeze(Object.defineProperty({__proto__:null,ApT:IW,ApplicativePar:{URI:If,map:In,ap:Ir,of:Is},ApplicativeSeq:Ib,ApplyPar:Im,ApplySeq:Iv,Chain:Ix,Do:IP,FromIO:IS,FromReader:IO,FromTask:IR,Functor:Id,Monad:IM,MonadIO:{URI:If,map:In,of:Is,ap:Ir,chain:Io,fromIO:It},MonadTask:{URI:If,map:In,of:Is,ap:Ir,chain:Io,fromIO:It,fromTask:nw},Pointed:Ih,URI:If,ap:Iu,apFirst:Ig,apS:IU,apSW:IU,apSecond:Iy,apW:Iu,ask:Ik,asks:IC,asksReaderTask:gZ,asksReaderTaskW:gZ,bind:Iz,bindTo:IF,bindW:Iz,chain:Ic,chainFirst:IT,chainFirstIOK:II,chainFirstReaderK:IE,chainFirstReaderKW:IE,chainFirstTaskK:IL,chainFirstW:IT,chainIOK:I_,chainReaderK:Ij,chainReaderKW:Ij,chainTaskK:IA,chainW:Ic,flap:Ip,flatten:Il,flattenW:Il,fromIO:It,fromIOK:Iw,fromReader:Ie,fromReaderK:IN,fromTask:nw,fromTaskK:ID,getMonoid:IH,getSemigroup:IQ,local:gG,map:Ia,of:Is,readerTask:{URI:If,map:In,of:Is,ap:Ir,chain:Io,fromIO:It,fromTask:nw},readerTaskSeq:{URI:If,map:In,of:Is,ap:Ii,chain:Io,fromIO:It,fromTask:nw},run:IJ,sequenceArray:Iq,sequenceSeqArray:IZ,traverseArray:IY,traverseArrayWithIndex:IV,traverseReadonlyArrayWithIndex:IV,traverseReadonlyArrayWithIndexSeq:IK,traverseReadonlyNonEmptyArrayWithIndex:IB,traverseReadonlyNonEmptyArrayWithIndexSeq:I$,traverseSeqArray:IG,traverseSeqArrayWithIndex:IK},Symbol.toStringTag,{value:"Module"}));var I0=globalThis&&globalThis.__awaiter||function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{c(i.next(t))}catch(n){a(n)}}function s(t){try{c(i.throw(t))}catch(n){a(n)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}c((i=i.apply(t,n||[])).next())})},I1=globalThis&&globalThis.__generator||function(t,n){var r,i,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,i=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=n.call(t,u)}catch(s){a=[6,s],i=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},I2=m7(_R),I4=m6(_R),I3=ge(_j),I5=gt(_j),I9=nC(_x,I3),I8=nC(_x,I5),I6=function(t){return __(mw(t))},I7=gd(_j),Oe=gp(_W),Ot=gh(_W),On=function(t,n){return function(){return I0(void 0,void 0,void 0,function(){var r;return I1(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t().then(nY)];case 1:return[2,r.sent()];case 2:return[2,nK(n(r.sent()))];case 3:return[2]}})})}},Or=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return On(function(){return t.apply(void 0,r)},n)}},Oi=gb(_j),Oo=gn(_R),Oa=gr(_R),Ou=gi(_W),Os=gm(_W),Oc=gg(_W),Ol=function(t){return Oc(O2(t))},Of=function(t){return Oc(O9(t))},Od=gy(_W),Op=gv(_j),Oh=function(t){var n=I6(t);return function(t){return nC(t,n)}},Om=function(t){return function(n){return function(r){return nD(r,OC(Oh(t)(n)))}}},Og=function(t){return nC(t,_x)},Oy=function(t){return ON(Og(t))},Ov=function(t,n){return nD(t,O_(n))},Ob=function(t,n){return nD(t,Ok(n))},Ox=function(t,n){return nD(t,OC(function(t){return nD(n,O_(t))}))},OM=function(t,n){return nD(t,OC(n))},OT=function(t,n,r){return nD(t,OI(n,r))},OS=function(t,n){return nD(t,OO(n))},Ow=function(t,n){return nD(t,OE(n))},O_=go(_j),OI=gc(_j),OO=gl(_j),Ok=ga(_D),OC=gu(_W),ON=OC,Oj=ON(nS),OE=gs(_W),OR="TaskEither";function OD(t,n){var r=n1(t,h7(n));return{URI:OR,_E:void 0,map:Ov,ap:function(t,n){return nD(t,r(n))},of:I4}}function OA(t){var n=gf(_W,t);return{URI:OR,_E:void 0,map:Ov,alt:function(t,r){return nD(t,n(r))}}}var OL=function(t){var n=h9(t);return{URI:OR,_E:void 0,compact:hy(_j,n),separate:hv(_j,n,mn)}},OP={URI:OR,map:Ov},OF=rn(OP),Oz={URI:OR,map:Ov,ap:Ob},OU=n2(Oz),OW=n4(Oz),OB={URI:OR,map:Ov,ap:Ox},OV={URI:OR,map:Ov,ap:Ox,of:I4},O$={URI:OR,map:Ov,ap:Ob,chain:OM},OK=rc(O$),OY={URI:OR,fromEither:_O},Oq=rd(OY),OG=rh(OY),OZ=rm(OY,O$),OQ=ry(OY,O$),OH=rv(OY,O$),OJ=rp(OY),OX=rb(OY,O$),O0=rg(OY),O1={URI:OR,fromIO:I9},O2=gV(O1),O4=g$(O1,O$),O3=gK(O1,O$),O5={URI:OR,fromIO:I9,fromTask:I3},O9=vc(O5),O8=vl(O5,O$),O6=vf(O5,O$),O7=function(t,n,r){return ke(t,n,r)},ke=function(t,n,r){return nD(t,ON(function(t){return nD(n(t),_k(function(n){return nD(r(t,n),ON(function(){return _O(n)}))}))}))},kt=I4(nJ),kn=rr(OP),kr=rl(O$),ki=n3(Oz),ko=I4(nH),ka=function(t){return nC(_X(t),__(mJ(nA)))},ku=function(t){var n=ka(t);return function(t){return nG(t)?n(t):ko}},ks=function(t){return function(n){return function(){return nQ(n).reduce(function(n,r,i){return n.then(function(o){return nV(o)?n:t(i+1,r)().then(function(t){return nV(t)?t:(o.right.push(t.right),o)})})},t(0,nZ(n))().then(mt(nq)))}}},kc=function(t){var n=ks(t);return function(t){return nG(t)?n(t):ko}},kl=function(t){return ku(function(n,r){return t(r)})},kf=kl(nS),kd=function(t){return kc(function(n,r){return t(r)})},kp=kd(nS),kh=n5(OB),km=ra(OV),kg=function(t){return n5(_F)(h5(t))};let ky=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:OR,map:Ov,alt:Ow},ApT:ko,ApplicativePar:{URI:OR,map:Ov,ap:Ob,of:I4},ApplicativeSeq:OV,ApplyPar:Oz,ApplySeq:OB,Bifunctor:{URI:OR,bimap:OT,mapLeft:OS},Chain:O$,Do:kt,FromEither:OY,FromIO:O1,FromTask:O5,Functor:OP,Monad:{URI:OR,map:Ov,ap:Ob,chain:OM,of:I4},MonadIO:{URI:OR,map:Ov,ap:Ob,chain:OM,of:I4,fromIO:I9},MonadTask:{URI:OR,map:Ov,ap:Ob,chain:OM,of:I4,fromIO:I9,fromTask:I3},MonadThrow:{URI:OR,map:Ov,ap:Ob,chain:OM,of:I4,throwError:I2},Pointed:{URI:OR,of:I4},URI:OR,alt:OE,altW:OE,ap:Ok,apFirst:OU,apFirstW:OU,apS:ki,apSW:ki,apSecond:OW,apSecondW:OW,apW:Ok,bimap:OI,bind:kr,bindTo:kn,bindW:kr,bracket:O7,bracketW:ke,chain:OC,chainEitherK:OQ,chainEitherKW:OQ,chainFirst:OK,chainFirstEitherK:OH,chainFirstEitherKW:OH,chainFirstIOK:O3,chainFirstTaskK:O6,chainFirstW:OK,chainIOEitherK:Oy,chainIOEitherKW:Oy,chainIOK:O4,chainNullableK:Ou,chainOptionK:OZ,chainTaskK:O8,chainTaskOptionK:Om,chainTaskOptionKW:Om,chainW:ON,filterOrElse:OX,filterOrElseW:OX,flap:OF,flatten:Oj,flattenW:Oj,fold:Oe,foldW:Oe,fromEither:_O,fromEitherK:O0,fromIO:I9,fromIOEither:_x,fromIOEitherK:Og,fromIOK:O2,fromNullable:Oo,fromNullableK:Oa,fromOption:Oq,fromOptionK:OG,fromPredicate:OJ,fromTask:I3,fromTaskK:O9,fromTaskOption:I6,fromTaskOptionK:Oh,getAltTaskValidation:OA,getApplicativeTaskValidation:OD,getApplyMonoid:km,getApplySemigroup:kh,getCompactable:OL,getFilterable:function(t){var n=h8(t),r=OL(t),i=gO(_j,n),o=gk(_j,n),a=gC(_j,n),u=gN(_j,n);return{URI:OR,_E:void 0,map:Ov,compact:r.compact,separate:r.separate,filter:function(t,n){return nD(t,i(n))},filterMap:function(t,n){return nD(t,o(n))},partition:function(t,n){return nD(t,a(n))},partitionMap:function(t,n){return nD(t,u(n))}}},getOrElse:Ot,getOrElseW:Ot,getSemigroup:kg,getTaskValidation:function(t){var n=OD(_P,t),r=OA(t);return{URI:OR,_E:void 0,map:Ov,ap:n.ap,of:I4,chain:OM,bimap:OT,mapLeft:OS,alt:r.alt,fromIO:I9,fromTask:I3,throwError:I2}},left:I2,leftIO:I8,leftTask:I5,map:O_,mapLeft:OO,match:I7,matchE:Oe,matchEW:Oe,matchW:I7,of:I4,orElse:Os,orElseFirst:Oc,orElseFirstIOK:Ol,orElseFirstTaskK:Of,orElseFirstW:Oc,orElseW:Os,orLeft:Od,right:I4,rightIO:I9,rightTask:I3,sequenceArray:kf,sequenceSeqArray:kp,swap:Op,taskEither:{URI:OR,bimap:OT,mapLeft:OS,map:Ov,of:I4,ap:Ob,chain:OM,alt:Ow,fromIO:I9,fromTask:I3,throwError:I2},taskEitherSeq:{URI:OR,bimap:OT,mapLeft:OS,map:Ov,of:I4,ap:Ox,chain:OM,alt:Ow,fromIO:I9,fromTask:I3,throwError:I2},taskify:function(t){return function(){var n=Array.prototype.slice.call(arguments);return function(){return new Promise(function(r){var i=function(t,n){return null!=t?r(nK(t)):r(nY(n))};t.apply(null,n.concat(i))})}}},throwError:I2,toUnion:Oi,traverseArray:kl,traverseArrayWithIndex:ku,traverseReadonlyArrayWithIndex:ku,traverseReadonlyArrayWithIndexSeq:kc,traverseReadonlyNonEmptyArrayWithIndex:ka,traverseReadonlyNonEmptyArrayWithIndexSeq:ks,traverseSeqArray:kd,traverseSeqArrayWithIndex:kc,tryCatch:On,tryCatchK:Or},Symbol.toStringTag,{value:"Module"}));var kv=m7(Ih),kb=m6(Ih),kx=nC(I3,nw),kM=nC(I5,nw),kT=function(t){return nC(t,I4)},kS=function(t){return nC(t,I2)},kw=ge(Id),k_=gt(Id),kI=nC(I9,nw),kO=nC(I8,nw),kk=nC(_x,nw),kC=function(t){return nC(t,_O)},kN=gd(Id),kj=gp(Ix),kE=gh(IM),kR=gb(Id),kD=gn(Ih),kA=gr(Ih),kL=gi(IM),kP=gm(IM),kF=gg(IM),kz=gy(IM),kU=gv(Id),kW=function(t){return nC(t,kk)},kB=function(t){return k8(kW(t))},kV=function(t){return nC(t,nw)},k$=function(t){return k8(kV(t))},kK=function(t){return Ch(kV(t))},kY=function(t){return nC(t,kC)},kq=function(t){return k8(kY(t))},kG=function(t){return Ch(kY(t))},kZ=function(t,n){return nD(t,k2(n))},kQ=function(t,n){return nD(t,k5(n))},kH=function(t,n){return nD(t,k9(function(t){return nD(n,k2(t))}))},kJ=function(t,n){return nD(t,k9(n))},kX=function(t,n){return nD(t,k7(n))},k0=function(t,n,r){return nD(t,k4(n,r))},k1=function(t,n){return nD(t,k3(n))},k2=go(Id),k4=gc(Id),k3=gl(Id),k5=ga(Im),k9=gu(IM),k8=k9,k6=k8(nS),k7=gs(IM),Ce="ReaderTaskEither",Ct=function(t){var n=h9(t);return{URI:Ce,_E:void 0,compact:hy(Id,n),separate:hv(Id,n,mn)}};function Cn(t,n){var r=n1(ys,OD(t,n));return{URI:Ce,_E:void 0,map:kZ,ap:function(t,n){return nD(t,r(n))},of:kb}}function Cr(t){var n=gf(IM,t);return{URI:Ce,_E:void 0,map:kZ,alt:function(t,r){return nD(t,n(r))}}}var Ci={URI:Ce,map:kZ},Co=rn(Ci),Ca={URI:Ce,of:kb},Cu={URI:Ce,map:kZ,ap:kQ},Cs=n2(Cu),Cc=n4(Cu),Cl={URI:Ce,map:kZ,ap:kH},Cf={URI:Ce,map:kZ,ap:kH,of:kb},Cd={URI:Ce,map:kZ,ap:kQ,chain:kJ},Cp=rc(Cd),Ch=Cp,Cm={URI:Ce,fromReader:kT},Cg=yO(Cm),Cy=yk(Cm),Cv=yC(Cm),Cb=yN(Cm,Cd),Cx=yj(Cm,Cd),CM=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return kw(t.apply(void 0,n))}},CT=function(t){return k8(CM(t))},CS=function(t){return Ch(CM(t))},Cw={URI:Ce,fromEither:Is},C_=rd(Cw),CI=rh(Cw),CO=rm(Cw,Cd),Ck=ry(Cw,Cd),CC=rv(Cw,Cd),CN=rp(Cw),Cj=rb(Cw,Cd),CE=rg(Cw),CR={URI:Ce,fromIO:kI},CD=gV(CR),CA=g$(CR,Cd),CL=gK(CR,Cd),CP={URI:Ce,fromIO:kI,fromTask:kx},CF=vc(CP),Cz=vl(CP,Cd),CU=vf(CP,Cd);function CW(t,n,r){return CB(t,n,r)}function CB(t,n,r){return function(i){return ke(t(i),function(t){return n(t)(i)},function(t,n){return r(t,n)(i)})}}var CV=kb(nJ),C$=rr(Ci),CK=rl(Cd),CY=n3(Cu),Cq=kb(nH),CG=function(t){return nC(yx(t),g1(ka(nA)))},CZ=function(t){var n=CG(t);return function(t){return nG(t)?n(t):Cq}},CQ=function(t){return nC(yx(t),g1(ks(nA)))},CH=function(t){var n=CQ(t);return function(t){return nG(t)?n(t):Cq}},CJ=function(t){return CZ(function(n,r){return t(r)})},CX=CJ(nS),C0=function(t){return CH(function(n,r){return t(r)})},C1=C0(nS),C2=n5(Cl),C4=ra(Cf),C3=function(t){return n5(Iv)(h5(t))};function C5(t,n){return t(n)()}let C9=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Ce,map:kZ,alt:kX},ApT:Cq,ApplicativePar:{URI:Ce,map:kZ,ap:kQ,of:kb},ApplicativeSeq:Cf,ApplyPar:Cu,ApplySeq:Cl,Bifunctor:{URI:Ce,bimap:k0,mapLeft:k1},Chain:Cd,Do:CV,FromEither:Cw,FromIO:CR,FromReader:Cm,FromTask:CP,Functor:Ci,Monad:{URI:Ce,map:kZ,ap:kQ,chain:kJ,of:kb},MonadIO:{URI:Ce,map:kZ,ap:kQ,chain:kJ,of:kb,fromIO:kI},MonadTask:{URI:Ce,map:kZ,ap:kQ,chain:kJ,of:kb,fromIO:kI,fromTask:kx},MonadThrow:{URI:Ce,map:kZ,ap:kQ,chain:kJ,of:kb,throwError:kv},Pointed:Ca,URI:Ce,alt:k7,altW:k7,ap:k5,apFirst:Cs,apFirstW:Cs,apS:CY,apSW:CY,apSecond:Cc,apSecondW:Cc,apW:k5,ask:Cg,asks:Cy,asksReaderTaskEither:gZ,asksReaderTaskEitherW:gZ,bimap:k4,bind:CK,bindTo:C$,bindW:CK,bracket:CW,bracketW:CB,chain:k9,chainEitherK:Ck,chainEitherKW:Ck,chainFirst:Cp,chainFirstEitherK:CC,chainFirstEitherKW:CC,chainFirstIOK:CL,chainFirstReaderEitherK:kG,chainFirstReaderEitherKW:kG,chainFirstReaderK:Cx,chainFirstReaderKW:Cx,chainFirstReaderTaskK:CS,chainFirstReaderTaskKW:CS,chainFirstTaskEitherK:kK,chainFirstTaskEitherKW:kK,chainFirstTaskK:CU,chainFirstW:Ch,chainIOEitherK:kB,chainIOEitherKW:kB,chainIOK:CA,chainNullableK:kL,chainOptionK:CO,chainReaderEitherK:kq,chainReaderEitherKW:kq,chainReaderK:Cb,chainReaderKW:Cb,chainReaderTaskK:CT,chainReaderTaskKW:CT,chainTaskEitherK:k$,chainTaskEitherKW:k$,chainTaskK:Cz,chainW:k8,filterOrElse:Cj,filterOrElseW:Cj,flap:Co,flatten:k6,flattenW:k6,fold:kj,foldW:kj,fromEither:Is,fromEitherK:CE,fromIO:kI,fromIOEither:kk,fromIOEitherK:kW,fromIOK:CD,fromNullable:kD,fromNullableK:kA,fromOption:C_,fromOptionK:CI,fromPredicate:CN,fromReader:kT,fromReaderEither:kC,fromReaderEitherK:kY,fromReaderK:Cv,fromReaderTaskK:CM,fromTask:kx,fromTaskEither:nw,fromTaskEitherK:kV,fromTaskK:CF,getAltReaderTaskValidation:Cr,getApplicativeReaderTaskValidation:Cn,getApplyMonoid:C4,getApplySemigroup:C2,getCompactable:Ct,getFilterable:function(t){var n=h8(t),r=Ct(t),i=gO(Id,n),o=gk(Id,n),a=gC(Id,n),u=gN(Id,n);return{URI:Ce,_E:void 0,map:kZ,compact:r.compact,separate:r.separate,filter:function(t,n){return nD(t,i(n))},filterMap:function(t,n){return nD(t,o(n))},partition:function(t,n){return nD(t,a(n))},partitionMap:function(t,n){return nD(t,u(n))}}},getOrElse:kE,getOrElseW:kE,getReaderTaskValidation:function(t){var n=Cn(_P,t),r=Cr(t);return{URI:Ce,_E:void 0,map:kZ,of:kb,chain:kJ,bimap:k0,mapLeft:k1,ap:n.ap,alt:r.alt,fromIO:kI,fromTask:kx,throwError:kv}},getSemigroup:C3,left:kv,leftIO:kO,leftReader:kS,leftReaderTask:k_,leftTask:kM,local:gG,map:k2,mapLeft:k3,match:kN,matchE:kj,matchEW:kj,matchW:kN,of:kb,orElse:kP,orElseFirst:kF,orElseFirstW:kF,orElseW:kP,orLeft:kz,readerTaskEither:{URI:Ce,map:kZ,of:kb,ap:kQ,chain:kJ,alt:kX,bimap:k0,mapLeft:k1,fromIO:kI,fromTask:kx,throwError:kv},readerTaskEitherSeq:{URI:Ce,map:kZ,of:kb,ap:kH,chain:kJ,alt:kX,bimap:k0,mapLeft:k1,fromIO:kI,fromTask:kx,throwError:kv},right:kb,rightIO:kI,rightReader:kT,rightReaderTask:kw,rightTask:kx,run:C5,sequenceArray:CX,sequenceSeqArray:C1,swap:kU,throwError:kv,toUnion:kR,traverseArray:CJ,traverseArrayWithIndex:CZ,traverseReadonlyArrayWithIndex:CZ,traverseReadonlyArrayWithIndexSeq:CH,traverseReadonlyNonEmptyArrayWithIndex:CG,traverseReadonlyNonEmptyArrayWithIndexSeq:CQ,traverseSeqArray:C0,traverseSeqArrayWithIndex:CH},Symbol.toStringTag,{value:"Module"}));var C8={equals:function(t,n){return t===n}},C6={concat:function(t,n){return t+n}},C7={concat:C6.concat,empty:""},Ne={equals:C8.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},Nt=function(t){return"string"==typeof t},Nn=function(t){return t.toUpperCase()},Nr=function(t){return t.toLowerCase()},Ni=function(t,n){return function(r){return r.replace(t,n)}},No=function(t){return t.trim()},Na=function(t){return t.trimLeft()},Nu=function(t){return t.trimRight()},Ns=function(t,n){return function(r){return r.slice(t,n)}},Nc=function(t){return 0===t.length},Nl=function(t){return t.length},Nf=function(t){return function(n){var r=n.split(t);return nG(r)?r:[n]}},Nd=function(t,n){return function(r){return r.includes(t,n)}},Np=function(t,n){return function(r){return r.startsWith(t,n)}},Nh=function(t,n){return function(r){return r.endsWith(t,n)}};let Nm=Object.freeze(Object.defineProperty({__proto__:null,Eq:C8,Monoid:C7,Ord:Ne,Semigroup:C6,Show:{show:function(t){return JSON.stringify(t)}},empty:"",endsWith:Nh,includes:Nd,isEmpty:Nc,isString:Nt,replace:Ni,size:Nl,slice:Ns,split:Nf,startsWith:Np,toLowerCase:Nr,toUpperCase:Nn,trim:No,trimLeft:Na,trimRight:Nu},Symbol.toStringTag,{value:"Module"}));var Ng=function(t){return Object.assign({},t)},Ny=function(t){return Object.assign({},t)},Nv=function(t){return Object.keys(t).length},Nb=function(t){for(var n in t)if(nX.call(t,n))return!1;return!0},Nx=function(t){return function(n){return Object.keys(n).sort(t.compare)}},NM=Nx(Ne);function NT(t){if("function"==typeof t)return NT(Ne)(t);var n=Nx(t);return function(t){return function(r){for(var i=[],o=0,a=n(r);o<a.length;o++){var u=a[o];i.push(t(u,r[u]))}return i}}}var NS=NT(Ne)(function(t,n){return[t,n]}),Nw=function(t,n){return function(r){if(nX.call(r,t)&&r[t]===n)return r;var i=Object.assign({},r);return i[t]=n,i}},N_=function(t,n){return nX.call(n,t)};function NI(t){return function(n){if(!nX.call(n,t))return n;var r=Object.assign({},n);return delete r[t],r}}var NO=function(t,n){return function(r){if(!N_(t,r))return nW;if(r[t]===n)return nB(r);var i=Object.assign({},r);return i[t]=n,nB(i)}},Nk=function(t,n){return function(r){if(!N_(t,r))return nW;var i=n(r[t]);if(i===r[t])return nB(r);var o=Object.assign({},r);return o[t]=i,nB(o)}};function NC(t){return function(n,r){if(void 0===r){var i=NC(t);return function(t){return i(t,n)}}for(var o in n)if(!nX.call(r,o)||!t.equals(n[o],r[o]))return!1;return!0}}function NN(t,n){return void 0===n?function(n){return NN(t,n)}:nX.call(n,t)?nB(n[t]):nW}var Nj={};function NE(t){return function(n){var r={};for(var i in n)nX.call(n,i)&&(r[i]=t(i,n[i]));return r}}function NR(t){return NE(function(n,r){return t(r)})}function ND(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(2===t.length)return ND(Ne).apply(void 0,t);var r=Nx(t[0]);return function(t,n){return function(i){for(var o=t,a=r(i),u=a.length,s=0;s<u;s++){var c=a[s];o=n(c,o,i[c])}return o}}}function NA(t){if("compare"in t){var n=Nx(t);return function(t){return function(r){return function(i){for(var o=t.empty,a=n(i),u=a.length,s=0;s<u;s++){var c=a[s];o=t.concat(o,r(c,i[c]))}return o}}}}return NA(Ne)(t)}function NL(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(2===t.length)return NL(Ne).apply(void 0,t);var r=Nx(t[0]);return function(t,n){return function(i){for(var o=t,a=r(i),u=a.length,s=u-1;s>=0;s--){var c=a[s];o=n(c,i[c],o)}return o}}}var NP=function(t,n){var r;return(r={})[t]=n,r};function NF(t){var n=jl(Ne)(t);return function(t){return function(r){return n(r,t)}}}function Nz(t){var n=js(Ne)(t);return function(t){return function(r){return n(r,t)}}}function NU(t){return jc(Ne)(t)}var NW=function(t){var n=Nz(t);return function(r){return function(i){return t.map(nD(i,n(r)),jv)}}},NB=function(t){var n=Nz(t);return function(r){return function(i){return t.map(nD(i,n(r)),jb)}}};function NV(t){return function(n){var r={},i={};for(var o in n)if(nX.call(n,o)){var a=t(o,n[o]);switch(a._tag){case"Left":r[o]=a.left;break;case"Right":i[o]=a.right}}return uC(r,i)}}function N$(t){return function(n){var r={},i={};for(var o in n)if(nX.call(n,o)){var a=n[o];t(o,a)?i[o]=a:r[o]=a}return uC(r,i)}}function NK(t){return function(n){var r={};for(var i in n)if(nX.call(n,i)){var o=t(i,n[i]);nU(o)&&(r[i]=o.value)}return r}}function NY(t){return function(n){var r={},i=!1;for(var o in n)if(nX.call(n,o)){var a=n[o];t(o,a)?r[o]=a:i=!0}return i?r:n}}function Nq(t,n){var r=NG(t,n);return function(t){return r(t,nS)}}function NG(t,n){return function(r,i){return n.reduce(r,{},function(n,r){var o=i(r),a=o[0],u=o[1];return n[a]=nX.call(n,a)?t.concat(n[a],u):u,n})}}var NZ=function(t){for(var n={},r=0;r<t.length;r++){var i=t[r];n[i[0]]=i[1]}return n};function NQ(t){return function(n){for(var r in n)if(!t(n[r]))return!1;return!0}}function NH(t){return function(n){for(var r in n)if(t(n[r]))return!0;return!1}}function NJ(t){return function(n,r){if(void 0===r){var i=NJ(t);return function(t){return i(n,t)}}for(var o in r)if(t.equals(r[o],n))return!0;return!1}}var NX=function(t){return function(n){return function(r){if(Nb(r))return n;if(Nb(n))return r;var i={};for(var o in r)N_(o,n)?i[o]=t.concat(r[o],n[o]):i[o]=r[o];for(var o in n)N_(o,i)||(i[o]=n[o]);return i}}},N0=function(t){return function(n){return function(r){if(Nb(r)||Nb(n))return Nj;var i={};for(var o in r)N_(o,n)&&(i[o]=t.concat(r[o],n[o]));return i}}},N1=function(t){return function(n){if(Nb(n))return t;if(Nb(t))return n;var r={};for(var i in n)N_(i,t)||(r[i]=n[i]);for(var i in t)N_(i,n)||(r[i]=t[i]);return r}},N2=function(t,n){return nD(t,NR(n))},N4=function(t,n){return nD(t,NE(n))},N3=function(t){var n=jm(t);return function(t,r,i){return nD(t,n(r,i))}},N5=function(t){return function(n){var r=jg(t)(n);return function(t,n){return nD(t,r(n))}}},N9=function(t){var n=jy(t);return function(t,r,i){return nD(t,n(r,i))}},N8=function(t,n){return nD(t,jf(n))},N6=function(t,n){return nD(t,jd(n))},N7=function(t,n){return nD(t,jp(n))},je=function(t,n){return nD(t,jh(n))},jt=function(t){var n=ND(t);return function(t,r,i){return nD(t,n(r,i))}},jn=function(t){var n=NA(t);return function(t){var r=n(t);return function(t,n){return nD(t,r(n))}}},jr=function(t){var n=NL(t);return function(t,r,i){return nD(t,n(r,i))}},ji=function(t,n){return nD(t,NV(n))},jo=function(t,n){return nD(t,N$(n))},ja=function(t,n){return nD(t,NK(n))},ju=function(t,n){return nD(t,NY(n))},js=function(t){var n=jl(t);return function(t){var r=n(t);return function(t,n){return r(t,nC(nA,n))}}},jc=function(t){var n=js(t);return function(t){var r=n(t);return function(t){return r(t,nS)}}},jl=function(t){return function(n){var r=Nx(t);return function(t,i){var o=r(t);if(0===o.length)return n.of(Nj);for(var a=n.of({}),u=function(r){a=n.ap(n.map(a,function(t){return function(n){var i;return Object.assign({},t,((i={})[r]=n,i))}}),i(r,t[r]))},s=0;s<o.length;s++)u(o[s]);return a}}},jf=function(t){return NY(function(n,r){return t(r)})},jd=function(t){return NK(function(n,r){return t(r)})},jp=function(t){return N$(function(n,r){return t(r)})},jh=function(t){return NV(function(n,r){return t(r)})};function jm(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(1===t.length){var r=ND(t[0]);return function(t,n){return r(t,function(t,r,i){return n(r,i)})}}return jm(Ne).apply(void 0,t)}function jg(t){if("compare"in t){var n=NA(t);return function(t){var r=n(t);return function(t){return r(function(n,r){return t(r)})}}}return jg(Ne)(t)}function jy(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(1===t.length){var r=NL(t[0]);return function(t,n){return r(t,function(t,r,i){return n(r,i)})}}return jy(Ne).apply(void 0,t)}var jv=function(t){var n={};for(var r in t)if(nX.call(t,r)){var i=t[r];nU(i)&&(n[r]=i.value)}return n},jb=function(t){var n={},r={};for(var i in t)if(nX.call(t,i)){var o=t[i];nV(o)?n[i]=o.left:r[i]=o.right}return uC(n,r)},jx="ReadonlyRecord";function jM(t){return"compare"in t?function(n){return{show:function(r){var i=NT(t)(function(t,r){return"".concat(JSON.stringify(t),": ").concat(n.show(r))})(r).join(", ");return""===i?"{}":"{ ".concat(i," }")}}}:jM(Ne)(t)}function jT(t){var n=NC(t);return rM(function(t,r){return n(t)(r)&&n(r)(t)})}function jS(t){return{concat:function(n,r){if(Nb(n))return r;if(Nb(r))return n;var i=Object.assign({},n);for(var o in r)nX.call(r,o)&&(i[o]=nX.call(n,o)?t.concat(n[o],r[o]):r[o]);return i},empty:Nj}}var jw={URI:jx,map:N2},j_=rn(jw),jI=function(t){return{URI:jx,reduce:N3(t),foldMap:N5(t),reduceRight:N9(t)}},jO=function(t){return{URI:jx,reduce:N3(t),foldMap:N5(t),reduceRight:N9(t),reduceWithIndex:jt(t),foldMapWithIndex:jn(t),reduceRightWithIndex:jr(t)}},jk={URI:jx,compact:jv,separate:jb},jC=function(t){return{URI:jx,map:N2,reduce:N3(t),foldMap:N5(t),reduceRight:N9(t),traverse:js(t),sequence:jc(t)}},jN=function(t){return{URI:jx,map:N2,mapWithIndex:N4,reduce:N3(t),foldMap:N5(t),reduceRight:N9(t),reduceWithIndex:jt(t),foldMapWithIndex:jn(t),reduceRightWithIndex:jr(t),traverse:js(t),sequence:jc(t),traverseWithIndex:jl(t)}},jj=function(t){var n=jC(t);return{URI:jx,map:N2,reduce:N3(t),foldMap:N5(t),reduceRight:N9(t),traverse:n.traverse,sequence:n.sequence,compact:jv,separate:jb,filter:N8,filterMap:N6,partition:N7,partitionMap:je,wither:uB(n,jk),wilt:uW(n,jk)}},jE=function(t){var n=NX(t);return{concat:function(t,r){return n(r)(t)}}},jR=function(t){return{concat:jE(t).concat,empty:Nj}},jD=function(t){var n=N0(t);return{concat:function(t,r){return n(r)(t)}}},jA=function(){return{concat:function(t,n){return N1(n)(t)}}},jL={URI:jx,reduce:N3(Ne),foldMap:N5(Ne),reduceRight:N9(Ne)},jP={URI:jx,reduce:N3(Ne),foldMap:N5(Ne),reduceRight:N9(Ne),reduceWithIndex:jt(Ne),foldMapWithIndex:jn(Ne),reduceRightWithIndex:jr(Ne)},jF={URI:jx,map:N2,reduce:N3(Ne),foldMap:N5(Ne),reduceRight:N9(Ne),traverse:js(Ne),sequence:NU},jz={URI:jx,map:N2,mapWithIndex:N4,reduce:N3(Ne),foldMap:N5(Ne),reduceRight:N9(Ne),reduceWithIndex:jt(Ne),foldMapWithIndex:jn(Ne),reduceRightWithIndex:jr(Ne),traverse:js(Ne),sequence:NU,traverseWithIndex:jl(Ne)},jU=uB(jF,jk),jW=uW(jF,jk),jB={URI:jx,map:N2,reduce:N3(Ne),foldMap:N5(Ne),reduceRight:N9(Ne),traverse:js(Ne),sequence:NU,compact:jv,separate:jb,filter:N8,filterMap:N6,partition:N7,partitionMap:je,wither:jU,wilt:jW};function jV(t,n){return nX.call(void 0===n?this:n,t)}var j$={URI:jx,map:N2,reduce:N3(Ne),foldMap:N5(Ne),reduceRight:N9(Ne),traverse:js(Ne),sequence:NU,compact:jv,separate:jb,filter:N8,filterMap:N6,partition:N7,partitionMap:je,mapWithIndex:N4,reduceWithIndex:jt(Ne),foldMapWithIndex:jn(Ne),reduceRightWithIndex:jr(Ne),filterMapWithIndex:ja,filterWithIndex:ju,partitionMapWithIndex:ji,partitionWithIndex:jo,traverseWithIndex:jl(Ne),wither:jU,wilt:jW};let jK=Object.freeze(Object.defineProperty({__proto__:null,Compactable:jk,Filterable:{URI:jx,map:N2,compact:jv,separate:jb,filter:N8,filterMap:N6,partition:N7,partitionMap:je},FilterableWithIndex:{URI:jx,map:N2,mapWithIndex:N4,compact:jv,separate:jb,filter:N8,filterMap:N6,partition:N7,partitionMap:je,filterMapWithIndex:ja,filterWithIndex:ju,partitionMapWithIndex:ji,partitionWithIndex:jo},Foldable:jL,FoldableWithIndex:jP,Functor:jw,FunctorWithIndex:{URI:jx,map:N2,mapWithIndex:N4},Traversable:jF,TraversableWithIndex:jz,URI:jx,Witherable:jB,_filter:N8,_filterMap:N6,_filterMapWithIndex:ja,_filterWithIndex:ju,_foldMap:N5,_foldMapWithIndex:jn,_map:N2,_mapWithIndex:N4,_partition:N7,_partitionMap:je,_partitionMapWithIndex:ji,_partitionWithIndex:jo,_reduce:N3,_reduceRight:N9,_reduceRightWithIndex:jr,_reduceWithIndex:jt,_sequence:jc,_traverse:js,collect:NT,compact:jv,deleteAt:NI,difference:N1,elem:NJ,empty:Nj,every:NQ,filter:jf,filterMap:jd,filterMapWithIndex:NK,filterWithIndex:NY,flap:j_,foldMap:jg,foldMapWithIndex:NA,fromEntries:NZ,fromFoldable:Nq,fromFoldableMap:NG,fromRecord:Ng,getDifferenceMagma:jA,getEq:jT,getFoldable:jI,getFoldableWithIndex:jO,getIntersectionSemigroup:jD,getMonoid:jS,getShow:jM,getTraversable:jC,getTraversableWithIndex:jN,getUnionMonoid:jR,getUnionSemigroup:jE,getWitherable:jj,has:N_,hasOwnProperty:jV,insertAt:Nw,intersection:N0,isEmpty:Nb,isSubrecord:NC,keys:NM,lookup:NN,map:NR,mapWithIndex:NE,modifyAt:Nk,partition:jp,partitionMap:jh,partitionMapWithIndex:NV,partitionWithIndex:N$,pop:function(t){var n=NI(t);return function(r){var i=NN(t,r);return nz(i)?nW:nB([i.value,n(r)])}},readonlyRecord:j$,reduce:jm,reduceRight:jy,reduceRightWithIndex:NL,reduceWithIndex:ND,separate:jb,sequence:NU,singleton:NP,size:Nv,some:NH,toEntries:NS,toReadonlyArray:NS,toRecord:Ny,toUnfoldable:function(t){return function(n){var r=NS(n),i=r.length;return t.unfold(0,function(t){return t<i?nB([r[t],t+1]):nW})}},traverse:Nz,traverseWithIndex:NF,union:NX,updateAt:NO,upsertAt:Nw,wilt:NB,wither:NW},Symbol.toStringTag,{value:"Module"}));var jY=function(t){return new Set(t)},jq=function(t){return new Set([t])},jG=function(t){return function(n){for(var r=n.length,i=new Set,o=Er(t),a=0;a<r;a++){var u=n[a];o(u,i)||i.add(u)}return i}};function jZ(t){return function(n){for(var r,i=n.values(),o=new Set;!(r=i.next()).done;){var a=r.value;t(a)&&o.add(a)}return o}}function jQ(t){var n=Er(t);return function(r,i){if(void 0===i){var o=jQ(t);return function(t){return o(r,t)}}if(j6(r))return i;if(j6(i))return r;var a=new Set(r);return i.forEach(function(t){n(t,a)||a.add(t)}),a}}function jH(t){var n=Er(t);return function(r,i){if(void 0===i){var o=jH(t);return function(t){return o(t,r)}}if(j6(r)||j6(i))return j8;var a=new Set;return r.forEach(function(t){n(t,i)&&a.add(t)}),a}}function jJ(t){var n=Er(t);return function(r,i){if(void 0===i){var o=jJ(t);return function(t){return o(t,r)}}return jZ(function(t){return!n(t,i)})(r)}}function jX(t){var n=Ei(t);return function(t,r){return function(i){return n(i).reduce(r,t)}}}function j0(t,n){var r=Ei(t);return function(t){return function(i){return r(i).reduce(function(r,i){return n.concat(r,t(i))},n.empty)}}}var j1=function(t){var n=Ei(t);return function(t,r){return function(i){return n(i).reduceRight(function(t,n){return r(n,t)},t)}}};function j2(t){var n=Er(t);return function(t){return function(r){if(n(t)(r))return r;var i=new Set(r);return i.add(t),i}}}var j4=function(t){return function(n){return function(r){return jZ(function(r){return!t.equals(n,r)})(r)}}},j3=function(t){var n=Er(t),r=j4(t),i=j2(t);return function(t){return function(o){return(n(t,o)?r:i)(t)(o)}}},j5=function(t){return j9(t)(nS)};function j9(t){var n=Er(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){var o=t(r);"Some"!==o._tag||n(o.value,i)||i.add(o.value)}),i}}}var j8=new Set,j6=function(t){return 0===t.size},j7=function(t){return t.size},Ee=function(t){return function(n){for(var r,i=n.values(),o=!1;!o&&!(r=i.next()).done;)o=t(r.value);return o}};function Et(t){return dQ(Ee(dQ(t)))}function En(t){var n=Er(t);return function(r,i){if(void 0===i){var o=En(t);return function(t){return o(t,r)}}return Et(function(t){return n(t,i)})(r)}}function Er(t){return function(n,r){if(void 0===r){var i=Er(t);return function(t){return i(n,t)}}for(var o,a=r.values(),u=!1;!u&&!(o=a.next()).done;)u=t.equals(n,o.value);return u}}var Ei=function(t){return function(n){var r=[];return n.forEach(function(t){return r.push(t)}),r.sort(t.compare)}};function Eo(t){return{show:function(n){var r=[];return n.forEach(function(n){r.push(t.show(n))}),"new Set([".concat(r.sort().join(", "),"])")}}}function Ea(t){var n=En(t);return rM(function(t,r){return n(t,r)&&n(r,t)})}var Eu=function(t){return{concat:jQ(t)}},Es=function(t){return{concat:Eu(t).concat,empty:j8}},Ec=function(t){return{concat:jH(t)}},El=function(t){return{concat:jJ(t)}};let Ef=Object.freeze(Object.defineProperty({__proto__:null,URI:"ReadonlySet",chain:function(t){var n=Er(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){t(r).forEach(function(t){n(t,i)||i.add(t)})}),i}}},compact:j5,difference:jJ,elem:Er,empty:j8,every:Et,filter:jZ,filterMap:j9,foldMap:j0,fromArray:jG,fromReadonlyArray:jG,fromSet:jY,getDifferenceMagma:El,getEq:Ea,getIntersectionSemigroup:Ec,getShow:Eo,getUnionMonoid:Es,getUnionSemigroup:Eu,insert:j2,intersection:jH,isEmpty:j6,isSubset:En,map:function(t){var n=Er(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){var o=t(r);n(o,i)||i.add(o)}),i}}},partition:function(t){return function(n){for(var r,i=n.values(),o=new Set,a=new Set;!(r=i.next()).done;){var u=r.value;t(u)?o.add(u):a.add(u)}return uC(a,o)}},partitionMap:function(t,n){return function(r){return function(i){for(var o,a=i.values(),u=new Set,s=new Set,c=Er(t),l=Er(n);!(o=a.next()).done;){var f=r(o.value);switch(f._tag){case"Left":c(f.left,u)||u.add(f.left);break;case"Right":l(f.right,s)||s.add(f.right)}}return uC(u,s)}}},reduce:jX,reduceRight:j1,remove:j4,separate:function(t,n){return function(r){var i=Er(t),o=Er(n),a=new Set,u=new Set;return r.forEach(function(t){switch(t._tag){case"Left":i(t.left,a)||a.add(t.left);break;case"Right":o(t.right,u)||u.add(t.right)}}),uC(a,u)}},singleton:jq,size:j7,some:Ee,toReadonlyArray:Ei,toSet:function(t){return new Set(t)},toggle:j3,union:jQ},Symbol.toStringTag,{value:"Module"}));function Ed(t){return t[0]}function Ep(t){return t[1]}var Eh=function(t){var n;return[Ep(t),t[0]]};function Em(t){return{URI:EF,_E:void 0,map:Eb,ap:function(n,r){var i,o;return[(0,n[0])(r[0]),t.concat(Ep(n),Ep(r))]}}}var Eg=function(t){return function(n){return[n,t.empty]}};function Ey(t){var n=Em(t);return{URI:EF,_E:void 0,map:n.map,ap:n.ap,chain:function(n,r){var i,o=r(n[0]),a=o[0],u=o[1];return[a,t.concat(Ep(n),u)]}}}var Ev=function(t,n){return nD(t,EN(n))},Eb=function(t,n){return nD(t,Ek(n))},Ex=function(t,n,r){return nD(t,EO(n,r))},EM=function(t,n){return nD(t,EC(n))},ET=function(t,n){return nD(t,Ej(n))},ES=function(t,n,r){return nD(t,ER(n,r))},Ew=function(t){var n=ED();return function(t,r){return nD(t,n(r))}},E_=function(t,n,r){return nD(t,EA(n,r))},EI=function(t){var n=EL(t);return function(t,r){return nD(t,n(r))}},EO=function(t,n){return function(r){var i;return[n(r[0]),t(Ep(r))]}},Ek=function(t){return function(n){var r;return[t(n[0]),Ep(n)]}},EC=function(t){return function(n){var r;return[n[0],t(Ep(n))]}},EN=function(t){return function(n){var r;return[n[0],Ep(t)]}},Ej=function(t){return function(n){return[t(n),Ep(n)]}},EE=Ej(nS),ER=function(t,n){return function(r){var i;return n(t,r[0])}},ED=function(){return function(t){return function(n){var r;return t(n[0])}}},EA=function(t,n){return function(r){var i;return n(r[0],t)}},EL=function(t){return function(n){return function(r){var i;return t.map(n(r[0]),function(t){return[t,Ep(r)]})}}},EP=function(t){return function(n){var r;return t.map(n[0],function(t){return[t,Ep(n)]})}},EF="ReadonlyTuple",Ez={URI:EF,map:Eb},EU=rn(Ez);let EW=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:EF,bimap:Ex,mapLeft:EM},Comonad:{URI:EF,map:Eb,extend:ET,extract:Ed},Foldable:{URI:EF,reduce:ES,foldMap:Ew,reduceRight:E_},Functor:Ez,Semigroupoid:{URI:EF,compose:Ev},Traversable:{URI:EF,map:Eb,reduce:ES,foldMap:Ew,reduceRight:E_,traverse:EI,sequence:EP},URI:EF,bimap:EO,compose:EN,duplicate:EE,extend:Ej,extract:Ed,flap:EU,foldMap:ED,fst:Ed,getApplicative:function(t){var n=Em(t);return{URI:EF,_E:void 0,map:n.map,ap:n.ap,of:Eg(t)}},getApply:Em,getChain:Ey,getChainRec:function(t){var n=function(n,r){for(var i,o,a=r(n),u=t.empty,s=(i=a)[0];"Left"===s._tag;)u=t.concat(u,Ep(a)),s=(a=r(s.left))[0];return[s.right,t.concat(u,Ep(a))]},r=Ey(t);return{URI:EF,_E:void 0,map:r.map,ap:r.ap,chain:r.chain,chainRec:n}},getMonad:function(t){var n=Ey(t);return{URI:EF,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,of:Eg(t)}},map:Ek,mapFst:Ek,mapLeft:EC,mapSnd:EC,readonlyTuple:{URI:EF,compose:Ev,map:Eb,bimap:Ex,mapLeft:EM,extract:Ed,extend:ET,reduce:ES,foldMap:Ew,reduceRight:E_,traverse:EI,sequence:EP},reduce:ER,reduceRight:EA,sequence:EP,snd:Ep,swap:Eh,traverse:EL},Symbol.toStringTag,{value:"Module"}));var EB=globalThis&&globalThis.__assign||function(){return(EB=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},EV=function(t){return function(n){return Object.keys(n).sort(t.compare)}},E$=EV(Ne);function EK(t){if("function"==typeof t)return EK(Ne)(t);var n=EV(t);return function(t){return function(r){for(var i=[],o=0,a=n(r);o<a.length;o++){var u=a[o];i.push(t(u,r[u]))}return i}}}var EY=EK(Ne)(function(t,n){return[t,n]});function Eq(t){return function(n){if(!nX.call(n,t))return n;var r=Object.assign({},n);return delete r[t],r}}var EG=function(t,n){return EZ(t,function(){return n})},EZ=function(t,n){return function(r){if(!N_(t,r))return nW;var i=Object.assign({},r);return i[t]=n(r[t]),nB(i)}};function EQ(t){return NF(t)}function EH(t){return Nz(t)}function EJ(t){return NU(t)}var EX=function(t){var n,r=Nz(t);return function(n){return function(i){return t.map(nD(i,r(n)),Re)}}},E0=function(t){var n,r=Nz(t);return function(n){return function(i){return t.map(nD(i,r(n)),Rt)}}};function E1(t){return N$(t)}function E2(t){return NY(t)}function E4(t,n){return Nq(t,n)}var E3=function(t){var n,r;return(n=ir(),Nq(n,f9))(t)};function E5(t,n){return NG(t,n)}var E9=function(t){var n=NX(t);return function(t){return function(r){return Nb(r)?EB({},t):Nb(t)?EB({},r):n(t)(r)}}},E8=function(t){return function(n){return function(r){return Nb(r)||Nb(n)?{}:N0(t)(n)(r)}}},E6=function(t){return function(n){return Nb(n)?EB({},t):Nb(t)?EB({},n):N1(t)(n)}},E7=function(t){return function(n){var r=EV(t);return function(t,i){var o=r(t);if(0===o.length)return n.of({});for(var a=n.of({}),u=function(r){a=n.ap(n.map(a,function(t){return function(n){return t[r]=n,t}}),i(r,t[r]))},s=0;s<o.length;s++)u(o[s]);return a}}},Re=jv,Rt=jb,Rn="Record",Rr={URI:Rn,map:N2},Ri=rn(Rr),Ro=function(t){return{URI:Rn,reduce:N3(t),foldMap:N5(t),reduceRight:N9(t)}},Ra=function(t){return{URI:Rn,reduce:N3(t),foldMap:N5(t),reduceRight:N9(t),reduceWithIndex:jt(t),foldMapWithIndex:jn(t),reduceRightWithIndex:jr(t)}},Ru={URI:Rn,compact:Re,separate:Rt},Rs=function(t){return{URI:Rn,map:N2,reduce:N3(t),foldMap:N5(t),reduceRight:N9(t),traverse:js(t),sequence:jc(t)}},Rc=function(t){return{URI:Rn,map:N2,mapWithIndex:N4,reduce:N3(t),foldMap:N5(t),reduceRight:N9(t),reduceWithIndex:jt(t),foldMapWithIndex:jn(t),reduceRightWithIndex:jr(t),traverse:js(t),sequence:jc(t),traverseWithIndex:E7(t)}},Rl=function(t){var n=Rs(t);return{URI:Rn,map:N2,reduce:N3(t),foldMap:N5(t),reduceRight:N9(t),traverse:n.traverse,sequence:n.sequence,compact:Re,separate:Rt,filter:N8,filterMap:N6,partition:N7,partitionMap:je,wither:uB(n,Ru),wilt:uW(n,Ru)}},Rf=function(t){var n=E9(t);return{concat:function(t,r){return n(r)(t)}}},Rd=function(t){return{concat:Rf(t).concat,empty:{}}},Rp=function(t){var n=E8(t);return{concat:function(t,r){return n(r)(t)}}},Rh=function(){return{concat:function(t,n){return E6(n)(t)}}},Rm={URI:Rn,reduce:N3(Ne),foldMap:N5(Ne),reduceRight:N9(Ne)},Rg={URI:Rn,reduce:N3(Ne),foldMap:N5(Ne),reduceRight:N9(Ne),reduceWithIndex:jt(Ne),foldMapWithIndex:jn(Ne),reduceRightWithIndex:jr(Ne)},Ry={URI:Rn,map:N2,reduce:N3(Ne),foldMap:N5(Ne),reduceRight:N9(Ne),traverse:js(Ne),sequence:EJ},Rv={URI:Rn,map:N2,mapWithIndex:N4,reduce:N3(Ne),foldMap:N5(Ne),reduceRight:N9(Ne),reduceWithIndex:jt(Ne),foldMapWithIndex:jn(Ne),reduceRightWithIndex:jr(Ne),traverse:js(Ne),sequence:EJ,traverseWithIndex:E7(Ne)},Rb=uB(Ry,Ru),Rx=uW(Ry,Ru),RM={URI:Rn,map:N2,reduce:N3(Ne),foldMap:N5(Ne),reduceRight:N9(Ne),traverse:js(Ne),sequence:EJ,compact:Re,separate:Rt,filter:N8,filterMap:N6,partition:N7,partitionMap:je,wither:Rb,wilt:Rx},RT={URI:Rn,map:N2,reduce:N3(Ne),foldMap:N5(Ne),reduceRight:N9(Ne),traverse:js(Ne),sequence:EJ,compact:Re,separate:Rt,filter:N8,filterMap:N6,partition:N7,partitionMap:je,mapWithIndex:N4,reduceWithIndex:jt(Ne),foldMapWithIndex:jn(Ne),reduceRightWithIndex:jr(Ne),filterMapWithIndex:ja,filterWithIndex:ju,partitionMapWithIndex:ji,partitionWithIndex:jo,traverseWithIndex:E7(Ne),wither:Rb,wilt:Rx};let RS=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Ru,Filterable:{URI:Rn,map:N2,compact:Re,separate:Rt,filter:N8,filterMap:N6,partition:N7,partitionMap:je},FilterableWithIndex:{URI:Rn,map:N2,mapWithIndex:N4,compact:Re,separate:Rt,filter:N8,filterMap:N6,partition:N7,partitionMap:je,filterMapWithIndex:ja,filterWithIndex:ju,partitionMapWithIndex:ji,partitionWithIndex:jo},Foldable:Rm,FoldableWithIndex:Rg,Functor:Rr,FunctorWithIndex:{URI:Rn,map:N2,mapWithIndex:N4},Traversable:Ry,TraversableWithIndex:Rv,URI:Rn,Witherable:RM,collect:EK,compact:Re,deleteAt:Eq,difference:E6,elem:NJ,empty:{},every:NQ,filter:jf,filterMap:jd,filterMapWithIndex:NK,filterWithIndex:E2,flap:Ri,foldMap:function(t){return"compare"in t?jg(t):jg(Ne)(t)},foldMapWithIndex:function(t){return"compare"in t?NA(t):NA(Ne)(t)},fromEntries:E3,fromFoldable:E4,fromFoldableMap:E5,getDifferenceMagma:Rh,getEq:jT,getFoldable:Ro,getFoldableWithIndex:Ra,getIntersectionSemigroup:Rp,getMonoid:jS,getShow:function(t){return"compare"in t?jM(t):jM(Ne)(t)},getTraversable:Rs,getTraversableWithIndex:Rc,getUnionMonoid:Rd,getUnionSemigroup:Rf,getWitherable:Rl,has:N_,hasOwnProperty:jV,insertAt:Nw,intersection:E8,isEmpty:Nb,isSubrecord:NC,keys:E$,lookup:NN,map:NR,mapWithIndex:NE,modifyAt:EZ,partition:jp,partitionMap:jh,partitionMapWithIndex:NV,partitionWithIndex:E1,pop:function(t){var n=Eq(t);return function(r){var i=NN(t,r);return nz(i)?nW:nB([i.value,n(r)])}},record:RT,reduce:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?jm(t[0]):jm(Ne).apply(void 0,t)},reduceRight:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?jy(t[0]):jy(Ne).apply(void 0,t)},reduceRightWithIndex:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?NL(t[0]):NL(Ne).apply(void 0,t)},reduceWithIndex:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?ND(t[0]):ND(Ne).apply(void 0,t)},separate:Rt,sequence:EJ,singleton:NP,size:Nv,some:NH,toArray:EY,toEntries:EY,toUnfoldable:function(t){return function(n){var r=EY(n),i=r.length;return t.unfold(0,function(t){return t<i?nB([r[t],t+1]):nW})}},traverse:EH,traverseWithIndex:EQ,union:E9,updateAt:EG,upsertAt:Nw,wilt:E0,wither:EX},Symbol.toStringTag,{value:"Module"}));var Rw=function(t){return function(n){return nU(t(n))}},R_=function(t){return function(n){return n$(t(n))}},RI=function(){return function(t){return!0}},RO=function(t){return function(n){return!t(n)}},Rk=function(t){return function(n){return function(r){return n(r)||t(r)}}},RC=function(t){return function(n){return function(r){return n(r)&&t(r)}}},RN=function(){return function(t){return!1}},Rj=function(t){return function(n){return function(r){return n(r)&&t(r)}}};let RE=Object.freeze(Object.defineProperty({__proto__:null,and:RC,compose:Rj,fromEitherK:R_,fromOptionK:Rw,id:RI,not:RO,or:Rk,zero:RN},Symbol.toStringTag,{value:"Module"}));var RR=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{add:function(n,r){return t.map(function(t,i){return t.add(n[i],r[i])})},zero:t.map(function(t){return t.zero}),mul:function(n,r){return t.map(function(t,i){return t.mul(n[i],r[i])})},one:t.map(function(t){return t.one}),sub:function(n,r){return t.map(function(t,i){return t.sub(n[i],r[i])})}}},RD=function(t){return function(n){return t.sub(t.zero,n)}};let RA=Object.freeze(Object.defineProperty({__proto__:null,getFunctionRing:nM,getTupleRing:RR,negate:RD,tuple:RR},Symbol.toStringTag,{value:"Module"})),RL=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),RP=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:nx},Symbol.toStringTag,{value:"Module"}));function RF(t){return function(n){for(var r,i=n.values(),o=new Set;!(r=i.next()).done;){var a=r.value;t(a)&&o.add(a)}return o}}function Rz(t){var n=R2(t);return function(r,i){if(void 0===i){var o=Rz(t);return function(t){return o(r,t)}}if(R0(r))return i;if(R0(i))return r;var a=new Set(r);return i.forEach(function(t){n(t,a)||a.add(t)}),a}}function RU(t){var n=R2(t);return function(r,i){if(void 0===i){var o=RU(t);return function(t){return o(t,r)}}if(R0(r)||R0(i))return new Set;var a=new Set;return r.forEach(function(t){n(t,i)&&a.add(t)}),a}}function RW(t){var n=R2(t);return function(r,i){if(void 0===i){var o=RW(t);return function(t){return o(t,r)}}return RF(function(t){return!n(t,i)})(r)}}var RB=function(t){return{concat:Rz(t)}},RV=function(t){return{concat:RB(t).concat,empty:new Set}},R$=function(t){return{concat:RU(t)}},RK=function(t){return{concat:RW(t)}},RY=function(t){return new Set([t])};function Rq(t){var n=R2(t);return function(t){return function(r){if(n(t)(r))return r;var i=new Set(r);return i.add(t),i}}}var RG=function(t){return function(n){return function(r){return RF(function(r){return!t.equals(n,r)})(r)}}},RZ=function(t){var n=R2(t),r=RG(t),i=Rq(t);return function(t){return function(o){return(n(t,o)?r:i)(t)(o)}}},RQ=function(t){return function(n){for(var r=n.length,i=new Set,o=R2(t),a=0;a<r;a++){var u=n[a];o(u,i)||i.add(u)}return i}},RH=function(t){return RJ(t)(nS)};function RJ(t){var n=R2(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){var o=t(r);"Some"!==o._tag||n(o.value,i)||i.add(o.value)}),i}}}var RX=new Set,R0=function(t){return 0===t.size},R1=function(t){return t.size},R2=Er,R4=function(t){return function(n){var r=[];return n.forEach(function(t){return r.push(t)}),r.sort(t.compare)}};let R3=Object.freeze(Object.defineProperty({__proto__:null,chain:function(t){var n=R2(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){t(r).forEach(function(t){n(t,i)||i.add(t)})}),i}}},compact:RH,difference:RW,elem:R2,empty:RX,every:Et,filter:RF,filterMap:RJ,foldMap:j0,fromArray:RQ,getDifferenceMagma:RK,getEq:Ea,getIntersectionSemigroup:R$,getShow:Eo,getUnionMonoid:RV,getUnionSemigroup:RB,insert:Rq,intersection:RU,isEmpty:R0,isSubset:En,map:function(t){var n=R2(t);return function(t){return function(r){var i=new Set;return r.forEach(function(r){var o=t(r);n(o,i)||i.add(o)}),i}}},partition:function(t){return function(n){for(var r,i=n.values(),o=new Set,a=new Set;!(r=i.next()).done;){var u=r.value;t(u)?o.add(u):a.add(u)}return uC(a,o)}},partitionMap:function(t,n){return function(r){return function(i){for(var o,a=i.values(),u=new Set,s=new Set,c=R2(t),l=R2(n);!(o=a.next()).done;){var f=r(o.value);switch(f._tag){case"Left":c(f.left,u)||u.add(f.left);break;case"Right":l(f.right,s)||s.add(f.right)}}return uC(u,s)}}},reduce:jX,reduceRight:j1,remove:RG,separate:function(t,n){return function(r){var i=R2(t),o=R2(n),a=new Set,u=new Set;return r.forEach(function(t){switch(t._tag){case"Left":i(t.left,a)||a.add(t.left);break;case"Right":o(t.right,u)||u.add(t.right)}}),uC(a,u)}},singleton:RY,size:R1,some:Ee,subset:En,toArray:R4,toggle:RZ,union:Rz},Symbol.toStringTag,{value:"Module"}));var R5=function(t){return{show:function(n){var r="{";for(var i in t)nX.call(t,i)&&(r+=" ".concat(i,": ").concat(t[i].show(n[i]),","));return r.length>1&&(r=r.slice(0,-1)+" "),r+="}"}}},R9=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{show:function(n){return"[".concat(n.map(function(n,r){return t[r].show(n)}).join(", "),"]")}}};let R8=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:R5,getTupleShow:R9,showBoolean:{show:function(t){return JSON.stringify(t)}},showNumber:{show:function(t){return JSON.stringify(t)}},showString:{show:function(t){return JSON.stringify(t)}},struct:R5,tuple:R9},Symbol.toStringTag,{value:"Module"}));function R6(t){return function(n){return function(r){return t.of([n,r])}}}function R7(t){return function(n){return function(r){return function(i){return t.map(r(i),function(t){var r=t[0],i=t[1];return[n(r),i]})}}}}function De(t){return function(n){return function(r){return function(i){return t.chain(r(i),function(r){var i=r[0],o=r[1];return t.map(n(o),function(t){var n=t[0],r=t[1];return[i(n),r]})})}}}}function Dt(t){return function(n){return function(r){return function(i){return t.chain(r(i),function(t){var r=t[0],i=t[1];return n(r)(i)})}}}}function Dn(t){return function(n){return function(r){return t.of(n(r))}}}function Dr(t){return function(n){return function(r){return t.map(n,function(t){return[t,r]})}}}function Di(t){return function(n){return function(r){return t.map(r(n),function(t){return t[0]})}}}function Do(t){return function(n){return function(r){return t.map(r(n),Ep)}}}let Da=Object.freeze(Object.defineProperty({__proto__:null,ap:De,chain:Dt,evaluate:Di,execute:Do,fromF:Dr,fromState:Dn,getStateM:function(t){var n=De(t),r=R7(t),i=Dt(t),o=Di(t),a=Do(t);return{map:function(t,n){return nD(t,r(n))},ap:function(t,r){return nD(t,n(r))},of:R6(t),chain:function(t,n){return nD(t,i(n))},get:function(){return function(n){return t.of([n,n])}},put:function(n){return function(){return t.of([void 0,n])}},modify:function(n){return function(r){return t.of([void 0,n(r)])}},gets:function(n){return function(r){return t.of([n(r),r])}},fromState:Dn(t),fromM:Dr(t),evalState:function(t,n){return nD(t,o(n))},execState:function(t,n){return nD(t,a(n))}}},map:R7,of:R6},Symbol.toStringTag,{value:"Module"}));var Du=function(t){return function(){return kv(t)}},Ds=R6(Ca);function Dc(t){return Db(kx(t))}function Dl(t){return Db(kT(t))}function Df(t){return Db(kI(t))}var Dd=function(t){return nC(t,kb)},Dp=function(t){return function(n){return kv(t(n)[0])}},Dh=mO(function(t){return Du(t)},Ds),Dm=Dn(Ca),Dg=function(t){return Db(nw(t))},Dy=function(t){return Db(kk(t))},Dv=function(t){return Db(kC(t))},Db=Dr(Ci),Dx=function(t){return function(n){return nC(n,gG(t))}},DM=function(t){return function(n){return function(r){return t(r)(n)(r)}}},DT=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Dy(t.apply(void 0,n))}},DS=function(t){return function(n){return nD(n,Dz(DT(t)))}},Dw=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Dg(t.apply(void 0,n))}},D_=function(t){return function(n){return nD(n,Dz(Dw(t)))}},DI=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Db(t.apply(void 0,n))}},DO=function(t){return function(n){return nD(n,Dz(DI(t)))}},Dk=function(t,n){return nD(t,DD(n))},DC=function(t,n){return nD(t,DP(n))},DN=function(t,n){return nD(t,DF(n))},Dj=function(t,n){return function(r){return nD(t(r),k7(function(){return n()(r)}))}},DE=function(t,n,r){return function(i){return nD(t(i),k4(n,function(t){var n=t[0],i=t[1];return[r(n),i]}))}},DR=function(t,n){return function(r){return nD(t(r),k3(n))}},DD=R7(Ci),DA=function(t,n){return function(r){return DE(r,t,n)}},DL=function(t){return function(n){return DR(n,t)}},DP=De(Cd),DF=Dt(Cd),Dz=DF,DU=Dz(nS),DW=function(t){return function(n){return function(r){return nD(n(r),k7(function(){return t()(r)}))}}},DB="StateReaderTaskEither",DV={URI:DB,map:Dk},D$=rn(DV),DK={URI:DB,map:Dk,ap:DC},DY=n2(DK),Dq=n4(DK),DG={URI:DB,map:Dk,ap:DC,chain:DN},DZ={URI:DB,fromState:Dm},DQ=vn(DZ),DH=vr(DZ),DJ=vi(DZ),DX=vo(DZ),D0=va(DZ),D1=vu(DZ,DG),D2=rc(DG),D4={URI:DB,fromReader:Dl},D3=yO(D4),D5=yk(D4),D9=yC(D4),D8=yN(D4,DG),D6=yj(D4,DG),D7={URI:DB,fromEither:Dh},Ae=rd(D7),At=rh(D7),An=rm(D7,DG),Ar=ry(D7,DG),Ai=rv(D7,DG),Ao=rp(D7),Aa=rb(D7,DG),Au=rg(D7),As={URI:DB,fromIO:Df},Ac=gV(As),Al=g$(As,DG),Af=gK(As,DG),Ad={URI:DB,fromIO:Df,fromTask:Dc},Ap=vc(Ad),Ah=vl(Ad,DG),Am=vf(Ad,DG),Ag=Di(Ci),Ay=Do(Ci),Av=rr(DV),Ab=rl(DG),Ax=n3(DK),AM=function(t){return function(n){return function(r){return function(i){return function(){return nQ(n).reduce(function(n,r,o){return n.then(function(a){return nV(a)?n:t(o+1,r)(a.right[1])(i)().then(function(t){if(nV(t))return t;var n=t.right,r=n[0],i=n[1];return a.right[0].push(r),a.right[1]=i,a})})},t(0,nZ(n))(r)(i)().then(mt(function(t){var n;return[[t[0]],t[1]]})))}}}}},AT=function(t){var n=AM(t);return function(t){return nG(t)?n(t):Ds(nH)}},AS=function(t){return AT(function(n,r){return t(r)})},Aw=AS(nS),A_=function(t,n){return nD(t(n),k2(function(t){return t[0]}))},AI=function(t,n){return nD(t(n),k2(function(t){return t[0],t[1]}))};let AO=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:DB,map:Dk,alt:Dj},Applicative:{URI:DB,map:Dk,ap:DC,of:Ds},Apply:DK,Bifunctor:{URI:DB,bimap:DE,mapLeft:DR},Chain:DG,FromEither:D7,FromIO:As,FromReader:D4,FromState:DZ,FromTask:Ad,Functor:DV,Monad:{URI:DB,map:Dk,ap:DC,of:Ds,chain:DN},MonadIO:{URI:DB,map:Dk,ap:DC,of:Ds,chain:DN,fromIO:Df},MonadTask:{URI:DB,map:Dk,ap:DC,of:Ds,chain:DN,fromIO:Df,fromTask:Dc},MonadThrow:{URI:DB,map:Dk,ap:DC,of:Ds,chain:DN,throwError:Du},Pointed:{URI:DB,of:Ds},URI:DB,alt:DW,altW:DW,ap:DP,apFirst:DY,apFirstW:DY,apS:Ax,apSW:Ax,apSecond:Dq,apSecondW:Dq,apW:DP,ask:D3,asks:D5,asksStateReaderTaskEither:DM,asksStateReaderTaskEitherW:DM,bimap:DA,bind:Ab,bindTo:Av,bindW:Ab,chain:DF,chainEitherK:Ar,chainEitherKW:Ar,chainFirst:D2,chainFirstEitherK:Ai,chainFirstEitherKW:Ai,chainFirstIOK:Af,chainFirstReaderK:D6,chainFirstReaderKW:D6,chainFirstTaskK:Am,chainFirstW:D2,chainIOEitherK:DS,chainIOEitherKW:DS,chainIOK:Al,chainOptionK:An,chainReaderK:D8,chainReaderKW:D8,chainReaderTaskEitherK:DO,chainReaderTaskEitherKW:DO,chainStateK:D1,chainTaskEitherK:D_,chainTaskEitherKW:D_,chainTaskK:Ah,chainW:Dz,evalState:A_,evaluate:Ag,execState:AI,execute:Ay,filterOrElse:Aa,filterOrElseW:Aa,flap:D$,flatten:DU,flattenW:DU,fromEither:Dh,fromEitherK:Au,fromIO:Df,fromIOEither:Dy,fromIOEitherK:DT,fromIOK:Ac,fromOption:Ae,fromOptionK:At,fromPredicate:Ao,fromReader:Dl,fromReaderEither:Dv,fromReaderK:D9,fromReaderTaskEither:Db,fromReaderTaskEitherK:DI,fromState:Dm,fromStateK:D0,fromTask:Dc,fromTaskEither:Dg,fromTaskEitherK:Dw,fromTaskK:Ap,get:DQ,gets:DX,left:Du,leftIO:function(t){return Db(kO(t))},leftReader:function(t){return Db(kS(t))},leftState:Dp,leftTask:function(t){return Db(kM(t))},local:Dx,map:DD,mapLeft:DL,modify:DJ,of:Ds,put:DH,right:Ds,rightIO:Df,rightReader:Dl,rightState:Dd,rightTask:Dc,run:function(t,n,r){return t(n)(r)()},sequenceArray:Aw,stateReaderTaskEither:{URI:DB,map:Dk,of:Ds,ap:DC,chain:DN,bimap:DE,mapLeft:DR,alt:Dj,fromIO:Df,fromTask:Dc,throwError:Du},stateReaderTaskEitherSeq:{URI:DB,map:Dk,of:Ds,ap:DC,chain:DN,bimap:DE,mapLeft:DR,alt:Dj,fromIO:Df,fromTask:Dc,throwError:Du},throwError:Du,traverseArray:AS,traverseArrayWithIndex:AT,traverseReadonlyArrayWithIndex:AT,traverseReadonlyNonEmptyArrayWithIndex:AM},Symbol.toStringTag,{value:"Module"}));var Ak=function(t,n){return nD(t,AR(n))},AC=function(t,n){return nD(t,AN(n))},AN=function(t){return function(n){return{peek:function(r){return t({peek:n.peek,pos:r})},pos:n.pos}}},Aj=function(t){return t.peek(t.pos)},AE=AN(nS),AR=function(t){return function(n){return{peek:function(r){return t(n.peek(r))},pos:n.pos}}},AD="Store",AA={URI:AD,map:Ak},AL=rn(AA),AP={URI:AD,map:Ak,extend:AC,extract:Aj};let AF=Object.freeze(Object.defineProperty({__proto__:null,Comonad:AP,Functor:AA,URI:AD,duplicate:AE,experiment:function(t){return function(n){return function(r){return t.map(n(r.pos),function(t){return r.peek(t)})}}},extend:AN,extract:Aj,flap:AL,map:AR,peeks:function(t){return function(n){return n.peek(t(n.pos))}},seek:function(t){return function(n){return{peek:n.peek,pos:t}}},seeks:function(t){return function(n){return{peek:n.peek,pos:t(n.pos)}}},store:AP},Symbol.toStringTag,{value:"Module"}));function Az(t,n){return function(r,i){return n.compose(t.second(i),t.first(r))}}function AU(t,n){var r=Az(t,n);return function(i,o){return n.compose(r(i,o),t.promap(n.id(),nS,function(t){return[t,t]}))}}let AW=Object.freeze(Object.defineProperty({__proto__:null,fanOut:AU,fanout:function(t){return AU(t,t)},split:Az,splitStrong:function(t){return Az(t,t)}},Symbol.toStringTag,{value:"Module"}));var AB=function(){return{concat:function(t,n){return Object.assign({},t,n)}}},AV=function(t){return function(n){var r={};for(var i in n)nX.call(n,i)&&(r[i]=t[i](n[i]));return r}};let A$=Object.freeze(Object.defineProperty({__proto__:null,evolve:AV,getAssignSemigroup:AB},Symbol.toStringTag,{value:"Module"}));var AK=globalThis&&globalThis.__awaiter||function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{c(i.next(t))}catch(n){a(n)}}function s(t){try{c(i.throw(t))}catch(n){a(n)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}c((i=i.apply(t,n||[])).next())})},AY=globalThis&&globalThis.__generator||function(t,n){var r,i,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw TypeError("Generator is already executing.");for(;u;)try{if(r=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,i=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=n.call(t,u)}catch(s){a=[6,s],i=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},Aq=xj(_R),AG=xz(_R),AZ=xU(_R),AQ=function(t){return AH(_x(t))},AH=xR(_j),AJ=__(d2),AX=xW(_j),A0=xB(_U),A1=xV(_W),A2=xD(_R),A4=function(t){return function(){return AK(void 0,void 0,void 0,function(){return AY(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t().then(nB)];case 1:return[2,n.sent()];case 2:return n.sent(),[2,nW];case 3:return[2]}})})}},A3=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return A4(function(){return t.apply(void 0,n)})}},A5=xA(_R),A9=xL(_W),A8=xP(_R),A6=xF(_W),A7=x$(_j),Le=xK(_D),Lt=xY(_W),Ln=Lt(nS),Lr=xq(_W),Li=xE(_R),Lo=Li(),La=hy(_j,pj),Lu=hv(_j,pj,pd),Ls=gO(_j,pL),Lc=gk(_j,pL),Ll=gC(_j,pL),Lf=gN(_j,pL),Ld=function(t,n){return nD(t,A7(n))},Lp=function(t,n){return nD(t,Le(n))},Lh=function(t,n){return nD(t,Lt(n))},Lm=function(t,n){return nD(t,Lr(n))},Lg=function(t,n){return nD(t,Ls(n))},Ly=function(t,n){return nD(t,Lc(n))},Lv=function(t,n){return nD(t,Ll(n))},Lb=function(t,n){return nD(t,Lf(n))},Lx="TaskOption",LM={URI:Lx,map:Ld},LT=rn(LM),LS={URI:Lx,of:Aq},Lw={URI:Lx,map:Ld,ap:Lp},L_=n2(Lw),LI=n4(Lw),LO=function(t,n){return nD(t,Lt(function(t){return nD(n,A7(t))}))},Lk={URI:Lx,map:Ld,ap:Lp,chain:Lh},LC=rc(Lk),LN={URI:Lx,zero:Li},Lj=uK(LN,LS),LE={URI:Lx,fromIO:AQ},LR=gV(LE),LD=g$(LE,Lk),LA=gK(LE,Lk),LL={URI:Lx,fromEither:AZ},LP=rg(LL),LF=ry(LL,Lk),Lz=rv(LL,Lk),LU={URI:Lx,fromIO:AQ,fromTask:AH},LW=vc(LU),LB=vl(LU,Lk),LV=vf(LU,Lk),L$=Aq(nJ),LK=rr(LM),LY=rl(Lk),Lq=n3(Lw),LG=Aq(nH),LZ=function(t){return nC(_X(t),__(hu(nA)))},LQ=function(t){var n=LZ(t);return function(t){return nG(t)?n(t):LG}},LH=function(t){return function(n){return function(){return nQ(n).reduce(function(n,r,i){return n.then(function(o){return nz(o)?n:t(i+1,r)().then(function(t){return nz(t)?t:(o.value.push(t.value),o)})})},t(0,nZ(n))().then(pf(nq)))}}},LJ=function(t){var n=LH(t);return function(t){return nG(t)?n(t):LG}},LX=function(t){return LQ(function(n,r){return t(r)})},L0=LX(nS),L1=function(t){return LJ(function(n,r){return t(r)})},L2=L1(nS);let L4=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Lx,map:Ld,alt:Lm},Alternative:{URI:Lx,map:Ld,ap:Lp,of:Aq,alt:Lm,zero:Li},ApT:LG,ApplicativePar:{URI:Lx,map:Ld,ap:Lp,of:Aq},ApplicativeSeq:{URI:Lx,map:Ld,ap:LO,of:Aq},ApplyPar:Lw,ApplySeq:{URI:Lx,map:Ld,ap:LO},Chain:Lk,Compactable:{URI:Lx,compact:La,separate:Lu},Do:L$,Filterable:{URI:Lx,map:Ld,compact:La,separate:Lu,filter:Lg,filterMap:Ly,partition:Lv,partitionMap:Lb},FromEither:LL,FromIO:LE,FromTask:LU,Functor:LM,Monad:{URI:Lx,map:Ld,ap:Lp,of:Aq,chain:Lh},MonadIO:{URI:Lx,map:Ld,ap:Lp,of:Aq,chain:Lh,fromIO:AQ},MonadTask:{URI:Lx,map:Ld,ap:Lp,of:Aq,chain:Lh,fromIO:AQ,fromTask:AH},Pointed:LS,Zero:LN,alt:Lr,altW:Lr,ap:Le,apFirst:L_,apS:Lq,apSecond:LI,bind:LY,bindTo:LK,chain:Lt,chainEitherK:LF,chainFirst:LC,chainFirstEitherK:Lz,chainFirstIOK:LA,chainFirstTaskK:LV,chainIOK:LD,chainNullableK:A9,chainOptionK:A6,chainTaskK:LB,compact:La,filter:Ls,filterMap:Lc,flap:LT,flatten:Ln,fold:A0,foldW:A0,fromEither:AZ,fromEitherK:LP,fromIO:AQ,fromIOK:LR,fromNullable:A2,fromNullableK:A5,fromOption:_O,fromOptionK:A8,fromPredicate:AG,fromTask:AH,fromTaskEither:AJ,fromTaskK:LW,getOrElse:A1,getOrElseW:A1,guard:Lj,map:A7,match:AX,matchE:A0,matchEW:A0,matchW:AX,none:Lo,of:Aq,partition:Ll,partitionMap:Lf,separate:Lu,sequenceArray:L0,sequenceSeqArray:L2,some:Aq,traverseArray:LX,traverseArrayWithIndex:LQ,traverseReadonlyArrayWithIndex:LQ,traverseReadonlyArrayWithIndexSeq:LJ,traverseReadonlyNonEmptyArrayWithIndex:LZ,traverseReadonlyNonEmptyArrayWithIndexSeq:LH,traverseSeqArray:L1,traverseSeqArrayWithIndex:LJ,tryCatch:A4,tryCatchK:A3,zero:Li},Symbol.toStringTag,{value:"Module"}));var L3=function(t){return"Left"===t._tag},L5=function(t){return"Right"===t._tag};function L9(t){return"Both"===t._tag}function L8(t){return{_tag:"Left",left:t}}function L6(t){return{_tag:"Right",right:t}}function L7(t,n){return{_tag:"Both",left:t,right:n}}var Pe=function(t,n,r){return function(i){switch(i._tag){case"Left":return t(i.left);case"Right":return n(i.right);case"Both":return r(i.left,i.right)}}},Pt=Pe(L6,L8,function(t,n){return L7(n,t)});function Pn(t,n){return{concat:function(r,i){return L3(r)?L3(i)?L8(t.concat(r.left,i.left)):L5(i)?L7(r.left,i.right):L7(t.concat(r.left,i.left),i.right):L5(r)?L3(i)?L7(i.left,r.right):L5(i)?L6(n.concat(r.right,i.right)):L7(i.left,n.concat(r.right,i.right)):L3(i)?L7(t.concat(r.left,i.left),r.right):L5(i)?L7(r.left,n.concat(r.right,i.right)):L7(t.concat(r.left,i.left),n.concat(r.right,i.right))}}}var Pr=function(t){return{URI:PM,_E:void 0,map:Pa,ap:function(n,r){return L3(n)?L3(r)?L8(t.concat(n.left,r.left)):L5(r)?L8(n.left):L8(t.concat(n.left,r.left)):L5(n)?L3(r)?L8(r.left):L5(r)?L6(n.right(r.right)):L7(r.left,n.right(r.right)):L3(r)?L8(t.concat(n.left,r.left)):L5(r)?L7(n.left,n.right(r.right)):L7(t.concat(n.left,r.left),n.right(r.right))}}};function Pi(t){var n=Pr(t),r=function(n,r){if(L3(n))return n;if(L5(n))return r(n.right);var i=r(n.right);return L3(i)?L8(t.concat(n.left,i.left)):L5(i)?L7(n.left,i.right):L7(t.concat(n.left,i.left),i.right)};return{URI:PM,_E:void 0,map:Pa,ap:n.ap,chain:r}}var Po=function(t,n){return nz(t)?nz(n)?nW:nB(L6(n.value)):nz(n)?nB(L8(t.value)):nB(L7(t.value,n.value))},Pa=function(t,n){return nD(t,Pm(n))},Pu=function(t,n,r){return nD(t,Pp(n,r))},Ps=function(t,n){return nD(t,Ph(n))},Pc=function(t,n,r){return nD(t,Pg(n,r))},Pl=function(t){var n=Py(t);return function(t,r){return nD(t,n(r))}},Pf=function(t,n,r){return nD(t,Pv(n,r))},Pd=function(t){var n=Pb(t);return function(t,r){return nD(t,n(r))}},Pp=function(t,n){return function(r){return L3(r)?L8(t(r.left)):L5(r)?L6(n(r.right)):L7(t(r.left),n(r.right))}},Ph=function(t){return function(n){return L3(n)?L8(t(n.left)):L9(n)?L7(t(n.left),n.right):n}},Pm=function(t){return function(n){return L3(n)?n:L5(n)?L6(t(n.right)):L7(n.left,t(n.right))}},Pg=function(t,n){return function(r){return L3(r)?t:n(t,r.right)}},Py=function(t){return function(n){return function(r){return L3(r)?t.empty:n(r.right)}}},Pv=function(t,n){return function(r){return L3(r)?t:n(r.right,t)}},Pb=function(t){return function(n){return function(r){return L3(r)?t.of(r):L5(r)?t.map(n(r.right),L6):t.map(n(r.right),function(t){return L7(r.left,t)})}}},Px=function(t){return function(n){return L3(n)?t.of(n):L5(n)?t.map(n.right,L6):t.map(n.right,function(t){return L7(n.left,t)})}},PM="These",PT={URI:PM,map:Pa},PS=rn(PT),Pw={URI:PM,fromEither:nS},P_=rd(Pw),PI=rh(Pw),PO=function(t){return function(n){return function(r){return!L3(r)&&t.equals(n,r.right)}}},Pk=function(t){return function(n){return!L3(n)&&t(n.right)}},PC=function(t,n){return function(r){return L3(r)?[r.left,n()]:L5(r)?[t(),r.right]:[r.left,r.right]}},PN=function(t,n){return PC(function(){return t},function(){return n})},Pj=L6(nH),PE=function(t){return function(n){return function(r){var i=nW,o=n(0,nZ(r));if(L3(o))return o;L9(o)&&(i=nB(o.left));for(var a=[o.right],u=1;u<r.length;u++){var s=n(u,r[u]);if(L3(s))return s;L9(s)&&(i=nz(i)?nB(s.left):nB(t.concat(i.value,s.left))),a.push(s.right)}return nz(i)?L6(a):L7(i.value,a)}}},PR=function(t){return function(n){var r=PE(t)(n);return function(t){return nG(t)?r(t):Pj}}};let PD=Object.freeze(Object.defineProperty({__proto__:null,ApT:Pj,Bifunctor:{URI:PM,bimap:Pu,mapLeft:Ps},Foldable:{URI:PM,reduce:Pc,foldMap:Pl,reduceRight:Pf},FromEither:Pw,FromThese:{URI:PM,fromThese:nS},Functor:PT,Pointed:{URI:PM,of:L6},Traversable:{URI:PM,map:Pa,reduce:Pc,foldMap:Pl,reduceRight:Pf,traverse:Pd,sequence:Px},URI:PM,bimap:Pp,both:L7,elem:PO,exists:Pk,flap:PS,fold:Pe,foldMap:Py,foldW:Pe,fromOption:P_,fromOptionK:PI,fromOptions:Po,getApplicative:function(t){var n=Pr(t);return{URI:PM,_E:void 0,map:Pa,ap:n.ap,of:L6}},getApply:Pr,getChain:Pi,getEq:function(t,n){return rM(function(r,i){return L3(r)?L3(i)&&t.equals(r.left,i.left):L5(r)?L5(i)&&n.equals(r.right,i.right):L9(i)&&t.equals(r.left,i.left)&&n.equals(r.right,i.right)})},getLeft:function(t){return L3(t)?nB(t.left):L5(t)?nW:nB(t.left)},getLeftOnly:function(t){return L3(t)?nB(t.left):nW},getMonad:function(t){var n=Pi(t);return{URI:PM,_E:void 0,map:Pa,of:L6,ap:n.ap,chain:n.chain,throwError:L8}},getRight:function(t){return L3(t)?nW:(L5(t),nB(t.right))},getRightOnly:function(t){return L5(t)?nB(t.right):nW},getSemigroup:Pn,getShow:function(t,n){return{show:Pe(function(n){return"left(".concat(t.show(n),")")},function(t){return"right(".concat(n.show(t),")")},function(r,i){return"both(".concat(t.show(r),", ").concat(n.show(i),")")})}},isBoth:L9,isLeft:L3,isRight:L5,left:L8,leftOrBoth:function(t){return function(n){return nz(n)?L8(t):L7(t,n.value)}},map:Pm,mapLeft:Ph,match:Pe,matchW:Pe,of:L6,reduce:Pg,reduceRight:Pv,right:L6,rightOrBoth:function(t){return function(n){return nz(n)?L6(t):L7(n.value,t)}},sequence:Px,swap:Pt,these:{URI:PM,map:Pa,bimap:Pu,mapLeft:Ps,reduce:Pc,foldMap:Pl,reduceRight:Pf,traverse:Pd,sequence:Px},toTuple:PN,toTuple2:PC,traverse:Pb,traverseReadonlyArrayWithIndex:PR,traverseReadonlyNonEmptyArrayWithIndex:PE},Symbol.toStringTag,{value:"Module"}));function PA(t){return nC(L6,t.of)}function PL(t){return nC(L8,t.of)}function PP(t){return nC(L7,t.of)}function PF(t){return function(n){return t.map(n,L6)}}function Pz(t){return function(n){return t.map(n,L8)}}function PU(t){return rt(t,PT)}function PW(t,n){return n1(t,Pr(n))}function PB(t,n){var r=PL(t);return function(i){return function(o){return t.chain(o,Pe(r,i,function(r,o){return t.map(i(o),Pe(function(t){return L8(n.concat(r,t))},function(t){return L7(r,t)},function(t,i){return L7(n.concat(r,t),i)}))}))}}}function PV(t){return function(n,r){return function(i){return t.map(i,Pp(n,r))}}}function P$(t){return function(n){return function(r){return t.map(r,Ph(n))}}}function PK(t){return function(n,r,i){return function(o){return t.map(o,Pe(n,r,i))}}}function PY(t){return function(n,r,i){return function(o){return t.chain(o,Pe(n,r,i))}}}function Pq(t){return function(n){return t.map(n,Pt)}}function PG(t){return function(n,r){return function(i){return t.map(i,PC(n,r))}}}let PZ=Object.freeze(Object.defineProperty({__proto__:null,ap:PW,bimap:PV,both:PP,chain:PB,getTheseM:function(t){var n=PU(t),r=PV(t),i=P$(t),o=PY(t),a=PG(t),u=PA(t),s=function(t,r){return nD(t,n(r))};return{map:s,bimap:function(t,n,i){return nD(t,r(n,i))},mapLeft:function(t,n){return nD(t,i(n))},fold:function(t,n,r,i){return nD(t,o(n,r,i))},swap:Pq(t),rightM:PF(t),leftM:Pz(t),left:PL(t),right:PA(t),both:PP(t),toTuple:function(t,n,r){return nD(t,a(function(){return n},function(){return r}))},getMonad:function(n){var r=PW(t,n),i=PB(t,n);return{_E:void 0,map:s,of:u,ap:function(t,n){return nD(t,r(n))},chain:function(t,n){return nD(t,i(n))}}}}},left:PL,leftF:Pz,map:PU,mapLeft:P$,match:PK,matchE:PY,right:PA,rightF:PF,swap:Pq,toTuple2:PG},Symbol.toStringTag,{value:"Module"}));var PQ=PL(_R),PH=PA(_R),PJ=PP(_R),PX=PF(_j),P0=Pz(_j),P1=nC(_x,PX),P2=nC(_x,P0),P4=PK(_j),P3=PY(_W),P5=Pq(_j),P9=function(t,n){return nD(t,P7(n))},P8=function(t,n,r){return nD(t,Fe(n,r))},P6=function(t,n){return nD(t,Ft(n))},P7=PU(_j),Fe=PV(_j),Ft=P$(_j),Fn="TaskThese",Fr=function(t,n){var r=PW(t,n);return{URI:Fn,_E:void 0,map:P9,ap:function(t,n){return nD(t,r(n))}}};function Fi(t,n){var r=Fr(t,n).ap;return{URI:Fn,_E:void 0,map:P9,ap:r,of:PH}}function Fo(t){var n=Fr(_P,t),r=PB(_W,t);return{URI:Fn,_E:void 0,map:P9,ap:n.ap,chain:function(t,n){return nD(t,r(n))}}}var Fa={URI:Fn,map:P9},Fu=rn(Fa),Fs={URI:Fn,fromEither:_O},Fc=rd(Fs),Fl=rh(Fs),Ff=rp(Fs),Fd={URI:Fn,fromThese:_O},Fp=vp(Fd),Fh={URI:Fn,fromIO:P1},Fm=gV(Fh),Fg={URI:Fn,fromIO:P1,fromTask:PX},Fy=vc(Fg),Fv=PG(_j),Fb=PH(nH),Fx=function(t){var n=PE(t);return function(t){return nC(_X(t),__(n(nA)))}},FM=function(t){return function(n){var r=Fx(t)(n);return function(t){return nG(t)?r(t):Fb}}},FT=function(t){return function(n){return function(r){return function(){return nQ(r).reduce(function(r,i,o){return r.then(function(a){return L3(a)?r:n(o+1,i)().then(function(n){if(L3(n))return n;if(L9(n)){var r=a.right;return r.push(n.right),L9(a)?L7(t.concat(a.left,n.left),r):L7(n.left,r)}return a.right.push(n.right),a})})},n(0,nZ(r))().then(Pm(nq)))}}}},FS=function(t){return function(n){var r=FT(t)(n);return function(t){return nG(t)?r(t):Fb}}},Fw=function(t,n){return Fv(function(){return t},function(){return n})},F_=function(t,n){return n5(_F)(Pn(t,n))};let FI=Object.freeze(Object.defineProperty({__proto__:null,ApT:Fb,Bifunctor:{URI:Fn,bimap:P8,mapLeft:P6},FromEither:Fs,FromIO:Fh,FromTask:Fg,FromThese:Fd,Functor:Fa,Pointed:{URI:Fn,of:PH},URI:Fn,bifunctorTaskThese:{URI:Fn,bimap:P8,mapLeft:P6},bimap:Fe,both:PJ,flap:Fu,fold:P3,foldW:P3,fromEither:_O,fromIO:P1,fromIOEither:_x,fromIOK:Fm,fromOption:Fc,fromOptionK:Fl,fromPredicate:Ff,fromTask:PX,fromTaskK:Fy,fromThese:_O,fromTheseK:Fp,functorTaskThese:{URI:Fn,map:P9},getApplicative:Fi,getApply:Fr,getChain:Fo,getMonad:function(t){var n=Fi(_P,t),r=Fo(t);return{URI:Fn,_E:void 0,map:P9,ap:n.ap,of:PH,chain:r.chain,fromIO:P1,fromTask:PX}},getSemigroup:F_,left:PQ,leftIO:P2,leftTask:P0,map:P7,mapLeft:Ft,match:P4,matchE:P3,matchEW:P3,matchW:P4,of:PH,right:PH,rightIO:P1,rightTask:PX,swap:P5,taskThese:{URI:Fn,map:P9,bimap:P8,mapLeft:P6},toTuple:Fw,toTuple2:Fv,traverseReadonlyArrayWithIndex:FM,traverseReadonlyArrayWithIndexSeq:FS,traverseReadonlyNonEmptyArrayWithIndex:Fx,traverseReadonlyNonEmptyArrayWithIndexSeq:FT},Symbol.toStringTag,{value:"Module"}));var FO=function(t,n){return nD(t,Fk(n))},Fk=function(t){return function(n){return function(r){return t(n(r))}}},FC="Traced",FN={URI:FC,map:FO},Fj=rn(FN);let FE=Object.freeze(Object.defineProperty({__proto__:null,Functor:FN,URI:FC,censor:function(t){return function(n){return function(r){return n(t(r))}}},flap:Fj,getComonad:function(t){return{URI:FC,_E:void 0,map:FO,extend:function(n,r){return function(i){return r(function(r){return n(t.concat(i,r))})}},extract:function(n){return n(t.empty)}}},listen:function(t){return function(n){return[t(n),n]}},listens:function(t){return function(n){return function(r){return[n(r),t(r)]}}},map:Fk,traced:FN,tracks:function(t,n){return function(r){return r(n(r(t.empty)))}}},Symbol.toStringTag,{value:"Module"}));function FR(t,n){return function(r){var i=t.traverse(r),o=n.traverse(r);return function(t){return function(n){return i(n,function(n){return o(n,t)})}}}}function FD(t,n){return function(r){var i=t.sequence(r),o=n.sequence(r);return function(n){return i(t.map(n,o))}}}let FA=Object.freeze(Object.defineProperty({__proto__:null,getTraversableComposition:function(t,n){var r=ri(t,n).map,i=gP(t,n),o=FR(t,n),a=FD(t,n);return{map:r,reduce:i.reduce,foldMap:i.foldMap,reduceRight:i.reduceRight,traverse:function(t){var n=o(t);return function(t,r){return nD(t,n(r))}},sequence:function(t){var n=a(t);return function(t){return nD(t,n)}}}},sequence:FD,traverse:FR},Symbol.toStringTag,{value:"Module"})),FL=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function FP(t,n){return void 0===n&&(n=[]),{value:t,forest:n}}var FF=function(t,n){for(var r,i="",o=n.length,a=0;a<o;a++){r=n[a];var u=a===o-1;i+=t+(u?"└":"├")+"─ "+r.value,i+=FF(t+(o>1&&!u?"│ ":" "),r.forest)}return i};function Fz(t){return FF(`
|
|
2
|
-
`,t)}function FU(t,n){var r,i=n(t);return{value:i[0],forest:FW(i[1],n)}}function FW(t,n){return t.map(function(t){return FU(t,n)})}function FB(t){var n=FV(t);return function(r,i){return t.chain(i(r),function(r){var o=r[0],a=r[1];return t.map(n(a,i),function(t){return{value:o,forest:t}})})}}function FV(t){var n=fL(t);return function(r,i){return nD(r,n(function(n){return FB(t)(n,i)}))}}var F$=function(t,n){return nD(t,F4(n))},FK=function(t,n){return nD(t,FX(function(t){return nD(n,F4(t))}))},FY=function(t,n){return nD(t,FX(n))},Fq=function(t,n,r){return nD(t,F3(n,r))},FG=function(t){var n=F5(t);return function(t,r){return nD(t,n(r))}},FZ=function(t,n,r){return nD(t,F9(n,r))},FQ=function(t,n){return nD(t,F0(n))},FH=function(t){var n=F6(t);return function(t,r){return nD(t,n(r))}},FJ=function(t){return function(n){return FK(n,t)}},FX=function(t){return function(n){var r=t(n.value),i=r.value,o=r.forest,a=f$().concat;return{value:i,forest:a(o,n.forest.map(FX(t)))}}},F0=function(t){return function(n){return{value:t(n),forest:n.forest.map(F0(t))}}},F1=F0(nS),F2=FX(nS),F4=function(t){return function(n){return{value:t(n.value),forest:n.forest.map(F4(t))}}},F3=function(t,n){return function(r){for(var i=n(t,r.value),o=r.forest.length,a=0;a<o;a++)i=nD(r.forest[a],F3(i,n));return i}},F5=function(t){return function(n){return F3(t.empty,function(r,i){return t.concat(r,n(i))})}},F9=function(t,n){return function(r){for(var i=t,o=r.forest.length,a=o-1;a>=0;a--)i=nD(r.forest[a],F9(i,n));return n(r.value,i)}},F8=function(t){return t.value},F6=function(t){var n=fL(t),r=function(i){return function(o){return t.ap(t.map(i(o.value),function(t){return function(n){return{value:t,forest:n}}}),nD(o.forest,n(r(i))))}};return r},F7=function(t){return F6(t)(nS)},ze=function(t){return FP(t)},zt="Tree",zn={URI:zt,map:F$},zr=rn(zn),zi={URI:zt,map:F$,ap:FK},zo=n2(zi),za=n4(zi),zu={URI:zt,map:F$,ap:FK,chain:FY},zs=rc(zu),zc=ze(nJ),zl=rr(zn),zf=rl(zu),zd=n3(zi),zp=function(t){return function(n){return t(n.value)||n.forest.some(zp(t))}};let zh=Object.freeze(Object.defineProperty({__proto__:null,Applicative:{URI:zt,map:F$,ap:FK,of:ze},Apply:zi,Chain:zu,Comonad:{URI:zt,map:F$,extend:FQ,extract:F8},Do:zc,Foldable:{URI:zt,reduce:Fq,foldMap:FG,reduceRight:FZ},Functor:zn,Monad:{URI:zt,map:F$,ap:FK,of:ze,chain:FY},Pointed:{URI:zt,of:ze},Traversable:{URI:zt,map:F$,reduce:Fq,foldMap:FG,reduceRight:FZ,traverse:FH,sequence:F7},URI:zt,ap:FJ,apFirst:zo,apS:zd,apSecond:za,bind:zf,bindTo:zl,chain:FX,chainFirst:zs,drawForest:Fz,drawTree:function(t){return t.value+Fz(t.forest)},duplicate:F1,elem:function(t){var n=function(r,i){return t.equals(r,i.value)||i.forest.some(function(t){return n(r,t)})};return n},exists:zp,extend:F0,extract:F8,flap:zr,flatten:F2,fold:function(t){var n=function(r){return t(r.value,r.forest.map(n))};return n},foldMap:F5,getEq:function(t){var n,r=rM(function(r,i){return t.equals(r.value,i.value)&&n.equals(r.forest,i.forest)});return n=cE(r),r},getShow:function(t){var n=function(r){return lu(r.forest)?"make(".concat(t.show(r.value),")"):"make(".concat(t.show(r.value),", [").concat(r.forest.map(n).join(", "),"])")};return{show:n}},make:FP,map:F4,of:ze,reduce:F3,reduceRight:F9,sequence:F7,traverse:F6,tree:{URI:zt,map:F$,of:ze,ap:FK,chain:FY,reduce:Fq,foldMap:FG,reduceRight:FZ,traverse:FH,sequence:F7,extract:F8,extend:FQ},unfoldForest:FW,unfoldForestM:FV,unfoldTree:FU,unfoldTreeM:FB},Symbol.toStringTag,{value:"Module"}));var zm=function(t){var n;return[Ep(t),(n=t,n[0])]};function zg(t){return{URI:zz,_E:void 0,map:zx,ap:function(n,r){var i,o;return[(i=n,i[0])((o=r,o[0])),t.concat(Ep(n),Ep(r))]}}}var zy=function(t){return function(n){return[n,t.empty]}};function zv(t){var n=zg(t);return{URI:zz,_E:void 0,map:n.map,ap:n.ap,chain:function(n,r){var i,o=r((i=n,i[0])),a=o[0],u=o[1];return[a,t.concat(Ep(n),u)]}}}var zb=function(t,n){return nD(t,zj(n))},zx=function(t,n){return nD(t,zC(n))},zM=function(t,n,r){return nD(t,zk(n,r))},zT=function(t,n){return nD(t,zN(n))},zS=function(t,n){return nD(t,zE(n))},zw=function(t,n,r){return nD(t,zA(n,r))},z_=function(t){var n=zD();return function(t,r){return nD(t,n(r))}},zI=function(t,n,r){return nD(t,zL(n,r))};function zO(t){var n=zP(t);return function(t,r){return nD(t,n(r))}}var zk=function(t,n){return function(r){var i;return[n((i=r,i[0])),t(Ep(r))]}},zC=function(t){return function(n){var r;return[t((r=n,r[0])),Ep(n)]}},zN=function(t){return function(n){var r;return[(r=n,r[0]),t(Ep(n))]}},zj=function(t){return function(n){var r;return[(r=n,r[0]),Ep(t)]}},zE=function(t){return function(n){return[t(n),Ep(n)]}},zR=zE(nS),zD=ED,zA=ER,zL=EA,zP=function(t){return function(n){return function(r){var i;return t.map(n((i=r,i[0])),function(t){return[t,Ep(r)]})}}},zF=function(t){return function(n){var r;return t.map((r=n,r[0]),function(t){return[t,Ep(n)]})}},zz="Tuple",zU={URI:zz,map:zx},zW=rn(zU);let zB=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:zz,bimap:zM,mapLeft:zT},Comonad:{URI:zz,map:zx,extend:zS,extract:Ed},Foldable:{URI:zz,reduce:zw,foldMap:z_,reduceRight:zI},Functor:zU,Semigroupoid:{URI:zz,compose:zb},Traversable:{URI:zz,map:zx,reduce:zw,foldMap:z_,reduceRight:zI,traverse:zO,sequence:zF},URI:zz,bimap:zk,compose:zj,duplicate:zR,extend:zE,extract:Ed,flap:zW,foldMap:zD,fst:Ed,getApplicative:function(t){var n=zg(t);return{URI:zz,_E:void 0,map:n.map,ap:n.ap,of:zy(t)}},getApply:zg,getChain:zv,getChainRec:function(t){var n=function(n,r){for(var i,o,a=r(n),u=t.empty,s=(i=a,i[0]);"Left"===s._tag;){u=t.concat(u,Ep(a)),s=(o=a=r(s.left))[0]}return[s.right,t.concat(u,Ep(a))]},r=zv(t);return{URI:zz,_E:void 0,map:r.map,ap:r.ap,chain:r.chain,chainRec:n}},getMonad:function(t){var n=zv(t);return{URI:zz,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,of:zy(t)}},map:zC,mapFst:zC,mapLeft:zN,mapSnd:zN,reduce:zA,reduceRight:zL,sequence:zF,snd:Ep,swap:zm,traverse:zP,tuple:{URI:zz,compose:zb,map:zx,bimap:zM,mapLeft:zT,extract:Ed,extend:zS,reduce:zw,foldMap:z_,reduceRight:zI,traverse:zO,sequence:zF}},Symbol.toStringTag,{value:"Module"})),zV=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),z$=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:function(t,n){var r=ru(n,h7(t));return{map:r.map,ap:r.ap,of:r.of,chain:function(t,r){return n.chain(t,function(t){return nV(t)?n.of(nK(t.left)):r(t.right)})},alt:function(r,i){return n.chain(r,function(r){return n$(r)?n.of(r):n.map(i(),function(n){return nV(n)?nK(t.concat(r.left,n.left)):n})})}}}},Symbol.toStringTag,{value:"Module"}));var zK=r8(void 0),zY={concat:zK.concat,empty:void 0};let zq=Object.freeze(Object.defineProperty({__proto__:null,Monoid:zY,Semigroup:zK},Symbol.toStringTag,{value:"Module"}));var zG=function(t){return function(){return[void 0,t]}},zZ=function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,i],i]}},zQ=function(t){return function(){var n,r=t(),i=r[0],o=i[0];return[o,(0,i[1])(r[1])]}},zH=function(t){return function(n){return function(){var r=n(),i=r[0],o=r[1];return[[i,t(o)],o]}}},zJ=function(t){return function(n){return function(){var r,i=n();return[i[0],t(i[1])]}}},zX=function(t,n){return nD(t,z0(n))},z0=function(t){return function(n){return function(){var r=n(),i=r[0],o=r[1];return[t(i),o]}}},z1="Writer",z2=function(t){return{URI:z1,_E:void 0,of:function(n){return function(){return[n,t.empty]}}}},z4=function(t){return{URI:z1,_E:void 0,map:zX,ap:function(n,r){return function(){var i=n(),o=i[0],a=i[1],u=r(),s=u[0],c=u[1];return[o(s),t.concat(a,c)]}}}},z3=function(t){var n=z4(t),r=z2(t);return{URI:z1,_E:void 0,map:zX,ap:n.ap,of:r.of}};function z5(t){var n=z4(t);return{URI:z1,_E:void 0,map:zX,ap:n.ap,chain:function(n,r){return function(){var i=n(),o=i[0],a=i[1],u=r(o)(),s=u[0],c=u[1];return[s,t.concat(a,c)]}}}}var z9={URI:z1,map:zX},z8=rn(z9),z6=function(t){return t()[0]},z7=function(t){return t()[1]},Ue=function(t){return t()[0]},Ut=function(t){return t()[1]};let Un=Object.freeze(Object.defineProperty({__proto__:null,Functor:z9,URI:z1,censor:zJ,evalWriter:Ue,evaluate:z6,execWriter:Ut,execute:z7,flap:z8,getApplicative:z3,getApply:z4,getChain:z5,getMonad:function(t){var n=z3(t),r=z5(t);return{URI:z1,_E:void 0,map:zX,ap:n.ap,of:n.of,chain:r.chain}},getPointed:z2,listen:zZ,listens:zH,map:z0,pass:zQ,tell:zG,writer:z9},Symbol.toStringTag,{value:"Module"})),Ur=Object.freeze(Object.defineProperty({__proto__:null,getWriterM:function(t){var n=function(n,r){return function(){return t.map(n(),function(t){var n=t[0],i=t[1];return[r(n),i]})}};return{map:n,evalWriter:function(n){return t.map(n(),function(t){return t[0]})},execWriter:function(n){return t.map(n(),function(t){return t[0],t[1]})},tell:function(n){return function(){return t.of([void 0,n])}},listen:function(n){return function(){return t.map(n(),function(t){var n=t[0],r=t[1];return[[n,r],r]})}},pass:function(n){return function(){return t.map(n(),function(t){var n,r=t[0],i=r[0];return[i,(0,r[1])(t[1])]})}},listens:function(n,r){return function(){return t.map(n(),function(t){var n=t[0],i=t[1];return[[n,r(i)],i]})}},censor:function(n,r){return function(){return t.map(n(),function(t){var n;return[t[0],r(t[1])]})}},getMonad:function(r){return{_E:void 0,map:n,of:function(n){return function(){return t.of([n,r.empty])}},ap:function(n,i){return function(){return t.chain(n(),function(n){var o=n[0],a=n[1];return t.map(i(),function(t){var n=t[0],i=t[1];return[o(n),r.concat(a,i)]})})}},chain:function(n,i){return function(){return t.chain(n(),function(n){var o=n[0],a=n[1];return t.map(i(o)(),function(t){var n=t[0],i=t[1];return[n,r.concat(a,i)]})})}}}}}}},Symbol.toStringTag,{value:"Module"})),Ui=Object.freeze(Object.defineProperty({__proto__:null,alt:nm,alternative:ng,applicative:rs,apply:re,array:dp,bifunctor:dh,boolean:dS,booleanAlgebra:d_,bounded:dC,boundedDistributiveLattice:dE,boundedJoinSemilattice:dR,boundedLattice:dD,boundedMeetSemilattice:dA,category:dL,chain:rf,chainRec:dF,choice:dW,comonad:dB,compactable:hb,console:hw,const:hF,contravariant:hz,date:hV,distributiveLattice:dj,either:m8,eitherT:gx,endomorphism:gS,eq:rj,extend:gw,field:gI,filterable:gj,filterableWithIndex:gE,foldable:gF,foldableWithIndex:gB,fromEither:rx,fromIO:gY,fromReader:yE,fromState:vs,fromTask:vd,fromThese:vh,function:nP,functor:ro,functorWithIndex:vg,group:vy,heytingAlgebra:vv,hkt:vb,identity:v0,invariant:v1,io:bM,ioEither:xN,ioOption:Mq,ioRef:MZ,joinSemilattice:MQ,json:MX,lattice:M0,magma:r3,map:SW,meetSemilattice:SB,monad:SV,monadIO:S$,monadTask:SK,monadThrow:SY,monoid:S9,naturalTransformation:S8,nonEmptyArray:uy,number:uk,option:hg,optionT:xG,ord:rJ,ordering:wi,pipeable:wo,pointed:wa,predicate:dX,profunctor:wu,random:wd,reader:yI,readerEither:_p,readerT:_b,readerTask:IX,readerTaskEither:C9,readonlyArray:la,readonlyMap:T1,readonlyNonEmptyArray:oZ,readonlyRecord:jK,readonlySet:Ef,readonlyTuple:EW,record:RS,refinement:RE,ring:RA,semigroup:id,semigroupoid:RL,semiring:RP,separated:uU,set:R3,show:R8,state:vt,stateReaderTaskEither:AO,stateT:Da,store:AF,string:Nm,strong:AW,struct:A$,task:_7,taskEither:ky,taskOption:L4,taskThese:FI,these:PD,theseT:PZ,traced:FE,traversable:FA,traversableWithIndex:FL,tree:zh,tuple:zB,unfoldable:zV,validationT:z$,void:zq,witherable:u$,writer:Un,writerT:Ur,zero:uY},Symbol.toStringTag,{value:"Module"})),Uo=w(Ui);var Ua={},Uu={},Us={},Uc={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getEndomorphismMonoid=t.not=t.SK=t.hole=t.pipe=t.untupled=t.tupled=t.absurd=t.decrement=t.increment=t.tuple=t.flow=t.flip=t.constVoid=t.constUndefined=t.constNull=t.constFalse=t.constTrue=t.constant=t.unsafeCoerce=t.identity=t.apply=t.getRing=t.getSemiring=t.getMonoid=t.getSemigroup=t.getBooleanAlgebra=void 0;var n=function(t){return function(){return{meet:function(n,r){return function(i){return t.meet(n(i),r(i))}},join:function(n,r){return function(i){return t.join(n(i),r(i))}},zero:function(){return t.zero},one:function(){return t.one},implies:function(n,r){return function(i){return t.implies(n(i),r(i))}},not:function(n){return function(r){return t.not(n(r))}}}}};t.getBooleanAlgebra=n;var r=function(t){return function(){return{concat:function(n,r){return function(i){return t.concat(n(i),r(i))}}}}};t.getSemigroup=r;var i=function(n){var r=(0,t.getSemigroup)(n);return function(){return{concat:r().concat,empty:function(){return n.empty}}}};t.getMonoid=i;var o=function(t){return{add:function(n,r){return function(i){return t.add(n(i),r(i))}},zero:function(){return t.zero},mul:function(n,r){return function(i){return t.mul(n(i),r(i))}},one:function(){return t.one}}};t.getSemiring=o;var a=function(n){var r=(0,t.getSemiring)(n);return{add:r.add,mul:r.mul,one:r.one,zero:r.zero,sub:function(t,r){return function(i){return n.sub(t(i),r(i))}}}};t.getRing=a;var u=function(t){return function(n){return n(t)}};function s(t){return t}function c(t){return function(){return t}}function l(t,n,r,i,o,a,u,s,c){switch(arguments.length){case 1:return t;case 2:return function(){return n(t.apply(this,arguments))};case 3:return function(){return r(n(t.apply(this,arguments)))};case 4:return function(){return i(r(n(t.apply(this,arguments))))};case 5:return function(){return o(i(r(n(t.apply(this,arguments)))))};case 6:return function(){return a(o(i(r(n(t.apply(this,arguments))))))};case 7:return function(){return u(a(o(i(r(n(t.apply(this,arguments)))))))};case 8:return function(){return s(u(a(o(i(r(n(t.apply(this,arguments))))))))};case 9:return function(){return c(s(u(a(o(i(r(n(t.apply(this,arguments)))))))))}}}function f(t){return t+1}function d(t){return t-1}function p(t){throw Error("Called `absurd` function which should be uncallable")}t.apply=u,t.identity=s,t.unsafeCoerce=s,t.constant=c,t.constTrue=c(!0),t.constFalse=c(!1),t.constNull=c(null),t.constUndefined=c(void 0),t.constVoid=t.constUndefined,t.flip=function(t){return function(n,r){return t(r,n)}},t.flow=l,t.tuple=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t},t.increment=f,t.decrement=d,t.absurd=p,t.tupled=function(t){return function(n){return t.apply(void 0,n)}},t.untupled=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(n)}},t.pipe=function(t,n,r,i,o,a,u,s,c){switch(arguments.length){case 1:return t;case 2:return n(t);case 3:return r(n(t));case 4:return i(r(n(t)));case 5:return o(i(r(n(t))));case 6:return a(o(i(r(n(t)))));case 7:return u(a(o(i(r(n(t))))));case 8:return s(u(a(o(i(r(n(t)))))));case 9:return c(s(u(a(o(i(r(n(t))))))));default:for(var l=arguments[0],f=1;f<arguments.length;f++)l=arguments[f](l);return l}},t.hole=p;var h=function(t,n){return n};t.SK=h,t.not=function(t){return function(n){return!t(n)}};var m=function(){return{concat:function(t,n){return l(t,n)},empty:s}};t.getEndomorphismMonoid=m}(Uc);var Ul={},Uf=S&&S.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))};Object.defineProperty(Ul,"__esModule",{value:!0}),Ul.fromReadonlyNonEmptyArray=Ul.has=Ul.emptyRecord=Ul.emptyReadonlyArray=Ul.tail=Ul.head=Ul.isNonEmpty=Ul.singleton=Ul.right=Ul.left=Ul.isRight=Ul.isLeft=Ul.some=Ul.none=Ul.isSome=Ul.isNone=void 0;var Ud=function(t){return"None"===t._tag};Ul.isNone=Ud;var Up=function(t){return"Some"===t._tag};Ul.isSome=Up,Ul.none={_tag:"None"};var Uh=function(t){return{_tag:"Some",value:t}};Ul.some=Uh;var Um=function(t){return"Left"===t._tag};Ul.isLeft=Um;var Ug=function(t){return"Right"===t._tag};Ul.isRight=Ug;var Uy=function(t){return{_tag:"Left",left:t}};Ul.left=Uy;var Uv=function(t){return{_tag:"Right",right:t}};Ul.right=Uv;var Ub=function(t){return[t]};Ul.singleton=Ub;var Ux=function(t){return t.length>0};Ul.isNonEmpty=Ux;var UM=function(t){return t[0]};Ul.head=UM;var UT=function(t){return t.slice(1)};Ul.tail=UT,Ul.emptyReadonlyArray=[],Ul.emptyRecord={},Ul.has=Object.prototype.hasOwnProperty;var US=function(t){return Uf([t[0]],t.slice(1),!0)};Ul.fromReadonlyNonEmptyArray=US;var Uw=S&&S.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),U_=S&&S.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),UI=S&&S.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&Uw(n,t,r);return U_(n,t),n};Object.defineProperty(Us,"__esModule",{value:!0}),Us.sequenceS=Us.sequenceT=Us.getApplySemigroup=Us.apS=Us.apSecond=Us.apFirst=Us.ap=void 0;var UO=UI(Ul);function Uk(t,n,r){return function(i){for(var o=Array(r.length+1),a=0;a<r.length;a++)o[a]=r[a];return o[r.length]=i,0===n?t.apply(null,o):Uk(t,n-1,o)}}Us.ap=function(t,n){return function(r){return function(i){return t.ap(t.map(i,function(t){return function(r){return n.ap(t,r)}}),r)}}},Us.apFirst=function(t){return function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}}},Us.apSecond=function(t){return function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}},Us.apS=function(t){return function(n,r){return function(i){return t.ap(t.map(i,function(t){return function(r){var i;return Object.assign({},t,((i={})[n]=r,i))}}),r)}}},Us.getApplySemigroup=function(t){return function(n){return{concat:function(r,i){return t.ap(t.map(r,function(t){return function(r){return n.concat(t,r)}}),i)}}}};var UC={1:function(t){return[t]},2:function(t){return function(n){return[t,n]}},3:function(t){return function(n){return function(r){return[t,n,r]}}},4:function(t){return function(n){return function(r){return function(i){return[t,n,r,i]}}}},5:function(t){return function(n){return function(r){return function(i){return function(o){return[t,n,r,i,o]}}}}}};function UN(t){return UO.has.call(UC,t)||(UC[t]=Uk(Uc.tuple,t-1,[])),UC[t]}function Uj(t){var n=t.length;switch(n){case 1:return function(n){var r;return(r={})[t[0]]=n,r};case 2:return function(n){return function(r){var i;return(i={})[t[0]]=n,i[t[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return(o={})[t[0]]=n,o[t[1]]=r,o[t[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return(a={})[t[0]]=n,a[t[1]]=r,a[t[2]]=i,a[t[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return(u={})[t[0]]=n,u[t[1]]=r,u[t[2]]=i,u[t[3]]=o,u[t[4]]=a,u}}}}};default:return Uk(function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];for(var o={},a=0;a<n;a++)o[t[a]]=r[a];return o},n-1,[])}}Us.sequenceT=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=n.length,o=UN(i),a=t.map(n[0],o),u=1;u<i;u++)a=t.ap(a,n[u]);return a}},Us.sequenceS=function(t){return function(n){for(var r=Object.keys(n),i=r.length,o=Uj(r),a=t.map(n[r[0]],o),u=1;u<i;u++)a=t.ap(a,n[r[u]]);return a}};var UE={};function UR(t,n){return function(r){return function(i){return t.map(i,function(t){return n.map(t,r)})}}}Object.defineProperty(UE,"__esModule",{value:!0}),UE.getFunctorComposition=UE.bindTo=UE.flap=UE.map=void 0,UE.map=UR,UE.flap=function(t){return function(n){return function(r){return t.map(r,function(t){return t(n)})}}},UE.bindTo=function(t){return function(n){return function(r){return t.map(r,function(t){var r;return(r={})[n]=t,r})}}},UE.getFunctorComposition=function(t,n){var r=UR(t,n);return{map:function(t,n){return(0,Uc.pipe)(t,r(n))}}},Object.defineProperty(Uu,"__esModule",{value:!0}),Uu.getApplicativeComposition=Uu.getApplicativeMonoid=void 0,Uu.getApplicativeMonoid=function(t){var n=(0,Us.getApplySemigroup)(t);return function(r){return{concat:n(r).concat,empty:t.of(r.empty)}}},Uu.getApplicativeComposition=function(t,n){var r=(0,UE.getFunctorComposition)(t,n).map,i=(0,Us.ap)(t,n);return{map:r,of:function(r){return t.of(n.of(r))},ap:function(t,n){return(0,Uc.pipe)(t,i(n))}}};var UD={};Object.defineProperty(UD,"__esModule",{value:!0}),UD.bind=UD.chainFirst=void 0,UD.chainFirst=function(t){return function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}}},UD.bind=function(t){return function(n,r){return function(i){return t.chain(i,function(i){return t.map(r(i),function(t){var r;return Object.assign({},i,((r={})[n]=t,r))})})}}};var UA={};Object.defineProperty(UA,"__esModule",{value:!0}),UA.tailRec=void 0;var UL=function(t,n){for(var r=n(t);"Left"===r._tag;)r=n(r.left);return r.right};UA.tailRec=UL;var UP={},UF=S&&S.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),Uz=S&&S.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),UU=S&&S.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&UF(n,t,r);return Uz(n,t),n};Object.defineProperty(UP,"__esModule",{value:!0}),UP.filterOrElse=UP.chainFirstEitherK=UP.chainEitherK=UP.fromEitherK=UP.chainOptionK=UP.fromOptionK=UP.fromPredicate=UP.fromOption=void 0;var UW=UU(Ul);function UB(t){return function(n){return function(r){return t.fromEither(UW.isNone(r)?UW.left(n()):UW.right(r.value))}}}function UV(t){var n=UB(t);return function(t){var r=n(t);return function(t){return(0,Uc.flow)(t,r)}}}function U$(t){return function(n){return(0,Uc.flow)(n,t.fromEither)}}UP.fromOption=UB,UP.fromPredicate=function(t){return function(n,r){return function(i){return t.fromEither(n(i)?UW.right(i):UW.left(r(i)))}}},UP.fromOptionK=UV,UP.chainOptionK=function(t,n){var r=UV(t);return function(t){var i=r(t);return function(t){return function(r){return n.chain(r,i(t))}}}},UP.fromEitherK=U$,UP.chainEitherK=function(t,n){var r=U$(t);return function(t){return function(i){return n.chain(i,r(t))}}},UP.chainFirstEitherK=function(t,n){return(0,Uc.flow)(U$(t),(0,UD.chainFirst)(n))},UP.filterOrElse=function(t,n){return function(r,i){return function(o){return n.chain(o,function(n){return t.fromEither(r(n)?UW.right(n):UW.left(i(n)))})}}};var UK,UY,Uq,UG,UZ,UQ,UH,UJ,UX,U0,U1={};Object.defineProperty(UK=U1,"__esModule",{value:!0}),UK.right=UK.left=UK.flap=UK.Functor=UK.Bifunctor=UK.URI=UK.bimap=UK.mapLeft=UK.map=UK.separated=void 0,UY=function(t,n){return{left:t,right:n}},UK.separated=UY,Uq=function(t,n){return(0,Uc.pipe)(t,(0,UK.map)(n))},UG=function(t,n){return(0,Uc.pipe)(t,(0,UK.mapLeft)(n))},UZ=function(t,n,r){return(0,Uc.pipe)(t,(0,UK.bimap)(n,r))},UQ=function(t){return function(n){return(0,UK.separated)((0,UK.left)(n),t((0,UK.right)(n)))}},UK.map=UQ,UH=function(t){return function(n){return(0,UK.separated)(t((0,UK.left)(n)),(0,UK.right)(n))}},UK.mapLeft=UH,UJ=function(t,n){return function(r){return(0,UK.separated)(t((0,UK.left)(r)),n((0,UK.right)(r)))}},UK.bimap=UJ,UK.URI="Separated",UK.Bifunctor={URI:UK.URI,mapLeft:UG,bimap:UZ},UK.Functor={URI:UK.URI,map:Uq},UK.flap=(0,UE.flap)(UK.Functor),UX=function(t){return t.left},UK.left=UX,U0=function(t){return t.right},UK.right=U0;var U2={},U4=S&&S.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),U3=S&&S.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),U5=S&&S.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&U4(n,t,r);return U3(n,t),n};Object.defineProperty(U2,"__esModule",{value:!0}),U2.filterE=U2.witherDefault=U2.wiltDefault=void 0;var U9=U5(Ul);U2.wiltDefault=function(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.separate)}}},U2.witherDefault=function(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.compact)}}},U2.filterE=function(t){return function(n){var r=t.wither(n);return function(t){return function(i){return r(i,function(r){return n.map(t(r),function(t){return t?U9.some(r):U9.none})})}}}},WQ=Ua,WH=S&&S.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(n,r);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(t,i,o)}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),WJ=S&&S.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),WX=S&&S.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&WH(n,t,r);return WJ(n,t),n},Object.defineProperty(WQ,"__esModule",{value:!0}),WQ.fold=WQ.match=WQ.foldW=WQ.matchW=WQ.isRight=WQ.isLeft=WQ.fromOption=WQ.fromPredicate=WQ.FromEither=WQ.MonadThrow=WQ.throwError=WQ.ChainRec=WQ.Extend=WQ.extend=WQ.Alt=WQ.alt=WQ.altW=WQ.Bifunctor=WQ.mapLeft=WQ.bimap=WQ.Traversable=WQ.sequence=WQ.traverse=WQ.Foldable=WQ.reduceRight=WQ.foldMap=WQ.reduce=WQ.Monad=WQ.Chain=WQ.chain=WQ.chainW=WQ.Applicative=WQ.Apply=WQ.ap=WQ.apW=WQ.Pointed=WQ.of=WQ.Functor=WQ.map=WQ.getAltValidation=WQ.getApplicativeValidation=WQ.getWitherable=WQ.getFilterable=WQ.getCompactable=WQ.getSemigroup=WQ.getEq=WQ.getShow=WQ.URI=WQ.right=WQ.left=void 0,WQ.getValidation=WQ.getValidationMonoid=WQ.getValidationSemigroup=WQ.getApplyMonoid=WQ.getApplySemigroup=WQ.either=WQ.stringifyJSON=WQ.parseJSON=WQ.sequenceArray=WQ.traverseArray=WQ.traverseArrayWithIndex=WQ.traverseReadonlyArrayWithIndex=WQ.traverseReadonlyNonEmptyArrayWithIndex=WQ.ApT=WQ.apSW=WQ.apS=WQ.bindW=WQ.bind=WQ.bindTo=WQ.Do=WQ.exists=WQ.elem=WQ.toError=WQ.toUnion=WQ.chainNullableK=WQ.fromNullableK=WQ.tryCatchK=WQ.tryCatch=WQ.fromNullable=WQ.orElse=WQ.orElseW=WQ.swap=WQ.filterOrElseW=WQ.filterOrElse=WQ.chainOptionK=WQ.fromOptionK=WQ.duplicate=WQ.flatten=WQ.flattenW=WQ.chainFirstW=WQ.chainFirst=WQ.apSecondW=WQ.apSecond=WQ.apFirstW=WQ.apFirst=WQ.flap=WQ.getOrElse=WQ.getOrElseW=void 0,W0=WX(Ul),WQ.left=W0.left,WQ.right=W0.right,W1=function(t,n){return(0,Uc.pipe)(t,(0,WQ.map)(n))},W2=function(t,n){return(0,Uc.pipe)(t,(0,WQ.ap)(n))},W4=function(t,n){return(0,Uc.pipe)(t,(0,WQ.chain)(n))},W3=function(t,n,r){return(0,Uc.pipe)(t,(0,WQ.reduce)(n,r))},W5=function(t){return function(n,r){var i=(0,WQ.foldMap)(t);return(0,Uc.pipe)(n,i(r))}},W9=function(t,n,r){return(0,Uc.pipe)(t,(0,WQ.reduceRight)(n,r))},W8=function(t){var n=(0,WQ.traverse)(t);return function(t,r){return(0,Uc.pipe)(t,n(r))}},W6=function(t,n,r){return(0,Uc.pipe)(t,(0,WQ.bimap)(n,r))},W7=function(t,n){return(0,Uc.pipe)(t,(0,WQ.mapLeft)(n))},Be=function(t,n){return(0,Uc.pipe)(t,(0,WQ.alt)(n))},Bt=function(t,n){return(0,Uc.pipe)(t,(0,WQ.extend)(n))},Bn=function(t,n){return(0,UA.tailRec)(n(t),function(t){return(0,WQ.isLeft)(t)?(0,WQ.right)((0,WQ.left)(t.left)):(0,WQ.isLeft)(t.right)?(0,WQ.left)(n(t.right.left)):(0,WQ.right)((0,WQ.right)(t.right.right))})},WQ.URI="Either",Br=function(t,n){return{show:function(r){return(0,WQ.isLeft)(r)?"left(".concat(t.show(r.left),")"):"right(".concat(n.show(r.right),")")}}},WQ.getShow=Br,Bi=function(t,n){return{equals:function(r,i){return r===i||((0,WQ.isLeft)(r)?(0,WQ.isLeft)(i)&&t.equals(r.left,i.left):(0,WQ.isRight)(i)&&n.equals(r.right,i.right))}}},WQ.getEq=Bi,Bo=function(t){return{concat:function(n,r){return(0,WQ.isLeft)(r)?n:(0,WQ.isLeft)(n)?r:(0,WQ.right)(t.concat(n.right,r.right))}}},WQ.getSemigroup=Bo,Ba=function(t){var n=(0,WQ.left)(t.empty);return{URI:WQ.URI,_E:void 0,compact:function(t){return(0,WQ.isLeft)(t)?t:"None"===t.right._tag?n:(0,WQ.right)(t.right.value)},separate:function(t){return(0,WQ.isLeft)(t)?(0,U1.separated)(t,t):(0,WQ.isLeft)(t.right)?(0,U1.separated)((0,WQ.right)(t.right.left),n):(0,U1.separated)(n,(0,WQ.right)(t.right.right))}}},WQ.getCompactable=Ba,Bu=function(t){var n=(0,WQ.left)(t.empty),r=(0,WQ.getCompactable)(t),i=r.compact,o=r.separate,a=function(t,r){return(0,WQ.isLeft)(t)||r(t.right)?t:n},u=function(t,r){return(0,WQ.isLeft)(t)?(0,U1.separated)(t,t):r(t.right)?(0,U1.separated)(n,(0,WQ.right)(t.right)):(0,U1.separated)((0,WQ.right)(t.right),n)};return{URI:WQ.URI,_E:void 0,map:W1,compact:i,separate:o,filter:a,filterMap:function(t,r){if((0,WQ.isLeft)(t))return t;var i=r(t.right);return"None"===i._tag?n:(0,WQ.right)(i.value)},partition:u,partitionMap:function(t,r){if((0,WQ.isLeft)(t))return(0,U1.separated)(t,t);var i=r(t.right);return(0,WQ.isLeft)(i)?(0,U1.separated)((0,WQ.right)(i.left),n):(0,U1.separated)(n,(0,WQ.right)(i.right))}}},WQ.getFilterable=Bu,Bs=function(t){var n=(0,WQ.getFilterable)(t),r=(0,WQ.getCompactable)(t);return{URI:WQ.URI,_E:void 0,map:W1,compact:n.compact,separate:n.separate,filter:n.filter,filterMap:n.filterMap,partition:n.partition,partitionMap:n.partitionMap,traverse:W8,sequence:WQ.sequence,reduce:W3,foldMap:W5,reduceRight:W9,wither:(0,U2.witherDefault)(WQ.Traversable,r),wilt:(0,U2.wiltDefault)(WQ.Traversable,r)}},WQ.getWitherable=Bs,Bc=function(t){return{URI:WQ.URI,_E:void 0,map:W1,ap:function(n,r){return(0,WQ.isLeft)(n)?(0,WQ.isLeft)(r)?(0,WQ.left)(t.concat(n.left,r.left)):n:(0,WQ.isLeft)(r)?r:(0,WQ.right)(n.right(r.right))},of:WQ.of}},WQ.getApplicativeValidation=Bc,Bl=function(t){return{URI:WQ.URI,_E:void 0,map:W1,alt:function(n,r){if((0,WQ.isRight)(n))return n;var i=r();return(0,WQ.isLeft)(i)?(0,WQ.left)(t.concat(n.left,i.left)):i}}},WQ.getAltValidation=Bl,Bf=function(t){return function(n){return(0,WQ.isLeft)(n)?n:(0,WQ.right)(t(n.right))}},WQ.map=Bf,WQ.Functor={URI:WQ.URI,map:W1},WQ.of=WQ.right,WQ.Pointed={URI:WQ.URI,of:WQ.of},Bd=function(t){return function(n){return(0,WQ.isLeft)(n)?n:(0,WQ.isLeft)(t)?t:(0,WQ.right)(n.right(t.right))}},WQ.apW=Bd,WQ.ap=WQ.apW,WQ.Apply={URI:WQ.URI,map:W1,ap:W2},WQ.Applicative={URI:WQ.URI,map:W1,ap:W2,of:WQ.of},Bp=function(t){return function(n){return(0,WQ.isLeft)(n)?n:t(n.right)}},WQ.chainW=Bp,WQ.chain=WQ.chainW,WQ.Chain={URI:WQ.URI,map:W1,ap:W2,chain:W4},WQ.Monad={URI:WQ.URI,map:W1,ap:W2,of:WQ.of,chain:W4},Bh=function(t,n){return function(r){return(0,WQ.isLeft)(r)?t:n(t,r.right)}},WQ.reduce=Bh,Bm=function(t){return function(n){return function(r){return(0,WQ.isLeft)(r)?t.empty:n(r.right)}}},WQ.foldMap=Bm,Bg=function(t,n){return function(r){return(0,WQ.isLeft)(r)?t:n(r.right,t)}},WQ.reduceRight=Bg,WQ.Foldable={URI:WQ.URI,reduce:W3,foldMap:W5,reduceRight:W9},By=function(t){return function(n){return function(r){return(0,WQ.isLeft)(r)?t.of((0,WQ.left)(r.left)):t.map(n(r.right),WQ.right)}}},WQ.traverse=By,Bv=function(t){return function(n){return(0,WQ.isLeft)(n)?t.of((0,WQ.left)(n.left)):t.map(n.right,WQ.right)}},WQ.sequence=Bv,WQ.Traversable={URI:WQ.URI,map:W1,reduce:W3,foldMap:W5,reduceRight:W9,traverse:W8,sequence:WQ.sequence},Bb=function(t,n){return function(r){return(0,WQ.isLeft)(r)?(0,WQ.left)(t(r.left)):(0,WQ.right)(n(r.right))}},WQ.bimap=Bb,Bx=function(t){return function(n){return(0,WQ.isLeft)(n)?(0,WQ.left)(t(n.left)):n}},WQ.mapLeft=Bx,WQ.Bifunctor={URI:WQ.URI,bimap:W6,mapLeft:W7},BM=function(t){return function(n){return(0,WQ.isLeft)(n)?t():n}},WQ.altW=BM,WQ.alt=WQ.altW,WQ.Alt={URI:WQ.URI,map:W1,alt:Be},BT=function(t){return function(n){return(0,WQ.isLeft)(n)?n:(0,WQ.right)(t(n))}},WQ.extend=BT,WQ.Extend={URI:WQ.URI,map:W1,extend:Bt},WQ.ChainRec={URI:WQ.URI,map:W1,ap:W2,chain:W4,chainRec:Bn},WQ.throwError=WQ.left,WQ.MonadThrow={URI:WQ.URI,map:W1,ap:W2,of:WQ.of,chain:W4,throwError:WQ.throwError},WQ.FromEither={URI:WQ.URI,fromEither:Uc.identity},WQ.fromPredicate=(0,UP.fromPredicate)(WQ.FromEither),WQ.fromOption=(0,UP.fromOption)(WQ.FromEither),WQ.isLeft=W0.isLeft,WQ.isRight=W0.isRight,BS=function(t,n){return function(r){return(0,WQ.isLeft)(r)?t(r.left):n(r.right)}},WQ.matchW=BS,WQ.foldW=WQ.matchW,WQ.match=WQ.matchW,WQ.fold=WQ.match,Bw=function(t){return function(n){return(0,WQ.isLeft)(n)?t(n.left):n.right}},WQ.getOrElseW=Bw,WQ.getOrElse=WQ.getOrElseW,WQ.flap=(0,UE.flap)(WQ.Functor),WQ.apFirst=(0,Us.apFirst)(WQ.Apply),WQ.apFirstW=WQ.apFirst,WQ.apSecond=(0,Us.apSecond)(WQ.Apply),WQ.apSecondW=WQ.apSecond,WQ.chainFirst=(0,UD.chainFirst)(WQ.Chain),WQ.chainFirstW=WQ.chainFirst,WQ.flattenW=(0,WQ.chainW)(Uc.identity),WQ.flatten=WQ.flattenW,WQ.duplicate=(0,WQ.extend)(Uc.identity),WQ.fromOptionK=(0,UP.fromOptionK)(WQ.FromEither),WQ.chainOptionK=(0,UP.chainOptionK)(WQ.FromEither,WQ.Chain),WQ.filterOrElse=(0,UP.filterOrElse)(WQ.FromEither,WQ.Chain),WQ.filterOrElseW=WQ.filterOrElse,B_=function(t){return(0,WQ.isLeft)(t)?(0,WQ.right)(t.left):(0,WQ.left)(t.right)},WQ.swap=B_,BI=function(t){return function(n){return(0,WQ.isLeft)(n)?t(n.left):n}},WQ.orElseW=BI,WQ.orElse=WQ.orElseW,BO=function(t){return function(n){return null==n?(0,WQ.left)(t):(0,WQ.right)(n)}},WQ.fromNullable=BO,Bk=function(t,n){try{return(0,WQ.right)(t())}catch(r){return(0,WQ.left)(n(r))}},WQ.tryCatch=Bk,BC=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(0,WQ.tryCatch)(function(){return t.apply(void 0,r)},n)}},WQ.tryCatchK=BC,BN=function(t){var n=(0,WQ.fromNullable)(t);return function(t){return(0,Uc.flow)(t,n)}},WQ.fromNullableK=BN,Bj=function(t){var n=(0,WQ.fromNullableK)(t);return function(t){return(0,WQ.chain)(n(t))}},WQ.chainNullableK=Bj,WQ.toUnion=(0,WQ.foldW)(Uc.identity,Uc.identity),WQ.toError=function(t){return t instanceof Error?t:Error(String(t))},WQ.elem=function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!(0,WQ.isLeft)(i)&&n.equals(r,i.right)}},BE=function(t){return function(n){return!(0,WQ.isLeft)(n)&&t(n.right)}},WQ.exists=BE,WQ.Do=(0,WQ.of)(W0.emptyRecord),WQ.bindTo=(0,UE.bindTo)(WQ.Functor),WQ.bind=(0,UD.bind)(WQ.Chain),WQ.bindW=WQ.bind,WQ.apS=(0,Us.apS)(WQ.Apply),WQ.apSW=WQ.apS,WQ.ApT=(0,WQ.of)(W0.emptyReadonlyArray),BR=function(t){return function(n){var r=t(0,W0.head(n));if((0,WQ.isLeft)(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o]);if((0,WQ.isLeft)(a))return a;i.push(a.right)}return(0,WQ.right)(i)}},WQ.traverseReadonlyNonEmptyArrayWithIndex=BR,BD=function(t){var n=(0,WQ.traverseReadonlyNonEmptyArrayWithIndex)(t);return function(t){return W0.isNonEmpty(t)?n(t):WQ.ApT}},WQ.traverseReadonlyArrayWithIndex=BD,WQ.traverseArrayWithIndex=WQ.traverseReadonlyArrayWithIndex,BA=function(t){return(0,WQ.traverseReadonlyArrayWithIndex)(function(n,r){return t(r)})},WQ.traverseArray=BA,WQ.sequenceArray=(0,WQ.traverseArray)(Uc.identity),WQ.parseJSON=function(t,n){return(0,WQ.tryCatch)(function(){return JSON.parse(t)},n)},BL=function(t,n){return(0,WQ.tryCatch)(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},n)},WQ.stringifyJSON=BL,WQ.either={URI:WQ.URI,map:W1,of:WQ.of,ap:W2,chain:W4,reduce:W3,foldMap:W5,reduceRight:W9,traverse:W8,sequence:WQ.sequence,bimap:W6,mapLeft:W7,alt:Be,extend:Bt,chainRec:Bn,throwError:WQ.throwError},WQ.getApplySemigroup=(0,Us.getApplySemigroup)(WQ.Apply),WQ.getApplyMonoid=(0,Uu.getApplicativeMonoid)(WQ.Applicative),BP=function(t,n){return(0,Us.getApplySemigroup)((0,WQ.getApplicativeValidation)(t))(n)},WQ.getValidationSemigroup=BP,BF=function(t,n){return(0,Uu.getApplicativeMonoid)((0,WQ.getApplicativeValidation)(t))(n)},WQ.getValidationMonoid=BF,WQ.getValidation=function(t){var n=(0,WQ.getApplicativeValidation)(t).ap,r=(0,WQ.getAltValidation)(t).alt;return{URI:WQ.URI,_E:void 0,map:W1,of:WQ.of,chain:W4,bimap:W6,mapLeft:W7,reduce:W3,foldMap:W5,reduceRight:W9,extend:Bt,traverse:W8,sequence:WQ.sequence,chainRec:Bn,throwError:WQ.throwError,ap:n,alt:r}};var U8=globalThis&&globalThis.__extends||(Bz=function(t,n){return(Bz=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])})(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}Bz(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),U6=globalThis&&globalThis.__assign||function(){return(U6=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},U7=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},We=function(t,n,r){return nK([{value:t,context:n,message:r}])},Wt=function(){function t(t,n,r,i){this.name=t,this.is=n,this.validate=r,this.encode=i,this.decode=this.decode.bind(this)}return t.prototype.pipe=function(n,r){var i=this;return void 0===r&&(r="pipe(".concat(this.name,", ").concat(n.name,")")),new t(r,n.is,function(t,r){var o=i.validate(t,r);return m_(o)?o:n.validate(o.right,r)},this.encode===Wn&&n.encode===Wn?Wn:function(t){return i.encode(n.encode(t))})},t.prototype.asDecoder=function(){return this},t.prototype.asEncoder=function(){return this},t.prototype.decode=function(t){return this.validate(t,[{key:"",type:this,actual:t}])},t}(),Wn=function(t){return t};function Wr(t){return t.displayName||t.name||"<function".concat(t.length,">")}function Wi(t,n,r,i){for(var o=t.length,a=Array(o+1),u=0;u<o;u++)a[u]=t[u];return a[o]={key:n,type:r,actual:i},a}function Wo(t,n){for(var r=n.length,i=0;i<r;i++)t.push(n[i])}var Wa=Object.prototype.hasOwnProperty;function Wu(t){return Object.keys(t).map(function(n){return"".concat(n,": ").concat(t[n].name)}).join(", ")}function Ws(t){for(var n=0;n<t.length;n++)if(t[n].encode!==Wn)return!1;return!0}function Wc(t){return"{ ".concat(Wu(t)," }")}function Wl(t){return"Partial<".concat(t,">")}function Wf(t){if(Wb(t)){var n,r,i=t.value;if(WD.is(i))return(n={})[i]=null,n}else{if(r=t,"KeyofType"===r._tag)return t.keys;if(WM(t)){var o=t.types.map(function(t){return Wf(t)});return o.some(Wk.is)?void 0:Object.assign.apply(Object,U7([{}],o,!1))}}}function Wd(t){return"("+t.map(function(t){return t.name}).join(" | ")+")"}function Wp(t,n){for(var r=!0,i=!0,o=!W$.is(t),a=0;a<n.length;a++){var u=n[a];u!==t&&(r=!1),W$.is(u)&&(i=!1)}if(r)return t;if(i)return n[n.length-1];for(var s={},c=0;c<n.length;c++){var u=n[c];for(var l in u)(!Wa.call(s,l)||o||u[l]!==t[l])&&(s[l]=u[l])}return s}function Wh(t,n){for(var r=Object.getOwnPropertyNames(t),i=!1,o={},a=0;a<r.length;a++){var u=r[a];Wa.call(n,u)?o[u]=t[u]:i=!0}return i?o:t}function Wm(t){return t.length>0}var Wg={};function Wy(t,n){for(var r=[],i=0;i<t.length;i++){var o=t[i];-1!==n.indexOf(o)&&r.push(o)}return r}function Wv(t){return"AnyType"===t._tag}function Wb(t){return"LiteralType"===t._tag}function Wx(t){return"InterfaceType"===t._tag}function WM(t){return"UnionType"===t._tag}var WT=[];function WS(t){if(-1!==WT.indexOf(t))return Wg;if(Wx(t)||"StrictType"===(n=t)._tag){var n,r,i,o,a,u=Wg;for(var s in t.props){var c=t.props[s];Wb(c)&&(u===Wg&&(u={}),u[s]=[c.value])}return u}if("ExactType"===t._tag||"RefinementType"===t._tag)return WS(t.type);if("IntersectionType"===t._tag)return t.types.reduce(function(t,n){return function(t,n){if(t===Wg)return n;if(n===Wg)return t;var r=Object.assign({},t);for(var i in n)if(Wa.call(t,i)){var o=Wy(t[i],n[i]);if(Wm(o))r[i]=o;else{r=Wg;break}}else r[i]=n[i];return r}(t,WS(n))},Wg);if(WM(t))return t.types.slice(1).reduce(function(t,n){return function(t,n){if(t===Wg||n===Wg)return Wg;var r=Wg;for(var i in t)Wa.call(n,i)&&0===Wy(t[i],n[i]).length&&(r===Wg&&(r={}),r[i]=t[i].concat(n[i]));return r}(t,WS(n))},WS(t.types[0]));if("RecursiveType"===t._tag){WT.push(t);var l=WS(t.type);return WT.pop(),l}return Wg}function Ww(t){var n=WS(t[0]),r=Object.keys(n),i=t.length;e:for(var o=0;o<r.length;o++){var a=function(r){for(var o=n[r].slice(),a=[n[r]],u=1;u<i;u++){var s=WS(t[u])[r];if(void 0===s||s.some(function(t){return -1!==o.indexOf(t)}))return"continue-keys";o.push.apply(o,s),a.push(s)}return{value:[r,a]}}(r[o]);if("object"==typeof a)return a.value;if("continue-keys"===a)continue e}}var W_=function(t){function n(){var n=t.call(this,"null",function(t){return null===t},function(t,r){return n.is(t)?nY(t):We(t,r)},Wn)||this;return n._tag="NullType",n}return U8(n,t),n}(Wt),WI=new W_,WO=function(t){function n(){var n=t.call(this,"undefined",function(t){return void 0===t},function(t,r){return n.is(t)?nY(t):We(t,r)},Wn)||this;return n._tag="UndefinedType",n}return U8(n,t),n}(Wt),Wk=new WO,WC=function(t){function n(){var n=t.call(this,"void",Wk.is,Wk.validate,Wn)||this;return n._tag="VoidType",n}return U8(n,t),n}(Wt),WN=new WC,Wj=function(t){function n(){var n=t.call(this,"unknown",function(t){return!0},nY,Wn)||this;return n._tag="UnknownType",n}return U8(n,t),n}(Wt),WE=new Wj,WR=function(t){function n(){var n=t.call(this,"string",function(t){return"string"==typeof t},function(t,r){return n.is(t)?nY(t):We(t,r)},Wn)||this;return n._tag="StringType",n}return U8(n,t),n}(Wt),WD=new WR,WA=function(t){function n(){var n=t.call(this,"number",function(t){return"number"==typeof t},function(t,r){return n.is(t)?nY(t):We(t,r)},Wn)||this;return n._tag="NumberType",n}return U8(n,t),n}(Wt),WL=new WA,WP=function(t){function n(){var n=t.call(this,"bigint",function(t){return"bigint"==typeof t},function(t,r){return n.is(t)?nY(t):We(t,r)},Wn)||this;return n._tag="BigIntType",n}return U8(n,t),n}(Wt),WF=new WP,Wz=function(t){function n(){var n=t.call(this,"boolean",function(t){return"boolean"==typeof t},function(t,r){return n.is(t)?nY(t):We(t,r)},Wn)||this;return n._tag="BooleanType",n}return U8(n,t),n}(Wt),WU=new Wz,WW=function(t){function n(){var n=t.call(this,"UnknownArray",Array.isArray,function(t,r){return n.is(t)?nY(t):We(t,r)},Wn)||this;return n._tag="AnyArrayType",n}return U8(n,t),n}(Wt),WB=new WW,WV=function(t){function n(){var n=t.call(this,"UnknownRecord",function(t){var n=Object.prototype.toString.call(t);return"[object Object]"===n||"[object Window]"===n},function(t,r){return n.is(t)?nY(t):We(t,r)},Wn)||this;return n._tag="AnyDictionaryType",n}return U8(n,t),n}(Wt),W$=new WV,WK=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.value=a,u._tag="LiteralType",u}return U8(n,t),n}(Wt);function WY(t,n){void 0===n&&(n=JSON.stringify(t));var r=function(n){return n===t};return new WK(n,r,function(n,i){return r(n)?nY(t):We(n,i)},Wn,t)}var Wq=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.keys=a,u._tag="KeyofType",u}return U8(n,t),n}(Wt),WG=function(t){function n(n,r,i,o,a,u){var s=t.call(this,n,r,i,o)||this;return s.type=a,s.predicate=u,s._tag="RefinementType",s}return U8(n,t),n}(Wt);function WZ(t,n,r){return Vl(t,n,r)}var WQ,WH,WJ,WX,W0,W1,W2,W4,W3,W5,W9,W8,W6,W7,Be,Bt,Bn,Br,Bi,Bo,Ba,Bu,Bs,Bc,Bl,Bf,Bd,Bp,Bh,Bm,Bg,By,Bv,Bb,Bx,BM,BT,BS,Bw,B_,BI,BO,Bk,BC,BN,Bj,BE,BR,BD,BA,BL,BP,BF,Bz,BU,BW,BB=Vl(WL,BW=function(t){return Number.isInteger(t)},"Int"),BV=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.runDefinition=a,u._tag="RecursiveType",u}return U8(n,t),n}(Wt);function B$(t,n){var r,i=function(){return r||((r=n(o)).name=t),r},o=new BV(t,function(t){return i().is(t)},function(t,n){return i().validate(t,n)},function(t){return i().encode(t)},i);return o}Object.defineProperty(BV.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});var BK=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ArrayType",u}return U8(n,t),n}(Wt);function BY(t,n){return void 0===n&&(n="Array<".concat(t.name,">")),new BK(n,function(n){return WB.is(n)&&n.every(t.is)},function(n,r){var i=WB.validate(n,r);if(m_(i))return i;for(var o=i.right,a=o.length,u=o,s=[],c=0;c<a;c++){var l=o[c],f=t.validate(l,Wi(r,String(c),t,l));if(m_(f))Wo(s,f.left);else{var d=f.right;d!==l&&(u===o&&(u=o.slice()),u[c]=d)}}return s.length>0?nK(s):nY(u)},t.encode===Wn?Wn:function(n){return n.map(t.encode)},t)}var Bq=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.props=a,u._tag="InterfaceType",u}return U8(n,t),n}(Wt);function BG(t,n){void 0===n&&(n=Wc(t));var r=Object.keys(t),i=r.map(function(n){return t[n]}),o=r.length;return new Bq(n,function(t){if(W$.is(t)){for(var n=0;n<o;n++){var a=r[n],u=t[a];if(void 0===u&&!Wa.call(t,a)||!i[n].is(u))return!1}return!0}return!1},function(t,n){var a=W$.validate(t,n);if(m_(a))return a;for(var u=a.right,s=u,c=[],l=0;l<o;l++){var f=r[l],d=s[f],p=i[l],h=p.validate(d,Wi(n,f,p,d));if(m_(h))Wo(c,h.left);else{var m=h.right;m===d&&(void 0!==m||Wa.call(s,f))||(s===u&&(s=U6({},u)),s[f]=m)}}return c.length>0?nK(c):nY(s)},Ws(i)?Wn:function(t){for(var n=U6({},t),a=0;a<o;a++){var u=r[a],s=i[a].encode;s!==Wn&&(n[u]=s(t[u]))}return n},t)}var BZ=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.props=a,u._tag="PartialType",u}return U8(n,t),n}(Wt),BQ=function(t){function n(n,r,i,o,a,u){var s=t.call(this,n,r,i,o)||this;return s.domain=a,s.codomain=u,s._tag="DictionaryType",s}return U8(n,t),n}(Wt);function BH(t,n,r){var i,o,a,u,s,c,l,f,d=Wf(t);return d?(i=Object.keys(d),void 0===(u=r)&&(u="{ [K in ".concat(t.name,"]: ").concat(n.name," }")),s=i.length,new BQ(u,function(t){return W$.is(t)&&i.every(function(r){return n.is(t[r])})},function(t,r){var o=W$.validate(t,r);if(m_(o))return o;for(var a=o.right,u={},c=[],l=!1,f=0;f<s;f++){var d=i[f],p=a[d],h=n.validate(p,Wi(r,d,n,p));if(m_(h))Wo(c,h.left);else{var m=h.right;l=l||m!==p,u[d]=m}}return c.length>0?nK(c):nY(l||Object.keys(a).length!==s?u:a)},n.encode===Wn?Wn:function(t){for(var r={},o=0;o<s;o++){var a=i[o];r[a]=n.encode(t[a])}return r},t,n)):(c=t,void 0===(f=r)&&(f="{ [K in ".concat(c.name,"]: ").concat(n.name," }")),new BQ(f,function(t){return W$.is(t)?Object.keys(t).every(function(r){return c.is(r)&&n.is(t[r])}):Wv(n)&&Array.isArray(t)},function(t,r){if(W$.is(t)){for(var i={},o=[],a=Object.keys(t),u=a.length,s=!1,l=0;l<u;l++){var f=a[l],d=t[f],p=c.validate(f,Wi(r,f,c,f));if(m_(p))Wo(o,p.left);else{var h=p.right;s=s||h!==f,f=h;var m=n.validate(d,Wi(r,f,n,d));if(m_(m))Wo(o,m.left);else{var g=m.right;s=s||g!==d,i[f]=g}}}return o.length>0?nK(o):nY(s?i:t)}return Wv(n)&&Array.isArray(t)?nY(t):We(t,r)},c.encode===Wn&&n.encode===Wn?Wn:function(t){for(var r={},i=Object.keys(t),o=i.length,a=0;a<o;a++){var u=i[a];r[String(c.encode(u))]=n.encode(t[u])}return r},c,n))}var BJ=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.types=a,u._tag="UnionType",u}return U8(n,t),n}(Wt);function BX(t,n){void 0===n&&(n=Wd(t));var r=Ww(t);if(void 0===r||!(t.length>0))return new BJ(n,function(n){return t.some(function(t){return t.is(n)})},function(n,r){for(var i=[],o=0;o<t.length;o++){var a=t[o],u=a.validate(n,Wi(r,String(o),a,n));if(!m_(u))return nY(u.right);Wo(i,u.left)}return nK(i)},Ws(t)?Wn:function(r){for(var i=0;i<t.length;i++){var o=t[i];if(o.is(r))return o.encode(r)}throw Error("no codec found to encode value in union type ".concat(n))},t);var i=r[0],o=r[1],a=o.length,u=function(t){for(var n=0;n<a;n++)if(-1!==o[n].indexOf(t))return n};return new Ve(n,function(n){if(W$.is(n)){var r=u(n[i]);return void 0!==r&&t[r].is(n)}return!1},function(n,r){var o=W$.validate(n,r);if(m_(o))return o;var a=o.right,s=u(a[i]);if(void 0===s)return We(n,r);var c=t[s];return c.validate(a,Wi(r,String(s),c,a))},Ws(t)?Wn:function(r){var o=u(r[i]);if(void 0===o)throw Error("no codec found to encode value in union codec ".concat(n));return t[o].encode(r)},t,i)}var B0=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.types=a,u._tag="IntersectionType",u}return U8(n,t),n}(Wt),B1=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.types=a,u._tag="TupleType",u}return U8(n,t),n}(Wt),B2=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyType",u}return U8(n,t),n}(Wt),B4=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyArrayType",u}return U8(n,t),n}(Wt);function B3(t,n){void 0===n&&(n="ReadonlyArray<".concat(t.name,">"));var r=BY(t);return new B4(n,r.is,r.validate,r.encode,t)}var B5=function(t,n){return B8(BG(t),n)},B9=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.type=a,u._tag="ExactType",u}return U8(n,t),n}(Wt);function B8(t,n){void 0===n&&(n=Wx(i=t)?"{| ".concat(Wu(i.props)," |}"):(r=i,"PartialType"===r._tag)?Wl("{| ".concat(Wu(i.props)," |}")):"Exact<".concat(i.name,">"));var r,i,o=function t(n){switch(n._tag){case"RefinementType":case"ReadonlyType":return t(n.type);case"InterfaceType":case"StrictType":case"PartialType":return n.props;case"IntersectionType":return n.types.reduce(function(n,r){return Object.assign(n,t(r))},{})}}(t);return new B9(n,t.is,function(n,r){var i=W$.validate(n,r);if(m_(i))return i;var a=t.validate(n,r);return m_(a)?a:nY(Wh(a.right,o))},function(n){return t.encode(Wh(n,o))},t)}var B6=function(t){function n(){var n=t.call(this,"Function",function(t){return"function"==typeof t},function(t,r){return n.is(t)?nY(t):We(t,r)},Wn)||this;return n._tag="FunctionType",n}return U8(n,t),n}(Wt),B7=new B6,Ve=function(t){function n(n,r,i,o,a,u){var s=t.call(this,n,r,i,o,a)||this;return s.tag=u,s}return U8(n,t),n}(BJ),Vt=function(t,n,r){void 0===r&&(r=Wd(n));var i=BX(n,r);return i instanceof Ve?i:(console.warn("[io-ts] Cannot build a tagged union for ".concat(r,", returning a de-optimized union")),new Ve(r,i.is,i.validate,i.encode,n,t))},Vn=function(t,n){return{value:t,context:n}},Vr=function(t){return[{key:"",type:t}]},Vi=function(t){function n(){var n=t.call(this,"never",function(t){return!1},function(t,n){return We(t,n)},function(){throw Error("cannot encode never")})||this;return n._tag="NeverType",n}return U8(n,t),n}(Wt),Vo=new Vi,Va=function(t){function n(){var n=t.call(this,"any",function(t){return!0},nY,Wn)||this;return n._tag="AnyType",n}return U8(n,t),n}(Wt),Vu=new Va,Vs=function(t){function n(){var n=t.call(this,"object",function(t){return null!==t&&"object"==typeof t},function(t,r){return n.is(t)?nY(t):We(t,r)},Wn)||this;return n._tag="ObjectType",n}return U8(n,t),n}(Wt),Vc=new Vs;function Vl(t,n,r){return void 0===r&&(r="(".concat(t.name," | ").concat(Wr(n),")")),new WG(r,function(r){return t.is(r)&&n(r)},function(r,i){var o=t.validate(r,i);if(m_(o))return o;var a=o.right;return n(a)?nY(a):We(a,i)},t.encode,t,n)}var Vf=Vl(WL,Number.isInteger,"Integer"),Vd=function(t){function n(n,r,i,o,a){var u=t.call(this,n,r,i,o)||this;return u.props=a,u._tag="StrictType",u}return U8(n,t),n}(Wt);function Vp(t){return t}let Vh=Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:WW,AnyDictionaryType:WV,AnyType:Va,Array:WB,ArrayType:BK,BigIntType:WP,BooleanType:Wz,Dictionary:W$,DictionaryType:BQ,ExactType:B9,Function:B7,FunctionType:B6,Int:BB,Integer:Vf,InterfaceType:Bq,IntersectionType:B0,KeyofType:Wq,LiteralType:WK,NeverType:Vi,NullType:W_,NumberType:WA,ObjectType:Vs,PartialType:BZ,ReadonlyArrayType:B4,ReadonlyType:B2,RecursiveType:BV,RefinementType:WG,StrictType:Vd,StringType:WR,TaggedUnionType:Ve,TupleType:B1,Type:Wt,UndefinedType:WO,UnionType:BJ,UnknownArray:WB,UnknownRecord:W$,UnknownType:Wj,VoidType:WC,alias:function(t){return function(){return t}},any:Vu,appendContext:Wi,array:BY,bigint:WF,boolean:WU,brand:WZ,clean:Vp,dictionary:BH,emptyTags:Wg,exact:B8,failure:We,failures:nK,getContextEntry:function(t,n){return{key:t,type:n}},getDefaultContext:Vr,getDomainKeys:Wf,getFunctionName:Wr,getIndex:Ww,getTags:WS,getValidationError:Vn,identity:Wn,interface:BG,intersection:function(t,n){void 0===n&&(n="(".concat(t.map(function(t){return t.name}).join(" & "),")"));var r=t.length;return new B0(n,function(n){return t.every(function(t){return t.is(n)})},0===t.length?nY:function(n,i){for(var o=[],a=[],u=0;u<r;u++){var s=t[u],c=s.validate(n,Wi(i,String(u),s,n));m_(c)?Wo(a,c.left):o.push(c.right)}return a.length>0?nK(a):nY(Wp(n,o))},0===t.length?Wn:function(n){return Wp(n,t.map(function(t){return t.encode(n)}))},t)},keyof:function(t,n){void 0===n&&(n=Object.keys(t).map(function(t){return JSON.stringify(t)}).join(" | "));var r=function(n){return WD.is(n)&&Wa.call(t,n)};return new Wq(n,r,function(t,n){return r(t)?nY(t):We(t,n)},Wn,t)},literal:WY,mergeAll:Wp,never:Vo,null:WI,nullType:WI,number:WL,object:Vc,partial:function(t,n){void 0===n&&(n=Wl(Wc(t)));var r=Object.keys(t),i=r.map(function(n){return t[n]}),o=r.length;return new BZ(n,function(n){if(W$.is(n)){for(var i=0;i<o;i++){var a=r[i],u=n[a];if(void 0!==u&&!t[a].is(u))return!1}return!0}return!1},function(n,i){var a=W$.validate(n,i);if(m_(a))return a;for(var u=a.right,s=u,c=[],l=0;l<o;l++){var f=r[l],d=s[f],p=t[f],h=p.validate(d,Wi(i,f,p,d));if(m_(h))void 0!==d&&Wo(c,h.left);else{var m=h.right;m!==d&&(s===u&&(s=U6({},u)),s[f]=m)}}return c.length>0?nK(c):nY(s)},Ws(i)?Wn:function(t){for(var n=U6({},t),a=0;a<o;a++){var u=r[a],s=t[u];void 0!==s&&(n[u]=i[a].encode(s))}return n},t)},readonly:function(t,n){return void 0===n&&(n="Readonly<".concat(t.name,">")),new B2(n,t.is,t.validate,t.encode,t)},readonlyArray:B3,record:BH,recursion:B$,refinement:Vl,strict:B5,string:WD,success:nY,taggedUnion:Vt,tuple:function(t,n){void 0===n&&(n="[".concat(t.map(function(t){return t.name}).join(", "),"]"));var r=t.length;return new B1(n,function(n){return WB.is(n)&&n.length===r&&t.every(function(t,r){return t.is(n[r])})},function(n,i){var o=WB.validate(n,i);if(m_(o))return o;for(var a=o.right,u=a.length>r?a.slice(0,r):a,s=[],c=0;c<r;c++){var l=a[c],f=t[c],d=f.validate(l,Wi(i,String(c),f,l));if(m_(d))Wo(s,d.left);else{var p=d.right;p!==l&&(u===a&&(u=a.slice()),u[c]=p)}}return s.length>0?nK(s):nY(u)},Ws(t)?Wn:function(n){return t.map(function(t,r){return t.encode(n[r])})},t)},type:BG,undefined:Wk,union:BX,unknown:WE,void:WN,voidType:WN},Symbol.toStringTag,{value:"Module"})),Vm=w(Vh);var Vg={};Object.defineProperty(Vg,"__esModule",{value:!0}),Vg.ContentPath=void 0,Vg.ContentPath={serialize:t=>t.map(t=>t.key).join("::"),current:t=>t[t.length-1],append:(t,n)=>t+"::"+n,make:t=>t.reduce((t,{key:n,type:r})=>n?t.concat({key:n,type:r}):t,[])};var Vy={},Vv={};Object.defineProperty(Vv,"__esModule",{value:!0}),Vv.getAssetOrThrow=void 0;let Vb=t=>n=>{let r=t[n];if(!r)throw Error(`Missing asset with id '${n}'!`);return r};Vv.getAssetOrThrow=Vb;var Vx={};Object.defineProperty(Vx,"__esModule",{value:!0}),Vx.getEmbedOrThrow=void 0;let VM=t=>n=>{let r=t[n];if(!r)throw Error(`Missing embed with url '${n}'`);return r};Vx.getEmbedOrThrow=VM;var VT={},VS={};let Vw=w(nP);function V_(t,n,r){return void 0===r&&(r=t.name),new Wt(r,t.is,t.validate,function(r){return n(t.encode(r))})}let VI=Object.freeze(Object.defineProperty({__proto__:null,mapOutput:V_},Symbol.toStringTag,{value:"Module"}));var VO,Vk,VC,VN=Vl(WD,Vk=function(t){return t.length>0},"NonEmptyString");function Vj(t,n){void 0===n&&(n="NonEmptyArray<"+t.name+">");var r=BY(t);return new Wt(n,function(t){return r.is(t)&&oH(t)},function(t,n){return nD(r.validate(t,n),mc(function(r){var i=o6(r);return pq(i)?We(t,n):nY(i.value)}))},function(t){return r.encode(t)})}function VE(t,n,r){void 0===r&&(r="Set<"+t.name+">");var i=BY(t),o=R4(n),a=RQ(n);return new Wt(r,function(n){return n instanceof Set&&Et(t.is)(n)},function(t,n){return nD(i.validate(t,n),mc(function(r){var i=a(r);return i.size!==r.length?We(t,n):nY(i)}))},function(t){return i.encode(o(t))})}function VR(t,n){return new Wt(t,n,function(t,r){return n(t)?nY(t):We(t,r)},Wn)}var VD=VR("Date",function(t){return t instanceof Date}),VA=globalThis&&globalThis.__spreadArray||function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},VL=function(t,n){return{get:t,reverseGet:n}},VP=function(t){return VW(t.get,nC(t.reverseGet,nw))},VF=function(t){return VJ(nC(t.get,nB),t.reverseGet)},Vz=function(t){return V4(nC(t.get,nB),nC(t.reverseGet,nw))},VU=function(t){return V7(function(n){return function(r){return function(i){return n.map(r(t.get(i)),function(n){return t.reverseGet(n)})}}})},VW=function(t,n){return{get:t,set:n}},VB=function(t){return V4(nC(t.get,nB),t.set)},VV=function(t){return V7(function(n){return function(r){return function(i){return n.map(r(t.get(i)),function(n){return t.set(n)(i)})}}})},V$=function(t){return function(n){return VW(function(r){return t.get(n.get(r))},function(r){return function(i){return n.set(t.set(r)(n.get(i)))(i)}})}},VK=function(t){return function(n){return VJ(nC(n.getOption,py(t.getOption)),nC(t.reverseGet,n.reverseGet))}},VY=function(t){return function(n){return V8(VX(t))(VB(n))}},Vq=function(){return VW(nS,nw)},VG=function(t){return function(n){return VW(function(r){return n.get(r)[t]},function(r){return function(i){var o,a=n.get(i);return r===a[t]?i:n.set(Object.assign({},a,((o={})[t]=r,o)))(i)}})}},VZ=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(n){return VW(function(r){for(var i=n.get(r),o={},a=0;a<t.length;a++){var u=t[a];o[u]=i[u]}return o},function(r){return function(i){for(var o=n.get(i),a=0;a<t.length;a++){var u=t[a];if(r[u]!==o[u])return n.set(Object.assign({},o,r))(i)}return i}})}},VQ=function(t){return function(n){return VW(function(r){return n.get(r)[t]},function(r){return function(i){var o=n.get(i);if(r===o[t])return i;var a=o.slice();return a[t]=r,n.set(a)(i)}})}},VH=function(t){return function(n){var r;return nD(n,V$(({at:r=function(t){return VW(function(n){return NN(t,n)},pG(function(){return NI(t)},function(n){return Nw(t,n)}))}}).at(t)))}},VJ=function(t,n){return{getOption:t,reverseGet:n}},VX=function(t){return V4(t.getOption,function(n){return V1(n)(t)})},V0=function(t){return V7(function(n){return function(r){return function(i){return nD(t.getOption(i),pG(function(){return n.of(i)},function(o){return n.map(r(o),function(n){return V1(n)(t)(i)})}))}}})},V1=function(t){var n;return n=function(){return t},function(t){var r,i,o=(r=t,function(t){return nD(r.getOption(t),pf(function(i){var o=n(i);return o===i?t:r.reverseGet(o)}))});return function(t){return nD(o(t),pZ(function(){return t}))}}},V2=function(t){return VJ(d0(t),nS)},V4=function(t,n){return{getOption:t,set:n}},V3=function(t){return V7(function(n){return function(r){return function(i){return nD(t.getOption(i),pG(function(){return n.of(i)},function(o){return n.map(r(o),function(n){return t.set(n)(i)})}))}}})},V5=function(t){return function(n){return function(r){return nD(n.getOption(r),pf(function(i){var o=t(i);return o===i?r:n.set(o)(r)}))}}},V9=function(t){return function(n){var r=V5(t)(n);return function(t){return nD(r(t),pZ(function(){return t}))}}},V8=function(t){return function(n){return V4(nC(n.getOption,py(t.getOption)),function(r){return V9(t.set(r))(n)})}},V6=function(t,n,r){if(r[t]===n)return r;var i=VA([r[0]],r.slice(1),!0);return i[t]=n,i},V7=function(t){return{modifyF:t}};function $e(t){return function(n){return V7(function(r){return function(i){return n.modifyF(r)(t.modifyF(r)(i))}})}}var $t={URI:"Identity",map:function(t,n){return n(t)},of:nS,ap:function(t,n){return t(n)}},$n=function(t){return{index:t}},$r=nC(VP,V$),$i=function(t){return nC(VB,V8(t))},$o=function(t){return nC(VV,$e(t))},$a=function(t){return function(n){return function(r){var i=n.get(r),o=t(i);return i===o?r:n.set(o)(r)}}},$u=function(t){return VY(VJ(p3,nS))(t)},$s=function(t){var n;return nC(VB,function(n){return nD(n,V8($n(function(t){return V4(function(n){return u9(t,n)},function(n){return function(r){return nD(u9(t,r),pG(function(){return r},function(){return c3(t,n,r)}))}})}).index(t)))})},$c=function(t){var n;return nC(VB,function(n){return nD(n,V8($n(function(t){return V4(function(n){return u9(t,n)},function(n){return function(r){return nD(u9(t,r),pG(function(){return r},function(){return V6(t,n,r)}))}})}).index(t)))})},$l=function(t){var n;return nC(VB,function(n){return nD(n,V8($n(function(t){return V4(function(n){return NN(t,n)},function(n){return function(r){return r[t]===n||pq(NN(t,r))?r:Nw(t,n)(r)}})}).index(t)))})},$f=VY(VJ(nS,nB)),$d=VY(VJ(d2,nY)),$p=VY(VJ(function(t){return m_(t)?nB(t.left):nW},nK)),$h=function(t,n){return function(r){return $m(r,t,n)}},$m=function(t,n,r){return VW(nC(t.get,n),nC(r,t.set))},$g="monocle-ts/Lens",$y={URI:$g,compose:function(t,n){return V$(t)(n)}},$v={URI:$g,compose:$y.compose,id:Vq};let $b=Object.freeze(Object.defineProperty({__proto__:null,Category:$v,Invariant:{URI:$g,imap:$m},Semigroupoid:$y,URI:$g,asOptional:VB,asTraversal:VV,atKey:VH,component:VQ,compose:V$,composeIso:$r,composeLens:V$,composeOptional:$i,composePrism:VY,composeTraversal:$o,filter:function(t){return VY(V2(t))},findFirst:function(t){var n;return $i(V4(su(t),function(n){return function(r){return nD(sa(t)(r),pG(function(){return r},function(t){return c3(t,n,r)}))}}))},findFirstNonEmpty:function(t){var n;return $i(V4(su(t),function(n){return function(r){return nD(sa(t)(r),pG(function(){return r},function(t){return V6(t,n,r)}))}}))},fromNullable:$u,id:Vq,imap:$h,index:$s,indexNonEmpty:$c,key:$l,left:$p,lens:VW,modify:$a,modifyF:function(t){return function(n){return function(r){return function(i){return nD(r.get(i),n,function(n){return t.map(n,function(t){return r.set(t)(i)})})}}}},prop:VG,props:VZ,right:$d,some:$f,traverse:function(t){var n,r;return nC(VV,$e(V7(function(n){var r,i="Identity"===n.URI?t.map:t.traverse(n);return function(t){return function(n){return i(n,t)}}})))}},Symbol.toStringTag,{value:"Module"}));var $x=function(t){return function(n){return n.modifyF($t)(t)}},$M=function(t){return new $O(t.get,t.reverseGet)},$T=function(t){return new $k(t.get,t.set)},$S=function(t){return new $C(t.getOption,t.reverseGet)},$w=function(t){return new $j(t.getOption,t.set)},$_=function(t){return new $E(t.modifyF)},$I=function(t,n,r){var i;return r===t[n]?t:Object.assign({},t,((i={})[n]=r,i))},$O=function(){function t(t,n){this.get=t,this.reverseGet=n,this._tag="Iso",this.unwrap=this.get,this.to=this.get,this.wrap=this.reverseGet,this.from=this.reverseGet}return t.prototype.reverse=function(){var t;return $M(VL(this.reverseGet,this.get))},t.prototype.modify=function(t){var n,r;return r=this,function(n){return r.reverseGet(t(r.get(n)))}},t.prototype.asLens=function(){return $T(VP(this))},t.prototype.asPrism=function(){return $S(VF(this))},t.prototype.asOptional=function(){return $w(Vz(this))},t.prototype.asTraversal=function(){return $_(VU(this))},t.prototype.asFold=function(){var t=this;return new $D(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.asGetter=function(){var t=this;return new $R(function(n){return t.get(n)})},t.prototype.asSetter=function(){var t=this;return new $A(function(n){return t.modify(n)})},t.prototype.compose=function(t){var n,r;return $M((r=this,VL(nC(r.get,t.get),nC(t.reverseGet,r.reverseGet))))},t.prototype.composeIso=function(t){return this.compose(t)},t.prototype.composeLens=function(t){return $T(nD(this,VP,V$(t)))},t.prototype.composePrism=function(t){return $S(nD(this,VF,VK(t)))},t.prototype.composeOptional=function(t){return $w(nD(this,Vz,V8(t)))},t.prototype.composeTraversal=function(t){return $_(nD(this,VU,$e(t)))},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeGetter=function(t){return this.asGetter().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t}(),$k=function(){function t(t,n){this.get=t,this.set=n,this._tag="Lens"}return t.fromPath=function(){var n=t.fromProp();return function(t){var r=n(t[0]);return t.slice(1).reduce(function(t,r){return t.compose(n(r))},r)}},t.fromProp=function(){return function(t){return $T(nD(Vq(),VG(t)))}},t.fromProps=function(){return function(t){return $T(nD(Vq(),VZ.apply($b,t)))}},t.fromNullableProp=function(){return function(n,r){return new t(function(t){var i=p3(t[n]);return pq(i)?r:i.value},function(t){return function(r){return $I(r,n,t)}})}},t.prototype.modify=function(t){return $a(t)(this)},t.prototype.asOptional=function(){return $w(VB(this))},t.prototype.asTraversal=function(){return $_(VV(this))},t.prototype.asSetter=function(){var t=this;return new $A(function(n){return t.modify(n)})},t.prototype.asGetter=function(){var t=this;return new $R(function(n){return t.get(n)})},t.prototype.asFold=function(){var t=this;return new $D(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.compose=function(t){return $T(V$(t)(this))},t.prototype.composeLens=function(t){return this.compose(t)},t.prototype.composeGetter=function(t){return this.asGetter().compose(t)},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeOptional=function(t){return $w(nD(this,VB,V8(t)))},t.prototype.composeTraversal=function(t){return $_(nD(this,VV,$e(t)))},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeIso=function(t){return $T(nD(this,V$(nD(t,VP))))},t.prototype.composePrism=function(t){return $w(VY(t)(this))},t}(),$C=function(){function t(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return t.fromPredicate=function(t){return $S(V2(t))},t.some=function(){return $N},t.prototype.modify=function(t){var n=this;return function(r){var i=n.modifyOption(t)(r);return pq(i)?r:i.value}},t.prototype.modifyOption=function(t){var n=this;return function(r){return hf.map(n.getOption(r),function(i){var o=t(i);return o===i?r:n.reverseGet(o)})}},t.prototype.set=function(t){return this.modify(function(){return t})},t.prototype.asOptional=function(){return $w(VX(this))},t.prototype.asTraversal=function(){return $_(V0(this))},t.prototype.asSetter=function(){var t=this;return new $A(function(n){return t.modify(n)})},t.prototype.asFold=function(){var t=this;return new $D(function(n){return function(r){return function(i){var o=t.getOption(i);return pq(o)?n.empty:r(o.value)}}})},t.prototype.compose=function(t){return $S(VK(t)(this))},t.prototype.composePrism=function(t){return this.compose(t)},t.prototype.composeOptional=function(t){return $w(nD(this,VX,V8(t)))},t.prototype.composeTraversal=function(t){return $_(nD(this,V0,$e(t)))},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeIso=function(t){return $S(nD(this,VK(nD(t,VF))))},t.prototype.composeLens=function(t){var n;return $w((n=t,function(t){return V8(VB(n))(VX(t))})(this))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),$N=new $C(nS,nB),$j=function(){function t(t,n){this.getOption=t,this.set=n,this._tag="Optional"}return t.fromPath=function(){var n=t.fromNullableProp();return function(t){var r=n(t[0]);return t.slice(1).reduce(function(t,r){return t.compose(n(r))},r)}},t.fromNullableProp=function(){return function(n){return new t(function(t){return p3(t[n])},function(t){return function(r){return null==r[n]?r:$I(r,n,t)}})}},t.fromOptionProp=function(){var t=$k.fromProp();return function(n){return t(n).composePrism($N)}},t.prototype.modify=function(t){return V9(t)(this)},t.prototype.modifyOption=function(t){return V5(t)(this)},t.prototype.asTraversal=function(){return $_(V3(this))},t.prototype.asFold=function(){var t=this;return new $D(function(n){return function(r){return function(i){var o=t.getOption(i);return pq(o)?n.empty:r(o.value)}}})},t.prototype.asSetter=function(){var t=this;return new $A(function(n){return t.modify(n)})},t.prototype.compose=function(t){return $w(V8(t)(this))},t.prototype.composeOptional=function(t){return this.compose(t)},t.prototype.composeTraversal=function(t){return $_(nD(this,V3,$e(t)))},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeLens=function(t){return $w(nD(this,V8(nD(t,VB))))},t.prototype.composePrism=function(t){return $w(nD(this,V8(nD(t,VX))))},t.prototype.composeIso=function(t){return $w(nD(this,V8(nD(t,Vz))))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),$E=function(){function t(t){this.modifyF=t,this._tag="Traversal"}return t.prototype.modify=function(t){return $x(t)(this)},t.prototype.set=function(t){var n;return $x(function(){return t})(this)},t.prototype.filter=function(t){var n;return $_($e(V0(V2(t)))(this))},t.prototype.asFold=function(){var t=this;return new $D(function(n){return function(r){return t.modifyF(hI(n))(function(t){return nS(r(t))})}})},t.prototype.asSetter=function(){var t=this;return new $A(function(n){return t.modify(n)})},t.prototype.compose=function(t){return $_($e(t)(this))},t.prototype.composeTraversal=function(t){return this.compose(t)},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeOptional=function(t){return this.compose(t.asTraversal())},t.prototype.composeLens=function(t){return $_(nD(this,$e(nD(t,VV))))},t.prototype.composePrism=function(t){return $_(nD(this,$e(nD(t,V0))))},t.prototype.composeIso=function(t){return $_(nD(this,$e(nD(t,VU))))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),$R=function(){function t(t){this.get=t,this._tag="Getter"}return t.prototype.asFold=function(){var t=this;return new $D(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.compose=function(n){var r=this;return new t(function(t){return n.get(r.get(t))})},t.prototype.composeGetter=function(t){return this.compose(t)},t.prototype.composeFold=function(t){return this.asFold().compose(t)},t.prototype.composeLens=function(t){return this.compose(t.asGetter())},t.prototype.composeIso=function(t){return this.compose(t.asGetter())},t.prototype.composeTraversal=function(t){return this.asFold().compose(t.asFold())},t.prototype.composeOptional=function(t){return this.asFold().compose(t.asFold())},t.prototype.composePrism=function(t){return this.asFold().compose(t.asFold())},t}(),$D=function(){function t(t){this.foldMap=t,this._tag="Fold",this.getAll=t(f$())(ah),this.exist=t(S1),this.all=t(S0),this.foldMapFirst=t(hh())}return t.prototype.compose=function(n){var r=this;return new t(function(t){return function(i){return r.foldMap(t)(n.foldMap(t)(i))}})},t.prototype.composeFold=function(t){return this.compose(t)},t.prototype.composeGetter=function(t){return this.compose(t.asFold())},t.prototype.composeTraversal=function(t){return this.compose(t.asFold())},t.prototype.composeOptional=function(t){return this.compose(t.asFold())},t.prototype.composeLens=function(t){return this.compose(t.asFold())},t.prototype.composePrism=function(t){return this.compose(t.asFold())},t.prototype.composeIso=function(t){return this.compose(t.asFold())},t.prototype.find=function(t){return this.foldMapFirst(d0(t))},t.prototype.headOption=function(t){return this.find(function(){return!0})(t)},t}(),$A=function(){function t(t){this.modify=t,this._tag="Setter"}return t.prototype.set=function(t){return this.modify(nw(t))},t.prototype.compose=function(n){var r=this;return new t(function(t){return r.modify(n.modify(t))})},t.prototype.composeSetter=function(t){return this.compose(t)},t.prototype.composeTraversal=function(t){return this.compose(t.asSetter())},t.prototype.composeOptional=function(t){return this.compose(t.asSetter())},t.prototype.composeLens=function(t){return this.compose(t.asSetter())},t.prototype.composePrism=function(t){return this.compose(t.asSetter())},t.prototype.composeIso=function(t){return this.compose(t.asSetter())},t}(),$L=new $O(nS,nS),$P=B5({_tag:WY("None")}),$F=WY("Some");function $z(t,n){return void 0===n&&(n="Option<"+t.name+">"),BX([$P,B5({_tag:$F,value:t},"Some<"+t.name+">")],n)}var $U=new Wt("DateFromISOString",function(t){return t instanceof Date},function(t,n){return nD(WD.validate(t,n),mc(function(r){var i=new Date(r);return isNaN(i.getTime())?We(t,n):nY(i)}))},function(t){return t.toISOString()});function $W(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n}var $B=new Wt("DateFromNumber",function(t){return t instanceof Date},function(t,n){return nD(WL.validate(t,n),mc(function(r){var i=new Date(r);return isNaN(i.getTime())?We(t,n):nY(i)}))},function(t){return t.getTime()});function $V(t,n,r){void 0===r&&(r=t.name);var i=$W(t);return i.validate=n,i.decode=function(t){return n(t,Vr(i))},i.name=r,i}var $$,$K,$Y,$q=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,$G=Vl(WD,$K=function(t){return $q.test(t)},"UUID"),$Z=new Wt("BooleanFromString",WU.is,function(t,n){return nD(WD.validate(t,n),mc(function(r){return"true"===r?nY(!0):"false"===r?nY(!1):We(t,n)}))},String);function $Q(t){switch(t._tag){case"InterfaceType":return t.props;case"ExactType":return $Q(t.type)}}var $H=$k.fromProp(),$J=VR("RegExp",function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}),$X=new Wt("DateFromUnixTime",function(t){return t instanceof Date},function(t,n){return nD(BB.validate(t,n),mc(function(r){var i=new Date(1e3*r);return isNaN(i.getTime())?We(t,n):nY(i)}))},function(t){return Math.floor(t.getTime()/1e3)}),$0=new Wt("NumberFromString",WL.is,function(t,n){return nD(WD.validate(t,n),mc(function(r){var i=+r;return isNaN(i)||""===r.trim()?We(t,n):nY(i)}))},String),$1=new Wt("IntFromString",BB.is,function(t,n){return nD($0.validate(t,n),mc(function(r){return BB.is(r)?nY(r):We(t,n)}))},$0.encode),$2=B$("JsonArray",function(){return B3($3)}),$4=B$("JsonRecord",function(){return BH(WD,$3)}),$3=BX([WU,WL,WD,WI,$2,$4],"Json"),$5=new Wt("JsonFromString",$3.is,function(t,n){try{return nY(JSON.parse(t))}catch{return We(t,n)}},function(t){return JSON.stringify(t)}),$9=WY("Left"),$8=WY("Right"),$6=new Wt("BigIntFromString",function(t){return"bigint"==typeof t},function(t,n){return nD(WD.validate(t,n),mc(function(r){if(!VN.is(r.trim()))return We(t,n);try{return nY(BigInt(r))}catch{return We(t,n)}}))},String),$7=new Wt("BooleanFromNumber",WU.is,function(t,n){return nD(WL.validate(t,n),mt(function(t){return 0!==t}))},Number);let Ke=Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:$6,BooleanFromNumber:$7,BooleanFromString:$Z,DateFromISOString:$U,DateFromNumber:$B,DateFromUnixTime:$X,IntFromString:$1,Json:$3,JsonArray:$2,JsonFromString:$5,JsonRecord:$4,NonEmptyString:VN,NumberFromString:$0,UUID:$G,clone:$W,date:VD,either:function(t,n,r){return void 0===r&&(r="Either<"+t.name+", "+n.name+">"),BX([B5({_tag:$9,left:t},"Left<"+t.name+">"),B5({_tag:$8,right:n},"Right<"+t.name+">")],r)},fromNewtype:function(t,n){return void 0===n&&(n="fromNewtype("+t.name+")"),new Wt(n,function(n){return t.is(n)},function(n,r){return nD(t.validate(n,r),mt($L.wrap))},function(n){return t.encode($L.unwrap(n))})},fromNullable:function(t,n,r){return void 0===r&&(r="fromNullable("+t.name+")"),$V(t,function(r,i){return null==r?nY(n):t.validate(r,i)},r)},fromRefinement:VR,getLenses:function(t){var n={};for(var r in $Q(t))n[r]=$H(r);return n},mapOutput:V_,nonEmptyArray:Vj,option:$z,optionFromNullable:function(t,n){return void 0===n&&(n="Option<"+t.name+">"),new Wt(n,$z(t).is,function(n,r){return null==n?nY(nW):nD(t.validate(n,r),mt(nB))},function(n){return p7(nD(n,pf(t.encode)))})},readonlyNonEmptyArray:function(t,n){return void 0===n&&(n="ReadonlyNonEmptyArray<"+t.name+">"),Vj(t,n)},readonlySetFromArray:function(t,n,r){return void 0===r&&(r="ReadonlySet<"+t.name+">"),VE(t,n,r)},regexp:$J,setFromArray:VE,withEncode:function(t,n,r){return void 0===r&&(r=t.name),new Wt(r,t.is,t.validate,n)},withFallback:function(t,n,r){return void 0===r&&(r="withFallback("+t.name+")"),$V(t,function(r,i){return mz(function(){return nY(n)})(t.validate(r,i))},r)},withMessage:function(t,n){return $V(t,function(r,i){return mv(function(){return[{value:r,context:i,message:n(r,i),actual:r}]})(t.validate(r,i))})},withValidate:$V},Symbol.toStringTag,{value:"Module"})),Kt=w(Ke),Kn=w(VI);Object.defineProperty(VS,"__esModule",{value:!0}),VS.withCustomError=VS.addType=VS.isEmpty=VS.objectToMap=VS.grouped=VS.formatDate=VS.formatDateTime=VS.filterDouble=VS.refineType=VS.nullable=void 0;let Kr=nd,Ki=(0,Kr.__importStar)(Vm);VS.nullable=function(t){return Ki.union([t,Ki.null,Ki.undefined])},VS.refineType=function(t,n,r){return new Ki.Type(n,t.is,(n,i)=>(0,Vw.pipe)(t.validate(n,i),Uo.either.chain(t=>r(t)?Ki.success(t):Ki.failure(n,i))),t.encode)},VS.filterDouble=function(t){if(""===t)return null;let n=Number(t);return Number.isNaN(n)?null:n},VS.formatDateTime=function(t){return t.toISOString().replace(/\.\d{3}Z$/,"+0000")},VS.formatDate=function(t){return t.toISOString().replace(/T.*/,"")},VS.grouped=function(t,n){return t.reduce((t,r,i)=>(i%n==0?t.push([r]):t[Math.floor(i/n)].push(r),t),[])},VS.objectToMap=function(t){return new Map(Object.entries(t))},VS.isEmpty=function(t){for(let n in t)return!1;return!0},VS.addType=function(t,n){return(0,Kn.mapOutput)(t,t=>({...t,__TYPE__:n}))},VS.withCustomError=function(t,n){return(0,Kt.withValidate)(t,(r,i)=>Uo.either.mapLeft(t=>t.find(t=>t.message)?t:[{value:r,context:i,message:n(r,i),actual:r}])(t.validate(r,i)))},Object.defineProperty(VT,"__esModule",{value:!0}),VT.WidgetKey=void 0;let Ko=nd,Ka=(0,Ko.__importStar)(Vm),Ku=RegExp("^[^<>]+$");VT.WidgetKey=(0,VS.refineType)(Ka.string,"WidgetKey",t=>0===t.length||Ku.test(t)),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nd;(0,n.__exportStar)(Vv,t),(0,n.__exportStar)(Vx,t),(0,n.__exportStar)(VT,t)}(Vy);var Ks={},Kc={},Kl={},Kf={},Kd={};Object.defineProperty(Kd,"__esModule",{value:!0}),Kd.clone=void 0,Kd.clone=function(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n};var Kp=S&&S.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[r]}})}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),Kh=S&&S.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Km=S&&S.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&Kp(n,t,r);return Kh(n,t),n};Object.defineProperty(Kf,"__esModule",{value:!0}),Kf.withValidate=void 0;var Kg=Km(Vm);Kf.withValidate=function(t,n,r){void 0===r&&(r=t.name);var i=Kd.clone(t);return i.validate=n,i.decode=function(t){return n(t,Kg.getDefaultContext(i))},i.name=r,i};var Ky=S&&S.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[r]}})}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),Kv=S&&S.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Kb=S&&S.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&Ky(n,t,r);return Kv(n,t),n};Object.defineProperty(Kl,"__esModule",{value:!0}),Kl.withFallback=void 0;var Kx=Kb(Vm);Kl.withFallback=function(t,n,r){return void 0===r&&(r="withFallback("+t.name+")"),Kf.withValidate(t,function(r,i){return Ua.orElse(function(){return Kx.success(n)})(t.validate(r,i))},r)};var KM={},KT={};Object.defineProperty(KT,"__esModule",{value:!0}),KT.EmptyArray=KT.EmptyObject=KT.Boolean=KT.NumberOrNull=KT.Number=KT.StringOrNull=KT.String=void 0;let KS=nd,Kw=(0,KS.__importStar)(Vm);KT.String=(0,VS.withCustomError)(Kw.string,()=>"The value must be a string"),KT.StringOrNull=(0,VS.withCustomError)(Kw.union([Kw.string,Kw.null]),()=>"The value must be a string or null"),KT.Number=(0,VS.withCustomError)(Kw.number,()=>"The value must be a number"),KT.NumberOrNull=(0,VS.withCustomError)(Kw.union([Kw.number,Kw.null]),()=>"The value must be a number or null"),KT.Boolean=(0,VS.withCustomError)(Kw.boolean,()=>"The value must be a boolean"),KT.EmptyObject=Kw.UnknownRecord.pipe(new Kw.Type("emptyObject",t=>Kw.UnknownRecord.is(t),(t,n)=>Object.keys(t).length>0?Kw.failure(t,n,"The object is not empty."):Kw.success({}),Kw.identity)),KT.EmptyArray=new Kw.Type("emptyArray",t=>Kw.UnknownArray.is(t)&&0===t.length,(t,n)=>(0,Uc.pipe)(Kw.UnknownArray.decode(t),Uo.either.chain(r=>r.length>0?Kw.failure(t,n,"The array is not empty."):Kw.success([]))),()=>[]);var K_={};let KI=w(m8);var KO={};Object.defineProperty(KO,"__esModule",{value:!0});let Kk=nd,KC=(0,Kk.__importStar)(Vm);KO.default=new KC.Type("dateFromStringOrNumber",t=>t instanceof Date,(t,n)=>(0,Vw.pipe)(KC.union([KC.number,KC.string]).validate(t,n),(0,KI.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?KC.failure(t,n):KC.success(i)})),t=>t);var KN={};Object.defineProperty(KN,"__esModule",{value:!0});let Kj=nd,KE=(0,Kj.__importStar)(Vm);KN.default=new KE.Type("dateFromTsMs",t=>t instanceof Date,(t,n)=>(0,Vw.pipe)(KE.number.validate(t,n),(0,KI.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?KE.failure(t,n):KE.success(i)})),t=>t.getTime());var KR={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyArrayOrElse=t.EmptyObjectOrElse=t.NullOrElse=t.DefaultOrElse=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=t=>n=>new r.Type(`DefaultOrElse<${t.name}, ${n.name}>`,t=>null===t||n.is(t),(i,o)=>(0,Ua.isRight)(t.validate(i,o))?r.success(null):n.validate(i,o),t=>t?n.encode(t):void 0);t.DefaultOrElse=i;let o=n=>(0,t.DefaultOrElse)(r.null)(n);t.NullOrElse=o;let a=n=>(0,t.DefaultOrElse)(KT.EmptyObject)(n);t.EmptyObjectOrElse=a;let u=n=>(0,t.DefaultOrElse)(KT.EmptyArray)(n);t.EmptyArrayOrElse=u}(KR);var KD={};Object.defineProperty(KD,"__esModule",{value:!0});let KA=nd,KL=(0,KA.__importStar)(Vm);KD.default=new KL.Type("IntFromNumber",KL.Int.is,(t,n)=>(0,Vw.pipe)(KL.number.validate(t,n),(0,KI.chain)(t=>KL.Int.is(t)?KL.success(t):KL.success(Math.round(t)))),KL.Int.encode);var KP={};Object.defineProperty(KP,"__esModule",{value:!0});let KF=nd,Kz=(0,KF.__importStar)(Vm),KU=/^([0-9]+)px$/;KP.default=new Kz.Type("IntFromPixels",Kz.Int.is,(t,n)=>(0,Vw.pipe)(Kz.string.validate(t,n),(0,KI.chain)(r=>{try{let i=r.match(KU);if(!i)return Kz.failure(t,n);let o=parseInt(i[1]);return Kz.success(o)}catch{return Kz.failure(t,n)}})),String);var KW={};Object.defineProperty(KW,"__esModule",{value:!0});let KB=nd,KV=(0,KB.__importStar)(Vm);KW.default=(0,VS.withCustomError)((0,VS.refineType)(KV.string,"nonEmptyString",t=>t.trim().length>0),()=>"The value must be a non-empty string");var K$={},KK={};Object.defineProperty(KK,"__esModule",{value:!0});let KY=nd,Kq=(0,KY.__importStar)(Vm);KK.default=(0,VS.nullable)(Kq.string),Object.defineProperty(K$,"__esModule",{value:!0});let KG=nd,KZ=(0,KG.__importDefault)(KK);K$.default=new Vm.Type("nonEmptyStringOrNull",t=>"string"==typeof t||null===t,(t,n)=>(0,Vw.pipe)(KZ.default.validate(t,n),(0,KI.chain)(t=>"string"==typeof t&&t.length>0?(0,Vm.success)(t):(0,Vm.success)(null))),t=>t);var KQ={};Object.defineProperty(KQ,"__esModule",{value:!0});let KH=nd,KJ=(0,KH.__importStar)(Vm);KQ.default=(0,VS.nullable)(KJ.number);var KX={};Object.defineProperty(KX,"__esModule",{value:!0});let K0=nd,K1=(0,K0.__importStar)(Vm);KX.default=(t,n,r)=>KT.Number.pipe(new K1.Type("numberInRange",t=>KT.Number.is(t),(i,o)=>i>n||i<t?K1.failure(i,o,`${r} must be a number between ${t} and ${n}`):K1.success(i),K1.identity));var K2={};Object.defineProperty(K2,"__esModule",{value:!0});let K4=nd,K3=(0,K4.__importStar)(Vm);K2.default=new K3.Type("StringFromInt",K3.string.is,(t,n)=>(0,Vw.pipe)(K3.boolean.validate(t,n),(0,KI.chain)(t=>K3.success(t.toString()))),t=>t);var K5={};Object.defineProperty(K5,"__esModule",{value:!0});let K9=nd,K8=(0,K9.__importStar)(Vm);function K6(){return qT||(qT=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.StringOrNull=t.StringFromNumber=t.StringFromBoolean=t.NumberRange=t.NumberOrNull=t.NonEmptyStringOrNull=t.NonEmptyString=t.IntFromPixels=t.IntFromNumber=t.Function=t.DateFromTsMs=t.DateFromStringOrNumber=t.DateFromString=void 0;let n=nd;(0,n.__exportStar)(KT,t);var r=function(){if(qM)return K_;qM=1,Object.defineProperty(K_,"__esModule",{value:!0});let t=nd,n=(0,t.__importStar)(Vm),r=K6();return K_.default=new n.Type("dateFromString",t=>t instanceof Date,(t,i)=>(0,Vw.pipe)(r.String.validate(t,i),(0,KI.chain)(r=>{let o=new Date(r);return isNaN(o.getTime())?n.failure(t,i):n.success(o)})),t=>t.toISOString()),K_}();Object.defineProperty(t,"DateFromString",{enumerable:!0,get:function(){return(0,n.__importDefault)(r).default}}),Object.defineProperty(t,"DateFromStringOrNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(KO).default}}),Object.defineProperty(t,"DateFromTsMs",{enumerable:!0,get:function(){return(0,n.__importDefault)(KN).default}}),(0,n.__exportStar)(KR,t),t.Function=(0,n.__importStar)(VS),Object.defineProperty(t,"IntFromNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(KD).default}}),Object.defineProperty(t,"IntFromPixels",{enumerable:!0,get:function(){return(0,n.__importDefault)(KP).default}}),Object.defineProperty(t,"NonEmptyString",{enumerable:!0,get:function(){return(0,n.__importDefault)(KW).default}}),Object.defineProperty(t,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(K$).default}}),Object.defineProperty(t,"NumberOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(KQ).default}}),Object.defineProperty(t,"NumberRange",{enumerable:!0,get:function(){return(0,n.__importDefault)(KX).default}}),Object.defineProperty(t,"StringFromBoolean",{enumerable:!0,get:function(){return(0,n.__importDefault)(K2).default}}),Object.defineProperty(t,"StringFromNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(K5).default}}),Object.defineProperty(t,"StringOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(KK).default}})}(KM)),KM}K5.default=new K8.Type("StringFromInt",K8.string.is,(t,n)=>(0,Vw.pipe)(K8.number.validate(t,n),(0,KI.chain)(t=>K8.success(t.toString()))),t=>t);var K7={},Ye={},Yt={},Yn={},Yr={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanField=t.BooleanConfig=t.BooleanFieldType=void 0;let n=(0,nd.__importStar)(Vm),r=K6();t.BooleanFieldType="Boolean",t.BooleanConfig=n.exact(n.partial({label:r.StringOrNull,default_value:n.boolean,placeholder_true:n.string,placeholder_false:n.string})),t.BooleanField=n.exact(n.intersection([n.type({type:n.literal(t.BooleanFieldType)}),n.partial({config:t.BooleanConfig})]))}(Yr);var Yi={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Color=t.ColorConfig=t.ColorFieldType=void 0;let n=(0,nd.__importStar)(Vm),r=K6();t.ColorFieldType="Color",t.ColorConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string})),t.Color=n.exact(n.intersection([n.type({type:n.literal(t.ColorFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.ColorConfig})]))}(Yi);var Yo={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Date=t.DateConfig=t.DateFieldType=void 0;let n=(0,nd.__importStar)(Vm),r=K6();t.DateFieldType="Date",t.DateConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),t.Date=n.exact(n.intersection([n.type({type:n.literal(t.DateFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.DateConfig})]))}(Yo);var Ya={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Embed=t.EmbedConfig=t.EmbedFieldType=void 0;let n=(0,nd.__importStar)(Vm),r=K6();t.EmbedFieldType="Embed",t.EmbedConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,useAsTitle:n.boolean})),t.Embed=n.exact(n.intersection([n.type({type:n.literal(t.EmbedFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.EmbedConfig})]))}(Ya);var Yu={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPoint=t.GeoPointConfig=t.GeoPointFieldType=void 0;let n=(0,nd.__importStar)(Vm),r=K6();t.GeoPointFieldType="GeoPoint",t.GeoPointConfig=n.exact(n.partial({label:r.StringOrNull})),t.GeoPoint=n.exact(n.intersection([n.type({type:n.literal(t.GeoPointFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.GeoPointConfig})]))}(Yu);var Ys={},Yc={},Yl={},Yf={},Yd={};Object.defineProperty(Yd,"__esModule",{value:!0}),Yd.pipe=Yd.pipeable=void 0,Yd.pipeable=function(t){var n,r,i,o,a,u,s,c,l,f,d,p,h,m,g,y={};if("function"==typeof t.map){var v=function(n){return function(r){return t.map(r,n)}};y.map=v}if("function"==typeof t.contramap){var b=function(n){return function(r){return t.contramap(r,n)}};y.contramap=b}if("function"==typeof t.mapWithIndex){var x=function(n){return function(r){return t.mapWithIndex(r,n)}};y.mapWithIndex=x}if("function"==typeof t.ap){var M=function(n){return function(r){return t.ap(r,n)}},T=function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}};y.ap=M,y.apFirst=T,y.apSecond=function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}if("function"==typeof t.chain){var S=function(n){return function(r){return t.chain(r,n)}},w=function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}},_=function(n){return t.chain(n,Uc.identity)};y.chain=S,y.chainFirst=w,y.flatten=_}if("function"==typeof t.bimap){var I=function(n,r){return function(i){return t.bimap(i,n,r)}},O=function(n){return function(r){return t.mapLeft(r,n)}};y.bimap=I,y.mapLeft=O}if("function"==typeof t.extend){var k=function(n){return function(r){return t.extend(r,n)}},C=function(n){return t.extend(n,Uc.identity)};y.extend=k,y.duplicate=C}if("function"==typeof t.reduce){var N=function(n,r){return function(i){return t.reduce(i,n,r)}},j=function(n){var r=t.foldMap(n);return function(t){return function(n){return r(n,t)}}},E=function(n,r){return function(i){return t.reduceRight(i,n,r)}};y.reduce=N,y.foldMap=j,y.reduceRight=E}if("function"==typeof t.reduceWithIndex){var R=function(n,r){return function(i){return t.reduceWithIndex(i,n,r)}},D=function(n){var r=t.foldMapWithIndex(n);return function(t){return function(n){return r(n,t)}}},A=function(n,r){return function(i){return t.reduceRightWithIndex(i,n,r)}};y.reduceWithIndex=R,y.foldMapWithIndex=D,y.reduceRightWithIndex=A}if("function"==typeof t.alt){var L=function(n){return function(r){return t.alt(r,n)}};y.alt=L}if("function"==typeof t.compact&&(y.compact=t.compact,y.separate=t.separate),"function"==typeof t.filter){var P=function(n){return function(r){return t.filter(r,n)}},F=function(n){return function(r){return t.filterMap(r,n)}},z=function(n){return function(r){return t.partition(r,n)}},U=function(n){return function(r){return t.partitionMap(r,n)}};y.filter=P,y.filterMap=F,y.partition=z,y.partitionMap=U}if("function"==typeof t.filterWithIndex){var W=function(n){return function(r){return t.filterWithIndex(r,n)}},B=function(n){return function(r){return t.filterMapWithIndex(r,n)}},V=function(n){return function(r){return t.partitionWithIndex(r,n)}},$=function(n){return function(r){return t.partitionMapWithIndex(r,n)}};y.filterWithIndex=W,y.filterMapWithIndex=B,y.partitionWithIndex=V,y.partitionMapWithIndex=$}if("function"==typeof t.promap){var K=function(n,r){return function(i){return t.promap(i,n,r)}};y.promap=K}if("function"==typeof t.compose){var Y=function(n){return function(r){return t.compose(r,n)}};y.compose=Y}if("function"==typeof t.throwError){var q=function(n){return function(r){return"None"===r._tag?t.throwError(n()):t.of(r.value)}},G=function(n){return"Left"===n._tag?t.throwError(n.left):t.of(n.right)},Z=function(n,r){return function(i){return n(i)?t.of(i):t.throwError(r(i))}},Q=function(n,r){return function(i){return t.chain(i,function(i){return n(i)?t.of(i):t.throwError(r(i))})}};y.fromOption=q,y.fromEither=G,y.fromPredicate=Z,y.filterOrElse=Q}return y},Yd.pipe=Uc.pipe;var Yp=S&&S.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[r]}})}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),Yh=S&&S.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Ym=S&&S.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&Yp(n,t,r);return Yh(n,t),n};Object.defineProperty(Yf,"__esModule",{value:!0}),Yf.NumberFromString=void 0;var Yg=Ym(Vm);Yf.NumberFromString=new Yg.Type("NumberFromString",Yg.number.is,function(t,n){return Yd.pipe(Yg.string.validate(t,n),Ua.chain(function(r){var i=+r;return isNaN(i)||""===r.trim()?Yg.failure(t,n):Yg.success(i)}))},String);var Yy=S&&S.__createBinding||(Object.create?function(t,n,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return n[r]}})}:function(t,n,r,i){void 0===i&&(i=r),t[i]=n[r]}),Yv=S&&S.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Yb=S&&S.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&Yy(n,t,r);return Yv(n,t),n};Object.defineProperty(Yl,"__esModule",{value:!0}),Yl.IntFromString=void 0;var Yx=Yb(Vm);Yl.IntFromString=new Yx.Type("IntFromString",Yx.Int.is,function(t,n){return Yd.pipe(Yf.NumberFromString.validate(t,n),Ua.chain(function(r){return Yx.Int.is(r)?Yx.success(r):Yx.failure(t,n)}))},Yf.NumberFromString.encode),Object.defineProperty(Yc,"__esModule",{value:!0});let YM=nd,YT=(0,YM.__importStar)(Vm),YS=K6(),Yw=new YT.Type("SideConstraints",t=>!t||"number"==typeof t,(t,n)=>Ua.either.chain(YT.union([YT.literal("auto"),YT.literal(""),YT.Int,Yl.IntFromString,YS.IntFromNumber,YS.IntFromPixels,YT.null]).validate(t,n),t=>"auto"===t||""===t?YT.success(null):YT.success(t)),t=>t),Y_=YT.partial({width:Yw,height:Yw});Yc.default=Y_,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Image=t.ImageConfig=t.Thumbnail=t.ImageFieldType=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=K6(),o=(0,n.__importDefault)(Yc);t.ImageFieldType="Image",t.Thumbnail=r.exact(r.intersection([r.type({name:r.string}),o.default])),t.ImageConfig=r.exact(r.partial({label:i.StringOrNull,placeholder:r.string,constraint:o.default,thumbnails:r.readonlyArray(t.Thumbnail)})),t.Image=r.exact(r.intersection([r.type({type:r.literal(t.ImageFieldType)}),r.partial({fieldset:i.StringOrNull,config:t.ImageConfig})]))}(Ys);var YI={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationField=t.IntegrationFieldConfig=t.IntegrationFieldType=void 0;let n=(0,nd.__importStar)(Vm),r=K6();t.IntegrationFieldType="IntegrationFields",t.IntegrationFieldConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,catalog:n.string})),t.IntegrationField=n.exact(n.intersection([n.type({type:n.literal(t.IntegrationFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.IntegrationFieldConfig})]))}(YI);var YO={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Link=t.LinkConfig=t.LinkFieldType=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=K6(),o=t=>{if(t instanceof Array&&t.reduce((t,n)=>t&&"string"==typeof n,!0))return r.success(t)},a=t=>{if("string"==typeof t)return r.success([t])},u=new r.Type("MasksArrayString",t=>t instanceof Array,(t,n)=>Ua.either.chain(r.union([r.array(r.string),r.string]).validate(t,n),i=>o(i)||a(i)||r.failure(t,n)),t=>t);t.LinkFieldType="Link",t.LinkConfig=r.exact(r.partial({label:i.StringOrNull,useAsTitle:r.boolean,placeholder:r.string,select:(0,Kl.withFallback)(r.union([r.literal("media"),r.literal("document"),r.literal("web"),r.null]),null),customtypes:r.readonlyArray(r.string),masks:u,tags:u,allowTargetBlank:r.boolean})),t.Link=r.exact(r.intersection([r.type({type:r.literal(t.LinkFieldType)}),r.partial({fieldset:i.StringOrNull,config:t.LinkConfig})]))}(YO);var Yk={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Number=t.NumberConfig=t.NumberFieldType=void 0;let n=(0,nd.__importStar)(Vm),r=K6();t.NumberFieldType="Number",t.NumberConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,min:n.union([n.number,Yf.NumberFromString]),max:n.union([n.number,Yf.NumberFromString]),step:n.union([n.number,Yf.NumberFromString])})),t.Number=n.exact(n.intersection([n.type({type:n.literal(t.NumberFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.NumberConfig})]))}(Yk);var YC={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Range=t.RangeConfig=t.RangeFieldType=void 0;let n=(0,nd.__importStar)(Vm),r=K6();t.RangeFieldType="Range",t.RangeConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,min:n.union([n.number,Yf.NumberFromString]),max:n.union([n.number,Yf.NumberFromString]),step:n.union([n.number,Yf.NumberFromString])})),t.Range=n.exact(n.intersection([n.type({type:n.literal(t.RangeFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.RangeConfig})]))}(YC);var YN={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RichText=t.RichTextConfig=t.RichTextNodeTypeCodec=t.RichTextNodeType=t.DEFAULT_OPTION=t.RichTextFieldType=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=K6(),o=(0,n.__importDefault)(Yc);t.RichTextFieldType="StructuredText",t.DEFAULT_OPTION="paragraph",t.RichTextNodeType={heading1:"heading1",heading2:"heading2",heading3:"heading3",heading4:"heading4",heading5:"heading5",heading6:"heading6",paragraph:"paragraph",strong:"strong",em:"em",preformatted:"preformatted",hyperlink:"hyperlink",image:"image",embed:"embed",list:"list-item",orderedList:"o-list-item",rtl:"rtl"},t.RichTextNodeTypeCodec=r.keyof({[t.RichTextNodeType.heading1]:null,[t.RichTextNodeType.heading2]:null,[t.RichTextNodeType.heading3]:null,[t.RichTextNodeType.heading4]:null,[t.RichTextNodeType.heading5]:null,[t.RichTextNodeType.heading6]:null,[t.RichTextNodeType.paragraph]:null,[t.RichTextNodeType.strong]:null,[t.RichTextNodeType.em]:null,[t.RichTextNodeType.preformatted]:null,[t.RichTextNodeType.hyperlink]:null,[t.RichTextNodeType.image]:null,[t.RichTextNodeType.embed]:null,[t.RichTextNodeType.list]:null,[t.RichTextNodeType.orderedList]:null,[t.RichTextNodeType.rtl]:null});let a=new r.Type("RichTextOptions",t=>"string"==typeof t,n=>(0,Uc.pipe)(r.union([r.string,r.null]).decode(n),Uo.either.map(n=>{if(!n)return t.DEFAULT_OPTION;let r=n.split(",").map(t=>t.trim()).filter(n=>(0,Ua.getOrElseW)(()=>{})(t.RichTextNodeTypeCodec.decode(n)));return r.length?r.join(","):t.DEFAULT_OPTION})),t=>t),u=t=>{if(!t)return r.success([])},s=t=>{if(t instanceof Object){if(!Object.entries(t).length)return r.success([]);if(t[""])return r.success(t[""].map(t=>t.name));let n=Object.entries(t).reduce((t,[,n])=>t.concat(n.map(t=>t.name)),[]).filter(Boolean);return r.success(n)}},c=t=>{if(t instanceof Array&&t.reduce((t,n)=>t&&"string"==typeof n,!0))return r.success(t)},l=t=>{if("string"==typeof t)return r.success([t])},f=new r.Type("RichTextLabels",t=>t instanceof Array,(t,n)=>{let i=r.record(r.string,r.readonlyArray(r.record(r.literal("name"),r.string))),o=r.readonlyArray(r.string);return(0,Uc.pipe)(r.union([i,o,r.string,r.null]).decode(t),Uo.either.chain(i=>u(i)||c(i)||s(i)||l(i)||r.failure(t,n)))},t=>t);t.RichTextConfig=r.exact(r.partial({label:i.StringOrNull,placeholder:r.string,useAsTitle:r.boolean,single:a,multi:a,imageConstraint:o.default,labels:f,allowTargetBlank:r.boolean})),t.RichText=r.exact(r.intersection([r.type({type:r.literal(t.RichTextFieldType)}),r.partial({fieldset:i.StringOrNull,config:t.RichTextConfig})]))}(YN);var Yj={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Select=t.SelectConfig=t.SelectFieldType=void 0;let n=(0,nd.__importStar)(Vm),r=K6();t.SelectFieldType="Select",t.SelectConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default_value:n.string,options:n.readonlyArray(n.union([n.string,r.StringFromNumber,r.StringFromBoolean]))})),t.Select=n.exact(n.intersection([n.type({type:n.literal(t.SelectFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.SelectConfig})]))}(Yj);var YE={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Separator=t.SeparatorConfig=t.SeparatorFieldType=void 0;let n=(0,nd.__importStar)(Vm),r=K6();t.SeparatorFieldType="Separator",t.SeparatorConfig=n.exact(n.partial({label:r.StringOrNull})),t.Separator=n.exact(n.intersection([n.type({type:n.literal(t.SeparatorFieldType)}),n.partial({config:t.SeparatorConfig})]))}(YE);var YR={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Text=t.TextConfig=t.TextFieldType=void 0;let n=(0,nd.__importStar)(Vm),r=K6();t.TextFieldType="Text",t.TextConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),t.Text=n.exact(n.intersection([n.type({type:n.literal(t.TextFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.TextConfig})]))}(YR);var YD={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Timestamp=t.TimestampConfig=t.TimestampFieldType=void 0;let n=(0,nd.__importStar)(Vm),r=K6();t.TimestampFieldType="Timestamp",t.TimestampConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),t.Timestamp=n.exact(n.intersection([n.type({type:n.literal(t.TimestampFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.TimestampConfig})]))}(YD),Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.NestableWidget=void 0;let YA=nd,YL=(0,YA.__importStar)(Vm);Yn.NestableWidget=YL.union([Yi.Color,Yr.BooleanField,Ya.Embed,Yu.GeoPoint,Yo.Date,Yk.Number,YC.Range,YN.RichText,Yj.Select,YE.Separator,YR.Text,YD.Timestamp,YO.Link,Ys.Image,YI.IntegrationField]),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Group=t.GroupConfig=t.GroupFieldType=void 0;let n=(0,nd.__importStar)(Vm),r=K6();t.GroupFieldType="Group",t.GroupConfig=n.exact(n.partial({label:r.StringOrNull,repeat:n.boolean,fields:n.record(Vy.WidgetKey,Yn.NestableWidget)})),t.Group=n.exact(n.intersection([n.type({type:n.literal(t.GroupFieldType)}),n.partial({fieldset:r.StringOrNull,icon:n.string,description:n.string,config:t.GroupConfig})]))}(Yt);var YP={};!function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nd;(0,n.__exportStar)(Yr,t),(0,n.__exportStar)(Yi,t),(0,n.__exportStar)(Yo,t),(0,n.__exportStar)(Ya,t),(0,n.__exportStar)(Yu,t),(0,n.__exportStar)(Ys,t),(0,n.__exportStar)(YI,t),(0,n.__exportStar)(YO,t),(0,n.__exportStar)(Yn,t),(0,n.__exportStar)(Yk,t),(0,n.__exportStar)(YC,t),(0,n.__exportStar)(YN,t),(0,n.__exportStar)(Yj,t),(0,n.__exportStar)(YE,t),(0,n.__exportStar)(YR,t),(0,n.__exportStar)(YD,t)}(YP);var YF={},Yz={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isCompositeSlice=t.CompositeSlice=t.CompositeSliceConfig=t.CompositeSliceType=void 0;let n=(0,nd.__importStar)(Vm),r=K6();t.CompositeSliceType="Slice",t.CompositeSliceConfig=n.exact(n.partial({label:r.StringOrNull})),t.CompositeSlice=n.exact(n.intersection([n.type({type:n.literal(t.CompositeSliceType)}),n.partial({fieldset:r.StringOrNull,description:n.string,icon:n.string,display:n.string,"non-repeat":n.record(Vy.WidgetKey,Yn.NestableWidget),repeat:n.record(Vy.WidgetKey,Yn.NestableWidget),config:t.CompositeSliceConfig})])),t.isCompositeSlice=function(t){return"Slice"===t.type}}(Yz);var YU={};Object.defineProperty(YU,"__esModule",{value:!0}),YU.isLegacySlice=YU.LegacySlice=void 0;let YW=nd,YB=(0,YW.__importStar)(Vm);YU.LegacySlice=YB.union([Yn.NestableWidget,Yt.Group]),YU.isLegacySlice=function(t){return"Slice"!==t.type&&"SharedSlice"!==t.type};var YV={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isDynamicSharedSlice=t.isStaticSharedSlice=t.SharedSlice=t.SharedSliceType=t.Variation=void 0;let n=(0,nd.__importStar)(Vm);t.Variation=n.exact(n.intersection([n.type({id:n.string,name:n.string,description:n.string,imageUrl:(0,Kl.withFallback)(n.string,"https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format"),docURL:n.string,version:n.string}),n.partial({display:n.string,primary:n.record(Vy.WidgetKey,Yn.NestableWidget),items:n.record(Vy.WidgetKey,Yn.NestableWidget)})])),t.SharedSliceType="SharedSlice";let r=n.string,i=n.string;t.SharedSlice=n.exact(n.intersection([n.type({id:n.string,type:n.literal(t.SharedSliceType),name:n.string,variations:n.readonlyArray(t.Variation)}),n.partial({description:n.string,legacyPaths:n.record(r,i)})])),t.isStaticSharedSlice=function(t){return"SharedSlice"===t.type},t.isDynamicSharedSlice=function(t){return"SharedSlice"===t.type}}(YV);var Y$={};Object.defineProperty(Y$,"__esModule",{value:!0}),Y$.SharedSliceRef=void 0;let YK=nd,YY=(0,YK.__importStar)(Vm);Y$.SharedSliceRef=YY.exact(YY.type({type:YY.literal(YV.SharedSliceType)})),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Slices=t.DynamicSlices=t.StaticSlices=t.slicesReader=t.DynamicSlicesConfig=t.StaticSlicesConfig=t.slicesConfigReader=t.SlicesLabels=t.SlicesFieldType=t.LegacySlicesFieldType=void 0;let n=(0,nd.__importStar)(Vm),r=K6();function i(i){return n.exact(n.partial({label:r.StringOrNull,labels:t.SlicesLabels,choices:n.record(Vy.WidgetKey,n.union([YU.LegacySlice,Yz.CompositeSlice,i]))}))}t.LegacySlicesFieldType="Choice",t.SlicesFieldType="Slices",t.SlicesLabels=n.union([n.record(n.string,n.readonlyArray(n.exact(n.intersection([n.type({name:n.string}),n.partial({display:n.string})])))),n.null]),t.slicesConfigReader=i,t.StaticSlicesConfig=i(YV.SharedSlice),t.DynamicSlicesConfig=i(Y$.SharedSliceRef);let o={toStatic(t,n){let r=Object.entries(t.choices||{}).reduce((t,[r,i])=>{if("SharedSlice"!==i.type)return{...t,[r]:i};{let o=n.get(r);return o?{...t,[r]:o}:t}},{});return{...t,choices:r}}};function a(i){return n.exact(n.intersection([n.type({type:n.keyof({[t.SlicesFieldType]:null,[t.LegacySlicesFieldType]:null})}),n.partial({fieldset:r.StringOrNull,config:i})]))}t.slicesReader=a,t.StaticSlices=a(t.StaticSlicesConfig),t.DynamicSlices=a(t.DynamicSlicesConfig),t.Slices={toStatic:(t,n)=>t.config?{...t,config:o.toStatic(t.config,n)}:t}}(YF);var Yq={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UID=t.UIDConfig=t.UIDFieldType=void 0;let n=(0,nd.__importStar)(Vm),r=K6();t.UIDFieldType="UID",t.UIDConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),t.UID=n.exact(n.intersection([n.type({type:n.literal(t.UIDFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.UIDConfig})]))}(Yq),Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.Widgets=Ye.FieldType=Ye.DynamicWidget=Ye.StaticWidget=Ye.widgetReader=void 0;let YG=nd,YZ=(0,YG.__importStar)(Vm);function YQ(t){return YZ.union([Yq.UID,Yn.NestableWidget,Yt.Group,t])}Ye.widgetReader=YQ,Ye.StaticWidget=YQ(YF.StaticSlices),Ye.DynamicWidget=YQ(YF.DynamicSlices),Ye.FieldType=YZ.keyof({[YP.ColorFieldType]:null,[YP.BooleanFieldType]:null,[YP.NumberFieldType]:null,[YP.EmbedFieldType]:null,[YP.GeoPointFieldType]:null,[YP.DateFieldType]:null,[YP.RangeFieldType]:null,[YP.RichTextFieldType]:null,[YP.SelectFieldType]:null,[YP.SeparatorFieldType]:null,[YP.TextFieldType]:null,[YP.TimestampFieldType]:null,[YP.LinkFieldType]:null,[YP.ImageFieldType]:null,[YP.IntegrationFieldType]:null,[Yq.UIDFieldType]:null,[Yt.GroupFieldType]:null,[YF.SlicesFieldType]:null,[YF.LegacySlicesFieldType]:null}),Ye.Widgets={toStatic(t,n){switch(t.type){case"Choice":case"Slices":return YF.Slices.toStatic(t,n);default:return t}}},Object.defineProperty(K7,"__esModule",{value:!0}),K7.Sections=K7.DynamicSection=K7.StaticSection=K7.sectionReader=void 0;let YH=nd,YJ=(0,YH.__importStar)(Vm);function YX(t){return YJ.record(Vy.WidgetKey,t)}K7.sectionReader=YX,K7.StaticSection=YX(Ye.StaticWidget),K7.DynamicSection=YX(Ye.DynamicWidget),K7.Sections={toStatic:(t,n)=>Object.entries(t).reduce((t,[r,i])=>({...t,[r]:Ye.Widgets.toStatic(i,n)}),{})},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.collectSharedSlices=t.flattenCustomTypeFields=t.filterMissingSharedSlices=t.collectWidgets=t.validateSlices=t.toStatic=t.flattenSections=t.flattenWidgets=t.CustomType=t.StaticCustomType=t.CustomTypeFormat=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=K6();t.CustomTypeFormat={page:"page",custom:"custom"};class o extends Error{constructor(t){super(),Object.defineProperty(this,"slices",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"message",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.slices=t,this.message=this._formatError(t)}_formatError(t){return`The following slices doesn't exists in your Prismic repository:
|
|
3
|
-
${t.map(t=>` - ${t}`).join(`
|
|
4
|
-
`)}
|
|
5
|
-
`}}function a(n){return r.exact(r.intersection([r.type({id:r.string,label:i.StringOrNull,repeatable:(0,Kl.withFallback)(r.boolean,!0),json:r.record(r.string,n),status:(0,Kl.withFallback)(r.boolean,!0)}),r.partial({hash:r.string,format:(0,Kl.withFallback)(r.keyof(t.CustomTypeFormat),"custom")})]))}function u(t){return Object.entries(t.json).reduce((t,[,n])=>{let r=Object.entries(n);return t.concat(r)},[])}function s(t,n){let r=Object.entries(t.json).reduce((t,[r,i])=>{let o=Object.entries(i).reduce((t,[r,i])=>{let o=n(r,i);return o?{...t,[r]:o}:t},{});return{...t,[r]:o}},{});return{...t,json:r}}t.StaticCustomType=a(K7.StaticSection),t.CustomType=a(K7.DynamicSection),t.flattenWidgets=u,t.flattenSections=function(t){return Object.entries(t.json).reduce((t,[,n])=>{let r=Object.entries(n);return t.concat(r)},[])},t.toStatic=function(t,n){let r=Object.entries(t.json).reduce((t,[r,i])=>({...t,[r]:K7.Sections.toStatic(i,n)}),{});return{...t,json:r}},t.validateSlices=function(t,n){let r=(function(t){var n;let r=u(t).filter(([,t])=>"Slices"===t.type).reduce((t,[,n])=>{let r=Object.entries(n.config&&n.config.choices?n.config.choices:{}).filter(([,t])=>"SharedSlice"===t.type).map(([t])=>t);return t.concat(r)},[]);return function(t){return r.map(t)}})(t)(t=>{if(!n.get(t))return t}).filter(Boolean);return r.length>0?(0,Ua.left)(new o(r)):(0,Ua.right)(t)},t.collectWidgets=s,t.filterMissingSharedSlices=function(t,n){return s(t,(t,r)=>{if("Slices"===r.type){if(!r.config||!r.config.choices)return r;let i=Object.entries(r.config.choices).reduce((t,[r,i])=>"SharedSlice"!==i.type||n.get(r)?{...t,[r]:i}:t,{}),o={...r.config,choices:i};return{...r,config:o}}return r})},t.flattenCustomTypeFields=function(t){return Object.values(t.json).reduce((t,n)=>({...t,...n}),{})},t.collectSharedSlices=function(t){return Object.entries(t.fields).reduce((t,[,n])=>{var r;return"Slices"===n.type||"Choice"===n.type?{...t,...Object.entries((null===(r=n.config)||void 0===r?void 0:r.choices)||{}).reduce((t,[n,r])=>"SharedSlice"===r.type?{...t,[n]:r}:t,{})}:t},{})}}(Kc);var Y0,Y1,Y2={},Y4={};Object.defineProperty(Y0=Y4,"__esModule",{value:!0}),Y0.DiffOperation=void 0,(Y1=Y0.DiffOperation||(Y0.DiffOperation={})).Added="added",Y1.Removed="removed",Y1.Updated="updated";var Y3={},Y5={},Y9={};Object.defineProperty(Y9,"__esModule",{value:!0}),Y9.HexaColor=void 0;let Y8=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;Y9.HexaColor={is:t=>Y8.test(t)};var Y6={};Object.defineProperty(Y6,"__esModule",{value:!0}),Y6.toRecord=void 0,Y6.toRecord=function(t,n){return t.reduce((t,r)=>{let i=n(r);return{...t,[i]:r}},{})};var Y7={};Object.defineProperty(Y7,"__esModule",{value:!0}),Y7.mapValues=Y7.isObject=Y7.withOptionals=Y7.isNotEmpty=Y7.zipObjects=void 0;let qe=nd,qt=(0,qe.__importStar)(Vm);Y7.zipObjects=function(t,n){return[...new Set(Object.keys(t||{}).concat(Object.keys(n||{})))].reduce((r,i)=>{let o=null==t?void 0:t[i],a=null==n?void 0:n[i];return{...r,[i]:{left:o,right:a}}},{})},Y7.isNotEmpty=function(t){return Boolean(Object.keys(t).length)},Y7.withOptionals=function(t,n){return{...t,...n.reduce((t,[n,r])=>r?{...t,[n]:r}:t,{})}};let qn=qt.record(qt.string,qt.unknown);Y7.isObject=function(t){return(0,Ua.isRight)(qn.decode(t))},Y7.mapValues=function(t,n){return Object.entries(t).reduce((t,[r,i])=>({...t,[r]:n(i,r)}),{})},Object.defineProperty(Y5,"__esModule",{value:!0}),Y5.Objects=Y5.Arrays=Y5.HexaColorCode=void 0;let qr=nd;Y5.HexaColorCode=(0,qr.__importStar)(Y9),Y5.Arrays=(0,qr.__importStar)(Y6),Y5.Objects=(0,qr.__importStar)(Y7);var qi={};function qo(t,n){let r=Y5.Objects.zipObjects(t,n),i=Object.entries(r).reduce((t,[n,r])=>{if(JSON.stringify(null==r?void 0:r.left)===JSON.stringify(null==r?void 0:r.right))return t;let i=(()=>{if(!(!(null!=r&&r.left)&&!(null!=r&&r.right)))return null!=r&&r.left&&!r.right?{op:Y4.DiffOperation.Removed}:!(null!=r&&r.left)&&null!=r&&r.right?{op:Y4.DiffOperation.Added,value:r.right}:{op:Y4.DiffOperation.Updated,value:r.right}})();return i?{...t,[n]:i}:t},{});return Y5.Objects.isNotEmpty(i)?i:void 0}Object.defineProperty(qi,"__esModule",{value:!0}),qi.VariationComparator=void 0,qi.VariationComparator={compare(t,n){if(t&&!n)return{op:Y4.DiffOperation.Removed};if(!t&&n)return{op:Y4.DiffOperation.Added,value:n};let r=function(t,n){let r=Y5.Objects.zipObjects(t,n);return Object.entries(r).reduce((t,[n,r])=>"primary"===n||"items"===n||(null==r?void 0:r.left)===(null==r?void 0:r.right)?t:{...t,[n]:null==r?void 0:r.right},{})}(t,n),i=qo(null==t?void 0:t.primary,null==n?void 0:n.primary),o=qo(null==t?void 0:t.items,null==n?void 0:n.items),a={...r,...i?{primary:i}:{},...o?{items:o}:{}};if(Y5.Objects.isNotEmpty(a))return{op:Y4.DiffOperation.Updated,value:a}}},Object.defineProperty(Y3,"__esModule",{value:!0}),Y3.SliceComparator=void 0,Y3.SliceComparator={compare(t,n){if(!t&&n)return{op:Y4.DiffOperation.Added,value:n};if(t&&!n)return{op:Y4.DiffOperation.Removed};let r=function(t,n){let r=Y5.Objects.zipObjects(t,n);return Object.entries(r).reduce((t,[n,r])=>"variations"===n||(null==r?void 0:r.left)===(null==r?void 0:r.right)?t:{...t,[n]:null==r?void 0:r.right},{})}(t,n),i=Y5.Objects.zipObjects(t&&Y5.Arrays.toRecord(t.variations,t=>t.id),n&&Y5.Arrays.toRecord(n.variations,t=>t.id)),o=Object.entries(i).reduce((t,[n,r])=>{if(!r)return t;let i=qi.VariationComparator.compare(r.left,r.right);return i?{...t,[n]:i}:t},{}),a={...r,...Y5.Objects.isNotEmpty(o)?{variations:o}:{}};if(Y5.Objects.isNotEmpty(a))return{op:Y4.DiffOperation.Updated,value:a}}},function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nd;(0,n.__exportStar)(Y4,t),(0,n.__exportStar)(Y3,t),(0,n.__exportStar)(qi,t)}(Y2);var qa,qu,qs={},qc={};qa=qc,qu=S&&S.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Object.defineProperty(qa,"__esModule",{value:!0}),qa.ImageConstraint=void 0,Object.defineProperty(qa,"ImageConstraint",{enumerable:!0,get:function(){return qu(Yc).default}});var ql={},qf={};Object.defineProperty(qf,"__esModule",{value:!0});var qd={};Object.defineProperty(qd,"__esModule",{value:!0}),qd.SlicesTypes=void 0;let qp=nd,qh=(0,qp.__importStar)(Vm);qd.SlicesTypes=qh.keyof({[Yz.CompositeSliceType]:null,[YV.SharedSliceType]:null}),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nd;(0,n.__exportStar)(Yz,t),(0,n.__exportStar)(YU,t),(0,n.__exportStar)(YV,t),(0,n.__exportStar)(Y$,t),(0,n.__exportStar)(qf,t),(0,n.__exportStar)(YF,t),(0,n.__exportStar)(qd,t)}(ql),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nd;(0,n.__exportStar)(Yt,t),(0,n.__exportStar)(YP,t),(0,n.__exportStar)(qc,t),(0,n.__exportStar)(ql,t),(0,n.__exportStar)(Yq,t),(0,n.__exportStar)(Ye,t)}(qs),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nd;(0,n.__exportStar)(Kc,t),(0,n.__exportStar)(Y2,t),(0,n.__exportStar)(K7,t),(0,n.__exportStar)(qs,t)}(Ks);var qm,qg,qy,qv,qb,qx,qM,qT,qS,qw={},q_={},qI={};function qO(){if(qS)return qI;qS=1,Object.defineProperty(qI,"__esModule",{value:!0}),qI.hasContentType=qI.hasFieldContentType=void 0;let t=Ze();function n(t){return"object"==typeof t&&null!==t&&"__TYPE__"in t}return qI.hasFieldContentType=function(r){return n(r)&&r.__TYPE__===t.FieldContentType&&(null==r?void 0:r.type)!==void 0&&"string"==typeof r.type&&(0,Ua.isRight)(t.FieldType.decode(r.type))},qI.hasContentType=n,qI}function qk(){return qD||(qD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyContent=t.EmptyLegacy=t.isEmptyContent=t.EmptyContentType=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=qO();t.EmptyContentType="EmptyContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.EmptyContentType;t.isEmptyContent=o;let a=r.union([r.null,r.type({value:r.null})]),u=n=>new r.Type("EmptyLegacy",t.isEmptyContent,r=>(0,Uc.pipe)(a.decode(r),Uo.either.map(()=>({type:n,__TYPE__:t.EmptyContentType}))),()=>null);t.EmptyLegacy=u,t.EmptyContent=r.strict({type:r.string,__TYPE__:r.literal(t.EmptyContentType)})}(q_)),q_}var qC={},qN={};Object.defineProperty(qN,"__esModule",{value:!0}),qN.defaultCtx=qN.getFieldCtx=qN.LegacyContentCtx=qN.FieldOrSliceType=void 0;let qj=nd,qE=(0,qj.__importStar)(Vm);qN.FieldOrSliceType=qE.union([qs.FieldType,qs.SlicesTypes]);class qR{constructor(t,n,r){Object.defineProperty(this,"fieldKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"prefixedKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"keyOfType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"allTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fieldKey=t,this.fieldPath=n||[],this.allTypes=r||new Map;let i=Array.of(this.fieldPath,[this.fieldKey]).flat().join(".");this.prefixedKey=i,this.keyOfType=`${i}_TYPE`,this.fieldType=this.allTypes.get(this.prefixedKey)}}qN.LegacyContentCtx=qR,qN.getFieldCtx=function(t,n,r){return new qR(t,[...n.fieldPath,n.fieldKey,...r||[]],n.allTypes)},qN.defaultCtx=function(t,n=new Map){return new qR(t,[],n)};var qD,qA,qL={},qP={};function qF(){return qA||(qA=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanContentDefaultValue=t.BooleanContent=t.BooleanLegacy=t.isBooleanContent=t.BooleanContentType=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=qO();t.BooleanContentType="BooleanContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.BooleanContentType;t.isBooleanContent=o;let a=n=>new r.Type("BooleanLegacy",t.isBooleanContent,n=>(0,Uc.pipe)(r.boolean.decode(n),Uo.either.map(n=>t.BooleanContent.encode({value:n,__TYPE__:t.BooleanContentType}))),t=>({content:t.value,types:{[n.keyOfType]:"Boolean"}}));t.BooleanLegacy=a,t.BooleanContent=r.strict({__TYPE__:r.literal(t.BooleanContentType),value:r.boolean});let u=n=>{var r;return(null===(r=n.config)||void 0===r?void 0:r.default_value)!==void 0?{__TYPE__:t.BooleanContentType,value:n.config.default_value||!1}:void 0};t.BooleanContentDefaultValue=u}(qP)),qP}var qz,qU={};function qW(){return qz||(qz=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmbedContent=t.EmbedLegacy=t.EmbedContentLegacy=t.isEmbedContent=t.EmbedContentType=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=K6(),o=qO();t.EmbedContentType="EmbedContent";let a=n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.EmbedContentType;t.isEmbedContent=a,t.EmbedContentLegacy=r.exact(r.intersection([r.type({embed_url:r.string,type:r.string}),r.partial({version:r.union([r.string,r.number,r.null]),title:i.StringOrNull,author_name:i.StringOrNull,author_url:i.StringOrNull,provider_name:i.StringOrNull,provider_url:i.StringOrNull,cache_age:r.union([r.string,r.number,r.null]),thumbnail_url:i.StringOrNull,thumbnail_width:i.NumberOrNull,thumbnail_height:i.NumberOrNull,html:i.StringOrNull})]));let u=n=>new r.Type("EmbedLegacy",t.isEmbedContent,n=>(0,Uc.pipe)(t.EmbedContentLegacy.decode(n),Uo.either.map(r=>({...r,all:n,__TYPE__:t.EmbedContentType}))),t=>({content:t.all,types:{[n.keyOfType]:"Embed"}}));t.EmbedLegacy=u,t.EmbedContent=r.intersection([t.EmbedContentLegacy,r.strict({__TYPE__:r.literal(t.EmbedContentType),all:r.unknown})])}(qU)),qU}var qB={},qV={},q$={};Object.defineProperty(q$,"__esModule",{value:!0});let qK=nd,qY=(0,qK.__importStar)(Vm);q$.default=new qY.Type("TrimmedString",qY.string.is,(t,n)=>(0,Vw.pipe)(qY.string.validate(t,n),(0,KI.chain)(t=>qY.success(function(t){let n=0;for(;n<t.length&&t[n]<=" ";)n++;let r=t.length;for(;n<r&&t[r-1]<=" ";)r--;return t.substring(n,r)}(t)))),t=>t);var qq={};function qG(){return qZ||(qZ=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContent=t.ColorLegacy=t.isColorContent=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=(0,n.__importDefault)(q$),o=qO(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qq.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Color"===t.type;t.isColorContent=a;let u=n=>new r.Type("ColorLegacy",t.isColorContent,n=>(0,Uc.pipe)(i.default.decode(n),Uo.either.map(n=>t.ColorContent.encode({value:n,type:qs.ColorFieldType,__TYPE__:qq.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qs.ColorFieldType}}));t.ColorLegacy=u,t.ColorContent=r.strict({type:r.literal(qs.ColorFieldType),value:i.default,__TYPE__:r.literal(qq.FieldContentType)})}(qV)),qV}Object.defineProperty(qq,"__esModule",{value:!0}),qq.FieldContentType=void 0,qq.FieldContentType="FieldContent";var qZ,qQ,qH={};function qJ(){return qQ||(qQ=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DateContent=t.DateLegacy=t.isDateContent=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=(0,n.__importDefault)(q$),o=qO(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qq.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Date"===t.type;t.isDateContent=a;let u=n=>new r.Type("DateLegacy",t.isDateContent,n=>(0,Uc.pipe)(i.default.decode(n),Uo.either.map(n=>t.DateContent.encode({value:n,type:qs.DateFieldType,__TYPE__:qq.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qs.DateFieldType}}));t.DateLegacy=u,t.DateContent=r.strict({type:r.literal(qs.DateFieldType),value:i.default,__TYPE__:r.literal(qq.FieldContentType)})}(qH)),qH}var qX,q0={};function q1(){return qX||(qX=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NumberContent=t.NumberLegacy=t.isNumberContent=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=(0,n.__importDefault)(q$),o=qO(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qq.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Number"===t.type;t.isNumberContent=a;let u=n=>new r.Type("NumberLegacy",t.isNumberContent,n=>(0,Uc.pipe)(i.default.decode(n),Uo.either.map(n=>t.NumberContent.encode({value:n,type:qs.NumberFieldType,__TYPE__:qq.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qs.NumberFieldType}}));t.NumberLegacy=u,t.NumberContent=r.strict({type:r.literal(qs.NumberFieldType),value:i.default,__TYPE__:r.literal(qq.FieldContentType)})}(q0)),q0}var q2,q4={};function q3(){return q2||(q2=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RangeContent=t.RangeLegacy=t.isRangeContent=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=(0,n.__importDefault)(q$),o=qO(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qq.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Range"===t.type;t.isRangeContent=a;let u=n=>new r.Type("RangeLegacy",t.isRangeContent,n=>(0,Uc.pipe)(i.default.decode(n),Uo.either.map(n=>t.RangeContent.encode({value:n,type:qs.RangeFieldType,__TYPE__:qq.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qs.RangeFieldType}}));t.RangeLegacy=u,t.RangeContent=r.strict({type:r.literal(qs.RangeFieldType),value:i.default,__TYPE__:r.literal(qq.FieldContentType)})}(q4)),q4}var q5,q9={};function q8(){return q5||(q5=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectContentDefaultValue=t.SelectContent=t.SelectLegacy=t.isSelectContent=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=(0,n.__importDefault)(q$),o=qO(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qq.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Select"===t.type;t.isSelectContent=a;let u=n=>new r.Type("SelectLegacy",t.isSelectContent,n=>(0,Uc.pipe)(i.default.decode(n),Uo.either.map(n=>t.SelectContent.encode({value:n,type:qs.SelectFieldType,__TYPE__:qq.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qs.SelectFieldType}}));t.SelectLegacy=u,t.SelectContent=r.strict({type:r.literal(qs.SelectFieldType),value:i.default,__TYPE__:r.literal(qq.FieldContentType)});let s=t=>{var n;return!(null===(n=t.config)||void 0===n)&&n.default_value?{__TYPE__:qq.FieldContentType,type:qs.SelectFieldType,value:t.config.default_value||""}:void 0};t.SelectContentDefaultValue=s}(q9)),q9}var q6,q7={};function Ge(){return q6||(q6=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TextContent=t.TextLegacy=t.isTextContent=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=(0,n.__importDefault)(q$),o=qO(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qq.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Text"===t.type;t.isTextContent=a;let u=n=>new r.Type("TextLegacy",t.isTextContent,n=>(0,Uc.pipe)(i.default.decode(n),Uo.either.map(n=>t.TextContent.encode({value:n,type:qs.TextFieldType,__TYPE__:qq.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qs.TextFieldType}}));t.TextLegacy=u,t.TextContent=r.strict({type:r.literal(qs.TextFieldType),value:i.default,__TYPE__:r.literal(qq.FieldContentType)})}(q7)),q7}var Gt,Gn={};function Gr(){return Gt||(Gt=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TimestampContent=t.TimestampLegacy=t.isTimestampContent=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=(0,n.__importDefault)(q$),o=qO(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===qq.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Timestamp"===t.type;t.isTimestampContent=a;let u=n=>new r.Type("TimestampLegacy",t.isTimestampContent,n=>(0,Uc.pipe)(i.default.decode(n),Uo.either.map(n=>t.TimestampContent.encode({value:n,type:qs.TimestampFieldType,__TYPE__:qq.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qs.TimestampFieldType}}));t.TimestampLegacy=u,t.TimestampContent=r.strict({type:r.literal(qs.TimestampFieldType),value:i.default,__TYPE__:r.literal(qq.FieldContentType)})}(Gn)),Gn}function Gi(){return Go||(Go=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FieldContent=t.FieldType=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=qG(),o=qJ(),a=q1(),u=q3(),s=q8(),c=Ge(),l=Gr();t.FieldType=r.keyof({Text:null,Date:null,Timestamp:null,Color:null,Number:null,Range:null,Select:null}),t.FieldContent=r.union([o.DateContent,i.ColorContent,a.NumberContent,u.RangeContent,s.SelectContent,c.TextContent,l.TimestampContent]),(0,n.__exportStar)(qG(),t),(0,n.__exportStar)(qq,t),(0,n.__exportStar)(qJ(),t),(0,n.__exportStar)(q1(),t),(0,n.__exportStar)(q3(),t),(0,n.__exportStar)(q8(),t),(0,n.__exportStar)(Ge(),t),(0,n.__exportStar)(Gr(),t)}(qB)),qB}var Go,Ga,Gu={};function Gs(){return Ga||(Ga=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPointContent=t.GeoPointLegacy=t.isGeoPointContent=t.GeoPointContentType=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=qO();t.GeoPointContentType="GeoPointContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.GeoPointContentType;t.isGeoPointContent=o;let a=r.strict({position:r.strict({lat:r.number,lng:r.number})}),u=n=>new r.Type("GeoPointLegacy",t.isGeoPointContent,n=>(0,Vw.pipe)(a.decode(n),Uo.either.map(n=>t.GeoPointContent.encode({...n,__TYPE__:t.GeoPointContentType}))),t=>({content:{position:t.position},types:{[n.keyOfType]:"GeoPoint"}}));t.GeoPointLegacy=u,t.GeoPointContent=r.intersection([a,r.strict({__TYPE__:r.literal(t.GeoPointContentType)})])}(Gu)),Gu}var Gc,Gl={};function Gf(){return Gc||(Gc=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageContent=t.ImageLegacy=t.ImageContentView=t.isImageContent=t.ImageContentType=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=K6(),o=qO();t.ImageContentType="ImageContent";let a=n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.ImageContentType;t.isImageContent=a;let u=r.exact(r.type({id:r.string,url:r.string,width:r.number,height:r.number}));t.ImageContentView=r.exact(r.intersection([r.type({origin:u,width:r.number,height:r.number,edit:r.type({zoom:r.number,crop:r.type({x:r.number,y:r.number}),background:r.string})}),r.partial({url:r.string,credits:i.NonEmptyStringOrNull,alt:i.NonEmptyStringOrNull,provider:i.StringOrNull})]));let s=r.intersection([t.ImageContentView,r.partial({thumbnails:r.record(r.string,t.ImageContentView)})]),c=n=>new r.Type("ImageLegacy",t.isImageContent,n=>(0,Uc.pipe)(s.decode(n),Uo.either.map(n=>t.ImageContent.encode({...n,__TYPE__:t.ImageContentType}))),t=>({content:(0,Y7.withOptionals)({edit:t.edit,height:t.height,origin:t.origin,width:t.width},[["alt",t.alt],["credits",t.credits],["provider",t.provider],["thumbnails",t.thumbnails],["url",t.url]]),types:{[n.keyOfType]:"Image"}}));t.ImageLegacy=c,t.ImageContent=r.intersection([s,r.strict({__TYPE__:r.literal(t.ImageContentType)})])}(Gl)),Gl}var Gd,Gp={};function Gh(){return Gd||(Gd=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationFieldContent=t.IntegrationFieldLegacy=t.isIntegrationFieldContent=t.IntegrationFieldContentType=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=qO();t.IntegrationFieldContentType="IntegrationFieldsContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.IntegrationFieldContentType;t.isIntegrationFieldContent=o;let a=n=>new r.Type("IntegrationFieldLegacy",t.isIntegrationFieldContent,n=>(0,Uc.pipe)(r.string.decode(n),Uo.either.map(n=>t.IntegrationFieldContent.encode({value:n,__TYPE__:t.IntegrationFieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:"IntegrationFields"}}));t.IntegrationFieldLegacy=a,t.IntegrationFieldContent=r.strict({__TYPE__:r.literal(t.IntegrationFieldContentType),value:r.string})}(Gp)),Gp}var Gm,Gg={};function Gy(){return Gm||(Gm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LinkContent=t.Link=t.LinkContentLegacy=t.LinkLegacy=t.isLinkContent=t.LinkContentType=t.ExternalLinkContent=t.ExternalLinkType=t.DocumentLinkContent=t.DocumentLinkType=t.FileLinkContent=t.FileLinkType=t.ImageLinkContent=t.ImageLinkType=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=K6(),o=qO();t.ImageLinkType="ImageLink";let a=r.exact(r.intersection([r.type({id:r.string,url:r.string,height:r.string,width:r.string,size:r.string,name:r.string,kind:r.string}),r.partial({date:i.StringOrNull})])),u=new r.Type("ImageLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.ImageLinkType,n=>(0,Uc.pipe)(a.decode(n),Uo.either.map(n=>t.ImageLinkContent.encode({...n,__TYPE__:t.ImageLinkType}))),t=>a.encode(t));t.ImageLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.ImageLinkType)}),a]),t.FileLinkType="FileLink";let s=r.exact(r.intersection([r.type({id:r.string,url:r.string,name:r.string,kind:r.string,size:(0,Kt.withFallback)(r.string,"0")}),r.partial({date:(0,VS.nullable)(r.string)})])),c=new r.Type("FileLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.FileLinkType,n=>(0,Uc.pipe)(s.decode(n),Uo.either.map(n=>t.FileLinkContent.encode({...n,__TYPE__:t.FileLinkType}))),t=>s.encode(t));t.FileLinkContent=r.intersection([s,r.exact(r.intersection([r.type({__TYPE__:r.literal(t.FileLinkType)}),r.partial({size:(0,Kt.withFallback)(r.string,"0")})]))]),t.DocumentLinkType="DocumentLink";let l=r.strict({id:i.NonEmptyString}),f=new r.Type("DocumentLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.DocumentLinkType,n=>(0,Uc.pipe)(l.decode(n),Uo.either.map(n=>t.DocumentLinkContent.encode({...n,__TYPE__:t.DocumentLinkType}))),t=>l.encode(t));t.DocumentLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.DocumentLinkType)}),l]),t.ExternalLinkType="ExternalLink";let d=r.exact(r.intersection([r.type({url:r.string}),r.partial({kind:r.literal("web"),target:i.StringOrNull,preview:(0,VS.nullable)(r.partial({title:r.string}))})])),p=new r.Type("ExternalLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.ExternalLinkType,n=>(0,Uc.pipe)(d.decode(n),Uo.either.map(n=>t.ExternalLinkContent.encode({...n,__TYPE__:t.ExternalLinkType}))),t=>d.encode(t));t.ExternalLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.ExternalLinkType)}),d]),t.LinkContentType="LinkContent";let h=n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.LinkContentType;t.isLinkContent=h,t.LinkLegacy=r.union([u,c,f,p]);let m=n=>new r.Type("LinkLegacy",t.isLinkContent,n=>(0,Uc.pipe)(t.LinkLegacy.decode(n),Uo.either.map(n=>t.LinkContent.encode({value:n,__TYPE__:t.LinkContentType}))),r=>({content:t.LinkLegacy.encode(r.value),types:{[n.keyOfType]:"Link"}}));t.LinkContentLegacy=m,t.Link=r.union([t.ImageLinkContent,t.FileLinkContent,t.DocumentLinkContent,t.ExternalLinkContent]),t.LinkContent=r.strict({__TYPE__:r.literal(t.LinkContentType),value:t.Link})}(Gg)),Gg}var Gv,Gb={},Gx={},GM={};function GT(){return Gv||(Gv=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Block=t.BlockLegacy=t.TextBlock=t.checkEmbedBlock=t.EmbedBlock=t.checkImageBlock=t.ImageBlock=t.ValidatedSpans=t.SpanLegacy=t.Span=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=K6(),o=qW(),a=Gf(),u=Gy(),s=t=>r.strict({data:t,start:r.number,end:r.number,type:r.literal(YP.RichTextNodeType.hyperlink)}),c=r.strict({data:(0,Kt.withFallback)(r.string,""),start:r.number,end:r.number,type:r.literal("label")}),l=r.strict({start:r.number,end:r.number,type:r.keyof({[YP.RichTextNodeType.strong]:null,[YP.RichTextNodeType.em]:null,"list-item":null})});t.Span=r.union([s(u.Link),c,l]),t.SpanLegacy=r.union([s(u.LinkLegacy),c,l]);let f=t=>new r.Type("ValidatedSpans",n=>Array.isArray(n)&&n.every(t.is),(n,i)=>{if(!Array.isArray(n))return r.failure(n,i);{let o=n.reduce((n,r)=>{let i=t.decode(r);return(0,Ua.isLeft)(i)?n:[...n,i.right]},[]).sort((t,n)=>t.start-n.start);return r.success(o)}},n=>n.reduce((n,r)=>{let i=t.encode(r);return[...n,i]},[]));t.ValidatedSpans=f;let d=t=>r.exact(r.intersection([r.type({type:r.literal(YP.RichTextNodeType.image),data:r.intersection([a.ImageContentView,r.partial({linkTo:(0,VS.nullable)(t)})])}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})]));t.ImageBlock=d(u.Link);let p=d(u.LinkLegacy);t.checkImageBlock=function(t){return t.type===YP.RichTextNodeType.image};let h=r.exact(r.intersection([r.type({type:r.literal(YP.RichTextNodeType.embed),data:r.unknown}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})])),m=new r.Type("EmbedBlockLegacy",t=>"embed"===t.type,n=>(0,Uc.pipe)(h.decode(n),Uo.either.chain(t=>Uo.either.map(n=>[t,n])(o.EmbedContentLegacy.decode(t.data))),Uo.either.map(([n,r])=>t.EmbedBlock.encode({...n,data:{...r,__TYPE__:o.EmbedContentType,all:n.data}}))),t=>({...h.encode(t),data:o.EmbedContentLegacy.encode(t.data)}));t.EmbedBlock=r.exact(r.intersection([r.type({type:r.literal(YP.RichTextNodeType.embed),data:o.EmbedContent}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})])),t.checkEmbedBlock=function(t){return t.type===YP.RichTextNodeType.embed};let g=n=>r.exact(r.intersection([r.type({type:(0,VS.refineType)(YP.RichTextNodeTypeCodec,`string which isn't ${YP.RichTextNodeType.image} ${YP.RichTextNodeType.embed}`,t=>t!==YP.RichTextNodeType.image&&t!==YP.RichTextNodeType.embed),content:r.intersection([r.type({text:r.string}),r.partial({spans:(0,t.ValidatedSpans)(n)})])}),r.partial({label:r.string,direction:r.string})]));t.TextBlock=g(t.Span);let y=g(t.SpanLegacy),v=r.union([m,p,y]);t.BlockLegacy=new r.Type("BlockLegacy",t=>m.is(t)||p.is(t)||y.is(t),t=>v.decode(t),n=>t.ImageBlock.is(n)?p.encode(n):t.EmbedBlock.is(n)?m.encode(n):y.encode(n)),t.Block=r.union([t.ImageBlock,t.EmbedBlock,t.TextBlock])}(GM)),GM}function GS(){return Gw||(Gw=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RichTextLegacy=t.RichTextContent=t.isRichTextContent=t.RichTextContentType=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=qO(),o=GT();t.RichTextContentType="StructuredTextContent";let a=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.RichTextContentType;t.isRichTextContent=a;let u=r.array(o.BlockLegacy);t.RichTextContent=r.strict({__TYPE__:r.literal(t.RichTextContentType),value:r.array(o.Block)}),(0,n.__exportStar)(GT(),t);let s=n=>new r.Type("RichTextLegacy",t.isRichTextContent,n=>(0,Uc.pipe)(u.decode(n),Uo.either.map(n=>({value:n,__TYPE__:t.RichTextContentType}))),t=>({content:u.encode(t.value),types:{[n.keyOfType]:"StructuredText"}}));t.RichTextLegacy=s}(Gx)),Gx}var Gw,G_,GI={};function GO(){return G_||(G_=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SeparatorContent=t.SeparatorLegacy=t.isSeparatorContent=t.SeparatorContentType=void 0;let n=(0,nd.__importStar)(Vm),r=qO();t.SeparatorContentType="SeparatorContent";let i=n=>(0,r.hasContentType)(n)&&n.__TYPE__===t.SeparatorContentType;t.isSeparatorContent=i;let o=r=>new n.Type("SeparatorLegacy",t.isSeparatorContent,()=>n.success(t.SeparatorContent.encode({__TYPE__:t.SeparatorContentType})),()=>({content:{},types:{[r.keyOfType]:"Separator"}}));t.SeparatorLegacy=o,t.SeparatorContent=n.strict({__TYPE__:n.literal(t.SeparatorContentType)})}(GI)),GI}function Gk(){return GN||(GN=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nd;(0,n.__exportStar)(qF(),t),(0,n.__exportStar)(qW(),t),(0,n.__exportStar)(Gi(),t),(0,n.__exportStar)(Gs(),t),(0,n.__exportStar)(Gf(),t),(0,n.__exportStar)(Gh(),t),(0,n.__exportStar)(Gy(),t),(0,n.__exportStar)(function(){if(GC)return Gb;GC=1,Object.defineProperty(Gb,"__esModule",{value:!0}),Gb.NestableLegacy=Gb.isNestableContent=Gb.NestableContentDefaultValue=Gb.NestableContent=void 0;let t=nd,n=(0,t.__importStar)(Vm),r=qk(),i=qF(),o=qW(),a=Gi(),u=Gs(),s=Gf(),c=Gh(),l=Gy(),f=GS(),d=GO();Gb.NestableContent=n.union([r.EmptyContent,i.BooleanContent,o.EmbedContent,a.TextContent,a.TimestampContent,a.SelectContent,a.RangeContent,a.NumberContent,a.DateContent,a.ColorContent,u.GeoPointContent,s.ImageContent,c.IntegrationFieldContent,l.LinkContent,f.RichTextContent,d.SeparatorContent]);let p=t=>{switch(t.type){case"Boolean":return(0,i.BooleanContentDefaultValue)(t);case"Select":return(0,a.SelectContentDefaultValue)(t);default:return}};Gb.NestableContentDefaultValue=p;let h=t=>(0,a.isTextContent)(t)||(0,a.isColorContent)(t)||(0,a.isDateContent)(t)||(0,a.isTimestampContent)(t)||(0,a.isNumberContent)(t)||(0,a.isRangeContent)(t)||(0,a.isSelectContent)(t)||(0,u.isGeoPointContent)(t)||(0,f.isRichTextContent)(t)||(0,i.isBooleanContent)(t)||(0,o.isEmbedContent)(t)||(0,s.isImageContent)(t)||(0,c.isIntegrationFieldContent)(t)||(0,l.isLinkContent)(t)||(0,d.isSeparatorContent)(t)||(0,r.isEmptyContent)(t);Gb.isNestableContent=h;let m=t=>({decode(n){if(!t.fieldType)return;let p=(0,r.EmptyLegacy)(t.fieldType).decode(n);if((0,Ua.isRight)(p))return p;let h=(()=>{switch(t.fieldType){case"Text":return(0,a.TextLegacy)(t);case"Color":return(0,a.ColorLegacy)(t);case"Date":return(0,a.DateLegacy)(t);case"Timestamp":return(0,a.TimestampLegacy)(t);case"Number":return(0,a.NumberLegacy)(t);case"Range":return(0,a.RangeLegacy)(t);case"Select":return(0,a.SelectLegacy)(t);case"GeoPoint":return(0,u.GeoPointLegacy)(t);case"StructuredText":return(0,f.RichTextLegacy)(t);case"Boolean":return(0,i.BooleanLegacy)(t);case"Embed":return(0,o.EmbedLegacy)(t);case"Image":return(0,s.ImageLegacy)(t);case"IntegrationFields":return(0,c.IntegrationFieldLegacy)(t);case"Link":return(0,l.LinkContentLegacy)(t);case"Separator":return(0,d.SeparatorLegacy)(t);default:return}})();if(h)return h.decode(n)},encode(n){switch(n.__TYPE__){case qq.FieldContentType:return"Text"===n.type?(0,a.TextLegacy)(t).encode(n):"Color"===n.type?(0,a.ColorLegacy)(t).encode(n):"Range"===n.type?(0,a.RangeLegacy)(t).encode(n):"Date"===n.type?(0,a.DateLegacy)(t).encode(n):"Number"===n.type?(0,a.NumberLegacy)(t).encode(n):"Timestamp"===n.type?(0,a.TimestampLegacy)(t).encode(n):"Select"===n.type?(0,a.SelectLegacy)(t).encode(n):void 0;case u.GeoPointContentType:return(0,u.GeoPointLegacy)(t).encode(n);case f.RichTextContentType:return(0,f.RichTextLegacy)(t).encode(n);case o.EmbedContentType:return(0,o.EmbedLegacy)(t).encode(n);case i.BooleanContentType:return(0,i.BooleanLegacy)(t).encode(n);case s.ImageContentType:return(0,s.ImageLegacy)(t).encode(n);case c.IntegrationFieldContentType:return(0,c.IntegrationFieldLegacy)(t).encode(n);case l.LinkContentType:return(0,l.LinkContentLegacy)(t).encode(n);case d.SeparatorContentType:return(0,d.SeparatorLegacy)(t).encode(n);default:return}}});return Gb.NestableLegacy=m,Gb}(),t),(0,n.__exportStar)(GS(),t),(0,n.__exportStar)(GO(),t)}(qL)),qL}var GC,GN,Gj,GE={};function GR(){if(Gj)return GE;Gj=1,Object.defineProperty(GE,"__esModule",{value:!0}),GE.repeatableContentWithDefaultNestableContentValues=GE.withDefaultNestableContentValues=void 0;let t=Gk();return GE.withDefaultNestableContentValues=function(n,r){return Object.entries(n).reduce((n,[i,o])=>{if(void 0===r[i]){let a=(0,t.NestableContentDefaultValue)(o);return void 0!==a?{...n,[i]:a}:n}return n},r)},GE.repeatableContentWithDefaultNestableContentValues=function(n,r){let i=Object.entries(n);return r.map(n=>i.reduce((r,[i,o])=>{if(!n.value.find(([t])=>t===i)){let a=(0,t.NestableContentDefaultValue)(o);return{...r,value:[...r.value,...a?[[i,a]]:[]]}}return r},n))},GE}function GD(){return GA||(GA=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.traverseGroupItemsContent=t.traverseGroupContent=t.groupContentWithDefaultValues=t.GroupContent=t.isGroupContent=t.GroupContentType=t.GroupLegacy=t.GroupItemLegacy=t.GroupItemContent=t.GroupItemContentType=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=qO(),o=Gk(),a=GR();t.GroupItemContentType="GroupItemContent",t.GroupItemContent=r.strict({__TYPE__:r.literal(t.GroupItemContentType),value:r.array(r.tuple([r.string,o.NestableContent]))});let u=r.record(r.string,r.unknown),s=n=>new r.Type("GroupItemLegacy",n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.GroupItemContentType,r=>(0,Uc.pipe)(u.decode(r),Uo.either.map(r=>({value:Object.entries(r).reduce((t,[r,i])=>{let a=(0,qN.getFieldCtx)(r,n),u=(0,o.NestableLegacy)(a).decode(i);return!u||(0,Ua.isLeft)(u)?t:[...t,[r,u.right]]},[]),__TYPE__:t.GroupItemContentType}))),t=>t.value.reduce((t,[r,i])=>{let a=(0,qN.getFieldCtx)(r,n),u=(0,o.NestableLegacy)(a).encode(i);return u?{content:{...t.content,[r]:u.content},types:{...t.types,...u.types}}:t},{content:{},types:{}}));t.GroupItemLegacy=s;let c=n=>{let i=r.array(r.union([r.null,(0,t.GroupItemLegacy)(n)])),o=r.array((0,t.GroupItemLegacy)(n));return new r.Type("GroupLegacy",t.isGroupContent,n=>(0,Uc.pipe)(i.decode(n),Uo.either.map(n=>({value:n.map(n=>null===n?{__TYPE__:t.GroupItemContentType,value:[]}:n),__TYPE__:t.GroupContentType}))),t=>{let r=o.encode(t.value);return{content:r.map(t=>t.content),types:r.reduce((t,n)=>({...t,...n.types}),{[n.keyOfType]:"Group"})}})};t.GroupLegacy=c,t.GroupContentType="GroupContentType";let l=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.GroupContentType;function f({path:t,model:n,content:r}){return i=>r.map((r,a)=>{let u=t.concat([{key:a.toString(),type:"GroupItem"}]),s=r.value.reduce((t,[r,a])=>{let s=null==n?void 0:n[r],c=i({path:u.concat([{key:r,type:"Widget"}]),key:r,apiId:r,model:s,content:a});return c&&(0,o.isNestableContent)(c)?t.concat([[r,c]]):t},[]);return{__TYPE__:r.__TYPE__,value:s}})}t.isGroupContent=l,t.GroupContent=r.strict({__TYPE__:r.literal(t.GroupContentType),value:r.array(t.GroupItemContent)}),t.groupContentWithDefaultValues=function(t,n){var r;let i=null===(r=t.config)||void 0===r?void 0:r.fields;return i?{...n,value:(0,a.repeatableContentWithDefaultNestableContentValues)(i,n.value)}:n},t.traverseGroupContent=function({path:t,key:n,apiId:r,model:i,content:o}){return a=>{var u;let s=f({path:t,model:null===(u=null==i?void 0:i.config)||void 0===u?void 0:u.fields,content:o.value})(a);return a({path:t,key:n,apiId:r,model:i,content:{__TYPE__:o.__TYPE__,value:s}})}},t.traverseGroupItemsContent=f}(qC)),qC}var GA,GL,GP={},GF={},Gz={},GU={};function GW(){if(GL)return GU;GL=1,Object.defineProperty(GU,"__esModule",{value:!0}),GU.RepeatableWidgets=GU.RepeatableWidgetsLegacy=void 0;let t=(0,nd.__importStar)(Vm),n=GD(),r=Gk(),i=r=>t.array((0,n.GroupItemLegacy)(r));GU.RepeatableWidgetsLegacy=i;let o=t.tuple([t.string,r.NestableContent]),a=t.strict({__TYPE__:t.literal(n.GroupItemContentType),value:t.array(o)});return GU.RepeatableWidgets=t.array(a),GU}function GB(){return GV||(GV=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.migrateCompositeSlice=t.traverseCompositeSliceContent=t.compositeSliceContentWithDefaultValues=t.CompositeSliceContent=t.CompositeSliceLegacy=t.isCompositeSliceContent=t.CompositeSliceContentType=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=qO(),o=GD(),a=Gk(),u=GR(),s=GW();t.CompositeSliceContentType="CompositeSliceContent";let c=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.CompositeSliceContentType;t.isCompositeSliceContent=c;let l=r.exact(r.partial({repeat:r.array(r.unknown),"non-repeat":r.UnknownRecord})),f=n=>new r.Type("CompositeSliceLegacy",t.isCompositeSliceContent,r=>(0,Uc.pipe)(l.decode(r),Uo.either.map(r=>{let i=(()=>{let t=(0,qN.getFieldCtx)("repeat",n),i=(0,s.RepeatableWidgetsLegacy)(t).decode(r.repeat);if(!(!i||(0,Ua.isLeft)(i)))return i.right})()||[];return{nonRepeat:Object.entries(r["non-repeat"]||{}).reduce((t,[r,i])=>{let o=(0,qN.getFieldCtx)(r,n,["non-repeat"]);if(!o)return t;let u=(0,a.NestableLegacy)(o).decode(i);return!u||(0,Ua.isLeft)(u)?t:{...t,[r]:u.right}},{}),repeat:i,__TYPE__:t.CompositeSliceContentType}})),t=>{let r=Object.entries(t.nonRepeat).reduce((t,[r,i])=>{let o=(0,qN.getFieldCtx)(r,n,["non-repeat"]),u=(0,a.NestableLegacy)(o).encode(i);return u?{content:{...t.content,[r]:u.content},types:{...t.types,...u.types}}:t},{content:{},types:{}}),i=(()=>{let r=(0,qN.getFieldCtx)("repeat",n);return(0,s.RepeatableWidgetsLegacy)(r).encode(t.repeat)})()||[];return{content:{"non-repeat":r.content,repeat:i.map(t=>t.content)},types:{[n.keyOfType]:"Slice",...r.types,...i.reduce((t,n)=>({...t,...n.types}),{})}}});t.CompositeSliceLegacy=f,t.CompositeSliceContent=r.strict({__TYPE__:r.literal(t.CompositeSliceContentType),nonRepeat:r.record(r.string,a.NestableContent),repeat:s.RepeatableWidgets}),t.compositeSliceContentWithDefaultValues=function(t,n){var r,i;let o=(0,u.withDefaultNestableContentValues)(null!==(r=t["non-repeat"])&&void 0!==r?r:{},n.nonRepeat),a=(0,u.repeatableContentWithDefaultNestableContentValues)(null!==(i=t.repeat)&&void 0!==i?i:{},n.repeat);return{...n,nonRepeat:o,repeat:a}},t.traverseCompositeSliceContent=function({path:t,sliceKey:n,sliceName:r,model:i,content:u}){return(s,c)=>{let l=Object.entries(u.widget.nonRepeat).reduce((o,[u,c])=>{var l,f,d;let p=(null==i?void 0:i.type)==="SharedSlice"?null===(f=null===(l=null==i?void 0:i.fields)||void 0===l?void 0:l.primary)||void 0===f?void 0:f[u]:null===(d=null==i?void 0:i["non-repeat"])||void 0===d?void 0:d[u],h=s({path:t.concat([{key:"non-repeat",type:"primary"},{key:u,type:"Widget"}]),key:u,apiId:r,model:p,content:c});return h?(0,a.isNestableContent)(h)?{...o,[u]:h}:(console.warn(`Warn: Non nestable content with key [${u}] detected in a composite slice [${r}] with key [${n}]`),o):o},{}),f=(0,o.traverseGroupItemsContent)({path:t.concat([{key:"repeat",type:"items"}]),model:(null==i?void 0:i.type)==="SharedSlice"?null==i?void 0:i.fields.items:null==i?void 0:i.repeat,content:u.widget.repeat})(s);return c({key:n,apiId:r,path:t,model:i,content:{...u,widget:{__TYPE__:"CompositeSliceContent",repeat:f,nonRepeat:l}}})}},t.migrateCompositeSlice=function(t,n){let[,r]=n.key.split("$");return{key:`${t.sliceName}$${r}`,name:t.sliceName,maybeLabel:n.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:t.variationId,primary:Object.entries(n.widget.nonRepeat).reduce((r,[i,o])=>{var a;return!(null===(a=t.fields.primary)||void 0===a)&&a[i]?{...r,[i]:o}:(console.warn(`The widget ${i} in the non-repeat zone of the composite slice [${t.sliceName}] with key [${n.key}] doesn't exist in the model.`),r)},{}),items:n.widget.repeat.map(r=>({__TYPE__:"GroupItemContent",value:r.value.reduce((r,[i,o])=>{var a;return!(null===(a=t.fields.items)||void 0===a)&&a[i]?r.concat([[i,o]]):(console.warn(`The widget ${i} in the repeat zone of the composite slice [${t.sliceName}] with key [${n.key}] doesn't exist in the model.`),r)},[])}),[])}}}}(Gz)),Gz}var GV,G$,GK={};function GY(){return G$||(G$=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.traverseSharedSliceContent=t.sharedSliceContentWithDefaultValues=t.SharedSliceContent=t.SharedSliceLegacy=t.isSharedSliceContent=t.SharedSliceContentType=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=qO(),o=GD(),a=Gk(),u=GR(),s=GW();t.SharedSliceContentType="SharedSliceContent";let c=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.SharedSliceContentType;t.isSharedSliceContent=c;let l=r.exact(r.type({variation:r.string,items:(0,Kt.withFallback)(r.array(r.unknown),[]),primary:(0,Kt.withFallback)(r.UnknownRecord,{})})),f=n=>new r.Type("SharedSliceLegacy",t.isSharedSliceContent,r=>(0,Uc.pipe)(l.decode(r),Uo.either.map(r=>{let i=(()=>{let t=(0,qN.getFieldCtx)("items",n,["variations",r.variation]),i=(0,s.RepeatableWidgetsLegacy)(t).decode(r.items);if(!(!i||(0,Ua.isLeft)(i)))return i.right})()||[],o=Object.entries(r.primary).reduce((t,[i,o])=>{let u=(0,qN.getFieldCtx)(i,n,["variations",r.variation,"primary"]),s=(0,a.NestableLegacy)(u).decode(o);return!s||(0,Ua.isLeft)(s)?t:{...t,[i]:s.right}},{});return{variation:r.variation,primary:o,items:i,__TYPE__:t.SharedSliceContentType}})),t=>{let r=Object.entries(t.primary).reduce((r,[i,o])=>{let u=(0,qN.getFieldCtx)(i,n,["variations",t.variation,"primary"]),s=(0,a.NestableLegacy)(u).encode(o);return s?{content:{...r.content,[i]:s.content},types:{...r.types,...s.types}}:r},{content:{},types:{}}),i=(()=>{let r=(0,qN.getFieldCtx)("items",n,["variations",t.variation]);return(0,s.RepeatableWidgetsLegacy)(r).encode(t.items)})()||[];return{content:{primary:r.content,items:i.map(t=>t.content),variation:t.variation},types:{[n.keyOfType]:"SharedSlice",...r.types,...i.reduce((t,n)=>({...t,...n.types}),{})}}});t.SharedSliceLegacy=f,t.SharedSliceContent=r.strict({__TYPE__:r.literal(t.SharedSliceContentType),variation:r.string,primary:r.record(r.string,a.NestableContent),items:s.RepeatableWidgets}),t.sharedSliceContentWithDefaultValues=function(t,n){var r,i;let o=t.variations.find(t=>t.id===n.variation),a=null!==(r=null==o?void 0:o.primary)&&void 0!==r?r:{},s=null!==(i=null==o?void 0:o.items)&&void 0!==i?i:{},c=(0,u.withDefaultNestableContentValues)(a,n.primary),l=(0,u.repeatableContentWithDefaultNestableContentValues)(s,n.items);return{...n,primary:c,items:l}},t.traverseSharedSliceContent=function({path:t,sliceKey:n,sliceName:r,model:i,content:u}){return(s,c)=>{let l=Object.entries(u.widget.primary).reduce((o,[u,c])=>{var l,f;let d=null===(f=null===(l=null==i?void 0:i.fields)||void 0===l?void 0:l.primary)||void 0===f?void 0:f[u],p=s({path:t.concat([{key:"primary",type:"primary"},{key:u,type:"Widget"}]),key:u,apiId:r,model:d,content:c});return p?(0,a.isNestableContent)(p)?{...o,[u]:p}:(console.warn(`Warn: Non nestable content with key [${u}] detected in a shared slice [${r}] with key [${n}]`),o):o},{}),f=(0,o.traverseGroupItemsContent)({path:t.concat([{key:"items",type:"items"}]),model:null==i?void 0:i.fields.items,content:u.widget.items})(s);return c({key:n,apiId:r,path:t,model:i,content:{...u,widget:{__TYPE__:"SharedSliceContent",variation:u.widget.variation,primary:l,items:f}}})}}}(GK)),GK}var Gq,GG={};function GZ(){if(Gq)return GG;Gq=1,Object.defineProperty(GG,"__esModule",{value:!0}),GG.migrateSimpleSlice=GG.traverseSimpleSliceContent=GG.SimpleSliceLegacy=GG.isSimpleSliceContent=GG.SimpleSliceContent=void 0;let t=(0,nd.__importStar)(Vm),n=GD(),r=Gk();GG.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);let i=t=>(0,r.isNestableContent)(t)||(0,n.isGroupContent)(t);GG.isSimpleSliceContent=i;let o=t=>({decode:"Group"===t.fieldType?(0,n.GroupLegacy)(t).decode.bind(null):(0,r.NestableLegacy)(t).decode.bind(null),encode:i=>"GroupContentType"===i.__TYPE__?(0,n.GroupLegacy)(t).encode(i):(0,r.NestableLegacy)(t).encode(i)});return GG.SimpleSliceLegacy=o,GG.traverseSimpleSliceContent=function({path:t,sliceKey:r,sliceName:i,model:o,content:a}){return(u,s)=>{var c;if((0,n.isGroupContent)(a.widget)){let l=(0,n.traverseGroupContent)({path:t,key:a.key,apiId:a.name,model:(null==o?void 0:o.type)==="Group"?o:(null==o?void 0:o.type)==="SharedSlice"?{type:"Group",config:{fields:o.fields.items||{}}}:void 0,content:a.widget})(u);return l&&s({key:a.key,apiId:a.name,path:t,model:o,content:{...a,widget:l}})}let f=u({key:a.key,apiId:a.name,path:t,model:(null==o?void 0:o.type)==="SharedSlice"?null===(c=o.fields.primary)||void 0===c?void 0:c[a.name]:(null==o?void 0:o.type)!=="Group"?o:void 0,content:a.widget});return f&&s({key:r,apiId:i,path:t,model:o,content:{...a,widget:f}})}},GG.migrateSimpleSlice=function(t,n){var r;let[,i]=n.key.split("$"),o=`${t.sliceName}$${i}`;return"GroupContentType"===n.widget.__TYPE__?{key:o,name:t.sliceName,maybeLabel:n.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:t.variationId,primary:{},items:n.widget.value.map(n=>({__TYPE__:"GroupItemContent",value:n.value.reduce((n,[r,i])=>{var o;return!(null===(o=t.fields.items)||void 0===o)&&o[r]?n.concat([[r,i]]):n},[])}),[])}}:{key:o,name:t.sliceName,maybeLabel:n.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:t.variationId,primary:!(null===(r=t.fields.primary)||void 0===r)&&r[n.name]?{[n.name]:n.widget}:{},items:[]}}},GG}function GQ(){return GH||(GH=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SliceContent=t.SliceLegacy=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=GB(),o=GY(),a=GZ(),u=t=>({decode:n=>(()=>{switch(t.fieldType){case"Slice":return(0,i.CompositeSliceLegacy)(t);case"SharedSlice":return(0,o.SharedSliceLegacy)(t);default:return(0,a.SimpleSliceLegacy)(t)}})().decode(n),encode(n){switch(n.__TYPE__){case"SharedSliceContent":return(0,o.SharedSliceLegacy)(t).encode(n);case"CompositeSliceContent":return(0,i.CompositeSliceLegacy)(t).encode(n);default:return(0,a.SimpleSliceLegacy)(t).encode(n)}}});t.SliceLegacy=u,t.SliceContent=r.union([i.CompositeSliceContent,o.SharedSliceContent,a.SimpleSliceContent]),(0,n.__exportStar)(GB(),t),(0,n.__exportStar)(GY(),t),(0,n.__exportStar)(GZ(),t)}(GF)),GF}var GH,GJ,GX={};function G0(){if(GJ)return GX;GJ=1,Object.defineProperty(GX,"__esModule",{value:!0}),GX.migrateSliceItem=GX.SlicesItemLegacy=GX.sliceItemContentWithDefaultValues=GX.isSimpleSliceItemContent=GX.isCompositeSliceItemContent=GX.isSharedSliceItemContent=GX.SliceItemContent=void 0;let t=nd,n=(0,t.__importStar)(Vm),r=GD(),i=Gk(),o=GR(),a=GQ(),u=GB(),s=GY(),c=GZ();function l(t){return(0,u.isCompositeSliceContent)(t.widget)}function f(t){return(0,r.isGroupContent)(t.widget)||(0,i.isNestableContent)(t.widget)}GX.SliceItemContent=n.type({key:n.string,name:n.string,maybeLabel:n.union([n.string,n.undefined]),widget:a.SliceContent}),GX.isSharedSliceItemContent=function(t){return(0,s.isSharedSliceContent)(t.widget)},GX.isCompositeSliceItemContent=l,GX.isSimpleSliceItemContent=f,GX.sliceItemContentWithDefaultValues=function(t,n){var i;if("SharedSlice"===t.type&&(0,s.isSharedSliceContent)(n))return(0,a.sharedSliceContentWithDefaultValues)(t,n);if("Slice"===t.type&&(0,u.isCompositeSliceContent)(n))return(0,a.compositeSliceContentWithDefaultValues)(t,n);if("Group"===t.type&&(0,r.isGroupContent)(n)&&!(null===(i=t.config)||void 0===i)&&i.fields){let c=(0,o.repeatableContentWithDefaultNestableContentValues)(t.config.fields,n.value);return{...n,value:c}}return n};let d=n.exact(n.intersection([n.type({key:n.string,value:n.unknown}),n.partial({label:(0,VS.nullable)(n.string)})])),p=t=>new n.Type("SlicesItemLegacy",t=>((0,s.isSharedSliceContent)(t.widget),(0,u.isCompositeSliceContent)(t.widget),(0,c.isSimpleSliceContent)(t.widget)),(r,i)=>(0,Uc.pipe)(d.decode(r),Uo.either.chain(o=>{var u;let s=o.key.indexOf("$"),c=o.key.substring(0,s>0?s:void 0),l=(0,qN.getFieldCtx)(c,t),f=(0,a.SliceLegacy)(l).decode(o.value);return!f||(0,Ua.isLeft)(f)?n.failure(r,i):n.success({key:o.key,name:c,maybeLabel:null!==(u=o.label)&&void 0!==u?u:void 0,widget:f.right})})),n=>{let r=(0,qN.getFieldCtx)(n.name,t),i=(0,a.SliceLegacy)(r).encode(n.widget);return{content:{key:n.key,label:n.maybeLabel,value:(null==i?void 0:i.content)||{}},types:(null==i?void 0:i.types)||{}}});GX.SlicesItemLegacy=p;let h=({model:t,content:n})=>l(n)&&(null==t?void 0:t.type)==="SharedSlice"?(0,u.migrateCompositeSlice)(t,n):f(n)&&(null==t?void 0:t.type)==="SharedSlice"?(0,c.migrateSimpleSlice)(t,n):n;return GX.migrateSliceItem=h,GX}var G1,G2={};function G4(){return G3||(G3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nd;(0,n.__exportStar)(GQ(),t),(0,n.__exportStar)(G0(),t),(0,n.__exportStar)((G1||(G1=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.traverseSlices=t.slicesContentWithDefaultValues=t.SlicesContent=t.SlicesLegacy=t.isSlicesContent=t.SlicesContentType=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=qO(),o=GB(),a=GY(),u=GZ(),s=G0();t.SlicesContentType="SliceContentType";let c=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.SlicesContentType;t.isSlicesContent=c;let l=n=>{let i=r.array((0,s.SlicesItemLegacy)(n));return new r.Type("SlicesLegacy",t.isSlicesContent,n=>(0,Uc.pipe)(i.decode(n),Uo.either.map(n=>({__TYPE__:t.SlicesContentType,value:n}))),t=>{let r=i.encode(t.value);return{content:r.map(t=>t.content),types:r.reduce((t,n)=>({...t,...n.types}),{[n.keyOfType]:"Slices"})}})};t.SlicesLegacy=l,t.SlicesContent=r.type({__TYPE__:r.literal(t.SlicesContentType),value:r.array(s.SliceItemContent)}),t.slicesContentWithDefaultValues=function(t,n){var r;let i=null===(r=null==t?void 0:t.config)||void 0===r?void 0:r.choices;if(void 0===i)return n;let o=n.value.map(t=>{let n=i[t.name];if(n){let r=(0,s.sliceItemContentWithDefaultValues)(n,t.widget);return{...t,widget:r}}return t});return{...n,value:o}},t.traverseSlices=function({path:t,key:n,model:r,content:i}){return({transformWidget:c=({content:t})=>t,transformSlice:l=({content:t})=>t})=>{let f=i.value.reduce((n,i)=>{let f=r&&function(t,n,r){var i,o;let a=null===(o=null===(i=null==n?void 0:n.config)||void 0===i?void 0:i.choices)||void 0===o?void 0:o[r.name];return(()=>{if((0,s.isSharedSliceItemContent)(r)&&a&&(0,Ks.isStaticSharedSlice)(a)){let t=a.variations.find(t=>t.id===r.widget.variation);return t?{type:"SharedSlice",sliceName:a.id,variationId:t.id,fields:{primary:t.primary||{},items:t.items||{}}}:void 0}})()||(()=>{var i;let o=Vg.ContentPath.append(Vg.ContentPath.serialize(t),r.name),a=Object.values((null===(i=null==n?void 0:n.config)||void 0===i?void 0:i.choices)||{}).find(t=>{var n;return!!(0,Ks.isStaticSharedSlice)(t)&&!!(!(null===(n=t.legacyPaths)||void 0===n)&&n[o])});if(!a)return;let u=null==a?void 0:a.variations.find(t=>{var n;return t.id===(null===(n=a.legacyPaths)||void 0===n?void 0:n[o])});if(u)return{type:"SharedSlice",sliceName:a.id,variationId:u.id,fields:{primary:u.primary||{},items:u.items||{}}}})()||(()=>{if(a){if((0,Ks.isCompositeSlice)(a))return{type:"Slice","non-repeat":a["non-repeat"]||{},repeat:a.repeat||{}};if((0,Ks.isLegacySlice)(a))return a}})()}(t,r,i),d=(0,s.isSharedSliceItemContent)(i)?(0,a.traverseSharedSliceContent)({path:t.concat({key:i.key,type:"SharedSlice"}),sliceKey:i.key,sliceName:i.name,model:(null==f?void 0:f.type)==="SharedSlice"?f:void 0,content:i})(c,l):(0,s.isCompositeSliceItemContent)(i)?(0,o.traverseCompositeSliceContent)({path:t.concat({key:i.key,type:"Slice"}),sliceKey:i.key,sliceName:i.name,model:(null==f?void 0:f.type)==="Slice"||(null==f?void 0:f.type)==="SharedSlice"?f:void 0,content:i})(c,l):(0,s.isSimpleSliceItemContent)(i)?(0,u.traverseSimpleSliceContent)({path:t.concat({key:i.key,type:"LegacySlice"}),sliceKey:i.key,sliceName:i.name,model:f&&(null==f?void 0:f.type)!=="Slice"?f:void 0,content:i})(c,l):void 0;return d?n.concat(d):n},[]);return c({path:t,key:n,apiId:n,model:r,content:{__TYPE__:i.__TYPE__,value:f}})}}}(G2)),G2),t)}(GP)),GP}var G3,G5,G9={};function G8(){return G5||(G5=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UIDContent=t.UIDLegacy=t.isUIDContent=t.UIDContentType=void 0;let n=nd,r=(0,n.__importStar)(Vm),i=qO();t.UIDContentType="UIDContent";let o=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.UIDContentType;t.isUIDContent=o;let a=n=>new r.Type("UIDLegacy",t.isUIDContent,n=>(0,Uc.pipe)(r.string.decode(n),Uo.either.map(n=>t.UIDContent.encode({value:n,__TYPE__:t.UIDContentType}))),t=>({content:t.value,types:{[n.keyOfType]:"UID"}}));t.UIDLegacy=a,t.UIDContent=r.type({__TYPE__:r.literal(t.UIDContentType),value:r.string})}(G9)),G9}var G6,G7={};function Ze(){return i||(i=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nd;(0,n.__exportStar)(qk(),t),(0,n.__exportStar)(GD(),t),(0,n.__exportStar)(Gk(),t),(0,n.__exportStar)(G4(),t),(0,n.__exportStar)(G8(),t),(0,n.__exportStar)(function(){if(G6)return G7;G6=1,Object.defineProperty(G7,"__esModule",{value:!0}),G7.WidgetLegacy=G7.isWidgetContent=G7.WidgetContent=void 0;let t=(0,nd.__importStar)(Vm),n=GD(),r=Gk(),i=G4(),o=G8();G7.WidgetContent=t.union([n.GroupContent,r.NestableContent,o.UIDContent,i.SlicesContent]);let a=t=>(0,n.isGroupContent)(t)||(0,r.isNestableContent)(t)||(0,o.isUIDContent)(t)||(0,i.isSlicesContent)(t);G7.isWidgetContent=a;let u=t=>({decode(a){if(!t.fieldType)return;let u=(()=>{switch(t.fieldType){case"UID":return(0,o.UIDLegacy)(t);case"Group":return(0,n.GroupLegacy)(t);case"Choice":case"Slices":return(0,i.SlicesLegacy)(t);default:return(0,r.NestableLegacy)(t)}})();if(u)return u.decode(a)},encode(a){switch(a.__TYPE__){case o.UIDContentType:return(0,o.UIDLegacy)(t).encode(a);case n.GroupContentType:return(0,n.GroupLegacy)(t).encode(a);case i.SlicesContentType:return(0,i.SlicesLegacy)(t).encode(a);default:return(0,r.NestableLegacy)(t).encode(a)}}});return G7.WidgetLegacy=u,G7}(),t)}(qw)),qw}Object.defineProperty(np,"__esModule",{value:!0}),np.migrateDocument=np.collectWidgets=np.traverseDocument=np.fillDocumentWithDefaultValues=np.DocumentLegacy=np.Document=void 0;let Zt=nd,Zn=(0,Zt.__importStar)(Vm),Zr=Ze();np.Document=Zn.record(Vy.WidgetKey,Zr.WidgetContent);let Zi=Zn.record(Vy.WidgetKey,Zn.unknown),Zo=t=>new Zn.Type("Document",t=>!!t&&"object"==typeof t,n=>(0,Uc.pipe)(Zi.decode(n),Uo.either.map(n=>Object.entries(n).reduce((n,[r,i])=>{let o=(0,qN.defaultCtx)(r,t),a=(0,Zr.WidgetLegacy)(o).decode(i);return!a||(0,Ua.isLeft)(a)?n:{...n,[r]:a.right}},{}))),n=>Object.entries(n).reduce((n,[r,i])=>{let o=(0,qN.defaultCtx)(r,t),a=(0,Zr.WidgetLegacy)(o).encode(i);return a?{content:{...n.content,[r]:a.content},types:{...n.types,...a.types}}:n},{content:{},types:{}}));function Za(t){let n=Object.entries(t),{types:r,widgets:i}=n.reduce((t,[n,r])=>{if(n.endsWith("_TYPE")){let i=qN.FieldOrSliceType.decode(r);if((0,Ua.isRight)(i))return{...t,types:t.types.set(n.substring(0,n.length-5),i.right)}}return n.endsWith("_POSITION")||n.endsWith("_TYPE")?t:{...t,widgets:{...t.widgets,[n]:r}}},{types:new Map,widgets:{}}),o=t.slugs_INTERNAL||[],a=t.uid;return{widgets:i,types:r,uid:a,slugs:o}}function Zu(t){return{customTypeId:null==t?void 0:t.id,fields:Object.fromEntries((0,Ks.flattenSections)(t))}}function Zs({document:t,customType:n}){let r=n&&Ks.StaticCustomType.is(n)?Zu(n):n;return({transformWidget:n=({content:t})=>t,transformSlice:i=({content:t})=>t})=>{let o=r&&Object.entries(r.fields).reduce((t,[n,r])=>({...t,[n]:r}),{});return Object.entries(t).reduce((t,[a,u])=>{let s=o&&o[a],c=Vg.ContentPath.make([{key:null==r?void 0:r.customTypeId,type:"CustomType"},{key:a,type:"Widget"}]),l=(()=>{switch(u.__TYPE__){case"SliceContentType":return(0,Zr.traverseSlices)({path:c,key:a,model:(null==s?void 0:s.type)==="Slices"||(null==s?void 0:s.type)==="Choice"?s:void 0,content:u})({transformWidget:n,transformSlice:i});case"GroupContentType":return(0,Zr.traverseGroupContent)({path:c,key:a,apiId:a,model:(null==s?void 0:s.type)==="Group"?s:void 0,content:u})(n);default:return n({path:c,key:a,apiId:a,model:(null==s?void 0:s.type)!=="Group"&&(null==s?void 0:s.type)!=="Slices"&&(null==s?void 0:s.type)!=="Choice"?s:void 0,content:u})}})();return{...t,...l?{[a]:l}:{}}},{})}}function Zc(t,n){let r=Ks.StaticCustomType.is(n)?Zu(n):n;return Object.values((0,Ks.collectSharedSlices)(r)).some(t=>Boolean(t.legacyPaths))?Zs({document:t,customType:n})({transformSlice:Zr.migrateSliceItem}):t}np.DocumentLegacy={_codec:Zo,extractMetadata:Za,parse:function(t,n){let r=(0,Uc.pipe)(Zn.record(Vy.WidgetKey,Zn.unknown).decode(t),Uo.either.chain(t=>{let{types:n,widgets:r}=Za(t);return Zo(n).decode(r)}));return(0,Ua.isLeft)(r)?void 0:Zc(r.right,n)},encode:function(t){let n=Zo().encode(t);return{...n.content,...n.types}}},np.fillDocumentWithDefaultValues=function(t,n){let{fields:r}=t&&Ks.StaticCustomType.is(t)?Zu(t):t;return Object.entries(r).reduce((t,[r,i])=>{let o=n[r],a=(()=>{switch(i.type){case"Group":return(0,Zr.isGroupContent)(o)?(0,Zr.groupContentWithDefaultValues)(i,o):o;case"Choice":case"Slices":return(0,Zr.isSlicesContent)(o)?(0,Zr.slicesContentWithDefaultValues)(i,o):o;default:return void 0===o&&Ks.NestableWidget.is(i)?(0,Zr.NestableContentDefaultValue)(i):o}})();return a?{...t,[r]:a}:t},n)},np.traverseDocument=Zs,np.collectWidgets=function(t,n){let r={};return Zs({document:t})({transformWidget({content:t,path:i}){let o=Vg.ContentPath.serialize(i);return n(t,i)&&(r[o]=t),t}}),r},np.migrateDocument=Zc,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nd;(0,n.__exportStar)(np,t),(0,n.__exportStar)(Ze(),t),(0,n.__exportStar)(qN,t)}(nf);let Zl=(0,o.createContext)({update(){}});function Zf(t){var n;return(null==(n=t.config)?void 0:n.label)??("Boolean"===t.type||"Separator"===t.type?void 0:t.fieldset)??t.type}function Zd(t,n){var r,i,o;return"Boolean"===t.type?(n?null==(r=t.config)?void 0:r.placeholder_true:null==(i=t.config)?void 0:i.placeholder_false)??"...":(null==(o=t.config)?void 0:o.placeholder)??"..."}function Zp(t){var n;let{content:r,field:i,id:o,onContentChange:a,readOnly:s}=t,c=(null==r?void 0:r.value)??(null==(n=i.config)?void 0:n.default_value)??!1;return k.jsxs(u.gN,{children:[k.jsx(u.fw,{name:"toggleOff"}),k.jsx(u.Qy,{htmlFor:o,children:Zf(i)}),k.jsxs(u.JO,{children:[k.jsx(u.xu,{padding:4,alignItems:"center",children:k.jsx(u.xv,{children:Zd(i,c)})}),k.jsx(u.rs,{checked:c,id:o,onCheckedChange(t){var n;s||a((n=t,{__TYPE__:"BooleanContent",value:n}))}})]})]})}function Zh(t){let{id:n,field:r,content:i,onContentChange:o}=t;return k.jsxs(u.gN,{children:[k.jsx(u.fw,{name:"colorLens"}),k.jsx(u.Qy,{id:n,children:Zf(r)}),k.jsx(u.JO,{children:k.jsx(u.xu,{padding:{left:4},alignItems:"center",children:k.jsx(u.TC,{onValueChange(t){var n;return o((n=t,void 0===n?void 0:{__TYPE__:"FieldContent",type:"Color",value:n}))},value:null==i?void 0:i.value,"aria-labelledby":n,placeholder:Zd(r)})})})]})}function Zm(t){let{id:n,readOnly:r,field:i,content:o,onContentChange:a}=t,s=null!=o&&o.value?(0,c._O)(o.value):void 0;return k.jsxs(u.gN,{children:[k.jsx(u.fw,{name:"dateRange"}),k.jsx(u.Qy,{id:n,children:Zf(i)}),k.jsx(u.JO,{children:k.jsx(u.xu,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:k.jsx(u.Wr,{mode:"date","aria-labelledby":n,readOnly:r,value:s,onValueChange:t=>a(function(t){if(t)return{__TYPE__:"FieldContent",type:"Date",value:function(t){let n=`${t.getFullYear()}`.padStart(4,"0"),r=`${t.getMonth()+1}`.padStart(2,"0"),i=`${t.getDate()}`.padStart(2,"0");return`${n}-${r}-${i}`}(t)}}(t))})})})]})}function Zg(t){this.content=t}Zg.prototype={constructor:Zg,find:function(t){for(var n=0;n<this.content.length;n+=2)if(this.content[n]===t)return n;return -1},get:function(t){var n=this.find(t);return -1==n?void 0:this.content[n+1]},update:function(t,n,r){var i=r&&r!=t?this.remove(r):this,o=i.find(t),a=i.content.slice();return -1==o?a.push(r||t,n):(a[o+1]=n,r&&(a[o]=r)),new Zg(a)},remove:function(t){var n=this.find(t);if(-1==n)return this;var r=this.content.slice();return r.splice(n,2),new Zg(r)},addToStart:function(t,n){return new Zg([t,n].concat(this.remove(t).content))},addToEnd:function(t,n){var r=this.remove(t).content.slice();return r.push(t,n),new Zg(r)},addBefore:function(t,n,r){var i=this.remove(n),o=i.content.slice(),a=i.find(t);return o.splice(-1==a?o.length:a,0,n,r),new Zg(o)},forEach:function(t){for(var n=0;n<this.content.length;n+=2)t(this.content[n],this.content[n+1])},prepend:function(t){return(t=Zg.from(t)).size?new Zg(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=Zg.from(t)).size?new Zg(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var n=this;t=Zg.from(t);for(var r=0;r<t.content.length;r+=2)n=n.remove(t.content[r]);return n},toObject:function(){var t={};return this.forEach(function(n,r){t[n]=r}),t},get size(){return this.content.length>>1}},Zg.from=function(t){if(t instanceof Zg)return t;var n=[];if(t)for(var r in t)n.push(r,t[r]);return new Zg(n)};class Zy{constructor(t,n){if(this.content=t,this.size=n||0,null==n)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let a=0,u=0;u<n;a++){let s=this.content[a],c=u+s.nodeSize;if(c>t&&!1!==r(s,i+u,o||null,a)&&s.content.size){let l=u+1;s.nodesBetween(Math.max(0,t-l),Math.min(s.content.size,n-l),r,i+l)}u=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",a=!0;return this.nodesBetween(t,n,(u,s)=>{u.isText?(o+=u.text.slice(Math.max(t,s)-s,n-s),a=!r):u.isLeaf?(i?o+="function"==typeof i?i(u):i:u.type.spec.leafText&&(o+=u.type.spec.leafText(u)),a=!r):!a&&u.isBlock&&(o+=r,a=!0)},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new Zy(i,this.size+t.size)}cut(t,n=this.size){if(0==t&&n==this.size)return this;let r=[],i=0;if(n>t)for(let o=0,a=0;a<n;o++){let u=this.content[o],s=a+u.nodeSize;s>t&&((a<t||s>n)&&(u=u.isText?u.cut(Math.max(0,t-a),Math.min(u.text.length,n-a)):u.cut(Math.max(0,t-a-1),Math.min(u.content.size,n-a-1))),r.push(u),i+=u.nodeSize),a=s}return new Zy(r,i)}cutByIndex(t,n){return t==n?Zy.empty:0==t&&n==this.content.length?this:new Zy(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new Zy(i,o)}addToStart(t){return new Zy([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Zy(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return function t(n,r,i){for(let o=0;;o++){if(o==n.childCount||o==r.childCount)return n.childCount==r.childCount?null:i;let a=n.child(o),u=r.child(o);if(a==u){i+=a.nodeSize;continue}if(!a.sameMarkup(u))return i;if(a.isText&&a.text!=u.text){for(let s=0;a.text[s]==u.text[s];s++)i++;return i}if(a.content.size||u.content.size){let c=t(a.content,u.content,i+1);if(null!=c)return c}i+=a.nodeSize}}(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return function t(n,r,i,o){for(let a=n.childCount,u=r.childCount;;){if(0==a||0==u)return a==u?null:{a:i,b:o};let s=n.child(--a),c=r.child(--u),l=s.nodeSize;if(s==c){i-=l,o-=l;continue}if(!s.sameMarkup(c))return{a:i,b:o};if(s.isText&&s.text!=c.text){let f=0,d=Math.min(s.text.length,c.text.length);for(;f<d&&s.text[s.text.length-f-1]==c.text[c.text.length-f-1];)f++,i--,o--;return{a:i,b:o}}if(s.content.size||c.content.size){let p=t(s.content,c.content,i-1,o-1);if(p)return p}i-=l,o-=l}}(this,t,n,r)}findIndex(t,n=-1){if(0==t)return Zb(0,t);if(t==this.size)return Zb(this.content.length,t);if(t>this.size||t<0)throw RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=i+this.child(r).nodeSize;if(o>=t)return o==t||n>0?Zb(r+1,o):Zb(r,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return Zy.empty;if(!Array.isArray(n))throw RangeError("Invalid input for Fragment.fromJSON");return new Zy(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Zy.empty;let n,r=0;for(let i=0;i<t.length;i++){let o=t[i];r+=o.nodeSize,i&&o.isText&&t[i-1].sameMarkup(o)?(n||(n=t.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new Zy(n||t,r)}static from(t){if(!t)return Zy.empty;if(t instanceof Zy)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new Zy([t],t.nodeSize);throw RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Zy.empty=new Zy([],0);let Zv={index:0,offset:0};function Zb(t,n){return Zv.index=t,Zv.offset=n,Zv}function Zx(t,n){if(t===n)return!0;if(!(t&&"object"==typeof t)||!(n&&"object"==typeof n))return!1;let r=Array.isArray(t);if(Array.isArray(n)!=r)return!1;if(r){if(t.length!=n.length)return!1;for(let i=0;i<t.length;i++)if(!Zx(t[i],n[i]))return!1}else{for(let o in t)if(!(o in n)||!Zx(t[o],n[o]))return!1;for(let a in n)if(!(a in t))return!1}return!0}let ZM=class t{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let o=t[i];if(this.eq(o))return t;if(this.type.excludes(o.type))n||(n=t.slice(0,i));else{if(o.type.excludes(this.type))return t;!r&&o.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Zx(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(n){if(!n||Array.isArray(n)&&0==n.length)return t.none;if(n instanceof t)return[n];let r=n.slice();return r.sort((t,n)=>t.type.rank-n.type.rank),r}};ZM.none=[];class ZT extends Error{}class ZS{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=function t(n,r,i,o){let{index:a,offset:u}=n.findIndex(r),s=n.maybeChild(a);if(u==r||s.isText)return o&&!o.canReplace(a,a,i)?null:n.cut(0,r).append(i).append(n.cut(r));let c=t(s.content,r-u-1,i);return c&&n.replaceChild(a,s.copy(c))}(this.content,t+this.openStart,n);return r&&new ZS(r,this.openStart,this.openEnd)}removeBetween(t,n){return new ZS(function t(n,r,i){let{index:o,offset:a}=n.findIndex(r),u=n.maybeChild(o),{index:s,offset:c}=n.findIndex(i);if(a==r||u.isText){if(c!=i&&!n.child(s).isText)throw RangeError("Removing non-flat range");return n.cut(0,r).append(n.cut(i))}if(o!=s)throw RangeError("Removing non-flat range");return n.replaceChild(o,u.copy(t(u.content,r-a-1,i-a-1)))}(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return ZS.empty;let r=n.openStart||0,i=n.openEnd||0;if("number"!=typeof r||"number"!=typeof i)throw RangeError("Invalid input for Slice.fromJSON");return new ZS(Zy.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)i++;return new ZS(t,r,i)}}function Zw(t,n){if(!n.type.compatibleContent(t.type))throw new ZT("Cannot join "+n.type.name+" onto "+t.type.name)}function Z_(t,n,r){let i=t.node(r);return Zw(i,n.node(r)),i}function ZI(t,n){let r=n.length-1;r>=0&&t.isText&&t.sameMarkup(n[r])?n[r]=t.withText(n[r].text+t.text):n.push(t)}function ZO(t,n,r,i){let o=(n||t).node(r),a=0,u=n?n.index(r):o.childCount;t&&(a=t.index(r),t.depth>r?a++:t.textOffset&&(ZI(t.nodeAfter,i),a++));for(let s=a;s<u;s++)ZI(o.child(s),i);n&&n.depth==r&&n.textOffset&&ZI(n.nodeBefore,i)}function Zk(t,n){return t.type.checkContent(n),t.copy(n)}function ZC(t,n,r){let i=[];return ZO(null,t,r,i),t.depth>r&&ZI(Zk(Z_(t,n,r+1),ZC(t,n,r+1)),i),ZO(n,null,r,i),new Zy(i)}ZS.empty=new ZS(Zy.empty,0,0);class ZN{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):0==t?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[3*n],i=0==n?0:this.path[3*n-1]+1;for(let o=0;o<t;o++)i+=r.child(o).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(0==t.content.size)return ZM.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let o=r;r=i,i=o}let a=r.marks;for(var u=0;u<a.length;u++)!1!==a[u].type.spec.inclusive||i&&a[u].isInSet(i.marks)||(a=a[u--].removeFromSet(a));return a}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)!1!==r[o].type.spec.inclusive||i&&r[o].isInSet(i.marks)||(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new ZD(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=t;;){let{index:u,offset:s}=a.content.findIndex(o),c=o-s;if(r.push(a,u,i+s),!c||(a=a.child(u)).isText)break;o=c-1,i+=s+1}return new ZN(n,r,o)}static resolveCached(t,n){for(let r=0;r<Zj.length;r++){let i=Zj[r];if(i.pos==n&&i.doc==t)return i}let o=Zj[ZE]=ZN.resolve(t,n);return ZE=(ZE+1)%ZR,o}}let Zj=[],ZE=0,ZR=12;class ZD{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}let ZA=Object.create(null),ZL=class t{constructor(t,n,r,i=ZM.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||Zy.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Zx(this.attrs,n||t.defaultAttrs||ZA)&&ZM.sameSet(this.marks,r||ZM.none)}copy(n=null){return n==this.content?this:new t(this.type,this.attrs,n,this.marks)}mark(n){return n==this.marks?this:new t(this.type,this.attrs,this.content,n)}cut(t,n=this.content.size){return 0==t&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return ZS.empty;let i=this.resolve(t),o=this.resolve(n),a=r?0:i.sharedDepth(n),u=i.start(a),s=i.node(a).content.cut(i.pos-u,o.pos-u);return new ZS(s,i.depth-a,o.depth-a)}replace(t,n,r){return function(t,n,r){if(r.openStart>t.depth)throw new ZT("Inserted content deeper than insertion position");if(t.depth-r.openStart!=n.depth-r.openEnd)throw new ZT("Inconsistent open depths");return function t(n,r,i,o){let a=n.index(o),u=n.node(o);if(a==r.index(o)&&o<n.depth-i.openStart){let s=t(n,r,i,o+1);return u.copy(u.content.replaceChild(a,s))}if(!i.content.size)return Zk(u,ZC(n,r,o));if(i.openStart||i.openEnd||n.depth!=o||r.depth!=o){let{start:c,end:l}=function(t,n){let r=n.depth-t.openStart,i=n.node(r).copy(t.content);for(let o=r-1;o>=0;o--)i=n.node(o).copy(Zy.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}(i,n);return Zk(u,function t(n,r,i,o,a){let u=n.depth>a&&Z_(n,r,a+1),s=o.depth>a&&Z_(i,o,a+1),c=[];return ZO(null,n,a,c),u&&s&&r.index(a)==i.index(a)?(Zw(u,s),ZI(Zk(u,t(n,r,i,o,a+1)),c)):(u&&ZI(Zk(u,ZC(n,r,a+1)),c),ZO(r,i,a,c),s&&ZI(Zk(s,ZC(i,o,a+1)),c)),ZO(o,null,a,c),new Zy(c)}(n,c,l,r,o))}{let f=n.parent,d=f.content;return Zk(f,d.cut(0,n.parentOffset).append(i.content).append(d.cut(r.parentOffset)))}}(t,n,r,0)}(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(!(n=n.maybeChild(r)))return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return ZN.resolveCached(this,t)}resolveNoCache(t){return ZN.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,t=>(r.isInSet(t.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),ZF(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=Zy.empty,i=0,o=r.childCount){let a=this.contentMatchAt(t).matchFragment(r,i,o),u=a&&a.matchFragment(this.content,n);if(!u||!u.validEnd)return!1;for(let s=i;s<o;s++)if(!this.type.allowsMarks(r.child(s).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),a=o&&o.matchFragment(this.content,n);return!!a&&a.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content);let t=ZM.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!ZM.sameSet(t,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(t=>t.toJSON())),t}static fromJSON(t,n){if(!n)throw RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if("text"==n.type){if("string"!=typeof n.text)throw RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=Zy.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}};ZL.prototype.text=void 0;class ZP extends ZL{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ZF(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new ZP(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new ZP(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return 0==t&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function ZF(t,n){for(let r=t.length-1;r>=0;r--)n=t[r].type.name+"("+n+")";return n}class Zz{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){var r;let i=new ZU(t,n);if(null==i.next)return Zz.empty;let o=ZW(i);i.next&&i.err("Unexpected trailing text");let a,u=(r=function(t){let n=[[]];return o(a(t,0),r()),n;function r(){return n.push([])-1}function i(t,r,i){let o={term:i,to:r};return n[t].push(o),o}function o(t,n){t.forEach(t=>t.to=n)}function a(t,n){if("choice"==t.type)return t.exprs.reduce((t,r)=>t.concat(a(r,n)),[]);if("seq"==t.type)for(let u=0;;u++){let s=a(t.exprs[u],n);if(u==t.exprs.length-1)return s;o(s,n=r())}else if("star"==t.type){let c=r();return i(n,c),o(a(t.expr,c),c),[i(c)]}else if("plus"==t.type){let l=r();return o(a(t.expr,n),l),o(a(t.expr,l),l),[i(l)]}else{if("opt"==t.type)return[i(n)].concat(a(t.expr,n));if("range"==t.type){let f=n;for(let d=0;d<t.min;d++){let p=r();o(a(t.expr,f),p),f=p}if(-1==t.max)o(a(t.expr,f),f);else for(let h=t.min;h<t.max;h++){let m=r();i(f,m),o(a(t.expr,f),m),f=m}return[i(f)]}if("name"==t.type)return[i(n,void 0,t.value)];throw Error("Unknown expr type")}}}(o),a=Object.create(null),function t(n){let i=[];n.forEach(t=>{r[t].forEach(({term:t,to:n})=>{if(!t)return;let o;for(let a=0;a<i.length;a++)i[a][0]==t&&(o=i[a][1]);ZG(r,n).forEach(n=>{o||i.push([t,o=[]]),-1==o.indexOf(n)&&o.push(n)})})});let o=a[n.join(",")]=new Zz(n.indexOf(r.length-1)>-1);for(let u=0;u<i.length;u++){let s=i[u][1].sort(Zq);o.next.push({type:i[u][0],next:a[s.join(",")]||t(s)})}return o}(ZG(r,0)));return function(t,n){for(let r=0,i=[t];r<i.length;r++){let o=i[r],a=!o.validEnd,u=[];for(let s=0;s<o.next.length;s++){let{type:c,next:l}=o.next[s];u.push(c.name),a&&!(c.isText||c.hasRequiredAttrs())&&(a=!1),-1==i.indexOf(l)&&i.push(l)}a&&n.err("Only non-generatable nodes ("+u.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(u,i),u}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];return function o(a,u){let s=a.matchFragment(t,r);if(s&&(!n||s.validEnd))return Zy.from(u.map(t=>t.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:l,next:f}=a.next[c];if(!(l.isText||l.hasRequiredAttrs())&&-1==i.indexOf(f)){i.push(f);let d=o(f,u.concat(l));if(d)return d}}return null}(this,[])}findWrapping(t){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==t)return this.wrapCache[n+1];let r=this.computeWrapping(t);return this.wrapCache.push(t,r),r}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let a=[];for(let u=i;u.type;u=u.via)a.push(u.type);return a.reverse()}for(let s=0;s<o.next.length;s++){let{type:c,next:l}=o.next[s];c.isLeaf||c.hasRequiredAttrs()||c.name in n||i.type&&!l.validEnd||(r.push({match:c.contentMatch,type:c,via:i}),n[c.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return function n(r){t.push(r);for(let i=0;i<r.next.length;i++)-1==t.indexOf(r.next[i].next)&&n(r.next[i].next)}(this),t.map((n,r)=>{let i=r+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)i+=(o?", ":"")+n.next[o].type.name+"->"+t.indexOf(n.next[o].next);return i}).join(`
|
|
6
|
-
`)}}Zz.empty=new Zz(!0);class ZU{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw SyntaxError(t+" (in content expression '"+this.string+"')")}}function ZW(t){let n=[];do n.push(ZB(t));while(t.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}function ZB(t){let n=[];do n.push(ZV(t));while(t.next&&")"!=t.next&&"|"!=t.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}function ZV(t){let n=ZY(t);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=ZK(t,n);else break;return n}function Z$(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let n=Number(t.next);return t.pos++,n}function ZK(t,n){let r=Z$(t),i=r;return t.eat(",")&&(i="}"!=t.next?Z$(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:i,expr:n}}function ZY(t){if(t.eat("(")){let n=ZW(t);return t.eat(")")||t.err("Missing closing paren"),n}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let r=(function(t,n){let r=t.nodeTypes,i=r[n];if(i)return[i];let o=[];for(let a in r){let u=r[a];u.groups.indexOf(n)>-1&&o.push(u)}return 0==o.length&&t.err("No node type or group '"+n+"' found"),o})(t,t.next).map(n=>(null==t.inline?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,1==r.length?r[0]:{type:"choice",exprs:r}}}function Zq(t,n){return n-t}function ZG(t,n){let r=[];return function n(i){let o=t[i];if(1==o.length&&!o[0].term)return n(o[0].to);r.push(i);for(let a=0;a<o.length;a++){let{term:u,to:s}=o[a];u||-1!=r.indexOf(s)||n(s)}}(n),r.sort(Zq)}function ZZ(t){let n=Object.create(null);for(let r in t){let i=t[r];if(!i.hasDefault)return null;n[r]=i.default}return n}function ZQ(t,n){let r=Object.create(null);for(let i in t){let o=n&&n[i];if(void 0===o){let a=t[i];if(a.hasDefault)o=a.default;else throw RangeError("No value supplied for attribute "+i)}r[i]=o}return r}function ZH(t){let n=Object.create(null);if(t)for(let r in t)n[r]=new ZX(t[r]);return n}let ZJ=class t{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=ZH(r.attrs),this.defaultAttrs=ZZ(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Zz.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:ZQ(this.attrs,t)}create(t=null,n,r){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new ZL(this,this.computeAttrs(t),Zy.from(n),ZM.setFrom(r))}createChecked(t=null,n,r){return n=Zy.from(n),this.checkContent(n),new ZL(this,this.computeAttrs(t),n,ZM.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),(n=Zy.from(n)).size){let i=this.contentMatch.fillBefore(n);if(!i)return null;n=i.append(n)}let o=this.contentMatch.matchFragment(n),a=o&&o.fillBefore(Zy.empty,!0);return a?new ZL(this,t,n.append(a),ZM.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(null==this.markSet)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:ZM.none:t}static compile(n,r){let i=Object.create(null);n.forEach((n,o)=>i[n]=new t(n,r,o));let o=r.spec.topNode||"doc";if(!i[o])throw RangeError("Schema is missing its top node type ('"+o+"')");if(!i.text)throw RangeError("Every schema needs a 'text' type");for(let a in i.text.attrs)throw RangeError("The text node type should not have attributes");return i}};class ZX{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Z0{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=ZH(i.attrs),this.excluded=null;let o=ZZ(this.attrs);this.instance=o?new ZM(this,o):null}create(t=null){return!t&&this.instance?this.instance:new ZM(this,ZQ(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,o)=>r[t]=new Z0(t,i++,n,o)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}excludes(t){return this.excluded.indexOf(t)>-1}}class Z1{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let r in t)n[r]=t[r];n.nodes=Zg.from(t.nodes),n.marks=Zg.from(t.marks||{}),this.nodes=ZJ.compile(this.spec.nodes,this),this.marks=Z0.compile(this.spec.marks,this);let i=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw RangeError(o+" can not be both a node and a mark");let a=this.nodes[o],u=a.spec.content||"",s=a.spec.marks;a.contentMatch=i[u]||(i[u]=Zz.parse(u,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.markSet="_"==s?null:s?Z2(this,s.split(" ")):""!=s&&a.inlineContent?null:[]}for(let c in this.marks){let l=this.marks[c],f=l.spec.excludes;l.excluded=null==f?[l]:""==f?[]:Z2(this,f.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if("string"==typeof t)t=this.nodeType(t);else if(t instanceof ZJ){if(t.schema!=this)throw RangeError("Node type from different schema used ("+t.name+")")}else throw RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new ZP(r,r.defaultAttrs,t,ZM.setFrom(n))}mark(t,n){return"string"==typeof t&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return ZL.fromJSON(this,t)}markFromJSON(t){return ZM.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw RangeError("Unknown node type: "+t);return n}}function Z2(t,n){let r=[];for(let i=0;i<n.length;i++){let o=n[i],a=t.marks[o],u=a;if(a)r.push(a);else for(let s in t.marks){let c=t.marks[s];("_"==o||c.spec.group&&c.spec.group.split(" ").indexOf(o)>-1)&&r.push(u=c)}if(!u)throw SyntaxError("Unknown mark type: '"+n[i]+"'")}return r}class Z4{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(t=>{t.tag?this.tags.push(t):t.style&&this.styles.push(t)}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let r=t.nodes[n.node];return r.contentMatch.matchType(r)})}parse(t,n={}){let r=new Z7(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new Z7(this,n,!0);return r.addAll(t,n.from,n.to),ZS.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(Qe(t,o.tag)&&(void 0===o.namespace||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(t);if(!1===a)continue;o.attrs=a||void 0}return o}}}matchStyle(t,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],u=a.style;if(!(0!=u.indexOf(t)||a.context&&!r.matchesContext(a.context)||u.length>t.length&&(61!=u.charCodeAt(t.length)||u.slice(t.length+1)!=n))){if(a.getAttrs){let s=a.getAttrs(n);if(!1===s)continue;a.attrs=s||void 0}return a}}}static schemaRules(t){let n=[];function r(t){let r=null==t.priority?50:t.priority,i=0;for(;i<n.length;i++){let o=n[i];if((null==o.priority?50:o.priority)<r)break}n.splice(i,0,t)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(t=>{r(t=Qt(t)),t.mark||t.ignore||t.clearMark||(t.mark=i)})}for(let a in t.nodes){let u=t.nodes[a].spec.parseDOM;u&&u.forEach(t=>{r(t=Qt(t)),t.node||t.ignore||t.mark||(t.node=a)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Z4(t,Z4.schemaRules(t)))}}let Z3={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Z5={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Z9={ol:!0,ul:!0};function Z8(t,n,r){return null!=n?(n?1:0)|("full"===n?2:0):t&&"pre"==t.whitespace?3:-5&r}class Z6{constructor(t,n,r,i,o,a,u){this.type=t,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=u,this.content=[],this.activeMarks=ZM.none,this.stashMarks=[],this.match=a||(4&u?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Zy.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let n=this.content[this.content.length-1],r;n&&n.isText&&(r=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-r[0].length)))}let i=Zy.from(this.content);return!t&&this.match&&(i=i.append(this.match.fillBefore(Zy.empty,!0))),this.type?this.type.create(this.attrs,i,this.marks):i}popFromStashMark(t){for(let n=this.stashMarks.length-1;n>=0;n--)if(t.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(t){for(let n=0,r=this.pendingMarks;n<r.length;n++){let i=r[n];(this.type?this.type.allowsMarkType(i.type):Qn(i.type,t))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Z3.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Z7{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=Z8(null,n.preserveWhitespace,0)|(r?4:0);o=i?new Z6(i.type,i.attrs,ZM.none,ZM.none,!0,n.topMatch||i.type.contentMatch,a):r?new Z6(null,null,ZM.none,ZM.none,!0,null,a):new Z6(t.schema.topNodeType,null,ZM.none,ZM.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){let n=t.getAttribute("style");if(n){let r=this.readStyles(function(t){let n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r,i=[];for(;r=n.exec(t);)i.push(r[1],r[2].trim());return i}(n));if(!r)return;let[i,o]=r,a=this.top;for(let u=0;u<o.length;u++)this.removePendingMark(o[u],a);for(let s=0;s<i.length;s++)this.addPendingMark(i[s]);this.addElement(t);for(let c=0;c<i.length;c++)this.removePendingMark(i[c],a);for(let l=0;l<o.length;l++)this.addPendingMark(o[l])}else this.addElement(t)}}addTextNode(t){let n=t.nodeValue,r=this.top;if(2&r.options||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(1&r.options)n=2&r.options?n.replace(/\r\n?/g,`
|
|
7
|
-
`):n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=t.previousSibling;(!i||o&&"BR"==o.nodeName||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(t)}else this.findInside(t)}addElement(t,n){let r=t.nodeName.toLowerCase(),i;Z9.hasOwnProperty(r)&&this.parser.normalizeLists&&function(t){for(let n=t.firstChild,r=null;n;n=n.nextSibling){let i=1==n.nodeType?n.nodeName.toLowerCase():null;i&&Z9.hasOwnProperty(i)&&r?(r.appendChild(n),n=r):"li"==i?r=n:i&&(r=null)}}(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));if(o?o.ignore:Z5.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);let a,u=this.top,s=this.needsBlock;if(Z3.hasOwnProperty(r))u.content.length&&u.content[0].isInline&&this.open&&(this.open--,u=this.top),a=!0,u.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t);return}this.addAll(t),a&&this.sync(u),this.needsBlock=s}else this.addElementByRule(t,o,!1===o.consuming?i:void 0)}leafFallback(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
|
|
8
|
-
`))}ignoreFallback(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=ZM.none,r=ZM.none;e:for(let i=0;i<t.length;i+=2)for(let o;;){let a=this.parser.matchStyle(t[i],t[i+1],this,o);if(!a)continue e;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.forEach(t=>{a.clearMark(t)&&(r=t.addToSet(r))}):n=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(n),!1===a.consuming)o=a;else break}return[n,r]}addElementByRule(t,n,r){let i,o,a;n.node?(o=this.parser.schema.nodes[n.node]).isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(t):i=this.enter(o,n.attrs||null,n.preserveWhitespace):(a=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(a));let u=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(t=>this.insertNode(t));else{let s=t;"string"==typeof n.contentElement?s=t.querySelector(n.contentElement):"function"==typeof n.contentElement?s=n.contentElement(t):n.contentElement&&(s=n.contentElement),this.findAround(t,s,!0),this.addAll(s)}i&&this.sync(u)&&this.open--,a&&this.removePendingMark(a,u)}addAll(t,n,r){let i=n||0;for(let o=n?t.childNodes[n]:t.firstChild,a=null==r?null:t.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(o);this.findAtPoint(t,i)}findPlace(t){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],a=o.findWrapping(t);if(a&&(!n||n.length>a.length)&&(n=a,r=o,!a.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let u=0;u<n.length;u++)this.enterInner(n[u],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(t)){this.closeExtra();let r=this.top;r.applyPending(t.type),r.match&&(r.match=r.match.matchType(t.type));let i=r.activeMarks;for(let o=0;o<t.marks.length;o++)(!r.type||r.type.allowsMarkType(t.marks[o].type))&&(i=t.marks[o].addToSet(i));return r.content.push(t.mark(i)),!0}return!1}enter(t,n,r){let i=this.findPlace(t.create(n));return i&&this.enterInner(t,n,!0,r),i}enterInner(t,n=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t);let a=Z8(t,i,o.options);4&o.options&&0==o.content.length&&(a|=4),this.nodes.push(new Z6(t,n,o.activeMarks,o.pendingMarks,r,null,a)),this.open++}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let n=this.open;n>=0;n--)if(this.nodes[n]==t)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)null==this.find[n].pos&&1==t.nodeType&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)null==this.find[i].pos&&1==t.nodeType&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(t,u)=>{for(;t>=0;t--){let s=n[t];if(""==s){if(t==n.length-1||0==t)continue;for(;u>=o;u--)if(a(t-1,u))return!0;return!1}{let c=u>0||0==u&&i?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!c||c.name!=s&&-1==c.groups.indexOf(s))return!1;u--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let i in this.parser.schema.nodes){let o=this.parser.schema.nodes[i];if(o.isTextblock&&o.defaultAttrs)return o}}addPendingMark(t){let n=function(t,n){for(let r=0;r<n.length;r++)if(t.eq(n[r]))return n[r]}(t,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(t)>-1)i.pendingMarks=t.removeFromSet(i.pendingMarks);else{i.activeMarks=t.removeFromSet(i.activeMarks);let o=i.popFromStashMark(t);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==n)break}}}function Qe(t,n){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,n)}function Qt(t){let n={};for(let r in t)n[r]=t[r];return n}function Qn(t,n){let r=n.schema.nodes;for(let i in r){let o=r[i];if(!o.allowsMarkType(t))continue;let a=[],u=t=>{a.push(t);for(let r=0;r<t.edgeCount;r++){let{type:i,next:o}=t.edge(r);if(i==n||0>a.indexOf(o)&&u(o))return!0}};if(u(o.contentMatch))return!0}}class Qr{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=Qo(n).createDocumentFragment());let i=r,o=[];return t.forEach(t=>{if(o.length||t.marks.length){let r=0,a=0;for(;r<o.length&&a<t.marks.length;){let u=t.marks[a];if(!this.marks[u.type.name]){a++;continue}if(!u.eq(o[r][0])||!1===u.type.spec.spanning)break;r++,a++}for(;r<o.length;)i=o.pop()[1];for(;a<t.marks.length;){let s=t.marks[a++],c=this.serializeMark(s,t.isInline,n);c&&(o.push([s,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(t,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=Qr.renderSpec(Qo(n),this.nodes[t.type.name](t));if(i){if(t.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&Qr.renderSpec(Qo(r),i(t,n))}static renderSpec(t,n,r=null){if("string"==typeof n)return{dom:t.createTextNode(n)};if(null!=n.nodeType)return{dom:n};if(n.dom&&null!=n.dom.nodeType)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,u=r?t.createElementNS(r,i):t.createElement(i),s=n[1],c=1;if(s&&"object"==typeof s&&null==s.nodeType&&!Array.isArray(s)){for(let l in c=2,s)if(null!=s[l]){let f=l.indexOf(" ");f>0?u.setAttributeNS(l.slice(0,f),l.slice(f+1),s[l]):u.setAttribute(l,s[l])}}for(let d=c;d<n.length;d++){let p=n[d];if(0===p){if(d<n.length-1||d>c)throw RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}{let{dom:h,contentDOM:m}=Qr.renderSpec(t,p,r);if(u.appendChild(h),m){if(a)throw RangeError("Multiple content holes");a=m}}}return{dom:u,contentDOM:a}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Qr(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=Qi(t.nodes);return n.text||(n.text=t=>t.text),n}static marksFromSchema(t){return Qi(t.marks)}}function Qi(t){let n={};for(let r in t){let i=t[r].spec.toDOM;i&&(n[r]=i)}return n}function Qo(t){return t.document||window.document}function Qa(t,n){return t+65536*n}function Qu(t){return 65535&t}class Qs{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class Qc{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Qc.empty)return Qc.empty}recover(t){var n;let r=0,i=Qu(t);if(!this.inverted)for(let o=0;o<i;o++)r+=this.ranges[3*o+2]-this.ranges[3*o+1];return this.ranges[3*i]+r+(t-(65535&t))/65536}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?i:0);if(s>t)break;let c=this.ranges[u+o],l=this.ranges[u+a],f=s+c;if(t<=f){let d=c?t==s?-1:t==f?1:n:n,p=s+i+(d<0?0:l);if(r)return p;let h=t==(n<0?s:f)?null:Qa(u/3,t-s),m=t==s?2:t==f?1:4;return(n<0?t!=s:t!=f)&&(m|=8),new Qs(p,m,h)}i+=l-c}return r?t+i:new Qs(t+i,0,null)}touches(t,n){let r=0,i=Qu(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?r:0);if(s>t)break;let c=this.ranges[u+o];if(t<=s+c&&u==3*i)return!0;r+=this.ranges[u+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],u=a-(this.inverted?o:0),s=a+(this.inverted?0:o),c=this.ranges[i+n],l=this.ranges[i+r];t(u,u+c,s,s+l),o+=l-c}}invert(){return new Qc(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?Qc.empty:new Qc(t<0?[0,-t,0]:[0,0,t])}}Qc.empty=new Qc([]);class Ql{constructor(t=[],n,r=0,i=t.length){this.maps=t,this.mirror=n,this.from=r,this.to=i}slice(t=0,n=this.maps.length){return new Ql(this.maps,this.mirror,t,n)}copy(){return new Ql(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),null!=n&&this.setMirror(this.maps.length-1,n)}appendMapping(t){for(let n=0,r=this.maps.length;n<t.maps.length;n++){let i=t.getMirror(n);this.appendMap(t.maps[n],null!=i&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this.maps.length+t.maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t.maps[n].invert(),null!=i&&i>n?r-i-1:void 0)}}invert(){let t=new Ql;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this.maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o].mapResult(t,n);if(null!=a.recover){let u=this.getMirror(o);if(null!=u&&u>o&&u<this.to){o=u,t=this.maps[u].recover(a.recover);continue}}i|=a.delInfo,t=a.pos}return r?t:new Qs(t,i,null)}}let Qf=Object.create(null);class Qd{getMap(){return Qc.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw RangeError("Invalid input for Step.fromJSON");let r=Qf[n.stepType];if(!r)throw RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Qf)throw RangeError("Duplicate use of step JSON ID "+t);return Qf[t]=n,n.prototype.jsonID=t,n}}class Qp{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Qp(t,null)}static fail(t){return new Qp(null,t)}static fromReplace(t,n,r,i){try{return Qp.ok(t.replace(n,r,i))}catch(o){if(o instanceof ZT)return Qp.fail(o.message);throw o}}}function Qh(t,n,r){let i=[];for(let o=0;o<t.childCount;o++){let a=t.child(o);a.content.size&&(a=a.copy(Qh(a.content,n,a))),a.isInline&&(a=n(a,r,o)),i.push(a)}return Zy.fromArray(i)}class Qm extends Qd{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new ZS(Qh(n.content,(t,n)=>t.isAtom&&n.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t,i),n.openStart,n.openEnd);return Qp.fromReplace(t,this.from,this.to,o)}invert(){return new Qg(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Qm(n.pos,r.pos,this.mark)}merge(t){return t instanceof Qm&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Qm(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new Qm(n.from,n.to,t.markFromJSON(n.mark))}}Qd.jsonID("addMark",Qm);class Qg extends Qd{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new ZS(Qh(n.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),n.openStart,n.openEnd);return Qp.fromReplace(t,this.from,this.to,r)}invert(){return new Qm(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Qg(n.pos,r.pos,this.mark)}merge(t){return t instanceof Qg&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Qg(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Qg(n.from,n.to,t.markFromJSON(n.mark))}}Qd.jsonID("removeMark",Qg);class Qy extends Qd{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Qp.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Qp.fromReplace(t,this.pos,this.pos+1,new ZS(Zy.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Qy(this.pos,n.marks[i]);return new Qy(this.pos,this.mark)}}return new Qv(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Qy(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Qy(n.pos,t.markFromJSON(n.mark))}}Qd.jsonID("addNodeMark",Qy);class Qv extends Qd{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Qp.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Qp.fromReplace(t,this.pos,this.pos+1,new ZS(Zy.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return n&&this.mark.isInSet(n.marks)?new Qy(this.pos,this.mark):this}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Qv(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Qv(n.pos,t.markFromJSON(n.mark))}}Qd.jsonID("removeNodeMark",Qv);class Qb extends Qd{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&QM(t,this.from,this.to)?Qp.fail("Structure replace would overwrite content"):Qp.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Qc([this.from,this.to-this.from,this.slice.size])}invert(t){return new Qb(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Qb(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Qb)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let n=this.slice.size+t.slice.size==0?ZS.empty:new ZS(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Qb(t.from,this.to,n,this.structure)}}{let r=this.slice.size+t.slice.size==0?ZS.empty:new ZS(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Qb(this.from,this.to+(t.to-t.from),r,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new Qb(n.from,n.to,ZS.fromJSON(t,n.slice),!!n.structure)}}Qd.jsonID("replace",Qb);class Qx extends Qd{constructor(t,n,r,i,o,a,u=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=u}apply(t){if(this.structure&&(QM(t,this.from,this.gapFrom)||QM(t,this.gapTo,this.to)))return Qp.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Qp.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Qp.fromReplace(t,this.from,this.to,r):Qp.fail("Content does not fit in gap")}getMap(){return new Qc([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Qx(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Qx(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Qx(n.from,n.to,n.gapFrom,n.gapTo,ZS.fromJSON(t,n.slice),n.insert,!!n.structure)}}function QM(t,n,r){let i=t.resolve(n),o=r-n,a=i.depth;for(;o>0&&a>0&&i.indexAfter(a)==i.node(a).childCount;)a--,o--;if(o>0){let u=i.node(a).maybeChild(i.indexAfter(a));for(;o>0;){if(!u||u.isLeaf)return!0;u=u.firstChild,o--}}return!1}function QT(t,n,r){return(0==n||t.canReplace(n,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function QS(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),a=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,a,n))return r;if(0==r||i.type.spec.isolating||!QT(i,o,a))break}return null}function Qw(t,n,r=null,i=t){let o=function(t,n){let{parent:r,startIndex:i,endIndex:o}=t,a=r.contentMatchAt(i).findWrapping(n);if(!a)return null;let u=a.length?a[0]:n;return r.canReplaceWith(i,o,u)?a:null}(t,n),a=o&&function(t,n){let{parent:r,startIndex:i,endIndex:o}=t,a=r.child(i),u=n.contentMatch.findWrapping(a.type);if(!u)return null;let s=(u.length?u[u.length-1]:n).contentMatch;for(let c=i;s&&c<o;c++)s=s.matchType(r.child(c).type);return s&&s.validEnd?u:null}(i,n);return a?o.map(Q_).concat({type:n,attrs:r}).concat(a.map(Q_)):null}function Q_(t){return{type:t,attrs:null}}function QI(t,n,r=1,i){let o=t.resolve(n),a=o.depth-r,u=i&&i[i.length-1]||o.parent;if(a<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!u.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let s=o.depth-1,c=r-2;s>a;s--,c--){let l=o.node(s),f=o.index(s);if(l.type.spec.isolating)return!1;let d=l.content.cutByIndex(f,l.childCount),p=i&&i[c+1];p&&(d=d.replaceChild(0,p.type.create(p.attrs)));let h=i&&i[c]||l;if(!l.canReplace(f+1,l.childCount)||!h.type.validContent(d))return!1}let m=o.indexAfter(a),g=i&&i[0];return o.node(a).canReplaceWith(m,m,g?g.type:o.node(a+1).type)}function QO(t,n){let r=t.resolve(n),i=r.index();return Qk(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(i,i+1)}function Qk(t,n){return!!(t&&n&&!t.isLeaf&&t.canAppend(n))}function QC(t,n,r=-1){let i=t.resolve(n);for(let o=i.depth;;o--){let a,u,s=i.index(o);if(o==i.depth?(a=i.nodeBefore,u=i.nodeAfter):r>0?(a=i.node(o+1),s++,u=i.node(o).maybeChild(s)):(a=i.node(o).maybeChild(s-1),u=i.node(o+1)),a&&!a.isTextblock&&Qk(a,u)&&i.node(o).canReplace(s,s+1))return n;if(0==o)break;n=r<0?i.before(o):i.after(o)}}function QN(t,n,r=n,i=ZS.empty){if(n==r&&!i.size)return null;let o=t.resolve(n),a=t.resolve(r);return Qj(o,a,i)?new Qb(n,r,i):new QE(o,a,i).fit()}function Qj(t,n,r){return!r.openStart&&!r.openEnd&&t.start()==n.start()&&t.parent.canReplace(t.index(),n.index(),r.content)}Qd.jsonID("replaceAround",Qx);class QE{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=Zy.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let a=t.depth;a>0;a--)this.placed=Zy.from(t.node(a).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let n=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(n<0?this.$to:i.doc.resolve(n));if(!o)return null;let a=this.placed,u=i.depth,s=o.depth;for(;u&&s&&1==a.childCount;)a=a.firstChild.content,u--,s--;let c=new ZS(a,u,s);return n>-1?new Qx(i.pos,n,this.$to.pos,this.$to.end(),c,r):c.size||i.pos!=this.$to.pos?new Qb(i.pos,o.pos,c):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let a=1;a<=2;a++)for(let u=1==a?t:this.unplaced.openStart;u>=0;u--){let s,c=null,l=(u?(c=QA(this.unplaced.content,u-1).firstChild).content:this.unplaced.content).firstChild;for(let f=this.depth;f>=0;f--){let{type:d,match:p}=this.frontier[f],h,m=null;if(1==a&&(l?p.matchType(l.type)||(m=p.fillBefore(Zy.from(l),!1)):c&&d.compatibleContent(c.type)))return{sliceDepth:u,frontierDepth:f,parent:c,inject:m};if(2==a&&l&&(h=p.findWrapping(l.type)))return{sliceDepth:u,frontierDepth:f,parent:c,wrap:h};if(c&&p.matchType(c.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=QA(t,n);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new ZS(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=QA(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new ZS(QR(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new ZS(QR(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let a=0;a<o.length;a++)this.openFrontierNode(o[a]);let u=this.unplaced,s=r?r.content:u.content,c=u.openStart-t,l=0,f=[],{match:d,type:p}=this.frontier[n];if(i){for(let h=0;h<i.childCount;h++)f.push(i.child(h));d=d.matchFragment(i)}let m=s.size+t-(u.content.size-u.openEnd);for(;l<s.childCount;){let g=s.child(l),y=d.matchType(g.type);if(!y)break;(++l>1||0==c||g.content.size)&&(d=y,f.push(QL(g.mark(p.allowedMarks(g.marks)),1==l?c:0,l==s.childCount?m:-1)))}let v=l==s.childCount;v||(m=-1),this.placed=QD(this.placed,n,Zy.from(f)),this.frontier[n].match=d,v&&m<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,x=s;b<m;b++){let M=x.lastChild;this.frontier.push({type:M.type,match:M.contentMatchAt(M.childCount)}),x=M.content}this.unplaced=v?0==t?ZS.empty:new ZS(QR(u.content,t-1,1),t-1,m<0?u.openEnd:t-1):new ZS(QR(u.content,t,l),u.openStart,u.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!QP(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return -1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),a=QP(t,n,i,r,o);if(a){for(let u=n-1;u>=0;u--){let{match:s,type:c}=this.frontier[u],l=QP(t,u,c,s,!0);if(!l||l.childCount)continue e}return{depth:n,fit:a,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=QD(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,o)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=QD(this.placed,this.depth,Zy.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(Zy.empty,!0);t.childCount&&(this.placed=QD(this.placed,this.frontier.length,t))}}function QR(t,n,r){return 0==n?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(QR(t.firstChild.content,n-1,r)))}function QD(t,n,r){return 0==n?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(QD(t.lastChild.content,n-1,r)))}function QA(t,n){for(let r=0;r<n;r++)t=t.firstChild.content;return t}function QL(t,n,r){if(n<=0)return t;let i=t.content;return n>1&&(i=i.replaceChild(0,QL(i.firstChild,n-1,1==i.childCount?r-1:0))),n>0&&(i=t.type.contentMatch.fillBefore(i).append(i),r<=0&&(i=i.append(t.type.contentMatch.matchFragment(i).fillBefore(Zy.empty,!0)))),t.copy(i)}function QP(t,n,r,i,o){let a=t.node(n),u=o?t.indexAfter(n):t.index(n);if(u==a.childCount&&!r.compatibleContent(a.type))return null;let s=i.fillBefore(a.content,!0,u);return s&&!function(t,n,r){for(let i=r;i<n.childCount;i++)if(!t.allowsMarks(n.child(i).marks))return!0;return!1}(r,a.content,u)?s:null}function QF(t){return t.spec.defining||t.spec.definingForContent}function Qz(t,n,r,i,o){if(n<r){let a=t.firstChild;t=t.replaceChild(0,a.copy(Qz(a.content,n+1,r,i,a)))}if(n>i){let u=o.contentMatchAt(0),s=u.fillBefore(t).append(t);t=s.append(u.matchFragment(s).fillBefore(Zy.empty,!0))}return t}function QU(t,n){let r=[],i=Math.min(t.depth,n.depth);for(let o=i;o>=0;o--){let a=t.start(o);if(a<t.pos-(t.depth-o)||n.end(o)>n.pos+(n.depth-o)||t.node(o).type.spec.isolating||n.node(o).type.spec.isolating)break;(a==n.start(o)||o==t.depth&&o==n.depth&&t.parent.inlineContent&&n.parent.inlineContent&&o&&n.start(o-1)==a-1)&&r.push(o)}return r}class QW extends Qd{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Qp.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return Qp.fromReplace(t,this.pos,this.pos+1,new ZS(Zy.from(o),0,n.isLeaf?0:1))}getMap(){return Qc.empty}invert(t){return new QW(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new QW(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if("number"!=typeof n.pos||"string"!=typeof n.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new QW(n.pos,n.attr,n.value)}}Qd.jsonID("attr",QW);let QB=class extends Error{};(QB=function t(n){let r=Error.call(this,n);return r.__proto__=t.prototype,r}).prototype=Object.create(Error.prototype),QB.prototype.constructor=QB,QB.prototype.name="TransformError";class QV{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Ql}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new QB(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=ZS.empty){let i=QN(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new ZS(Zy.from(r),0,0))}delete(t,n){return this.replace(t,n,ZS.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return function(t,n,r,i){if(!i.size)return t.deleteRange(n,r);let o=t.doc.resolve(n),a=t.doc.resolve(r);if(Qj(o,a,i))return t.step(new Qb(n,r,i));let u=QU(o,t.doc.resolve(r));0==u[u.length-1]&&u.pop();let s=-(o.depth+1);u.unshift(s);for(let c=o.depth,l=o.pos-1;c>0;c--,l--){let f=o.node(c).type.spec;if(f.defining||f.definingAsContext||f.isolating)break;u.indexOf(c)>-1?s=c:o.before(c)==l&&u.splice(1,0,-c)}let d=u.indexOf(s),p=[],h=i.openStart;for(let m=i.content,g=0;;g++){let y=m.firstChild;if(p.push(y),g==i.openStart)break;m=y.content}for(let v=h-1;v>=0;v--){let b=p[v].type,x=QF(b);if(x&&o.node(d).type!=b)h=v;else if(x||!b.isTextblock)break}for(let M=i.openStart;M>=0;M--){let T=(M+h+1)%(i.openStart+1),S=p[T];if(S)for(let w=0;w<u.length;w++){let _=u[(w+d)%u.length],I=!0;_<0&&(I=!1,_=-_);let O=o.node(_-1),k=o.index(_-1);if(O.canReplaceWith(k,k,S.type,S.marks))return t.replace(o.before(_),I?a.after(_):r,new ZS(Qz(i.content,0,i.openStart,T),T,i.openEnd))}}let C=t.steps.length;for(let N=u.length-1;N>=0&&(t.replace(n,r,i),!(t.steps.length>C));N--){let j=u[N];j<0||(n=o.before(j),r=a.after(j))}}(this,t,n,r),this}replaceRangeWith(t,n,r){return function(t,n,r,i){if(!i.isInline&&n==r&&t.doc.resolve(n).parent.content.size){let o=function(t,n,r){let i=t.resolve(n);if(i.parent.canReplaceWith(i.index(),i.index(),r))return n;if(0==i.parentOffset)for(let o=i.depth-1;o>=0;o--){let a=i.index(o);if(i.node(o).canReplaceWith(a,a,r))return i.before(o+1);if(a>0)return null}if(i.parentOffset==i.parent.content.size)for(let u=i.depth-1;u>=0;u--){let s=i.indexAfter(u);if(i.node(u).canReplaceWith(s,s,r))return i.after(u+1);if(s<i.node(u).childCount)break}return null}(t.doc,n,i.type);null!=o&&(n=r=o)}t.replaceRange(n,r,new ZS(Zy.from(i),0,0))}(this,t,n,r),this}deleteRange(t,n){return function(t,n,r){let i=t.doc.resolve(n),o=t.doc.resolve(r),a=QU(i,o);for(let u=0;u<a.length;u++){let s=a[u],c=u==a.length-1;if(c&&0==s||i.node(s).type.contentMatch.validEnd)return t.delete(i.start(s),o.end(s));if(s>0&&(c||i.node(s-1).canReplace(i.index(s-1),o.indexAfter(s-1))))return t.delete(i.before(s),o.after(s))}for(let l=1;l<=i.depth&&l<=o.depth;l++)if(n-i.start(l)==i.depth-l&&r>i.end(l)&&o.end(l)-r!=o.depth-l)return t.delete(i.before(l),r);t.delete(n,r)}(this,t,n),this}lift(t,n){return function(t,n,r){let{$from:i,$to:o,depth:a}=n,u=i.before(a+1),s=o.after(a+1),c=u,l=s,f=Zy.empty,d=0;for(let p=a,h=!1;p>r;p--)h||i.index(p)>0?(h=!0,f=Zy.from(i.node(p).copy(f)),d++):c--;let m=Zy.empty,g=0;for(let y=a,v=!1;y>r;y--)v||o.after(y+1)<o.end(y)?(v=!0,m=Zy.from(o.node(y).copy(m)),g++):l++;t.step(new Qx(c,l,u,s,new ZS(f.append(m),d,g),f.size-d,!0))}(this,t,n),this}join(t,n=1){return function(t,n,r){let i=new Qb(n-r,n+r,ZS.empty,!0);t.step(i)}(this,t,n),this}wrap(t,n){return function(t,n,r){let i=Zy.empty;for(let o=r.length-1;o>=0;o--){if(i.size){let a=r[o].type.contentMatch.matchFragment(i);if(!a||!a.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=Zy.from(r[o].type.create(r[o].attrs,i))}let u=n.start,s=n.end;t.step(new Qx(u,s,u,s,new ZS(i,0,0),r.length,!0))}(this,t,n),this}setBlockType(t,n=t,r,i=null){return function(t,n,r,i,o){if(!i.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let a=t.steps.length;t.doc.nodesBetween(n,r,(n,r)=>{var u,s,c;let l,f;if(n.isTextblock&&!n.hasMarkup(i,o)&&(u=t.doc,s=t.mapping.slice(a).map(r),c=i,l=u.resolve(s),f=l.index(),l.parent.canReplaceWith(f,f+1,c))){t.clearIncompatible(t.mapping.slice(a).map(r,1),i);let d=t.mapping.slice(a),p=d.map(r,1),h=d.map(r+n.nodeSize,1);return t.step(new Qx(p,h,p+1,h-1,new ZS(Zy.from(i.create(o,null,n.marks)),0,0),1,!0)),!1}})}(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return function(t,n,r,i,o){let a=t.doc.nodeAt(n);if(!a)throw RangeError("No node at given position");r||(r=a.type);let u=r.create(i,null,o||a.marks);if(a.isLeaf)return t.replaceWith(n,n+a.nodeSize,u);if(!r.validContent(a.content))throw RangeError("Invalid content for node type "+r.name);t.step(new Qx(n,n+a.nodeSize,n+1,n+a.nodeSize-1,new ZS(Zy.from(u),0,0),1,!0))}(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new QW(t,n,r)),this}addNodeMark(t,n){return this.step(new Qy(t,n)),this}removeNodeMark(t,n){if(!(n instanceof ZM)){let r=this.doc.nodeAt(t);if(!r)throw RangeError("No node at position "+t);if(!(n=n.isInSet(r.marks)))return this}return this.step(new Qv(t,n)),this}split(t,n=1,r){return function(t,n,r=1,i){let o=t.doc.resolve(n),a=Zy.empty,u=Zy.empty;for(let s=o.depth,c=o.depth-r,l=r-1;s>c;s--,l--){a=Zy.from(o.node(s).copy(a));let f=i&&i[l];u=Zy.from(f?f.type.create(f.attrs,u):o.node(s).copy(u))}t.step(new Qb(n,n,new ZS(a.append(u),r,r),!0))}(this,t,n,r),this}addMark(t,n,r){var i,o,a,u;let s,c,l,f;return i=this,s=[],c=[],i.doc.nodesBetween(t,n,(i,o,a)=>{if(!i.isInline)return;let u=i.marks;if(!r.isInSet(u)&&a.type.allowsMarkType(r.type)){let d=Math.max(o,t),p=Math.min(o+i.nodeSize,n),h=r.addToSet(u);for(let m=0;m<u.length;m++)u[m].isInSet(h)||(l&&l.to==d&&l.mark.eq(u[m])?l.to=p:s.push(l=new Qg(d,p,u[m])));f&&f.to==d?f.to=p:c.push(f=new Qm(d,p,r))}}),s.forEach(t=>i.step(t)),c.forEach(t=>i.step(t)),this}removeMark(t,n,r){var i,o,a,u;let s,c;return i=this,s=[],c=0,i.doc.nodesBetween(t,n,(i,o)=>{if(!i.isInline)return;c++;let a=null;if(r instanceof Z0){let u=i.marks,l;for(;l=r.isInSet(u);)(a||(a=[])).push(l),u=l.removeFromSet(u)}else r?r.isInSet(i.marks)&&(a=[r]):a=i.marks;if(a&&a.length){let f=Math.min(o+i.nodeSize,n);for(let d=0;d<a.length;d++){let p=a[d],h;for(let m=0;m<s.length;m++){let g=s[m];g.step==c-1&&p.eq(s[m].style)&&(h=g)}h?(h.to=f,h.step=c):s.push({style:p,from:Math.max(o,t),to:f,step:c})}}}),s.forEach(t=>i.step(new Qg(t.from,t.to,t.style))),this}clearIncompatible(t,n,r){return function(t,n,r,i=r.contentMatch){let o=t.doc.nodeAt(n),a=[],u=n+1;for(let s=0;s<o.childCount;s++){let c=o.child(s),l=u+c.nodeSize,f=i.matchType(c.type);if(f){i=f;for(let d=0;d<c.marks.length;d++)r.allowsMarkType(c.marks[d].type)||t.step(new Qg(u,l,c.marks[d]))}else a.push(new Qb(u,l,ZS.empty));u=l}if(!i.validEnd){let p=i.fillBefore(Zy.empty,!0);t.replace(u,u,new ZS(p,0,0))}for(let h=a.length-1;h>=0;h--)t.step(a[h])}(this,t,n,r),this}}let Q$=Object.create(null);class QK{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new QY(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=ZS.empty){let r=n.content.lastChild,i=null;for(let o=0;o<n.openEnd;o++)i=r,r=r.lastChild;let a=t.steps.length,u=this.ranges;for(let s=0;s<u.length;s++){let{$from:c,$to:l}=u[s],f=t.mapping.slice(a);t.replaceRange(f.map(c.pos),f.map(l.pos),s?ZS.empty:n),0==s&&Q2(t,a,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:u}=i[o],s=t.mapping.slice(r),c=s.map(a.pos),l=s.map(u.pos);o?t.deleteRange(c,l):(t.replaceRangeWith(c,l,n),Q2(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new QZ(t):Q1(t.node(0),t.parent,t.pos,t.index(),n,r);if(i)return i;for(let o=t.depth-1;o>=0;o--){let a=n<0?Q1(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):Q1(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,n,r);if(a)return a}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new QX(t.node(0))}static atStart(t){return Q1(t,t,0,0,1)||new QX(t)}static atEnd(t){return Q1(t,t,t.content.size,t.childCount,-1)||new QX(t)}static fromJSON(t,n){if(!n||!n.type)throw RangeError("Invalid input for Selection.fromJSON");let r=Q$[n.type];if(!r)throw RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Q$)throw RangeError("Duplicate use of selection JSON ID "+t);return Q$[t]=n,n.prototype.jsonID=t,n}getBookmark(){return QZ.between(this.$anchor,this.$head).getBookmark()}}QK.prototype.visible=!0;class QY{constructor(t,n){this.$from=t,this.$to=n}}let Qq=!1;function QG(t){Qq||t.parent.inlineContent||(Qq=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class QZ extends QK{constructor(t,n=t){QG(t),QG(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return QK.near(r);let i=t.resolve(n.map(this.anchor));return new QZ(i.parent.inlineContent?i:r,r)}replace(t,n=ZS.empty){if(super.replace(t,n),n==ZS.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof QZ&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new QQ(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new QZ(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let i=t.resolve(n);return new this(i,r==n?i:t.resolve(r))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=QK.findFrom(n,r,!0)||QK.findFrom(n,-r,!0);if(!o)return QK.near(n,r);n=o.$head}return t.parent.inlineContent||(0==i?t=n:(t=(QK.findFrom(t,-r,!0)||QK.findFrom(t,r,!0)).$anchor).pos<n.pos!=i<0&&(t=n)),new QZ(t,n)}}QK.jsonID("text",QZ);class QQ{constructor(t,n){this.anchor=t,this.head=n}map(t){return new QQ(t.map(this.anchor),t.map(this.head))}resolve(t){return QZ.between(t.resolve(this.anchor),t.resolve(this.head))}}class QH extends QK{constructor(t){let n=t.nodeAfter;super(t,t.node(0).resolve(t.pos+n.nodeSize)),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=t.resolve(i);return r?QK.near(o):new QH(o)}content(){return new ZS(Zy.from(this.node),0,0)}eq(t){return t instanceof QH&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new QJ(this.anchor)}static fromJSON(t,n){if("number"!=typeof n.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new QH(t.resolve(n.anchor))}static create(t,n){return new QH(t.resolve(n))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}QH.prototype.visible=!1,QK.jsonID("node",QH);class QJ{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new QQ(r,r):new QJ(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&QH.isSelectable(r)?new QH(n):QK.near(n)}}class QX extends QK{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=ZS.empty){if(n==ZS.empty){t.delete(0,t.doc.content.size);let r=QK.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new QX(t)}map(t){return new QX(t)}eq(t){return t instanceof QX}getBookmark(){return Q0}}QK.jsonID("all",QX);let Q0={map(){return this},resolve:t=>new QX(t)};function Q1(t,n,r,i,o,a=!1){if(n.inlineContent)return QZ.create(t,r);for(let u=i-(o>0?0:1);o>0?u<n.childCount:u>=0;u+=o){let s=n.child(u);if(s.isAtom){if(!a&&QH.isSelectable(s))return QH.create(t,r-(o<0?s.nodeSize:0))}else{let c=Q1(t,s,r+o,o<0?s.childCount:0,o,a);if(c)return c}r+=s.nodeSize*o}return null}function Q2(t,n,r){let i=t.steps.length-1;if(i<n)return;let o=t.steps[i];if(!(o instanceof Qb||o instanceof Qx))return;let a;t.mapping.maps[i].forEach((t,n,r,i)=>{null==a&&(a=i)}),t.setSelection(QK.near(t.doc.resolve(a),r))}class Q4 extends QV{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return ZM.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,n){super.addStep(t,n),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ZM.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(null==n)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(null==r&&(r=n),r=r??n,!t)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let a=this.doc.resolve(n);o=r==n?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(t,o)),this.selection.empty||this.setSelection(QK.near(this.selection.$to)),this}}setMeta(t,n){return this.meta["string"==typeof t?t:t.key]=n,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function Q3(t,n){return n&&t?t.bind(n):t}class Q5{constructor(t,n,r){this.name=t,this.init=Q3(n.init,r),this.apply=Q3(n.apply,r)}}let Q9=[new Q5("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new Q5("selection",{init:(t,n)=>t.selection||QK.atStart(n.doc),apply:t=>t.selection}),new Q5("storedMarks",{init:t=>t.storedMarks||null,apply:(t,n,r,i)=>i.selection.$cursor?t.storedMarks:null}),new Q5("scrollToSelection",{init:()=>0,apply:(t,n)=>t.scrolledIntoView?n+1:n})];class Q8{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Q9.slice(),n&&n.forEach(t=>{if(this.pluginsByKey[t.key])throw RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new Q5(t.key,t.spec.state,t))})}}class Q6{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),i=null;for(;;){let o=!1;for(let a=0;a<this.config.plugins.length;a++){let u=this.config.plugins[a];if(u.spec.appendTransaction){let s=i?i[a].n:0,c=i?i[a].state:this,l=s<n.length&&u.spec.appendTransaction.call(u,s?n.slice(s):n,c,r);if(l&&r.filterTransaction(l,a)){if(l.setMeta("appendedTransaction",t),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<a?{state:r,n:n.length}:{state:this,n:0})}n.push(l),r=r.applyInner(l),o=!0}i&&(i[a]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let n=new Q6(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(t,this[o.name],this,n)}return n}get tr(){return new Q4(this)}static create(t){let n=new Q8(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new Q6(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(t,r);return r}reconfigure(t){let n=new Q8(this.schema,t.plugins),r=n.fields,i=new Q6(n);for(let o=0;o<r.length;o++){let a=r[o].name;i[a]=this.hasOwnProperty(a)?this[a]:r[o].init(t,i)}return i}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(t=>t.toJSON())),t&&"object"==typeof t)for(let r in t){if("doc"==r||"selection"==r)throw RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(t,n,r){if(!n)throw RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw RangeError("Required config field 'schema' missing");let i=new Q8(t.schema,t.plugins),o=new Q6(i);return i.fields.forEach(i=>{if("doc"==i.name)o.doc=ZL.fromJSON(t.schema,n.doc);else if("selection"==i.name)o.selection=QK.fromJSON(o.doc,n.selection);else if("storedMarks"==i.name)n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let a in r){let u=r[a],s=u.spec.state;if(u.key==i.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[i.name]=s.fromJSON.call(u,t,n[a],o);return}}o[i.name]=i.init(t,o)}}),o}}class Q7{constructor(t){this.spec=t,this.props={},t.props&&function t(n,r,i){for(let o in n){let a=n[o];a instanceof Function?a=a.bind(r):"handleDOMEvents"==o&&(a=t(a,r,{})),i[o]=a}return i}(t.props,this,this.props),this.key=t.key?t.key.key:Ht("plugin")}getState(t){return t[this.key]}}let He=Object.create(null);function Ht(t){return t in He?t+"$"+ ++He[t]:(He[t]=0,t+"$")}class Hn{constructor(t="key"){this.key=Ht(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}let Hr=function(t){for(var n=0;;n++)if(!(t=t.previousSibling))return n},Hi=function(t){let n=t.assignedSlot||t.parentNode;return n&&11==n.nodeType?n.host:n},Ho=null,Ha=function(t,n,r){let i=Ho||(Ho=document.createRange());return i.setEnd(t,r??t.nodeValue.length),i.setStart(t,n||0),i},Hu=function(t,n,r,i){return r&&(Hc(t,n,r,i,-1)||Hc(t,n,r,i,1))},Hs=/^(img|br|input|textarea|hr)$/i;function Hc(t,n,r,i,o){for(;;){if(t==r&&n==i)return!0;if(n==(o<0?0:Hl(t))){let a=t.parentNode;if(!a||1!=a.nodeType||Hf(t)||Hs.test(t.nodeName)||"false"==t.contentEditable)return!1;n=Hr(t)+(o<0?0:1),t=a}else{if(1!=t.nodeType||"false"==(t=t.childNodes[n+(o<0?-1:0)]).contentEditable)return!1;n=o<0?Hl(t):0}}}function Hl(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Hf(t){let n;for(let r=t;r&&!(n=r.pmViewDesc);r=r.parentNode);return n&&n.node&&n.node.isBlock&&(n.dom==t||n.contentDOM==t)}let Hd=function(t){return t.focusNode&&Hu(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Hp(t,n){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=n,r}function Hh(t,n,r){if(t.caretPositionFromPoint)try{let i=t.caretPositionFromPoint(n,r);if(i)return{node:i.offsetNode,offset:i.offset}}catch{}if(t.caretRangeFromPoint){let o=t.caretRangeFromPoint(n,r);if(o)return{node:o.startContainer,offset:o.startOffset}}}let Hm="u">typeof navigator?navigator:null,Hg="u">typeof document?document:null,Hy=Hm&&Hm.userAgent||"",Hv=/Edge\/(\d+)/.exec(Hy),Hb=/MSIE \d/.exec(Hy),Hx=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Hy),HM=!!(Hb||Hx||Hv),HT=Hb?document.documentMode:Hx?+Hx[1]:Hv?+Hv[1]:0,HS=!HM&&/gecko\/(\d+)/i.test(Hy);HS&&(/Firefox\/(\d+)/.exec(Hy)||[0,0])[1];let Hw=!HM&&/Chrome\/(\d+)/.exec(Hy),H_=!!Hw,HI=Hw?+Hw[1]:0,HO=!HM&&!!Hm&&/Apple Computer/.test(Hm.vendor),Hk=HO&&(/Mobile\/\w+/.test(Hy)||!!Hm&&Hm.maxTouchPoints>2),HC=Hk||!!Hm&&/Mac/.test(Hm.platform),HN=!!Hm&&/Win/.test(Hm.platform),Hj=/Android \d/.test(Hy),HE=!!Hg&&"webkitFontSmoothing"in Hg.documentElement.style,HR=HE?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function HD(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function HA(t,n){return"number"==typeof t?t:t[n]}function HL(t){let n=t.getBoundingClientRect(),r=n.width/t.offsetWidth||1,i=n.height/t.offsetHeight||1;return{left:n.left,right:n.left+t.clientWidth*r,top:n.top,bottom:n.top+t.clientHeight*i}}function HP(t,n,r){let i=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,a=t.dom.ownerDocument;for(let u=r||t.dom;u;u=Hi(u)){if(1!=u.nodeType)continue;let s=u,c=s==a.body,l=c?HD(a):HL(s),f=0,d=0;if(n.top<l.top+HA(i,"top")?d=-(l.top-n.top+HA(o,"top")):n.bottom>l.bottom-HA(i,"bottom")&&(d=n.bottom-l.bottom+HA(o,"bottom")),n.left<l.left+HA(i,"left")?f=-(l.left-n.left+HA(o,"left")):n.right>l.right-HA(i,"right")&&(f=n.right-l.right+HA(o,"right")),f||d){if(c)a.defaultView.scrollBy(f,d);else{let p=s.scrollLeft,h=s.scrollTop;d&&(s.scrollTop+=d),f&&(s.scrollLeft+=f);let m=s.scrollLeft-p,g=s.scrollTop-h;n={left:n.left-m,top:n.top-g,right:n.right-m,bottom:n.bottom-g}}}if(c)break}}function HF(t){let n=[],r=t.ownerDocument;for(let i=t;i&&(n.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),t!=r);i=Hi(i));return n}function Hz(t,n){for(let r=0;r<t.length;r++){let{dom:i,top:o,left:a}=t[r];i.scrollTop!=o+n&&(i.scrollTop=o+n),i.scrollLeft!=a&&(i.scrollLeft=a)}}let HU=null;function HW(t,n){return t.left>=n.left-1&&t.left<=n.right+1&&t.top>=n.top-1&&t.top<=n.bottom+1}function HB(t){return t.top<t.bottom||t.left<t.right}function HV(t,n){let r=t.getClientRects();if(r.length){let i=r[n<0?0:r.length-1];if(HB(i))return i}return Array.prototype.find.call(r,HB)||t.getBoundingClientRect()}let H$=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function HK(t,n,r){let{node:i,offset:o,atom:a}=t.docView.domFromPos(n,r<0?-1:1),u=HE||HS;if(3==i.nodeType){if(u&&(H$.test(i.nodeValue)||(r<0?!o:o==i.nodeValue.length))){let s=HV(Ha(i,o,o),r);if(HS&&o&&/\s/.test(i.nodeValue[o-1])&&o<i.nodeValue.length){let c=HV(Ha(i,o-1,o-1),-1);if(c.top==s.top){let l=HV(Ha(i,o,o+1),-1);if(l.top!=s.top)return HY(l,l.left<c.left)}}return s}{let f=o,d=o,p=r<0?1:-1;return r<0&&!o?(d++,p=-1):r>=0&&o==i.nodeValue.length?(f--,p=1):r<0?f--:d++,HY(HV(Ha(i,f,d),p),p<0)}}if(!t.state.doc.resolve(n-(a||0)).parent.inlineContent){if(null==a&&o&&(r<0||o==Hl(i))){let h=i.childNodes[o-1];if(1==h.nodeType)return Hq(h.getBoundingClientRect(),!1)}if(null==a&&o<Hl(i)){let m=i.childNodes[o];if(1==m.nodeType)return Hq(m.getBoundingClientRect(),!0)}return Hq(i.getBoundingClientRect(),r>=0)}if(null==a&&o&&(r<0||o==Hl(i))){let g=i.childNodes[o-1],y=3==g.nodeType?Ha(g,Hl(g)-(u?0:1)):1!=g.nodeType||"BR"==g.nodeName&&g.nextSibling?null:g;if(y)return HY(HV(y,1),!1)}if(null==a&&o<Hl(i)){let v=i.childNodes[o];for(;v.pmViewDesc&&v.pmViewDesc.ignoreForCoords;)v=v.nextSibling;let b=v?3==v.nodeType?Ha(v,0,u?0:1):1==v.nodeType?v:null:null;if(b)return HY(HV(b,-1),!0)}return HY(HV(3==i.nodeType?Ha(i):i,-r),r>=0)}function HY(t,n){if(0==t.width)return t;let r=n?t.left:t.right;return{top:t.top,bottom:t.bottom,left:r,right:r}}function Hq(t,n){if(0==t.height)return t;let r=n?t.top:t.bottom;return{top:r,bottom:r,left:t.left,right:t.right}}function HG(t,n,r){let i=t.state,o=t.root.activeElement;i!=n&&t.updateState(n),o!=t.dom&&t.focus();try{return r()}finally{i!=n&&t.updateState(i),o!=t.dom&&o&&o.focus()}}let HZ=/[\u0590-\u08ac]/,HQ=null,HH=null,HJ=!1;class HX{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=0,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==t)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,r){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(r<0){let i,o;if(t==this.contentDOM)i=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.previousSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(o)+o.size:this.posAtStart}{let a,u;if(t==this.contentDOM)a=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;a=t.nextSibling}for(;a&&!((u=a.pmViewDesc)&&u.parent==this);)a=a.nextSibling;return a?this.posBeforeChild(u):this.posAtEnd}}let s;if(t==this.dom&&this.contentDOM)s=n>Hr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==n)for(let c=t;;c=c.parentNode){if(c==this.dom){s=!1;break}if(c.previousSibling)break}if(null==s&&n==t.childNodes.length)for(let l=t;;l=l.parentNode){if(l==this.dom){s=!0;break}if(l.nextSibling)break}}return s??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let o=this.getDesc(i),a;if(o&&(!n||o.node)){if(!r||!(a=o.nodeDOM)||(1==a.nodeType?a.contains(1==t.nodeType?t:t.parentNode):a==t))return o;r=!1}}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(t,n,r)}return -1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==t&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(t<o)return i.descAt(t-r-i.border);r=o}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let a=this.children[r],u=o+a.size;if(u>t||a instanceof H9){i=t-o;break}o=u}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof H0&&s.side>=0;r--);if(n<=0){let c,l=!0;for(;!(!(c=r?this.children[r-1]:null)||c.dom.parentNode==this.contentDOM);r--,l=!1);return c&&n&&l&&!c.border&&!c.domAtom?c.domFromPos(c.size,n):{node:this.contentDOM,offset:c?Hr(c.dom)+1:0}}{let f,d=!0;for(;!(!(f=r<this.children.length?this.children[r]:null)||f.dom.parentNode==this.contentDOM);r++,d=!1);return f&&d&&!f.border&&!f.domAtom?f.domFromPos(0,n):{node:this.contentDOM,offset:f?Hr(f.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(0==this.children.length)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let a=r,u=0;;u++){let s=this.children[u],c=a+s.size;if(-1==i&&t<=c){let l=a+s.border;if(t>=l&&n<=c-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(t,n,l);t=a;for(let f=u;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=Hr(d.dom)+1;break}t-=d.size}-1==i&&(i=0)}if(i>-1&&(c>n||u==this.children.length-1)){n=c;for(let p=u+1;p<this.children.length;p++){let h=this.children[p];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){o=Hr(h.dom);break}n+=h.size}-1==o&&(o=this.contentDOM.childNodes.length);break}a=c}return{node:this.contentDOM,from:t,to:n,fromOffset:i,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return 0==n.size||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(1!=n.nodeType||r==n.childNodes.length)throw RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,i=!1){let o=Math.min(t,n),a=Math.max(t,n);for(let u=0,s=0;u<this.children.length;u++){let c=this.children[u],l=s+c.size;if(o>s&&a<l)return c.setSelection(t-s-c.border,n-s-c.border,r,i);s=l}let f=this.domFromPos(t,t?-1:1),d=n==t?f:this.domFromPos(n,n?-1:1),p=r.getSelection(),h=!1;if((HS||HO)&&t==n){let{node:m,offset:g}=f;if(3==m.nodeType){if((h=!!(g&&m.nodeValue[g-1]==`
|
|
9
|
-
`))&&g==m.nodeValue.length)for(let y=m,v;y;y=y.parentNode){if(v=y.nextSibling){"BR"==v.nodeName&&(f=d={node:v.parentNode,offset:Hr(v)+1});break}let b=y.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let x=m.childNodes[g-1];h=x&&("BR"==x.nodeName||"false"==x.contentEditable)}}if(HS&&p.focusNode&&p.focusNode!=d.node&&1==p.focusNode.nodeType){let M=p.focusNode.childNodes[p.focusOffset];M&&"false"==M.contentEditable&&(i=!0)}if(!(i||h&&HO)&&Hu(f.node,f.offset,p.anchorNode,p.anchorOffset)&&Hu(d.node,d.offset,p.focusNode,p.focusOffset))return;let T=!1;if((p.extend||t==n)&&!h){p.collapse(f.node,f.offset);try{t!=n&&p.extend(d.node,d.offset),T=!0}catch{}}if(!T){if(t>n){let S=f;f=d,d=S}let w=document.createRange();w.setEnd(d.node,d.offset),w.setStart(f.node,f.offset),p.removeAllRanges(),p.addRange(w)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],a=r+o.size;if(r==a?t<=a&&n>=r:t<a&&n>r){let u=r+o.border,s=a-o.border;if(t>=u&&n<=s){this.dirty=t==r||n==a?2:1,t==u&&n==s&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=3:o.markDirty(t-u,n-u);return}o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}r=a}this.dirty=2}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=1==t?2:1;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class H0 extends HX{constructor(t,n,r,i){let o,a=n.type.toDOM;if("function"==typeof a&&(a=a(r,()=>o?o.parent?o.parent.posBeforeChild(o):void 0:i)),!n.type.spec.raw){if(1!=a.nodeType){let u=document.createElement("span");u.appendChild(a),a=u}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(t,[],a,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return 0==this.dirty&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return!!n&&n(t)}ignoreMutation(t){return"selection"!=t.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class H1 extends HX{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class H2 extends HX{constructor(t,n,r,i){super(t,[],r,i),this.mark=n}static create(t,n,r,i){let o=i.nodeViews[n.type.name],a=o&&o(n,i,r);return a&&a.dom||(a=Qr.renderSpec(document,n.type.spec.toDOM(n,r))),new H2(t,n,a.dom,a.contentDOM||a.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(t){return 3!=this.dirty&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),0!=this.dirty){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}}slice(t,n,r){let i=H2.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;n<a&&(o=Js(o,n,a,r)),t>0&&(o=Js(o,0,t,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}}class H4 extends HX{constructor(t,n,r,i,o,a,u,s,c){super(t,[],o,a),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=u}static create(t,n,r,i,o,a){let u=o.nodeViews[n.type.name],s,c=u&&u(n,o,()=>s?s.parent?s.parent.posBeforeChild(s):void 0:a,r,i),l=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(l){if(3!=l.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else l=document.createTextNode(n.text)}else l||({dom:l,contentDOM:f}=Qr.renderSpec(document,n.type.spec.toDOM(n)));f||n.isText||"BR"==l.nodeName||(l.hasAttribute("contenteditable")||(l.contentEditable="false"),n.type.spec.draggable&&(l.draggable=!0));let d=l;return l=Jr(l,r,n),c?s=new H8(t,n,r,i,l,f||null,d,c,o,a+1):n.isText?new H5(t,n,r,i,l,d,o):new H4(t,n,r,i,l,f||null,d,o,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM){if(this.contentLost){for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>Zy.empty)}else t.contentElement=this.contentDOM}else t.getContent=()=>this.node.content;return t}matchesNode(t,n,r){return 0==this.dirty&&t.eq(this.node)&&Ji(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,i=n,o=t.composing?this.localCompositionInfo(t,n):null,a=o&&o.pos>-1?o:null,u=o&&o.pos<0,s=new Ja(this,a&&a.node,t);(function(t,n,r,i){let o=n.locals(t),a=0;if(0==o.length){for(let u=0;u<t.childCount;u++){let s=t.child(u);i(s,o,n.forChild(a,s),u),a+=s.nodeSize}return}let c=0,l=[],f=null;for(let d=0;;){if(c<o.length&&o[c].to==a){let p=o[c++],h;for(;c<o.length&&o[c].to==a;)(h||(h=[p])).push(o[c++]);if(h){h.sort(Ju);for(let m=0;m<h.length;m++)r(h[m],d,!!f)}else r(p,d,!!f)}let g,y;if(f)y=-1,g=f,f=null;else if(d<t.childCount)y=d,g=t.child(d++);else break;for(let v=0;v<l.length;v++)l[v].to<=a&&l.splice(v--,1);for(;c<o.length&&o[c].from<=a&&o[c].to>a;)l.push(o[c++]);let b=a+g.nodeSize;if(g.isText){let x=b;c<o.length&&o[c].from<x&&(x=o[c].from);for(let M=0;M<l.length;M++)l[M].to<x&&(x=l[M].to);x<b&&(f=g.cut(x-a),g=g.cut(0,x-a),b=x,y=-1)}let T=g.isInline&&!g.isLeaf?l.filter(t=>!t.inline):l.slice();i(g,T,n.forChild(a,g),y),a=b}})(this.node,this.innerDeco,(n,o,a)=>{n.spec.marks?s.syncToMarks(n.spec.marks,r,t):n.type.side>=0&&!a&&s.syncToMarks(o==this.node.childCount?ZM.none:this.node.child(o).marks,r,t),s.placeWidget(n,t,i)},(n,a,c,l)=>{s.syncToMarks(n.marks,r,t);let f;s.findNodeMatch(n,a,c,l)||u&&t.state.selection.from>i&&t.state.selection.to<i+n.nodeSize&&(f=s.findIndexWithChild(o.node))>-1&&s.updateNodeAt(n,a,c,f,t)||s.updateNextNode(n,a,c,t,l,i)||s.addNode(n,a,c,t,i),i+=n.nodeSize}),s.syncToMarks([],r,t),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||2==this.dirty)&&(a&&this.protectLocalComposition(t,a),function t(n,r,i){let o=n.firstChild,a=!1;for(let u=0;u<r.length;u++){let s=r[u],c=s.dom;if(c.parentNode==n){for(;c!=o;)o=Jo(o),a=!0;o=o.nextSibling}else a=!0,n.insertBefore(c,o);if(s instanceof H2){let l=o?o.previousSibling:n.lastChild;t(s.contentDOM,s.children,i),o=l?l.nextSibling:n.firstChild}}for(;o;)o=Jo(o),a=!0;a&&i.trackWrites==n&&(i.trackWrites=null)}(this.contentDOM,this.children,t),Hk&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){let n=t.style.cssText;t.style.cssText=n+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=n}}(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof QZ)||r<n||i>n+this.node.content.size)return null;let o=t.domSelectionRange(),a=function(t,n){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&n>0){if(t.childNodes.length>n&&3==t.childNodes[n].nodeType)return t.childNodes[n];n=Hl(t=t.childNodes[n-1])}else{if(1!=t.nodeType||!(n<t.childNodes.length))return null;t=t.childNodes[n],n=0}}}(o.focusNode,o.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(!this.node.inlineContent)return{node:a,pos:-1,text:""};{let u=a.nodeValue,s=function(t,n,r,i){for(let o=0,a=0;o<t.childCount&&a<=i;){let u=t.child(o++);if(a+=u.nodeSize,!u.isText)continue;let s=u.text;for(;o<t.childCount;){let c=t.child(o++);if(a+=c.nodeSize,!c.isText)break;s+=c.text}if(a>=r){let l=a<i?s.lastIndexOf(n,i-a-1):-1;if(l>=0&&l+n.length+a>=r)return a+l;if(r==i&&s.length>=i+n.length-a&&s.slice(i-a,i-a+n.length)==n)return i}}return -1}(this.node.content,u,r-n,i-n);return s<0?null:{node:a,pos:s,text:u}}}protectLocalComposition(t,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let a=new H1(this,o,n,i);t.input.compositionNodes.push(a),this.children=Js(this.children,r,r+i.length,t,a)}update(t,n,r,i){return!!(3!=this.dirty&&t.sameMarkup(this.node))&&(this.updateInner(t,n,r,i),!0)}updateInner(t,n,r,i){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=0}updateOuterDeco(t){if(Ji(t,this.outerDeco))return;let n=1!=this.nodeDOM.nodeType,r=this.dom;this.dom=Jt(this.dom,this.nodeDOM,Je(this.outerDeco,this.node,n),Je(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function H3(t,n,r,i,o){Jr(i,n,t);let a=new H4(void 0,t,n,r,i,i,i,o,0);return a.contentDOM&&a.updateChildren(o,0),a}class H5 extends H4{constructor(t,n,r,i,o,a,u){super(t,n,r,i,o,null,a,u,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,i){return!!(3!=this.dirty&&(0==this.dirty||this.inParent())&&t.sameMarkup(this.node))&&(this.updateOuterDeco(n),(0!=this.dirty||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=t,this.dirty=0,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type}slice(t,n,r){let i=this.node.cut(t,n),o=document.createTextNode(i.text);return new H5(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(0==t||n==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}}class H9 extends HX{parseRule(){return{ignore:!0}}matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class H8 extends H4{constructor(t,n,r,i,o,a,u,s,c,l){super(t,n,r,i,o,a,u,c,l),this.spec=s}update(t,n,r,i){if(3==this.dirty)return!1;if(!this.spec.update)return(!!this.contentDOM||!!t.isLeaf)&&super.update(t,n,r,i);{let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r):super.setSelection(t,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}let H6=function(t){t&&(this.nodeName=t)};H6.prototype=Object.create(null);let H7=[new H6];function Je(t,n,r){if(0==t.length)return H7;let i=r?H7[0]:new H6,o=[i];for(let a=0;a<t.length;a++){let u=t[a].type.attrs;if(u)for(let s in u.nodeName&&o.push(i=new H6(u.nodeName)),u){let c=u[s];null!=c&&(r&&1==o.length&&o.push(i=new H6(n.isInline?"span":"div")),"class"==s?i.class=(i.class?i.class+" ":"")+c:"style"==s?i.style=(i.style?i.style+";":"")+c:"nodeName"!=s&&(i[s]=c))}}return o}function Jt(t,n,r,i){if(r==H7&&i==H7)return n;let o=n;for(let a=0;a<i.length;a++){let u=i[a],s=r[a];if(a){let c;s&&s.nodeName==u.nodeName&&o!=t&&(c=o.parentNode)&&c.nodeName.toLowerCase()==u.nodeName||((c=document.createElement(u.nodeName)).pmIsDeco=!0,c.appendChild(o),s=H7[0]),o=c}Jn(o,s||H7[0],u)}return o}function Jn(t,n,r){for(let i in n)"class"==i||"style"==i||"nodeName"==i||i in r||t.removeAttribute(i);for(let o in r)"class"!=o&&"style"!=o&&"nodeName"!=o&&r[o]!=n[o]&&t.setAttribute(o,r[o]);if(n.class!=r.class){let a=n.class?n.class.split(" ").filter(Boolean):[],u=r.class?r.class.split(" ").filter(Boolean):[];for(let s=0;s<a.length;s++)-1==u.indexOf(a[s])&&t.classList.remove(a[s]);for(let c=0;c<u.length;c++)-1==a.indexOf(u[c])&&t.classList.add(u[c]);0==t.classList.length&&t.removeAttribute("class")}if(n.style!=r.style){if(n.style){let l=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,f;for(;f=l.exec(n.style);)t.style.removeProperty(f[1])}r.style&&(t.style.cssText+=r.style)}}function Jr(t,n,r){return Jt(t,t,H7,Je(n,r,1!=t.nodeType))}function Ji(t,n){if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].type.eq(n[r].type))return!1;return!0}function Jo(t){let n=t.nextSibling;return t.parentNode.removeChild(t),n}class Ja{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=function(t,n){let r=n,i=r.children.length,o=t.childCount,a=new Map,u=[];e:for(;o>0;){let s;for(;;)if(i){let c=r.children[i-1];if(c instanceof H2)r=c,i=c.children.length;else{s=c,i--;break}}else{if(r==n)break e;i=r.parent.children.indexOf(r),r=r.parent}let l=s.node;if(l){if(l!=t.child(o-1))break;--o,a.set(s,o),u.push(s)}}return{index:o,matched:a,matches:u.reverse()}}(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r){let i=0,o=this.stack.length>>1,a=Math.min(o,t.length);for(;i<a&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(t[i])&&!1!==t[i].type.spec.spanning;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<t.length;){this.stack.push(this.top,this.index+1);let u=-1;for(let s=this.index;s<Math.min(this.index+3,this.top.children.length);s++){let c=this.top.children[s];if(c.matchesMark(t[o])&&!this.isLocked(c.dom)){u=s;break}}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let l=H2.create(this.top,t[o],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(t,n,r,i){let o=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(t,n,r))o=this.top.children.indexOf(a,this.index);else for(let u=this.index,s=Math.min(this.top.children.length,u+5);u<s;u++){let c=this.top.children[u];if(c.matchesNode(t,n,r)&&!this.preMatch.matched.has(c)){o=u;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,n,r,i,o){let a=this.top.children[i];return 3==a.dirty&&a.dom==a.contentDOM&&(a.dirty=2),!!a.update(t,n,r,o)&&(this.destroyBetween(this.index,i),this.index++,!0)}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return -1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return -1}t=n}}updateNextNode(t,n,r,i,o,a){for(let u=this.index;u<this.top.children.length;u++){let s=this.top.children[u];if(s instanceof H4){let c=this.preMatch.matched.get(s);if(null!=c&&c!=o)return!1;let l=s.dom,f,d=this.isLocked(l)&&!(t.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==t.text&&3!=s.dirty&&Ji(n,s.outerDeco));if(!d&&s.update(t,n,r,i))return this.destroyBetween(this.index,u),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(f=this.recreateWrapper(s,t,n,r,i,a)))return this.top.children[this.index]=f,f.dirty=2,f.updateChildren(i,a+1),f.dirty=0,this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,i,o,a){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content))return null;let u=H4.create(this.top,n,r,i,o,a);if(!u.contentDOM)return null;for(let s of(u.children=t.children,t.children=[],t.destroy(),u.children))s.parent=u;return u}addNode(t,n,r,i,o){let a=H4.create(this.top,t,n,r,i,o);a.contentDOM&&a.updateChildren(i,o+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(t,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(t)&&(t==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new H0(this.top,t,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof H2;)t=(n=t).children[n.children.length-1];(!t||!(t instanceof H5)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((HO||H_)&&t&&"false"==t.dom.contentEditable&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);"IMG"==t&&(r.className="ProseMirror-separator",r.alt=""),"BR"==t&&(r.className="ProseMirror-trailingBreak");let i=new H9(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||1==t.nodeType&&t.contains(this.lock.parentNode))}}function Ju(t,n){return t.type.side-n.type.side}function Js(t,n,r,i,o){let a=[];for(let u=0,s=0;u<t.length;u++){let c=t[u],l=s+=c.size;s>=r||l<=n?a.push(c):(s<n&&a.push(c.slice(0,n-s,i)),o&&(a.push(o),o=void 0),l>r&&a.push(c.slice(r-s,c.size,i)))}return a}function Jc(t,n=null){let r=t.domSelectionRange(),i=t.state.doc;if(!r.focusNode)return null;let o=t.docView.nearestDesc(r.focusNode),a=o&&0==o.size,u=t.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(u<0)return null;let s=i.resolve(u),c,l;if(Hd(r)){for(c=s;o&&!o.node;)o=o.parent;let f=o.node;if(o&&f.isAtom&&QH.isSelectable(f)&&o.parent&&!(f.isInline&&function(t,n,r){for(let i=0==n,o=n==Hl(t);i||o;){if(t==r)return!0;let a=Hr(t);if(!(t=t.parentNode))return!1;i=i&&0==a,o=o&&a==Hl(t)}}(r.focusNode,r.focusOffset,o.dom))){let d=o.posBefore;l=new QH(u==d?s:i.resolve(d))}}else{let p=t.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(p<0)return null;c=i.resolve(p)}if(!l){let h="pointer"==n||t.state.selection.head<s.pos&&!a?1:-1;l=Jv(t,c,s,h)}return l}function Jl(t){return t.editable?t.hasFocus():Jx(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Jf(t,n=!1){let r=t.state.selection;if(Jg(t,r),Jl(t)){var i,o;if(!n&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&H_){let a=t.domSelectionRange(),u=t.domObserver.currentSelection;if(a.anchorNode&&u.anchorNode&&Hu(a.anchorNode,a.anchorOffset,u.anchorNode,u.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper){let s,c,l,f;i=t,s=i.domSelection(),c=document.createRange(),l=i.cursorWrapper.dom,f="IMG"==l.nodeName,f?c.setEnd(l.parentNode,Hr(l)+1):c.setEnd(l,0),c.collapse(!1),s.removeAllRanges(),s.addRange(c),!f&&!i.state.selection.visible&&HM&&HT<=11&&(l.disabled=!0,l.disabled=!1)}else{let{anchor:d,head:p}=r,h,m,g,y,v,b;!Jd||r instanceof QZ||(r.$from.parent.inlineContent||(h=Jp(t,r.from)),r.empty||r.$from.parent.inlineContent||(m=Jp(t,r.to))),t.docView.setSelection(d,p,t.root,n),Jd&&(h&&Jm(h),m&&Jm(m)),r.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&(o=t,g=o.dom.ownerDocument,g.removeEventListener("selectionchange",o.input.hideSelectionGuard),y=o.domSelectionRange(),v=y.anchorNode,b=y.anchorOffset,g.addEventListener("selectionchange",o.input.hideSelectionGuard=()=>{(y.anchorNode!=v||y.anchorOffset!=b)&&(g.removeEventListener("selectionchange",o.input.hideSelectionGuard),setTimeout(()=>{(!Jl(o)||o.state.selection.visible)&&o.dom.classList.remove("ProseMirror-hideselection")},20))})))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}let Jd=HO||H_&&HI<63;function Jp(t,n){let{node:r,offset:i}=t.docView.domFromPos(n,0),o=i<r.childNodes.length?r.childNodes[i]:null,a=i?r.childNodes[i-1]:null;if(HO&&o&&"false"==o.contentEditable)return Jh(o);if((!o||"false"==o.contentEditable)&&(!a||"false"==a.contentEditable)){if(o)return Jh(o);if(a)return Jh(a)}}function Jh(t){return t.contentEditable="true",HO&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Jm(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Jg(t,n){if(n instanceof QH){let r=t.docView.descAt(n.from);r!=t.lastSelectedViewDesc&&(Jy(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else Jy(t)}function Jy(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Jv(t,n,r,i){return t.someProp("createSelectionBetween",i=>i(t,n,r))||QZ.between(n,r,i)}function Jb(t){return(!t.editable||!!t.hasFocus())&&Jx(t)}function Jx(t){let n=t.domSelectionRange();if(!n.anchorNode)return!1;try{return t.dom.contains(3==n.anchorNode.nodeType?n.anchorNode.parentNode:n.anchorNode)&&(t.editable||t.dom.contains(3==n.focusNode.nodeType?n.focusNode.parentNode:n.focusNode))}catch{return!1}}function JM(t,n){let{$anchor:r,$head:i}=t.selection,o=n>0?r.max(i):r.min(i),a=o.parent.inlineContent?o.depth?t.doc.resolve(n>0?o.after():o.before()):null:o;return a&&QK.findFrom(a,n)}function JT(t,n){return t.dispatch(t.state.tr.setSelection(n).scrollIntoView()),!0}function JS(t,n,r){let i=t.state.selection;if(i instanceof QZ){if(!i.empty||r.indexOf("s")>-1)return!1;if(t.endOfTextblock(n>0?"forward":"backward")){let o=JM(t.state,n);return!!o&&o instanceof QH&&JT(t,o)}if(!(HC&&r.indexOf("m")>-1)){let a=i.$head,u=a.textOffset?null:n<0?a.nodeBefore:a.nodeAfter,s;if(!u||u.isText)return!1;let c=n<0?a.pos-u.nodeSize:a.pos;return!!(u.isAtom||(s=t.docView.descAt(c))&&!s.contentDOM)&&(QH.isSelectable(u)?JT(t,new QH(n<0?t.state.doc.resolve(a.pos-u.nodeSize):a)):!!HE&&JT(t,new QZ(t.state.doc.resolve(n<0?c:c+u.nodeSize))))}}else{if(i instanceof QH&&i.node.isInline)return JT(t,new QZ(n>0?i.$to:i.$from));{let l=JM(t.state,n);return!!l&&JT(t,l)}}}function Jw(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function J_(t){let n=t.pmViewDesc;return n&&0==n.size&&(t.nextSibling||"BR"!=t.nodeName)}function JI(t,n){return n<0?function(t){let n=t.domSelectionRange(),r=n.focusNode,i=n.focusOffset;if(!r)return;let o,a,u=!1;for(HS&&1==r.nodeType&&i<Jw(r)&&J_(r.childNodes[i])&&(u=!0);;)if(i>0){if(1!=r.nodeType)break;{let s=r.childNodes[i-1];if(J_(s))o=r,a=--i;else if(3==s.nodeType)i=(r=s).nodeValue.length;else break}}else{if(Jk(r))break;{let c=r.previousSibling;for(;c&&J_(c);)o=r.parentNode,a=Hr(c),c=c.previousSibling;if(c)i=Jw(r=c);else{if((r=r.parentNode)==t.dom)break;i=0}}}u?JC(t,r,i):o&&JC(t,o,a)}(t):JO(t)}function JO(t){let n=t.domSelectionRange(),r=n.focusNode,i=n.focusOffset;if(!r)return;let o=Jw(r),a,u;for(;;)if(i<o){if(1!=r.nodeType)break;if(J_(r.childNodes[i]))a=r,u=++i;else break}else{if(Jk(r))break;{let s=r.nextSibling;for(;s&&J_(s);)a=s.parentNode,u=Hr(s)+1,s=s.nextSibling;if(s)i=0,o=Jw(r=s);else{if((r=r.parentNode)==t.dom)break;i=o=0}}}a&&JC(t,a,u)}function Jk(t){let n=t.pmViewDesc;return n&&n.node&&n.node.isBlock}function JC(t,n,r){let i=t.domSelection();if(Hd(i)){let o=document.createRange();o.setEnd(n,r),o.setStart(n,r),i.removeAllRanges(),i.addRange(o)}else i.extend&&i.extend(n,r);t.domObserver.setCurSelection();let{state:a}=t;setTimeout(()=>{t.state==a&&Jf(t)},50)}function JN(t,n){let r=t.state.doc.resolve(n);if(!(H_||HN)&&r.parent.inlineContent){let i=t.coordsAtPos(n);if(n>r.start()){let o=t.coordsAtPos(n-1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(n<r.end()){let u=t.coordsAtPos(n+1),s=(u.top+u.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(u.left-i.left)>1)return u.left>i.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(t.dom).direction?"rtl":"ltr"}function Jj(t,n,r){let i=t.state.selection;if(i instanceof QZ&&!i.empty||r.indexOf("s")>-1||HC&&r.indexOf("m")>-1)return!1;let{$from:o,$to:a}=i;if(!o.parent.inlineContent||t.endOfTextblock(n<0?"up":"down")){let u=JM(t.state,n);if(u&&u instanceof QH)return JT(t,u)}if(!o.parent.inlineContent){let s=n<0?o:a,c=i instanceof QX?QK.near(s,n):QK.findFrom(s,n);return!!c&&JT(t,c)}return!1}function JE(t,n){if(!(t.state.selection instanceof QZ))return!0;let{$head:r,$anchor:i,empty:o}=t.state.selection;if(!r.sameParent(i))return!0;if(!o)return!1;if(t.endOfTextblock(n>0?"forward":"backward"))return!0;let a=!r.textOffset&&(n<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){let u=t.state.tr;return n<0?u.delete(r.pos-a.nodeSize,r.pos):u.delete(r.pos,r.pos+a.nodeSize),t.dispatch(u),!0}return!1}function JR(t,n,r){t.domObserver.stop(),n.contentEditable=r,t.domObserver.start()}function JD(t,n){t.someProp("transformCopied",r=>{n=r(n,t)});let r=[],{content:i,openStart:o,openEnd:a}=n;for(;o>1&&a>1&&1==i.childCount&&1==i.firstChild.childCount;){o--,a--;let u=i.firstChild;r.push(u.type.name,u.attrs!=u.type.defaultAttrs?u.attrs:null),i=u.content}let s=t.someProp("clipboardSerializer")||Qr.fromSchema(t.state.schema),c=J$(),l=c.createElement("div");l.appendChild(s.serializeFragment(i,{document:c}));let f=l.firstChild,d,p=0;for(;f&&1==f.nodeType&&(d=JB[f.nodeName.toLowerCase()]);){for(let h=d.length-1;h>=0;h--){let m=c.createElement(d[h]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),p++}f=l.firstChild}return f&&1==f.nodeType&&f.setAttribute("data-pm-slice",`${o} ${a}${p?` -${p}`:""} ${JSON.stringify(r)}`),{dom:l,text:t.someProp("clipboardTextSerializer",r=>r(n,t))||n.content.textBetween(0,n.content.size,`
|
|
10
|
-
|
|
11
|
-
`)}}function JA(t,n,r,i,o){let a=o.parent.type.spec.code,u,s;if(!r&&!n)return null;let c=n&&(i||a||!r);if(c){if(t.someProp("transformPastedText",r=>{n=r(n,a||i,t)}),a)return n?new ZS(Zy.from(t.state.schema.text(n.replace(/\r\n?/g,`
|
|
12
|
-
`))),0,0):ZS.empty;let l=t.someProp("clipboardTextParser",r=>r(n,o,i,t));if(l)s=l;else{let f=o.marks(),{schema:d}=t.state,p=Qr.fromSchema(d);u=document.createElement("div"),n.split(/(?:\r\n?|\n)+/).forEach(t=>{let n=u.appendChild(document.createElement("p"));t&&n.appendChild(p.serializeNode(d.text(t,f)))})}}else t.someProp("transformPastedHTML",n=>{r=n(r,t)}),u=function(t){let n=/^(\s*<meta [^>]*>)*/.exec(t);n&&(t=t.slice(n[0].length));let r=J$().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t),o;if((o=i&&JB[i[1].toLowerCase()])&&(t=o.map(t=>"<"+t+">").join("")+t+o.map(t=>"</"+t+">").reverse().join("")),r.innerHTML=t,o)for(let a=0;a<o.length;a++)r=r.querySelector(o[a])||r;return r}(r),HE&&function(t){let n=t.querySelectorAll(H_?"span:not([class]):not([style])":"span.Apple-converted-space");for(let r=0;r<n.length;r++){let i=n[r];1==i.childNodes.length&&"\xa0"==i.textContent&&i.parentNode&&i.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),i)}}(u);let h=u&&u.querySelector("[data-pm-slice]"),m=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(m&&m[3])for(let g=+m[3];g>0;g--){let y=u.firstChild;for(;y&&1!=y.nodeType;)y=y.nextSibling;if(!y)break;u=y}if(s||(s=(t.someProp("clipboardParser")||t.someProp("domParser")||Z4.fromSchema(t.state.schema)).parseSlice(u,{preserveWhitespace:!!(c||m),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||JL.test(t.parentNode.nodeName)?null:{ignore:!0}})),m)s=function(t,n){if(!t.size)return t;let r=t.content.firstChild.type.schema,i;try{i=JSON.parse(n)}catch{return t}let{content:o,openStart:a,openEnd:u}=t;for(let s=i.length-2;s>=0;s-=2){let c=r.nodes[i[s]];if(!c||c.hasRequiredAttrs())break;o=Zy.from(c.create(i[s+1],o)),a++,u++}return new ZS(o,a,u)}(JW(s,+m[1],+m[2]),m[4]);else if((s=ZS.maxOpen(function(t,n){if(t.childCount<2)return t;for(let r=n.depth;r>=0;r--){let i=n.node(r).contentMatchAt(n.index(r)),o,a=[];if(t.forEach(t=>{if(!a)return;let n=i.findWrapping(t.type),r;if(!n)return a=null;if(r=a.length&&o.length&&JF(n,o,t,a[a.length-1],0))a[a.length-1]=r;else{a.length&&(a[a.length-1]=Jz(a[a.length-1],o.length));let u=JP(t,n);a.push(u),i=i.matchType(u.type),o=n}}),a)return Zy.from(a)}return t}(s.content,o),!0)).openStart||s.openEnd){let v=0,b=0;for(let x=s.content.firstChild;v<s.openStart&&!x.type.spec.isolating;v++,x=x.firstChild);for(let M=s.content.lastChild;b<s.openEnd&&!M.type.spec.isolating;b++,M=M.lastChild);s=JW(s,v,b)}return t.someProp("transformPasted",n=>{s=n(s,t)}),s}let JL=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function JP(t,n,r=0){for(let i=n.length-1;i>=r;i--)t=n[i].create(null,Zy.from(t));return t}function JF(t,n,r,i,o){if(o<t.length&&o<n.length&&t[o]==n[o]){let a=JF(t,n,r,i.lastChild,o+1);if(a)return i.copy(i.content.replaceChild(i.childCount-1,a));if(i.contentMatchAt(i.childCount).matchType(o==t.length-1?r.type:t[o+1]))return i.copy(i.content.append(Zy.from(JP(r,t,o+1))))}}function Jz(t,n){if(0==n)return t;let r=t.content.replaceChild(t.childCount-1,Jz(t.lastChild,n-1)),i=t.contentMatchAt(t.childCount).fillBefore(Zy.empty,!0);return t.copy(r.append(i))}function JU(t,n,r,i,o,a){let u=n<0?t.firstChild:t.lastChild,s=u.content;return t.childCount>1&&(a=0),o<i-1&&(s=JU(s,n,r,i,o+1,a)),o>=r&&(s=n<0?u.contentMatchAt(0).fillBefore(s,a<=o).append(s):s.append(u.contentMatchAt(u.childCount).fillBefore(Zy.empty,!0))),t.replaceChild(n<0?0:t.childCount-1,u.copy(s))}function JW(t,n,r){return n<t.openStart&&(t=new ZS(JU(t.content,-1,n,t.openStart,0,t.openEnd),n,t.openEnd)),r<t.openEnd&&(t=new ZS(JU(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}let JB={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},JV=null;function J$(){return JV||(JV=document.implementation.createHTMLDocument("title"))}let JK={},JY={},Jq={touchstart:!0,touchmove:!0};class JG{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function JZ(t,n){t.input.lastSelectionOrigin=n,t.input.lastSelectionTime=Date.now()}function JQ(t){t.someProp("handleDOMEvents",n=>{for(let r in n)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=n=>JH(t,n))})}function JH(t,n){return t.someProp("handleDOMEvents",r=>{let i=r[n.type];return!!i&&(i(t,n)||n.defaultPrevented)})}function JJ(t,n){if(!n.bubbles)return!0;if(n.defaultPrevented)return!1;for(let r=n.target;r!=t.dom;r=r.parentNode)if(!r||11==r.nodeType||r.pmViewDesc&&r.pmViewDesc.stopEvent(n))return!1;return!0}function JX(t){return{left:t.clientX,top:t.clientY}}function J0(t,n,r,i,o){if(-1==i)return!1;let a=t.state.doc.resolve(i);for(let u=a.depth+1;u>0;u--)if(t.someProp(n,n=>u>a.depth?n(t,r,a.nodeAfter,a.before(u),o,!0):n(t,r,a.node(u),a.before(u),o,!1)))return!0;return!1}function J1(t,n,r){t.focused||t.focus();let i=t.state.tr.setSelection(n);"pointer"==r&&i.setMeta("pointer",!0),t.dispatch(i)}function J2(t,n,r,i){return J0(t,"handleDoubleClickOn",n,r,i)||t.someProp("handleDoubleClick",r=>r(t,n,i))}function J4(t,n,r,i){return J0(t,"handleTripleClickOn",n,r,i)||t.someProp("handleTripleClick",r=>r(t,n,i))||function(t,n,r){if(0!=r.button)return!1;let i=t.state.doc;if(-1==n)return!!i.inlineContent&&(J1(t,QZ.create(i,0,i.content.size),"pointer"),!0);let o=i.resolve(n);for(let a=o.depth+1;a>0;a--){let u=a>o.depth?o.nodeAfter:o.node(a),s=o.before(a);if(u.inlineContent)J1(t,QZ.create(i,s+1,s+1+u.content.size),"pointer");else{if(!QH.isSelectable(u))continue;J1(t,QH.create(i,s),"pointer")}return!0}}(t,r,i)}JY.keydown=(t,n)=>{if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!J9(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Hj&&H_&&13==n.keyCode))){if(229!=n.keyCode&&t.domObserver.forceFlush(),!Hk||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",r=>r(t,n))||function(t,n){var r;let i,o=n.keyCode,a=(i="",n.ctrlKey&&(i+="c"),n.metaKey&&(i+="m"),n.altKey&&(i+="a"),n.shiftKey&&(i+="s"),i);if(8==o||HC&&72==o&&"c"==a)return JE(t,-1)||JI(t,-1);if(46==o&&!n.shiftKey||HC&&68==o&&"c"==a)return JE(t,1)||JI(t,1);if(13==o||27==o)return!0;if(37==o||HC&&66==o&&"c"==a){let u=37==o?"ltr"==JN(t,t.state.selection.from)?-1:1:-1;return JS(t,u,a)||JI(t,u)}if(39==o||HC&&70==o&&"c"==a){let s=39==o?"ltr"==JN(t,t.state.selection.from)?1:-1:1;return JS(t,s,a)||JI(t,s)}return 38==o||HC&&80==o&&"c"==a?Jj(t,-1,a)||JI(t,-1):40==o||HC&&78==o&&"c"==a?function(t){if(!HO||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:n,focusOffset:r}=t.domSelectionRange();if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){let i=n.firstChild;JR(t,i,"true"),setTimeout(()=>JR(t,i,"false"),20)}return!1}(t)||Jj(t,1,a)||JO(t):a==(HC?"m":"c")&&(66==o||73==o||89==o||90==o)}(t,n)?n.preventDefault():JZ(t,"key");else{let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",n=>n(t,Hp(13,"Enter"))),t.input.lastIOSEnter=0)},200)}}},JY.keyup=(t,n)=>{16==n.keyCode&&(t.input.shiftKey=!1)},JY.keypress=(t,n)=>{if(J9(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||HC&&n.metaKey)return;if(t.someProp("handleKeyPress",r=>r(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof QZ)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);/[\r\n]/.test(i)||t.someProp("handleTextInput",n=>n(t,r.$from.pos,r.$to.pos,i))||t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};let J3=HC?"metaKey":"ctrlKey";JK.mousedown=(t,n)=>{var r,i,o;t.input.shiftKey=n.shiftKey;let a=Xe(t),u=Date.now(),s="singleClick",c,l;u-t.input.lastClick.time<500&&(c=(o=t.input.lastClick).x-n.clientX,c*c+(l=o.y-n.clientY)*l<100)&&!n[J3]&&("singleClick"==t.input.lastClick.type?s="doubleClick":"doubleClick"==t.input.lastClick.type&&(s="tripleClick")),t.input.lastClick={time:u,x:n.clientX,y:n.clientY,type:s};let f=t.posAtCoords(JX(n));f&&("singleClick"==s?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new J5(t,f,n,!!a)):("doubleClick"==s?J2:J4)(t,f.pos,f.inside,n)?n.preventDefault():JZ(t,"pointer"))};class J5{constructor(t,n,r,i){this.view=t,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[J3],this.allowDefault=r.shiftKey;let o,a;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),a=n.inside;else{let u=t.state.doc.resolve(n.pos);o=u.parent,a=u.depth?u.before():0}let s=i?null:r.target,c=s?t.docView.nearestDesc(s,!0):null;this.target=c?c.dom:null;let{selection:l}=t.state;(0==r.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof QH&&l.from<=a&&l.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&HS&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),JZ(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Jf(this.view)),this.view.input.mouseDown=null}up(t){var n,r,i,o,a;if(this.done(),!this.view.dom.contains(t.target))return;let u=this.pos;this.view.state.doc!=this.startDoc&&(u=this.view.posAtCoords(JX(t))),this.updateAllowDefault(t),this.allowDefault||!u?JZ(this.view,"pointer"):(n=this.view,r=u.pos,i=u.inside,a=this.selectNode,J0(n,"handleClickOn",r,i,t)||n.someProp("handleClick",i=>i(n,r,t))||(a?function(t,n){if(-1==n)return!1;let r=t.state.selection,i,o;r instanceof QH&&(i=r.node);let a=t.state.doc.resolve(n);for(let u=a.depth+1;u>0;u--){let s=u>a.depth?a.nodeAfter:a.node(u);if(QH.isSelectable(s)){o=i&&r.$from.depth>0&&u>=r.$from.depth&&a.before(r.$from.depth+1)==r.$from.pos?a.before(r.$from.depth):a.before(u);break}}return null!=o&&(J1(t,QH.create(t.state.doc,o),"pointer"),!0)}(n,i):function(t,n){if(-1==n)return!1;let r=t.state.doc.resolve(n),i=r.nodeAfter;return!!(i&&i.isAtom&&QH.isSelectable(i))&&(J1(t,new QH(r),"pointer"),!0)}(n,i)))?t.preventDefault():0==t.button&&(this.flushed||HO&&this.mightDrag&&!this.mightDrag.node.isAtom||H_&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(u.pos-this.view.state.selection.from),Math.abs(u.pos-this.view.state.selection.to)))?(J1(this.view,QK.near(this.view.state.doc.resolve(u.pos)),"pointer"),t.preventDefault()):JZ(this.view,"pointer")}move(t){this.updateAllowDefault(t),JZ(this.view,"pointer"),0==t.buttons&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}function J9(t,n){return!!t.composing||!!(HO&&500>Math.abs(n.timeStamp-t.input.compositionEndedAt))&&(t.input.compositionEndedAt=-2e8,!0)}JK.touchstart=t=>{t.input.lastTouch=Date.now(),Xe(t),JZ(t,"pointer")},JK.touchmove=t=>{t.input.lastTouch=Date.now(),JZ(t,"pointer")},JK.contextmenu=t=>{var n;return Xe(t)};let J8=Hj?5e3:-1;function J6(t,n){clearTimeout(t.input.composingTimeout),n>-1&&(t.input.composingTimeout=setTimeout(()=>Xe(t),n))}function J7(t){let n;for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=(n=document.createEvent("Event"),n.initEvent("event",!0,!0),n.timeStamp));t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Xe(t,n=!1){if(!(Hj&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),J7(t),n||t.docView&&t.docView.dirty){let r=Jc(t);return r&&!r.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(r)):t.updateState(t.state),!0}return!1}}JY.compositionstart=JY.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:n}=t,r=n.selection.$from;if(n.selection.empty&&(n.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(t=>!1===t.type.spec.inclusive)))t.markCursor=t.state.storedMarks||r.marks(),Xe(t,!0),t.markCursor=null;else if(Xe(t),HS&&n.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let i=t.domSelectionRange();for(let o=i.focusNode,a=i.focusOffset;o&&1==o.nodeType&&0!=a;){let u=a<0?o.lastChild:o.childNodes[a-1];if(!u)break;if(3==u.nodeType){t.domSelection().collapse(u,u.nodeValue.length);break}o=u,a=-1}}t.input.composing=!0}J6(t,J8)},JY.compositionend=(t,n)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=n.timeStamp,t.input.compositionID++,J6(t,20))};let Xt=HM&&HT<15||Hk&&HR<604;function Xn(t,n,r,i,o){var a;let u=JA(t,n,r,i,t.state.selection.$from);if(t.someProp("handlePaste",n=>n(t,o,u||ZS.empty)))return!0;if(!u)return!1;let s=0==u.openStart&&0==u.openEnd&&1==u.content.childCount?u.content.firstChild:null,c=s?t.state.tr.replaceSelectionWith(s,i):t.state.tr.replaceSelection(u);return t.dispatch(c.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}JK.copy=JY.cut=(t,n)=>{let r=t.state.selection,i="cut"==n.type;if(r.empty)return;let o=Xt?null:n.clipboardData,{dom:a,text:u}=JD(t,r.content());o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",u)):function(t,n){if(!t.dom.parentNode)return;let r=t.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(n),r.style.cssText="position: fixed; left: -10000px; top: 10px";let i=getSelection(),o=document.createRange();o.selectNodeContents(n),t.dom.blur(),i.removeAllRanges(),i.addRange(o),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),t.focus()},50)}(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},JY.paste=(t,n)=>{if(t.composing&&!Hj)return;let r=Xt?null:n.clipboardData,i=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&Xn(t,r.getData("text/plain"),r.getData("text/html"),i,n)?n.preventDefault():function(t,n){if(!t.dom.parentNode)return;let r=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,i=t.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let o=t.input.shiftKey&&45!=t.input.lastKeyCode;setTimeout(()=>{t.focus(),i.parentNode&&i.parentNode.removeChild(i),r?Xn(t,i.value,null,o,n):Xn(t,i.textContent,i.innerHTML,o,n)},50)}(t,n)};class Xr{constructor(t,n){this.slice=t,this.move=n}}let Xi=HC?"altKey":"ctrlKey";for(let Xo in JK.dragstart=(t,n)=>{let r=n,i=t.input.mouseDown;if(i&&i.done(),!r.dataTransfer)return;let o=t.state.selection,a=o.empty?null:t.posAtCoords(JX(r));if(!(a&&a.pos>=o.from&&a.pos<=(o instanceof QH?o.to-1:o.to))){if(i&&i.mightDrag)t.dispatch(t.state.tr.setSelection(QH.create(t.state.doc,i.mightDrag.pos)));else if(r.target&&1==r.target.nodeType){let u=t.docView.nearestDesc(r.target,!0);u&&u.node.type.spec.draggable&&u!=t.docView&&t.dispatch(t.state.tr.setSelection(QH.create(t.state.doc,u.posBefore)))}}let s=t.state.selection.content(),{dom:c,text:l}=JD(t,s);r.dataTransfer.clearData(),r.dataTransfer.setData(Xt?"Text":"text/html",c.innerHTML),r.dataTransfer.effectAllowed="copyMove",Xt||r.dataTransfer.setData("text/plain",l),t.dragging=new Xr(s,!r[Xi])},JK.dragend=t=>{let n=t.dragging;window.setTimeout(()=>{t.dragging==n&&(t.dragging=null)},50)},JY.dragover=JY.dragenter=(t,n)=>n.preventDefault(),JY.drop=(t,n)=>{let r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(JX(n));if(!i)return;let o=t.state.doc.resolve(i.pos),a=r&&r.slice;a?t.someProp("transformPasted",n=>{a=n(a,t)}):a=JA(t,n.dataTransfer.getData(Xt?"Text":"text/plain"),Xt?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[Xi]);if(t.someProp("handleDrop",r=>r(t,n,a||ZS.empty,u))){n.preventDefault();return}if(!a)return;n.preventDefault();let s=a?function(t,n,r){let i=t.resolve(n);if(!r.content.size)return n;let o=r.content;for(let a=0;a<r.openStart;a++)o=o.firstChild.content;for(let u=1;u<=(0==r.openStart&&r.size?2:1);u++)for(let s=i.depth;s>=0;s--){let c=s==i.depth?0:i.pos<=(i.start(s+1)+i.end(s+1))/2?-1:1,l=i.index(s)+(c>0?1:0),f=i.node(s),d=!1;if(1==u)d=f.canReplace(l,l,o);else{let p=f.contentMatchAt(l).findWrapping(o.firstChild.type);d=p&&f.canReplaceWith(l,l,p[0])}if(d)return 0==c?i.pos:c<0?i.before(s+1):i.after(s+1)}return null}(t.state.doc,o.pos,a):o.pos;null==s&&(s=o.pos);let c=t.state.tr;u&&c.deleteSelection();let l=c.mapping.map(s),f=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,d=c.doc;if(f?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let p=c.doc.resolve(l);if(f&&QH.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new QH(p));else{let h=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((t,n,r,i)=>h=i),c.setSelection(Jv(t,p,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},JK.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Jf(t)},20))},JK.blur=(t,n)=>{t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},JK.beforeinput=(t,n)=>{if(H_&&Hj&&"deleteContentBackward"==n.inputType){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",n=>n(t,Hp(8,"Backspace")))))return;let{$cursor:n}=t.state.selection;n&&n.pos>0&&t.dispatch(t.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}},JY)JK[Xo]=JY[Xo];function Xa(t,n){if(t==n)return!0;for(let r in t)if(t[r]!==n[r])return!1;for(let i in n)if(!(i in t))return!1;return!0}class Xu{constructor(t,n){this.toDOM=t,this.spec=n||Xd,this.side=this.spec.side||0}map(t,n,r,i){let{pos:o,deleted:a}=t.mapResult(n.from+i,this.side<0?-1:1);return a?null:new Xl(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof Xu&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Xa(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Xs{constructor(t,n){this.attrs=t,this.spec=n||Xd}map(t,n,r,i){let o=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,a=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=a?null:new Xl(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Xs&&Xa(this.attrs,t.attrs)&&Xa(this.spec,t.spec)}static is(t){return t.type instanceof Xs}destroy(){}}let Xc=class t{constructor(t,n){this.attrs=t,this.spec=n||Xd}map(t,n,r,i){let o=t.mapResult(n.from+i,1);if(o.deleted)return null;let a=t.mapResult(n.to+i,-1);return a.deleted||a.pos<=o.pos?null:new Xl(o.pos-r,a.pos-r,this)}valid(t,n){let{index:r,offset:i}=t.content.findIndex(n.from),o;return i==n.from&&!(o=t.child(r)).isText&&i+o.nodeSize==n.to}eq(n){return this==n||n instanceof t&&Xa(this.attrs,n.attrs)&&Xa(this.spec,n.spec)}destroy(){}};class Xl{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Xl(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new Xl(t,t,new Xu(n,r))}static inline(t,n,r,i){return new Xl(t,n,new Xs(r,i))}static node(t,n,r,i){return new Xl(t,n,new Xc(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Xs}}let Xf=[],Xd={};class Xp{constructor(t,n){this.local=t.length?t:Xf,this.children=n.length?n:Xf}static create(t,n){return n.length?Xb(n,t,0,Xd):Xh}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,o){for(let a=0;a<this.local.length;a++){let u=this.local[a];u.from<=n&&u.to>=t&&(!o||o(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>t){let c=this.children[s]+1;this.children[s+2].findInner(t-c,n-c,r,i+c,o)}}map(t,n,r){return this==Xh||0==t.maps.length?this:this.mapInner(t,n,0,0,r||Xd)}mapInner(t,n,r,i,o){let a;for(let u=0;u<this.local.length;u++){let s=this.local[u].map(t,r,i);s&&s.type.valid(n,s)?(a||(a=[])).push(s):o.onRemove&&o.onRemove(this.local[u].spec)}return this.children.length?function(t,n,r,i,o,a,u){let s=t.slice();for(let c=0,l=a;c<r.maps.length;c++){let f=0;r.maps[c].forEach((t,n,r,i)=>{let a=i-r-(n-t);for(let u=0;u<s.length;u+=3){let c=s[u+1];if(c<0||t>c+l-f)continue;let d=s[u]+l-f;n>=d?s[u+1]=t<=d?-2:-1:r>=o&&a&&(s[u]+=a,s[u+1]+=a)}f+=a}),l=r.maps[c].map(l,-1)}let d=!1;for(let p=0;p<s.length;p+=3)if(s[p+1]<0){if(-2==s[p+1]){d=!0,s[p+1]=-1;continue}let h=r.map(t[p]+a),m=h-o;if(m<0||m>=i.content.size){d=!0;continue}let g=r.map(t[p+1]+a,-1)-o,{index:y,offset:v}=i.content.findIndex(m),b=i.maybeChild(y);if(b&&v==m&&v+b.nodeSize==g){let x=s[p+2].mapInner(r,b,h+1,t[p]+a+1,u);x!=Xh?(s[p]=m,s[p+1]=g,s[p+2]=x):(s[p+1]=-2,d=!0)}else d=!0}if(d){let M=function(t,n,r,i,o,a,u){function s(t,n){for(let a=0;a<t.local.length;a++){let c=t.local[a].map(i,o,n);c?r.push(c):u.onRemove&&u.onRemove(t.local[a].spec)}for(let l=0;l<t.children.length;l+=3)s(t.children[l+2],t.children[l]+n+1)}for(let c=0;c<t.length;c+=3)-1==t[c+1]&&s(t[c+2],n[c]+a+1);return r}(s,t,n,r,o,a,u),T=Xb(M,i,0,u);n=T.local;for(let S=0;S<s.length;S+=3)s[S+1]<0&&(s.splice(S,3),S-=3);for(let w=0,_=0;w<T.children.length;w+=3){let I=T.children[w];for(;_<s.length&&s[_]<I;)_+=3;s.splice(_,0,T.children[w],T.children[w+1],T.children[w+2])}}return new Xp(n.sort(Xx),s)}(this.children,a||[],t,n,r,i,o):a?new Xp(a.sort(Xx),Xf):Xh}add(t,n){return n.length?this==Xh?Xp.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((t,a)=>{let u=a+r,s;if(s=Xy(n,t,u)){for(i||(i=this.children.slice());o<i.length&&i[o]<a;)o+=3;i[o]==a?i[o+2]=i[o+2].addInner(t,s,u+1):i.splice(o,0,a,a+t.nodeSize,Xb(s,t,u+1,Xd)),o+=3}});let a=Xg(o?Xv(n):n,-r);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||a.splice(u--,1);return new Xp(a.length?this.local.concat(a).sort(Xx):this.local,i||this.children)}remove(t){return 0==t.length||this==Xh?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,u=r[o]+n,s=r[o+1]+n;for(let c=0,l;c<t.length;c++)(l=t[c])&&l.from>u&&l.to<s&&(t[c]=null,(a||(a=[])).push(l));if(!a)continue;r==this.children&&(r=this.children.slice());let f=r[o+2].removeInner(a,u+1);f!=Xh?r[o+2]=f:(r.splice(o,3),o-=3)}if(i.length){for(let d=0,p;d<t.length;d++)if(p=t[d])for(let h=0;h<i.length;h++)i[h].eq(p,n)&&(i==this.local&&(i=this.local.slice()),i.splice(h--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Xp(i,r):Xh}forChild(t,n){if(this==Xh)return this;if(n.isLeaf)return Xp.empty;let r,i;for(let o=0;o<this.children.length;o+=3)if(this.children[o]>=t){this.children[o]==t&&(r=this.children[o+2]);break}let a=t+1,u=a+n.content.size;for(let s=0;s<this.local.length;s++){let c=this.local[s];if(c.from<u&&c.to>a&&c.type instanceof Xs){let l=Math.max(a,c.from)-a,f=Math.min(u,c.to)-a;l<f&&(i||(i=[])).push(c.copy(l,f))}}if(i){let d=new Xp(i.sort(Xx),Xf);return r?new Xm([d,r]):d}return r||Xh}eq(t){if(this==t)return!0;if(!(t instanceof Xp)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let r=0;r<this.children.length;r+=3)if(this.children[r]!=t.children[r]||this.children[r+1]!=t.children[r+1]||!this.children[r+2].eq(t.children[r+2]))return!1;return!0}locals(t){return XM(this.localsInner(t))}localsInner(t){if(this==Xh)return Xf;if(t.inlineContent||!this.local.some(Xs.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Xs||n.push(this.local[r]);return n}}Xp.empty=new Xp([],[]),Xp.removeOverlap=XM;let Xh=Xp.empty;class Xm{constructor(t){this.members=t}map(t,n){let r=this.members.map(r=>r.map(t,n,Xd));return Xm.from(r)}forChild(t,n){if(n.isLeaf)return Xp.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=Xh&&(o instanceof Xm?r=r.concat(o.members):r.push(o))}return Xm.from(r)}eq(t){if(!(t instanceof Xm)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(t);if(o.length){if(n){r&&(n=n.slice(),r=!1);for(let a=0;a<o.length;a++)n.push(o[a])}else n=o}}return n?XM(r?n:n.sort(Xx)):Xf}static from(t){switch(t.length){case 0:return Xh;case 1:return t[0];default:return new Xm(t.every(t=>t instanceof Xp)?t:t.reduce((t,n)=>t.concat(n instanceof Xp?n:n.members),[]))}}}function Xg(t,n){if(!n||!t.length)return t;let r=[];for(let i=0;i<t.length;i++){let o=t[i];r.push(new Xl(o.from+n,o.to+n,o.type))}return r}function Xy(t,n,r){if(n.isLeaf)return null;let i=r+n.nodeSize,o=null;for(let a=0,u;a<t.length;a++)(u=t[a])&&u.from>r&&u.to<i&&((o||(o=[])).push(u),t[a]=null);return o}function Xv(t){let n=[];for(let r=0;r<t.length;r++)null!=t[r]&&n.push(t[r]);return n}function Xb(t,n,r,i){let o=[],a=!1;n.forEach((n,u)=>{let s=Xy(t,n,u+r);if(s){a=!0;let c=Xb(s,n,r+u+1,i);c!=Xh&&o.push(u,u+n.nodeSize,c)}});let u=Xg(a?Xv(t):t,-r).sort(Xx);for(let s=0;s<u.length;s++)u[s].type.valid(n,u[s])||(i.onRemove&&i.onRemove(u[s].spec),u.splice(s--,1));return u.length||o.length?new Xp(u,o):Xh}function Xx(t,n){return t.from-n.from||t.to-n.to}function XM(t){let n=t;for(let r=0;r<n.length-1;r++){let i=n[r];if(i.from!=i.to)for(let o=r+1;o<n.length;o++){let a=n[o];if(a.from==i.from){a.to!=i.to&&(n==t&&(n=t.slice()),n[o]=a.copy(a.from,i.to),XT(n,o+1,a.copy(i.to,a.to)));continue}a.from<i.to&&(n==t&&(n=t.slice()),n[r]=i.copy(i.from,a.from),XT(n,o,i.copy(a.from,i.to)));break}}return n}function XT(t,n,r){for(;n<t.length&&Xx(r,t[n])>0;)n++;t.splice(n,0,r)}function XS(t){let n=[];return t.someProp("decorations",r=>{let i=r(t.state);i&&i!=Xh&&n.push(i)}),t.cursorWrapper&&n.push(Xp.create(t.state.doc,[t.cursorWrapper.deco])),Xm.from(n)}let Xw={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},X_=HM&&HT<=11;class XI{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class XO{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new XI,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let n=0;n<t.length;n++)this.queue.push(t[n]);HM&&HT<=11&&t.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),X_&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Xw)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Jb(this.view)){if(this.suppressingSelectionUpdates)return Jf(this.view);if(HM&&HT<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Hu(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let i=t.focusNode;i;i=Hi(i))n.add(i);for(let o=t.anchorNode;o;o=Hi(o))if(n.has(o)){r=o;break}let a=r&&this.view.docView.nearestDesc(r);if(a&&a.ignoreMutation({type:"selection",target:3==r.nodeType?r.parentNode:r}))return this.setCurSelection(),!0}flush(){var t;let{view:n}=this;if(!n.docView||this.flushingSoon>-1)return;let r=this.observer?this.observer.takeRecords():[];this.queue.length&&(r=this.queue.concat(r),this.queue.length=0);let i=n.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(i)&&Jb(n)&&!this.ignoreSelectionChange(i),a=-1,u=-1,s=!1,c=[];if(n.editable)for(let l=0;l<r.length;l++){let f=this.registerMutation(r[l],c);f&&(a=a<0?f.from:Math.min(f.from,a),u=u<0?f.to:Math.max(f.to,u),f.typeOver&&(s=!0))}if(HS&&c.length>1){let d=c.filter(t=>"BR"==t.nodeName);if(2==d.length){let p=d[0],h=d[1];p.parentNode&&p.parentNode.parentNode==h.parentNode?h.remove():p.remove()}}let m=null;a<0&&o&&n.input.lastFocus>Date.now()-200&&Math.max(n.input.lastTouch,n.input.lastClick.time)<Date.now()-300&&Hd(i)&&(m=Jc(n))&&m.eq(QK.near(n.state.doc.resolve(0),1))?(n.input.lastFocus=0,Jf(n),this.currentSelection.set(i),n.scrollToSelection()):(a>-1||o)&&(a>-1&&(n.docView.markDirty(a,u),t=n,Xk.has(t)||(Xk.set(t,null),-1===["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace))||(t.requiresGeckoHackNode=HS,XC||(console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),XC=!0))),this.handleDOMChange(a,u,s,c),n.docView&&n.docView.dirty?n.updateState(n.state):this.currentSelection.eq(i)||Jf(n),this.currentSelection.set(i))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(r==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if("childList"!=t.type)return"attributes"==t.type?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue};{for(let i=0;i<t.addedNodes.length;i++)n.push(t.addedNodes[i]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let o=t.previousSibling,a=t.nextSibling;if(HM&&HT<=11&&t.addedNodes.length)for(let u=0;u<t.addedNodes.length;u++){let{previousSibling:s,nextSibling:c}=t.addedNodes[u];(!s||0>Array.prototype.indexOf.call(t.addedNodes,s))&&(o=s),(!c||0>Array.prototype.indexOf.call(t.addedNodes,c))&&(a=c)}let l=o&&o.parentNode==t.target?Hr(o)+1:0,f=r.localPosFromDOM(t.target,l,-1),d=a&&a.parentNode==t.target?Hr(a):t.target.childNodes.length,p=r.localPosFromDOM(t.target,d,1);return{from:f,to:p}}}}let Xk=new WeakMap,XC=!1;function XN(t){let n=t.pmViewDesc;if(n)return n.parseRule();if("BR"==t.nodeName&&t.parentNode){if(HO&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}if(t.parentNode.lastChild==t||HO&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}let Xj=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function XE(t,n,r){return Math.max(r.anchor,r.head)>n.content.size?null:Jv(t,n.resolve(r.anchor),n.resolve(r.head))}function XR(t,n,r){let i=t.depth,o=n?t.end():t.pos;for(;i>0&&(n||t.indexAfter(i)==t.node(i).childCount);)i--,o++,n=!1;if(r){let a=t.node(i).maybeChild(t.indexAfter(i));for(;a&&!a.isLeaf;)a=a.firstChild,o++}return o}class XD{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new JG,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Xz),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=XP(this),XL(this),this.nodeViews=XF(this),this.docView=H3(this.state.doc,XA(this),XS(this),this.dom,this),this.domObserver=new XO(this,(t,n,r,i)=>(function(t,n,r,i,o){if(n<0){let a=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,u=Jc(t,a);if(u&&!t.state.selection.eq(u)){if(H_&&Hj&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",n=>n(t,Hp(13,"Enter"))))return;let s=t.state.tr.setSelection(u);"pointer"==a?s.setMeta("pointer",!0):"key"==a&&s.scrollIntoView(),t.composing&&s.setMeta("composition",t.input.compositionID),t.dispatch(s)}return}let c=t.state.doc.resolve(n),l=c.sharedDepth(r);n=c.before(l+1),r=t.state.doc.resolve(r).after(l+1);let f=t.state.selection,d=function(t,n,r){let{node:i,fromOffset:o,toOffset:a,from:u,to:s}=t.docView.parseRange(n,r),c=t.domSelectionRange(),l,f=c.anchorNode;if(f&&t.dom.contains(1==f.nodeType?f:f.parentNode)&&(l=[{node:f,offset:c.anchorOffset}],Hd(c)||l.push({node:c.focusNode,offset:c.focusOffset})),H_&&8===t.input.lastKeyCode)for(let d=a;d>o;d--){let p=i.childNodes[d-1],h=p.pmViewDesc;if("BR"==p.nodeName&&!h){a=d;break}if(!h||h.size)break}let m=t.state.doc,g=t.someProp("domParser")||Z4.fromSchema(t.state.schema),y=m.resolve(u),v=null,b=g.parse(i,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:o,to:a,preserveWhitespace:"pre"!=y.parent.type.whitespace||"full",findPositions:l,ruleFromNode:XN,context:y});if(l&&null!=l[0].pos){let x=l[0].pos,M=l[1]&&l[1].pos;null==M&&(M=x),v={anchor:x+u,head:M+u}}return{doc:b,sel:v,from:u,to:s}}(t,n,r),p=t.state.doc,h=p.slice(d.from,d.to),m,g;8===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime?(m=t.state.selection.to,g="end"):(m=t.state.selection.from,g="start"),t.input.lastKeyCode=null;let y=function(t,n,r,i,o){let a=t.findDiffStart(n,r);if(null==a)return null;let{a:u,b:s}=t.findDiffEnd(n,r+t.size,r+n.size);if("end"==o){let c=Math.max(0,a-Math.min(u,s));i-=u+c-a}if(u<a&&t.size<n.size){let l=i<=a&&i>=u?a-i:0;a-=l,s=a+(s-u),u=a}else if(s<a){let f=i<=a&&i>=s?a-i:0;a-=f,u=a+(u-s),s=a}return{start:a,endA:u,endB:s}}(h.content,d.doc.content,d.from,m,g);if((Hk&&t.input.lastIOSEnter>Date.now()-225||Hj)&&o.some(t=>1==t.nodeType&&!Xj.test(t.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",n=>n(t,Hp(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y){if(i&&f instanceof QZ&&!f.empty&&f.$head.sameParent(f.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))y={start:f.from,endA:f.to,endB:f.to};else{if(d.sel){let v=XE(t,t.state.doc,d.sel);if(v&&!v.eq(t.state.selection)){let b=t.state.tr.setSelection(v);t.composing&&b.setMeta("composition",t.input.compositionID),t.dispatch(b)}}return}}if(H_&&t.cursorWrapper&&d.sel&&d.sel.anchor==t.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){let x=y.endB-y.start;d.sel={anchor:d.sel.anchor+x,head:d.sel.anchor+x}}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&y.start==y.endB&&t.state.selection instanceof QZ&&(y.start>t.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?y.start=t.state.selection.from:y.endA<t.state.selection.to&&y.endA>=t.state.selection.to-2&&t.state.selection.to<=d.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),HM&&HT<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>d.from&&" \xa0"==d.doc.textBetween(y.start-d.from-1,y.start-d.from+1)&&(y.start--,y.endA--,y.endB--);let M=d.doc.resolveNoCache(y.start-d.from),T=d.doc.resolveNoCache(y.endB-d.from),S=p.resolve(y.start),w=M.sameParent(T)&&M.parent.inlineContent&&S.end()>=y.endA,_;if((Hk&&t.input.lastIOSEnter>Date.now()-225&&(!w||o.some(t=>"DIV"==t.nodeName||"P"==t.nodeName))||!w&&M.pos<d.doc.content.size&&!M.sameParent(T)&&(_=QK.findFrom(d.doc.resolve(M.pos+1),1,!0))&&_.head==T.pos)&&t.someProp("handleKeyDown",n=>n(t,Hp(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>y.start&&function(t,n,r,i,o){if(!i.parent.isTextblock||r-n<=o.pos-i.pos||XR(i,!0,!1)<o.pos)return!1;let a=t.resolve(n);if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let u=t.resolve(XR(a,!0,!0));return!(!u.parent.isTextblock||u.pos>r||XR(u,!0,!1)<r)&&i.parent.content.cut(i.parentOffset).eq(u.parent.content)}(p,y.start,y.endA,M,T)&&t.someProp("handleKeyDown",n=>n(t,Hp(8,"Backspace")))){Hj&&H_&&t.domObserver.suppressSelectionUpdates();return}H_&&Hj&&y.endB==y.start&&(t.input.lastAndroidDelete=Date.now()),Hj&&!w&&M.start()!=T.start()&&0==T.parentOffset&&M.depth==T.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==y.endA&&(y.endB-=2,T=d.doc.resolveNoCache(y.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(n){return n(t,Hp(13,"Enter"))})},20));let I=y.start,O=y.endA,k,C,N;if(w){if(M.pos==T.pos)HM&&HT<=11&&0==M.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Jf(t),20)),k=t.state.tr.delete(I,O),C=p.resolve(y.start).marksAcross(p.resolve(y.endA));else if(y.endA==y.endB&&(N=function(t,n){let r=t.firstChild.marks,i=n.firstChild.marks,o=r,a=i,u,s,c;for(let l=0;l<i.length;l++)o=i[l].removeFromSet(o);for(let f=0;f<r.length;f++)a=r[f].removeFromSet(a);if(1==o.length&&0==a.length)s=o[0],u="add",c=t=>t.mark(s.addToSet(t.marks));else{if(0!=o.length||1!=a.length)return null;s=a[0],u="remove",c=t=>t.mark(s.removeFromSet(t.marks))}let d=[];for(let p=0;p<n.childCount;p++)d.push(c(n.child(p)));if(Zy.from(d).eq(t))return{mark:s,type:u}}(M.parent.content.cut(M.parentOffset,T.parentOffset),S.parent.content.cut(S.parentOffset,y.endA-S.start()))))k=t.state.tr,"add"==N.type?k.addMark(I,O,N.mark):k.removeMark(I,O,N.mark);else if(M.parent.child(M.index()).isText&&M.index()==T.index()-(T.textOffset?0:1)){let j=M.parent.textBetween(M.parentOffset,T.parentOffset);if(t.someProp("handleTextInput",n=>n(t,I,O,j)))return;k=t.state.tr.insertText(j,I,O)}}if(k||(k=t.state.tr.replace(I,O,d.doc.slice(y.start-d.from,y.endB-d.from))),d.sel){let E=XE(t,k.doc,d.sel);E&&!(H_&&Hj&&t.composing&&E.empty&&(y.start!=y.endB||t.input.lastAndroidDelete<Date.now()-100)&&(E.head==I||E.head==k.mapping.map(O)-1)||HM&&E.empty&&E.head==I)&&k.setSelection(E)}C&&k.ensureMarks(C),t.composing&&k.setMeta("composition",t.input.compositionID),t.dispatch(k.scrollIntoView())})(this,t,n,r,i)),this.domObserver.start(),function(t){for(let n in JK){let r=JK[n];t.dom.addEventListener(n,t.input.eventHandlers[n]=n=>{!JJ(t,n)||JH(t,n)||!t.editable&&n.type in JY||r(t,n)},Jq[n]?{passive:!0}:void 0)}HO&&t.dom.addEventListener("input",()=>null),JQ(t)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;for(let n in this._props={},t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&JQ(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(Xz),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];for(let i in n.state=this.state,t)n[i]=t[i];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){let r=this.state,i=!1,o=!1;t.storedMarks&&this.composing&&(J7(this),o=!0),this.state=t;let a=r.plugins!=t.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let u=XF(this);(function(t,n){let r=0,i=0;for(let o in t){if(t[o]!=n[o])return!0;r++}for(let a in n)i++;return r!=i})(u,this.nodeViews)&&(this.nodeViews=u,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&JQ(this),this.editable=XP(this),XL(this);let s=XS(this),c=XA(this),l=r.plugins==t.plugins||r.doc.eq(t.doc)?t.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",f=i||!this.docView.matchesNode(t.doc,c,s);(f||!t.selection.eq(r.selection))&&(o=!0);let d="preserve"==l&&o&&null==this.dom.style.overflowAnchor&&function(t){let n=t.dom.getBoundingClientRect(),r=Math.max(0,n.top),i,o;for(let a=(n.left+n.right)/2,u=r+1;u<Math.min(innerHeight,n.bottom);u+=5){let s=t.root.elementFromPoint(a,u);if(!s||s==t.dom||!t.dom.contains(s))continue;let c=s.getBoundingClientRect();if(c.top>=r-20){i=s,o=c.top;break}}return{refDOM:i,refTop:o,stack:HF(t.dom)}}(this);if(o){var p,h,m;this.domObserver.stop();let g,y=f&&(HM||H_)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&(h=r.selection,m=t.selection,g=Math.min(h.$anchor.sharedDepth(h.head),m.$anchor.sharedDepth(m.head)),h.$anchor.start(g)!=m.$anchor.start(g));if(f){let v=H_?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(t.doc,c,s,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=H3(t.doc,c,s,this.dom,this)),v&&!this.trackWrites&&(y=!0)}let b,x;y||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(b=this.docView.domFromPos(this.state.selection.anchor,0),x=this.domSelectionRange(),Hu(b.node,b.offset,x.anchorNode,x.anchorOffset)))?Jf(this,y):(Jg(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():d&&function({refDOM:t,refTop:n,stack:r}){let i=t?t.getBoundingClientRect().top:0;Hz(r,0==i?0:i-n)}(d)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this))){if(this.state.selection instanceof QH){let n=this.docView.domAfterPos(this.state.selection.from);1==n.nodeType&&HP(this,n.getBoundingClientRect(),t)}else HP(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let i=0;i<this.directPlugins.length;i++){let o=this.directPlugins[i];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(let a=0;a<this.state.plugins.length;a++){let u=this.state.plugins[a];u.spec.view&&this.pluginViews.push(u.spec.view(this))}}}someProp(t,n){let r=this._props&&this._props[t],i;if(null!=r&&(i=n?n(r):r))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[t];if(null!=a&&(i=n?n(a):a))return i}let u=this.state.plugins;if(u)for(let s=0;s<u.length;s++){let c=u[s].props[t];if(null!=c&&(i=n?n(c):c))return i}}hasFocus(){if(HM){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if("false"==t.contentEditable)return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(HU)return t.focus(HU);let n=HF(t);t.focus(null==HU?{get preventScroll(){return HU={preventScroll:!0},!0}}:void 0),HU||(HU=!1,Hz(n,0))}(this.dom),Jf(this),this.domObserver.start()}get root(){let t=this._root;if(null==t){for(let n=this.dom.parentNode;n;n=n.parentNode)if(9==n.nodeType||11==n.nodeType&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}posAtCoords(t){return function(t,n){var r,i;let o=t.dom.ownerDocument,a,u=0,s=Hh(o,n.left,n.top);s&&({node:a,offset:u}=s);let c=(t.root.elementFromPoint?t.root:o).elementFromPoint(n.left,n.top),l;if(!c||!t.dom.contains(1!=c.nodeType?c.parentNode:c)){let f=t.dom.getBoundingClientRect();if(!HW(n,f)||!(c=function t(n,r,i){let o=n.childNodes.length;if(o&&i.top<i.bottom)for(let a=Math.max(0,Math.min(o-1,Math.floor(o*(r.top-i.top)/(i.bottom-i.top))-2)),u=a;;){let s=n.childNodes[u];if(1==s.nodeType){let c=s.getClientRects();for(let l=0;l<c.length;l++){let f=c[l];if(HW(r,f))return t(s,r,f)}}if((u=(u+1)%o)==a)break}return n}(t.dom,n,f)))return null}if(HO)for(let d=c;a&&d;d=Hi(d))d.draggable&&(a=void 0);let p;if(c=(p=(r=c).parentNode)&&/^li$/i.test(p.nodeName)&&n.left<r.getBoundingClientRect().left?p:r,a){if(HS&&1==a.nodeType&&(u=Math.min(u,a.childNodes.length))<a.childNodes.length){let h=a.childNodes[u],m;"IMG"==h.nodeName&&(m=h.getBoundingClientRect()).right<=n.left&&m.bottom>n.top&&u++}a==t.dom&&u==a.childNodes.length-1&&1==a.lastChild.nodeType&&n.top>a.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(0==u||1!=a.nodeType||"BR"!=a.childNodes[u-1].nodeName)&&(l=function(t,n,r,i){let o=-1;for(let a=n,u=!1;a!=t.dom;){let s=t.docView.nearestDesc(a,!0);if(!s)return null;if(1==s.dom.nodeType&&(s.node.isBlock&&s.parent&&!u||!s.contentDOM)){let c=s.dom.getBoundingClientRect();if(s.node.isBlock&&s.parent&&!u&&(u=!0,c.left>i.left||c.top>i.top?o=s.posBefore:(c.right<i.left||c.bottom<i.top)&&(o=s.posAfter)),!s.contentDOM&&o<0)return(s.node.isBlock?i.top<(c.top+c.bottom)/2:i.left<(c.left+c.right)/2)?s.posBefore:s.posAfter}a=s.dom.parentNode}return o>-1?o:t.docView.posFromDOM(n,r,-1)}(t,a,u,n))}null==l&&(l=function(t,n,r){let{node:i,offset:o}=function t(n,r){let i,o=2e8,a,u=0,s=r.top,c=r.top,l,f;for(let d=n.firstChild,p=0;d;d=d.nextSibling,p++){let h;if(1==d.nodeType)h=d.getClientRects();else{if(3!=d.nodeType)continue;h=Ha(d).getClientRects()}for(let m=0;m<h.length;m++){let g=h[m];if(g.top<=s&&g.bottom>=c){s=Math.max(g.bottom,s),c=Math.min(g.top,c);let y=g.left>r.left?g.left-r.left:g.right<r.left?r.left-g.right:0;if(y<o){i=d,o=y,a=y&&3==i.nodeType?{left:g.right<r.left?g.right:g.left,top:r.top}:r,1==d.nodeType&&y&&(u=p+(r.left>=(g.left+g.right)/2?1:0));continue}}else g.top>r.top&&!l&&g.left<=r.left&&g.right>=r.left&&(l=d,f={left:Math.max(g.left,Math.min(g.right,r.left)),top:g.top});!i&&(r.left>=g.right&&r.top>=g.top||r.left>=g.left&&r.top>=g.bottom)&&(u=p+1)}}return!i&&l&&(i=l,a=f,o=0),i&&3==i.nodeType?function(t,n){let r=t.nodeValue.length,i=document.createRange();for(let o=0;o<r;o++){i.setEnd(t,o+1),i.setStart(t,o);let a=HV(i,1);if(a.top!=a.bottom&&HW(n,a))return{node:t,offset:o+(n.left>=(a.left+a.right)/2?1:0)}}return{node:t,offset:0}}(i,a):!i||o&&1==i.nodeType?{node:n,offset:u}:t(i,a)}(n,r),a=-1;if(1==i.nodeType&&!i.firstChild){let u=i.getBoundingClientRect();a=u.left!=u.right&&r.left>(u.left+u.right)/2?1:-1}return t.docView.posFromDOM(i,o,a)}(t,c,n));let g=t.docView.nearestDesc(c,!0);return{pos:l,inside:g?g.posAtStart-g.border:-1}}(this,t)}coordsAtPos(t,n=1){return HK(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let i=this.docView.posFromDOM(t,n,r);if(null==i)throw RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){var r,i,o,a,u,s;let c,l;return HQ==(i=n||this.state)&&HH==t?HJ:(HQ=i,HH=t,HJ="up"==t||"down"==t?(a=this,c=i.selection,l="up"==t?c.$from:c.$to,HG(a,i,()=>{let{node:n}=a.docView.domFromPos(l.pos,"up"==t?-1:1);for(;;){let r=a.docView.nearestDesc(n,!0);if(!r)break;if(r.node.isBlock){n=r.contentDOM||r.dom;break}n=r.dom.parentNode}let i=HK(a,l.pos,1);for(let o=n.firstChild;o;o=o.nextSibling){let u;if(1==o.nodeType)u=o.getClientRects();else{if(3!=o.nodeType)continue;u=Ha(o,0,o.nodeValue.length).getClientRects()}for(let s=0;s<u.length;s++){let c=u[s];if(c.bottom>c.top+1&&("up"==t?i.top-c.top>(c.bottom-i.top)*2:c.bottom-i.bottom>(i.bottom-c.top)*2))return!1}}return!0})):function(t,n,r){let{$head:i}=n.selection;if(!i.parent.isTextblock)return!1;let o=i.parentOffset,a=o==i.parent.content.size,u=t.domSelection();return HZ.test(i.parent.textContent)&&u.modify?HG(t,n,()=>{let{focusNode:n,focusOffset:o,anchorNode:a,anchorOffset:s}=t.domSelectionRange(),c=u.caretBidiLevel;u.modify("move",r,"character");let l=i.depth?t.docView.domAfterPos(i.before()):t.dom,{focusNode:f,focusOffset:d}=t.domSelectionRange(),p=f&&!l.contains(1==f.nodeType?f:f.parentNode)||n==f&&o==d;try{u.collapse(a,s),n&&(n!=a||o!=s)&&u.extend&&u.extend(n,o)}catch{}return null!=c&&(u.caretBidiLevel=c),p}):"left"==r||"backward"==r?!o:a}(this,i,t))}pasteHTML(t,n){return Xn(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Xn(this,t,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(function(t){for(let n in t.domObserver.stop(),t.input.eventHandlers)t.dom.removeEventListener(n,t.input.eventHandlers[n]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],XS(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(t){var n,r;JH(this,t)||!JK[t.type]||!this.editable&&t.type in JY||JK[t.type](this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return HO&&11===this.root.nodeType&&function(t){let n=t.activeElement;for(;n&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}(this.dom.ownerDocument)==this.dom?function(t){let n;function r(t){t.preventDefault(),t.stopImmediatePropagation(),n=t.getTargetRanges()[0]}t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0);let i=n.startContainer,o=n.startOffset,a=n.endContainer,u=n.endOffset,s=t.domAtPos(t.state.selection.anchor);return Hu(s.node,s.offset,a,u)&&([i,o,a,u]=[a,u,i,o]),{anchorNode:i,anchorOffset:o,focusNode:a,focusOffset:u}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function XA(t){let n=Object.create(null);return n.class="ProseMirror",n.contenteditable=String(t.editable),t.someProp("attributes",r=>{if("function"==typeof r&&(r=r(t.state)),r)for(let i in r)"class"==i?n.class+=" "+r[i]:"style"==i?n.style=(n.style?n.style+";":"")+r[i]:n[i]||"contenteditable"==i||"nodeName"==i||(n[i]=String(r[i]))}),n.translate||(n.translate="no"),[Xl.node(0,t.state.doc.content.size,n)]}function XL(t){if(t.markCursor){let n=document.createElement("img");n.className="ProseMirror-separator",n.setAttribute("mark-placeholder","true"),n.setAttribute("alt",""),t.cursorWrapper={dom:n,deco:Xl.widget(t.state.selection.head,n,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function XP(t){return!t.someProp("editable",n=>!1===n(t.state))}function XF(t){let n=Object.create(null);function r(t){for(let r in t)Object.prototype.hasOwnProperty.call(n,r)||(n[r]=t[r])}return t.someProp("nodeViews",r),t.someProp("markViews",r),n}function Xz(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}for(var XU={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:"'"},XW={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},XB="u">typeof navigator&&/Mac/.test(navigator.platform),XV="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),X$=0;X$<10;X$++)XU[48+X$]=XU[96+X$]=String(X$);for(var X$=1;X$<=24;X$++)XU[X$+111]="F"+X$;for(var X$=65;X$<=90;X$++)XU[X$]=String.fromCharCode(X$+32),XW[X$]=String.fromCharCode(X$);for(var XK in XU)XW.hasOwnProperty(XK)||(XW[XK]=XU[XK]);let XY="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Xq(t){let n=t.split(/-(?!$)/),r=n[n.length-1];"Space"==r&&(r=" ");let i,o,a,u;for(let s=0;s<n.length-1;s++){let c=n[s];if(/^(cmd|meta|m)$/i.test(c))u=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))a=!0;else if(/^mod$/i.test(c))XY?u=!0:o=!0;else throw Error("Unrecognized modifier name: "+c)}return i&&(r="Alt-"+r),o&&(r="Ctrl-"+r),u&&(r="Meta-"+r),a&&(r="Shift-"+r),r}function XG(t,n,r=!0){return n.altKey&&(t="Alt-"+t),n.ctrlKey&&(t="Ctrl-"+t),n.metaKey&&(t="Meta-"+t),r&&n.shiftKey&&(t="Shift-"+t),t}let XZ=(t,n)=>!t.selection.empty&&(n&&n(t.tr.deleteSelection().scrollIntoView()),!0),XQ=(t,n,r)=>{let i=function(t,n){let{$cursor:r}=t.selection;return r&&(n?n.endOfTextblock("backward",t):!(r.parentOffset>0))?r:null}(t,r);if(!i)return!1;let o=XX(i);if(!o){let a=i.blockRange(),u=a&&QS(a);return null!=u&&(n&&n(t.tr.lift(a,u).scrollIntoView()),!0)}let s=o.nodeBefore;if(!s.type.spec.isolating&&een(t,o,n))return!0;if(0==i.parent.content.size&&(XH(s,"end")||QH.isSelectable(s))){let c=QN(t.doc,i.before(),i.after(),ZS.empty);if(c&&c.slice.size<c.to-c.from){if(n){let l=t.tr.step(c);l.setSelection(XH(s,"end")?QK.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):QH.create(l.doc,o.pos-s.nodeSize)),n(l.scrollIntoView())}return!0}}return!!s.isAtom&&o.depth==i.depth-1&&(n&&n(t.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0)};function XH(t,n,r=!1){for(let i=t;i;i="start"==n?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(r&&1!=i.childCount)break}return!1}let XJ=(t,n,r)=>{let{$head:i,empty:o}=t.selection,a=i;if(!o)return!1;if(i.parent.isTextblock){if(r?!r.endOfTextblock("backward",t):i.parentOffset>0)return!1;a=XX(i)}let u=a&&a.nodeBefore;return!!(u&&QH.isSelectable(u))&&(n&&n(t.tr.setSelection(QH.create(t.doc,a.pos-u.nodeSize)).scrollIntoView()),!0)};function XX(t){if(!t.parent.type.spec.isolating)for(let n=t.depth-1;n>=0;n--){if(t.index(n)>0)return t.doc.resolve(t.before(n+1));if(t.node(n).type.spec.isolating)break}return null}let X0=(t,n,r)=>{let i=function(t,n){let{$cursor:r}=t.selection;return r&&(n?n.endOfTextblock("forward",t):!(r.parentOffset<r.parent.content.size))?r:null}(t,r);if(!i)return!1;let o=X2(i);if(!o)return!1;let a=o.nodeAfter;if(een(t,o,n))return!0;if(0==i.parent.content.size&&(XH(a,"start")||QH.isSelectable(a))){let u=QN(t.doc,i.before(),i.after(),ZS.empty);if(u&&u.slice.size<u.to-u.from){if(n){let s=t.tr.step(u);s.setSelection(XH(a,"start")?QK.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):QH.create(s.doc,s.mapping.map(o.pos))),n(s.scrollIntoView())}return!0}}return!!a.isAtom&&o.depth==i.depth-1&&(n&&n(t.tr.delete(o.pos,o.pos+a.nodeSize).scrollIntoView()),!0)},X1=(t,n,r)=>{let{$head:i,empty:o}=t.selection,a=i;if(!o)return!1;if(i.parent.isTextblock){if(r?!r.endOfTextblock("forward",t):i.parentOffset<i.parent.content.size)return!1;a=X2(i)}let u=a&&a.nodeAfter;return!!(u&&QH.isSelectable(u))&&(n&&n(t.tr.setSelection(QH.create(t.doc,a.pos)).scrollIntoView()),!0)};function X2(t){if(!t.parent.type.spec.isolating)for(let n=t.depth-1;n>=0;n--){let r=t.node(n);if(t.index(n)+1<r.childCount)return t.doc.resolve(t.after(n+1));if(r.type.spec.isolating)break}return null}let X4=(t,n)=>{let r=t.selection,i=r instanceof QH,o;if(i){if(r.node.isTextblock||!QO(t.doc,r.from))return!1;o=r.from}else if(null==(o=QC(t.doc,r.from,-1)))return!1;if(n){let a=t.tr.join(o);i&&a.setSelection(QH.create(a.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),n(a.scrollIntoView())}return!0},X3=(t,n)=>{let r=t.selection,i;if(r instanceof QH){if(r.node.isTextblock||!QO(t.doc,r.to))return!1;i=r.to}else if(null==(i=QC(t.doc,r.to,1)))return!1;return n&&n(t.tr.join(i).scrollIntoView()),!0},X5=(t,n)=>{let{$from:r,$to:i}=t.selection,o=r.blockRange(i),a=o&&QS(o);return null!=a&&(n&&n(t.tr.lift(o,a).scrollIntoView()),!0)},X9=(t,n)=>{let{$head:r,$anchor:i}=t.selection;return!!(r.parent.type.spec.code&&r.sameParent(i))&&(n&&n(t.tr.insertText(`
|
|
13
|
-
`).scrollIntoView()),!0)};function X8(t){for(let n=0;n<t.edgeCount;n++){let{type:r}=t.edge(n);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}let X6=(t,n)=>{let{$head:r,$anchor:i}=t.selection;if(!r.parent.type.spec.code||!r.sameParent(i))return!1;let o=r.node(-1),a=r.indexAfter(-1),u=X8(o.contentMatchAt(a));if(!u||!o.canReplaceWith(a,a,u))return!1;if(n){let s=r.after(),c=t.tr.replaceWith(s,s,u.createAndFill());c.setSelection(QK.near(c.doc.resolve(s),1)),n(c.scrollIntoView())}return!0},X7=(t,n)=>{let r=t.selection,{$from:i,$to:o}=r;if(r instanceof QX||i.parent.inlineContent||o.parent.inlineContent)return!1;let a=X8(o.parent.contentMatchAt(o.indexAfter()));if(!a||!a.isTextblock)return!1;if(n){let u=(!i.parentOffset&&o.index()<o.parent.childCount?i:o).pos,s=t.tr.insert(u,a.createAndFill());s.setSelection(QZ.create(s.doc,u+1)),n(s.scrollIntoView())}return!0},eee=(t,n)=>{let{$cursor:r}=t.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let i=r.before();if(QI(t.doc,i))return n&&n(t.tr.split(i).scrollIntoView()),!0}let o=r.blockRange(),a=o&&QS(o);return null!=a&&(n&&n(t.tr.lift(o,a).scrollIntoView()),!0)},eet=(t,n)=>{let{$from:r,to:i}=t.selection,o,a=r.sharedDepth(i);return 0!=a&&(o=r.before(a),n&&n(t.tr.setSelection(QH.create(t.doc,o))),!0)};function een(t,n,r){var i,o,a;let u=n.nodeBefore,s=n.nodeAfter,c,l;if(u.type.spec.isolating||s.type.spec.isolating)return!1;let f,d,p;if(f=n.nodeBefore,d=n.nodeAfter,p=n.index(),f&&d&&f.type.compatibleContent(d.type)&&(!f.content.size&&n.parent.canReplace(p-1,p)?(r&&r(t.tr.delete(n.pos-f.nodeSize,n.pos).scrollIntoView()),!0):!!(n.parent.canReplace(p,p+1)&&(d.isTextblock||QO(t.doc,n.pos)))&&(r&&r(t.tr.clearIncompatible(n.pos,f.type,f.contentMatchAt(f.childCount)).join(n.pos).scrollIntoView()),!0)))return!0;let h=n.parent.canReplace(n.index(),n.index()+1);if(h&&(c=(l=u.contentMatchAt(u.childCount)).findWrapping(s.type))&&l.matchType(c[0]||s.type).validEnd){if(r){let m=n.pos+s.nodeSize,g=Zy.empty;for(let y=c.length-1;y>=0;y--)g=Zy.from(c[y].create(null,g));g=Zy.from(u.copy(g));let v=t.tr.step(new Qx(n.pos-1,m,n.pos,m,new ZS(g,1,0),c.length,!0)),b=m+2*c.length;QO(v.doc,b)&&v.join(b),r(v.scrollIntoView())}return!0}let x=QK.findFrom(n,1),M=x&&x.$from.blockRange(x.$to),T=M&&QS(M);if(null!=T&&T>=n.depth)return r&&r(t.tr.lift(M,T).scrollIntoView()),!0;if(h&&XH(s,"start",!0)&&XH(u,"end")){let S=u,w=[];for(;w.push(S),!S.isTextblock;)S=S.lastChild;let _=s,I=1;for(;!_.isTextblock;_=_.firstChild)I++;if(S.canReplace(S.childCount,S.childCount,_.content)){if(r){let O=Zy.empty;for(let k=w.length-1;k>=0;k--)O=Zy.from(w[k].copy(O));let C=t.tr.step(new Qx(n.pos-w.length,n.pos+s.nodeSize,n.pos+I,n.pos+s.nodeSize-I,new ZS(O,w.length,0),0,!0));r(C.scrollIntoView())}return!0}}return!1}function eer(t){return function(n,r){let i=n.selection,o=t<0?i.$from:i.$to,a=o.depth;for(;o.node(a).isInline;){if(!a)return!1;a--}return!!o.node(a).isTextblock&&(r&&r(n.tr.setSelection(QZ.create(n.doc,t<0?o.start(a):o.end(a)))),!0)}}let eei=eer(-1),eeo=eer(1);function eea(t,n=null){return function(r,i){let o=!1;for(let a=0;a<r.selection.ranges.length&&!o;a++){let{$from:{pos:u},$to:{pos:s}}=r.selection.ranges[a];r.doc.nodesBetween(u,s,(i,a)=>{if(o)return!1;if(!(!i.isTextblock||i.hasMarkup(t,n))){if(i.type==t)o=!0;else{let u=r.doc.resolve(a),s=u.index();o=u.parent.canReplaceWith(s,s+1,t)}}})}if(!o)return!1;if(i){let c=r.tr;for(let l=0;l<r.selection.ranges.length;l++){let{$from:{pos:f},$to:{pos:d}}=r.selection.ranges[l];c.setBlockType(f,d,t,n)}i(c.scrollIntoView())}return!0}}function eeu(t){let{state:n,transaction:r}=t,{selection:i}=r,{doc:o}=r,{storedMarks:a}=r;return{...n,apply:n.apply.bind(n),applyTransaction:n.applyTransaction.bind(n),filterTransaction:n.filterTransaction,plugins:n.plugins,schema:n.schema,reconfigure:n.reconfigure.bind(n),toJSON:n.toJSON.bind(n),get storedMarks(){return a},get selection(){return i},get doc(){return o},get tr(){return i=r.selection,o=r.doc,a=r.storedMarks,r}}}"u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&os.platform&&os.platform();class ees{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:t,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([t,n])=>[t,(...t)=>{let r=n(...t)(a);return o.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(o),r}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:a}=i,u=[],s=!!t,c=t||o.tr,l=()=>(s||!n||c.getMeta("preventDispatch")||this.hasCustomState||a.dispatch(c),u.every(t=>!0===t)),f={...Object.fromEntries(Object.entries(r).map(([t,r])=>[t,(...t)=>{let i=this.buildProps(c,n),o=r(...t)(i);return u.push(o),f}])),run:l};return f}createCan(t){let{rawCommands:n,state:r}=this,i=t||r.tr,o=this.buildProps(i,!1);return{...Object.fromEntries(Object.entries(n).map(([t,n])=>[t,(...t)=>n(...t)({...o,dispatch:void 0})])),chain:()=>this.createChain(i,!1)}}buildProps(t,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:a}=i;o.storedMarks&&t.setStoredMarks(o.storedMarks);let u={tr:t,editor:i,view:a,state:eeu({state:o,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([t,n])=>[t,(...t)=>n(...t)(u)]))}};return u}}class eec{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){let r=this.callbacks[t];return r&&r.forEach(t=>t.apply(this,n)),this}off(t,n){let r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(t=>t!==n):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}function eel(t,n,r){return void 0===t.config[n]&&t.parent?eel(t.parent,n,r):"function"==typeof t.config[n]?t.config[n].bind({...r,parent:t.parent?eel(t.parent,n,r):null}):t.config[n]}function eef(t){let n=t.filter(t=>"extension"===t.type),r=t.filter(t=>"node"===t.type),i=t.filter(t=>"mark"===t.type);return{baseExtensions:n,nodeExtensions:r,markExtensions:i}}function eed(t){let n=[],{nodeExtensions:r,markExtensions:i}=eef(t),o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(t=>{let r={name:t.name,options:t.options,storage:t.storage},i=eel(t,"addGlobalAttributes",r);i&&i().forEach(t=>{t.types.forEach(r=>{Object.entries(t.attributes).forEach(([t,i])=>{n.push({type:r,name:t,attribute:{...o,...i}})})})})}),[...r,...i].forEach(t=>{let r={name:t.name,options:t.options,storage:t.storage},i=eel(t,"addAttributes",r);if(!i)return;let a=i();Object.entries(a).forEach(([r,i])=>{let a={...o,...i};"function"==typeof(null==a?void 0:a.default)&&(a.default=a.default()),null!=a&&a.isRequired&&(null==a?void 0:a.default)===void 0&&delete a.default,n.push({type:t.name,name:r,attribute:a})})}),n}function eep(t,n){if("string"==typeof t){if(!n.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return n.nodes[t]}return t}function eeh(...t){return t.filter(t=>!!t).reduce((t,n)=>{let r={...t};return Object.entries(n).forEach(([t,n])=>{if(!r[t]){r[t]=n;return}"class"===t?r[t]=[r[t],n].join(" "):"style"===t?r[t]=[r[t],n].join("; "):r[t]=n}),r},{})}function eem(t,n){return n.filter(t=>t.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((t,n)=>eeh(t,n),{})}function eeg(t){return"function"==typeof t}function eey(t,n,...r){return eeg(t)?n?t.bind(n)(...r):t(...r):t}function eev(t,n){return t.style?t:{...t,getAttrs(r){let i=t.getAttrs?t.getAttrs(r):t.attrs;if(!1===i)return!1;let o=n.reduce((t,n)=>{var i;let o=n.attribute.parseHTML?n.attribute.parseHTML(r):"string"!=typeof(i=r.getAttribute(n.name))?i:i.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(i):"true"===i||"false"!==i&&i;return null==o?t:{...t,[n.name]:o}},{});return{...i,...o}}}}function eeb(t){return Object.fromEntries(Object.entries(t).filter(([t,n])=>!("attrs"===t&&function(t={}){return 0===Object.keys(t).length&&t.constructor===Object}(n))&&null!=n))}function eex(t,n){var r;let i=eed(t),{nodeExtensions:o,markExtensions:a}=eef(t),u=null===(r=o.find(t=>eel(t,"topNode")))||void 0===r?void 0:r.name,s=Object.fromEntries(o.map(r=>{let o=i.filter(t=>t.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:n},u=t.reduce((t,n)=>{let i=eel(n,"extendNodeSchema",a);return{...t,...i?i(r):{}}},{}),s=eeb({...u,content:eey(eel(r,"content",a)),marks:eey(eel(r,"marks",a)),group:eey(eel(r,"group",a)),inline:eey(eel(r,"inline",a)),atom:eey(eel(r,"atom",a)),selectable:eey(eel(r,"selectable",a)),draggable:eey(eel(r,"draggable",a)),code:eey(eel(r,"code",a)),defining:eey(eel(r,"defining",a)),isolating:eey(eel(r,"isolating",a)),attrs:Object.fromEntries(o.map(t=>{var n;return[t.name,{default:null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.default}]}))}),c=eey(eel(r,"parseHTML",a));c&&(s.parseDOM=c.map(t=>eev(t,o)));let l=eel(r,"renderHTML",a);l&&(s.toDOM=t=>l({node:t,HTMLAttributes:eem(t,o)}));let f=eel(r,"renderText",a);return f&&(s.toText=f),[r.name,s]})),c=Object.fromEntries(a.map(r=>{let o=i.filter(t=>t.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:n},u=t.reduce((t,n)=>{let i=eel(n,"extendMarkSchema",a);return{...t,...i?i(r):{}}},{}),s=eeb({...u,inclusive:eey(eel(r,"inclusive",a)),excludes:eey(eel(r,"excludes",a)),group:eey(eel(r,"group",a)),spanning:eey(eel(r,"spanning",a)),code:eey(eel(r,"code",a)),attrs:Object.fromEntries(o.map(t=>{var n;return[t.name,{default:null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.default}]}))}),c=eey(eel(r,"parseHTML",a));c&&(s.parseDOM=c.map(t=>eev(t,o)));let l=eel(r,"renderHTML",a);return l&&(s.toDOM=t=>l({mark:t,HTMLAttributes:eem(t,o)})),[r.name,s]}));return new Z1({topNode:u,nodes:s,marks:c})}function eeM(t,n){return n.nodes[t]||n.marks[t]||null}function eeT(t,n){return Array.isArray(n)?n.some(n=>("string"==typeof n?n:n.name)===t.name):n}let eeS=(t,n=500)=>{let r="",i=t.parentOffset;return t.parent.nodesBetween(Math.max(0,i-n),i,(t,n,o,a)=>{var u,s;let c=(null===(s=(u=t.type.spec).toText)||void 0===s?void 0:s.call(u,{node:t,pos:n,parent:o,index:a}))||t.textContent||"%leaf%";r+=c.slice(0,Math.max(0,i-n))}),r};function eew(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class ee_{constructor(t){this.find=t.find,this.handler=t.handler}}let eeI=(t,n)=>{if(eew(n))return n.exec(t);let r=n(t);if(!r)return null;let i=[r.text];return i.index=r.index,i.input=t,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),i.push(r.replaceWith)),i};function eeO(t){var n;let{editor:r,from:i,to:o,text:a,rules:u,plugin:s}=t,{view:c}=r;if(c.composing)return!1;let l=c.state.doc.resolve(i);if(l.parent.type.spec.code||!(null===(n=l.nodeBefore||l.nodeAfter)||void 0===n)&&n.marks.find(t=>t.type.spec.code))return!1;let f=!1,d=eeS(l)+a;return u.forEach(t=>{if(f)return;let n=eeI(d,t.find);if(!n)return;let u=c.state.tr,l=eeu({state:c.state,transaction:u}),p={from:i-(n[0].length-a.length),to:o},{commands:h,chain:m,can:g}=new ees({editor:r,state:l});null!==t.handler({state:l,range:p,match:n,commands:h,chain:m,can:g})&&u.steps.length&&(u.setMeta(s,{transform:u,from:i,to:o,text:a}),c.dispatch(u),f=!0)}),f}class eek{constructor(t){this.find=t.find,this.handler=t.handler}}let eeC=(t,n)=>{if(eew(n))return[...t.matchAll(n)];let r=n(t);return r?r.map(n=>{let r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),r.push(n.replaceWith)),r}):[]};class eeN{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=eeN.resolve(t),this.schema=eex(this.extensions,n),this.extensions.forEach(t=>{var n;this.editor.extensionStorage[t.name]=t.storage;let r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:eeM(t.name,this.schema)};"mark"===t.type&&(!(null!==(n=eey(eel(t,"keepOnSplit",r)))&&void 0!==n)||n)&&this.splittableMarks.push(t.name);let i=eel(t,"onBeforeCreate",r);i&&this.editor.on("beforeCreate",i);let o=eel(t,"onCreate",r);o&&this.editor.on("create",o);let a=eel(t,"onUpdate",r);a&&this.editor.on("update",a);let u=eel(t,"onSelectionUpdate",r);u&&this.editor.on("selectionUpdate",u);let s=eel(t,"onTransaction",r);s&&this.editor.on("transaction",s);let c=eel(t,"onFocus",r);c&&this.editor.on("focus",c);let l=eel(t,"onBlur",r);l&&this.editor.on("blur",l);let f=eel(t,"onDestroy",r);f&&this.editor.on("destroy",f)})}static resolve(t){let n=eeN.sort(eeN.flatten(t)),r=function(t){let n=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(n)]}(n.map(t=>t.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(t=>`'${t}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(t=>{let n={name:t.name,options:t.options,storage:t.storage},r=eel(t,"addExtensions",n);return r?[t,...this.flatten(r())]:t}).flat(10)}static sort(t){return t.sort((t,n)=>{let r=eel(t,"priority")||100,i=eel(n,"priority")||100;return r>i?-1:r<i?1:0})}get commands(){return this.extensions.reduce((t,n)=>{let r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:eeM(n.name,this.schema)},i=eel(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){let{editor:t}=this,n=eeN.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(n=>{var o,a;let u={name:n.name,options:n.options,storage:n.storage,editor:t,type:eeM(n.name,this.schema)},s=[],c=eel(n,"addKeyboardShortcuts",u),l={};if("mark"===n.type&&n.config.exitable&&(l.ArrowRight=()=>ene.handleExit({editor:t,mark:n})),c){let f=Object.fromEntries(Object.entries(c()).map(([n,r])=>[n,()=>r({editor:t})]));l={...l,...f}}let d,p=(o=l,new Q7({props:{handleKeyDown:(a=o,d=function(t){let n=Object.create(null);for(let r in t)n[Xq(r)]=t[r];return n}(a),function(t,n){var r,i;let o=("Esc"==(i=!(XB&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||XV&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?XW:XU)[n.keyCode]||n.key||"Unidentified")&&(i="Escape"),"Del"==i&&(i="Delete"),"Left"==i&&(i="ArrowLeft"),"Up"==i&&(i="ArrowUp"),"Right"==i&&(i="ArrowRight"),"Down"==i&&(i="ArrowDown"),i),a,u=d[XG(o,n)];if(u&&u(t.state,t.dispatch,t))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let s=d[XG(o,n,!1)];if(s&&s(t.state,t.dispatch,t))return!0}if((n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(a=XU[n.keyCode])&&a!=o){let c=d[XG(a,n)];if(c&&c(t.state,t.dispatch,t))return!0}}return!1})}}));s.push(p);let h=eel(n,"addInputRules",u);eeT(n,t.options.enableInputRules)&&h&&r.push(...h());let m=eel(n,"addPasteRules",u);eeT(n,t.options.enablePasteRules)&&m&&i.push(...m());let g=eel(n,"addProseMirrorPlugins",u);if(g){let y=g();s.push(...y)}return s}).flat();return[function(t){let{editor:n,rules:r}=t,i=new Q7({state:{init:()=>null,apply(t,n){let r=t.getMeta(i);return r||(t.selectionSet||t.docChanged?null:n)}},props:{handleTextInput:(t,o,a,u)=>eeO({editor:n,from:o,to:a,text:u,rules:r,plugin:i}),handleDOMEvents:{compositionend:t=>(setTimeout(()=>{let{$cursor:o}=t.state.selection;o&&eeO({editor:n,from:o.pos,to:o.pos,text:"",rules:r,plugin:i})}),!1)},handleKeyDown(t,o){if("Enter"!==o.key)return!1;let{$cursor:a}=t.state.selection;return!!a&&eeO({editor:n,from:a.pos,to:a.pos,text:`
|
|
14
|
-
`,rules:r,plugin:i})}},isInputRules:!0});return i}({editor:t,rules:r}),...function(t){let{editor:n,rules:r}=t,i=null,o=!1,a=!1;return r.map(t=>new Q7({view(t){let n=n=>{var r;i=!(null===(r=t.dom.parentElement)||void 0===r)&&r.contains(n.target)?t.dom.parentElement:null};return window.addEventListener("dragstart",n),{destroy(){window.removeEventListener("dragstart",n)}}},props:{handleDOMEvents:{drop:t=>(a=i===t.dom.parentElement,!1),paste(t,n){var r;let i=null===(r=n.clipboardData)||void 0===r?void 0:r.getData("text/html");return o=!!(null!=i&&i.includes("data-pm-slice")),!1}}},appendTransaction(r,i,u){var s;let c=r[0],l="paste"===c.getMeta("uiEvent")&&!o,f="drop"===c.getMeta("uiEvent")&&!a;if(!l&&!f)return;let d=i.doc.content.findDiffStart(u.doc.content),p=i.doc.content.findDiffEnd(u.doc.content);if("number"!=typeof d||!p||d===p.b)return;let h=u.tr,m=eeu({state:u,transaction:h});if(!(!function(t){let{editor:n,state:r,from:i,to:o,rule:a}=t,{commands:u,chain:s,can:c}=new ees({editor:n,state:r}),l=[];return r.doc.nodesBetween(i,o,(t,n)=>{if(!t.isTextblock||t.type.spec.code)return;let f=Math.max(i,n),d=Math.min(o,n+t.content.size),p=t.textBetween(f-n,d-n,void 0,"");eeC(p,a.find).forEach(t=>{if(void 0===t.index)return;let n=f+t.index+1,i=n+t[0].length,o={from:r.tr.mapping.map(n),to:r.tr.mapping.map(i)},d=a.handler({state:r,range:o,match:t,commands:u,chain:s,can:c});l.push(d)})}),l.every(t=>null!==t)}({editor:n,state:m,from:Math.max(d-1,0),to:p.b-1,rule:t})||!h.steps.length))return h}}))}({editor:t,rules:i}),...o]}get attributes(){return eed(this.extensions)}get nodeViews(){let{editor:t}=this,{nodeExtensions:n}=eef(this.extensions);return Object.fromEntries(n.filter(t=>!!eel(t,"addNodeView")).map(n=>{let r=this.attributes.filter(t=>t.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:t,type:eep(n.name,this.schema)},o=eel(n,"addNodeView",i);if(!o)return[];let a=(i,a,u,s)=>{let c=eem(i,r);return o()({editor:t,node:i,getPos:u,decorations:s,HTMLAttributes:c,extension:n})};return[n.name,a]}))}}function eej(t){var n;return"Object"===Object.prototype.toString.call(t).slice(8,-1)&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function eeE(t,n){let r={...t};return eej(t)&&eej(n)&&Object.keys(n).forEach(i=>{eej(n[i])&&i in t?r[i]=eeE(t[i],n[i]):Object.assign(r,{[i]:n[i]})}),r}class eeR{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=eey(eel(this,"addOptions",{name:this.name}))),this.storage=eey(eel(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new eeR(t)}configure(t={}){let n=this.extend();return n.options=eeE(this.options,t),n.storage=eey(eel(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){let n=new eeR(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=eey(eel(n,"addOptions",{name:n.name})),n.storage=eey(eel(n,"addStorage",{name:n.name,options:n.options})),n}}function eeD(t,n,r){let{from:i,to:o}=n,{blockSeparator:a=`
|
|
15
|
-
|
|
16
|
-
`,textSerializers:u={}}=r||{},s="",c=!0;return t.nodesBetween(i,o,(t,r,l,f)=>{var d;let p=null==u?void 0:u[t.type.name];p?(t.isBlock&&!c&&(s+=a,c=!0),l&&(s+=p({node:t,pos:r,parent:l,index:f,range:n}))):t.isText?(s+=null===(d=null==t?void 0:t.text)||void 0===d?void 0:d.slice(Math.max(i,r)-r,o-r),c=!1):t.isBlock&&!c&&(s+=a,c=!0)}),s}function eeA(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}let eeL=eeR.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Q7({key:new Hn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:t}=this,{state:n,schema:r}=t,{doc:i,selection:o}=n,{ranges:a}=o,u=Math.min(...a.map(t=>t.$from.pos)),s=Math.max(...a.map(t=>t.$to.pos)),c=eeA(r);return eeD(i,{from:u,to:s},{textSerializers:c})}}})]}}),eeP=()=>({editor:t,view:n})=>(requestAnimationFrame(()=>{var r;t.isDestroyed||(n.dom.blur(),null===(r=null==window?void 0:window.getSelection())||void 0===r||r.removeAllRanges())}),!0),eeF=(t=!1)=>({commands:n})=>n.setContent("",t),eez=()=>({state:t,tr:n,dispatch:r})=>{let{selection:i}=n,{ranges:o}=i;return r&&o.forEach(({$from:r,$to:i})=>{t.doc.nodesBetween(r.pos,i.pos,(t,r)=>{if(t.type.isText)return;let{doc:i,mapping:o}=n,a=i.resolve(o.map(r)),u=i.resolve(o.map(r+t.nodeSize)),s=a.blockRange(u);if(!s)return;let c=QS(s);if(t.type.isTextblock){let{defaultType:l}=a.parent.contentMatchAt(a.index());n.setNodeMarkup(s.start,l)}(c||0===c)&&n.lift(s,c)})}),!0},eeU=t=>n=>t(n),eeW=()=>({state:t,dispatch:n})=>X7(t,n),eeB=()=>({tr:t,dispatch:n})=>{let{selection:r}=t,i=r.$anchor.node();if(i.content.size>0)return!1;let o=t.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i.type){if(n){let u=o.before(a),s=o.after(a);t.delete(u,s).scrollIntoView()}return!0}return!1},eeV=t=>({tr:n,state:r,dispatch:i})=>{let o=eep(t,r.schema),a=n.selection.$anchor;for(let u=a.depth;u>0;u-=1)if(a.node(u).type===o){if(i){let s=a.before(u),c=a.after(u);n.delete(s,c).scrollIntoView()}return!0}return!1},ee$=t=>({tr:n,dispatch:r})=>{let{from:i,to:o}=t;return r&&n.delete(i,o),!0},eeK=()=>({state:t,dispatch:n})=>XZ(t,n),eeY=()=>({commands:t})=>t.keyboardShortcut("Enter"),eeq=()=>({state:t,dispatch:n})=>X6(t,n);function eeG(t,n,r={strict:!0}){let i=Object.keys(n);return!i.length||i.every(i=>r.strict?n[i]===t[i]:eew(n[i])?n[i].test(t[i]):n[i]===t[i])}function eeZ(t,n,r={}){return t.find(t=>t.type===n&&eeG(t.attrs,r))}function eeQ(t,n,r={}){return!!eeZ(t,n,r)}function eeH(t,n,r={}){if(!t||!n)return;let i=t.parent.childAfter(t.parentOffset);if(t.parentOffset===i.offset&&0!==i.offset&&(i=t.parent.childBefore(t.parentOffset)),!i.node)return;let o=eeZ([...i.node.marks],n,r);if(!o)return;let a=i.index,u=t.start()+i.offset,s=a+1,c=u+i.node.nodeSize;for(eeZ([...i.node.marks],n,r);a>0&&o.isInSet(t.parent.child(a-1).marks);)a-=1,u-=t.parent.child(a).nodeSize;for(;s<t.parent.childCount&&eeQ([...t.parent.child(s).marks],n,r);)c+=t.parent.child(s).nodeSize,s+=1;return{from:u,to:c}}function eeJ(t,n){if("string"==typeof t){if(!n.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return n.marks[t]}return t}let eeX=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let a=eeJ(t,i.schema),{doc:u,selection:s}=r,{$from:c,from:l,to:f}=s;if(o){let d=eeH(c,a,n);if(d&&d.from<=l&&d.to>=f){let p=QZ.create(u,d.from,d.to);r.setSelection(p)}}return!0},ee0=t=>n=>{let r="function"==typeof t?t(n):t;for(let i=0;i<r.length;i+=1)if(r[i](n))return!0;return!1};function ee1(t){return t instanceof QZ}function ee2(t=0,n=0,r=0){return Math.min(Math.max(t,n),r)}function ee4(t,n=null){if(!n)return null;let r=QK.atStart(t),i=QK.atEnd(t);if("start"===n||!0===n)return r;if("end"===n)return i;let o=r.from,a=i.to;return"all"===n?QZ.create(t,ee2(0,o,a),ee2(t.content.size,o,a)):QZ.create(t,ee2(n,o,a),ee2(n,o,a))}function ee3(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}let ee5=(t=null,n={})=>({editor:r,view:i,tr:o,dispatch:a})=>{n={scrollIntoView:!0,...n};let u=()=>{ee3()&&i.dom.focus(),requestAnimationFrame(()=>{r.isDestroyed||(i.focus(),null!=n&&n.scrollIntoView&&r.commands.scrollIntoView())})};if(i.hasFocus()&&null===t||!1===t)return!0;if(a&&null===t&&!ee1(r.state.selection))return u(),!0;let s=ee4(o.doc,t)||r.state.selection,c=r.state.selection.eq(s);return a&&(c||o.setSelection(s),c&&o.storedMarks&&o.setStoredMarks(o.storedMarks),u()),!0},ee9=(t,n)=>r=>t.every((t,i)=>n(t,{...r,index:i})),ee8=(t,n)=>({tr:r,commands:i})=>i.insertContentAt({from:r.selection.from,to:r.selection.to},t,n);function ee6(t){let n=`<body>${t}</body>`;return new window.DOMParser().parseFromString(n,"text/html").body}function ee7(t,n,r){if(r={slice:!0,parseOptions:{},...r},"object"==typeof t&&null!==t)try{return Array.isArray(t)&&t.length>0?Zy.fromArray(t.map(t=>n.nodeFromJSON(t))):n.nodeFromJSON(t)}catch(i){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),ee7("",n,r)}if("string"==typeof t){let o=Z4.fromSchema(n);return r.slice?o.parseSlice(ee6(t),r.parseOptions).content:o.parse(ee6(t),r.parseOptions)}return ee7("",n,r)}let ete=t=>t.toString().startsWith("<"),ett=(t,n,r)=>({tr:i,dispatch:o,editor:a})=>{if(o){r={parseOptions:{},updateSelection:!0,...r};let u=ee7(n,a.schema,{parseOptions:{preserveWhitespace:"full",...r.parseOptions}});if("<>"===u.toString())return!0;let{from:s,to:c}="number"==typeof t?{from:t,to:t}:t,l=!0,f=!0;if((ete(u)?u:[u]).forEach(t=>{t.check(),l=!!l&&t.isText&&0===t.marks.length,f=!!f&&t.isBlock}),s===c&&f){let{parent:d}=i.doc.resolve(s);!d.isTextblock||d.type.spec.code||d.childCount||(s-=1,c+=1)}l?Array.isArray(n)?i.insertText(n.map(t=>t.text||"").join(""),s,c):"object"==typeof n&&n&&n.text?i.insertText(n.text,s,c):i.insertText(n,s,c):i.replaceWith(s,c,u),r.updateSelection&&function(t,n,r){let i=t.steps.length-1;if(i<n)return;let o=t.steps[i];if(!(o instanceof Qb||o instanceof Qx))return;let a=t.mapping.maps[i],u=0;a.forEach((t,n,r,i)=>{0===u&&(u=i)}),t.setSelection(QK.near(t.doc.resolve(u),-1))}(i,i.steps.length-1,-1)}return!0},etn=()=>({state:t,dispatch:n})=>X4(t,n),etr=()=>({state:t,dispatch:n})=>X3(t,n),eti=()=>({state:t,dispatch:n})=>XQ(t,n),eto=()=>({state:t,dispatch:n})=>X0(t,n);function eta(){return"u">typeof navigator&&/Mac/.test(navigator.platform)}let etu=t=>({editor:n,view:r,tr:i,dispatch:o})=>{let a=(function(t){let n=t.split(/-(?!$)/),r=n[n.length-1];"Space"===r&&(r=" ");let i,o,a,u;for(let s=0;s<n.length-1;s+=1){let c=n[s];if(/^(cmd|meta|m)$/i.test(c))u=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))a=!0;else if(/^mod$/i.test(c))ee3()||eta()?u=!0:o=!0;else throw Error(`Unrecognized modifier name: ${c}`)}return i&&(r=`Alt-${r}`),o&&(r=`Ctrl-${r}`),u&&(r=`Meta-${r}`),a&&(r=`Shift-${r}`),r})(t).split(/-(?!$)/),u=a.find(t=>!["Alt","Ctrl","Meta","Shift"].includes(t)),s=new KeyboardEvent("keydown",{key:"Space"===u?" ":u,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),c=n.captureTransaction(()=>{r.someProp("handleKeyDown",t=>t(r,s))});return null==c||c.steps.forEach(t=>{let n=t.map(i.mapping);n&&o&&i.maybeStep(n)}),!0};function ets(t,n,r={}){let{from:i,to:o,empty:a}=t.selection,u=n?eep(n,t.schema):null,s=[];t.doc.nodesBetween(i,o,(t,n)=>{if(t.isText)return;let r=Math.min(o,n+t.nodeSize);s.push({node:t,from:Math.max(i,n),to:r})});let c=s.filter(t=>!u||u.name===t.node.type.name).filter(t=>eeG(t.node.attrs,r,{strict:!1}));return a?!!c.length:c.reduce((t,n)=>t+n.to-n.from,0)>=o-i}let etc=(t,n={})=>({state:r,dispatch:i})=>{let o=eep(t,r.schema);return!!ets(r,o,n)&&X5(r,i)},etl=()=>({state:t,dispatch:n})=>eee(t,n),etf=t=>({state:n,dispatch:r})=>{var i;let o=eep(t,n.schema);return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==o);return!!a&&(!n||(r.node(a.depth-1).type==o?function(t,n,r,i){let o=t.tr,a=i.end,u=i.$to.end(i.depth);a<u&&(o.step(new Qx(a-1,u,a,u,new ZS(Zy.from(r.create(null,i.parent.copy())),1,0),1,!0)),i=new ZD(o.doc.resolve(i.$from.pos),o.doc.resolve(u),i.depth));let s=QS(i);if(null==s)return!1;o.lift(i,s);let c=o.mapping.map(a,-1)-1;return QO(o.doc,c)&&o.join(c),n(o.scrollIntoView()),!0}(t,n,o,a):function(t,n,r){let i=t.tr,o=r.parent;for(let a=r.end,u=r.endIndex-1,s=r.startIndex;u>s;u--)a-=o.child(u).nodeSize,i.delete(a-1,a+1);let c=i.doc.resolve(r.start),l=c.nodeAfter;if(i.mapping.map(r.end)!=r.start+c.nodeAfter.nodeSize)return!1;let f=0==r.startIndex,d=r.endIndex==o.childCount,p=c.node(-1),h=c.index(-1);if(!p.canReplace(h+(f?0:1),h+1,l.content.append(d?Zy.empty:Zy.from(o))))return!1;let m=c.pos,g=m+l.nodeSize;return i.step(new Qx(m-(f?1:0),g+(d?1:0),m+1,g-1,new ZS((f?Zy.empty:Zy.from(o.copy(Zy.empty))).append(d?Zy.empty:Zy.from(o.copy(Zy.empty))),f?0:1,d?0:1),f?0:1)),n(i.scrollIntoView()),!0}(t,n,a)))}(n,r)},etd=()=>({state:t,dispatch:n})=>X9(t,n);function etp(t,n){return n.nodes[t]?"node":n.marks[t]?"mark":null}function eth(t,n){let r="string"==typeof n?[n]:n;return Object.keys(t).reduce((n,i)=>(r.includes(i)||(n[i]=t[i]),n),{})}let etm=(t,n)=>({tr:r,state:i,dispatch:o})=>{let a=null,u=null,s=etp("string"==typeof t?t:t.name,i.schema);return!!s&&("node"===s&&(a=eep(t,i.schema)),"mark"===s&&(u=eeJ(t,i.schema)),o&&r.selection.ranges.forEach(t=>{i.doc.nodesBetween(t.$from.pos,t.$to.pos,(t,i)=>{a&&a===t.type&&r.setNodeMarkup(i,void 0,eth(t.attrs,n)),u&&t.marks.length&&t.marks.forEach(o=>{u===o.type&&r.addMark(i,i+t.nodeSize,u.create(eth(o.attrs,n)))})})}),!0)},etg=()=>({tr:t,dispatch:n})=>(n&&t.scrollIntoView(),!0),ety=()=>({tr:t,commands:n})=>n.setTextSelection({from:0,to:t.doc.content.size}),etv=()=>({state:t,dispatch:n})=>XJ(t,n),etb=()=>({state:t,dispatch:n})=>X1(t,n),etx=()=>({state:t,dispatch:n})=>eet(t,n),etM=()=>({state:t,dispatch:n})=>eeo(t,n),etT=()=>({state:t,dispatch:n})=>eei(t,n);function etS(t,n,r={}){return ee7(t,n,{slice:!1,parseOptions:r})}let etw=(t,n=!1,r={})=>({tr:i,editor:o,dispatch:a})=>{let{doc:u}=i,s=etS(t,o.schema,r);return a&&i.replaceWith(0,u.content.size,s).setMeta("preventUpdate",!n),!0};function et_(t){return n=>(function(t,n){for(let r=t.depth;r>0;r-=1){let i=t.node(r);if(n(i))return{pos:r>0?t.before(r):0,start:t.start(r),depth:r,node:i}}})(n.$from,t)}function etI(t,n){let r=eeJ(n,t.schema),{from:i,to:o,empty:a}=t.selection,u=[];a?(t.storedMarks&&u.push(...t.storedMarks),u.push(...t.selection.$head.marks())):t.doc.nodesBetween(i,o,t=>{u.push(...t.marks)});let s=u.find(t=>t.type.name===r.name);return s?{...s.attrs}:{}}function etO(t,n,r){let i=[];return t===n?r.resolve(t).marks().forEach(n=>{let o=r.resolve(t-1),a=eeH(o,n.type);a&&i.push({mark:n,...a})}):r.nodesBetween(t,n,(t,n)=>{i.push(...t.marks.map(r=>({from:n,to:n+t.nodeSize,mark:r})))}),i}function etk(t,n,r){return Object.fromEntries(Object.entries(r).filter(([r])=>{let i=t.find(t=>t.type===n&&t.name===r);return!!i&&i.attribute.keepOnSplit}))}function etC(t,n,r={}){let{empty:i,ranges:o}=t.selection,a=n?eeJ(n,t.schema):null;if(i)return!!(t.storedMarks||t.selection.$from.marks()).filter(t=>!a||a.name===t.type.name).find(t=>eeG(t.attrs,r,{strict:!1}));let u=0,s=[];if(o.forEach(({$from:n,$to:r})=>{let i=n.pos,o=r.pos;t.doc.nodesBetween(i,o,(t,n)=>{if(!t.isText&&!t.marks.length)return;let r=Math.max(i,n),a=Math.min(o,n+t.nodeSize);u+=a-r,s.push(...t.marks.map(t=>({mark:t,from:r,to:a})))})}),0===u)return!1;let c=s.filter(t=>!a||a.name===t.mark.type.name).filter(t=>eeG(t.mark.attrs,r,{strict:!1})).reduce((t,n)=>t+n.to-n.from,0),l=s.filter(t=>!a||t.mark.type!==a&&t.mark.type.excludes(a)).reduce((t,n)=>t+n.to-n.from,0);return(c>0?c+l:c)>=u}function etN(t,n){let{nodeExtensions:r}=eef(n),i=r.find(n=>n.name===t);if(!i)return!1;let o={name:i.name,options:i.options,storage:i.storage},a=eey(eel(i,"group",o));return"string"==typeof a&&a.split(" ").includes("list")}let etj=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let{selection:a}=r,{empty:u,ranges:s}=a,c=eeJ(t,i.schema);if(o){if(u){let l=etI(i,c);r.addStoredMark(c.create({...l,...n}))}else s.forEach(t=>{let o=t.$from.pos,a=t.$to.pos;i.doc.nodesBetween(o,a,(t,i)=>{let u=Math.max(i,o),s=Math.min(i+t.nodeSize,a);t.marks.find(t=>t.type===c)?t.marks.forEach(t=>{c===t.type&&r.addMark(u,s,c.create({...t.attrs,...n}))}):r.addMark(u,s,c.create(n))})})}return function(t,n,r){var i;let{selection:o}=n,a=null;if(ee1(o)&&(a=o.$cursor),a){let u=null!==(i=t.storedMarks)&&void 0!==i?i:a.marks();return!!r.isInSet(u)||!u.some(t=>t.type.excludes(r))}let{ranges:s}=o;return s.some(({$from:n,$to:i})=>{let o=0===n.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(r);return t.doc.nodesBetween(n.pos,i.pos,(t,n,i)=>{if(o)return!1;if(t.isInline){let a=!i||i.type.allowsMarkType(r),u=!!r.isInSet(t.marks)||!t.marks.some(t=>t.type.excludes(r));o=a&&u}return!o}),o})}(i,r,c)},etE=(t,n)=>({tr:r})=>(r.setMeta(t,n),!0),etR=(t,n={})=>({state:r,dispatch:i,chain:o})=>{let a=eep(t,r.schema);return a.isTextblock?o().command(({commands:t})=>!!eea(a,n)(r)||t.clearNodes()).command(({state:t})=>eea(a,n)(t,i)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},etD=t=>({tr:n,dispatch:r})=>{if(r){let{doc:i}=n,o=ee2(t,0,i.content.size),a=QH.create(i,o);n.setSelection(a)}return!0},etA=t=>({tr:n,dispatch:r})=>{if(r){let{doc:i}=n,{from:o,to:a}="number"==typeof t?{from:t,to:t}:t,u=QZ.atStart(i).from,s=QZ.atEnd(i).to,c=ee2(o,u,s),l=ee2(a,u,s),f=QZ.create(i,c,l);n.setSelection(f)}return!0},etL=t=>({state:n,dispatch:r})=>{var i;let o=eep(t,n.schema);return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==o);if(!a)return!1;let u=a.startIndex;if(0==u)return!1;let s=a.parent,c=s.child(u-1);if(c.type!=o)return!1;if(n){let l=c.lastChild&&c.lastChild.type==s.type,f=Zy.from(l?o.create():null),d=new ZS(Zy.from(o.create(null,Zy.from(s.type.create(null,f)))),l?3:1,0),p=a.start,h=a.end;n(t.tr.step(new Qx(p-(l?3:1),h,p,h,d,1,!0)).scrollIntoView())}return!0}(n,r)};function etP(t,n){let r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(r){let i=r.filter(t=>null==n?void 0:n.includes(t.type.name));t.tr.ensureMarks(i)}}let etF=({keepMarks:t=!0}={})=>({tr:n,state:r,dispatch:i,editor:o})=>{let{selection:a,doc:u}=n,{$from:s,$to:c}=a,l=o.extensionManager.attributes,f=etk(l,s.node().type.name,s.node().attrs);if(a instanceof QH&&a.node.isBlock)return!!(s.parentOffset&&QI(u,s.pos))&&(i&&(t&&etP(r,o.extensionManager.splittableMarks),n.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;if(i){let d=c.parentOffset===c.parent.content.size;a instanceof QZ&&n.deleteSelection();let p=0===s.depth?void 0:function(t){for(let n=0;n<t.edgeCount;n+=1){let{type:r}=t.edge(n);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}(s.node(-1).contentMatchAt(s.indexAfter(-1))),h=d&&p?[{type:p,attrs:f}]:void 0,m=QI(n.doc,n.mapping.map(s.pos),1,h);if(!h&&!m&&QI(n.doc,n.mapping.map(s.pos),1,p?[{type:p}]:void 0)&&(m=!0,h=p?[{type:p,attrs:f}]:void 0),m&&(n.split(n.mapping.map(s.pos),1,h),p&&!d&&!s.parentOffset&&s.parent.type!==p)){let g=n.mapping.map(s.before()),y=n.doc.resolve(g);s.node(-1).canReplaceWith(y.index(),y.index()+1,p)&&n.setNodeMarkup(n.mapping.map(s.before()),p)}t&&etP(r,o.extensionManager.splittableMarks),n.scrollIntoView()}return!0},etz=t=>({tr:n,state:r,dispatch:i,editor:o})=>{var a;let u=eep(t,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let f=s.node(-1);if(f.type!==u)return!1;let d=o.extensionManager.attributes;if(0===s.parent.content.size&&s.node(-1).childCount===s.indexAfter(-1)){if(2===s.depth||s.node(-3).type!==u||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let p=Zy.empty,h=s.index(-1)?1:s.index(-2)?2:3;for(let m=s.depth-h;m>=s.depth-3;m-=1)p=Zy.from(s.node(m).copy(p));let g=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,y=etk(d,s.node().type.name,s.node().attrs),v=(null===(a=u.contentMatch.defaultType)||void 0===a?void 0:a.createAndFill(y))||void 0;p=p.append(Zy.from(u.createAndFill(null,v)||void 0));let b=s.before(s.depth-(h-1));n.replace(b,s.after(-g),new ZS(p,4-h,0));let x=-1;n.doc.nodesBetween(b,n.doc.content.size,(t,n)=>{if(x>-1)return!1;t.isTextblock&&0===t.content.size&&(x=n+1)}),x>-1&&n.setSelection(QZ.near(n.doc.resolve(x))),n.scrollIntoView()}return!0}let M=c.pos===s.end()?f.contentMatchAt(0).defaultType:null,T=etk(d,f.type.name,f.attrs),S=etk(d,s.node().type.name,s.node().attrs);if(n.delete(s.pos,c.pos),!QI(n.doc,s.pos,2))return!1;if(i){let{selection:w,storedMarks:_}=r,{splittableMarks:I}=o.extensionManager,O=_||w.$to.parentOffset&&w.$from.marks();if(n.split(s.pos,2,M?[{type:u,attrs:T},{type:M,attrs:S}]:[{type:u,attrs:T}]).scrollIntoView(),!O||!i)return!0;let k=O.filter(t=>I.includes(t.type.name));n.ensureMarks(k)}return!0},etU=(t,n)=>{let r=et_(t=>t.type===n)(t.selection);if(!r)return!0;let i=t.doc.resolve(Math.max(0,r.pos-1)).before(r.depth);if(void 0===i)return!0;let o=t.doc.nodeAt(i);return r.node.type===(null==o?void 0:o.type)&&QO(t.doc,r.pos)&&t.join(r.pos),!0},etW=(t,n)=>{let r=et_(t=>t.type===n)(t.selection);if(!r)return!0;let i=t.doc.resolve(r.start).after(r.depth);if(void 0===i)return!0;let o=t.doc.nodeAt(i);return r.node.type===(null==o?void 0:o.type)&&QO(t.doc,i)&&t.join(i),!0},etB=(t,n,r,i={})=>({editor:o,tr:a,state:u,dispatch:s,chain:c,commands:l,can:f})=>{let{extensions:d,splittableMarks:p}=o.extensionManager,h=eep(t,u.schema),m=eep(n,u.schema),{selection:g,storedMarks:y}=u,{$from:v,$to:b}=g,x=v.blockRange(b),M=y||g.$to.parentOffset&&g.$from.marks();if(!x)return!1;let T=et_(t=>etN(t.type.name,d))(g);if(x.depth>=1&&T&&x.depth-T.depth<=1){if(T.node.type===h)return l.liftListItem(m);if(etN(T.node.type.name,d)&&h.validContent(T.node.content)&&s)return c().command(()=>(a.setNodeMarkup(T.pos,h),!0)).command(()=>etU(a,h)).command(()=>etW(a,h)).run()}return r&&M&&s?c().command(()=>{let t=f().wrapInList(h,i),n=M.filter(t=>p.includes(t.type.name));return a.ensureMarks(n),!!t||l.clearNodes()}).wrapInList(h,i).command(()=>etU(a,h)).command(()=>etW(a,h)).run():c().command(()=>!!f().wrapInList(h,i)||l.clearNodes()).wrapInList(h,i).command(()=>etU(a,h)).command(()=>etW(a,h)).run()},etV=(t,n={},r={})=>({state:i,commands:o})=>{let{extendEmptyMarkRange:a=!1}=r,u=eeJ(t,i.schema);return etC(i,u,n)?o.unsetMark(u,{extendEmptyMarkRange:a}):o.setMark(u,n)},et$=(t,n,r={})=>({state:i,commands:o})=>{let a=eep(t,i.schema),u=eep(n,i.schema);return ets(i,a,r)?o.setNode(u):o.setNode(a,r)},etK=(t,n={})=>({state:r,commands:i})=>{let o=eep(t,r.schema);return ets(r,o,n)?i.lift(o):i.wrapIn(o,n)},etY=()=>({state:t,dispatch:n})=>{let r=t.plugins;for(let i=0;i<r.length;i+=1){let o=r[i],a;if(o.spec.isInputRules&&(a=o.getState(t))){if(n){let u=t.tr,s=a.transform;for(let c=s.steps.length-1;c>=0;c-=1)u.step(s.steps[c].invert(s.docs[c]));if(a.text){let l=u.doc.resolve(a.from).marks();u.replaceWith(a.from,a.to,t.schema.text(a.text,l))}else u.delete(a.from,a.to)}return!0}}return!1},etq=()=>({tr:t,dispatch:n})=>{let{selection:r}=t,{empty:i,ranges:o}=r;return i||n&&o.forEach(n=>{t.removeMark(n.$from.pos,n.$to.pos)}),!0},etG=(t,n={})=>({tr:r,state:i,dispatch:o})=>{var a;let{extendEmptyMarkRange:u=!1}=n,{selection:s}=r,c=eeJ(t,i.schema),{$from:l,empty:f,ranges:d}=s;if(!o)return!0;if(f&&u){let{from:p,to:h}=s,m=null===(a=l.marks().find(t=>t.type===c))||void 0===a?void 0:a.attrs,g=eeH(l,c,m);g&&(p=g.from,h=g.to),r.removeMark(p,h,c)}else d.forEach(t=>{r.removeMark(t.$from.pos,t.$to.pos,c)});return r.removeStoredMark(c),!0},etZ=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let a=null,u=null,s=etp("string"==typeof t?t:t.name,i.schema);return!!s&&("node"===s&&(a=eep(t,i.schema)),"mark"===s&&(u=eeJ(t,i.schema)),o&&r.selection.ranges.forEach(t=>{let o=t.$from.pos,s=t.$to.pos;i.doc.nodesBetween(o,s,(t,i)=>{a&&a===t.type&&r.setNodeMarkup(i,void 0,{...t.attrs,...n}),u&&t.marks.length&&t.marks.forEach(a=>{if(u===a.type){let c=Math.min(i+t.nodeSize,s);r.addMark(Math.max(i,o),c,u.create({...a.attrs,...n}))}})})}),!0)},etQ=(t,n={})=>({state:r,dispatch:i})=>{let o=eep(t,r.schema);return(function(t,n=null){return function(r,i){let{$from:o,$to:a}=r.selection,u=o.blockRange(a),s=u&&Qw(u,t,n);return!!s&&(i&&i(r.tr.wrap(u,s).scrollIntoView()),!0)}})(o,n)(r,i)},etH=(t,n={})=>({state:r,dispatch:i})=>{let o=eep(t,r.schema);return(function(t,n=null){return function(r,i){let{$from:o,$to:a}=r.selection,u=o.blockRange(a),s=!1,c=u;if(!u)return!1;if(u.depth>=2&&o.node(u.depth-1).type.compatibleContent(t)&&0==u.startIndex){if(0==o.index(u.depth-1))return!1;let l=r.doc.resolve(u.start-2);c=new ZD(l,l,u.depth),u.endIndex<u.parent.childCount&&(u=new ZD(o,r.doc.resolve(a.end(u.depth)),u.depth)),s=!0}let f=Qw(c,t,n,u);return!!f&&(i&&i((function(t,n,r,i,o){let a=Zy.empty;for(let u=r.length-1;u>=0;u--)a=Zy.from(r[u].type.create(r[u].attrs,a));t.step(new Qx(n.start-(i?2:0),n.end,n.start,n.end,new ZS(a,0,0),r.length,!0));let s=0;for(let c=0;c<r.length;c++)r[c].type==o&&(s=c+1);let l=r.length-s,f=n.start+r.length-(i?2:0),d=n.parent;for(let p=n.startIndex,h=n.endIndex,m=!0;p<h;p++,m=!1)!m&&QI(t.doc,f,l)&&(t.split(f,l),f+=2*l),f+=d.child(p).nodeSize;return t})(r.tr,u,f,s,t).scrollIntoView()),!0)}})(o,n)(r,i)};var etJ=Object.freeze({__proto__:null,blur:eeP,clearContent:eeF,clearNodes:eez,command:eeU,createParagraphNear:eeW,deleteCurrentNode:eeB,deleteNode:eeV,deleteRange:ee$,deleteSelection:eeK,enter:eeY,exitCode:eeq,extendMarkRange:eeX,first:ee0,focus:ee5,forEach:ee9,insertContent:ee8,insertContentAt:ett,joinUp:etn,joinDown:etr,joinBackward:eti,joinForward:eto,keyboardShortcut:etu,lift:etc,liftEmptyBlock:etl,liftListItem:etf,newlineInCode:etd,resetAttributes:etm,scrollIntoView:etg,selectAll:ety,selectNodeBackward:etv,selectNodeForward:etb,selectParentNode:etx,selectTextblockEnd:etM,selectTextblockStart:etT,setContent:etw,setMark:etj,setMeta:etE,setNode:etR,setNodeSelection:etD,setTextSelection:etA,sinkListItem:etL,splitBlock:etF,splitListItem:etz,toggleList:etB,toggleMark:etV,toggleNode:et$,toggleWrap:etK,undoInputRule:etY,unsetAllMarks:etq,unsetMark:etG,updateAttributes:etZ,wrapIn:etQ,wrapInList:etH});let etX=eeR.create({name:"commands",addCommands:()=>({...etJ})}),et0=eeR.create({name:"editable",addProseMirrorPlugins(){return[new Q7({key:new Hn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),et1=eeR.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new Q7({key:new Hn("focusEvents"),props:{handleDOMEvents:{focus(n,r){t.isFocused=!0;let i=t.state.tr.setMeta("focus",{event:r}).setMeta("addToHistory",!1);return n.dispatch(i),!1},blur(n,r){t.isFocused=!1;let i=t.state.tr.setMeta("blur",{event:r}).setMeta("addToHistory",!1);return n.dispatch(i),!1}}}})]}}),et2=eeR.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:t})=>[()=>t.undoInputRule(),()=>t.command(({tr:n})=>{let{selection:r,doc:i}=n,{empty:o,$anchor:a}=r,{pos:u,parent:s}=a,c=QK.atStart(i).from===u;return!!o&&!!c&&!!s.type.isTextblock&&!s.textContent.length&&t.clearNodes()}),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()]),n=()=>this.editor.commands.first(({commands:t})=>[()=>t.deleteSelection(),()=>t.deleteCurrentNode(),()=>t.joinForward(),()=>t.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:n,"Mod-Delete":n,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":n,"Ctrl-Alt-Backspace":n,"Alt-Delete":n,"Alt-d":n,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return ee3()||eta()?o:i},addProseMirrorPlugins(){return[new Q7({key:new Hn("clearDocument"),appendTransaction:(t,n,r)=>{if(!(t.some(t=>t.docChanged)&&!n.doc.eq(r.doc)))return;let{empty:i,from:o,to:a}=n.selection,u=QK.atStart(n.doc).from,s=QK.atEnd(n.doc).to;if(i||!(o===u&&a===s)||0!==r.doc.textBetween(0,r.doc.content.size," "," ").length)return;let c=r.tr,l=eeu({state:r,transaction:c}),{commands:f}=new ees({editor:this.editor,state:l});if(f.clearNodes(),c.steps.length)return c}})]}}),et4=eeR.create({name:"tabindex",addProseMirrorPlugins(){return[new Q7({key:new Hn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var et3=Object.freeze({__proto__:null,ClipboardTextSerializer:eeL,Commands:etX,Editable:et0,FocusEvents:et1,Keymap:et2,Tabindex:et4});let et5=`.ProseMirror {
|
|
17
|
-
position: relative;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.ProseMirror {
|
|
21
|
-
word-wrap: break-word;
|
|
22
|
-
white-space: pre-wrap;
|
|
23
|
-
white-space: break-spaces;
|
|
24
|
-
-webkit-font-variant-ligatures: none;
|
|
25
|
-
font-variant-ligatures: none;
|
|
26
|
-
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.ProseMirror [contenteditable="false"] {
|
|
30
|
-
white-space: normal;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
34
|
-
white-space: pre-wrap;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.ProseMirror pre {
|
|
38
|
-
white-space: pre-wrap;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
img.ProseMirror-separator {
|
|
42
|
-
display: inline !important;
|
|
43
|
-
border: none !important;
|
|
44
|
-
margin: 0 !important;
|
|
45
|
-
width: 1px !important;
|
|
46
|
-
height: 1px !important;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.ProseMirror-gapcursor {
|
|
50
|
-
display: none;
|
|
51
|
-
pointer-events: none;
|
|
52
|
-
position: absolute;
|
|
53
|
-
margin: 0;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.ProseMirror-gapcursor:after {
|
|
57
|
-
content: "";
|
|
58
|
-
display: block;
|
|
59
|
-
position: absolute;
|
|
60
|
-
top: -2px;
|
|
61
|
-
width: 20px;
|
|
62
|
-
border-top: 1px solid black;
|
|
63
|
-
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@keyframes ProseMirror-cursor-blink {
|
|
67
|
-
to {
|
|
68
|
-
visibility: hidden;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.ProseMirror-hideselection *::selection {
|
|
73
|
-
background: transparent;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.ProseMirror-hideselection *::-moz-selection {
|
|
77
|
-
background: transparent;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.ProseMirror-hideselection * {
|
|
81
|
-
caret-color: transparent;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
85
|
-
display: block;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
89
|
-
opacity: 0
|
|
90
|
-
}`,et9=class extends eec{constructor(t={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=function(t,n){let r=document.querySelector("style[data-tiptap-style]");if(null!==r)return r;let i=document.createElement("style");return n&&i.setAttribute("nonce",n),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}(et5,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,n=!0){this.setOptions({editable:t}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,n){let r=eeg(n)?n(t,[...this.state.plugins]):[...this.state.plugins,t],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(t){if(this.isDestroyed)return;let n="string"==typeof t?`${t}$`:t.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(t=>!t.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){let t=[...this.options.enableCoreExtensions?Object.values(et3):[],...this.options.extensions].filter(t=>["extension","node","mark"].includes(null==t?void 0:t.type));this.extensionManager=new eeN(t,this)}createCommandManager(){this.commandManager=new ees({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let t=etS(this.options.content,this.schema,this.options.parseOptions),n=ee4(t,this.options.autofocus);this.view=new XD(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Q6.create({doc:t,selection:n||void 0})});let r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews();let i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;let n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(t=>{var n;return null===(n=this.capturedTransaction)||void 0===n?void 0:n.step(t)});return}let n=this.state.apply(t),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:t}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});let i=t.getMeta("focus"),o=t.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:t}),o&&this.emit("blur",{editor:this,event:o.event,transaction:t}),!t.docChanged||t.getMeta("preventUpdate")||this.emit("update",{editor:this,transaction:t})}getAttributes(t){return function(t,n){let r=etp("string"==typeof n?n:n.name,t.schema);return"node"===r?function(t,n){let r=eep(n,t.schema),{from:i,to:o}=t.selection,a=[];t.doc.nodesBetween(i,o,t=>{a.push(t)});let u=a.reverse().find(t=>t.type.name===r.name);return u?{...u.attrs}:{}}(t,n):"mark"===r?etI(t,n):{}}(this.state,t)}isActive(t,n){return function(t,n,r={}){if(!n)return ets(t,null,r)||etC(t,null,r);let i=etp(n,t.schema);return"node"===i?ets(t,n,r):"mark"===i&&etC(t,n,r)}(this.state,"string"==typeof t?t:null,"string"==typeof t?n:t)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(t,n){let r=Qr.fromSchema(n).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(r),i.innerHTML}(this.state.doc.content,this.schema)}getText(t){let{blockSeparator:n=`
|
|
91
|
-
|
|
92
|
-
`,textSerializers:r={}}=t||{};return function(t,n){let r={from:0,to:t.content.size};return eeD(t,r,n)}(this.state.doc,{blockSeparator:n,textSerializers:{...eeA(this.schema),...r}})}get isEmpty(){return function(t){var n;let r=null===(n=t.type.createAndFill())||void 0===n?void 0:n.toJSON(),i=t.toJSON();return JSON.stringify(r)===JSON.stringify(i)}(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var t;return!(!(null===(t=this.view)||void 0===t)&&t.docView)}};function et8(t){return new ee_({find:t.find,handler({state:n,range:r,match:i}){let o=eey(t.getAttributes,void 0,i);if(!1===o||null===o)return null;let{tr:a}=n,u=i[i.length-1],s=i[0],c=r.to;if(u){let l=s.search(/\S/),f=r.from+s.indexOf(u),d=f+u.length;if(etO(r.from,r.to,n.doc).filter(n=>n.mark.type.excluded.find(r=>r===t.type&&r!==n.mark.type)).filter(t=>t.to>f).length)return null;d<r.to&&a.delete(d,r.to),f>r.from&&a.delete(r.from+l,f),c=r.from+l+u.length,a.addMark(r.from+l,c,t.type.create(o||{})),a.removeStoredMark(t.type)}}})}function et6(t){return new ee_({find:t.find,handler({state:n,range:r,match:i}){let o=n.doc.resolve(r.from),a=eey(t.getAttributes,void 0,i)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;n.tr.delete(r.from,r.to).setBlockType(r.from,r.from,t.type,a)}})}function et7(t){return new ee_({find:t.find,handler({state:n,range:r,match:i,chain:o}){let a=eey(t.getAttributes,void 0,i)||{},u=n.tr.delete(r.from,r.to),s=u.doc.resolve(r.from).blockRange(),c=s&&Qw(s,t.type,a);if(!c)return null;if(u.wrap(s,c),t.keepMarks&&t.editor){let{selection:l,storedMarks:f}=n,{splittableMarks:d}=t.editor.extensionManager,p=f||l.$to.parentOffset&&l.$from.marks();if(p){let h=p.filter(t=>d.includes(t.type.name));u.ensureMarks(h)}}if(t.keepAttributes){let m="bulletList"===t.type.name||"orderedList"===t.type.name?"listItem":"taskList";o().updateAttributes(m,a).run()}let g=u.doc.resolve(r.from-1).nodeBefore;g&&g.type===t.type&&QO(u.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(i,g))&&u.join(r.from-1)}})}let ene=class t{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=eey(eel(this,"addOptions",{name:this.name}))),this.storage=eey(eel(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(n={}){return new t(n)}configure(t={}){let n=this.extend();return n.options=eeE(this.options,t),n.storage=eey(eel(n,"addStorage",{name:n.name,options:n.options})),n}extend(n={}){let r=new t(n);return r.parent=this,this.child=r,r.name=n.name?n.name:r.parent.name,n.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${r.name}".`),r.options=eey(eel(r,"addOptions",{name:r.name})),r.storage=eey(eel(r,"addStorage",{name:r.name,options:r.options})),r}static handleExit({editor:t,mark:n}){let{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){let o=i.marks();if(!o.find(t=>(null==t?void 0:t.type.name)===n.name))return!1;let a=o.find(t=>(null==t?void 0:t.type.name)===n.name);return a&&r.removeStoredMark(a),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}};class ent{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=eey(eel(this,"addOptions",{name:this.name}))),this.storage=eey(eel(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new ent(t)}configure(t={}){let n=this.extend();return n.options=eeE(this.options,t),n.storage=eey(eel(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){let n=new ent(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=eey(eel(n,"addOptions",{name:n.name})),n.storage=eey(eel(n,"addStorage",{name:n.name,options:n.options})),n}}class enn{constructor(t,n,r){this.isDragging=!1,this.component=t,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var n,r,i,o,a,u,s;let{view:c}=this.editor,l=t.target,f=3===l.nodeType?null===(n=l.parentElement)||void 0===n?void 0:n.closest("[data-drag-handle]"):l.closest("[data-drag-handle]");if(!this.dom||!(null===(r=this.contentDOM)||void 0===r)&&r.contains(l)||!f)return;let d=0,p=0;if(this.dom!==f){let h=this.dom.getBoundingClientRect(),m=f.getBoundingClientRect(),g=null!==(i=t.offsetX)&&void 0!==i?i:null===(o=t.nativeEvent)||void 0===o?void 0:o.offsetX,y=null!==(a=t.offsetY)&&void 0!==a?a:null===(u=t.nativeEvent)||void 0===u?void 0:u.offsetY;d=m.x-h.x+g,p=m.y-h.y+y}null===(s=t.dataTransfer)||void 0===s||s.setDragImage(this.dom,d,p);let v=QH.create(c.state.doc,this.getPos()),b=c.state.tr.setSelection(v);c.dispatch(b)}stopEvent(t){var n;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:t});let r=t.target;if(!(this.dom.contains(r)&&!(!(null===(n=this.contentDOM)||void 0===n)&&n.contains(r))))return!1;let i=t.type.startsWith("drag"),o="drop"===t.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o&&!i)return!0;let{isEditable:a}=this.editor,{isDragging:u}=this,s=!!this.node.type.spec.draggable,c=QH.isSelectable(this.node),l="copy"===t.type,f="paste"===t.type,d="cut"===t.type,p="mousedown"===t.type;if(!s&&c&&i&&t.preventDefault(),s&&i&&!u)return t.preventDefault(),!1;if(s&&a&&!u&&p){let h=r.closest("[data-drag-handle]");h&&(this.dom===h||this.dom.contains(h))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(u||o||l||f||d||p&&c)}ignoreMutation(t){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:t}):!!this.node.isLeaf||!!this.node.isAtom||!("selection"===t.type||this.dom.contains(t.target)&&"childList"===t.type&&ee3()&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(t=>t.isContentEditable))&&(this.contentDOM===t.target&&"attributes"===t.type||!this.contentDOM.contains(t.target)))}updateAttributes(t){this.editor.commands.command(({tr:n})=>{let r=this.getPos();return n.setNodeMarkup(r,void 0,{...this.node.attrs,...t}),!0})}deleteNode(){let t=this.getPos(),n=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:n})}}function enr(t){return new eek({find:t.find,handler({state:n,range:r,match:i}){let o=eey(t.getAttributes,void 0,i);if(!1===o||null===o)return null;let{tr:a}=n,u=i[i.length-1],s=i[0],c=r.to;if(u){let l=s.search(/\S/),f=r.from+s.indexOf(u),d=f+u.length;if(etO(r.from,r.to,n.doc).filter(n=>n.mark.type.excluded.find(r=>r===t.type&&r!==n.mark.type)).filter(t=>t.to>f).length)return null;d<r.to&&a.delete(d,r.to),f>r.from&&a.delete(r.from+l,f),c=r.from+l+u.length,a.addMark(r.from+l,c,t.type.create(o||{})),a.removeStoredMark(t.type)}}})}var eni="bottom",eno="right",ena="left",enu="auto",ens=["top",eni,eno,ena],enc="start",enl="viewport",enf="popper",end=ens.reduce(function(t,n){return t.concat([n+"-"+enc,n+"-end"])},[]),enp=[].concat(ens,[enu]).reduce(function(t,n){return t.concat([n,n+"-"+enc,n+"-end"])},[]),enh=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function enm(t){return t?(t.nodeName||"").toLowerCase():null}function eng(t){if(null==t)return window;if("[object Window]"!==t.toString()){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function eny(t){var n=eng(t).Element;return t instanceof n||t instanceof Element}function env(t){var n=eng(t).HTMLElement;return t instanceof n||t instanceof HTMLElement}function enb(t){if(typeof ShadowRoot>"u")return!1;var n=eng(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}let enx={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var n=t.state;Object.keys(n.elements).forEach(function(t){var r=n.styles[t]||{},i=n.attributes[t]||{},o=n.elements[t];env(o)&&enm(o)&&(Object.assign(o.style,r),Object.keys(i).forEach(function(t){var n=i[t];!1===n?o.removeAttribute(t):o.setAttribute(t,!0===n?"":n)}))})},effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow),function(){Object.keys(n.elements).forEach(function(t){var i=n.elements[t],o=n.attributes[t]||{},a=Object.keys(n.styles.hasOwnProperty(t)?n.styles[t]:r[t]).reduce(function(t,n){return t[n]="",t},{});env(i)&&enm(i)&&(Object.assign(i.style,a),Object.keys(o).forEach(function(t){i.removeAttribute(t)}))})}},requires:["computeStyles"]};function enM(t){return t.split("-")[0]}var enT=Math.max,enS=Math.min,enw=Math.round;function en_(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function enI(){return!/^((?!chrome|android).)*safari/i.test(en_())}function enO(t,n,r){void 0===n&&(n=!1),void 0===r&&(r=!1);var i=t.getBoundingClientRect(),o=1,a=1;n&&env(t)&&(o=t.offsetWidth>0&&enw(i.width)/t.offsetWidth||1,a=t.offsetHeight>0&&enw(i.height)/t.offsetHeight||1);var u=(eny(t)?eng(t):window).visualViewport,s=!enI()&&r,c=(i.left+(s&&u?u.offsetLeft:0))/o,l=(i.top+(s&&u?u.offsetTop:0))/a,f=i.width/o,d=i.height/a;return{width:f,height:d,top:l,right:c+f,bottom:l+d,left:c,x:c,y:l}}function enk(t){var n=enO(t),r=t.offsetWidth,i=t.offsetHeight;return 1>=Math.abs(n.width-r)&&(r=n.width),1>=Math.abs(n.height-i)&&(i=n.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:i}}function enC(t,n){var r=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(r&&enb(r)){var i=n;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function enN(t){return eng(t).getComputedStyle(t)}function enj(t){return["table","td","th"].indexOf(enm(t))>=0}function enE(t){return((eny(t)?t.ownerDocument:t.document)||window.document).documentElement}function enR(t){return"html"===enm(t)?t:t.assignedSlot||t.parentNode||(enb(t)?t.host:null)||enE(t)}function enD(t){return env(t)&&"fixed"!==enN(t).position?t.offsetParent:null}function enA(t){for(var n=eng(t),r=enD(t);r&&enj(r)&&"static"===enN(r).position;)r=enD(r);return r&&("html"===enm(r)||"body"===enm(r)&&"static"===enN(r).position)?n:r||function(t){var n=/firefox/i.test(en_());if(/Trident/i.test(en_())&&env(t)&&"fixed"===enN(t).position)return null;var r=enR(t);for(enb(r)&&(r=r.host);env(r)&&0>["html","body"].indexOf(enm(r));){var i=enN(r);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||n&&"filter"===i.willChange||n&&i.filter&&"none"!==i.filter)return r;r=r.parentNode}return null}(t)||n}function enL(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function enP(t,n,r){return enT(t,enS(n,r))}function enF(){return{top:0,right:0,bottom:0,left:0}}function enz(t){return Object.assign({},enF(),t)}function enU(t,n){return n.reduce(function(n,r){return n[r]=t,n},{})}function enW(t){return t.split("-")[1]}var enB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function enV(t){var n,r,i=t.popper,o=t.popperRect,a=t.placement,u=t.variation,s=t.offsets,c=t.position,l=t.gpuAcceleration,f=t.adaptive,d=t.roundOffsets,p=t.isFixed,h=s.x,m=void 0===h?0:h,g=s.y,y=void 0===g?0:g,v="function"==typeof d?d({x:m,y:y}):{x:m,y:y};m=v.x,y=v.y;var b=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),M=ena,T="top",S=window;if(f){var w=enA(i),_="clientHeight",I="clientWidth";w===eng(i)&&(w=enE(i),"static"!==enN(w).position&&"absolute"===c&&(_="scrollHeight",I="scrollWidth")),("top"===a||(a===ena||a===eno)&&"end"===u)&&(T=eni,y-=(p&&w===S&&S.visualViewport?S.visualViewport.height:w[_])-o.height,y*=l?1:-1),(a===ena||("top"===a||a===eni)&&"end"===u)&&(M=eno,m-=(p&&w===S&&S.visualViewport?S.visualViewport.width:w[I])-o.width,m*=l?1:-1)}var O,k,C,N,j,E=Object.assign({position:c},f&&enB),R=!0===d?(O={x:m,y:y},k=eng(i),C=O.x,N=O.y,{x:enw(C*(j=k.devicePixelRatio||1))/j||0,y:enw(N*j)/j||0}):{x:m,y:y};return(m=R.x,y=R.y,l)?Object.assign({},E,((n={})[T]=x?"0":"",n[M]=b?"0":"",n.transform=1>=(S.devicePixelRatio||1)?"translate("+m+"px, "+y+"px)":"translate3d("+m+"px, "+y+"px, 0)",n)):Object.assign({},E,((r={})[T]=x?y+"px":"",r[M]=b?m+"px":"",r.transform="",r))}var en$={passive:!0},enK={left:"right",right:"left",bottom:"top",top:"bottom"};function enY(t){return t.replace(/left|right|bottom|top/g,function(t){return enK[t]})}var enq={start:"end",end:"start"};function enG(t){return t.replace(/start|end/g,function(t){return enq[t]})}function enZ(t){var n,r=eng(t);return{scrollLeft:r.pageXOffset,scrollTop:r.pageYOffset}}function enQ(t){return enO(enE(t)).left+enZ(t).scrollLeft}function enH(t){var n=enN(t),r=n.overflow,i=n.overflowX,o=n.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+i)}function enJ(t,n){void 0===n&&(n=[]);var r,i=function t(n){return["html","body","#document"].indexOf(enm(n))>=0?n.ownerDocument.body:env(n)&&enH(n)?n:t(enR(n))}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=eng(i),u=o?[a].concat(a.visualViewport||[],enH(i)?i:[]):i,s=n.concat(u);return o?s:s.concat(enJ(enR(u)))}function enX(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function en0(t,n,r){var i,o,a,u,s,c,l,f,d,p,h,m;return n===enl?enX(function(t,n){var r=eng(t),i=enE(t),o=r.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,c=0;if(o){a=o.width,u=o.height;var l=enI();(l||!l&&"fixed"===n)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:a,height:u,x:s+enQ(t),y:c}}(t,r)):eny(n)?((a=enO(n,!1,"fixed"===r)).top=a.top+n.clientTop,a.left=a.left+n.clientLeft,a.bottom=a.top+n.clientHeight,a.right=a.left+n.clientWidth,a.width=n.clientWidth,a.height=n.clientHeight,a.x=a.left,a.y=a.top,a):enX((u=enE(t),c=enE(u),l=enZ(u),f=null==(s=u.ownerDocument)?void 0:s.body,d=enT(c.scrollWidth,c.clientWidth,f?f.scrollWidth:0,f?f.clientWidth:0),p=enT(c.scrollHeight,c.clientHeight,f?f.scrollHeight:0,f?f.clientHeight:0),h=-l.scrollLeft+enQ(u),m=-l.scrollTop,"rtl"===enN(f||c).direction&&(h+=enT(c.clientWidth,f?f.clientWidth:0)-d),{width:d,height:p,x:h,y:m}))}function en1(t){var n,r=t.reference,i=t.element,o=t.placement,a=o?enM(o):null,u=o?enW(o):null,s=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2;switch(a){case"top":n={x:s,y:r.y-i.height};break;case eni:n={x:s,y:r.y+r.height};break;case eno:n={x:r.x+r.width,y:c};break;case ena:n={x:r.x-i.width,y:c};break;default:n={x:r.x,y:r.y}}var l=a?enL(a):null;if(null!=l){var f="y"===l?"height":"width";switch(u){case enc:n[l]=n[l]-(r[f]/2-i[f]/2);break;case"end":n[l]=n[l]+(r[f]/2-i[f]/2)}}return n}function en2(t,n){void 0===n&&(n={});var r,i,o,a,u,s,c,l,f,d,p=n,h=p.placement,m=void 0===h?t.placement:h,g=p.strategy,y=void 0===g?t.strategy:g,v=p.boundary,b=p.rootBoundary,x=p.elementContext,M=void 0===x?enf:x,T=p.altBoundary,S=p.padding,w=void 0===S?0:S,_=enz("number"!=typeof w?w:enU(w,ens)),I=t.rects.popper,O=t.elements[void 0!==T&&T?M===enf?"reference":enf:M],k=(r=eny(O)?O:O.contextElement||enE(t.elements.popper),f=(l=[].concat("clippingParents"===(i=void 0===v?"clippingParents":v)?(s=enJ(enR(r)),c=["absolute","fixed"].indexOf(enN(r).position)>=0&&env(r)?enA(r):r,eny(c)?s.filter(function(t){return eny(t)&&enC(t,c)&&"body"!==enm(t)}):[]):[].concat(i),[void 0===b?enl:b]))[0],(d=l.reduce(function(t,n){var i=en0(r,n,y);return t.top=enT(i.top,t.top),t.right=enS(i.right,t.right),t.bottom=enS(i.bottom,t.bottom),t.left=enT(i.left,t.left),t},en0(r,f,y))).width=d.right-d.left,d.height=d.bottom-d.top,d.x=d.left,d.y=d.top,d),C=enO(t.elements.reference),N=en1({reference:C,element:I,strategy:"absolute",placement:m}),j=enX(Object.assign({},I,N)),E=M===enf?j:C,R={top:k.top-E.top+_.top,bottom:E.bottom-k.bottom+_.bottom,left:k.left-E.left+_.left,right:E.right-k.right+_.right},D=t.modifiersData.offset;if(M===enf&&D){var A=D[m];Object.keys(R).forEach(function(t){var n=[eno,eni].indexOf(t)>=0?1:-1,r=["top",eni].indexOf(t)>=0?"y":"x";R[t]+=A[r]*n})}return R}function en4(t,n,r){return void 0===r&&(r={x:0,y:0}),{top:t.top-n.height-r.y,right:t.right-n.width+r.x,bottom:t.bottom-n.height+r.y,left:t.left-n.width-r.x}}function en3(t){return["top",eno,eni,ena].some(function(n){return t[n]>=0})}var en5={placement:"bottom",modifiers:[],strategy:"absolute"};function en9(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return!n.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}var en8,en6,en7,ere,ert,ern,err=(en8={defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var n=t.state,r=t.instance,i=t.options,o=i.scroll,a=void 0===o||o,u=i.resize,s=void 0===u||u,c=eng(n.elements.popper),l=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&l.forEach(function(t){t.addEventListener("scroll",r.update,en$)}),s&&c.addEventListener("resize",r.update,en$),function(){a&&l.forEach(function(t){t.removeEventListener("scroll",r.update,en$)}),s&&c.removeEventListener("resize",r.update,en$)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var n=t.state,r=t.name;n.modifiersData[r]=en1({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var n=t.state,r=t.options,i=r.gpuAcceleration,o=r.adaptive,a=r.roundOffsets,u=void 0===a||a,s={placement:enM(n.placement),variation:enW(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:void 0===i||i,isFixed:"fixed"===n.options.strategy};null!=n.modifiersData.popperOffsets&&(n.styles.popper=Object.assign({},n.styles.popper,enV(Object.assign({},s,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:void 0===o||o,roundOffsets:u})))),null!=n.modifiersData.arrow&&(n.styles.arrow=Object.assign({},n.styles.arrow,enV(Object.assign({},s,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})},data:{}},enx,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var n=t.state,r=t.options,i=t.name,o=r.offset,a=void 0===o?[0,0]:o,u=enp.reduce(function(t,r){var i,o,u,s,c,l,f,d;return t[r]=(o=n.rects,c=[ena,"top"].indexOf(s=enM(r))>=0?-1:1,f=(l="function"==typeof a?a(Object.assign({},o,{placement:r})):a)[0],d=l[1],f=f||0,d=(d||0)*c,[ena,eno].indexOf(s)>=0?{x:d,y:f}:{x:f,y:d}),t},{}),s=u[n.placement],c=s.x,l=s.y;null!=n.modifiersData.popperOffsets&&(n.modifiersData.popperOffsets.x+=c,n.modifiersData.popperOffsets.y+=l),n.modifiersData[i]=u}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var n=t.state,r=t.options,i=t.name;if(!n.modifiersData[i]._skip){for(var o=r.mainAxis,a=void 0===o||o,u=r.altAxis,s=void 0===u||u,c=r.fallbackPlacements,l=r.padding,f=r.boundary,d=r.rootBoundary,p=r.altBoundary,h=r.flipVariations,m=void 0===h||h,g=r.allowedAutoPlacements,y=n.options.placement,v=enM(y),b=c||(v!==y&&m?function(t){if(enM(t)===enu)return[];var n=enY(t);return[enG(t),n,enG(n)]}(y):[enY(y)]),x=[y].concat(b).reduce(function(t,r){var i,o,a,u,s,c,p,h,y,v,b,x,M,T;return t.concat(enM(r)===enu?(o={placement:r,boundary:f,rootBoundary:d,padding:l,flipVariations:m,allowedAutoPlacements:g},u=(a=o).placement,s=a.boundary,c=a.rootBoundary,p=a.padding,h=a.flipVariations,v=void 0===(y=a.allowedAutoPlacements)?enp:y,0===(M=(x=(b=enW(u))?h?end:end.filter(function(t){return enW(t)===b}):ens).filter(function(t){return v.indexOf(t)>=0})).length&&(M=x),Object.keys(T=M.reduce(function(t,r){return t[r]=en2(n,{placement:r,boundary:s,rootBoundary:c,padding:p})[enM(r)],t},{})).sort(function(t,n){return T[t]-T[n]})):r)},[]),M=n.rects.reference,T=n.rects.popper,S=new Map,w=!0,_=x[0],I=0;I<x.length;I++){var O=x[I],k=enM(O),C=enW(O)===enc,N=["top",eni].indexOf(k)>=0,j=N?"width":"height",E=en2(n,{placement:O,boundary:f,rootBoundary:d,altBoundary:p,padding:l}),R=N?C?eno:ena:C?eni:"top";M[j]>T[j]&&(R=enY(R));var D=enY(R),A=[];if(a&&A.push(E[k]<=0),s&&A.push(E[R]<=0,E[D]<=0),A.every(function(t){return t})){_=O,w=!1;break}S.set(O,A)}if(w)for(var L=m?3:1,P=function(t){var n=x.find(function(n){var r=S.get(n);if(r)return r.slice(0,t).every(function(t){return t})});if(n)return _=n,"break"},F=L;F>0&&"break"!==P(F);F--);n.placement!==_&&(n.modifiersData[i]._skip=!0,n.placement=_,n.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var n,r=t.state,i=t.options,o=t.name,a=i.mainAxis,u=i.altAxis,s=i.boundary,c=i.rootBoundary,l=i.altBoundary,f=i.padding,d=i.tether,p=void 0===d||d,h=i.tetherOffset,m=void 0===h?0:h,g=en2(r,{boundary:s,rootBoundary:c,padding:f,altBoundary:l}),y=enM(r.placement),v=enW(r.placement),b=!v,x=enL(y),M="x"===x?"y":"x",T=r.modifiersData.popperOffsets,S=r.rects.reference,w=r.rects.popper,_="function"==typeof m?m(Object.assign({},r.rects,{placement:r.placement})):m,I="number"==typeof _?{mainAxis:_,altAxis:_}:Object.assign({mainAxis:0,altAxis:0},_),O=r.modifiersData.offset?r.modifiersData.offset[r.placement]:null,k={x:0,y:0};if(T){if(void 0===a||a){var C,N="y"===x?"top":ena,j="y"===x?eni:eno,E="y"===x?"height":"width",R=T[x],D=R+g[N],A=R-g[j],L=p?-w[E]/2:0,P=v===enc?S[E]:w[E],F=v===enc?-w[E]:-S[E],z=r.elements.arrow,U=p&&z?enk(z):{width:0,height:0},W=r.modifiersData["arrow#persistent"]?r.modifiersData["arrow#persistent"].padding:enF(),B=W[N],V=W[j],$=enP(0,S[E],U[E]),K=b?S[E]/2-L-$-B-I.mainAxis:P-$-B-I.mainAxis,Y=b?-S[E]/2+L+$+V+I.mainAxis:F+$+V+I.mainAxis,q=r.elements.arrow&&enA(r.elements.arrow),G=q?"y"===x?q.clientTop||0:q.clientLeft||0:0,Z=null!=(C=null==O?void 0:O[x])?C:0,Q=enP(p?enS(D,R+K-Z-G):D,R,p?enT(A,R+Y-Z):A);T[x]=Q,k[x]=Q-R}if(void 0!==u&&u){var H,J,X,ee,et,en=T[M],er="y"===M?"height":"width",ei=en+g["x"===x?"top":ena],eo=en-g["x"===x?eni:eno],ea=-1!==["top",ena].indexOf(y),eu=null!=(et=null==O?void 0:O[M])?et:0,es=ea?ei:en-S[er]-w[er]-eu+I.altAxis,ec=ea?en+S[er]+w[er]-eu-I.altAxis:eo,el=p&&ea?(ee=enP(es,en,ec))>ec?ec:ee:enP(p?es:ei,en,p?ec:eo);T[M]=el,k[M]=el-en}r.modifiersData[o]=k}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var n,r=t.state,i=t.name,o=t.options,a=r.elements.arrow,u=r.modifiersData.popperOffsets,s=enM(r.placement),c=enL(s),l=[ena,eno].indexOf(s)>=0?"height":"width";if(!(!a||!u)){var f,d,p=enz("number"!=typeof(f="function"==typeof(f=o.padding)?f(Object.assign({},r.rects,{placement:r.placement})):f)?f:enU(f,ens)),h=enk(a),m=r.rects.reference[l]+r.rects.reference[c]-u[c]-r.rects.popper[l],g=u[c]-r.rects.reference[c],y=enA(a),v=y?"y"===c?y.clientHeight||0:y.clientWidth||0:0,b=p["y"===c?"top":ena],x=v-h[l]-p["y"===c?eni:eno],M=v/2-h[l]/2+(m/2-g/2),T=enP(b,M,x);r.modifiersData[i]=((n={})[c]=T,n.centerOffset=T-M,n)}},effect:function(t){var n=t.state,r=t.options.element,i=void 0===r?"[data-popper-arrow]":r;null==i||("string"!=typeof i||(i=n.elements.popper.querySelector(i)))&&enC(n.elements.popper,i)&&(n.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var n=t.state,r=t.name,i=n.rects.reference,o=n.rects.popper,a=n.modifiersData.preventOverflow,u=en2(n,{elementContext:"reference"}),s=en2(n,{altBoundary:!0}),c=en4(u,i),l=en4(s,o,a),f=en3(c),d=en3(l);n.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:f,hasPopperEscaped:d},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":d})}}]},ere=void 0===(en7=(en6=en8).defaultModifiers)?[]:en7,ern=void 0===(ert=en6.defaultOptions)?en5:ert,function(t,n,r){void 0===r&&(r=ern);var i,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},en5,ern),modifiersData:{},elements:{reference:t,popper:n},attributes:{},styles:{}},u=[],s=!1,c={state:a,setOptions:function(r){var i,o,s,f,d,p,h,m,g="function"==typeof r?r(a.options):r;l(),a.options=Object.assign({},ern,a.options,g),a.scrollParents={reference:eny(t)?enJ(t):t.contextElement?enJ(t.contextElement):[],popper:enJ(n)};var y=(s=Object.keys(o=(i=[].concat(ere,a.options.modifiers)).reduce(function(t,n){var r=t[n.name];return t[n.name]=r?Object.assign({},r,n,{options:Object.assign({},r.options,n.options),data:Object.assign({},r.data,n.data)}):n,t},{})).map(function(t){return o[t]}),d=new Map,p=new Set,h=[],s.forEach(function(t){d.set(t.name,t)}),s.forEach(function(t){p.has(t.name)||function t(n){p.add(n.name),[].concat(n.requires||[],n.requiresIfExists||[]).forEach(function(n){if(!p.has(n)){var r=d.get(n);r&&t(r)}}),h.push(n)}(t)}),enh.reduce(function(t,n){return t.concat(h.filter(function(t){return t.phase===n}))},[]));return a.orderedModifiers=y.filter(function(t){return t.enabled}),a.orderedModifiers.forEach(function(t){var n=t.name,r=t.options,i=t.effect;if("function"==typeof i){var o=i({state:a,name:n,instance:c,options:void 0===r?{}:r}),s=function(){};u.push(o||s)}}),c.update()},forceUpdate:function(){if(!s){var t,n,r,i,o,u,l,f,d,p,h,m,g,y,v,b=a.elements,x=b.reference,M=b.popper;if(en9(x,M)){a.rects={reference:(t=x,n=enA(M),r="fixed"===a.options.strategy,f=env(n),d=env(n)&&(u=enw((o=(i=n).getBoundingClientRect()).width)/i.offsetWidth||1,l=enw(o.height)/i.offsetHeight||1,1!==u||1!==l),p=enE(n),h=enO(t,d,r),m={scrollLeft:0,scrollTop:0},g={x:0,y:0},(f||!f&&!r)&&(("body"!==enm(n)||enH(p))&&(m=(y=n)!==eng(y)&&env(y)?{scrollLeft:(v=y).scrollLeft,scrollTop:v.scrollTop}:enZ(y)),env(n)?(g=enO(n,!0),g.x+=n.clientLeft,g.y+=n.clientTop):p&&(g.x=enQ(p))),{x:h.left+m.scrollLeft-g.x,y:h.top+m.scrollTop-g.y,width:h.width,height:h.height}),popper:enk(M)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(t){return a.modifiersData[t.name]=Object.assign({},t.data)});for(var T=0;T<a.orderedModifiers.length;T++){if(!0===a.reset){a.reset=!1,T=-1;continue}var S=a.orderedModifiers[T],w=S.fn,_=S.options,I=void 0===_?{}:_,O=S.name;"function"==typeof w&&(a=w({state:a,options:I,name:O,instance:c})||a)}}}},update:function(){return o||(o=new Promise(function(t){Promise.resolve().then(function(){o=void 0,t(new Promise(function(t){c.forceUpdate(),t(a)}))})})),o},destroy:function(){l(),s=!0}};if(!en9(t,n))return c;function l(){u.forEach(function(t){return t()}),u=[]}return c.setOptions(r).then(function(t){!s&&r.onFirstUpdate&&r.onFirstUpdate(t)}),c}),eri="tippy-content",ero="tippy-arrow",era="tippy-svg-arrow",eru={passive:!0,capture:!0},ers=function(){return document.body};function erc(t,n,r){return Array.isArray(t)?t[n]??(Array.isArray(r)?r[n]:r):t}function erl(t,n){var r=({}).toString.call(t);return 0===r.indexOf("[object")&&r.indexOf(n+"]")>-1}function erf(t,n){return"function"==typeof t?t.apply(void 0,n):t}function erd(t,n){var r;return 0===n?t:function(i){clearTimeout(r),r=setTimeout(function(){t(i)},n)}}function erp(t){return[].concat(t)}function erh(t,n){-1===t.indexOf(n)&&t.push(n)}function erm(t){return[].slice.call(t)}function erg(t){return Object.keys(t).reduce(function(n,r){return void 0!==t[r]&&(n[r]=t[r]),n},{})}function ery(){return document.createElement("div")}function erv(t){return["Element","Fragment"].some(function(n){return erl(t,n)})}function erb(t,n){t.forEach(function(t){t&&(t.style.transitionDuration=n+"ms")})}function erx(t,n){t.forEach(function(t){t&&t.setAttribute("data-state",n)})}function erM(t,n,r){var i=n+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){t[i](n,r)})}function erT(t,n){for(var r,i=n;i;){if(t.contains(i))return!0;i=null==i.getRootNode||null==(r=i.getRootNode())?void 0:r.host}return!1}var erS={isTouch:!1},erw=0;function er_(){erS.isTouch||(erS.isTouch=!0,window.performance&&document.addEventListener("mousemove",erI))}function erI(){var t=performance.now();t-erw<20&&(erS.isTouch=!1,document.removeEventListener("mousemove",erI)),erw=t}function erO(){var t,n=document.activeElement;if(n&&n._tippy&&n._tippy.reference===n){var r=n._tippy;n.blur&&!r.state.isVisible&&n.blur()}}var erk=!!("u">typeof window&&"u">typeof document)&&!!window.msCrypto,erC=Object.assign({appendTo:ers,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),erN=Object.keys(erC),erj=function(t){Object.keys(t).forEach(function(n){erC[n]=t[n]})};function erE(t){var n=(t.plugins||[]).reduce(function(n,r){var i,o=r.name,a=r.defaultValue;return o&&(n[o]=void 0!==t[o]?t[o]:null!=(i=erC[o])?i:a),n},{});return Object.assign({},t,n)}function erR(t,n){var r,i,o=Object.assign({},n,{content:erf(n.content,[t])},n.ignoreAttributes?{}:((i=n.plugins)?Object.keys(erE(Object.assign({},erC,{plugins:i}))):erN).reduce(function(n,r){var i=(t.getAttribute("data-tippy-"+r)||"").trim();if(!i)return n;if("content"===r)n[r]=i;else try{n[r]=JSON.parse(i)}catch{n[r]=i}return n},{}));return o.aria=Object.assign({},erC.aria,o.aria),o.aria={expanded:"auto"===o.aria.expanded?n.interactive:o.aria.expanded,content:"auto"===o.aria.content?n.interactive?null:"describedby":o.aria.content},o}var erD=function(){return"innerHTML"};function erA(t,n){t[erD()]=n}function erL(t){var n=ery();return!0===t?n.className=ero:(n.className=era,erv(t)?n.appendChild(t):erA(n,t)),n}function erP(t,n){erv(n.content)?(erA(t,""),t.appendChild(n.content)):"function"!=typeof n.content&&(n.allowHTML?erA(t,n.content):t.textContent=n.content)}function erF(t){var n=t.firstElementChild,r=erm(n.children);return{box:n,content:r.find(function(t){return t.classList.contains(eri)}),arrow:r.find(function(t){return t.classList.contains(ero)||t.classList.contains(era)}),backdrop:r.find(function(t){return t.classList.contains("tippy-backdrop")})}}function erz(t){var n=ery(),r=ery();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var i=ery();function o(r,i){var o=erF(n),a=o.box,u=o.content,s=o.arrow;i.theme?a.setAttribute("data-theme",i.theme):a.removeAttribute("data-theme"),"string"==typeof i.animation?a.setAttribute("data-animation",i.animation):a.removeAttribute("data-animation"),i.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth="number"==typeof i.maxWidth?i.maxWidth+"px":i.maxWidth,i.role?a.setAttribute("role",i.role):a.removeAttribute("role"),(r.content!==i.content||r.allowHTML!==i.allowHTML)&&erP(u,t.props),i.arrow?s?r.arrow!==i.arrow&&(a.removeChild(s),a.appendChild(erL(i.arrow))):a.appendChild(erL(i.arrow)):s&&a.removeChild(s)}return i.className=eri,i.setAttribute("data-state","hidden"),erP(i,t.props),n.appendChild(r),r.appendChild(i),o(t.props,t.props),{popper:n,onUpdate:o}}erz.$$tippy=!0;var erU=1,erW=[],erB=[];function erV(t,n){void 0===n&&(n={});var r,i,o=erC.plugins.concat(n.plugins||[]);document.addEventListener("touchstart",er_,eru),window.addEventListener("blur",erO);var a,u=Object.assign({},n,{plugins:o}),s=(erv(t)?[t]:erl(t,"NodeList")?erm(t):Array.isArray(t)?t:erm(document.querySelectorAll(t))).reduce(function(t,n){var r=n&&function(t,n){var r,i,o,a,u,s,c,l,f=erR(t,Object.assign({},erC,erE(erg(n)))),d=!1,p=!1,h=!1,m=!1,g=[],y=erd(G,f.interactiveDebounce),v=erU++,b=(r=f.plugins).filter(function(t,n){return r.indexOf(t)===n}),x={id:v,reference:t,popper:ery(),popperInstance:null,props:f,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(i),clearTimeout(o),cancelAnimationFrame(a)},setProps:function(n){if(!x.state.isDestroyed){D("onBeforeUpdate",[x,n]),Y();var r=x.props,i=erR(t,Object.assign({},r,erg(n),{ignoreAttributes:!0}));x.props=i,K(),r.interactiveDebounce!==i.interactiveDebounce&&(P(),y=erd(G,i.interactiveDebounce)),r.triggerTarget&&!i.triggerTarget?erp(r.triggerTarget).forEach(function(t){t.removeAttribute("aria-expanded")}):i.triggerTarget&&t.removeAttribute("aria-expanded"),L(),R(),S&&S(r,i),x.popperInstance&&(J(),ee().forEach(function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)})),D("onAfterUpdate",[x,n])}},setContent:function(t){x.setProps({content:t})},show:function(){var t=x.state.isVisible,n=x.state.isDestroyed,r=!x.state.isEnabled,i=erS.isTouch&&!x.props.touch,o=erc(x.props.duration,0,erC.duration);if(!(t||n||r||i)&&!C().hasAttribute("disabled")&&(D("onShow",[x],!1),!1!==x.props.onShow(x))){if(x.state.isVisible=!0,k()&&(T.style.visibility="visible"),R(),W(),x.state.isMounted||(T.style.transition="none"),k()){var a,u,s,l,f=j();erb([f.box,f.content],0)}c=function(){var t;if(!(!x.state.isVisible||m)){if(m=!0,T.offsetHeight,T.style.transition=x.props.moveTransition,k()&&x.props.animation){var n,r,i=j(),a=i.box,u=i.content;erb([a,u],o),erx([a,u],"visible")}A(),L(),erh(erB,x),null==(t=x.popperInstance)||t.forceUpdate(),D("onMount",[x]),x.props.animation&&k()&&V(o,r=function(){x.state.isShown=!0,D("onShown",[x])})}},u=x.props.appendTo,s=C(),(a=x.props.interactive&&u===ers||"parent"===u?s.parentNode:erf(u,[s])).contains(T)||a.appendChild(T),x.state.isMounted=!0,J()}},hide:function(){var t=!x.state.isVisible,n=x.state.isDestroyed,r=!x.state.isEnabled,i=erc(x.props.duration,1,erC.duration);if(!(t||n||r)&&(D("onHide",[x],!1),!1!==x.props.onHide(x))){if(x.state.isVisible=!1,x.state.isShown=!1,m=!1,d=!1,k()&&(T.style.visibility="hidden"),P(),B(),R(!0),k()){var o,a,u=j(),s=u.box,c=u.content;x.props.animation&&(erb([s,c],i),erx([s,c],"hidden"))}A(),L(),x.props.animation?k()&&(a=x.unmount,V(i,function(){!x.state.isVisible&&T.parentNode&&T.parentNode.contains(T)&&a()})):x.unmount()}},hideWithInteractivity:function(t){N().addEventListener("mousemove",y),erh(erW,y),y(t)},enable:function(){x.state.isEnabled=!0},disable:function(){x.hide(),x.state.isEnabled=!1},unmount:function(){x.state.isVisible&&x.hide(),x.state.isMounted&&(X(),ee().forEach(function(t){t._tippy.unmount()}),T.parentNode&&T.parentNode.removeChild(T),erB=erB.filter(function(t){return t!==x}),x.state.isMounted=!1,D("onHidden",[x]))},destroy:function(){x.state.isDestroyed||(x.clearDelayTimeouts(),x.unmount(),Y(),delete t._tippy,x.state.isDestroyed=!0,D("onDestroy",[x]))}};if(!f.render)return x;var M=f.render(x),T=M.popper,S=M.onUpdate;T.setAttribute("data-tippy-root",""),T.id="tippy-"+x.id,x.popper=T,t._tippy=x,T._tippy=x;var w=b.map(function(t){return t.fn(x)}),_=t.hasAttribute("aria-expanded");return K(),L(),R(),D("onCreate",[x]),f.showOnCreate&&et(),T.addEventListener("mouseenter",function(){x.props.interactive&&x.state.isVisible&&x.clearDelayTimeouts()}),T.addEventListener("mouseleave",function(){x.props.interactive&&x.props.trigger.indexOf("mouseenter")>=0&&N().addEventListener("mousemove",y)}),x;function I(){var t=x.props.touch;return Array.isArray(t)?t:[t,0]}function O(){return"hold"===I()[0]}function k(){var t;return!!(null!=(t=x.props.render)&&t.$$tippy)}function C(){return l||t}function N(){var t,n,r,i=C().parentNode;return i&&null!=(r=erp(i)[0])&&null!=(n=r.ownerDocument)&&n.body?r.ownerDocument:document}function j(){return erF(T)}function E(t){return x.state.isMounted&&!x.state.isVisible||erS.isTouch||u&&"focus"===u.type?0:erc(x.props.delay,t?0:1,erC.delay)}function R(t){void 0===t&&(t=!1),T.style.pointerEvents=x.props.interactive&&!t?"":"none",T.style.zIndex=""+x.props.zIndex}function D(t,n,r){if(void 0===r&&(r=!0),w.forEach(function(r){r[t]&&r[t].apply(r,n)}),r){var i;(i=x.props)[t].apply(i,n)}}function A(){var n=x.props.aria;if(n.content){var r="aria-"+n.content,i=T.id;erp(x.props.triggerTarget||t).forEach(function(t){var n=t.getAttribute(r);if(x.state.isVisible)t.setAttribute(r,n?n+" "+i:i);else{var o=n&&n.replace(i,"").trim();o?t.setAttribute(r,o):t.removeAttribute(r)}})}}function L(){!(_||!x.props.aria.expanded)&&erp(x.props.triggerTarget||t).forEach(function(t){x.props.interactive?t.setAttribute("aria-expanded",x.state.isVisible&&t===C()?"true":"false"):t.removeAttribute("aria-expanded")})}function P(){N().removeEventListener("mousemove",y),erW=erW.filter(function(t){return t!==y})}function F(n){if(!(erS.isTouch&&(h||"mousedown"===n.type))){var r=n.composedPath&&n.composedPath()[0]||n.target;if(!(x.props.interactive&&erT(T,r))){if(erp(x.props.triggerTarget||t).some(function(t){return erT(t,r)})){if(erS.isTouch||x.state.isVisible&&x.props.trigger.indexOf("click")>=0)return}else D("onClickOutside",[x,n]);!0===x.props.hideOnClick&&(x.clearDelayTimeouts(),x.hide(),p=!0,setTimeout(function(){p=!1}),x.state.isMounted||B())}}}function z(){h=!0}function U(){h=!1}function W(){var t=N();t.addEventListener("mousedown",F,!0),t.addEventListener("touchend",F,eru),t.addEventListener("touchstart",U,eru),t.addEventListener("touchmove",z,eru)}function B(){var t=N();t.removeEventListener("mousedown",F,!0),t.removeEventListener("touchend",F,eru),t.removeEventListener("touchstart",U,eru),t.removeEventListener("touchmove",z,eru)}function V(t,n){var r=j().box;function i(t){t.target===r&&(erM(r,"remove",i),n())}if(0===t)return n();erM(r,"remove",s),erM(r,"add",i),s=i}function $(n,r,i){void 0===i&&(i=!1),erp(x.props.triggerTarget||t).forEach(function(t){t.addEventListener(n,r,i),g.push({node:t,eventType:n,handler:r,options:i})})}function K(){var t;O()&&($("touchstart",q,{passive:!0}),$("touchend",Z,{passive:!0})),(t=x.props.trigger).split(/\s+/).filter(Boolean).forEach(function(t){if("manual"!==t)switch($(t,q),t){case"mouseenter":$("mouseleave",Z);break;case"focus":$(erk?"focusout":"blur",Q);break;case"focusin":$("focusout",Q)}})}function Y(){g.forEach(function(t){var n=t.node,r=t.eventType,i=t.handler,o=t.options;n.removeEventListener(r,i,o)}),g=[]}function q(t){var n,r=!1;if(!(!x.state.isEnabled||H(t)||p)){var i,o=(null==(n=u)?void 0:n.type)==="focus";u=t,l=t.currentTarget,L(),!x.state.isVisible&&erl(t,"MouseEvent")&&erW.forEach(function(n){return n(t)}),"click"===t.type&&(0>x.props.trigger.indexOf("mouseenter")||d)&&!1!==x.props.hideOnClick&&x.state.isVisible?r=!0:et(t),"click"===t.type&&(d=!r),r&&!o&&en(t)}}function G(t){var n,r,i,o,a=t.target,u=C().contains(a)||T.contains(a);!("mousemove"===t.type&&u)&&(n=ee().concat(T).map(function(t){var n,r=null==(n=t._tippy.popperInstance)?void 0:n.state;return r?{popperRect:t.getBoundingClientRect(),popperState:r,props:f}:null}).filter(Boolean),i=(r=t).clientX,o=r.clientY,n.every(function(t){var n,r=t.popperRect,a=t.popperState,u=t.props.interactiveBorder,s=(n=a.placement).split("-")[0],c=a.modifiersData.offset;if(!c)return!0;var l="bottom"===s?c.top.y:0,f="top"===s?c.bottom.y:0,d="right"===s?c.left.x:0,p="left"===s?c.right.x:0,h=r.top-o+l>u,m=o-r.bottom-f>u,g=r.left-i+d>u,y=i-r.right-p>u;return h||m||g||y})&&(P(),en(t)))}function Z(t){if(!(H(t)||x.props.trigger.indexOf("click")>=0&&d)){if(x.props.interactive){x.hideWithInteractivity(t);return}en(t)}}function Q(t){0>x.props.trigger.indexOf("focusin")&&t.target!==C()||x.props.interactive&&t.relatedTarget&&T.contains(t.relatedTarget)||en(t)}function H(t){return!!erS.isTouch&&O()!==t.type.indexOf("touch")>=0}function J(){X();var n=x.props,r=n.popperOptions,i=n.placement,o=n.offset,a=n.getReferenceClientRect,u=n.moveTransition,s=k()?erF(T).arrow:null,l=a?{getBoundingClientRect:a,contextElement:a.contextElement||C()}:t,f=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!u}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var n=t.state;if(k()){var r=j().box;["placement","reference-hidden","escaped"].forEach(function(t){"placement"===t?r.setAttribute("data-placement",n.placement):n.attributes.popper["data-popper-"+t]?r.setAttribute("data-"+t,""):r.removeAttribute("data-"+t)}),n.attributes.popper={}}}}];k()&&s&&f.push({name:"arrow",options:{element:s,padding:3}}),f.push.apply(f,(null==r?void 0:r.modifiers)||[]),x.popperInstance=err(l,T,Object.assign({},r,{placement:i,onFirstUpdate:c,modifiers:f}))}function X(){x.popperInstance&&(x.popperInstance.destroy(),x.popperInstance=null)}function ee(){return erm(T.querySelectorAll("[data-tippy-root]"))}function et(t){x.clearDelayTimeouts(),t&&D("onTrigger",[x,t]),W();var n=E(!0),r=I(),o=r[0],a=r[1];erS.isTouch&&"hold"===o&&a&&(n=a),n?i=setTimeout(function(){x.show()},n):x.show()}function en(t){if(x.clearDelayTimeouts(),D("onUntrigger",[x,t]),!x.state.isVisible){B();return}if(!(x.props.trigger.indexOf("mouseenter")>=0&&x.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&d)){var n=E(!1);n?o=setTimeout(function(){x.state.isVisible&&x.hide()},n):a=requestAnimationFrame(function(){x.hide()})}}}(n,u);return r&&t.push(r),t},[]);return erv(t)?s[0]:s}erV.defaultProps=erC,erV.setDefaultProps=erj,erV.currentInput=erS,Object.assign({},enx,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),erV.setDefaultProps({render:erz});class er${constructor({editor:t,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:t,state:n,from:r,to:i})=>{let{doc:o,selection:a}=n,{empty:u}=a,s=!o.textBetween(r,i).length&&ee1(n.selection),c=this.element.contains(document.activeElement);return!(!(t.hasFocus()||c)||u||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:t})=>{var n;if(this.preventHide){this.preventHide=!1;return}null!=t&&t.relatedTarget&&!(null===(n=this.element.parentNode)||void 0===n)&&n.contains(t.relatedTarget)||this.hide()},this.tippyBlurHandler=t=>{this.blurHandler({event:t})},this.handleDebouncedUpdate=(t,n)=>{let r=!(null!=n&&n.selection.eq(t.state.selection)),i=!(null!=n&&n.doc.eq(t.state.doc));(r||i)&&(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(t,r,i,n)},this.updateDelay))},this.updateHandler=(t,n,r,i)=>{var o,a,u;let{state:s,composing:c}=t,{selection:l}=s;if(c||!n&&!r)return;this.createTooltip();let{ranges:f}=l,d=Math.min(...f.map(t=>t.$from.pos)),p=Math.max(...f.map(t=>t.$to.pos));if(!(null===(o=this.shouldShow)||void 0===o?void 0:o.call(this,{editor:this.editor,view:t,state:s,oldState:i,from:d,to:p}))){this.hide();return}null===(a=this.tippy)||void 0===a||a.setProps({getReferenceClientRect:(null===(u=this.tippyOptions)||void 0===u?void 0:u.getReferenceClientRect)||(()=>{var n;if((n=s.selection)instanceof QH){let r=t.nodeDOM(d),i=r.dataset.nodeViewWrapper?r:r.querySelector("[data-node-view-wrapper]");if(i&&(r=i.firstChild),r)return r.getBoundingClientRect()}return function(t,n,r){let i=t.state.doc.content.size,o=ee2(n,0,i),a=ee2(r,0,i),u=t.coordsAtPos(o),s=t.coordsAtPos(a,-1),c=Math.min(u.top,s.top),l=Math.max(u.bottom,s.bottom),f=Math.min(u.left,s.left),d=Math.max(u.right,s.right),p={top:c,bottom:l,left:f,right:d,width:d-f,height:l-c,x:f,y:c};return{...p,toJSON:()=>p}}(t,d,p)})}),this.show()},this.editor=t,this.element=n,this.view=r,this.updateDelay=o,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=erV(t,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(t,n){let{state:r}=t,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(t,n);return}let o=!(null!=n&&n.selection.eq(t.state.selection)),a=!(null!=n&&n.doc.eq(t.state.doc));this.updateHandler(t,o,a,n)}show(){var t;null===(t=this.tippy)||void 0===t||t.show()}hide(){var t;null===(t=this.tippy)||void 0===t||t.hide()}destroy(){var t,n;!(null===(t=this.tippy)||void 0===t)&&t.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),null===(n=this.tippy)||void 0===n||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}let erK=t=>new Q7({key:"string"==typeof t.pluginKey?new Hn(t.pluginKey):t.pluginKey,view:n=>new er$({view:n,...t})});eeR.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[erK({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});let erY=t=>{let[n,r]=(0,o.useState)(null);return(0,o.useEffect)(()=>{if(!n||t.editor.isDestroyed)return;let{pluginKey:r="bubbleMenu",editor:i,tippyOptions:o={},updateDelay:a,shouldShow:u=null}=t,s=erK({updateDelay:a,editor:i,element:n,pluginKey:r,shouldShow:u,tippyOptions:o});return i.registerPlugin(s),()=>i.unregisterPlugin(r)},[t.editor,n]),o.createElement("div",{ref:r,className:t.className,style:{visibility:"hidden"}},t.children)};class erq extends et9{constructor(){super(...arguments),this.contentComponent=null}}let erG=({renderers:t})=>o.createElement(o.Fragment,null,Object.entries(t).map(([t,n])=>v.createPortal(n.reactElement,n.element,t)));class erZ extends o.Component{constructor(t){super(t),this.editorContentRef=o.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let{editor:t}=this.props;if(t&&t.options.element){if(t.contentComponent)return;let n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=this,t.createNodeViews(),this.initialized=!0}}maybeFlushSync(t){this.initialized?(0,v.flushSync)(t):t()}setRenderer(t,n){this.maybeFlushSync(()=>{this.setState(({renderers:r})=>({renderers:{...r,[t]:n}}))})}removeRenderer(t){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>{let r={...n};return delete r[t],{renderers:r}})})}componentWillUnmount(){let{editor:t}=this.props;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild))return;let n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){let{editor:t,...n}=this.props;return o.createElement(o.Fragment,null,o.createElement("div",{ref:this.editorContentRef,...n}),o.createElement(erG,{renderers:this.state.renderers}))}}let erQ=o.memo(erZ),erH=(0,o.createContext)({onDragStart:void 0}),erJ=()=>(0,o.useContext)(erH),erX=o.forwardRef((t,n)=>{let{onDragStart:r}=erJ(),i=t.as||"div";return o.createElement(i,{...t,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})});class er0{constructor(t,{editor:n,props:r={},as:i="div",className:o="",attrs:a}){this.ref=null,this.id=Math.floor(4294967295*Math.random()).toString(),this.component=t,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),a&&Object.keys(a).forEach(t=>{this.element.setAttribute(t,a[t])}),this.render()}render(){var t,n,r,i,a;let u=this.component,s=this.props;("function"==typeof u&&u.prototype&&u.prototype.isReactComponent||"object"==typeof u&&(null===(a=u.$$typeof)||void 0===a?void 0:a.toString())==="Symbol(react.forward_ref)")&&(s.ref=t=>{this.ref=t}),this.reactElement=o.createElement(u,{...s}),null===(n=null===(t=this.editor)||void 0===t?void 0:t.contentComponent)||void 0===n||n.setRenderer(this.id,this)}updateProps(t={}){this.props={...this.props,...t},this.render()}destroy(){var t,n;null===(n=null===(t=this.editor)||void 0===t?void 0:t.contentComponent)||void 0===n||n.removeRenderer(this.id)}}class er1 extends enn{mount(){let t={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(t={})=>this.updateAttributes(t),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){var n;this.component.displayName=(n=this.extension.name).charAt(0).toUpperCase()+n.substring(1)}let r=t=>{let n=this.component,r=this.onDragStart.bind(this),i=t=>{t&&this.contentDOMElement&&t.firstChild!==this.contentDOMElement&&t.appendChild(this.contentDOMElement)};return o.createElement(o.Fragment,null,o.createElement(erH.Provider,{value:{onDragStart:r,nodeViewContentRef:i}},o.createElement(n,{...t})))};r.displayName="ReactNodeView",this.contentDOMElement=this.node.isLeaf?null:document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let i=this.node.isInline?"span":"div";this.options.as&&(i=this.options.as);let{className:a=""}=this.options;this.renderer=new er0(r,{editor:this.editor,props:t,as:i,className:`node-${this.node.type.name} ${a}`.trim(),attrs:this.options.attrs})}get dom(){var t;if(this.renderer.element.firstElementChild&&!(!(null===(t=this.renderer.element.firstElementChild)||void 0===t)&&t.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(t,n){let r=t=>{this.renderer.updateProps(t)};if(t.type!==this.node.type)return!1;if("function"==typeof this.options.update){let i=this.node,o=this.decorations;return this.node=t,this.decorations=n,this.options.update({oldNode:i,oldDecorations:o,newNode:t,newDecorations:n,updateProps:()=>r({node:t,decorations:n})})}return t===this.node&&this.decorations===n||(this.node=t,this.decorations=n,r({node:t,decorations:n})),!0}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy(),this.contentDOMElement=null}}function er2(t,n){return r=>r.editor.contentComponent?new er1(t,r,n):{}}function er4(t){return setTimeout(()=>{t()})}function er3(t){let{debouncedUrl:n,content:r,onContentChange:i,selected:a}=t,c=(0,o.useRef)(null),[l,f]=(0,o.useState)(!1);return(0,s.pQ)(n,()=>{var t;l&&(f(!1),null==(t=c.current)||t.reset())}),(0,p.ju)(n)?n===(null==r?void 0:r.embed_url)?k.jsx(er9,{content:r,selected:a}):k.jsx(u.SV,{ref:c,renderError:er5,onError:function(){f(!0),i(void 0)},children:k.jsx(o.Suspense,{fallback:r&&k.jsx(er9,{content:r,selected:a}),children:k.jsx(er8,{url:n,selected:a,onContentChange:i})})}):null}function er5(){return k.jsx(u.yO,{title:"There is no embed data available."})}function er9(t){let{content:n,selected:r}=t;return k.jsx(u.fu,{...function(t){let n="";switch(t.type){case"video":n=t.title??"";break;case"photo":n="View this post"+(t.provider_name?` on ${t.provider_name}`:"");break;default:n="Open"+(t.provider_name?` on ${t.provider_name}`:"")}return{url:t.embed_url,thumbnail:{url:t.thumbnail_url??"",aspectRatio:"video"===t.type?"16:9":"1:1"},provider:t.provider_name??"",author:t.author_name??"",subtitle:n}}(n),selected:r})}function er8(t){let{url:n,onContentChange:r,selected:i}=t,a=function(t){let{url:n,onContentChange:r}=t,{embedsUrl:i}=tO(),a=(0,d.QT)(er6,[n,i]),u=(0,s.R9)(r);return(0,o.useEffect)(()=>{let t=er4(()=>u(a));return()=>{clearTimeout(t)}},[a,u]),a}({url:n,onContentChange:r});return k.jsx(er9,{content:a,selected:i})}function er6(t,n){var r;let i=new URL(n);return i.search=new URLSearchParams({url:t}).toString(),(0,f.WY)(i.toString(),{okType:(r=t,t_.object({type:t_.string(),version:t_.string().or(t_.number()).nullish(),title:t_.string().nullish(),author_name:t_.string().nullish(),author_url:t_.string().nullish(),provider_name:t_.string().nullish(),provider_url:t_.string().nullish(),cache_age:t_.string().or(t_.number()).nullish(),thumbnail_url:t_.string().nullish(),thumbnail_width:t_.number().nullish(),thumbnail_height:t_.number().nullish(),html:t_.string().nullish()}).passthrough().transform(t=>{let n={embed_url:r};return{...n,__TYPE__:"EmbedContent",type:t.type,version:t.version,title:t.title,author_name:t.author_name,author_url:t.author_url,provider_name:t.provider_name,provider_url:t.provider_url,cache_age:t.cache_age,thumbnail_url:t.thumbnail_url,thumbnail_width:t.thumbnail_width,thumbnail_height:t.thumbnail_height,html:t.html,all:{...n,...t}}}))})}function er7(t){let{id:n,readOnly:r,field:i,content:a,onContentChange:c}=t,l=(0,s.$P)({initialState:(null==a?void 0:a.embed_url)??"",startTransition:o.startTransition});function f(t){l.set(t),(0,p.ju)(t)||c(void 0)}return k.jsxs(u.gN,{footer:(0,p.ju)(l.value)&&k.jsx(u.mS,{children:k.jsx(er3,{debouncedUrl:l.debouncedValue,content:a,onContentChange:c})}),children:[k.jsx(u.fw,{name:"cloud"}),k.jsx(u.Qy,{htmlFor:n,children:Zf(i)}),k.jsx(u.JO,{children:k.jsx(u.oi,{id:n,readOnly:r,placeholder:Zd(i),value:l.value,onValueChange:f,variant:(0,p.ju)(l.value)?"link":"normal",endAdornment:k.jsx(u.zx,{startIcon:"close",color:"grey",size:"small",disabled:!l,onClick:()=>f("")})})})]})}function eie(t){return!(t.lat>85||t.lat<-85||t.lng>180||t.lng<-180)}function eit(t){let n=t.match(/^.*@(-?\d+.\d+),(-?\d+.\d+).*$/);if(!n)return;let r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return;let o={lat:r,lng:i};if(eie(o))return o}function ein(t){return t?`${t.lat}, ${t.lng}`:""}function eir(t){let n=t.match(/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/);if(!n)return eit(t);let r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return eit(t);let o={lat:r,lng:i};return eie(o)?o:eit(t)}function eii(t){let{field:n,id:r,readOnly:i,...a}=t,{onValueChange:s,displayedValue:c,onBlur:l,clearValue:f,isValidCoordinates:d}=function(t){let{content:n,onContentChange:r}=t,i=ein(null==n?void 0:n.position),[a,u]=(0,o.useState)(i),s=Boolean(eir(a));return{displayedValue:a,isValidCoordinates:s,onValueChange:u,onBlur:function(){let t=eir(a);if(!t)return u(""),r(void 0);let{lat:n,lng:i}=t;u(ein({lat:n,lng:i})),r({__TYPE__:"GeoPointContent",position:{lat:n,lng:i}})},clearValue:function(){u(""),r(void 0)}}}(a);return k.jsxs(u.gN,{children:[k.jsx(u.fw,{name:"place"}),k.jsx(u.Qy,{htmlFor:r,children:Zf(n)}),k.jsx(u.JO,{children:k.jsx(u.oi,{id:r,onValueChange:s,placeholder:"...",readOnly:i,value:c,onBlur:l,variant:d?"link":"normal",endAdornment:k.jsx(u.zx,{startIcon:"close",color:"grey",size:"small",disabled:!c,onClick:f})})})]})}function eio(t){let{open:n,onOpenChange:r}=t,[i,a]=(0,o.useState)("media");return k.jsxs(u.Vq,{open:n,onOpenChange:r,size:{width:1216,height:868},children:[k.jsx(u.fK,{icon:"image",title:"Add a media"}),k.jsxs(u.Zp,{value:i,onValueChange:function(t){if("media"!==t&&"unsplash"!==t)throw Error(`Invalid option ${t}.`);a(t)},padding:"small",width:"auto",children:[k.jsx(u.T9,{value:"media",icon:"photo"}),k.jsx(u.T9,{value:"unsplash",icon:"unsplash"})]}),k.jsx(u.cZ,{children:k.jsxs(u.xu,{overflow:"hidden",backgroundColor:"grey3",padding:{top:16,right:16,left:16},minHeight:"100%",children:["media"===i&&k.jsx(tW,{}),"unsplash"===i&&k.jsx(u.xu,{children:"Unsplash Library"})]})}),k.jsx(u.kX,{asFooter:!0,ok:{text:"Add to page",onClick(){},disabled:!1},cancel:{text:"Cancel"}})]})}function eia(){return new URL(location.href).searchParams.has("mediaLib")}let eiu="__MAIN_THUMBNAIL__";function eis(t,n,r){let i=t.name===eiu?void 0:t.name,o;return[i,(o=n?(0,l.$)(r)?[r.width,r.height]:(0,l.$)(t.width)||(0,l.$)(t.height)?[t.width??void 0,t.height??void 0]:[n.origin.width,n.origin.height]:void 0)?`${o[0]??"auto"}x${o[1]??"auto"}px`:void 0]}function eic(t,n){let{width:r,height:i}=n??{};return r&&i?[r,i]:r?[r,Math.round(t.height*(r/t.width))]:i?[Math.round(t.width*(i/t.height)),i]:[t.width,t.height]}function eil(t,n,r,i,o){let a=new URL(t);if(o){let{x:u,y:s,width:c,height:l}=n;a.searchParams.set("rect",[u,s,c,l].join(",")),a.searchParams.set("w",r.toString()),a.searchParams.set("h",i.toString())}return a.toString()}function eif(t){let n=new URL(t);return n.searchParams.delete("q"),n.searchParams.set("w","800"),n.searchParams.set("h","800"),n.searchParams.set("auto","compress,format"),n.searchParams.set("fit","max"),n.toString()}function eid(t){let n=new URL(t);return n.searchParams.delete("q"),n.searchParams.delete("fm"),n.searchParams.set("w","300"),n.searchParams.set("auto","compress,format"),n.toString()}function eip(t){return null!=t&&t.url?eif(t.url):void 0}function eih(t){let{onFilesSelected:n,assetType:r}=t,[i,a]=(0,o.useTransition)(),c=(0,s.$P)({initialState:i,ms:100});return k.jsx(u.SV,{renderError:eix,children:k.jsx(o.Suspense,{children:k.jsxs(u.Zz,{onFilesSelected:n,overlay:k.jsx(eiy,{}),assetType:r,children:[k.jsx(eim,{...t,startTransition:a,assetType:r}),k.jsx(u.xu,{position:"relative",width:"100%",justifyContent:"center",children:k.jsx(u.FN,{anchor:k.jsx(u.xu,{position:"fixed",bottom:72}),loadingIndicator:!0,open:c.debouncedValue,title:"Loading media ...",seconds:1})})]})})})}function eim(t){let{uploadingFiles:n,isUploading:r,onFilesSelected:i,onMediaSelected:a,startTransition:c,onRetry:l,assetType:f}=t,{media:d,limit:p,onHasReachedBottom:h,response:m,updateMedia:g}=tR({assetType:f});return(0,s.pQ)(n,()=>{if(r)return;let t=n.flatMap(t=>"success"!==t.status?[]:d.find(n=>n.id===t.id)?[]:[t.response]);t.length>0&&g(t)}),0===d.length?k.jsx(eig,{onFilesSelected:i}):k.jsxs(eiv,{onScrollToBottom:function(){m.total===p&&c(h)},children:[k.jsx(u.Fp,{enterDuration:400,exitDuration:400,children:n.length?k.jsx(u.xu,{flexDirection:"column",gap:6,children:n.map((t,n)=>k.jsx(u.tK,{file:t.file,status:t.status,onRetry:0!==n||r?void 0:l},t.id))},n.length):null}),k.jsx(u.Rk,{items:d,getItemInfo:eib,children:t=>k.jsxs(o.Suspense,{fallback:k.jsx(u.Od,{width:"100%",height:"100%"}),children:["image"===t.kind&&k.jsx(u.P0,{url:eid(t.url),onClick:()=>a({...t,width:t.width??2e3,height:t.height??2e3})}),"all"===t.kind&&k.jsx(u.Ti,{extension:t.extension,filename:t.filename,onClick:()=>a(t)})]})})]})}function eig(t){let{onFilesSelected:n}=t;return k.jsx(u.xu,{justifyContent:"center",flexDirection:"column",height:"100%",padding:24,children:k.jsx(u.xu,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:"grey2",borderRadius:4,padding:{inline:80},children:k.jsxs(u.R$,{children:[k.jsx(u.av,{name:"cloudUpload",lineColor:"purple10",backgroundColor:"purple3"}),k.jsx(u._T,{size:"big",children:"Drop files here or"}),k.jsx(u.nf,{children:k.jsxs(u.xv,{color:"grey11",align:"center",variant:"normal",children:["Explore our documentation to find out the"," ",k.jsx(u.hh,{underline:!0,color:"grey11",href:" https://prismic.io/docs/guides/manage-images#maximum-file-size",children:"maximum size"})," ","and"," ",k.jsx(u.hh,{underline:!0,color:"grey11",href:" https://prismic.io/docs/guides/manage-images#supported-media",children:"supported image formats"})," ","for uploads in the media library."]})}),k.jsx(u.Qj,{children:k.jsx(u.ZD,{title:"Upload Media",onFilesSelected:n})})]})})})}function eiy(){return k.jsx(u.xu,{justifyContent:"center",flexDirection:"column",height:"100%",children:k.jsxs(u.R$,{children:[k.jsx(u.av,{name:"cloudUpload",lineColor:"purple10",backgroundColor:"purple3"}),k.jsx(u._T,{size:"big",children:"Drop files here"}),k.jsx(u.nf,{children:"Drop your files to upload them instantly to your media library"})]})})}function eiv(t){let{children:n,onScrollToBottom:r}=t;return k.jsx(u.xr,{style:{height:"100%",paddingInline:u.TV.space[24],paddingBlock:u.TV.space[16],gap:u.TV.space[16]},onScrollToBottom:r,children:n})}function eib(t){return"pdf"===t.extension?{key:t.id,aspectRatio:193/154}:{key:t.id,aspectRatio:(t.width??2e3)/(t.height??2e3)}}function eix(){return k.jsx(u.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:k.jsx(u.Iq,{title:"Request failed",description:"An error occurred while searching for your image.",errorImageSrc:u.Os})})}let eiM,eiT=new Uint8Array(16);function eiS(){if(!eiM&&!(eiM="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return eiM(eiT)}let eiw=[];for(let ei_=0;ei_<256;++ei_)eiw.push((ei_+256).toString(16).slice(1));let eiI="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),eiO={randomUUID:eiI},eik=tn({id:eJ(),width:eX(),height:eX(),urls:tn({full:eJ(),small:eJ().transform(eid)}),alt_description:eJ().optional()}),eiC=tn({results:tt(eik)}).transform(t=>t.results);function eiN(t,n){let r=new URLSearchParams({page:"1",per_page:"30",query:n});return(0,f.WY)(`${t}/search/photos?${r.toString()}`,{okType:eiC})}d.Fs.registerFetcherConfig(eiN,{cacheCapacity:5,revalidationStrategy:{type:"never"}});let eij=t=>{let{onMediaSelected:n}=t,[r,i]=(0,o.useTransition)(),a=(0,s.$P)({initialState:"",ms:200,startTransition:i});return k.jsxs(k.Fragment,{children:[k.jsx(u.xu,{padding:{inline:24,top:16},flexDirection:"column",children:k.jsx(u.Mj,{value:a.value,placeholder:"Search on Unsplash.com",onValueChange:a.set})}),k.jsx(eiR,{children:k.jsx(u.SV,{renderError:eiA,children:k.jsx(o.Suspense,{fallback:k.jsx(u.DW,{}),children:k.jsx(eiE,{term:a.debouncedValue,isUpdating:r,onMediaSelected:n})})})})]})},eiE=t=>{var n,r,i;let{term:o,isUpdating:a,onMediaSelected:s}=t,c=tO(),l=(n=c.unsplashUrl,(0,d.QT)(eiN,[n,o||"fruit"])),f=(i=a,{opacity:i?.4:1,transitionProperty:i?"opacity":"none",transitionDuration:u.TV.transitionDuration[300],transitionTimingFunction:u.TV.transitionTimingFunction.easeInOut});return l.length?k.jsx(u.Rk,{items:l,getItemInfo:eiD,style:f,children:t=>k.jsx(u.P0,{url:t.urls.small,onClick:()=>s({id:t.id,url:t.urls.full,width:t.width,height:t.height,alt:t.alt_description})})}):k.jsxs(u.R$,{style:{marginTop:"auto",marginBottom:"auto",...f},children:[k.jsx(u.u2,{children:k.jsx("img",{src:u.Os,alt:"No results"})}),k.jsx(u._T,{size:"big",children:"Oh no ..."}),k.jsx(u.nf,{children:"The search returned no result."})]})},eiR=({children:t})=>k.jsx(u.xr,{style:{height:"100%",paddingInline:u.TV.space[24],paddingTop:u.TV.space[4]},children:t});function eiD(t){return{key:t.id,aspectRatio:t.width/t.height}}function eiA(){return k.jsx(u.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:k.jsx(u.Iq,{title:"Request failed",description:"An error occurred while searching for your image.",errorImageSrc:u.Os})})}function eiL(t){let{onMediaSelected:n,assetType:r="all",open:i,onOpenChange:a}=t,s=tO(),[c,l]=(0,o.useState)(s.mediaLibrary?"media":"unsplash"),{uploadingFiles:d,isUploading:p,onFilesSelected:h,onRetry:m}=function(t){let[n,r]=(0,o.useState)([]),i=n.some(t=>"idle"===t.status||"uploading"===t.status),a=tO();return(0,o.useEffect)(function(){if(!n.length||n.some(t=>"uploading"===t.status)||n.every(t=>"error"===t.status)||!a.mediaLibrary)return;let t=n.find(t=>"idle"===t.status);if(!t){setTimeout(()=>{r(t=>t.filter(t=>"error"===t.status))},1e3);return}let{assetsUrl:i,repository:o,env:u}=a;r(n=>n.map(n=>n.id===t.id?{...n,status:"uploading"}:n)),(function(t){let{file:n,url:r,repository:i,env:o}=t,a=new FormData;return a.append(n.name,n),(0,f.WY)(r,{headers:{repository:i,"Content-Type":"multipart/form-data"},method:"POST",body:a,credentials:(0,f.xb)(o),okType:tN})})({file:t.file,url:i,repository:o,env:u}).then(n=>{r(r=>r.map(r=>r.id===t.id?{...r,status:"success",response:n}:r))}).catch(()=>{r(n=>n.map(n=>n.id===t.id?{...n,status:"error"}:n))})},[a,n]),!t&&n.length&&r([]),{uploadingFiles:n,isUploading:i,onFilesSelected:function(t){r(t.map(t=>({id:function(t,n,r){if(eiO.randomUUID&&!n&&!t)return eiO.randomUUID();t=t||{};let i=t.random||(t.rng||eiS)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,n){r=r||0;for(let o=0;o<16;++o)n[r+o]=i[o];return n}return function(t,n=0){return(eiw[t[n+0]]+eiw[t[n+1]]+eiw[t[n+2]]+eiw[t[n+3]]+"-"+eiw[t[n+4]]+eiw[t[n+5]]+"-"+eiw[t[n+6]]+eiw[t[n+7]]+"-"+eiw[t[n+8]]+eiw[t[n+9]]+"-"+eiw[t[n+10]]+eiw[t[n+11]]+eiw[t[n+12]]+eiw[t[n+13]]+eiw[t[n+14]]+eiw[t[n+15]]).toLowerCase()}(i)}(),file:t,status:"idle"})))},onRetry:function(){r(t=>t.map(t=>"error"===t.status?{...t,status:"idle"}:t))}}}(i),g=t=>{if("media"!==t&&"unsplash"!==t)throw Error(`Invalid option ${t}.`);l(t)};return k.jsxs(u.Vq,{open:i,onOpenChange:a,children:[k.jsx(u.fK,{icon:"folder",title:"Add an image"}),k.jsxs(u.Zp,{value:c,onValueChange:g,children:[s.mediaLibrary&&k.jsx(u.T9,{value:"media",title:"Media library",subtitle:"From Prismic",icon:"photo"}),k.jsx(u.T9,{value:"unsplash",title:"Unsplash",subtitle:"Source of free images",icon:"unsplash"}),s.mediaLibrary&&k.jsx(u.xu,{flexDirection:"column",justifyContent:"end",flexGrow:1,animation:{name:"fadeIn"},children:k.jsx(u.ZD,{startIcon:"cloudUpload",title:"Upload media",disabled:p,onFilesSelected:h,assetType:r})})]}),k.jsx(u.cZ,{children:k.jsx(eiP,{option:c,uploadingFiles:d,isUploading:p,onFilesSelected:h,onRetry:m,onMediaSelected(t){a(!1),null==n||n(t)},assetType:r})})]})}function eiP(t){let{option:n,onMediaSelected:r,assetType:i,...o}=t,a=tO();switch(n){case"media":return a.mediaLibrary?k.jsx(eih,{onMediaSelected:r,assetType:i,...o}):null;case"unsplash":return k.jsx(eij,{onMediaSelected:r})}}function eiF(t){let{onMediaSelected:n,readOnly:r,isUpdating:i}=t,[a,s]=(0,o.useState)(!1),c=eia();return k.jsxs(u.aY,{children:[k.jsx(u.Zb,{color:"grey3",variant:"outlined",radius:4,children:k.jsx(u.aY,{children:k.jsx(u.xu,{padding:{block:48},flexDirection:"column",children:k.jsxs(u.R$,{children:[k.jsx(u.av,{name:"cloudUpload"}),k.jsx(u._T,{children:i?"Preparing your image...":"You haven't selected an image"}),!r&&k.jsx(u.Qj,{children:k.jsx(u.zx,{disabled:i,onClick:()=>s(!0),children:"Select image"})})]})})})}),c?k.jsx(eio,{open:a,onOpenChange:s}):k.jsx(eiL,{open:a,onOpenChange:s,onMediaSelected:n,assetType:"image"})]})}function eiz(t){let{id:n,readOnly:r,altText:i,onValueChange:o,selected:a}=t;return k.jsxs(u.gN,{labelPosition:"side",selected:a,children:[k.jsx(u.Qy,{htmlFor:n,children:"Alt text"}),k.jsx(u.JO,{children:k.jsx(u.oi,{id:n,onValueChange:o,placeholder:"Short description for the visually impaired",readOnly:r,value:i})})]})}let eiU=({contentView:t,constraints:n,croppedImage:r})=>{let[i,o]=eic(t.origin,n),a=eil(t.origin.url,r,i,o,!0);return{...t,width:i,height:o,url:a,edit:{...t.edit,zoom:r.zoom,crop:{x:r.x,y:r.y}}}},eiW=({field:t,content:n,thumbnail:r,croppedImage:i})=>{var o,a,u,s;if(r===eiu){let c=eiU({contentView:n,constraints:null==(o=null==t?void 0:t.config)?void 0:o.constraint,croppedImage:i});return c.url===n.url?n:{...n,...c}}let l=null==(u=null==(a=null==t?void 0:t.config)?void 0:a.thumbnails)?void 0:u.find(t=>t.name===r),f=null==(s=n.thumbnails)?void 0:s[r];if(!l||!f)return n;let d=eiU({contentView:f,constraints:l,croppedImage:i});return d.url===f.url?n:{...n,thumbnails:{...n.thumbnails,[r]:d}}},eiB=({initialSize:t,constraints:n})=>{let r=null!=n&&n.width&&null!=n&&n.height?n.width/n.height:t.width/t.height,[i,o]=t.width<t.height?[t.width,Math.round(t.width/r)]:[Math.round(t.height*r),t.height],a=Math.max(i/t.width,o/t.height,1);return{width:Math.round(i/a),height:Math.round(o/a)}},eiV=({contentView:t,constraints:n})=>{let r=eiB({initialSize:t.origin,constraints:n}),i=t.edit.zoom??1,o=Math.round(r.width/i),a=Math.round(r.height/i);return{...t.edit.crop,width:o,height:a,zoom:i}},ei$={x:0,y:0,width:0,height:0,zoom:1},eiK=({selectedImage:{thumbnail:t,contentView:n}})=>t.width&&t.height?t.width/t.height:n?n.origin.width/n.origin.height:1,eiY=({trigger:t,initialImages:n,initialOption:r,onClose:i})=>{var a;let[s,c]=(0,o.useState)({}),[l,f]=(0,o.useState)({}),[d,p]=(0,o.useState)(!1),[h,m]=(0,o.useState)(!1),[g,y]=(0,o.useState)(r),v=n[g],b=t=>{if(!v)return;let n=v.thumbnail.name,r=s[n]??ei$;c({...s,[n]:{...r,zoom:t}})},x=t=>{if(!v)return;let n=v.thumbnail.name,r=s[n]??ei$;c({...s,[n]:{...r,...t}})},M=t=>{if(!v)return;let n=v.thumbnail.name,r=l[n];f({...l,[n]:{...r,crop:t}})},T=t=>{if(!v)return;let n=v.thumbnail.name,r=l[n]??{};f({...l,[n]:{...r,aspectRatio:t}})},S=s[(null==v?void 0:v.thumbnail.name)??""],w=d?S??((null==v?void 0:v.contentView)&&eiV({contentView:v.contentView,constraints:v.thumbnail})):void 0,_=l[(null==v?void 0:v.thumbnail.name)??""];return k.jsxs(u.Vq,{trigger:t,onAnimationEnd:()=>m(!0),open:d,onOpenChange(t){t?(y(r),c({}),f({})):(m(!1),i({option:g,croppedImages:s})),p(t)},children:[k.jsx(u.fK,{icon:"photo",title:"Image editor"}),k.jsx(u.Zp,{value:String(g),onValueChange:t=>y(Number(t)),children:n.map((t,n)=>k.jsx(u.T9,{value:String(n),icon:"photo",title:t.labels[0]??"Main",subtitle:t.labels[1]??""},t.thumbnail.name))}),v&&k.jsx(u.cZ,{children:h&&k.jsx(u.tP,{image:(null==(a=v.contentView)?void 0:a.origin.url)??"",crop:(null==_?void 0:_.crop)??{x:0,y:0},onCropChange:M,zoom:(null==S?void 0:S.zoom)??1,onZoomChange:b,aspectRatio:eiK({selectedImage:v,cropper:_}),onAspectRatioChange:T,initialCroppedArea:w,onCropAreaChange:x},v.thumbnail.name)})]})};function eiq(t){var n,r;let{content:i,selected:a,fieldLabel:s,readOnly:c,imageLabel:l,onMediaSelected:f,initialImages:d,initialOption:p=0,onCropperDialogClose:h,onClear:m,children:g}=t,[y,v]=(0,o.useState)(!1),b=eia(),x=(null==(r=null==(n=null==i?void 0:i.url)?void 0:n.split("?")[0])?void 0:r.slice(-4))===".svg",M=null!=i&&i.url&&!c?"visible":"hidden";return k.jsxs(u.Zb,{color:a?"indigo2":"grey2",variant:a?"selected":"dashed",radius:4,children:[k.jsxs(u.Ol,{children:[k.jsxs(u.wP,{children:[s,0!==l.length&&k.jsx(u.xv,{color:"grey11",noSelect:!0,children:` • ${l.join(" • ")}`})]}),k.jsxs(u.Pf,{sx:{visibility:M},children:[k.jsx(eiY,{trigger:k.jsx(u.zx,{startIcon:"crop",disabled:x,children:"Crop & Resize"}),initialImages:d,initialOption:p,onClose:h}),k.jsx(u.zx,{startIcon:"imageSearch",onClick:()=>v(!0),children:"Replace"}),k.jsx(u.zx,{onClick:m,startIcon:"delete",children:"Clear"})]})]}),g,b?k.jsx(eio,{open:y,onOpenChange:v}):k.jsx(eiL,{open:y,onOpenChange:v,onMediaSelected:f,assetType:"image"})]})}function eiG(t,n){let{width:r,height:i,rect:o}=function(t,n){let[r,i]=eic(t,n),o=Math.max(r/t.width,i/t.height),a=Math.round((t.width-r/o)/2),u=Math.round((t.height-i/o)/2);return{width:r,height:i,rect:{x:a,y:u,width:Math.round(r/o),height:Math.round(i/o)}}}({...t,width:(null==t?void 0:t.width)??2e3,height:(null==t?void 0:t.height)??2e3},n),a=Boolean((null==n?void 0:n.width)||(null==n?void 0:n.height));return{url:eil(t.url,o,r,i,a),alt:t.alt,origin:{id:t.id,url:t.url,width:t.width??2e3,height:t.height??2e3},width:r,height:i,edit:{background:"transparent",zoom:1,crop:{x:o.x,y:o.y}}}}function eiZ(t){let{content:n,field:r,id:i,onContentChange:u,readOnly:s}=t,c=n&&n.origin.url.length>0,{onCropperDialogClose:f,onPageChange:d,onMediaSelected:p,isUpdating:h,page:m,thumbnail:g,allThumbnails:y,allContentViews:v,contentView:b,onClear:x}=function(t){var n;let{content:r,onContentChange:i,field:u}=t,[s,c]=(0,o.useState)(0),[l,f]=(0,o.useTransition)(),d=(n=u,(0,o.useMemo)(()=>{var t,r,i;return[{...null==(r=n.config)?void 0:r.constraint,name:eiu}].concat((null==(i=n.config)?void 0:i.thumbnails)??[])},[n])),p=d[s],h=r?function(t,n){var r,i;let{__TYPE__:o,thumbnails:a,...u}=n,s=null==(i=null==(r=t.config)?void 0:r.thumbnails)?void 0:i.map(({name:t})=>null==a?void 0:a[t]);return[u,...s??[]]}(u,r):void 0,m=null==h?void 0:h[s];return{onCropperDialogClose:function({option:t,croppedImages:n}){if(c(t),!r)return;let o=Object.entries(n).reduce((t,[n,r])=>eiW({field:u,content:t,thumbnail:n,croppedImage:r}),r);o!==r&&f(()=>i(o))},onPageChange:function(t){f(()=>c(t))},onMediaSelected:function(t){if(!p)return;let n=function(t,n,r,i){var o,u,s,c,l,f;if(!r){let d=null==(o=n.config)?void 0:o.thumbnails,p=d&&Object.fromEntries(d.map(t=>[t.name,eiG(i,t)]));return{__TYPE__:"ImageContent",...eiG(i,null==(u=n.config)?void 0:u.constraint),thumbnails:p}}if(t===eiu){let h=eiG(i,null==(s=n.config)?void 0:s.constraint);return h.url===r.url?r:{...r,...h}}let m=null==(l=null==(c=n.config)?void 0:c.thumbnails)?void 0:l.find(n=>n.name===t);if(!m)return r;let g=null==(f=r.thumbnails)?void 0:f[t],y=eiG(i,m);return y.url===(null==g?void 0:g.url)?r:{...r,thumbnails:(0,a.Q8)(r.thumbnails??{},(n,r)=>r===t?y:n)}}(p.name,u,r,t);n!==r&&f(()=>i(n))},isUpdating:l,page:s,thumbnail:p,allThumbnails:d,allContentViews:h,contentView:m,onClear:function(){null==c||c(0),i(void 0)}}}({field:r,content:n,onContentChange:u}),M=Zf(r),T=y.map((t,r)=>{let i=null==v?void 0:v[r];return{thumbnail:t,contentView:i,labels:eis(t,n,i)}}),S=g&&c?eis(g,n,b).filter(l.$):[];return k.jsx(eiq,{content:n,fieldLabel:M,imageLabel:S,initialOption:m,initialImages:T,readOnly:s,onMediaSelected:p,onCropperDialogClose:f,onClear:x,children:k.jsx(o.Suspense,{fallback:k.jsx("div",{style:{height:466}}),children:g&&n&&c&&v?k.jsx(eiQ,{allContentViews:v,content:n,contentView:b,id:i,onContentChange:u,onPageChange:d,page:m,readOnly:s,thumbnailName:g.name,isUpdating:h}):k.jsx(eiF,{onMediaSelected:p,readOnly:s,isUpdating:h})})})}function eiQ(t){let{allContentViews:n,content:r,contentView:i,id:o,onContentChange:a,onPageChange:s,page:c,readOnly:l,thumbnailName:f,isUpdating:d}=t;return k.jsxs(u.aY,{children:[k.jsx(u.lr,{getItemSource:eip,items:n,onPageChange:s,page:c,style:{height:400},children:t=>(null==t?void 0:t.url)&&k.jsx(u.d$,{src:eif(t.url),alt:t.alt??void 0,isUpdating:d},`${f}_${t.url}`)}),k.jsx(eiz,{id:o,readOnly:l||!i,altText:(null==i?void 0:i.alt)??"",onValueChange(t){i&&a(function(t,n,r,i){let o=0===i.length?void 0:i;return t===eiu?{...n,alt:o}:{...n,thumbnails:{...n.thumbnails,[t]:{...r,alt:o}}}}(f,r,i,t))}})]})}function eiH(t){let{content:n,field:r,id:i,onContentChange:o,readOnly:a}=t;return k.jsxs(u.gN,{children:[k.jsx(u.fw,{name:"notes"}),k.jsx(u.Qy,{htmlFor:i,children:Zf(r)}),k.jsx(u.JO,{children:k.jsx(u.Kx,{id:i,placeholder:Zd(r),readOnly:a,value:(null==n?void 0:n.value)??"",onChange(t){var n;o((n=t,0===n.length?void 0:{__TYPE__:"FieldContent",type:"Text",value:n}))}})})]})}function eiJ(t,n,r,i){return(0,g.W7)(t,r,i,30,n)}function eiX(){let t=tO();t.searchDocuments||tC("searchDocuments");let{coreApiUrl:n,env:r}=t,i=`${n}/repository`,o=(0,d.QT)(g.Ag,[i,r]);return new Set(o.languages.map(t=>({id:t.id,label:t.name})))}function ei0(){let t=tO();t.searchDocuments||tC("searchDocuments");let{coreApiUrl:n,env:r}=t,i=`${n}/repository`,o=(0,d.QT)(g.Mi,[i,r]);return new Set(o.results.map(t=>({id:t,label:t})))}function ei1(){let t=tO();t.searchDocuments||tC("searchDocuments");let{customTypesApiUrl:n,env:r,repository:i}=t,o=(0,d.QT)(g.JY,[n,i,r]);return new Set(o)}function ei2(t){return t?(0,y.UI)(t,t=>({id:t,label:t})):new Set}function ei4(t){let{filteredLocales:n,setFilteredLocales:r,filteredTags:i,setFilteredTags:a,filteredCustomTypes:s,setFilteredCustomTypes:c,fixedTags:l,fixedCustomTypes:f}=t;return k.jsxs(k.Fragment,{children:[k.jsx(u.SV,{children:k.jsx(o.Suspense,{fallback:k.jsx(ei3,{selectedValues:n,onSelectedValuesChange:r,label:"Locale",icon:"public",fetchFilters:eiX,multiple:!1}),children:k.jsx(ei9,{selectedValues:n,onSelectedValuesChange:r})})}),k.jsx(ei3,{selectedValues:i,fixedSelectedValues:ei2(l),onSelectedValuesChange:a,label:"Tags",icon:"label",fetchFilters:ei0}),k.jsx(ei3,{selectedValues:s,fixedSelectedValues:ei2(f),onSelectedValuesChange:c,label:"Type",icon:"description",fetchFilters:ei1})]})}function ei3(t){let[n,r]=(0,o.useState)(!1),i=(0,o.useContext)(d.Nk);return k.jsx(u.SV,{renderError:()=>k.jsx(u.R0,{mode:"error",onErrorRetry:null==i?void 0:i.reset,open:n,setOpen:r,values:new Set,...t}),children:k.jsx(o.Suspense,{fallback:k.jsx(u.R0,{mode:"loading",open:n,setOpen:r,values:new Set,...t}),children:k.jsx(ei5,{open:n,setOpen:r,...t})})})}function ei5(t){let{open:n,setOpen:r,onSelectedValuesChange:i,fixedSelectedValues:o,selectedValues:a,label:s,icon:c,fetchFilters:l,multiple:f}=t,d=l();return k.jsx(u.R0,{open:n,setOpen:r,label:s,icon:c,selectedValues:a,values:new Set(d),fixedSelectedValues:o,onSelectedValuesChange:i,multiple:f})}function ei9(t){let{selectedValues:n,onSelectedValuesChange:r}=t,[i,a]=(0,o.useState)((0,y.Ps)(n)),u=(0,y.sE)(eiX(),t=>{var r;return t.id===(null==(r=(0,y.Ps)(n))?void 0:r.id)});return(null==u?void 0:u.label)!==(null==i?void 0:i.label)&&a(u),k.jsx(ei3,{selectedValues:new Set(i?[i]:[]),onSelectedValuesChange:function(t){r(t),a((0,y.Ps)(t))},label:"Locale",icon:"public",fetchFilters:eiX,multiple:!1})}function ei8(t){let{onSelectDocument:n,fixedCustomTypes:r,fixedTags:i,...a}=t,c=tO(),{searchTerm:l,filteredTags:f,setFilteredTags:d,filteredCustomTypes:p,setFilteredCustomTypes:h,filteredLocales:m,setFilteredLocales:g,typesFilter:v,tagsFilter:b}=function(t,n){let r=tO(),i=(0,s.$P)({initialState:""}),[a,u]=(0,o.useState)(new Set),[c,l]=(0,o.useState)(new Set),[f,d]=(0,o.useState)(function(){return r.searchDocuments&&r.localeId?new Set([{id:r.localeId,label:r.localeId}]):new Set}),p=(0,y.G0)(c,ei2(t)),h=(0,y.G0)(a,ei2(n));return{searchTerm:i,filteredTags:a,setFilteredTags:u,filteredCustomTypes:c,setFilteredCustomTypes:l,filteredLocales:f,setFilteredLocales:d,typesFilter:p,tagsFilter:h}}(r,i),[x,M]=(0,o.useTransition)(),T=(0,s.$P)({initialState:x,ms:100}),{searchDocuments:S}=tO();return k.jsx(u.Vq,{size:{height:727,width:656},hasClose:!1,...a,children:k.jsx(u.cZ,{children:k.jsxs(u.xu,{flexDirection:"column",height:"100%",children:[k.jsxs(u.xu,{padding:{top:16,inline:16},flexDirection:"column",gap:12,children:[k.jsx(u.yt,{value:l.value,onValueChange:l.set,placeholder:"Search a page",icon:"search"}),S&&k.jsx(ei4,{filteredTags:f,setFilteredTags:d,filteredCustomTypes:p,setFilteredCustomTypes:h,filteredLocales:m,setFilteredLocales:g,fixedTags:i,fixedCustomTypes:r}),k.jsx(u.xv,{variant:"smallBold",color:"grey11",children:"Link to a document"})]}),c.searchDocuments?k.jsx(u.SV,{renderError:ei7,children:k.jsx(o.Suspense,{children:k.jsx(eoe,{searchTerm:l.debouncedValue,tagsFilter:b,typesFilter:v,localesFilter:m,startTransition:M,onSelectDocument:n})})}):k.jsx(eot,{message:"Slice Machine does not yet support mock data for linked documents in the simulator."}),k.jsx(ei6,{debouncedIsLoading:T.debouncedValue})]})})})}function ei6(t){return k.jsx(u.FN,{anchor:k.jsx(u.xu,{position:"relative",width:"100%",justifyContent:"center",bottom:72}),loadingIndicator:!0,open:t.debouncedIsLoading,title:"Loading more results ...",seconds:1})}function ei7(){return k.jsx(u.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:k.jsx(u.Iq,{title:"Request failed",description:"An error occurred while fetching documents.",errorImageSrc:u.Os})})}function eoe(t){let{searchTerm:n,tagsFilter:r,typesFilter:i,localesFilter:a,startTransition:s,onSelectDocument:c}=t,{documents:l,onHasReachedBottom:f}=function(t){var n,r;let{searchTerm:i,tagsFilter:a,typesFilter:u,localesFilter:s}=t,c=tO();c.searchDocuments||tC("searchDocuments");let{coreApiUrl:l,env:f,status:p}=c,[m,v]=(0,o.useState)(""),[b,x]=(0,o.useState)([]),[M,T]=(0,o.useState)(""),S=new URLSearchParams((0,g.fW)([{name:"tags",values:[...(0,y.UI)(a,t=>t.id)]},{name:"customTypes",values:[...(0,y.UI)(u,t=>t.id)]},{name:"language",values:[...(0,y.UI)(s,t=>t.id)]},{name:"status",values:g.Vu[p]},{name:"term",values:[i]}])).toString(),w=(0,d.QT)(eiJ,[l,S===M?m:"",f,S]);return S!==M?(T(S),v(""),x(w.results)):w.results.length>0&&(null==(n=(0,h.Z$)(b))?void 0:n.id)!==(null==(r=(0,h.Z$)(w.results))?void 0:r.id)&&x(t=>t.concat(w.results)),{documents:b,onHasReachedBottom:function(){w.cursor&&v(w.cursor)},response:w}}({searchTerm:n,tagsFilter:r,localesFilter:a,typesFilter:i}),p=tO();return k.jsx(u.xr,{onScrollToBottom:()=>s(f),style:{height:"100%",gap:u.TV.space[16],paddingTop:u.TV.space[10],paddingBottom:u.TV.space[16],paddingInline:u.TV.space[16]},children:k.jsxs(u.xu,{flexDirection:"column",gap:12,children:[0===l.length&&k.jsx(eot,{}),l.map(t=>{var n,i,o,a,s,l,f,d,g,y;let v=(0,m.u)({documentId:t.id,versionId:(null==(n=t.versions[0])?void 0:n.status)==="archived"?null==(i=t.versions[0])?void 0:i.version_id:void 0,releaseId:(null==(o=t.versions[0])?void 0:o.status)==="release"?t.versions[0].release_id:void 0,status:null==(a=t.versions[0])?void 0:a.status,env:p.env}),b=function(t){let{tags:n,tagsFilter:r}=t,i=[...r].map(t=>t.label).reverse();return(0,h.DY)(n,t=>-i.indexOf(t))}({tags:(null==(s=t.versions[0])?void 0:s.tags)??[],tagsFilter:r});return k.jsx(u.z4,{documentType:(null==(l=t.versions[0])?void 0:l.custom_type_label)??"",documentURL:v,description:null==(f=t.versions[0])?void 0:f.preview_summary,tags:b,title:t.title,previewImageUrl:null==(d=t.versions[0])?void 0:d.preview_image,onSelect:()=>c(t.id),status:null==(g=t.versions[0])?void 0:g.status},`${t.id}-${(null==(y=t.versions[0])?void 0:y.status)??""}`)})]})})}function eot(t){let{message:n="There are no versions matching this request"}=t;return k.jsxs(u.xu,{justifyContent:"center",flexDirection:"column",alignItems:"center",gap:16,children:[k.jsx(u.xu,{height:56,width:56,backgroundColor:"purple3",alignItems:"center",justifyContent:"center",borderRadius:"100%",children:k.jsx(u.I5,{name:"close",size:"large",color:"purple10"})}),k.jsx(u.xu,{maxWidth:204,children:k.jsx(u.xv,{color:"grey11",align:"center",children:n})})]})}function eon(t){let{hasLink:n,onUnlink:r,selectEnabled:i,selectedType:o,onValueChange:a,openInNewTab:s=!0,setOpenInNewTab:c}=t;return k.jsxs(k.Fragment,{children:[c&&"web"===o&&k.jsx(u.zx,{startIcon:s?"checkBox":"checkBoxOutlinedBlank",color:"grey",size:"small",onClick:()=>c(!s),children:"Open in new tab"}),k.jsxs(u.Ph,{value:o,color:"grey",size:"small",boldTriggerText:!0,startIcon:function(t){if(t)switch(t){case"document":return"description";case"web":return"public";case"media":return"image"}}(o),disabled:!i,onValueChange:a,placeholder:"Choose link type",children:[k.jsx(u.Ql,{value:"web",icon:"public",children:"Link to web page"}),k.jsx(u.Ql,{value:"document",icon:"description",children:"Link to Prismic page"}),k.jsx(u.Ql,{value:"media",icon:"image",children:"Link to media"})]}),k.jsx(u.zx,{startIcon:"close",color:"grey",size:"small",disabled:!n,onClick:r})]})}d.Fs.registerFetcherConfig(eiJ,{cacheCapacity:500,revalidationStrategy:{type:"never"}});let eor={DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media"},eoi={document:"DocumentLink",web:"ExternalLink",media:"FileLink"},eoo=tn({id:eJ(),title:eJ()});function eoa(t,n,r){return(0,f.WY)(`${t}/documents/${r}`,{credentials:(0,f.xb)(n),okType:eoo})}function eou(t){var n,r,i,o,a,u;let{media:s}=t,c="kind"in s;return c&&"image"===s.kind?{__TYPE__:"LinkContent",value:{__TYPE__:"ImageLink",id:s.id,name:s.filename,url:s.url,kind:s.kind,size:s.size.toString(),height:(null==(n=s.height)?void 0:n.toString())??"2000",width:(null==(r=s.width)?void 0:r.toString())??"2000",date:(null==(i=s.last_modified)?void 0:i.toString())??""}}:c?{__TYPE__:"LinkContent",value:{__TYPE__:"FileLink",id:s.id,name:s.filename,kind:s.kind,url:s.url,size:s.size.toString(),date:(null==(o=s.last_modified)?void 0:o.toString())??""}}:{__TYPE__:"LinkContent",value:{__TYPE__:"ImageLink",id:s.id,name:(null==s?void 0:s.alt)??s.url,kind:"image",url:s.url,size:"0",height:(null==(a=s.height)?void 0:a.toString())??"2000",width:(null==(u=s.width)?void 0:u.toString())??"2000"}}}function eos(t){var n,r;let{content:i,field:a,id:c,onContentChange:l,readOnly:f}=t,d=eia(),[h,m]=(0,o.useState)(!1),[g,y]=(0,o.useState)(!1),[v,b]=(0,o.useState)(!1),[x,M]=(0,o.useState)(!1),{contentType:T,fieldValue:S,errorBoundaryRef:w,onDocumentSelected:_,onError:I,onMediaSelected:O,...C}=function(t){var n;let{field:r,content:i,onContentChange:a}=t,u=i?"DocumentLink"===i.value.__TYPE__?i.value.id:"ExternalLink"===i.value.__TYPE__?i.value.url:i.value.name:"",[c,l]=(0,o.useState)(()=>{var t,n;return!(null!=(t=r.config)&&t.select)||null!=i&&i.value.__TYPE__?null==i?void 0:i.value.__TYPE__:eoi[null==(n=r.config)?void 0:n.select]}),[f,d]=(0,o.useState)(()=>(null==i?void 0:i.value.__TYPE__)==="ExternalLink"?i.value.target:""),[p,h]=(0,o.useState)(!1),m=(0,o.useRef)(null);(0,s.pQ)(u,function(){var t;p&&(h(!1),null==(t=m.current)||t.reset())});let g=c?eor[c]:void 0;function y(t){if(!t)return a(void 0);switch(c){case"ExternalLink":return a({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:t,target:f}});case"DocumentLink":return a({__TYPE__:"LinkContent",value:{__TYPE__:"DocumentLink",id:t}});default:return a(void 0)}}function v(t){y(t)}return{contentType:c,selectType:g,fieldValue:u,onValueChange:y,onTypeChange:function(t){l(eoi[t]),y("")},placeholder:Zd(r),isTypeSelectEnabled:!(null!=(n=r.config)&&n.select),onDocumentSelected:v,onError:function(){h(!0)},errorBoundaryRef:m,isTargetNewTab:"_blank"===f,updateWebLinkTarget:function(t){let n=t?"_blank":null;d(n),a({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:u,target:n}})},onMediaSelected:function(t){a(eou({media:t}))}}}({content:i,field:a,onContentChange:l}),N="ExternalLink"===T&&(0,p.ju)(S),j={id:c,contentType:T,onBlur:()=>m(!1),onFocus(){m(!0),"DocumentLink"===T&&b(!0),"FileLink"===T&&M(!0),"ImageLink"===T&&M(!0)},readOnly:f||!T,textType:N||"ImageLink"===T||"FileLink"===T?"link":"normal",value:S,...C},{searchDocuments:E}=tO();return k.jsxs(k.Fragment,{children:[k.jsxs(u.J2,{onMouseOverChange:y,open:h||g,align:"start",sideOffset:-3,openDelay:100,closeDelay:200,focusOnEnter:!1,anchor:k.jsxs(u.gN,{onMouseOverChange:m,children:[k.jsx(u.fw,{name:"link"}),k.jsx(u.Qy,{htmlFor:c,children:Zf(a)}),k.jsx(u.JO,{children:"DocumentLink"===T&&""!==S&&E?k.jsx(eof,{errorBoundaryRef:w,onError:I,fallback:k.jsx(eoc,{...j,value:"..."}),renderError(){var t;return t=j,k.jsx(eoc,{...t,textType:"link"})},children:k.jsx(eol,{...j,documentId:S,openDocumentListModal:()=>b(!0)})}):k.jsx(eoc,{...j})})]}),children:[N&&k.jsx(u.oZ,{url:N,title:(0,p.S$)(N)??"",subTitle:N.toString()}),(null==i?void 0:i.value.__TYPE__)==="ImageLink"&&k.jsx(u.Qi,{url:i.value.url,title:i.value.name,subTitle:`${i.value.width} x ${i.value.height} pixels`})]}),d?k.jsx(eio,{open:x,onOpenChange:M}):k.jsx(eiL,{open:x,onOpenChange:M,onMediaSelected:O}),k.jsx(ei8,{open:v,onOpenChange:b,onSelectDocument(t){b(!1),_(t)},fixedCustomTypes:new Set(null==(n=a.config)?void 0:n.customtypes),fixedTags:new Set(null==(r=a.config)?void 0:r.tags)})]})}function eoc(t){let{id:n,onValueChange:r,placeholder:i,readOnly:o,value:a,textType:s,onFocus:c,onBlur:l,contentType:f,isTypeSelectEnabled:d,selectType:p,onTypeChange:h,isTargetNewTab:m,updateWebLinkTarget:g}=t,y="DocumentLink"===f||"ImageLink"===f||"FileLink"===f;return k.jsx(u.oi,{id:n,onValueChange:r,placeholder:i,readOnly:o||y,value:a,variant:s,onFocus:c,onBlur:l,cursor:y?"pointer":"text",endAdornment:k.jsx(eon,{hasLink:Boolean(a),onUnlink:()=>r(""),selectEnabled:d,selectedType:p,onValueChange:h,openInNewTab:m,setOpenInNewTab:g})})}function eol(t){let{id:n,documentId:r,openDocumentListModal:i,onValueChange:o,isTypeSelectEnabled:a,selectType:s,onTypeChange:c}=t,l=function(t){let n=tO();n.searchDocuments||tC("searchDocuments");let{coreApiUrl:r,env:i}=n;return(0,d.QT)(eoa,[r,i,t]).title}(r);return k.jsx(u.oi,{id:n,readOnly:!0,value:l,variant:"link",onFocus:i,cursor:"pointer",endAdornment:k.jsx(eon,{hasLink:!0,onUnlink:()=>o(""),selectEnabled:a,selectedType:s,onValueChange:c})})}function eof(t){let{errorBoundaryRef:n,onError:r,children:i,fallback:a,renderError:s}=t;return k.jsx(u.SV,{ref:n,onError:r,renderError:s,children:k.jsx(o.Suspense,{fallback:a,children:i})})}let eod=({content:t,field:n,id:r,onContentChange:i,readOnly:o})=>{var a,s;let c=Number(null==t?void 0:t.value),l=Number.isFinite(c)?c:void 0;return k.jsxs(u.gN,{children:[k.jsx(u.fw,{name:"pin"}),k.jsx(u.Qy,{htmlFor:r,children:Zf(n)}),k.jsx(u.JO,{children:k.jsx(u.Y2,{id:r,value:l,min:null==(a=n.config)?void 0:a.min,max:null==(s=n.config)?void 0:s.max,placeholder:Zd(n),readOnly:o,onValueChange(t){var n;return i((n=t,void 0===n?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(n)}))}})})]})};var eop=function(){};eop.prototype.append=function(t){return t.length?(t=eop.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},eop.prototype.prepend=function(t){return t.length?eop.from(t).append(this):this},eop.prototype.appendInner=function(t){return new eom(this,t)},eop.prototype.slice=function(t,n){return void 0===t&&(t=0),void 0===n&&(n=this.length),t>=n?eop.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))},eop.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},eop.prototype.forEach=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)},eop.prototype.map=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=this.length);var i=[];return this.forEach(function(n,r){return i.push(t(n,r))},n,r),i},eop.from=function(t){return t instanceof eop?t:t&&t.length?new eoh(t):eop.empty};var eoh=function(t){function n(n){t.call(this),this.values=n}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var r={length:{configurable:!0},depth:{configurable:!0}};return n.prototype.flatten=function(){return this.values},n.prototype.sliceInner=function(t,r){return 0==t&&r==this.length?this:new n(this.values.slice(t,r))},n.prototype.getInner=function(t){return this.values[t]},n.prototype.forEachInner=function(t,n,r,i){for(var o=n;o<r;o++)if(!1===t(this.values[o],i+o))return!1},n.prototype.forEachInvertedInner=function(t,n,r,i){for(var o=n-1;o>=r;o--)if(!1===t(this.values[o],i+o))return!1},n.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new n(this.values.concat(t.flatten()))},n.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new n(t.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(n.prototype,r),n}(eop);eop.empty=new eoh([]);var eom=function(t){function n(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},n.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},n.prototype.forEachInner=function(t,n,r,i){var o=this.left.length;if(n<o&&!1===this.left.forEachInner(t,n,Math.min(r,o),i)||r>o&&!1===this.right.forEachInner(t,Math.max(n-o,0),Math.min(this.length,r)-o,i+o))return!1},n.prototype.forEachInvertedInner=function(t,n,r,i){var o=this.left.length;if(n>o&&!1===this.right.forEachInvertedInner(t,n-o,Math.max(r,o)-o,i+o)||r<o&&!1===this.left.forEachInvertedInner(t,Math.min(n,o),r,i))return!1},n.prototype.sliceInner=function(t,n){if(0==t&&n==this.length)return this;var r=this.left.length;return n<=r?this.left.slice(t,n):t>=r?this.right.slice(t-r,n-r):this.left.slice(t,r).append(this.right.slice(0,n-r))},n.prototype.leafAppend=function(t){var r=this.right.leafAppend(t);if(r)return new n(this.left,r)},n.prototype.leafPrepend=function(t){var r=this.left.leafPrepend(t);if(r)return new n(r,this.right)},n.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new n(this.left,new n(this.right,t)):new n(this,t)},n}(eop);class eog{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(0==this.eventCount)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(o=(i=this.remapping(r,this.items.length)).maps.length);let a=t.tr,u,s,c=[],l=[];return this.items.forEach((t,n)=>{if(!t.step){i||(o=(i=this.remapping(r,n+1)).maps.length),o--,l.push(t);return}if(i){l.push(new eoy(t.map));let f=t.step.map(i.slice(o)),d;f&&a.maybeStep(f).doc&&(d=a.mapping.maps[a.mapping.maps.length-1],c.push(new eoy(d,void 0,void 0,c.length+l.length))),o--,d&&i.appendMap(d,o)}else a.maybeStep(t.step);if(t.selection)return u=i?t.selection.map(i.slice(o)):t.selection,s=new eog(this.items.slice(0,r).append(l.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:s,transform:a,selection:u}}addTransform(t,n,r,i){var o,a;let u=[],s=this.eventCount,c=this.items,l=!i&&c.length?c.get(c.length-1):null;for(let f=0;f<t.steps.length;f++){let d=t.steps[f].invert(t.docs[f]),p=new eoy(t.mapping.maps[f],d,n),h;(h=l&&l.merge(p))&&(p=h,f?u.pop():c=c.slice(0,c.length-1)),u.push(p),n&&(s++,n=void 0),i||(l=p)}let m=s-r.depth,g;return m>eob&&(o=c,a=m,c=(o.forEach((t,n)=>{if(t.selection&&0==a--)return g=n,!1}),o.slice(g)),s-=m),new eog(c.append(u),s)}remapping(t,n){let r=new Ql;return this.items.forEach((n,i)=>{let o=null!=n.mirrorOffset&&i-n.mirrorOffset>=t?r.maps.length-n.mirrorOffset:void 0;r.appendMap(n.map,o)},t,n),r}addMaps(t){return 0==this.eventCount?this:new eog(this.items.append(t.map(t=>new eoy(t))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,a=t.steps.length,u=this.eventCount;this.items.forEach(t=>{t.selection&&u--},i);let s=n;this.items.forEach(n=>{let i=o.getMirror(--s);if(null==i)return;a=Math.min(a,i);let c=o.maps[i];if(n.step){let l=t.steps[i].invert(t.docs[i]),f=n.selection&&n.selection.map(o.slice(s+1,i));f&&u++,r.push(new eoy(c,l,f))}else r.push(new eoy(c))},i);let c=[];for(let l=n;l<a;l++)c.push(new eoy(o.maps[l]));let f=this.items.slice(0,i).append(c).append(r),d=new eog(f,u);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((a,u)=>{if(u>=t)i.push(a),a.selection&&o++;else if(a.step){let s=a.step.map(n.slice(r)),c=s&&s.getMap();if(r--,c&&n.appendMap(c,r),s){let l=a.selection&&a.selection.map(n.slice(r));l&&o++;let f=new eoy(c.invert(),s,l),d,p=i.length-1;(d=i.length&&i[p].merge(f))?i[p]=d:i.push(f)}}else a.map&&r--},this.items.length,0),new eog(eop.from(i.reverse()),o)}}eog.empty=new eog(eop.empty,0);class eoy{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new eoy(n.getMap().invert(),n,this.selection)}}}class eov{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}let eob=20;function eox(t){let n=[];return t.forEach((t,r,i,o)=>n.push(i,o)),n}function eoM(t,n){if(!t)return null;let r=[];for(let i=0;i<t.length;i+=2){let o=n.map(t[i],1),a=n.map(t[i+1],-1);o<=a&&r.push(o,a)}return r}function eoT(t,n,r,i){let o=eo_(n),a=eoI.get(n).spec.config,u=(i?t.undone:t.done).popEvent(n,o);if(!u)return;let s=u.selection.resolve(u.transform.doc),c=(i?t.done:t.undone).addTransform(u.transform,n.selection.getBookmark(),a,o),l=new eov(i?c:u.remaining,i?u.remaining:c,null,0,-1);r(u.transform.setSelection(s).setMeta(eoI,{redo:i,historyState:l}).scrollIntoView())}let eoS=!1,eow=null;function eo_(t){let n=t.plugins;if(eow!=n){eoS=!1,eow=n;for(let r=0;r<n.length;r++)if(n[r].spec.historyPreserveItems){eoS=!0;break}}return eoS}let eoI=new Hn("history"),eoO=new Hn("closeHistory"),eok=(t,n)=>{let r=eoI.getState(t);return!!r&&0!=r.done.eventCount&&(n&&eoT(r,t,n,!1),!0)},eoC=(t,n)=>{let r=eoI.getState(t);return!!r&&0!=r.undone.eventCount&&(n&&eoT(r,t,n,!0),!0)},eoN=eeR.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:n})=>eok(t,n),redo:()=>({state:t,dispatch:n})=>eoC(t,n)}),addProseMirrorPlugins(){return[function(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Q7({key:eoI,state:{init:()=>new eov(eog.empty,eog.empty,null,0,-1),apply:(n,r,i)=>(function(t,n,r,i){let o=r.getMeta(eoI),a;if(o)return o.historyState;r.getMeta(eoO)&&(t=new eov(t.done,t.undone,null,0,-1));let u=r.getMeta("appendedTransaction");if(0==r.steps.length)return t;if(u&&u.getMeta(eoI))return u.getMeta(eoI).redo?new eov(t.done.addTransform(r,void 0,i,eo_(n)),t.undone,eox(r.mapping.maps[r.steps.length-1]),t.prevTime,t.prevComposition):new eov(t.done,t.undone.addTransform(r,void 0,i,eo_(n)),null,t.prevTime,t.prevComposition);if(!1===r.getMeta("addToHistory")||u&&!1===u.getMeta("addToHistory"))return(a=r.getMeta("rebased"))?new eov(t.done.rebased(r,a),t.undone.rebased(r,a),eoM(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new eov(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),eoM(t.prevRanges,r.mapping),t.prevTime,t.prevComposition);{let s=r.getMeta("composition"),c=0==t.prevTime||!u&&t.prevComposition!=s&&(t.prevTime<(r.time||0)-i.newGroupDelay||!function(t,n){if(!n)return!1;if(!t.docChanged)return!0;let r=!1;return t.mapping.maps[0].forEach((t,i)=>{for(let o=0;o<n.length;o+=2)t<=n[o+1]&&i>=n[o]&&(r=!0)}),r}(r,t.prevRanges)),l=u?eoM(t.prevRanges,r.mapping):eox(r.mapping.maps[r.steps.length-1]);return new eov(t.done.addTransform(r,c?n.selection.getBookmark():void 0,i,eo_(n)),eog.empty,l,r.time,s??t.prevComposition)}})(r,i,n,t)},config:t,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i="historyUndo"==r?eok:"historyRedo"==r?eoC:null;return!!i&&(n.preventDefault(),i(t.state,t.dispatch))}}}})}(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),eoj=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,eoE=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,eoR=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,eoD=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,eoA=ene.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],renderHTML({HTMLAttributes:t}){return["strong",eeh(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[et8({find:eoj,type:this.type}),et8({find:eoR,type:this.type})]},addPasteRules(){return[enr({find:eoE,type:this.type}),enr({find:eoD,type:this.type})]}});var eoL,eoP,eoF=((eoL=eoF||{}).Document="document",eoL.Mark="mark",eoL.Node="node",eoL),eoz=((eoP=eoz||{}).Text="text",eoP.Embed="embed",eoP.Image="image",eoP);class eoU{constructor(t,n,r,i,o,a=!1){T(this,"extType","node"),T(this,"nodeType","text"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a}}function eoW(t){return t instanceof eoU}class eoB extends eoU{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class eoV extends eoU{constructor(t,n,r,i){super(t,n,r,i)}}function eo$(t){return t instanceof eoV}let eoK=ent.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",eeh(this.options.HTMLAttributes,t)]},renderText:()=>`
|
|
93
|
-
`,addCommands(){return{setHardBreak:()=>({commands:t,chain:n,state:r,editor:i})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:t,storedMarks:o}=r;if(t.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:u}=i.extensionManager,s=o||t.$to.parentOffset&&t.$from.marks();return n().insertContent({type:this.name}).command(({tr:t,dispatch:n})=>{if(n&&s&&a){let r=s.filter(t=>u.includes(t.type.name));t.ensureMarks(r)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),eoY={isHardBreak:t=>t.type.name===eoK.name,children:{reduce(t,n,r){let i=r;return t.forEach((t,r,o)=>{i=n(i,t,o)}),i},map(t,n){return this.reduce(t,(t,r)=>[...t,n(r)],[])},exists(t,n){return this.reduce(t,(t,r)=>t||n(r),!1)},filter(t,n){return this.reduce(t,(t,r)=>[...t,...n(r)?[r]:[]],[])}},marks:{reduce(t,n,r){let i=r;return t.marks.forEach((t,r)=>{i=n(i,t,r)}),i},map(t,n){return this.reduce(t,(t,r)=>[...t,n(r)],[])},filter(t,n){return this.reduce(t,(t,r)=>[...t,...n(r)?[r]:[]],[])}}};function eoq(){return{extensions:es$(),defaultTextConverter:void 0}}let eoG=eoA.extend({name:"bold"}),eoZ=new class{constructor(t,n,r){T(this,"extType",eoF.Mark),T(this,"richTextNodeTypes",Ks.RichTextNodeType.strong),this.name=t,this.component=n,this.converter=r}}(eoG.name,eoG,{fromPrismic:t=>function(){var n;return null==(n=t.marks[eoG.name])?void 0:n.create()},toPrismic(){}}),eoQ=ent.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",eeh(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),eoH=ene.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",eeh(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:n})=>{let r=etI(t,this.type);return!!Object.entries(r).some(([,t])=>!!t)||n.unsetMark(this.name)}}}}),eoJ=/^\s*([-+*])\s$/,eoX=ent.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",eeh(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:n})=>this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(eoQ.name,this.editor.getAttributes(eoH.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=et7({find:eoJ,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=et7({find:eoJ,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(eoH.name),editor:this.editor})),[t]}}),eo0=ent.create({name:"doc",topNode:!0,content:"block+"}),eo1=ent.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",eeh(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),eo2=eo1.extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),eo4={component:eo2,converter:{fromPrismic:t=>function(n){var r;let i=eu2.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[eo2.name])?void 0:r.create({},i)},toPrismic:(t,n)=>eoY.children.reduce(t,(t,r)=>{let i=eu2.converter.toPrismic(r),o=i instanceof Array?i.map(t=>({...t,type:n})):i?[{...i,type:n}]:[];return[...t,...o]},[])},placeholder:"List"},eo3="document",eo5=t=>eo0.extend({name:eo3,content:t?"block+":"block"}),eo9=t=>({fromPrismic(n,r){function i(t,n){return!n&&r&&nf.TextBlock.is(t)?r(t):n}return function(r){var o;let a=r.value.reduce((r,o)=>{let a=t.find(t=>t.richTextNodeTypes.includes(o.type)),u=function(t){let{ext:n,block:r,schema:i}=t;if(n)switch(n.nodeType){case eoz.Embed:return nf.EmbedBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;case eoz.Text:return nf.TextBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;case eoz.Image:return nf.ImageBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;default:return}}({ext:a,block:o,schema:n}),s=r.slice(0,r.length-1),c=(0,h.Z$)(r),l=function(t){var n,r;let{node:i,block:o,nodeWithDefault:a,previousNode:u}=t;return i&&u?i.type.name===u.type.name&&(i.type.name===est.name||i.type.name===esB.name)?{merged:!0,updatedNode:u.copy(u.content.append(i.content))}:{merged:!1,updatedNode:a(o,i)}:{merged:!1,updatedNode:i}}({node:u,block:o,nodeWithDefault:i,previousNode:c});return l.updatedNode?[...l.merged?s:r,l.updatedNode]:r},[]);return null==(o=n.nodes[eo3])?void 0:o.create({},a)}},toPrismic:n=>({__TYPE__:"StructuredTextContent",value:[...eoY.children.reduce(n,(n,r)=>{let i=Object.values(t).find(t=>r.type.name===t.name),o=null==i?void 0:i.converter.toPrismic(r);return o||console.warn(`Cannot convert node of type '${r.type.name}'.`),o?[...n,...o instanceof Array?o:[o]]:n},[])]})}),eo8=new class{constructor(t,n,r){T(this,"extType","document"),this.name=t,this.component=n,this.converter=r}}(eo3,eo5,eo9),eo6=eoK.extend({name:"hard_break"}),eo7=`
|
|
94
|
-
`,eae={fromPrismic:t=>function(n){var r;if(n===eo7)return null==(r=t.nodes[eo6.name])?void 0:r.create({})},toPrismic(t){if(t.type.name===eo6.name)return eo7}},eat={isEmptyLine:t=>0===t.length,isFirst:t=>0===t},ean={name:eo6.name,component:eo6,converter:eae,splitTextToNodes:function(t,n){return function(r){let i=eae.fromPrismic(t)(eo7);if(!i)return[r(n)];let o=n.split(eo7);return 1===o.length?n.length?[r(n)]:[i]:o.reduce((t,n,o)=>eat.isFirst(o)?eat.isEmptyLine(n)?t:[...t,r(n)]:eat.isEmptyLine(n)?[...t,i]:[...t,i,r(n)],[])}}},ear=eeR.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new Q7({key:new Hn("placeholder"),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,o=[];if(!r)return null;let a=t.type.createAndFill(),u=(null==a?void 0:a.sameMarkup(t))&&null===a.content.findDiffStart(t.content);return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,a=!t.isLeaf&&!t.childCount;if((r||!this.options.showOnlyCurrent)&&a){let s=[this.options.emptyNodeClass];u&&s.push(this.options.emptyEditorClass);let c=Xl.node(n,n+t.nodeSize,{class:s.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});o.push(c)}return this.options.includeChildren}),Xp.create(t,o)}}})]}}),eai=t=>ear.configure({includeChildren:!0,placeholder:n=>(function({props:t,params:n}){var r;let{editor:i,hasAnchor:o,node:a}=t,{placeholderByNodeType:u,unfocusedPlaceholder:s,nodeExtensions:c}=n,l=!eoY.children.exists(i.state.doc,t=>t===a),f=i.isEditable,d=i.isFocused&&o,p=a.type.name!==eu2.name,h=d||p||l,m=c.length>1,g=function(){if(l)return eo4.placeholder;let t=u[a.type.name];return"string"==typeof t?t:null==t?void 0:t(a.attrs)}();return s&&!d&&i.isEmpty?s:("Type '/' for commands"===g?f&&h&&m:f&&h)&&g||""})({props:n,params:t}),showOnlyCurrent:!1,showOnlyWhenEditable:!1});function eao(t){return t.split("-")[1]}function eaa(t){return"y"===t?"height":"width"}function eau(t){return t.split("-")[0]}function eas(t){return["top","bottom"].includes(eau(t))?"x":"y"}function eac(t,n,r){let{reference:i,floating:o}=t,a=i.x+i.width/2-o.width/2,u=i.y+i.height/2-o.height/2,s=eas(n),c=eaa(s),l=i[c]/2-o[c]/2,f=eau(n),d="x"===s,p;switch(f){case"top":p={x:a,y:i.y-o.height};break;case"bottom":p={x:a,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:u};break;case"left":p={x:i.x-o.width,y:u};break;default:p={x:i.x,y:i.y}}switch(eao(n)){case"start":p[s]-=l*(r&&d?-1:1);break;case"end":p[s]+=l*(r&&d?-1:1)}return p}let eal=async(t,n,r)=>{let{placement:i="bottom",strategy:o="absolute",middleware:a=[],platform:u}=r,s=a.filter(Boolean),c=await (null==u.isRTL?void 0:u.isRTL(n)),l=await u.getElementRects({reference:t,floating:n,strategy:o}),{x:f,y:d}=eac(l,i,c),p=i,h={},m=0;for(let g=0;g<s.length;g++){let{name:y,fn:v}=s[g],{x:b,y:x,data:M,reset:T}=await v({x:f,y:d,initialPlacement:i,placement:p,strategy:o,middlewareData:h,rects:l,platform:u,elements:{reference:t,floating:n}});if(f=b??f,d=x??d,h={...h,[y]:{...h[y],...M}},T&&m<=50){m++,"object"==typeof T&&(T.placement&&(p=T.placement),T.rects&&(l=!0===T.rects?await u.getElementRects({reference:t,floating:n,strategy:o}):T.rects),{x:f,y:d}=eac(l,p,c)),g=-1;continue}}return{x:f,y:d,placement:p,strategy:o,middlewareData:h}};function eaf(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function ead(t,n){var r,i,o;void 0===n&&(n={});let{x:a,y:u,platform:s,rects:c,elements:l,strategy:f}=t,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:h="floating",altBoundary:m=!1,padding:g=0}=n,y="number"!=typeof g?{top:0,right:0,bottom:0,left:0,...g}:{top:g,right:g,bottom:g,left:g},v=l[m?"floating"===h?"reference":"floating":h],b=eaf(await s.getClippingRect({element:null==(r=await (null==s.isElement?void 0:s.isElement(v)))||r?v:v.contextElement||await (null==s.getDocumentElement?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:p,strategy:f})),x="floating"===h?{...c.floating,x:a,y:u}:c.reference,M=await (null==s.getOffsetParent?void 0:s.getOffsetParent(l.floating)),T=await (null==s.isElement?void 0:s.isElement(M))&&await (null==s.getScale?void 0:s.getScale(M))||{x:1,y:1},S=eaf(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:M,strategy:f}):x);return{top:(b.top-S.top+y.top)/T.y,bottom:(S.bottom-b.bottom+y.bottom)/T.y,left:(b.left-S.left+y.left)/T.x,right:(S.right-b.right+y.right)/T.x}}let eap=Math.min,eah=Math.max;function eam(t,n,r){return eah(t,eap(n,r))}let eag={left:"right",right:"left",bottom:"top",top:"bottom"};function eay(t){return t.replace(/left|right|bottom|top/g,t=>eag[t])}let eav={start:"end",end:"start"};function eab(t){return t.replace(/start|end/g,t=>eav[t])}async function eax(t,n){let{placement:r,platform:i,elements:o}=t,a=await (null==i.isRTL?void 0:i.isRTL(o.floating)),u=eau(r),s=eao(r),c="x"===eas(r),l=["left","top"].includes(u)?-1:1,f=a&&c?-1:1,d="function"==typeof n?n(t):n,{mainAxis:p,crossAxis:h,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof m&&(h="end"===s?-1*m:m),c?{x:h*f,y:p*l}:{x:p*l,y:h*f}}function eaM(t){return"x"===t?"y":"x"}function eaT(t){var n;return(null==(n=t.ownerDocument)?void 0:n.defaultView)||window}function eaS(t){return eaT(t).getComputedStyle(t)}let eaw=Math.min,ea_=Math.max,eaI=Math.round;function eaO(t){let n=eaS(t),r=parseFloat(n.width),i=parseFloat(n.height),o=t.offsetWidth,a=t.offsetHeight,u=eaI(r)!==o||eaI(i)!==a;return u&&(r=o,i=a),{width:r,height:i,fallback:u}}function eak(t){return eaR(t)?(t.nodeName||"").toLowerCase():""}let eaC;function eaN(){if(eaC)return eaC;let t=navigator.userAgentData;return t&&Array.isArray(t.brands)?eaC=t.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function eaj(t){return t instanceof eaT(t).HTMLElement}function eaE(t){return t instanceof eaT(t).Element}function eaR(t){return t instanceof eaT(t).Node}function eaD(t){if(typeof ShadowRoot>"u")return!1;let n=eaT(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}function eaA(t){let{overflow:n,overflowX:r,overflowY:i,display:o}=eaS(t);return/auto|scroll|overlay|hidden|clip/.test(n+i+r)&&!["inline","contents"].includes(o)}function eaL(t){return["table","td","th"].includes(eak(t))}function eaP(t){let n=/firefox/i.test(eaN()),r=eaS(t),i=r.backdropFilter||r.WebkitBackdropFilter;return"none"!==r.transform||"none"!==r.perspective||!!i&&"none"!==i||n&&"filter"===r.willChange||n&&!!r.filter&&"none"!==r.filter||["transform","perspective"].some(t=>r.willChange.includes(t))||["paint","layout","strict","content"].some(t=>{let n=r.contain;return null!=n&&n.includes(t)})}function eaF(){return/^((?!chrome|android).)*safari/i.test(eaN())}function eaz(t){return["html","body","#document"].includes(eak(t))}function eaU(t){return eaE(t)?t:t.contextElement}let eaW={x:1,y:1};function eaB(t){let n=eaU(t);if(!eaj(n))return eaW;let r=n.getBoundingClientRect(),{width:i,height:o,fallback:a}=eaO(n),u=(a?eaI(r.width):r.width)/i,s=(a?eaI(r.height):r.height)/o;return u&&Number.isFinite(u)||(u=1),s&&Number.isFinite(s)||(s=1),{x:u,y:s}}function eaV(t,n,r,i){var o,a;void 0===n&&(n=!1),void 0===r&&(r=!1);let u=t.getBoundingClientRect(),s=eaU(t),c=eaW;n&&(i?eaE(i)&&(c=eaB(i)):c=eaB(t));let l=s?eaT(s):window,f=eaF()&&r,d=(u.left+(f&&(null==(o=l.visualViewport)?void 0:o.offsetLeft)||0))/c.x,p=(u.top+(f&&(null==(a=l.visualViewport)?void 0:a.offsetTop)||0))/c.y,h=u.width/c.x,m=u.height/c.y;if(s){let g=eaT(s),y=i&&eaE(i)?eaT(i):i,v=g.frameElement;for(;v&&i&&y!==g;){let b=eaB(v),x=v.getBoundingClientRect(),M=getComputedStyle(v);x.x+=(v.clientLeft+parseFloat(M.paddingLeft))*b.x,x.y+=(v.clientTop+parseFloat(M.paddingTop))*b.y,d*=b.x,p*=b.y,h*=b.x,m*=b.y,d+=x.x,p+=x.y,v=eaT(v).frameElement}}return{width:h,height:m,top:p,right:d+h,bottom:p+m,left:d,x:d,y:p}}function ea$(t){return((eaR(t)?t.ownerDocument:t.document)||window.document).documentElement}function eaK(t){return eaE(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function eaY(t){return eaV(ea$(t)).left+eaK(t).scrollLeft}function eaq(t){if("html"===eak(t))return t;let n=t.assignedSlot||t.parentNode||eaD(t)&&t.host||ea$(t);return eaD(n)?n.host:n}function eaG(t,n){var r;void 0===n&&(n=[]);let i=function t(n){let r=eaq(n);return eaz(r)?r.ownerDocument.body:eaj(r)&&eaA(r)?r:t(r)}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=eaT(i);return o?n.concat(a,a.visualViewport||[],eaA(i)?i:[]):n.concat(i,eaG(i))}function eaZ(t,n,r){let i;if("viewport"===n)i=function(t,n){let r=eaT(t),i=ea$(t),o=r.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,c=0;if(o){a=o.width,u=o.height;let l=eaF();(!l||l&&"fixed"===n)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:a,height:u,x:s,y:c}}(t,r);else if("document"===n)i=function(t){let n=ea$(t),r=eaK(t),i=t.ownerDocument.body,o=ea_(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),a=ea_(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight),u=-r.scrollLeft+eaY(t),s=-r.scrollTop;return"rtl"===eaS(i).direction&&(u+=ea_(n.clientWidth,i.clientWidth)-o),{width:o,height:a,x:u,y:s}}(ea$(t));else if(eaE(n))i=function(t,n){let r=eaV(t,!0,"fixed"===n),i=r.top+t.clientTop,o=r.left+t.clientLeft,a=eaj(t)?eaB(t):{x:1,y:1},u=t.clientWidth*a.x,s=t.clientHeight*a.y,c=o*a.x,l=i*a.y;return{width:u,height:s,x:c,y:l}}(n,r);else{let o={...n};if(eaF()){var a,u;let s=eaT(t);o.x-=(null==(a=s.visualViewport)?void 0:a.offsetLeft)||0,o.y-=(null==(u=s.visualViewport)?void 0:u.offsetTop)||0}i=o}return eaf(i)}function eaQ(t,n){return eaj(t)&&"fixed"!==eaS(t).position?n?n(t):t.offsetParent:null}function eaH(t,n){let r=eaT(t),i=eaQ(t,n);for(;i&&eaL(i)&&"static"===eaS(i).position;)i=eaQ(i,n);return i&&("html"===eak(i)||"body"===eak(i)&&"static"===eaS(i).position&&!eaP(i))?r:i||function(t){let n=eaq(t);for(;eaj(n)&&!eaz(n);){if(eaP(n))return n;n=eaq(n)}return null}(t)||r}let eaJ={getClippingRect:function(t){let{element:n,boundary:r,rootBoundary:i,strategy:o}=t,a=[..."clippingAncestors"===r?function(t,n){let r=n.get(t);if(r)return r;let i=eaG(t).filter(t=>eaE(t)&&"body"!==eak(t)),o=null,a="fixed"===eaS(t).position,u=a?eaq(t):t;for(;eaE(u)&&!eaz(u);){let s=eaS(u),c=eaP(u);"fixed"===s.position?o=null:(a?c||o:!(!c&&"static"===s.position&&o&&["absolute","fixed"].includes(o.position)))?o=s:i=i.filter(t=>t!==u),u=eaq(u)}return n.set(t,i),i}(n,this._c):[].concat(r),i],u=a[0],s=a.reduce((t,r)=>{let i=eaZ(n,r,o);return t.top=ea_(i.top,t.top),t.right=eaw(i.right,t.right),t.bottom=eaw(i.bottom,t.bottom),t.left=ea_(i.left,t.left),t},eaZ(n,u,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:n,offsetParent:r,strategy:i}=t,o=eaj(r),a=ea$(r);if(r===a)return n;let u={scrollLeft:0,scrollTop:0},s={x:1,y:1},c={x:0,y:0};if((o||!o&&"fixed"!==i)&&(("body"!==eak(r)||eaA(a))&&(u=eaK(r)),eaj(r))){let l=eaV(r);s=eaB(r),c.x=l.x+r.clientLeft,c.y=l.y+r.clientTop}return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-u.scrollLeft*s.x+c.x,y:n.y*s.y-u.scrollTop*s.y+c.y}},isElement:eaE,getDimensions:function(t){return eaj(t)?eaO(t):t.getBoundingClientRect()},getOffsetParent:eaH,getDocumentElement:ea$,getScale:eaB,async getElementRects(t){let{reference:n,floating:r,strategy:i}=t,o=this.getOffsetParent||eaH,a=this.getDimensions;return{reference:function(t,n,r){let i=eaj(n),o=ea$(n),a=eaV(t,!0,"fixed"===r,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(i||!i&&"fixed"!==r){if(("body"!==eak(n)||eaA(o))&&(u=eaK(n)),eaj(n)){let c=eaV(n,!0);s.x=c.x+n.clientLeft,s.y=c.y+n.clientTop}else o&&(s.x=eaY(o))}return{x:a.left+u.scrollLeft-s.x,y:a.top+u.scrollTop-s.y,width:a.width,height:a.height}}(n,await o(r),i),floating:{x:0,y:0,...await a(r)}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===eaS(t).direction};function eaX(t,n,r,i){void 0===i&&(i={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:u=!0,animationFrame:s=!1}=i,c=o&&!s,l=c||a?[...eaE(t)?eaG(t):t.contextElement?eaG(t.contextElement):[],...eaG(n)]:[];l.forEach(t=>{c&&t.addEventListener("scroll",r,{passive:!0}),a&&t.addEventListener("resize",r)});let f=null;if(u){let d=!0;f=new ResizeObserver(()=>{d||r(),d=!1}),eaE(t)&&!s&&f.observe(t),eaE(t)||!t.contextElement||s||f.observe(t.contextElement),f.observe(n)}let p,h=s?eaV(t):null;return s&&function n(){let i=eaV(t);h&&(i.x!==h.x||i.y!==h.y||i.width!==h.width||i.height!==h.height)&&r(),h=i,p=requestAnimationFrame(n)}(),r(),()=>{var t;l.forEach(t=>{c&&t.removeEventListener("scroll",r),a&&t.removeEventListener("resize",r)}),null==(t=f)||t.disconnect(),f=null,s&&cancelAnimationFrame(p)}}let ea0=(t,n,r)=>{let i=new Map,o={platform:eaJ,...r},a={...o.platform,_c:i};return eal(t,n,{...o,platform:a})};var ea1="u">typeof document?o.useLayoutEffect:o.useEffect;function ea2(t,n){if(t===n)return!0;if(typeof t!=typeof n)return!1;if("function"==typeof t&&t.toString()===n.toString())return!0;let r,i,o;if(t&&n&&"object"==typeof t){if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!ea2(t[i],n[i]))return!1;return!0}if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){let a=o[i];if(!("_owner"===a&&t.$$typeof)&&!ea2(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}function ea4(t){let n=o.useRef(t);return ea1(()=>{n.current=t}),n}var ea3="u">typeof document?o.useLayoutEffect:o.useEffect;let ea5=!1,ea9=0,ea8=()=>"floating-ui-"+ea9++,ea6=(qm||(qm=r.t(o,2)))["useId".toString()],ea7=ea6??function(){let[t,n]=o.useState(()=>ea5?ea8():void 0);return ea3(()=>{null==t&&n(ea8())},[]),o.useEffect(()=>{ea5||(ea5=!0)},[]),t},eue=o.createContext(null),eut=o.createContext(null),eun=()=>{var t,n;return null!=(t=null==(n=o.useContext(eue))?void 0:n.id)?t:null},eur=()=>o.useContext(eut);function eui(t){var n;return null!=(n=null==t?void 0:t.ownerDocument)?n:document}function euo(t){var n;return null!=(n=eui(t).defaultView)?n:window}function eua(t){return!!t&&t instanceof euo(t).Element}let euu=(qm||(qm=r.t(o,2)))["useInsertionEffect".toString()];function eus(t){let n=o.useRef(()=>{});return euu?euu(()=>{n.current=t}):n.current=t,o.useCallback(function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return null==n.current?void 0:n.current(...r)},[])}function euc(t,n,r){let i=new Map;return{..."floating"===r&&{tabIndex:-1},...t,...n.map(t=>t?t[r]:null).concat(t).reduce((t,n)=>(n&&Object.entries(n).forEach(n=>{let[r,o]=n;if(0===r.indexOf("on")){if(i.has(r)||i.set(r,[]),"function"==typeof o){var a;null==(a=i.get(r))||a.push(o),t[r]=function(){for(var t,n=arguments.length,o=Array(n),a=0;a<n;a++)o[a]=arguments[a];null==(t=i.get(r))||t.forEach(t=>t(...o))}}}else t[r]=o}),t),{})}}function eul(t,n){var r,i;let o=null!=(r=t.filter(t=>{var r;return t.parentId===n&&(null==(r=t.context)?void 0:r.open)}))?r:[],a=o;for(;a.length;)a=null!=(i=t.filter(t=>{var n;return null==(n=a)?void 0:n.some(n=>{var r;return t.parentId===n.id&&(null==(r=t.context)?void 0:r.open)})}))?i:[],o=o.concat(a);return o}function euf(t){let n=t.activeElement;for(;(null==(r=n)||null==(i=r.shadowRoot)?void 0:i.activeElement)!=null;){var r,i;n=n.shadowRoot.activeElement}return n}function eud(t){t.preventDefault(),t.stopPropagation()}function eup(t){let n=(0,o.useRef)();return ea3(()=>{n.current=t},[t]),n.current}let euh=function(t,n){let{open:r}=t,{enabled:i=!0,role:o="dialog"}=void 0===n?{}:n,a=ea7(),u=ea7(),s={id:a,role:o};return i?"tooltip"===o?{reference:{"aria-describedby":r?a:void 0},floating:s}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===o?"dialog":o,"aria-controls":r?a:void 0,..."listbox"===o&&{role:"combobox"},..."menu"===o&&{id:u}},floating:{...s,..."menu"===o&&{"aria-labelledby":u}}}:{}};function eum(t,n){return null!=n&&("composedPath"in t?t.composedPath().includes(n):null!=t.target&&n.contains(t.target))}let eug=function(t,n){let{open:r,onOpenChange:i,refs:a,events:u,nodeId:s}=t,{enabled:c=!0,escapeKey:l=!0,outsidePointerDown:f=!0,referencePointerDown:d=!1,ancestorScroll:p=!1,bubbles:h=!0}=void 0===n?{}:n,m=eur(),g=null!=eun(),y=o.useRef(!1);return o.useEffect(()=>{if(!r||!c)return;function t(t){"Escape"!==t.key||!h&&m&&eul(m.nodesRef.current,s).length>0||(u.emit("dismiss",{preventScroll:!1}),i(!1))}function n(t){var n,r;let o=y.current;if(y.current=!1,o)return;let c="composedPath"in t?t.composedPath()[0]:t.target;if(eua(c)&&a.floating.current){let l=null!=(r=a.floating.current.ownerDocument.defaultView)?r:window,f=c.scrollWidth>c.clientWidth,d=c.scrollHeight>c.clientHeight,p=d&&t.offsetX>c.clientWidth;if(d&&"rtl"===l.getComputedStyle(c).direction&&(p=t.offsetX<=c.offsetWidth-c.clientWidth),p||f&&t.offsetY>c.clientHeight)return}let v=m&&eul(m.nodesRef.current,s).some(n=>{var r;return eum(t,null==(r=n.context)?void 0:r.refs.floating.current)});eum(t,a.floating.current)||eum(t,a.domReference.current)||v||!h&&m&&eul(m.nodesRef.current,s).length>0||(u.emit("dismiss",!!g&&{preventScroll:!0}),i(!1))}function o(){i(!1)}let d=eui(a.floating.current);l&&d.addEventListener("keydown",t),f&&d.addEventListener("pointerdown",n);let v=(p?[...eua(a.reference.current)?eaG(a.reference.current):[],...eua(a.floating.current)?eaG(a.floating.current):[]]:[]).filter(t=>{var n;return t!==(null==(n=d.defaultView)?void 0:n.visualViewport)});return v.forEach(t=>t.addEventListener("scroll",o,{passive:!0})),()=>{l&&d.removeEventListener("keydown",t),f&&d.removeEventListener("pointerdown",n),v.forEach(t=>t.removeEventListener("scroll",o))}},[l,f,u,m,s,r,i,p,c,h,a,g]),c?{reference:{onPointerDown(){d&&(u.emit("dismiss"),i(!1))}},floating:{onPointerDownCapture(){y.current=!0}}}:{}},euy="ArrowUp",euv="ArrowDown",eub="ArrowLeft",eux="ArrowRight";function euM(t,n,r){return Math.floor(t/n)!==r}function euT(t,n){return n<0||n>=t.current.length}function euS(t,n){let{startingIndex:r=-1,decrement:i=!1,disabledIndices:o,amount:a=1}=void 0===n?{}:n,u=t.current,s=r;do{var c,l;s+=i?-a:a}while(s>=0&&s<=u.length-1&&(o?o.includes(s):null==u[s]||null!=(c=u[s])&&c.hasAttribute("disabled")||(null==(l=u[s])?void 0:l.getAttribute("aria-disabled"))==="true"));return s}function euw(t,n,r){switch(t){case"vertical":return n;case"horizontal":return r;default:return n||r}}function eu_(t,n){return euw(n,t===euy||t===euv,t===eub||t===eux)}function euI(t,n,r){return euw(n,t===euv,r?t===eub:t===eux)||"Enter"===t||" "==t||""===t}function euO(t,n){return euS(t,{disabledIndices:n})}function euk(t,n){return euS(t,{decrement:!0,startingIndex:t.current.length,disabledIndices:n})}let euC=function(t,n){let{open:r,onOpenChange:i,refs:a}=t,{listRef:u,activeIndex:s,onNavigate:c=()=>{},enabled:l=!0,selectedIndex:f=null,allowEscape:d=!1,loop:p=!1,nested:h=!1,rtl:m=!1,virtual:g=!1,focusItemOnOpen:y="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:b=!0,disabledIndices:x,orientation:M="vertical",cols:T=1}=void 0===n?{listRef:{current:[]},activeIndex:null,onNavigate(){}}:n,S=eun(),w=eur(),_=eup(r),I=eus(c),O=eus(eup(c)),k=o.useRef(y),C=o.useRef(f??-1),N=o.useRef(null),j=function(t){let n=(0,o.useRef)(t);return ea3(()=>{n.current=t}),n}(x),E=o.useRef(!1),R=o.useRef(-1),[D,A]=o.useState(),L=o.useCallback((t,n)=>{R.current=requestAnimationFrame(()=>{var r,i;g?A(null==(r=t.current[n.current])?void 0:r.id):null==(i=t.current[n.current])||i.focus({preventScroll:!0})})},[g]);function P(t){var n,o,s,c;if(E.current=!0,h&&(n=t.key,euw(M,m?n===eux:n===eub,n===euy))){eud(t),i(!1),(c=a.domReference.current)&&c instanceof euo(c).HTMLElement&&a.domReference.current.focus();return}let l=C.current,f=euO(u,x),y=euk(u,x);if("Home"===t.key&&(C.current=f,I(C.current)),"End"===t.key&&(C.current=y,I(C.current)),T>1){let v=C.current;if(t.key===euy){if(eud(t),-1===v)C.current=y;else if(C.current=euS(u,{startingIndex:v,amount:T,decrement:!0,disabledIndices:x}),p&&(v-T<f||C.current<0)){let b=v%T,S=y%T,w=y-(S-b);S===b?C.current=y:C.current=S>b?w:w-T}euT(u,C.current)&&(C.current=v),I(C.current)}if(t.key===euv&&(eud(t),-1===v?C.current=f:(C.current=euS(u,{startingIndex:v,amount:T,disabledIndices:x}),p&&v+T>y&&(C.current=euS(u,{startingIndex:v%T-T,amount:T,disabledIndices:x}))),euT(u,C.current)&&(C.current=v),I(C.current)),"both"===M){let _=Math.floor(v/T);t.key===eux&&(eud(t),v%T!=T-1?(C.current=euS(u,{startingIndex:v,disabledIndices:x}),p&&euM(C.current,T,_)&&(C.current=euS(u,{startingIndex:v-v%T-1,disabledIndices:x}))):p&&(C.current=euS(u,{startingIndex:v-v%T-1,disabledIndices:x})),euM(C.current,T,_)&&(C.current=v)),t.key===eub&&(eud(t),v%T!=0?(C.current=euS(u,{startingIndex:v,disabledIndices:x,decrement:!0}),p&&euM(C.current,T,_)&&(C.current=euS(u,{startingIndex:v+(T-v%T),decrement:!0,disabledIndices:x}))):p&&(C.current=euS(u,{startingIndex:v+(T-v%T),decrement:!0,disabledIndices:x})),euM(C.current,T,_)&&(C.current=v)),euT(u,C.current)&&(p&&Math.floor(y/T)===_?C.current=t.key===eub?y:euS(u,{startingIndex:v-v%T-1,disabledIndices:x}):C.current=v),I(C.current);return}}if(eu_(t.key,M)){if(eud(t),r&&!g&&euf(t.currentTarget.ownerDocument)===t.currentTarget){C.current=euI(t.key,M,m)?f:y,I(C.current);return}euI(t.key,M,m)?p?C.current=l>=y?d&&l!==u.current.length?-1:f:euS(u,{startingIndex:l,disabledIndices:x}):C.current=Math.min(y,euS(u,{startingIndex:l,disabledIndices:x})):p?C.current=l<=f?d&&-1!==l?u.current.length:y:euS(u,{startingIndex:l,decrement:!0,disabledIndices:x}):C.current=Math.max(f,euS(u,{startingIndex:l,decrement:!0,disabledIndices:x})),euT(u,C.current)?I(null):I(C.current)}}return ea3(()=>{l&&(!_&&r&&k.current&&null!=f&&I(f),_&&!r&&(cancelAnimationFrame(R.current),C.current=-1,O(null)))},[r,_,f,u,L,l,I,O]),ea3(()=>{l&&r&&(null==s?null==f&&(_&&(C.current=-1,L(u,C)),!_&&k.current&&(null!=N.current||!0===k.current&&null==N.current)&&(C.current=null==N.current||euI(N.current,M,m)||h?euO(u,j.current):euk(u,j.current),I(C.current),L(u,C))):euT(u,s)||(C.current=s,L(u,C)))},[r,_,s,f,h,u,I,L,l,d,M,m,g,j]),ea3(()=>{if(l&&!r&&_){var t,n;let i=null==w||null==(t=w.nodesRef.current.find(t=>t.id===S))||null==(n=t.context)?void 0:n.refs.floating.current;i&&!i.contains(euf(eui(i)))&&i.focus({preventScroll:!0})}},[l,r,_,w,S]),ea3(()=>{N.current=null}),l?{reference:{...g&&r&&null!=s&&{"aria-activedescendant":D},onKeyDown(t){if(E.current=!0,g&&r)return P(t);if((0===t.key.indexOf("Arrow")||"Enter"===t.key||" "===t.key||""===t.key)&&(N.current=t.key),h){var n,o,a;n=t.key,euw(M,m?n===eub:n===eux,n===euv)&&(eud(t),r?(C.current=euO(u,x),I(C.current)):i(!0));return}eu_(t.key,M)&&(null!=f&&(C.current=f),eud(t),!r&&b?i(!0):P(t),r&&I(C.current))}},floating:{"aria-orientation":"both"===M?void 0:M,...g&&null!=s&&{"aria-activedescendant":D},onKeyDown:P,onPointerMove(){E.current=!1}},item:{onFocus(t){let{currentTarget:n}=t,r=u.current.indexOf(n);-1!==r&&I(r)},onClick(t){let{currentTarget:n}=t;return n.focus({preventScroll:!0})},...v&&{onMouseMove(t){let{currentTarget:n}=t;if(n){let r=u.current.indexOf(n);-1!==r&&I(r)}},onPointerLeave(){if(!E.current&&(C.current=-1,L(u,C),I(null),!g)){var t;null==(t=a.floating.current)||t.focus({preventScroll:!0})}}}}}:{}},euN=new Hn("suggestion");function euj(t){var n,r,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t){if(Array.isArray(t))for(n=0;n<t.length;n++)t[n]&&(r=euj(t[n]))&&(i&&(i+=" "),i+=r);else for(n in t)t[n]&&(i&&(i+=" "),i+=n)}return i}function euE(){for(var t,n,r=0,i="";r<arguments.length;)(t=arguments[r++])&&(n=euj(t))&&(i&&(i+=" "),i+=n);return i}let euR=ent.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",eeh(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),euD={heading1:"heading1",heading2:"heading2",heading3:"heading3",heading4:"heading4",heading5:"heading5",heading6:"heading6",paragraph:"paragraph",preformatted:"preformatted",strong:"strong",em:"em",listItem:"list-item",oListItem:"o-list-item",list:"group-list-item",oList:"group-o-list-item",image:"image",embed:"embed",hyperlink:"hyperlink",label:"label",span:"span"},euA=()=>(++euA.i).toString();euA.i=0;let euL=t=>{let n=euz(t),r=[];for(let i=0;i<n.length;i++)r.push(euU(n[i]));return{key:euA(),children:r}},euP=(t,n=[])=>({key:euA(),type:t.type,text:"text"in t?t.text:void 0,node:t,children:n}),euF=t=>euP({type:euD.span,text:t,spans:[]}),euz=t=>{let n=t.slice(0);for(let r=0;r<n.length;r++){let i=n[r];if(i.type===euD.listItem||i.type===euD.oListItem){let o=[i];for(;n[r+1]&&n[r+1].type===i.type;)o.push(n[r+1]),n.splice(r,1);i.type===euD.listItem?n[r]={type:euD.list,items:o}:n[r]={type:euD.oList,items:o}}}return n},euU=t=>{if("text"in t)return euP(t,euW(t.spans,t));if("items"in t){let n=[];for(let r=0;r<t.items.length;r++)n.push(euU(t.items[r]));return euP(t,n)}return euP(t)},euW=(t,n,r)=>{if(!t.length)return[euF(n.text)];let i=t.slice(0);i.sort((t,n)=>t.start-n.start||n.end-t.end);let o=[];for(let a=0;a<i.length;a++){let u=i[a],s=r&&r.start||0,c=u.start-s,l=u.end-s,f=n.text.slice(c,l),d=[];for(let p=a;p<i.length;p++){let h=i[p];h!==u&&h.start>=u.start&&h.end<=u.end&&(d.push(h),i.splice(p,1),p--)}0===a&&c>0&&o.push(euF(n.text.slice(0,c)));let m={...u,text:f};o.push(euP(m,euW(d,{...n,text:f},u))),l<n.text.length&&o.push(euF(n.text.slice(l,i[a+1]?i[a+1].start-s:void 0)))}return o},euB=(t,n)=>euV(euL(t).children,n),euV=(t,n)=>{let r=[];for(let i=0;i<t.length;i++){let o=t[i],a=n(o.type,o.node,o.text,euV(o.children,n),o.key);null!=a&&r.push(a)}return r};euD.listItem,euD.oListItem,euD.list,euD.oList;let eu$=ent.create({name:"text",group:"inline"}),euK={groupBy:(t,n)=>t.reduce((t,r)=>{let i=n(r),o=(t.get(i)||[]).concat(r);return t.set(i,o)},new Map),sort:t=>[...t].sort((t,n)=>t.start-n.start),mergeOverlap(t){let n=this.groupBy(t,t=>t.type),r=Array.from(n.entries()).map(([t,n])=>(this.sort(n).reduce((t,n)=>{if(!t.length)return[n];let r=t.length-1,i=t[r];return i.end>=n.start?[...t.slice(0,r),{...i,end:n.end}]:[...t,n]},[]),n)).reduce((t,n)=>[...t,...n],[]);return this.sort(r)}},euY={fromPrismic:t=>n=>{switch(n.type){case"hyperlink":return esR.converter.fromPrismic(t)(n);case"em":return esj.converter.fromPrismic(t)(n);case"strong":return eoZ.converter.fromPrismic(t)(n);default:return}},toPrismic(t,n,r){let i=esV.find(n=>t.type.name===n.name);if(!i)throw Error(`Invalid mark extension '${t.type.name}'.`);let o=i.richTextNodeTypes;if("hyperlink"!==o)return{type:o,start:n,end:r};let a=i.converter.toPrismic(t);return{type:o,start:n,end:r,data:a}}},euq=eu$.extend({name:"text"}),euG={name:euq.name,component:euq,converter:{fromPrismic:t=>function(n,r,i=!1){let o={type:n,text:r.content.text,spans:r.content.spans||[]};return euB([o],function(t,n=!1){return(r,i,o,a)=>{if("span"===r&&o&&o.length)return n?[t.text(o)]:ean.splitTextToNodes(t,o)(n=>t.text(n));{let u=euY.fromPrismic(t)(i);return u?a.flat().map(t=>t.mark([...t.marks,u].sort((t,n)=>t.type.name.localeCompare(n.type.name)))):a.flat()}}}(t,i))[0]},toPrismic(t,n,r){let i=eoY.children.reduce(t,(t,n)=>{let r=n.type.name===ean.name?ean.converter.toPrismic(n):n.textContent,i=r?t.text+r:t.text,o=t.text.length,a=i.length,u=n.marks.length?eoY.marks.map(n,t=>euY.toPrismic(t,o,a)):void 0;return{...t,text:i,spans:u?[...t.spans,...u]:t.spans}},{text:"",spans:[]});return{type:n,content:{text:i.text,spans:[...euK.mergeOverlap(i.spans)].sort((t,n)=>t.type.localeCompare(n.type))},...r}}}};var euZ,euQ=((euZ=euQ||{}).LeftToRight="ltr",euZ.RightToLeft="rtl",euZ);let euH=Ks.RichTextNodeType.rtl,euJ=eeR.create({name:"textDirection",addOptions:()=>({supportedExtensionNames:[]}),addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{dir:{default:"ltr",parseHTML:t=>t.getAttribute("dir"),renderHTML:t=>({dir:"ltr"===t.dir?"ltr":"rtl"})}}}]},addCommands(){return{setDirection:t=>({commands:n})=>"rtl"===t?n.setRightToLeft():n.setLeftToRight(),toggleDirection:t=>({commands:n})=>n.setDirection("rtl"===t?"ltr":"rtl"),setRightToLeft:()=>({commands:t})=>this.options.supportedExtensionNames.every(n=>t.updateAttributes(n,{dir:"rtl"})),setLeftToRight:()=>({commands:t})=>this.options.supportedExtensionNames.every(n=>t.resetAttributes(n,"dir"))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),euX={parseNodeAttrsDirection:t=>"rtl"===t.dir?"rtl":"ltr",fromPrismic(t){let n="rtl"===t.direction?"rtl":"ltr";return{dir:n}},toPrismic(t){return{direction:this.parseNodeAttrsDirection(t.attrs)}}},eu0=euR.extend({name:"paragraph",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",eeh(this.options.HTMLAttributes,t),0]}}),eu1=new eoU([Ks.RichTextNodeType.paragraph],eu0.name,eu0,{fromPrismic:t=>function(n){var r;let i=euG.converter.fromPrismic(t)(eu0.name,n);return null==(r=t.nodes[eu0.name])?void 0:r.create(euX.fromPrismic(n),i)},toPrismic:t=>euG.converter.toPrismic(t,Ks.RichTextNodeType.paragraph,euX.toPrismic(t))},"Type '/' for commands"),eu2=eu1,eu4=["ArrowDown","ArrowUp","End","Home"],eu3=["Enter"],eu5=["Escape",...eu4,...eu3],eu9=eeR.create({name:"slash-commands",addOptions:()=>({nodeTypes:[]}),addProseMirrorPlugins(){let t=esQ(esK,this.options.nodeTypes);return t.length>1?[function({pluginKey:t=euN,editor:n,char:r="@",allowSpaces:i=!1,allowedPrefixes:o=[" "],startOfLine:a=!1,decorationTag:u="span",decorationClass:s="suggestion",command:c=()=>null,items:l=()=>[],render:f=()=>({}),allow:d=()=>!0}){let p,h=null==f?void 0:f(),m=new Q7({key:t,view(){return{update:async(t,r)=>{var i,o,a,u,s,f,d;let m=null===(i=this.key)||void 0===i?void 0:i.getState(r),g=null===(o=this.key)||void 0===o?void 0:o.getState(t.state),y=m.active&&g.active&&m.range.from!==g.range.from,v=!m.active&&g.active,b=m.active&&!g.active,x=!v&&!b&&m.query!==g.query,M=v||y,T=x&&!y,S=b||y;if(!M&&!T&&!S)return;let w=S&&!M?m:g,_=t.dom.querySelector(`[data-decoration-id="${w.decorationId}"]`);p={editor:n,range:w.range,query:w.query,text:w.text,items:[],command(t){c({editor:n,range:w.range,props:t})},decorationNode:_,clientRect:_?()=>{var r;let{decorationId:i}=null===(r=this.key)||void 0===r?void 0:r.getState(n.state),o=t.dom.querySelector(`[data-decoration-id="${i}"]`);return(null==o?void 0:o.getBoundingClientRect())||null}:null},M&&(null===(a=null==h?void 0:h.onBeforeStart)||void 0===a||a.call(h,p)),T&&(null===(u=null==h?void 0:h.onBeforeUpdate)||void 0===u||u.call(h,p)),(T||M)&&(p.items=await l({editor:n,query:w.query})),S&&(null===(s=null==h?void 0:h.onExit)||void 0===s||s.call(h,p)),T&&(null===(f=null==h?void 0:h.onUpdate)||void 0===f||f.call(h,p)),M&&(null===(d=null==h?void 0:h.onStart)||void 0===d||d.call(h,p))},destroy(){var t;p&&(null===(t=null==h?void 0:h.onExit)||void 0===t||t.call(h,p))}}},state:{init:()=>({active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}),apply(t,u,s,c){let{isEditable:l}=n,{composing:f}=n.view,{selection:p}=t,{empty:h,from:m}=p,g={...u};if(g.composing=f,l&&(h||n.view.composing)){(m<u.range.from||m>u.range.to)&&!f&&!u.composing&&(g.active=!1);let y=function(t){var n,r;let{char:i,allowSpaces:o,allowedPrefixes:a,startOfLine:u,$position:s}=t,c=i.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),l=RegExp(`\\s${c}$`),f=u?"^":"",d=o?RegExp(`${f}${c}.*?(?=\\s${c}|$)`,"gm"):RegExp(`${f}(?:^)?${c}[^\\s${c}]*`,"gm"),p=(null===(n=s.nodeBefore)||void 0===n?void 0:n.isText)&&s.nodeBefore.text;if(!p)return null;let h=s.pos-p.length,m=Array.from(p.matchAll(d)).pop();if(!m||void 0===m.input||void 0===m.index)return null;let g=m.input.slice(Math.max(0,m.index-1),m.index),y=RegExp(`^[${null==a?void 0:a.join("")}\0]?$`).test(g);if(null!==a&&!y)return null;let v=h+m.index,b=v+m[0].length;return o&&l.test(p.slice(b-1,b+1))&&(m[0]+=" ",b+=1),v<s.pos&&b>=s.pos?{range:{from:v,to:b},query:m[0].slice(i.length),text:m[0]}:null}({char:r,allowSpaces:i,allowedPrefixes:o,startOfLine:a,$position:p.$from}),v=`id_${Math.floor(4294967295*Math.random())}`;y&&d({editor:n,state:c,range:y.range})?(g.active=!0,g.decorationId=u.decorationId?u.decorationId:v,g.range=y.range,g.query=y.query,g.text=y.text):g.active=!1}else g.active=!1;return g.active||(g.decorationId=null,g.range={from:0,to:0},g.query=null,g.text=null),g}},props:{handleKeyDown(t,n){var r;let{active:i,range:o}=m.getState(t.state);return i&&(null===(r=null==h?void 0:h.onKeyDown)||void 0===r?void 0:r.call(h,{view:t,event:n,range:o}))||!1},decorations(t){let{active:n,range:r,decorationId:i}=m.getState(t);return n?Xp.create(t.doc,[Xl.inline(r.from,r.to,{nodeName:u,class:s,"data-decoration-id":i})]):null}}});return m}({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow({state:t}){let n=t.selection.$from;return n.parent.type.name===eu2.name&&1===n.depth},command({editor:t,props:n,range:r}){n.runCommands(t,{deleteRange:r})},items({query:n}){let r=n.toLocaleLowerCase().trim();return t.filter(t=>{var n,i;return(null==(n=t.shortText)?void 0:n.toLocaleLowerCase().includes(r))||(null==(i=t.text)?void 0:i.toLocaleLowerCase().includes(r))})},render(){let t;return{onStart(n){t=new er0(eu8,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate(n){null==t||t.updateProps(n)},onKeyDown({event:n}){var r;return Boolean(eu5.includes(n.key)&&(null==(r=null==t?void 0:t.ref)?void 0:r.handleKeyDown(n)))},onExit(){null==t||t.destroy(),null==t||t.element.remove()}}}})]:[]}}),eu8=(0,o.forwardRef)(function({command:t,decorationNode:n,editor:r,items:i},a){var c,l,f,d,p;let[h,m]=(0,o.useState)(!0),g=parseFloat(u.TV.space[0]),{context:y,floating:b,reference:x,strategy:M,x:T,y:S}=function(t){let{open:n=!1,onOpenChange:r,whileElementsMounted:i,placement:a,middleware:u,strategy:s,nodeId:c}=void 0===t?{}:t,[l,f]=o.useState(null),d=eur(),p=o.useRef(null),h=o.useRef({}),m=o.useState(()=>(function(){let t=new Map;return{emit(n,r){var i;null==(i=t.get(n))||i.forEach(t=>t(r))},on(n,r){t.set(n,[...t.get(n)||[],r])},off(n,r){t.set(n,(t.get(n)||[]).filter(t=>t!==r))}}})())[0],g=function(t){void 0===t&&(t={});let{placement:n="bottom",strategy:r="absolute",middleware:i=[],platform:a,whileElementsMounted:u,open:s}=t,[c,l]=o.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[f,d]=o.useState(i);ea2(f,i)||d(i);let p=o.useRef(null),h=o.useRef(null),m=o.useRef(c),g=ea4(u),y=ea4(a),[b,x]=o.useState(null),[M,T]=o.useState(null),S=o.useCallback(t=>{p.current!==t&&(p.current=t,x(t))},[]),w=o.useCallback(t=>{h.current!==t&&(h.current=t,T(t))},[]),_=o.useCallback(()=>{if(!p.current||!h.current)return;let t={placement:n,strategy:r,middleware:f};y.current&&(t.platform=y.current),ea0(p.current,h.current,t).then(t=>{let n={...t,isPositioned:!0};I.current&&!ea2(m.current,n)&&(m.current=n,v.flushSync(()=>{l(n)}))})},[f,n,r,y]);ea1(()=>{!1===s&&m.current.isPositioned&&(m.current.isPositioned=!1,l(t=>({...t,isPositioned:!1})))},[s]);let I=o.useRef(!1);ea1(()=>(I.current=!0,()=>{I.current=!1}),[]),ea1(()=>{if(b&&M){if(g.current)return g.current(b,M,_);_()}},[b,M,_,g]);let O=o.useMemo(()=>({reference:p,floating:h,setReference:S,setFloating:w}),[S,w]),k=o.useMemo(()=>({reference:b,floating:M}),[b,M]);return o.useMemo(()=>({...c,update:_,refs:O,elements:k,reference:S,floating:w}),[c,_,O,k,S,w])}({placement:a,middleware:u,strategy:s,whileElementsMounted:i}),y=eus(r),b=o.useMemo(()=>({...g.refs,domReference:p}),[g.refs]),x=o.useMemo(()=>({...g,refs:b,dataRef:h,nodeId:c,events:m,open:n,onOpenChange:y,_:{domReference:l}}),[g,c,m,n,y,b,l]);ea3(()=>{let t=null==d?void 0:d.nodesRef.current.find(t=>t.id===c);t&&(t.context=x)});let{reference:M}=g,T=o.useCallback(t=>{(eua(t)||null===t)&&(x.refs.domReference.current=t,f(t)),M(t)},[M,x.refs]);return o.useMemo(()=>({...g,context:x,refs:b,reference:T}),[g,b,x,T])}({middleware:[(void 0===(c=g)&&(c=0),{name:"offset",options:c,async fn(t){let{x:n,y:r}=t,i=await eax(t,c);return{x:n+i.x,y:r+i.y,data:i}}}),(void 0===l&&(l={}),{name:"flip",options:l,async fn(t){var n,r,i,o;let{placement:a,middlewareData:u,rects:s,initialPlacement:c,platform:f,elements:d}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...b}=l,x=eau(a),M=eau(c)===c,T=await (null==f.isRTL?void 0:f.isRTL(d.floating)),S=m||(M||!v?[eay(c)]:function(t){let n=eay(t);return[eab(t),n,eab(n)]}(c));m||"none"===y||S.push(...function(t,n,r,i){let o=eao(t),a=function(t,n,r){let i=["left","right"],o=["right","left"];switch(t){case"top":case"bottom":return r?n?o:i:n?i:o;case"left":case"right":return n?["top","bottom"]:["bottom","top"];default:return[]}}(eau(t),"start"===r,i);return o&&(a=a.map(t=>t+"-"+o),n&&(a=a.concat(a.map(eab)))),a}(c,v,y,T));let w=await ead(t,b),_=[],I=(null==(n=u.flip)?void 0:n.overflows)||[];if(p&&_.push(w[x]),h){let{main:O,cross:k}=function(t,n,r){void 0===r&&(r=!1);let i=eao(t),o=eas(t),a=eaa(o),u="x"===o?i===(r?"end":"start")?"right":"left":"start"===i?"bottom":"top";return n.reference[a]>n.floating[a]&&(u=eay(u)),{main:u,cross:eay(u)}}(a,s,T);_.push(w[O],w[k])}if(I=[...I,{placement:a,overflows:_}],!_.every(t=>t<=0)){let C=((null==(r=u.flip)?void 0:r.index)||0)+1,N=[c,...S][C];if(N)return{data:{index:C,overflows:I},reset:{placement:N}};let j=null==(i=I.filter(t=>t.overflows[0]<=0).sort((t,n)=>t.overflows[1]-n.overflows[1])[0])?void 0:i.placement;if(!j)switch(g){case"bestFit":{let E=null==(o=I.map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,n)=>t+n,0)]).sort((t,n)=>t[1]-n[1])[0])?void 0:o[0];E&&(j=E);break}case"initialPlacement":j=c}if(a!==j)return{reset:{placement:j}}}return{}}}),(d={limiter:(void 0===f&&(f={}),{options:f,fn(t){let{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:u=0,mainAxis:s=!0,crossAxis:c=!0}=f,l={x:n,y:r},d=eas(i),p=eaM(d),h=l[d],m=l[p],g="function"==typeof u?u(t):u,y="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(s){let v="y"===d?"height":"width",b=o.reference[d]-o.floating[v]+y.mainAxis,x=o.reference[d]+o.reference[v]-y.mainAxis;h<b?h=b:h>x&&(h=x)}if(c){var M,T;let S="y"===d?"width":"height",w=["top","left"].includes(eau(i)),_=o.reference[p]-o.floating[S]+(w&&(null==(M=a.offset)?void 0:M[p])||0)+(w?0:y.crossAxis),I=o.reference[p]+o.reference[S]+(w?0:(null==(T=a.offset)?void 0:T[p])||0)-(w?y.crossAxis:0);m<_?m=_:m>I&&(m=I)}return{[d]:h,[p]:m}}})},{name:"shift",options:d,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:u={fn(t){let{x:n,y:r}=t;return{x:n,y:r}}},...s}=d,c={x:n,y:r},l=await ead(t,s),f=eas(eau(i)),p=eaM(f),h=c[f],m=c[p];if(o){let g=h+l["y"===f?"top":"left"],y=h-l["y"===f?"bottom":"right"];h=eam(g,h,y)}if(a){let v=m+l["y"===p?"top":"left"],b=m-l["y"===p?"bottom":"right"];m=eam(v,m,b)}let x=u.fn({...t,[f]:h,[p]:m});return{...x,data:{x:x.x-n,y:x.y-r}}}})],onOpenChange:m,open:h,placement:"top-start",strategy:"fixed",whileElementsMounted:eaX});(0,o.useLayoutEffect)(()=>{x(n)},[x,n]),(0,o.useEffect)(()=>{let t,n=()=>{t=window.setTimeout(()=>{m(!0)})},i=()=>{m(!1)};return r.on("focus",n).on("blur",i),()=>{r.off("focus",n).off("blur",i),clearTimeout(t)}},[r]);let[w,_]=(0,o.useState)(0),I=(0,o.useRef)([]);(0,s.pQ)(i,()=>{_(0),I.current=[]});let{getFloatingProps:O,getItemProps:C,getReferenceProps:N}=(p=[eug(y,{outsidePointerDown:!1}),euC(y,{activeIndex:w,listRef:I,onNavigate(t){_(n=>t??n)},openOnArrowKeyDown:!1,virtual:!0}),euh(y,{role:"menu"})],{getReferenceProps:t=>euc(t,p,"reference"),getFloatingProps:t=>euc(t,p,"floating"),getItemProps:t=>euc(t,p,"item")}),j=N().onKeyDown;(0,o.useImperativeHandle)(a,()=>({handleKeyDown(n){if(!h)return!1;if(eu4.includes(n.key)&&j(n),eu3.includes(n.key)){let r=i[w];void 0!==r&&t(r)}return!0}}),[w,t,i,j,h]);let E=(0,o.useId)();return h?k.jsxs("div",{...O(),className:u._s.content,ref:b,style:{top:parseFloat(u.TV.space[0]),left:parseFloat(u.TV.space[0]),minWidth:256,position:M,transform:null!==T&&null!==S?`translate3d(${Math.round(T)}px, ${Math.round(S)}px, 0)`:"translate3d(0, -200%, 0)"},children:[i.map((n,r)=>(0,o.createElement)(eu6,{...C({onClick(){t(n)},onPointerDown(t){t.preventDefault()}}),"data-highlighted":r===w?"":void 0,id:`${E}[${r}]`,key:n.nodeType,ref(t){I.current[r]=t},shortcut:`/${n.shortText??""}`,startIcon:n.icon},n.text)),0===i.length?k.jsx(eu6,{...C({onPointerDown(t){t.preventDefault()}}),disabled:!0,id:`${E}[0]`,ref(t){I.current[0]=t},children:"No results"}):null]}):null}),eu6=(0,o.forwardRef)(function({children:t,disabled:n,shortcut:r,startIcon:i,...a},s){return k.jsxs("div",{...a,...n?{"aria-disabled":!0,"data-disabled":!0}:{},className:u._s.item,ref:s,role:"menuitem",children:[(0,o.isValidElement)(i)?(0,o.cloneElement)(i,{className:euE(i.props.className,u._s.itemStartIcon)}):null,k.jsx(u.xv,{className:euE(u._s.itemText,u._s.itemTextColor.grey),component:"span",children:t}),r?k.jsx(u.xv,{className:u._s.itemShortcut,color:"inherit",component:"span",variant:"inherit",children:r}):null]})}),eu7=eoX.extend({name:"bulletList",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",eeh(this.options.HTMLAttributes,t),0]}}).configure({itemTypeName:"listItem"}),ese=new eoV([Ks.RichTextNodeType.list],eu7.name,eu7,{fromPrismic:t=>function(n){var r;let i=eo4.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[eu7.name])?void 0:r.create(euX.fromPrismic(n),i)},toPrismic:t=>eoY.children.map(t,t=>eo4.converter.toPrismic(t,Ks.RichTextNodeType.list).filter(l.$)).flat()}),est=ese,esn=/^```([a-z]+)?[\s\n]$/,esr=/^~~~([a-z]+)?[\s\n]$/,esi=ent.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var n;let{languageClassPrefix:r}=this.options,i=[...(null===(n=t.firstElementChild)||void 0===n?void 0:n.classList)||[]].filter(t=>t.startsWith(r)).map(t=>t.replace(r,""))[0];return i||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:t,HTMLAttributes:n}){return["pre",eeh(this.options.HTMLAttributes,n),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:n})=>n.setNode(this.name,t),toggleCodeBlock:t=>({commands:n})=>n.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:n}=this.editor.state.selection,r=1===n.pos;return!!t&&n.parent.type.name===this.name&&(!!r||!n.parent.textContent.length)&&this.editor.commands.clearNodes()},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:n}=t,{selection:r}=n,{$from:i,empty:o}=r;if(!o||i.parent.type!==this.type)return!1;let a=i.parentOffset===i.parent.nodeSize-2,u=i.parent.textContent.endsWith(`
|
|
95
|
-
|
|
96
|
-
`);return!!a&&!!u&&t.chain().command(({tr:t})=>(t.delete(i.pos-2,i.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;let{state:n}=t,{selection:r,doc:i}=n,{$from:o,empty:a}=r;if(!a||o.parent.type!==this.type||o.parentOffset!==o.parent.nodeSize-2)return!1;let u=o.after();return!(void 0===u||i.nodeAt(u))&&t.commands.exitCode()}}},addInputRules(){return[et6({find:esn,type:this.type,getAttributes:t=>({language:t[1]})}),et6({find:esr,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Q7({key:new Hn("codeBlockVSCodeHandler"),props:{handlePaste:(t,n)=>{if(!n.clipboardData||this.editor.isActive(this.type.name))return!1;let r=n.clipboardData.getData("text/plain"),i=n.clipboardData.getData("vscode-editor-data"),o=i?JSON.parse(i):void 0,a=null==o?void 0:o.mode;if(!r||!a)return!1;let{tr:u}=t.state;return u.replaceSelectionWith(this.type.create({language:a})),u.setSelection(QZ.near(u.doc.resolve(Math.max(0,u.selection.from-2)))),u.insertText(r.replace(/\r\n?/g,`
|
|
97
|
-
`)),u.setMeta("paste",!0),t.dispatch(u),!0}}})]}}),eso=esi.extend({name:"preformatted",addAttributes(){return{language:{default:null,parseHTML:t=>{var n;let{languageClassPrefix:r}=this.options,i=[...(null==(n=t.firstElementChild)?void 0:n.classList)||[]].filter(t=>t.startsWith(r)).map(t=>t.replace(r,""))[0];return i||null},renderHTML:t=>t.language?{class:this.options.languageClassPrefix+t.language}:null}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({HTMLAttributes:t}){return["pre",eeh(this.options.HTMLAttributes),["code",t,0]]}}).configure({exitOnTripleEnter:!1}),esa=new eoU([Ks.RichTextNodeType.preformatted],eso.name,eso,{fromPrismic:t=>function(n){var r;let i=euG.converter.fromPrismic(t)(eso.name,n,!0);return null==(r=t.nodes[eso.name])?void 0:r.create(euX.fromPrismic(n),i)},toPrismic:t=>euG.converter.toPrismic(t,Ks.RichTextNodeType.preformatted,euX.toPrismic(t))},"",!0);function esu(t){let{editor:n,getPos:r,node:i}=t,[a,u]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{function t(){let{from:t,to:o}=n.state.selection,a=r(),s=r()+i.nodeSize;u(t<=a&&o>=s)}function o(){u(!1)}return n.on("blur",o),n.on("selectionUpdate",t),()=>{n.off("blur",o),n.off("selectionUpdate",t)}},[n,r,i.nodeSize]),{selected:a}}function ess(t){let n=(0,o.useRef)(null),r=(0,o.useRef)(null),{onKeyDown:i,url:a,urlChanged:c,onContentChange:l,debouncedUrl:f,content:d}=function(t,n,r){let{node:i}=t,a=i.attrs.content,u=(0,s.R9)(t.updateAttributes),c=(0,s.$P)({initialState:(null==a?void 0:a.embed_url)??"",startTransition:o.startTransition});function l(t){u({content:t})}let{onKeyDown:f}=function(t,n,r,i){let{editor:a,getPos:u,node:s}=t,[c,l]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{c&&t.editor.isFocused&&er4(()=>{var t;return null==(t=r.current)?void 0:t.focus()})},[r,c,t.editor.isFocused]),{containerRef:i,inputRef:r,onKeyDown:function(t){let r=u(),i=u()+s.nodeSize;"Enter"===t.code&&(l(!1),a.chain().insertContentAt(i,{type:"paragraph"}).focus(i+1).run()),"Backspace"===t.code&&""===n&&a.chain().deleteRange({from:r,to:i}).focus(i+1).run(),"ArrowUp"===t.code&&(l(!1),a.chain().focus(r-1).run()),"ArrowDown"===t.code&&(l(!1),a.chain().focus(i+1).run())}}}(t,c.value,n,r);return{inputRef:n,containerRef:r,onKeyDown:f,url:c.value,urlChanged:function(t){c.set(t),(0,p.ju)(t)||l(void 0)},onContentChange:l,debouncedUrl:c.debouncedValue,content:t.node.attrs.content}}(t,n,r),{selected:h}=esu(t);return k.jsx(erX,{className:"custom-embed",children:k.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:k.jsxs(u.xu,{flexDirection:"column",children:[k.jsxs(u.xu,{flexGrow:1,alignItems:"center",children:[k.jsx(u.I5,{size:"small",name:"cloud",color:"grey11"}),k.jsx(u.xu,{flexGrow:1,flexDirection:"column",ref:r,children:k.jsx(u.oi,{id:"id",ref:n,value:a,variant:(0,p.ju)(a)?"link":"normal",placeholder:"Paste your link here",onValueChange:c,onKeyDown:i})})]}),(0,p.ju)(a)&&k.jsx(er3,{selected:h,debouncedUrl:f,onContentChange:l,content:d})]})})})}let esc=ent.create({name:"embed",group:"block",atom:!0,content:"block*",marks:"",addAttributes:()=>({content:{default:void 0}}),addCommands(){return{setEmbed:()=>({tr:t,dispatch:n})=>{let r=this.type.create();return n&&t.replaceSelectionWith(r),!0}}},parseHTML:()=>[{tag:"embed"}],renderHTML:()=>["embed"],addNodeView:()=>er2(ess)}),esl=new class{constructor(t,n,r,i){T(this,"extType","node"),T(this,"nodeType","embed"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}([Ks.RichTextNodeType.embed],esc.name,esc,{fromPrismic:t=>function(n){var r;return null==(r=t.nodes[esc.name])?void 0:r.create({content:n.data})},toPrismic:t=>void 0===t.attrs.content?{type:"embed",data:{type:"embed",embed_url:"",__TYPE__:"EmbedContent",all:[]}}:{type:"embed",data:{...t.attrs.content}}}),esf=ent.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:n}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,eeh(this.options.HTMLAttributes,n),0]},addCommands(){return{setHeading:t=>({commands:n})=>!!this.options.levels.includes(t.level)&&n.setNode(this.name,t),toggleHeading:t=>({commands:n})=>!!this.options.levels.includes(t.level)&&n.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce((t,n)=>({...t,[`Mod-Alt-${n}`]:()=>this.editor.commands.toggleHeading({level:n})}),{})},addInputRules(){return this.options.levels.map(t=>et6({find:RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),esd="heading";function esp(t){switch(t){case 1:return Ks.RichTextNodeType.heading1;case 2:return Ks.RichTextNodeType.heading2;case 3:return Ks.RichTextNodeType.heading3;case 4:return Ks.RichTextNodeType.heading4;case 5:return Ks.RichTextNodeType.heading5;case 6:return Ks.RichTextNodeType.heading6}}function esh(t){return{fullName:esp(t),level:t}}let esm=[1,2,3,4,5,6];function esg(t,n=esm){let r=RegExp(`^heading([${n.join(",")}]){1}$`),i=t.match(r);if(!i||!i[1])return;let o=parseInt(i[1]);return{fullName:esp(o),level:o}}function esy(t,n){let r=t.level;if(n.includes(r))return{fullName:esp(r),level:r}}let esv=t=>{let n=t[0]??1;return{fromPrismic:r=>function(i){var o;let a=euG.converter.fromPrismic(r)(esd,i),u=esg(i.type,t)||esh(n);return null==(o=r.nodes[esd])?void 0:o.create({level:u.level,...euX.fromPrismic(i)},a)},toPrismic(r){let{fullName:i}=esy(r.attrs,t)||esh(n);return euG.converter.toPrismic(r,i,euX.toPrismic(r))}}},esb={name:esd,build(t){var n,r;let i=t?t.size?Array.from(t.values()).reduce((t,n)=>{let r=esg(n);return r?[...t,r.level]:t},[]).sort((t,n)=>t-n):[]:esm;if(!i)return;let o=i.map(t=>esp(t));return new eoB(o,esf.extend({name:"heading"}).configure({levels:i}),i,esv(i),t=>{let n=esy(t,i);return n&&`Heading ${n.level}`})}};function esx(t){let{node:n}=t,r=n.attrs.content,{selected:i}=esu(t),a={width:null==r?void 0:r.width,height:null==r?void 0:r.height,name:eiu},{onMediaSelected:s,onCropperDialogClose:c,isUpdating:l,updateContent:f,onClear:d}=function(t){let{content:n,thumbnail:r,imageViewProps:{getPos:i,updateAttributes:a,editor:u,node:s}}=t,[c,l]=(0,o.useTransition)();function f(t){l(()=>a({content:t}))}return{onMediaSelected:function(t){let r=eiG(t),o=i()+s.nodeSize;f({__TYPE__:"ImageContent",...n,...r}),u.chain().focus(o+1).run()},onCropperDialogClose:function({croppedImages:t}){if(!n)return;let i=t[r.name];if(!i)return;let o=eiW({content:n,thumbnail:r.name,croppedImage:i});o!==n&&f(o)},isUpdating:c,updateContent:f,onClear:function(){let t=i(),n=i()+s.nodeSize;u.chain().deleteRange({from:t,to:n}).focus(n).run()}}}({content:r,thumbnail:a,imageViewProps:t}),p=(null==r?void 0:r.width)===0&&(null==r?void 0:r.height)===0,h=r&&!p?[`${r.width}x${r.height}px`]:[],m=(null==r?void 0:r.alt)??"",g={thumbnail:a,contentView:r,labels:eis(a,r,r)};return k.jsx(erX,{className:"custom-image",children:k.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:k.jsx(eiq,{content:r,selected:i,fieldLabel:"Feature image",imageLabel:h,initialImages:[g],readOnly:!1,onMediaSelected:s,onCropperDialogClose:c,onClear:d,children:k.jsx(o.Suspense,{fallback:esM,children:null!=r&&r.url?k.jsxs(u.aY,{children:[k.jsx(u.hM,{children:k.jsx(u.xu,{flexDirection:"column",alignItems:"center",position:"relative",height:400,children:k.jsx(u.xu,{justifyContent:"center",flexGrow:1,maxHeight:"100%",maxWidth:"100%",children:k.jsx(u.kg,{src:eif(r.url),alt:m,sizing:"contain"})})})}),k.jsx(eiz,{onValueChange(t){f({...r,alt:t})},altText:m,readOnly:!r,selected:i})]}):k.jsx(eiF,{isUpdating:l,readOnly:!1,onMediaSelected:s})})})})})}let esM=k.jsx("div",{style:{height:468}}),esT=ent.create({name:"image",group:"block",atom:!0,addAttributes:()=>({content:{default:void 0}}),addCommands(){return{setImage:()=>t=>{let{dispatch:n,tr:r}=t,i=this.type.create();return n&&r.replaceSelectionWith(i),!0}}},parseHTML:()=>[{tag:"image"}],renderHTML:({HTMLAttributes:t})=>["image",eeh(t)],addNodeView:()=>er2(esx)}),esS=new class{constructor(t,n,r,i){T(this,"extType","node"),T(this,"nodeType","image"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}([Ks.RichTextNodeType.image],esT.name,esT,{fromPrismic:t=>function(n){var r;return null==(r=t.nodes[esT.name])?void 0:r.create({content:n.data})},toPrismic(t){if(void 0!==t.attrs.content)return{type:"image",data:{...t.attrs.content}}}}),esw=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,es_=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,esI=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,esO=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,esk=ene.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:t=>"normal"!==t.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:t}){return["em",eeh(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[et8({find:esw,type:this.type}),et8({find:esI,type:this.type})]},addPasteRules(){return[enr({find:es_,type:this.type}),enr({find:esO,type:this.type})]}}),esC=esk.extend({name:"em"}),esN=new class{constructor(t,n,r){T(this,"extType",eoF.Mark),T(this,"richTextNodeTypes",Ks.RichTextNodeType.em),this.name=t,this.component=n,this.converter=r}}(esC.name,esC,{fromPrismic:t=>function(){var n;return null==(n=t.marks[esC.name])?void 0:n.create()},toPrismic(){}}),esj=esN,esE=ene.create({name:"hyperlink",priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions:()=>({openOnClick:!1,linkOnPaste:!0,autolink:!0,protocols:[],htmlAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null,id:""},validate:void 0}),addAttributes:()=>({href:{default:""},id:{default:""},target:{default:"_blank"},rel:{default:"noopener noreferrer nofollow"},class:{default:null},media:{default:null}}),parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])'}],renderHTML({HTMLAttributes:t}){return["a",eeh(this.options.htmlAttributes,t),0]},addCommands(){return{setWebLink:t=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,t).setMeta("preventAutolink",!0).run(),setDocumentLink:t=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,t).setMeta("preventAutolink",!0).run(),setMediaLink:t=>({chain:n})=>{let r=esD(eou({media:t.media}).value);return n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMark(this.name,{media:r}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}}}),esR=new class{constructor(t,n,r){T(this,"extType",eoF.Mark),T(this,"richTextNodeTypes",Ks.RichTextNodeType.hyperlink),this.name=t,this.component=n,this.converter=r}}(esE.name,esE,{fromPrismic:t=>function(n){var r,i,o,a;let u=n.data;if("DocumentLink"===u.__TYPE__){let s={type:esE.name,id:u.id};return null==(r=t.marks[esE.name])?void 0:r.create(s)}if("ImageLink"===u.__TYPE__){let c={type:esE.name,media:esD(u)};return null==(i=t.marks[esE.name])?void 0:i.create(c)}if("FileLink"===u.__TYPE__){let l={type:esE.name,media:esD(u)};return null==(o=t.marks[esE.name])?void 0:o.create(l)}if("ExternalLink"===u.__TYPE__){let f={type:esE.name,url:u.url,href:u.url,target:u.target};return null==(a=t.marks[esE.name])?void 0:a.create(f)}},toPrismic:t=>t.attrs.media?esA(t.attrs.media):t.attrs.id?{__TYPE__:"DocumentLink",id:t.attrs.id}:{__TYPE__:"ExternalLink",url:t.attrs.href,target:t.attrs.target}});function esD(t){return JSON.stringify(t)}function esA(t){return JSON.parse(t)}let esL=ent.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",eeh(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),esP=ene.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",eeh(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:n})=>{let r=etI(t,this.type);return!!Object.entries(r).some(([,t])=>!!t)||n.unsetMark(this.name)}}}}),esF=/^(\d+)\.\s$/,esz=ent.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:t}){let{start:n,...r}=t;return 1===n?["ol",eeh(this.options.HTMLAttributes,r),0]:["ol",eeh(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:n})=>this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(esL.name,this.editor.getAttributes(esP.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=et7({find:esF,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=et7({find:esF,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(esP.name)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[t]}}),esU=esz.extend({name:"orderedList",addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}),renderHTML({HTMLAttributes:t}){let{start:n,...r}=t;return 1===n?["ol",eeh(this.options.HTMLAttributes,r),0]:["ol",eeh(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}}).configure({itemTypeName:"listItem"}),esW=new eoV([Ks.RichTextNodeType.orderedList],esU.name,esU,{fromPrismic:t=>function(n){var r;let i=eo4.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[esU.name])?void 0:r.create(euX.fromPrismic(n),i)},toPrismic:t=>eoY.children.map(t,t=>eo4.converter.toPrismic(t,Ks.RichTextNodeType.orderedList).filter(l.$)).flat()}),esB=esW,esV=[eoZ,esj,esR];function es$(t){return[eu2,est,esB,esb.build(t),esa,esl,esS,...esV].filter(l.$)}let esK=[{nodeType:Ks.RichTextNodeType.paragraph,icon:"textFields",isActive:t=>t.isActive(eu2.name)&&!t.isActive(est.name)&&!t.isActive(esB.name),runCommands:esG((t,n)=>t.clearNodes().setDirection(esZ(n))),shortText:"par",text:"Paragraph"},{nodeType:Ks.RichTextNodeType.heading1,icon:"looks1",isActive:t=>t.isActive(esb.name,{level:1}),runCommands:esG((t,n)=>t.setHeading({level:1}).setDirection(esZ(n))),shortText:"h1",text:"Heading 1"},{nodeType:Ks.RichTextNodeType.heading2,icon:"looks2",isActive:t=>t.isActive(esb.name,{level:2}),runCommands:esG((t,n)=>t.setHeading({level:2}).setDirection(esZ(n))),shortText:"h2",text:"Heading 2"},{nodeType:Ks.RichTextNodeType.heading3,icon:"looks3",isActive:t=>t.isActive(esb.name,{level:3}),runCommands:esG((t,n)=>t.setHeading({level:3}).setDirection(esZ(n))),shortText:"h3",text:"Heading 3"},{nodeType:Ks.RichTextNodeType.heading4,icon:"looks4",isActive:t=>t.isActive(esb.name,{level:4}),runCommands:esG((t,n)=>t.setHeading({level:4}).setDirection(esZ(n))),shortText:"h4",text:"Heading 4"},{nodeType:Ks.RichTextNodeType.heading5,icon:"looks5",isActive:t=>t.isActive(esb.name,{level:5}),runCommands:esG((t,n)=>t.setHeading({level:5}).setDirection(esZ(n))),shortText:"h5",text:"Heading 5"},{nodeType:Ks.RichTextNodeType.heading6,icon:"looks6",isActive:t=>t.isActive(esb.name,{level:6}),runCommands:esG((t,n)=>t.setHeading({level:6}).setDirection(esZ(n))),shortText:"h6",text:"Heading 6"},{nodeType:Ks.RichTextNodeType.list,icon:"formatListBulleted",isActive:t=>t.isActive(est.name),runCommands:esG((t,n)=>t.toggleBulletList().setDirection(esZ(n))),shortText:"bull",text:"Bulleted list"},{nodeType:Ks.RichTextNodeType.orderedList,icon:"formatListNumbered",isActive:t=>t.isActive(esB.name),runCommands:esG((t,n)=>t.toggleOrderedList().setDirection(esZ(n))),shortText:"num",text:"Numbered list"},{nodeType:Ks.RichTextNodeType.preformatted,icon:"dataObject",isActive:t=>t.isActive(esa.name),runCommands:esG((t,n)=>t.setCodeBlock().setDirection(esZ(n))),shortText:"code",text:"Code"},{nodeType:Ks.RichTextNodeType.embed,icon:"cloud",isActive:t=>t.isActive(esl.name),runCommands:esG(t=>t.setEmbed()),shortText:"emb",text:"Embed"},{nodeType:Ks.RichTextNodeType.image,icon:"image",isActive:t=>t.isActive(esS.name),runCommands:esG(t=>t.setImage()),shortText:"img",text:"Image"}],esY=[{nodeType:Ks.RichTextNodeType.strong,icon:"formatBold",isActive:t=>t.isActive(eoZ.name),runCommands:esG(t=>t.toggleBold())},{nodeType:Ks.RichTextNodeType.em,icon:"formatItalic",isActive:t=>t.isActive(esj.name),runCommands:esG(t=>t.toggleItalic())}],esq=[{nodeType:Ks.RichTextNodeType.rtl,icon:"formatTextDirectionRToL",isActive:t=>t.isActive({dir:euQ.RightToLeft}),runCommands:esG((t,n)=>t.toggleDirection(esZ(n)))}];function esG(t){return(n,r={})=>{let i=!0===r.can?n.can().chain():n.chain().focus();return void 0!==r.deleteRange&&(i=i.deleteRange(r.deleteRange)),r.can?function(t,n,r){try{return r(n,t).run()}catch{return!1}}(n,i,t):t(i,n).run()}}function esZ(t){let n=t.state.selection.$from.parent.attrs;return euX.parseNodeAttrsDirection(n)}function esQ(t,n){return t.filter(t=>n.includes(t.nodeType))}function esH(t){let{items:n,editor:r}=t;return 0===n.length?null:k.jsxs(k.Fragment,{children:[k.jsx(u.Jf,{}),n.map(t=>k.jsx(u.r8,{disabled:!t.runCommands(r,{can:!0}),onPressedChange(){t.runCommands(r)},pressed:t.isActive(r),startIcon:t.icon},t.nodeType))]})}function esJ(t){let{bubbleMenuContainerRef:n}=t,{disabled:r,showWebLinkModal:i,showDocumentsLinkModal:o,showMediaLinkModal:a}=function(t){let{editor:n,setModal:r}=t;return{disabled:!esG(t=>t.setWebLink({href:""}))(n,{can:!0}),showWebLinkModal:function(){r("webLink")},showDocumentsLinkModal:function(){r("documentLink")},showMediaLinkModal:function(){r("mediaLink")}}}(t);return k.jsxs(k.Fragment,{children:[k.jsx(u.Jf,{}),k.jsxs(u.yM,{density:"compact",children:[k.jsx(u.hA,{disabled:r,startIcon:"link",onClick:i},Ks.RichTextNodeType.hyperlink),k.jsxs(u.h_,{children:[k.jsx(u.$F,{children:k.jsx(u.hA,{startIcon:"arrowDropDown"})}),k.jsxs(u.AW,{align:"end",containerRef:n,children:[k.jsx(u.Xi,{startIcon:k.jsx(u.I5,{name:"public"}),onSelect:i,children:"Link to web page"}),k.jsx(u.Xi,{startIcon:k.jsx(u.I5,{name:"description"}),onSelect:o,children:"Link to document"}),k.jsx(u.Xi,{startIcon:k.jsx(u.I5,{name:"image"}),onSelect:a,children:"Link to media"})]})]})]})]})}function esX(t){let{docId:n,onEdit:r,onUnlink:i}=t,o=function(t){let n=tO();n.searchDocuments||tC("searchDocuments");let{coreApiUrl:r,env:i}=n;return(0,d.QT)(g.EK,[r,i,t])}(n),a=tO();if(!o)return null;let s=o.versions[0],c=(0,m.u)({status:null==s?void 0:s.status,releaseId:(null==s?void 0:s.status)==="release"?s.release_id:void 0,documentId:o.id,versionId:null==s?void 0:s.version_id,env:a.env}),l=(null==s?void 0:s.preview_summary)??"",f=(null==s?void 0:s.custom_type_label)??"";return k.jsx(u.oZ,{url:c,title:o.title,subTitle:f,description:l,onEdit:r,onUnlink:i,largeIconName:"description"})}function es0(t){let{editor:n}=t,{searchDocuments:r}=tO(),i=n.getAttributes(Ks.RichTextNodeType.hyperlink);if(i.id&&r){let o=i.id;return k.jsx(es1,{docId:o,...t})}if(i.href){let a=i.href;return k.jsx(es2,{url:a,...t})}if(i.media){let u=esA(i.media);return k.jsx(es4,{media:u,...t})}return null}function es1(t){let{editor:n,onEditDocumentLink:r,docId:i}=t;return k.jsx(u.SV,{renderError:()=>k.jsx(u.oZ,{url:"",title:"Failed to Load Linked Document Data",subTitle:"",error:!0,onEdit:r,onUnlink:()=>es3(n)}),children:k.jsx(o.Suspense,{fallback:k.jsx(u.oZ,{url:"",title:"",subTitle:"",loading:!0,onEdit:r,onUnlink:()=>es3(n)}),children:k.jsx(esX,{docId:i,onEdit:r,onUnlink:()=>es3(n)})})})}function es2(t){let{url:n,editor:r,onEditWebLink:i}=t,o=(0,p.ju)(n);return o?k.jsx(u.oZ,{url:n,title:(0,p.S$)(o),subTitle:n,onEdit:i,onUnlink:()=>es3(r)}):k.jsx(u.oZ,{url:n,title:"",subTitle:n,onEdit:i,onUnlink:()=>es3(r)})}function es4(t){let{media:n,editor:r,onEditMediaLink:i}=t;return"ImageLink"===n.__TYPE__?k.jsx(u.Qi,{url:n.url,title:n.name,subTitle:`${n.width} x ${n.height} pixels`,onEdit:i,onUnlink:()=>es3(r)}):"FileLink"===n.__TYPE__?k.jsx(u.oZ,{url:n.url,title:n.name,subTitle:function(t){let{filename:n}=t,r=n.split(".").pop();return r?r.toLowerCase():""}({filename:n.name}),onEdit:i,onUnlink:()=>es3(r),largeIconName:"insertDriveFile"}):null}function es3(t){esG(t=>t.unsetLink())(t)}function es5(t){let{open:n}=t,{onOpenChange:r,onSelectDocument:i}=function(t){let{editor:n,setOpen:r}=t;function i(t){r(t)}return{onSelectDocument:function(t){esG(n=>n.extendMarkRange(Ks.RichTextNodeType.hyperlink).setDocumentLink({id:t}))(n),r(!1)},onOpenChange:i}}(t);return k.jsx(ei8,{open:n,onOpenChange:r,onSelectDocument:i})}function es9(t){let{open:n}=t,{onOpenChange:r,onSelectMedia:i}=function(t){let{editor:n,setOpen:r}=t;return{onSelectMedia:function(t){esG(n=>n.extendMarkRange(Ks.RichTextNodeType.hyperlink).setMediaLink({media:t}))(n),r(!1)},onOpenChange:r}}(t);return eia()?k.jsx(eio,{open:n,onOpenChange:r}):k.jsx(eiL,{open:n,onOpenChange:r,onMediaSelected:i})}function es8(t){let{open:n}=t,{url:r,setUrl:i,onOpenChange:a,onKeyDown:s,openInNewTab:c,setOpenInNewTab:l,onSetUrl:f,selectionUrl:d,selectionUrlTitle:h}=function(t){var n;let{editor:r,setOpen:i}=t,[a,u]=(0,o.useState)(""),[s,c]=(0,o.useState)(!1),l=function(t){let n=t.getAttributes(Ks.RichTextNodeType.hyperlink);return n.href?n.href:void 0}(r),f=(n=r,"_blank"===n.getAttributes(Ks.RichTextNodeType.hyperlink).target);(0,o.useEffect)(()=>{u(l??"")},[l]),(0,o.useEffect)(()=>{c(f??!1)},[f]);let d=l?(0,p.ju)(l):void 0,h=d?(0,p.S$)(d):"";function m(t){let n=s?"_blank":"_self";esG(r=>r.extendMarkRange(Ks.RichTextNodeType.hyperlink).setWebLink({href:t,target:n}))(r),i(!1)}return{url:a,setUrl:u,onSetUrl:m,selectionUrl:l,selectionUrlTitle:h,openInNewTab:s,selectionOpenInNewTab:f,setOpenInNewTab:c,onKeyDown:function(t){"Enter"===t.key&&m(a)},onOpenChange:function(t){u(""),c(!1),i(t)}}}(t);return k.jsx(u.Vq,{open:n,onOpenChange:a,hasClose:!1,size:"small",children:k.jsx(u.cZ,{children:k.jsxs(u.xu,{flexDirection:"column",children:[k.jsxs(u.xu,{flexDirection:"column",height:"100%",padding:16,gap:4,children:[k.jsx(u.yt,{value:r,onValueChange:i,placeholder:"Paste URL",icon:"public",onKeyDown:s}),d&&k.jsxs(u.xu,{flexDirection:"column",padding:{top:8},gap:4,children:[k.jsx(u.xv,{variant:"smallBold",color:"grey11",children:"Linked to"}),k.jsxs(u.xu,{backgroundColor:"grey4",borderRadius:6,padding:8,alignItems:"center",gap:8,children:[k.jsx(u.pI,{largeIconName:"public",smallIconName:"link"}),k.jsxs(u.xu,{flexDirection:"column",children:[k.jsx(u.xv,{variant:"bold",color:"grey12",children:h}),k.jsx(u.xv,{color:"grey11",variant:"small",children:"Web page"})]})]})]})]}),r&&k.jsxs(u.xu,{flexDirection:"column",padding:{block:8},border:{top:!0},children:[k.jsx(u.UN,{onSelect:()=>l(!c),icon:c?"checkBox":"checkBoxOutlinedBlank",textContent:"Open in new tab"}),k.jsx(u.UN,{onSelect:()=>f(r),icon:"link",textContent:"Link to URL"})]})]})})})}function es6(t){let{items:n,editor:r}=t;return 0===n.length?null:k.jsxs(k.Fragment,{children:[k.jsx(u.Jf,{}),k.jsx(u.dV,{onValueChange(t){n.forEach(n=>{(n.isActive(r)&&!t.includes(n.nodeType)||!n.isActive(r)&&t.includes(n.nodeType))&&n.runCommands(r)})},type:"multiple",value:n.filter(t=>t.isActive(r)).map(t=>t.nodeType),children:n.map(t=>k.jsx(u.nG,{disabled:!t.runCommands(r,{can:!0}),startIcon:t.icon,value:t.nodeType},t.nodeType))},"mark")]})}function es7(t){var n;let{items:r,editor:i}=t;return 0===r.length?null:k.jsx(u.vT,{disabled:1===r.length,value:(null==(n=r.find(t=>t.isActive(i)))?void 0:n.nodeType)??"",onValueChange(t){var n;null==(n=r.find(n=>n.nodeType===t))||n.runCommands(i)},children:r.map(t=>k.jsx(u.KG,{value:t.nodeType,children:t.text},t.nodeType))})}let ece={duration:100,hideOnClick:!0,offset:[-48,parseFloat(u.TV.space[8])],placement:"top-start",zIndex:parseFloat(u.TV.zIndex.toolbar)};function ect(t){let{editor:n,nodeTypes:r}=t,[i,a]=(0,o.useState)(),u=r.includes(Ks.RichTextNodeType.hyperlink),s=!i,{shouldShowBubbleMenu:c,shouldShowLinkPopover:l}=function(t){let{editor:n}=t;return{shouldShowBubbleMenu:function(t){let{view:r,state:i,from:o,to:a}=t;if(!r.hasFocus())return!1;let{doc:u,selection:s}=i;return!(n.isActive(Ks.RichTextNodeType.preformatted)||s.empty||0===u.textBetween(o,a).length)},shouldShowLinkPopover:function(t){let{view:n,state:r,from:i,to:o}=t,a=n.state.doc.nodeAt(i),{doc:u,selection:s}=r;return!!s.empty&&!(u.textBetween(i,o).length>0)&&!!(null!=a&&a.marks.some(t=>"hyperlink"===t.type.name))}}}({editor:n}),f=(0,o.useRef)(null);return k.jsxs(k.Fragment,{children:[k.jsx(erY,{editor:n,tippyOptions:ece,shouldShow:c,children:s&&k.jsx("div",{ref:f,children:k.jsx(ecn,{...t,bubbleMenuContainerRef:f,setModal:a})})}),k.jsx(erY,{editor:n,tippyOptions:ece,shouldShow:l,children:s&&k.jsx(es0,{editor:n,onEditWebLink:()=>a("webLink"),onEditDocumentLink:()=>a("documentLink"),onEditMediaLink:()=>a("mediaLink")})}),u&&k.jsxs(k.Fragment,{children:[k.jsx(es8,{open:"webLink"===i,setOpen:function(t){a(t?"webLink":void 0)},editor:n}),k.jsx(es5,{open:"documentLink"===i,setOpen:function(t){a(t?"documentLink":void 0)},editor:n}),k.jsx(es9,{open:"mediaLink"===i,setOpen:function(t){a(t?"mediaLink":void 0)},editor:n})]})]})}function ecn(t){let{editor:n,nodeTypes:r}=t,i=r.includes("hyperlink"),o=esQ(esK,r),a=esQ(esY,r),s=esQ(esq,r),c=o.length+a.length+s.length+Number(i);return 0===c?null:k.jsxs(u.o8,{children:[k.jsx(es7,{items:o,editor:n}),k.jsx(es6,{items:a,editor:n}),i&&k.jsx(esJ,{...t}),k.jsx(esH,{items:s,editor:n}),c>1&&k.jsxs(k.Fragment,{children:[k.jsx(u.Jf,{}),k.jsx(u.hA,{onClick(){n.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:"formatClear"},"clear")]})]})}function ecr(t){var n;let{content:r,field:i,id:a,readOnly:c}=t,f=function(t){var n,r;let i=`${null==(n=t.config)?void 0:n.multi}-${null==(r=t.config)?void 0:r.single}`;return(0,o.useMemo)(()=>{let{extensions:n,defaultTextConverter:r}=function(t){var n;if(!t||!(null!=t&&t.single)&&!(null!=t&&t.multi))return eoq();let r=function(t){let n=(t.single||t.multi||"").split(/\s*,\s*/).map(t=>{let n=Ks.RichTextNodeTypeCodec.decode(t);return"Right"===n._tag?n.right:void 0}).filter(l.$);return new Set(n)}(t);if(!(null!=r&&r.size))return eoq();let i=(n=r,es$(n).filter(t=>(0,y.G)(n,n=>t.richTextNodeTypes.includes(n)))),o=function(t){let n=new Set(t);return(0,y.G)(n,eo$)&&n.add(eu2),(0,y.G)(n,eoW)||n.add(eu2),[...n]}(i);return{extensions:o,defaultTextConverter:function(t){let n=t.find(eoW)??eu2;return function(t){return r=>n.converter.fromPrismic(t)({...r,type:n.richTextNodeTypes[0]??"heading1"})}}(o)}}(t.config),i=n.filter(eci),o=n.flatMap(t=>t.richTextNodeTypes),a=n.map(t=>t.component),u=n.filter(eco).map(t=>t.name),s=[...a,...function(t,n){var r,i,o;let a=n.map(t=>t.richTextNodeTypes).flat(),u={placeholderByNodeType:(o=n,o.reduce((t,n)=>(n.nodeType===eoz.Text&&(t[n.name]=n.placeholder),t),{})),unfocusedPlaceholder:null==(r=t.config)?void 0:r.placeholder,nodeExtensions:n},s=a.includes(Ks.RichTextNodeType.orderedList)||a.includes(Ks.RichTextNodeType.list);return[eo8.component((null==(i=t.config)?void 0:i.single)===void 0),euG.component,ean.component,eai(u),s?eo4.component:void 0,eu9.configure({nodeTypes:a})].filter(l.$)}(t,i),euJ.configure({supportedExtensionNames:u}),eoN],c=s.map(t=>t.name),f=function(t,n){let r=eeN.resolve(t);return eex(r,void 0)}(s);return{allComponents:s,extensionNames:c,defaultTextConverter:r,nodeExtensions:i,names:o,schema:f}},[i])}(i),d=r&&eo8.converter(f.nodeExtensions).fromPrismic(f.schema,null==(n=f.defaultTextConverter)?void 0:n.call(f,f.schema))(r),p=(0,s.R9)(t.onContentChange),h=function(t={},n=[]){let{onUpdate:r}=t,[i,a]=(0,o.useState)(),u=(0,o.useRef)(r),c=(0,s.NW)();return(0,o.useEffect)(()=>{i&&r&&(i.off("update",u.current),i.on("update",r),u.current=r)},[r,i]),(0,o.useLayoutEffect)(()=>{let n=!0,r=new erq(t);return a(r),r.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{n&&c()})})}),()=>{n=!1}},n),(0,o.useEffect)(()=>()=>{null==i||i.destroy()},[i]),i}({content:null==d?void 0:d.toJSON(),editable:!c,editorProps:{attributes:{class:u.rk,id:a,tabIndex:"0"}},extensions:f.allComponents,injectCSS:!1,onUpdate({editor:t}){if(t.isEmpty)return p(void 0);let n=eo8.converter(f.nodeExtensions).toPrismic(t.state.doc);p(n)}},[f,c]);return k.jsxs(u.gN,{children:[k.jsx(u.Qy,{htmlFor:a,children:Zf(i)}),k.jsxs(u.JO,{children:[k.jsx(erQ,{editor:h??null,style:{flex:1}}),(null==h?void 0:h.isEditable)&&k.jsx(ect,{editor:h,nodeTypes:f.names.concat(euH)})]})]})}function eci(t){return t.extType===eoF.Node}function eco(t){return!(t.extType!==eoF.Node||t.nodeType!==eoz.Text||t.lockedFormat)}function eca(t){var n,r,i,o,a;let{content:s,field:c,id:l,onContentChange:f,readOnly:d}=t,p=Zd(c),h=(i=c,(null==(o=i.config)?void 0:o.default_value)===void 0||null==(a=i.config.options)?void 0:a[0]),m=(null==s?void 0:s.value)??h;return k.jsxs(u.gN,{children:[k.jsx(u.fw,{name:"arrowDropDownCircle"}),k.jsx(u.Qy,{htmlFor:l,children:Zf(c)}),k.jsx(u.JO,{children:k.jsx(u.Ph,{id:l,size:"large",color:"grey",value:m,renderTrigger:()=>k.jsx(u.JF,{id:l,placeholder:p}),onValueChange(t){var n;d||f((n=t,0===n.length?void 0:{__TYPE__:"FieldContent",type:"Select",value:n}))},children:null==(r=null==(n=c.config)?void 0:n.options)?void 0:r.map(t=>k.jsx(u.Ql,{value:t,children:t},t))})})]})}function ecu(t){let{id:n,readOnly:r,field:i,content:o,onContentChange:a}=t,s=null!=o&&o.value?(0,c._O)(o.value):void 0;return k.jsxs(u.gN,{children:[k.jsx(u.fw,{name:"event"}),k.jsx(u.Qy,{id:n,children:Zf(i)}),k.jsx(u.JO,{children:k.jsx(u.xu,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:k.jsx(u.Wr,{mode:"date-time","aria-labelledby":n,readOnly:r,value:s,onValueChange:t=>a(function(t){if(t)return{__TYPE__:"FieldContent",type:"Timestamp",value:function(t){let n=`${t.getUTCFullYear()}`.padStart(4,"0"),r=`${t.getUTCMonth()+1}`.padStart(2,"0"),i=`${t.getUTCDate()}`.padStart(2,"0"),o=`${t.getUTCHours()}`.padStart(2,"0"),a=`${t.getUTCMinutes()}`.padStart(2,"0");return`${n}-${r}-${i}T${o}:${a}:00+00:00`}(t)}}(t))})})})]})}function ecs(t){let{id:n,readOnly:r,content:i,nestableWidget:a}=t,u=(0,s.R9)(t.onContentChange);return(0,o.useMemo)(()=>{let t={id:n,readOnly:r,onContentChange:u};return"Boolean"===a.type?k.jsx(Zp,{...t,field:a,content:nf.isBooleanContent(i)?i:void 0}):"Date"===a.type?k.jsx(Zm,{...t,field:a,content:nf.isDateContent(i)?i:void 0}):"Timestamp"===a.type?k.jsx(ecu,{...t,field:a,content:nf.isTimestampContent(i)?i:void 0}):"Image"===a.type?k.jsx(eiZ,{...t,field:a,content:nf.isImageContent(i)?i:void 0}):"Link"===a.type?k.jsx(eos,{...t,field:a,content:nf.isLinkContent(i)?i:void 0}):"Number"===a.type?k.jsx(eod,{...t,field:a,content:nf.isNumberContent(i)?i:void 0}):"StructuredText"===a.type?k.jsx(ecr,{...t,field:a,content:nf.isRichTextContent(i)?i:void 0}):"Select"===a.type?k.jsx(eca,{...t,field:a,content:nf.isSelectContent(i)?i:void 0}):"Text"===a.type?k.jsx(eiH,{...t,field:a,content:nf.isTextContent(i)?i:void 0}):"Embed"===a.type?k.jsx(er7,{...t,field:a,content:nf.isEmbedContent(i)?i:void 0}):"Color"===a.type?k.jsx(Zh,{...t,field:a,content:nf.isColorContent(i)?i:void 0}):"GeoPoint"===a.type?k.jsx(eii,{...t,field:a,content:nf.isGeoPointContent(i)?i:void 0}):null},[i,n,a,u,r])}function ecc(t){let{content:n,id:r,nonRepeatableZone:i,onContentChange:u,readOnly:s}=t,c=(0,o.useMemo)(()=>Object.entries(i),[i]);return k.jsx(k.Fragment,{children:c.map(([t,i])=>{let o=n[t];return k.jsx(ecs,{id:`${r}.${t}`,readOnly:s,nestableWidget:i,content:nf.isNestableContent(o)?o:void 0,onContentChange(r){var i,o,s;u((i=n,o=t,s=r,void 0===s?(0,a.ud)(i,o):{...i,[o]:s}))}},t)})})}function ecl(t){let{id:n,title:r,content:i,onContentChange:a,readOnly:s,repeatableZone:c}=t,l=(0,o.useMemo)(()=>Object.entries(c),[c]),f=i??[ecf],d=(0,o.useRef)(new Map);function p(t){return d.current.get(t)??"!bugged!"}function m(t){let{index:n,offset:r}=t;a((0,h.pB)(f,n,n+r))}function g(t){let{index:n}=t;a((0,h.$E)(f,n))}return!function(t,n){let r=new Set(n);n.forEach(n=>{t.has(n)||t.set(n,(0,b.d)())}),(0,o.useLayoutEffect)(()=>{for(let[n]of t)r.has(n)||t.delete(n)})}(d.current,f),0===Object.keys(c).length?null:k.jsx(u.ZA,{title:"Repeatable zone"+(r?` • ${r}`:""),addItemButtonTitle:"Add item in group",items:f,getItemKey:p,onAddItem:function(){a(f.concat(ecd()))},children(t,r){let i=new Map(t.value),o=p(t);return k.jsx(u.MN,{index:r,title:"Item",onMove:m,onDelete:g,children:l.map(([u,c])=>{let l=i.get(u),p=nf.isNestableContent(l)?l:void 0;return k.jsx(ecs,{id:`${n}[${o}].${u}`,content:p,nestableWidget:c,onContentChange:n=>(function(t,n,r,i){let o=function(t,n){let[r,i]=n;if(!i){let o=t.value.filter(([t])=>t!==r);return ecd(o)}let a=Array.from(new Map(t.value).set(r,i));return ecd(a)}(t,[r,i]),u=function(t,n){let[r,i]=n;return i?t.map((t,n)=>n===r?i:t):t.filter((t,n)=>n!==r)}(f,[n,o]);(function(t,n,r){let i=t.get(n);void 0!==i&&t.set(r,i)})(d.current,t,o),a(u)})(t,r,u,n),readOnly:s},u)})})}})}let ecf={__TYPE__:"GroupItemContent",value:[]};function ecd(t=[]){return{__TYPE__:"GroupItemContent",value:t}}function ecp(t){var n,r,i,a;let{config:s,content:c,sliceKey:l,readOnly:f=!1,sharedSlice:d,onContentChange:p,...h}=t,m=(n=d,r=c.variation,(0,o.useMemo)(()=>n.variations.find(t=>t.id===r),[n,r])),g=(0,o.useId)(),y={id:h.id??g,readOnly:f},{selected:v,selectionId:b,selection:x}=function(t){let{sliceKey:n}=t||{},r=(0,o.useContext)(Zl),i=function(t,n){if(n)return`${t}___${n}`}("sliceFieldSet",n),a=n===(null==r?void 0:r.id);return{selectionId:i,selected:a,selection:r}}({sliceKey:l}),M=()=>{l&&x.update("sliceFieldSet",l)};return void 0===m?null:k.jsx(tI.Provider,{value:s,children:k.jsxs(u.C3,{id:b,selected:v,onFocus:M,children:[k.jsx(u.ax,{children:(i=d,a=m,[i.name,a.name].join(" • "))}),k.jsxs(u.En,{heightEstimate:400,box:{gap:u.jM},children:[k.jsx(ecc,{...y,nonRepeatableZone:m.primary??{},content:c.primary,onContentChange(t){p({...c,primary:t})}}),k.jsx(ecl,{...y,repeatableZone:m.items??{},content:c.items,onContentChange(t){p({...c,items:t})}})]})]})})}(0,o.createContext)({isDirty:!1,markDirty(){}})}}]);
|