slice-machine-ui 1.23.2-beta.8 → 1.24.0
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/.depcheckrc +3 -0
- package/components/ChangesEmptyState/OfflinePage.tsx +1 -1
- package/components/ChangesItems/ChangesItems.tsx +6 -2
- package/components/CustomTypeTable/changesPage.tsx +12 -7
- package/components/DeleteSliceModal/index.tsx +3 -0
- package/components/DeleteVariationModal/index.tsx +1 -0
- package/components/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +4 -0
- package/components/Forms/CreateSliceModal/CreateSliceModal.tsx +3 -1
- package/components/Forms/RenameCustomTypeModal/RenameCustomTypeModal.tsx +6 -1
- package/components/Forms/RenameSliceModal/RenameSliceModal.tsx +3 -0
- package/components/Forms/RenameVariationModal/RenameVariationModal.tsx +0 -1
- package/components/LoginModal/index.tsx +40 -2
- package/components/ModalFormCard/index.tsx +0 -1
- package/components/Navigation/ChangesItem.tsx +117 -0
- package/components/Navigation/Environment.tsx +51 -4
- package/components/Navigation/index.css.ts +1 -2
- package/components/Navigation/index.test.tsx +5 -85
- package/components/Navigation/index.tsx +32 -20
- package/components/ReviewModal/ReviewForm.tsx +0 -1
- package/lib/builders/SliceBuilder/index.tsx +3 -3
- package/lib/builders/common/EditModal/Form.jsx +0 -1
- package/lib/builders/common/Zone/Card/components/NewField.tsx +0 -1
- package/lib/models/common/ModelStatus/index.ts +25 -0
- package/out/404.html +1 -1
- package/out/_next/static/chunks/18539003-5f78714a35fde4a1.js +97 -0
- package/out/_next/static/chunks/25-3aa4d4b24167d340.js +1 -0
- package/out/_next/static/chunks/318-19dbcae10cdb6408.js +1 -0
- package/out/_next/static/chunks/727-de03055e40815a3a.js +1 -0
- package/out/_next/static/chunks/777-8c5507e3b119b5dc.js +8 -0
- package/out/_next/static/chunks/799-0af1215eb2b3c17e.js +1 -0
- package/out/_next/static/chunks/904-40686b0426716111.js +1 -0
- package/out/_next/static/chunks/pages/_app-bca191df4ac7078e.js +434 -0
- package/out/_next/static/chunks/pages/{changelog-afd18276fe018b24.js → changelog-cb1df3a70b20f1b8.js} +1 -1
- package/out/_next/static/chunks/pages/changes-ccfd715c2bdc4f83.js +1 -0
- package/out/_next/static/chunks/pages/{labs-ee206005948f8e87.js → labs-2adfb5127f9c4081.js} +1 -1
- package/out/_next/static/chunks/pages/settings-94bcd7422e8b237d.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-52c3e1f9d14160b8.js → simulator-aaf65fbec8f5839c.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-90bb2ea76d2abf42.js +1 -0
- package/out/_next/static/chunks/pages/slices-e0ce615c38e8338d.js +1 -0
- package/out/_next/static/css/39e089aad1742a3a.css +1 -0
- package/out/_next/static/css/{37153180c3b0dd66.css → 838fd8bb5a7c32b0.css} +1 -1
- package/out/_next/static/css/ca32882a5d2d8d88.css +1 -0
- package/out/_next/static/eNujlD43QIdmra7ggcNtK/_buildManifest.js +1 -0
- 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/settings.html +1 -0
- 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 +10 -8
- package/pages/_app.tsx +34 -32
- package/pages/changes.tsx +27 -41
- package/pages/settings.tsx +1 -0
- package/postcss.config.js +10 -0
- package/src/components/FieldSet/FieldSet.stories.tsx +20 -11
- package/src/components/RelativeTime/RelativeTime.stories.tsx +25 -0
- package/src/components/RelativeTime/RelativeTime.tsx +40 -0
- package/src/components/RelativeTime/index.ts +1 -0
- package/src/components/SideNav/SideNav.css.ts +1 -1
- package/src/components/SideNav/SideNav.tsx +9 -5
- package/src/components/SideNav/SideNavEnvironmentSelector.tsx +31 -11
- package/src/domain/__tests__/customType.test.ts +26 -19
- package/src/domain/customType.ts +22 -5
- package/src/features/autoSave/AutoSaveStatusIndicator.tsx +4 -4
- package/src/features/customTypes/customTypesBuilder/CustomTypeProvider.tsx +11 -10
- package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +3 -3
- package/src/features/environments/actions/setEnvironment.ts +4 -4
- package/src/features/settings/SettingsPage.tsx +47 -0
- package/src/features/settings/git/ConnectGitRepository.tsx +126 -0
- package/src/features/settings/git/ConnectGitRepositoryBlankSlate.tsx +33 -0
- package/src/features/settings/git/GitOwnerSelect.tsx +71 -0
- package/src/features/settings/git/GitProvider.ts +40 -0
- package/src/features/settings/git/GitProviderConnectButtons.tsx +63 -0
- package/src/features/settings/git/GitRepositoriesList.tsx +76 -0
- package/src/features/settings/git/GitRepositoriesSearch.tsx +69 -0
- package/src/features/settings/git/GitRepositoryConnectDialog.tsx +85 -0
- package/src/features/settings/git/GitRepositoryDisconnectDialog.tsx +60 -0
- package/src/features/settings/git/useGitIntegrationExperiment.ts +8 -0
- package/src/features/settings/git/useGitOwners.ts +12 -0
- package/src/features/settings/git/useGitRepos.ts +24 -0
- package/src/features/settings/git/useLinkedGitRepos.ts +41 -0
- package/src/features/settings/git/useWriteAPIToken.ts +23 -0
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +0 -1
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +0 -1
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceMergeWithIdenticalDialog.tsx +0 -1
- package/src/features/slices/sliceBuilder/SliceBuilderProvider.tsx +12 -10
- package/src/features/sync/AutoSyncProvider.tsx +252 -0
- package/src/features/sync/components/AutoSyncStatusIndicator.module.css +17 -0
- package/src/features/sync/components/AutoSyncStatusIndicator.module.css.d.ts +5 -0
- package/src/features/sync/components/AutoSyncStatusIndicator.tsx +58 -0
- package/src/features/sync/fetchUnSyncChanges.ts +40 -0
- package/src/features/sync/getUnSyncChanges.ts +144 -0
- package/src/features/sync/useUnSyncChanges.ts +32 -0
- package/src/hooks/useActionQueue.tsx +177 -0
- package/src/hooks/useAuthStatus.ts +12 -0
- package/src/hooks/useUser.ts +14 -0
- package/src/icons/SettingsIcon.tsx +19 -0
- package/src/icons/SyncFailed.tsx +30 -0
- package/src/icons/Synced.tsx +19 -0
- package/src/icons/Syncing.tsx +23 -0
- package/test/__testutils__/index.tsx +8 -5
- package/test/src/modules/__fixtures__/serverState.ts +1 -2
- package/components/Navigation/ChangesListItem.tsx +0 -74
- package/components/Navigation/ChangesRightElement.tsx +0 -33
- package/out/_next/static/chunks/18539003-5cc559566b738915.js +0 -97
- package/out/_next/static/chunks/25-01f422cea8066349.js +0 -1
- package/out/_next/static/chunks/318-387e3f23d717c53d.js +0 -1
- package/out/_next/static/chunks/376-7e784d6069e01654.js +0 -8
- package/out/_next/static/chunks/727-358d7fae68a880b3.js +0 -1
- package/out/_next/static/chunks/799-d95a93e965557aeb.js +0 -1
- package/out/_next/static/chunks/904-1ff7519adece2b55.js +0 -1
- package/out/_next/static/chunks/pages/_app-e31adcf75e9176d3.js +0 -432
- package/out/_next/static/chunks/pages/changes-92c84f6cac0285fd.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-608d206d10a719e3.js +0 -1
- package/out/_next/static/chunks/pages/slices-b0b58192a87df822.js +0 -1
- package/out/_next/static/css/200244e3e0463c39.css +0 -1
- package/out/_next/static/vxOhh_oqUIQ5PTSKUKgMR/_buildManifest.js +0 -1
- package/src/features/autoSave/useAutoSave.tsx +0 -177
- package/src/features/legacyState/actions/getLegacySliceMachineState.ts +0 -53
- package/src/features/legacyState/useLegacySliceMachineState.ts +0 -7
- package/src/hooks/useModelStatus.ts +0 -78
- package/src/hooks/useUnSyncChanges.ts +0 -88
- package/test/components/LoginModal.test.tsx +0 -67
- package/test/src/hooks/useModelStatus.test.ts +0 -115
- /package/out/_next/static/{vxOhh_oqUIQ5PTSKUKgMR → eNujlD43QIdmra7ggcNtK}/_ssgManifest.js +0 -0
- /package/src/features/{changes → sync}/actions/pushChanges.ts +0 -0
- /package/src/features/{changes → sync}/actions/trackPushChangesSuccess.ts +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 ecL}});var i,o=r(2784),a=r(98863),u=r(22715),s=r(74217),c=r(50054),l=r(86579),d=r(1611),f=r(17329),p=r(47124),h=r(77252),m=r(87322),g=r(16247),y=r(661),v=r(52393),b=r(28316),x=r(87598),M=Object.defineProperty,T=(t,n,r)=>n in t?M(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,S=(t,n,r)=>(T(t,"symbol"!=typeof n?n+"":n,r),r);let w={unclassified:{title:"Draft",color:"amber"},published:{title:"Live",color:"green"},release:{title:"Planned",color:"purple"},archived:{title:"Archived",color:"grey"}};var I="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{};function _(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 O,k,C,N={},j={get exports(){return N},set exports(e){N=e}},E={};(O=j).exports=function(){if(qU)return E;qU=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,d=null;for(s in void 0!==u&&(l=""+u),void 0!==o.key&&(l=""+o.key),void 0!==o.ref&&(d=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:d,props:c,_owner:i.current}}return E.Fragment=n,E.jsx=u,E.jsxs=u,E}(),(k=qW||(qW={})).assertEqual=t=>t,k.assertIs=function(t){},k.assertNever=function(t){throw Error()},k.arrayToEnum=t=>{let n={};for(let r of t)n[r]=r;return n},k.getValidEnumValues=t=>{let n=k.objectKeys(t).filter(n=>"number"!=typeof t[t[n]]),r={};for(let i of n)r[i]=t[i];return k.objectValues(r)},k.objectValues=t=>k.objectKeys(t).map(function(n){return t[n]}),k.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},k.find=(t,n)=>{for(let r of t)if(n(r))return r},k.isInteger="function"==typeof Number.isInteger?t=>Number.isInteger(t):t=>"number"==typeof t&&isFinite(t)&&Math.floor(t)===t,k.joinValues=function(t,n=" | "){return t.map(t=>"string"==typeof t?`'${t}'`:t).join(n)},k.jsonStringifyReplacer=(t,n)=>"bigint"==typeof n?n.toString():n,(C=qB||(qB={})).mergeShapes=(t,n)=>({...t,...n});let R=qW.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),D=t=>{switch(typeof t){case"undefined":return R.undefined;case"string":return R.string;case"number":return isNaN(t)?R.nan:R.number;case"boolean":return R.boolean;case"function":return R.function;case"bigint":return R.bigint;case"symbol":return R.symbol;case"object":return Array.isArray(t)?R.array:null===t?R.null:t.then&&"function"==typeof t.then&&t.catch&&"function"==typeof t.catch?R.promise:"u">typeof Map&&t instanceof Map?R.map:"u">typeof Set&&t instanceof Set?R.set:"u">typeof Date&&t instanceof Date?R.date:R.object;default:return R.unknown}},A=qW.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"]),L=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class P 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,qW.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()}}P.create=t=>new P(t);let F=(t,n)=>{let r;switch(t.code){case A.invalid_type:r=t.received===R.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case A.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,qW.jsonStringifyReplacer)}`;break;case A.unrecognized_keys:r=`Unrecognized key(s) in object: ${qW.joinValues(t.keys,", ")}`;break;case A.invalid_union:r="Invalid input";break;case A.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${qW.joinValues(t.options)}`;break;case A.invalid_enum_value:r=`Invalid enum value. Expected ${qW.joinValues(t.options)}, received '${t.received}'`;break;case A.invalid_arguments:r="Invalid function arguments";break;case A.invalid_return_type:r="Invalid function return type";break;case A.invalid_date:r="Invalid date";break;case A.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}"`:qW.assertNever(t.validation):r="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case A.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 A.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 A.custom:r="Invalid input";break;case A.invalid_intersection_types:r="Intersection results could not be merged";break;case A.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case A.not_finite:r="Number must be finite";break;default:r=n.defaultError,qW.assertNever(t)}return{message:r}},z=F;function U(t){z=t}function W(){return z}let B=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 V(t,n){let r=B({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,z,F].filter(t=>!!t)});t.common.issues.push(r)}class ${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 K;"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 $.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 K;"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 K=Object.freeze({status:"aborted"}),Y=t=>({status:"dirty",value:t}),q=t=>({status:"valid",value:t}),G=t=>"aborted"===t.status,Z=t=>"dirty"===t.status,Q=t=>"valid"===t.status,H=t=>"u">typeof Promise&&t instanceof Promise;(nr=qV||(qV={})).errToObj=t=>"string"==typeof t?{message:t}:t||{},nr.toString=t=>"string"==typeof t?t:null==t?void 0:t.message;class J{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 X=(t,n)=>{if(Q(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 P(t.common.issues);return this._error=r,this._error}}};function ee(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 et{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 D(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:D(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new $,ctx:{common:t.parent.common,data:t.data,parsedType:D(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(H(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:D(t)},o=this._parseSync({data:t,path:i.path,parent:i});return X(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:D(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await (H(i)?i:Promise.resolve(i));return X(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:A.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 eB({schema:this,typeName:q$.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return eV.create(this,this._def)}nullable(){return e$.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return eI.create(this,this._def)}promise(){return eW.create(this,this._def)}or(t){return eO.create([this,t],this._def)}and(t){return eN.create(this,t,this._def)}transform(t){return new eB({...ee(this._def),schema:this,typeName:q$.ZodEffects,effect:{type:"transform",transform:t}})}default(t){return new eK({...ee(this._def),innerType:this,defaultValue:"function"==typeof t?t:()=>t,typeName:q$.ZodDefault})}brand(){return new eZ({typeName:q$.ZodBranded,type:this,...ee(this._def)})}catch(t){return new eY({...ee(this._def),innerType:this,catchValue:"function"==typeof t?t:()=>t,typeName:q$.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return eQ.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let en=/^c[^\s-]{8,}$/i,er=/^[a-z][a-z0-9]*$/,ei=/[0-9A-HJKMNP-TV-Z]{26}/,eo=/^([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,ea=/^(([^<>()[\]\\.,;:\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,})+))$/,eu=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,es=/^(((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}))$/,ec=/^(([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})))$/,el=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 ed(t,n){return!!(("v4"===n||!n)&&es.test(t)||("v6"===n||!n)&&ec.test(t))}class ef extends et{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(n=>t.test(n),{validation:n,code:A.invalid_string,...qV.errToObj(r)}),this.nonempty=t=>this.min(1,qV.errToObj(t)),this.trim=()=>new ef({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new ef({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new ef({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==R.string){let n=this._getOrReturnCtx(t);return V(n,{code:A.invalid_type,expected:R.string,received:n.parsedType}),K}let r=new $,i;for(let o of this._def.checks)if("min"===o.kind)t.data.length<o.value&&(V(i=this._getOrReturnCtx(t,i),{code:A.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&&(V(i=this._getOrReturnCtx(t,i),{code:A.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?V(i,{code:A.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&V(i,{code:A.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if("email"===o.kind)ea.test(t.data)||(V(i=this._getOrReturnCtx(t,i),{validation:"email",code:A.invalid_string,message:o.message}),r.dirty());else if("emoji"===o.kind)eu.test(t.data)||(V(i=this._getOrReturnCtx(t,i),{validation:"emoji",code:A.invalid_string,message:o.message}),r.dirty());else if("uuid"===o.kind)eo.test(t.data)||(V(i=this._getOrReturnCtx(t,i),{validation:"uuid",code:A.invalid_string,message:o.message}),r.dirty());else if("cuid"===o.kind)en.test(t.data)||(V(i=this._getOrReturnCtx(t,i),{validation:"cuid",code:A.invalid_string,message:o.message}),r.dirty());else if("cuid2"===o.kind)er.test(t.data)||(V(i=this._getOrReturnCtx(t,i),{validation:"cuid2",code:A.invalid_string,message:o.message}),r.dirty());else if("ulid"===o.kind)ei.test(t.data)||(V(i=this._getOrReturnCtx(t,i),{validation:"ulid",code:A.invalid_string,message:o.message}),r.dirty());else if("url"===o.kind)try{new URL(t.data)}catch{V(i=this._getOrReturnCtx(t,i),{validation:"url",code:A.invalid_string,message:o.message}),r.dirty()}else"regex"===o.kind?(o.regex.lastIndex=0,o.regex.test(t.data)||(V(i=this._getOrReturnCtx(t,i),{validation:"regex",code:A.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)||(V(i=this._getOrReturnCtx(t,i),{code:A.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)||(V(i=this._getOrReturnCtx(t,i),{code:A.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):"endsWith"===o.kind?t.data.endsWith(o.value)||(V(i=this._getOrReturnCtx(t,i),{code:A.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):"datetime"===o.kind?el(o).test(t.data)||(V(i=this._getOrReturnCtx(t,i),{code:A.invalid_string,validation:"datetime",message:o.message}),r.dirty()):"ip"===o.kind?ed(t.data,o.version)||(V(i=this._getOrReturnCtx(t,i),{validation:"ip",code:A.invalid_string,message:o.message}),r.dirty()):qW.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new ef({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...qV.errToObj(t)})}url(t){return this._addCheck({kind:"url",...qV.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...qV.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...qV.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...qV.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...qV.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...qV.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...qV.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,...qV.errToObj(null==t?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...qV.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:null==n?void 0:n.position,...qV.errToObj(null==n?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...qV.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...qV.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...qV.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...qV.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...qV.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 ep(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)}ef.create=t=>{var n;return new ef({checks:[],typeName:q$.ZodString,coerce:null!==(n=null==t?void 0:t.coerce)&&void 0!==n&&n,...ee(t)})};class eh extends et{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)!==R.number){let n=this._getOrReturnCtx(t);return V(n,{code:A.invalid_type,expected:R.number,received:n.parsedType}),K}let r,i=new $;for(let o of this._def.checks)"int"===o.kind?qW.isInteger(t.data)||(V(r=this._getOrReturnCtx(t,r),{code:A.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):"min"===o.kind?(o.inclusive?t.data<o.value:t.data<=o.value)&&(V(r=this._getOrReturnCtx(t,r),{code:A.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)&&(V(r=this._getOrReturnCtx(t,r),{code:A.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):"multipleOf"===o.kind?0!==ep(t.data,o.value)&&(V(r=this._getOrReturnCtx(t,r),{code:A.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):"finite"===o.kind?Number.isFinite(t.data)||(V(r=this._getOrReturnCtx(t,r),{code:A.not_finite,message:o.message}),i.dirty()):qW.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,qV.toString(n))}gt(t,n){return this.setLimit("min",t,!1,qV.toString(n))}lte(t,n){return this.setLimit("max",t,!0,qV.toString(n))}lt(t,n){return this.setLimit("max",t,!1,qV.toString(n))}setLimit(t,n,r,i){return new eh({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:qV.toString(i)}]})}_addCheck(t){return new eh({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:qV.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:qV.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:qV.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:qV.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:qV.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:qV.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:qV.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:qV.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:qV.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&&qW.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)}}eh.create=t=>new eh({checks:[],typeName:q$.ZodNumber,coerce:(null==t?void 0:t.coerce)||!1,...ee(t)});class em extends et{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)!==R.bigint){let n=this._getOrReturnCtx(t);return V(n,{code:A.invalid_type,expected:R.bigint,received:n.parsedType}),K}let r,i=new $;for(let o of this._def.checks)"min"===o.kind?(o.inclusive?t.data<o.value:t.data<=o.value)&&(V(r=this._getOrReturnCtx(t,r),{code:A.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)&&(V(r=this._getOrReturnCtx(t,r),{code:A.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):"multipleOf"===o.kind?t.data%o.value!==BigInt(0)&&(V(r=this._getOrReturnCtx(t,r),{code:A.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):qW.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,qV.toString(n))}gt(t,n){return this.setLimit("min",t,!1,qV.toString(n))}lte(t,n){return this.setLimit("max",t,!0,qV.toString(n))}lt(t,n){return this.setLimit("max",t,!1,qV.toString(n))}setLimit(t,n,r,i){return new em({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:qV.toString(i)}]})}_addCheck(t){return new em({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:qV.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:qV.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:qV.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:qV.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:qV.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}}em.create=t=>{var n;return new em({checks:[],typeName:q$.ZodBigInt,coerce:null!==(n=null==t?void 0:t.coerce)&&void 0!==n&&n,...ee(t)})};class eg extends et{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==R.boolean){let n=this._getOrReturnCtx(t);return V(n,{code:A.invalid_type,expected:R.boolean,received:n.parsedType}),K}return q(t.data)}}eg.create=t=>new eg({typeName:q$.ZodBoolean,coerce:(null==t?void 0:t.coerce)||!1,...ee(t)});class ey extends et{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==R.date){let n=this._getOrReturnCtx(t);return V(n,{code:A.invalid_type,expected:R.date,received:n.parsedType}),K}if(isNaN(t.data.getTime())){let r=this._getOrReturnCtx(t);return V(r,{code:A.invalid_date}),K}let i=new $,o;for(let a of this._def.checks)"min"===a.kind?t.data.getTime()<a.value&&(V(o=this._getOrReturnCtx(t,o),{code:A.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),i.dirty()):"max"===a.kind?t.data.getTime()>a.value&&(V(o=this._getOrReturnCtx(t,o),{code:A.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),i.dirty()):qW.assertNever(a);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ey({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:qV.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:qV.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}}ey.create=t=>new ey({checks:[],coerce:(null==t?void 0:t.coerce)||!1,typeName:q$.ZodDate,...ee(t)});class ev extends et{_parse(t){if(this._getType(t)!==R.symbol){let n=this._getOrReturnCtx(t);return V(n,{code:A.invalid_type,expected:R.symbol,received:n.parsedType}),K}return q(t.data)}}ev.create=t=>new ev({typeName:q$.ZodSymbol,...ee(t)});class eb extends et{_parse(t){if(this._getType(t)!==R.undefined){let n=this._getOrReturnCtx(t);return V(n,{code:A.invalid_type,expected:R.undefined,received:n.parsedType}),K}return q(t.data)}}eb.create=t=>new eb({typeName:q$.ZodUndefined,...ee(t)});class ex extends et{_parse(t){if(this._getType(t)!==R.null){let n=this._getOrReturnCtx(t);return V(n,{code:A.invalid_type,expected:R.null,received:n.parsedType}),K}return q(t.data)}}ex.create=t=>new ex({typeName:q$.ZodNull,...ee(t)});class eM extends et{constructor(){super(...arguments),this._any=!0}_parse(t){return q(t.data)}}eM.create=t=>new eM({typeName:q$.ZodAny,...ee(t)});class eT extends et{constructor(){super(...arguments),this._unknown=!0}_parse(t){return q(t.data)}}eT.create=t=>new eT({typeName:q$.ZodUnknown,...ee(t)});class eS extends et{_parse(t){let n=this._getOrReturnCtx(t);return V(n,{code:A.invalid_type,expected:R.never,received:n.parsedType}),K}}eS.create=t=>new eS({typeName:q$.ZodNever,...ee(t)});class ew extends et{_parse(t){if(this._getType(t)!==R.undefined){let n=this._getOrReturnCtx(t);return V(n,{code:A.invalid_type,expected:R.void,received:n.parsedType}),K}return q(t.data)}}ew.create=t=>new ew({typeName:q$.ZodVoid,...ee(t)});class eI extends et{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==R.array)return V(n,{code:A.invalid_type,expected:R.array,received:n.parsedType}),K;if(null!==i.exactLength){let o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(V(n,{code:o?A.too_big:A.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&&(V(n,{code:A.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&&(V(n,{code:A.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 J(n,t,n.path,r)))).then(t=>$.mergeArray(r,t));let u=[...n.data].map((t,r)=>i.type._parseSync(new J(n,t,n.path,r)));return $.mergeArray(r,u)}get element(){return this._def.type}min(t,n){return new eI({...this._def,minLength:{value:t,message:qV.toString(n)}})}max(t,n){return new eI({...this._def,maxLength:{value:t,message:qV.toString(n)}})}length(t,n){return new eI({...this._def,exactLength:{value:t,message:qV.toString(n)}})}nonempty(t){return this.min(1,t)}}eI.create=(t,n)=>new eI({type:t,minLength:null,maxLength:null,exactLength:null,typeName:q$.ZodArray,...ee(n)});class e_ extends et{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=qW.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==R.object){let n=this._getOrReturnCtx(t);return V(n,{code:A.invalid_type,expected:R.object,received:n.parsedType}),K}let{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof eS&&"strip"===this._def.unknownKeys))for(let s in i.data)a.includes(s)||u.push(s);let c=[];for(let l of a){let d=o[l],f=i.data[l];c.push({key:{status:"valid",value:l},value:d._parse(new J(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof eS){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&&(V(i,{code:A.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 J(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=>$.mergeObjectSync(r,t)):$.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return qV.errToObj,new e_({...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=qV.errToObj(t).message)&&void 0!==u?u:s}:{message:s}}}:{}})}strip(){return new e_({...this._def,unknownKeys:"strip"})}passthrough(){return new e_({...this._def,unknownKeys:"passthrough"})}extend(t){return new e_({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e_({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:q$.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e_({...this._def,catchall:t})}pick(t){let n={};return qW.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new e_({...this._def,shape:()=>n})}omit(t){let n={};return qW.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new e_({...this._def,shape:()=>n})}deepPartial(){return function t(n){if(!(n instanceof e_))return n instanceof eI?new eI({...n._def,type:t(n.element)}):n instanceof eV?eV.create(t(n.unwrap())):n instanceof e$?e$.create(t(n.unwrap())):n instanceof ej?ej.create(n.items.map(n=>t(n))):n;{let r={};for(let i in n.shape){let o=n.shape[i];r[i]=eV.create(t(o))}return new e_({...n._def,shape:()=>r})}}(this)}partial(t){let n={};return qW.objectKeys(this.shape).forEach(r=>{let i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new e_({...this._def,shape:()=>n})}required(t){let n={};return qW.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof eV;)i=i._def.innerType;n[r]=i}}),new e_({...this._def,shape:()=>n})}keyof(){return eF(qW.objectKeys(this.shape))}}e_.create=(t,n)=>new e_({shape:()=>t,unknownKeys:"strip",catchall:eS.create(),typeName:q$.ZodObject,...ee(n)}),e_.strictCreate=(t,n)=>new e_({shape:()=>t,unknownKeys:"strict",catchall:eS.create(),typeName:q$.ZodObject,...ee(n)}),e_.lazycreate=(t,n)=>new e_({shape:t,unknownKeys:"strip",catchall:eS.create(),typeName:q$.ZodObject,...ee(n)});class eO extends et{_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 P(t.ctx.common.issues));return V(n,{code:A.invalid_union,unionErrors:o}),K});{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 P(t));return V(n,{code:A.invalid_union,unionErrors:c}),K}}get options(){return this._def.options}}eO.create=(t,n)=>new eO({options:t,typeName:q$.ZodUnion,...ee(n)});let ek=t=>t instanceof eL?ek(t.schema):t instanceof eB?ek(t.innerType()):t instanceof eP?[t.value]:t instanceof ez?t.options:t instanceof eU?Object.keys(t.enum):t instanceof eK?ek(t._def.innerType):t instanceof eb?[void 0]:t instanceof ex?[null]:null;class eC extends et{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==R.object)return V(n,{code:A.invalid_type,expected:R.object,received:n.parsedType}),K;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}):(V(n,{code:A.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),K)}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=ek(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 eC({typeName:q$.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...ee(r)})}}class eN extends et{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=(t,i)=>{if(G(t)||G(i))return K;let o=function t(n,r){let i=D(n),o=D(r);if(n===r)return{valid:!0,data:n};if(i===R.object&&o===R.object){let a=qW.objectKeys(r),u=qW.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!==R.array||o!==R.array)return i===R.date&&o===R.date&&+n==+r?{valid:!0,data:n}:{valid:!1};{if(n.length!==r.length)return{valid:!1};let d=[];for(let f=0;f<n.length;f++){let p=n[f],h=r[f],m=t(p,h);if(!m.valid)return{valid:!1};d.push(m.data)}return{valid:!0,data:d}}}(t.value,i.value);return o.valid?((Z(t)||Z(i))&&n.dirty(),{status:n.value,value:o.data}):(V(r,{code:A.invalid_intersection_types}),K)};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}))}}eN.create=(t,n,r)=>new eN({left:t,right:n,typeName:q$.ZodIntersection,...ee(r)});class ej extends et{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==R.array)return V(r,{code:A.invalid_type,expected:R.array,received:r.parsedType}),K;if(r.data.length<this._def.items.length)return V(r,{code:A.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),K;!this._def.rest&&r.data.length>this._def.items.length&&(V(r,{code:A.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 J(r,t,r.path,n)):null}).filter(t=>!!t);return r.common.async?Promise.all(i).then(t=>$.mergeArray(n,t)):$.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new ej({...this._def,rest:t})}}ej.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new ej({items:t,typeName:q$.ZodTuple,rest:null,...ee(n)})};class eE extends et{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!==R.object)return V(r,{code:A.invalid_type,expected:R.object,received:r.parsedType}),K;let i=[],o=this._def.keyType,a=this._def.valueType;for(let u in r.data)i.push({key:o._parse(new J(r,u,r.path,u)),value:a._parse(new J(r,r.data[u],r.path,u))});return r.common.async?$.mergeObjectAsync(n,i):$.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return new eE(n instanceof et?{keyType:t,valueType:n,typeName:q$.ZodRecord,...ee(r)}:{keyType:ef.create(),valueType:t,typeName:q$.ZodRecord,...ee(n)})}}class eR extends et{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==R.map)return V(r,{code:A.invalid_type,expected:R.map,received:r.parsedType}),K;let i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([t,n],a)=>({key:i._parse(new J(r,t,r.path,[a,"key"])),value:o._parse(new J(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 K;("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,d=c.value;if("aborted"===l.status||"aborted"===d.status)return K;("dirty"===l.status||"dirty"===d.status)&&n.dirty(),s.set(l.value,d.value)}return{status:n.value,value:s}}}}eR.create=(t,n,r)=>new eR({valueType:n,keyType:t,typeName:q$.ZodMap,...ee(r)});class eD extends et{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==R.set)return V(r,{code:A.invalid_type,expected:R.set,received:r.parsedType}),K;let i=this._def;null!==i.minSize&&r.data.size<i.minSize.value&&(V(r,{code:A.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&&(V(r,{code:A.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 K;"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 J(r,t,r.path,n)));return r.common.async?Promise.all(u).then(t=>a(t)):a(u)}min(t,n){return new eD({...this._def,minSize:{value:t,message:qV.toString(n)}})}max(t,n){return new eD({...this._def,maxSize:{value:t,message:qV.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}eD.create=(t,n)=>new eD({valueType:t,minSize:null,maxSize:null,typeName:q$.ZodSet,...ee(n)});class eA extends et{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==R.function)return V(n,{code:A.invalid_type,expected:R.function,received:n.parsedType}),K;function r(t,r){return B({data:t,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,z,F].filter(t=>!!t),issueData:{code:A.invalid_arguments,argumentsError:r}})}function i(t,r){return B({data:t,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,z,F].filter(t=>!!t),issueData:{code:A.invalid_return_type,returnTypeError:r}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof eW?q(async(...t)=>{let n=new P([]),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})}):q((...t)=>{let n=this._def.args.safeParse(t,o);if(!n.success)throw new P([r(t,n.error)]);let u=a(...n.data),s=this._def.returns.safeParse(u,o);if(!s.success)throw new P([i(u,s.error)]);return s.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new eA({...this._def,args:ej.create(t).rest(eT.create())})}returns(t){return new eA({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new eA({args:t||ej.create([]).rest(eT.create()),returns:n||eT.create(),typeName:q$.ZodFunction,...ee(r)})}}class eL extends et{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})}}eL.create=(t,n)=>new eL({getter:t,typeName:q$.ZodLazy,...ee(n)});class eP extends et{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return V(n,{received:n.data,code:A.invalid_literal,expected:this._def.value}),K}return{status:"valid",value:t.data}}get value(){return this._def.value}}function eF(t,n){return new ez({values:t,typeName:q$.ZodEnum,...ee(n)})}eP.create=(t,n)=>new eP({value:t,typeName:q$.ZodLiteral,...ee(n)});class ez extends et{_parse(t){if("string"!=typeof t.data){let n=this._getOrReturnCtx(t),r=this._def.values;return V(n,{expected:qW.joinValues(r),received:n.parsedType,code:A.invalid_type}),K}if(-1===this._def.values.indexOf(t.data)){let i=this._getOrReturnCtx(t),o=this._def.values;return V(i,{received:i.data,code:A.invalid_enum_value,options:o}),K}return q(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 ez.create(t)}exclude(t){return ez.create(this.options.filter(n=>!t.includes(n)))}}ez.create=eF;class eU extends et{_parse(t){let n=qW.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==R.string&&r.parsedType!==R.number){let i=qW.objectValues(n);return V(r,{expected:qW.joinValues(i),received:r.parsedType,code:A.invalid_type}),K}if(-1===n.indexOf(t.data)){let o=qW.objectValues(n);return V(r,{received:r.data,code:A.invalid_enum_value,options:o}),K}return q(t.data)}get enum(){return this._def.values}}eU.create=(t,n)=>new eU({values:t,typeName:q$.ZodNativeEnum,...ee(n)});class eW extends et{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==R.promise&&!1===n.common.async)return V(n,{code:A.invalid_type,expected:R.promise,received:n.parsedType}),K;let r=n.parsedType===R.promise?n.data:Promise.resolve(n.data);return q(r.then(t=>this._def.type.parseAsync(t,{path:n.path,errorMap:n.common.contextualErrorMap})))}}eW.create=(t,n)=>new eW({type:t,typeName:q$.ZodPromise,...ee(n)});class eB extends et{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===q$.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){V(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?K:("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?K:("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=>Q(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(!Q(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}}}qW.assertNever(i)}}eB.create=(t,n,r)=>new eB({schema:t,typeName:q$.ZodEffects,effect:n,...ee(r)}),eB.createWithPreprocess=(t,n,r)=>new eB({schema:n,effect:{type:"preprocess",transform:t},typeName:q$.ZodEffects,...ee(r)});class eV extends et{_parse(t){return this._getType(t)===R.undefined?q(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}eV.create=(t,n)=>new eV({innerType:t,typeName:q$.ZodOptional,...ee(n)});class e$ extends et{_parse(t){return this._getType(t)===R.null?q(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}e$.create=(t,n)=>new e$({innerType:t,typeName:q$.ZodNullable,...ee(n)});class eK extends et{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===R.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}eK.create=(t,n)=>new eK({innerType:t,typeName:q$.ZodDefault,defaultValue:"function"==typeof n.default?n.default:()=>n.default,...ee(n)});class eY extends et{_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 H(i)?i.then(t=>({status:"valid",value:"valid"===t.status?t.value:this._def.catchValue({get error(){return new P(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new P(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}eY.create=(t,n)=>new eY({innerType:t,typeName:q$.ZodCatch,catchValue:"function"==typeof n.catch?n.catch:()=>n.catch,...ee(n)});class eq extends et{_parse(t){if(this._getType(t)!==R.nan){let n=this._getOrReturnCtx(t);return V(n,{code:A.invalid_type,expected:R.nan,received:n.parsedType}),K}return{status:"valid",value:t.data}}}eq.create=t=>new eq({typeName:q$.ZodNaN,...ee(t)});let eG=Symbol("zod_brand");class eZ extends et{_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 eQ extends et{_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?K:"dirty"===t.status?(n.dirty(),Y(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?K:"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 eQ({in:t,out:n,typeName:q$.ZodPipeline})}}let eH=(t,n={},r)=>t?eM.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})}}):eM.create(),eJ={object:e_.lazycreate};(ni=q$||(q$={})).ZodString="ZodString",ni.ZodNumber="ZodNumber",ni.ZodNaN="ZodNaN",ni.ZodBigInt="ZodBigInt",ni.ZodBoolean="ZodBoolean",ni.ZodDate="ZodDate",ni.ZodSymbol="ZodSymbol",ni.ZodUndefined="ZodUndefined",ni.ZodNull="ZodNull",ni.ZodAny="ZodAny",ni.ZodUnknown="ZodUnknown",ni.ZodNever="ZodNever",ni.ZodVoid="ZodVoid",ni.ZodArray="ZodArray",ni.ZodObject="ZodObject",ni.ZodUnion="ZodUnion",ni.ZodDiscriminatedUnion="ZodDiscriminatedUnion",ni.ZodIntersection="ZodIntersection",ni.ZodTuple="ZodTuple",ni.ZodRecord="ZodRecord",ni.ZodMap="ZodMap",ni.ZodSet="ZodSet",ni.ZodFunction="ZodFunction",ni.ZodLazy="ZodLazy",ni.ZodLiteral="ZodLiteral",ni.ZodEnum="ZodEnum",ni.ZodEffects="ZodEffects",ni.ZodNativeEnum="ZodNativeEnum",ni.ZodOptional="ZodOptional",ni.ZodNullable="ZodNullable",ni.ZodDefault="ZodDefault",ni.ZodCatch="ZodCatch",ni.ZodPromise="ZodPromise",ni.ZodBranded="ZodBranded",ni.ZodPipeline="ZodPipeline";let eX=(t,n={message:`Input not instance of ${t.name}`})=>eH(n=>n instanceof t,n),e0=ef.create,e1=eh.create,e2=eq.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=eI.create,ti=e_.create,to=e_.strictCreate,ta=eO.create,tu=eC.create,ts=eN.create,tc=ej.create,tl=eE.create,td=eR.create,tf=eD.create,tp=eA.create,th=eL.create,tm=eP.create,tg=ez.create,ty=eU.create,tv=eW.create,tb=eB.create,tx=eV.create,tM=e$.create,tT=eB.createWithPreprocess,tS=eQ.create,tw=()=>e0().optional(),tI=()=>e1().optional(),t_=()=>e3().optional();var tO=Object.freeze({__proto__:null,defaultErrorMap:F,setErrorMap:U,getErrorMap:W,makeIssue:B,EMPTY_PATH:[],addIssueToContext:V,ParseStatus:$,INVALID:K,DIRTY:Y,OK:q,isAborted:G,isDirty:Z,isValid:Q,isAsync:H,get util(){return qW},get objectUtil(){return qB},ZodParsedType:R,getParsedType:D,ZodType:et,ZodString:ef,ZodNumber:eh,ZodBigInt:em,ZodBoolean:eg,ZodDate:ey,ZodSymbol:ev,ZodUndefined:eb,ZodNull:ex,ZodAny:eM,ZodUnknown:eT,ZodNever:eS,ZodVoid:ew,ZodArray:eI,ZodObject:e_,ZodUnion:eO,ZodDiscriminatedUnion:eC,ZodIntersection:eN,ZodTuple:ej,ZodRecord:eE,ZodMap:eR,ZodSet:eD,ZodFunction:eA,ZodLazy:eL,ZodLiteral:eP,ZodEnum:ez,ZodNativeEnum:eU,ZodPromise:eW,ZodEffects:eB,ZodTransformer:eB,ZodOptional:eV,ZodNullable:e$,ZodDefault:eK,ZodCatch:eY,ZodNaN:eq,BRAND:eG,ZodBranded:eZ,ZodPipeline:eQ,custom:eH,Schema:et,ZodSchema:et,late:eJ,get ZodFirstPartyTypeKind(){return q$},coerce:{string:t=>ef.create({...t,coerce:!0}),number:t=>eh.create({...t,coerce:!0}),boolean:t=>eg.create({...t,coerce:!0}),bigint:t=>em.create({...t,coerce:!0}),date:t=>ey.create({...t,coerce:!0})},any:e7,array:tr,bigint:e4,boolean:e3,date:e5,discriminatedUnion:tu,effect:tb,enum:tg,function:tp,instanceof:eX,intersection:ts,lazy:th,literal:tm,map:td,nan:e2,nativeEnum:ty,never:tt,null:e6,nullable:tM,number:e1,object:ti,oboolean:t_,onumber:tI,optional:tx,ostring:tw,pipeline:tS,preprocess:tT,promise:tv,record:tl,set:tf,strictObject:to,string:e0,symbol:e9,transformer:tb,tuple:tc,undefined:e8,union:ta,unknown:te,void:tn,NEVER:K,ZodIssueCode:A,quotelessJson:L,ZodError:P});let tk=(0,o.createContext)(void 0);function tC(){let t=(0,o.useContext)(tk);if(!t)throw Error("Missing EditorConfigContext.Provider");return t}class tN extends Error{}function tj(t){throw new tN(`Missing EditorConfig.${t}`)}let tE=ti({id:e0(),kind:e0(),extension:e0(),filename:e0(),width:e1().optional(),height:e1().optional(),last_modified:e1(),url:e0(),alt:e0().optional(),size:e1()}),tR=ti({total:e1(),cursor:e0().optional(),items:tr(tE)});function tD(t,n,r,i="all",o){let a=new URLSearchParams({assetType:i,limit:"30",...o&&{cursor:o}});return(0,d.WY)(`${t}?${a.toString()}`,{headers:{repository:n},credentials:(0,d.xb)(r),okType:tR})}function tA(t){let{assetType:n}=t,r=tC(),[i,a]=(0,o.useState)(),[u,s]=(0,o.useState)([]),[c,l]=(0,o.useState)(u);r.mediaLibrary||tj("mediaLibrary");let{assetsUrl:d,repository:p}=r,h=(0,f.QT)(tD,[d,p,r.env,n,i]);function m(t){s([]),(0,f.VA)(tD,[d,p,r.env,n,i],n=>({items:t,total:t.length,cursor:(null==n?void 0:n.cursor)??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=f.Fs.get(tD,[d,p,r.env,n,i]),a=(null==o?void 0:o.state)==="fetched"&&null!=o&&o.ok?o.body.items:[],u=[...t,...a].filter((t,n,r)=>n===r.findIndex(n=>n.id===t.id));m(u)},replaceMedia:function(t){let n=u.flatMap(n=>{let r=t.find(t=>t.id===n.id);return r?void 0===r.response?[]:r.response:n});m(n)}}}f.Fs.registerFetcherConfig(tD,{cacheCapacity:100,revalidationStrategy:{type:"never"}});let tL,tP=new Uint8Array(16);function tF(){if(!tL&&!(tL="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 tL(tP)}let tz=[];for(let tU=0;tU<256;++tU)tz.push((tU+256).toString(16).slice(1));let tW="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),tB={randomUUID:tW};function tV(t,n,r){if(tB.randomUUID&&!n&&!t)return tB.randomUUID();t=t||{};let i=t.random||(t.rng||tF)();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(tz[t[n+0]]+tz[t[n+1]]+tz[t[n+2]]+tz[t[n+3]]+"-"+tz[t[n+4]]+tz[t[n+5]]+"-"+tz[t[n+6]]+tz[t[n+7]]+"-"+tz[t[n+8]]+tz[t[n+9]]+"-"+tz[t[n+10]]+tz[t[n+11]]+tz[t[n+12]]+tz[t[n+13]]+tz[t[n+14]]+tz[t[n+15]]).toLowerCase()}(i)}let t$=(0,o.createContext)(void 0);function tK(t){let{children:n,assetType:r="all",onSelectedChange:i,actionContainerRef:a}=t,[s,c]=(0,o.useState)(new Set),[l,f]=(0,o.useTransition)(),{media:h,onHasReachedBottom:m,updateMedia:g,replaceMedia:y}=tA({assetType:r}),{isUploading:v,onFilesSelected:b,uploadingFiles:x}=function(t){let{onBeforeUpload:n,onComplete:r,onError:i}=t,[a,s]=(0,o.useState)([]),c=a.some(t=>"idle"===t.status||"uploading"===t.status),{showAlert:l}=(0,u.VY)(),{env:f}=tC(),h=tC(),m=(0,o.useCallback)(t=>{let r=[{...t,id:`retry-${tV()}`,status:"idle"}];s(r),n(r)},[n]);function g(t){s(n=>(null==t||t(n),n))}return(0,o.useEffect)(function(){if(!a.length||a.some(t=>"uploading"===t.status)||a.every(t=>"error"===t.status))return;let t=a.find(t=>"idle"===t.status);if(!t){setTimeout(()=>{g(r),s(t=>t.filter(t=>"error"===t.status))},1e3);return}s(n=>n.map(n=>n.id===t.id?{...n,status:"uploading"}:n)),(function(t){let{file:n,config:r}=t;if(!r.mediaLibrary)throw Error("Media Library not configured.");let{assetsUrl:i,repository:o,env:a}=r,u=new FormData;return u.append(n.name,n),(0,d.WY)(i,{headers:{repository:o,"Content-Type":"multipart/form-data"},method:"POST",body:u,credentials:(0,d.xb)(a),okType:tE})})({file:t.file,config:h}).then(n=>{s(r=>r.map(r=>r.id===t.id?{...r,status:"success",response:n}:r))}).catch(()=>{s(n=>n.map(n=>n.id===t.id?{...n,status:"error"}:n));let n=(0,p.tx)(t.file.name,30);l({id:t.id,title:`The specified file "${n}" could not be uploaded.`,subtitle:N.jsxs(u.xv,{color:"inherit",children:["Read more about our"," ",N.jsx(u.hh,{color:"tomato11",href:"https://prismic.io/docs/guides/manage-images#supported-media",underline:!0,children:"supported media"}),"."]}),..."dev"===f&&{buttons:[{text:"Retry upload",icon:"cloudUpload",onClick:()=>m(t)}]}}),g(i)})},[h,a,r,i,m,l,f]),{isUploading:c,uploadingFiles:a,onFilesSelected:function(t){let r=t.map(t=>({id:`temp-${tV()}`,file:t,status:"idle"}));s(r),g(n)},onRetry:m}}({onBeforeUpload(t){g(t.filter(t=>"idle"===t.status).map(t=>({id:t.id,url:URL.createObjectURL(t.file),filename:t.file.name,size:t.file.size,extension:t.file.type,kind:t.file.type,last_modified:t.file.lastModified})))},onComplete(t){let n=t.flatMap(t=>{var n;return"success"===t.status?{id:t.id,response:{...t.response,url:(null==(n=h.find(n=>n.id===t.id))?void 0:n.url)??t.response.url}}:{id:t.id,response:void 0}});y(n)},onError(t){let n=t.flatMap(t=>"error"===t.status?{id:t.id,response:void 0}:[]);setTimeout(()=>y(n),2e3)}});function M(t,n){c(r=>{let o=new Set(r);o[n](t);let a=Array.from(o).flatMap(t=>h.find(n=>n.id===t)??[]);return null==i||i(a),o})}return N.jsx(t$.Provider,{value:{isFetchingMedia:l,media:h,onScrollToBottom:function(){f(m)},selectedMediaIds:s,actionContainerRef:a,onFilesUpload:function(t){v||b(t)},isUploading:v,uploadingFiles:x,addMediaItem:function(t){M(t,"add")},removeMediaItem:function(t){M(t,"delete")},resetMediaSelection:function(){c(new Set)}},children:n})}function tY(){let t=(0,o.useContext)(t$);if(!t)throw Error("useMediaLibrary must be used within a MediaLibraryProvider");return t}function tq(){let{isFetchingMedia:t}=tY();return N.jsx(u.FN,{anchor:N.jsx(u.xu,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),loadingIndicator:!0,open:t,title:"Loading more items ...",seconds:1})}let tG={warning:{uploadWhileUploading:{title:"Hang tight!",description:"Your current images are still being uploaded. Once they're all set, you'll be free to upload more."}}};function tZ(){let{actionContainerRef:t,isUploading:n,onFilesUpload:r}=tY(),i=null==t?void 0:t.current,a=i?u.Uv:o.Fragment;return N.jsx(a,{...i?{container:t.current,asChild:!0}:{},children:N.jsxs(u.xu,{justifyContent:"space-between",width:"100%",flexGrow:1,children:[N.jsx("div",{}),N.jsx(u.u,{title:tG.warning.uploadWhileUploading.title,content:tG.warning.uploadWhileUploading.description,visible:n,stableMount:!0,children:N.jsx(u.KH,{disabled:n,onFilesSelected:r,startIcon:"cloudUpload",color:i?"purple":"grey",size:"large",children:"Upload media"})})]})})}function tQ(t){let{children:n}=t,{onFilesUpload:r}=tY();return N.jsx(u.Zz,{overlay:N.jsx(tH,{}),overlayVariant:"simple",onFilesSelected:r,children:n})}function tH(){let{isUploading:t}=tY(),n=t?tG.warning.uploadWhileUploading.title:"Drop files here",r=t?tG.warning.uploadWhileUploading.description:"Drop your files to upload them instantly to the media library.";return N.jsx(u.xu,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:"grey3",children:N.jsxs(u.R$,{children:[N.jsx(u.av,{name:t?"block":"cloudUpload",lineColor:t?"tomato11":"purple10",backgroundColor:t?"tomato2":"purple3",borderColor:t?"tomato6":"purple6",borderStyle:"dashed",size:"large"}),N.jsx(u._T,{size:"big",children:n}),N.jsx(u.nf,{width:360,children:r})]})})}function tJ(){return N.jsx(u.Iq,{title:"Oops! Something went wrong",description:"An error occurred while searching for your image.",errorImageSrc:u.Os,sx:{marginBlock:"auto",marginInline:"auto"}})}function tX(){var t;let{onScrollToBottom:n,media:r,selectedMediaIds:i,addMediaItem:a,removeMediaItem:s,resetMediaSelection:c,isUploading:l,uploadingFiles:d}=tY(),f=(0,o.useRef)(null);function p(t){if(i.has(t))return s(t);c(),a(t)}return l&&(null==(t=f.current)||t.scrollTo({top:0,behavior:"instant"})),N.jsx(u.xr,{ref:f,style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 250px), 1fr))",gap:16,paddingBottom:16,position:"relative"},onScrollToBottom:n,threshold:500,children:null==r?void 0:r.map(t=>{var n;return N.jsx(u.PB,{...t,status:null==(n=d.find(n=>n.id===t.id))?void 0:n.status,selected:i.has(t.id),onCardClick:()=>p(t.id),onCheckedChange:()=>p(t.id)},t.id)})})}function t0(){let{media:t,selectedMediaIds:n}=tY();return t.filter(({id:t})=>n.has(t))}function t1(){let t=t0(),[n]=t;return n?t.length>1?N.jsxs(u.xu,{gap:8,alignItems:"center",children:[N.jsxs(u.xv,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:[t.length," media selected"]}),N.jsx(u.u,{content:"Open all selected media in new tabs",children:N.jsx(u.hU,{icon:"openInFull",variant:"solid",size:"small",onClick:()=>t.forEach(t=>window.open(t.url,"_blank"))})})]}):N.jsxs(u.xu,{gap:8,alignItems:"center",children:[N.jsx(u.xv,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:n.filename}),N.jsxs(u.xu,{gap:8,children:[N.jsx(u.u,{content:"Open media in new tab",children:N.jsx(u.hU,{icon:"openInFull",variant:"solid",size:"small",hiddenLabel:"Open media in new tab",onClick:()=>window.open(n.url,"_blank")})}),N.jsx(u.u,{content:"Copy media URL",children:N.jsx(u.hU,{icon:"link",variant:"solid",size:"small",hiddenLabel:"Copy media URL",onClick:()=>navigator.clipboard.writeText(n.url)})})]})]}):null}function t2(){let t=t0(),[n]=t;return n?2===t.length?N.jsx(t4,{children:t.map((t,n)=>N.jsx("div",{style:{position:"absolute",transform:0===n?"translateX(25%) rotate(15deg) ":"translateX(-25%) rotate(-15deg) "},children:N.jsx(t3,{media:t})},t.id))}):t.length>2?N.jsx(t4,{children:t.slice(-4).map((t,n)=>N.jsx("div",{style:{position:"absolute",paddingRight:16*n},children:N.jsx(t3,{media:t})},t.id))}):N.jsx(u.xu,{flexDirection:"column",children:N.jsx(u.hM,{children:N.jsx(t4,{children:N.jsx(u.Ee,{src:n.url,alt:n.alt,sizing:"contain"})})})}):null}function t4(t){let{children:n}=t;return N.jsx(u.xu,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:200,width:"100%",children:n})}function t3(t){let{media:n}=t;return N.jsx(u.xu,{width:111,height:152,children:N.jsx(u.Ee,{borderRadius:8,src:n.url,alt:n.alt,sizing:"cover"})})}function t5(){let[t,n]=(0,o.useState)("description"),r=t0();if(0===r.length||r.length>1)return null;let i="description"===t,a="more-info"===t;return N.jsxs(N.Fragment,{children:[N.jsxs(u.xu,{border:!0,borderStyle:"solid",borderRadius:8,backgroundColor:"grey2",children:[N.jsx(u.OK,{title:"Description",selected:i,onSelect:()=>n("description"),outline:i,background:i?void 0:"transparent",sx:{flexGrow:1,flexBasis:0}}),N.jsx(u.OK,{title:"More info",selected:a,onSelect:()=>n("more-info"),outline:a,background:a?void 0:"transparent",sx:{flexGrow:1,flexBasis:0}})]}),N.jsxs(u.xu,{gap:16,flexDirection:"column",overflowY:"auto",children:[i&&N.jsx(t9,{}),a&&N.jsx(t8,{})]})]})}function t9(){let[t]=t0();return t?N.jsxs(u.xu,{flexDirection:"column",gap:16,children:[N.jsx(u.yt,{disabled:!0,value:(null==t?void 0:t.filename)??"",label:"Image title",placeholder:"Image title"}),N.jsx(u.Wi,{label:"Alternative text",disabled:!0,children:N.jsx(u.Kx,{disabled:!0,value:(null==t?void 0:t.alt)??"",placeholder:"A short description of the image for accessibility"})})]}):null}function t8(){let[t]=t0();if(!t)return null;let n=[{label:"Date",value:(0,c._L)(new Date(t.last_modified))},{label:"File size",value:(0,p.td)(t.size)},{label:"Dimensions",value:t.width+"x"+t.height},{label:"Ratio",value:((t.width??0)/(t.height??0)).toFixed(1)},{label:"Extension",value:t.extension.toUpperCase()}];return N.jsx(u.xu,{gap:8,flexDirection:"column",children:n.map(t=>N.jsxs(u.xu,{gap:8,children:[N.jsxs(u.xv,{color:"grey11",children:[t.label,":"]}),N.jsx(u.xv,{children:t.value})]},t.label))})}function t6(){let{onFilesUpload:t,isUploading:n}=tY();return N.jsxs(u.xu,{display:"grid",alignItems:"center",gridColumn:"1fr",gridTemplateRows:"1fr 1fr 1fr",children:[N.jsx(u.xu,{gridColumn:"1",gridRow:"1 / 3",children:N.jsx(u.Ee,{sizing:"contain",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzODUiIGhlaWdodD0iNDg1IiB2aWV3Qm94PSIwIDAgMzg1IDQ4NSIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00MTMuNTQgNDUuNjA4NEw0MDQuNjMzIDUwLjc1NDZMMzE3LjUyIDAuNDc5NDkySDMxNS4zNDFMNDAzLjU0MyA1MS4zODM5TDI5My4yNCAxMTUuMTFMMTgyLjUwNyA1MS4yMDI5TDI3MC4zMDQgMC40Nzk0OTJIMjY4LjEyNkwxODEuNDE4IDUwLjU3NDFMOTQuNjE3OSAwLjQ3OTQ5Mkg5Mi40MzgyTDE4MC4zMjggNTEuMjAzNEw3MC4wMjUxIDExNC45M0wtNDAuNzA4MSA1MS4wMjI0TDQ2Ljc3NjMgMC40Nzk0OTJINDQuNTk4M0wtNDEuNzk3NiA1MC4zOTM1TC01MC41NjA1IDQ1LjMzNjJWNDYuNTk0MkwtNDIuODg2OSA1MS4wMjI5TC01MC41NjA1IDU1LjQ1NjJWNTYuNzE0NUwtNDEuNzk3MyA1MS42NTE3TDY4LjkzNTggMTE1LjU1OUwtNDEuMzY3NSAxNzkuMjg1TC01MC41NjA1IDE3My45OFYxNzUuMjM4TC00Mi40NTY4IDE3OS45MTRMLTUwLjU2MDUgMTg0LjU5NlYxODUuODU1TC00MS4zNjcyIDE4MC41NDNMNjkuMzY1OSAyNDQuNDUxTC00MC45MzczIDMwOC4xNzdMLTUwLjU2MDUgMzAyLjYyM1YzMDMuODgxTC00Mi4wMjY2IDMwOC44MDZMLTUwLjU2MDUgMzEzLjczNlYzMTQuOTk1TC00MC45MzcgMzA5LjQzNUw2OS43OTYxIDM3My4zNDJMLTQwLjUwNzEgNDM3LjA2OEwtNTAuNTYwNSA0MzEuMjY2VjQzMi41MjRMLTQxLjU5NjQgNDM3LjY5OEwtNTAuNTYwNSA0NDIuODc2VjQ0NC4xMzVMLTQwLjUwNjkgNDM4LjMyNkwzOS4wNTgyIDQ4NC4yNDZINDEuMjM3OUwtMzkuNDE3NiA0MzcuNjk3TDcwLjg4NTYgMzczLjk3MUwxODEuNjE5IDQzNy44NzhMMTAxLjM2MiA0ODQuMjQ2SDEwMy41MzlMMTgyLjcwOCA0MzguNTA3TDI2MS45NiA0ODQuMjQ2SDI2NC4xNEwxODMuNzk4IDQzNy44NzhMMjk0LjEwMSAzNzQuMTUxTDQxMy41NCA0NDMuMDgzVjQ0MS44MjVMMjk1LjE5IDM3My41MjJMNDA1LjQ5MyAzMDkuNzk2TDQxMy41NCAzMTQuNDRWMzEzLjE4Mkw0MDYuNTgzIDMwOS4xNjdMNDEzLjU0IDMwNS4xNDdWMzAzLjg4OUw0MDUuNDkzIDMwOC41MzhMMjk0Ljc2IDI0NC42MzFMNDA1LjA2MyAxODAuOTA0TDQxMy41NCAxODUuNzk3VjE4NC41MzlMNDA2LjE1MiAxODAuMjc1TDQxMy41NCAxNzYuMDA3VjE3NC43NDlMNDA1LjA2MyAxNzkuNjQ2TDI5NC4zMyAxMTUuNzM5TDQwNC42MzMgNTIuMDEyN0w0MTMuNTQgNTcuMTUzM1Y1NS44OTU0TDQwNS43MjIgNTEuMzgzNUw0MTMuNTQgNDYuODY2OFY0NS42MDg0Wk0yOTIuMTUxIDExNS43MzlMMTgxLjg0OCAxNzkuNDY2TDcxLjExNDYgMTE1LjU1OEwxODEuNDE4IDUxLjgzMjJMMjkyLjE1MSAxMTUuNzM5Wk03MC4wMjU0IDExNi4xODhMMTgwLjc1OCAxODAuMDk1TDcwLjQ1NTIgMjQzLjgyMUwtNDAuMjc3OSAxNzkuOTE0TDcwLjAyNTQgMTE2LjE4OFpNMTgxLjg0OCAxODAuNzI0TDcxLjU0NDggMjQ0LjQ1TDE4Mi4yNzggMzA4LjM1N0wyOTIuNTgxIDI0NC42MzFMMTgxLjg0OCAxODAuNzI0Wk0tMzkuODQ3NyAzMDguODA2TDcwLjQ1NTUgMjQ1LjA3OUwxODEuMTg5IDMwOC45ODdMNzAuODg1NCAzNzIuNzEzTC0zOS44NDc3IDMwOC44MDZaTTE4Mi4yNzggMzA5LjYxNUwyOTMuMDExIDM3My41MjNMMTgyLjcwOCA0MzcuMjQ5TDcxLjk3NDkgMzczLjM0MkwxODIuMjc4IDMwOS42MTVaTTQwNC40MDQgMzA5LjE2N0wyOTMuNjcxIDI0NS4yNkwxODMuMzY3IDMwOC45ODZMMjk0LjEgMzcyLjg5M0w0MDQuNDA0IDMwOS4xNjdaTTE4Mi45MzcgMTgwLjA5NEwyOTMuNjcgMjQ0LjAwMkw0MDMuOTc0IDE4MC4yNzZMMjkzLjI0MSAxMTYuMzY4TDE4Mi45MzcgMTgwLjA5NFoiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl8xNjYyMF82NjEzKSIvPgogIDxwYXRoIGQ9Ik00MTMuNTQgNDQ1LjA3N1Y0NDMuODE5TDM0My41NjYgNDg0LjI0NkgzNDUuNzQ0TDQxMy41NCA0NDUuMDc3WiIgZmlsbD0idXJsKCNwYWludDFfbGluZWFyXzE2NjIwXzY2MTMpIi8+CiAgPGRlZnM+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfMTY2MjBfNjYxMyIgeDE9IjE4MS40OSIgeTE9IjAuNDc5NDkyIiB4Mj0iMTgxIiB5Mj0iNjI0IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CiAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiNFREVDRUUiIHN0b3Atb3BhY2l0eT0iMCIvPgogICAgICA8c3RvcCBvZmZzZXQ9IjAuNTQzMDM1IiBzdG9wLWNvbG9yPSIjRURFQ0VFIi8+CiAgICAgIDxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0VERUNFRSIgc3RvcC1vcGFjaXR5PSIwIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDFfbGluZWFyXzE2NjIwXzY2MTMiIHgxPSIxODEuNDkiIHkxPSIwLjQ3OTQ5MiIgeDI9IjE4MSIgeTI9IjYyNCIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgogICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjRURFQ0VFIiBzdG9wLW9wYWNpdHk9IjAiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIwLjU0MzAzNSIgc3RvcC1jb2xvcj0iI0VERUNFRSIvPgogICAgICA8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNFREVDRUUiIHN0b3Atb3BhY2l0eT0iMCIvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICA8L2RlZnM+Cjwvc3ZnPg==",alt:"media placeholder",background:"transparent"})}),N.jsx(u.xu,{gridColumn:"1",gridRow:"1",flexDirection:"column",justifyContent:"end",height:"100%",padding:16,children:N.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",background:"transparent"})}),N.jsx(u.xu,{gridColumn:"1",gridRow:"2",flexDirection:"column",padding:16,children:N.jsx(u.xu,{flexDirection:"column",alignItems:"center",children:N.jsxs(u.xv,{color:"grey12",variant:"h5",children:["Select or"," ",N.jsx(u.KH,{disabled:n,onFilesSelected:t,renderButton:t=>N.jsx(u.u,{title:tG.warning.uploadWhileUploading.title,content:tG.warning.uploadWhileUploading.description,visible:n,children:N.jsx(u.iC,{disabled:n,onClick:t,buttonText:"upload",inline:!0})})})," ","media."]})})})]})}function t7(){return 0===t0().length?N.jsx(t6,{}):N.jsxs(u.xu,{flexDirection:"column",backgroundColor:"grey1",width:"100%",overflowY:"auto",padding:16,gap:16,children:[N.jsx(t1,{}),N.jsx(t2,{}),N.jsx(t5,{})]})}function ne(){let{selectedMediaIds:t}=tY(),n=t.size>0;return N.jsx(u.xu,{overflow:"hidden",borderStyle:n?"solid":"dashed",border:{top:!0,right:!0,left:!0,bottom:!1},borderRadius:{topRight:8,topLeft:8},gridColumn:"2",gridRow:"1 / -1",children:N.jsx(t7,{})})}function nt(t){let{assetType:n,onSelectedChange:r,actionContainerRef:i}=t;return N.jsx(u.SV,{renderError:()=>N.jsx(tJ,{}),children:N.jsx(o.Suspense,{children:N.jsx(tK,{assetType:n,actionContainerRef:i,onSelectedChange:r,children:N.jsx(tQ,{children:N.jsx(nn,{})})})})})}function nn(){let{media:t}=tY();return N.jsxs(u.xu,{display:"grid",gridTemplateRows:"1fr 1fr",gridTemplateColumns:"1fr 292px",width:"100%",height:"100%",gap:16,children:[N.jsxs(u.xu,{position:"relative",display:"grid",gap:16,overflow:"hidden",gridColumn:"1",gridRow:"1 / -1",children:[N.jsx(tZ,{}),N.jsx(u.xu,{width:"100%",children:N.jsxs(u.xv,{variant:"bold",children:[t.length," items"]})}),N.jsx(tX,{}),N.jsx(tq,{})]}),N.jsx(ne,{})]})}var nr,ni,no,na,nu,ns,nc,nl,nd,nf,np,nh,nm,ng,ny,nv,nb,nx,nM,nT,nS,nw,nI,n_,nO,nk,nC,nN,nj,nE,nR,nD,nA={},nL={};no={get exports(){return nL},set exports(e){nL=e}},function(t){var n="object"==typeof I?I:"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(no.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])};na=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)},nu=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},ns=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},nc=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},nl=function(t,n){return function(r,i){n(r,i,t)}},nd=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",d=!n&&t?i.static?t:t.prototype:null,f=n||(d?Object.getOwnPropertyDescriptor(d,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:f.get,set:f.set}:f[l],m);if("accessor"===c){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw TypeError("Object expected");(s=u(y.get))&&(f.get=s),(s=u(y.set))&&(f.set=s),(s=u(y.init))&&o.push(s)}else(s=u(y))&&("field"===c?o.push(s):f[l]=s)}d&&Object.defineProperty(d,i.name,f),p=!0},nf=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},np=function(t){return"symbol"==typeof t?t:"".concat(t)},nh=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})},nm=function(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)},ng=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())})},ny=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])}}},nv=function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||nD(n,t,r)},nD=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]},nb=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.")},nx=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},nM=function(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(nx(arguments[n]));return t},nT=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},nS=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))},nw=function(t){return this instanceof nw?(this.v=t,this):new nw(t)},nI=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 nw?Promise.resolve(r.value.v).then(c,l):d(a[0][2],r)}catch(i){d(a[0][3],i)}}function c(t){s("next",t)}function l(t){s("throw",t)}function d(t,n){t(n),a.shift(),a.length&&s(a[0][0],a[0][1])}},n_=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:nw(t[i](n)),done:!1}:o?o(n):n}:o}},nO=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 nb?nb(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)})}}},nk=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};nC=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)&&nD(n,t,i);return r(n,t),n},nN=function(t){return t&&t.__esModule?t:{default:t}},nj=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)},nE=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},nR=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",na),t("__assign",nu),t("__rest",ns),t("__decorate",nc),t("__param",nl),t("__esDecorate",nd),t("__runInitializers",nf),t("__propKey",np),t("__setFunctionName",nh),t("__metadata",nm),t("__awaiter",ng),t("__generator",ny),t("__exportStar",nv),t("__createBinding",nD),t("__values",nb),t("__read",nx),t("__spread",nM),t("__spreadArrays",nT),t("__spreadArray",nS),t("__await",nw),t("__asyncGenerator",nI),t("__asyncDelegator",n_),t("__asyncValues",nO),t("__makeTemplateObject",nk),t("__importStar",nC),t("__importDefault",nN),t("__classPrivateFieldGet",nj),t("__classPrivateFieldSet",nE),t("__classPrivateFieldIn",nR)});var nP={};function nF(t){return function(n){return function(r){return r.reduce(function(n,r){return t.alt(n,function(){return r})},n)}}}let nz=Object.freeze(Object.defineProperty({__proto__:null,altAll:nF},Symbol.toStringTag,{value:"Module"})),nU=Object.freeze(Object.defineProperty({__proto__:null,altAll:function(t){return nF(t)(t.zero())}},Symbol.toStringTag,{value:"Module"}));var nW=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))}}}}},nB=function(t){return function(){return{concat:function(n,r){return function(i){return t.concat(n(i),r(i))}}}}},nV=function(t){var n=nB(t);return function(){return{concat:n().concat,empty:function(){return t.empty}}}},n$=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}}},nK=function(t){var n=n$(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))}}}},nY=function(t){return function(n){return n(t)}};function nq(t){return t}function nG(t){return function(){return t}}var nZ=nG(!0),nQ=nG(!1),nH=nG(null),nJ=nG(void 0);function nX(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 n0(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t}function n1(t){return t+1}function n2(t){return t-1}function n4(t){throw Error("Called `absurd` function which should be uncallable")}function n3(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],d=1;d<arguments.length;d++)l=arguments[d](l);return l}}var n5=function(t,n){return n},n9=function(){return{concat:function(t,n){return nX(t,n)},empty:nq}};let n8=Object.freeze(Object.defineProperty({__proto__:null,SK:n5,absurd:n4,apply:nY,constFalse:nQ,constNull:nH,constTrue:nZ,constUndefined:nJ,constVoid:nJ,constant:nG,decrement:n2,flip:function(t){return function(n,r){return t(r,n)}},flow:nX,getBooleanAlgebra:nW,getEndomorphismMonoid:n9,getMonoid:nV,getRing:nK,getSemigroup:nB,getSemiring:n$,hole:n4,identity:nq,increment:n1,not:function(t){return function(n){return!t(n)}},pipe:n3,tuple:n0,tupled:function(t){return function(n){return t.apply(void 0,n)}},unsafeCoerce:nq,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 n6=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))},n7=function(t){return"None"===t._tag},re=function(t){return"Some"===t._tag},rt={_tag:"None"},rn=function(t){return{_tag:"Some",value:t}},rr=function(t){return"Left"===t._tag},ri=function(t){return"Right"===t._tag},ro=function(t){return{_tag:"Left",left:t}},ra=function(t){return{_tag:"Right",right:t}},ru=function(t){return[t]},rs=function(t){return t.length>0},rc=function(t){return t[0]},rl=function(t){return t.slice(1)},rd=[],rf={},rp=Object.prototype.hasOwnProperty,rh=function(t){return n6([t[0]],t.slice(1),!0)};function rm(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 rg(t){return function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}}}function ry(t){return function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}function rv(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 rb(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 rx(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):rx(t,n-1,o)}}var rM={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 rT(t){return rp.call(rM,t)||(rM[t]=rx(n0,t-1,[])),rM[t]}function rS(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 rx(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 rw=Object.freeze(Object.defineProperty({__proto__:null,ap:rm,apFirst:rg,apS:rv,apSecond:ry,getApplySemigroup:rb,sequenceS:function(t){return function(n){for(var r=Object.keys(n),i=r.length,o=rS(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=rT(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 rI(t,n){return function(r){return function(i){return t.map(i,function(t){return n.map(t,r)})}}}function r_(t){return function(n){return function(r){return t.map(r,function(t){return t(n)})}}}function rO(t){return function(n){return function(r){return t.map(r,function(t){var r;return(r={})[n]=t,r})}}}function rk(t,n){var r=rI(t,n);return{map:function(t,n){return n3(t,r(n))}}}let rC=Object.freeze(Object.defineProperty({__proto__:null,bindTo:rO,flap:r_,getFunctorComposition:rk,map:rI},Symbol.toStringTag,{value:"Module"}));function rN(t){var n=rb(t);return function(r){return{concat:n(r).concat,empty:t.of(r.empty)}}}function rj(t,n){var r=rk(t,n).map,i=rm(t,n);return{map:r,of:function(r){return t.of(n.of(r))},ap:function(t,n){return n3(t,i(n))}}}let rE=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeComposition:rj,getApplicativeMonoid:rN},Symbol.toStringTag,{value:"Module"}));function rR(t){return function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}}}function rD(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 rA=Object.freeze(Object.defineProperty({__proto__:null,bind:rD,chainFirst:rR},Symbol.toStringTag,{value:"Module"}));function rL(t){return function(n){return function(r){return t.fromEither(n7(r)?ro(n()):ra(r.value))}}}function rP(t){return function(n,r){return function(i){return t.fromEither(n(i)?ra(i):ro(r(i)))}}}function rF(t){var n=rL(t);return function(t){var r=n(t);return function(t){return nX(t,r)}}}function rz(t,n){var r=rF(t);return function(t){var i=r(t);return function(t){return function(r){return n.chain(r,i(t))}}}}function rU(t){return function(n){return nX(n,t.fromEither)}}function rW(t,n){var r=rU(t);return function(t){return function(i){return n.chain(i,r(t))}}}function rB(t,n){return nX(rU(t),rR(n))}function rV(t,n){return function(r,i){return function(o){return n.chain(o,function(n){return t.fromEither(r(n)?ra(n):ro(i(n)))})}}}let r$=Object.freeze(Object.defineProperty({__proto__:null,chainEitherK:rW,chainFirstEitherK:rB,chainOptionK:rz,filterOrElse:rV,fromEitherK:rU,fromOption:rL,fromOptionK:rF,fromPredicate:rP},Symbol.toStringTag,{value:"Module"}));var rK=function(t){return{equals:function(n,r){return n===r||t(n,r)}}},rY=function(t){return rK(function(n,r){for(var i in t)if(!t[i].equals(n[i],r[i]))return!1;return!0})},rq=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return rK(function(n,r){return t.every(function(t,i){return t.equals(n[i],r[i])})})},rG=function(t){return function(n){return rK(function(r,i){return n.equals(t(r),t(i))})}},rZ={equals:function(t,n){return t===n}},rQ={equals:function(){return!0}},rH=function(){return{concat:function(t,n){return rK(function(r,i){return t.equals(r,i)&&n.equals(r,i)})}}},rJ=function(){return{concat:rH().concat,empty:rQ}},rX={URI:"Eq",contramap:function(t,n){return n3(t,rG(n))}},r0=rZ.equals;let r1=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:rX,URI:"Eq",contramap:rG,eq:rX,eqBoolean:rZ,eqDate:{equals:function(t,n){return t.valueOf()===n.valueOf()}},eqNumber:rZ,eqStrict:rZ,eqString:rZ,fromEquals:rK,getMonoid:rJ,getSemigroup:rH,getStructEq:rY,getTupleEq:rq,strictEqual:r0,struct:rY,tuple:rq},Symbol.toStringTag,{value:"Module"}));var r2=function(t){return function(n,r){return n===r||0===t(n,r)}},r4=function(t){return{equals:r2(t),compare:function(n,r){return n===r?0:t(n,r)}}},r3=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r4(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])})},r5=function(t){return r4(function(n,r){return t.compare(r,n)})},r9=function(t){return function(n){return r4(function(r,i){return n.compare(t(r),t(i))})}},r8=function(){return{concat:function(t,n){return r4(function(r,i){var o=t.compare(r,i);return 0!==o?o:n.compare(r,i)})}}},r6=function(){return{concat:r8().concat,empty:r4(function(){return 0})}},r7={URI:"Ord",contramap:function(t,n){return n3(t,r9(n))}},ie={equals:nZ,compare:nG(0)},it=function(t){return function(n){return function(r){return r===n||0===t.compare(r,n)}}},ir=function(t){return function(n,r){return -1===t.compare(n,r)}},ii=function(t){return function(n,r){return 1===t.compare(n,r)}},io=function(t){return function(n,r){return 1!==t.compare(n,r)}},ia=function(t){return function(n,r){return -1!==t.compare(n,r)}},iu=function(t){return function(n,r){return n===r||1>t.compare(n,r)?n:r}},is=function(t){return function(n,r){return n===r||t.compare(n,r)>-1?n:r}},ic=function(t){var n=iu(t),r=is(t);return function(t,i){return function(o){return r(n(o,i),t)}}},il=function(t){var n=ir(t),r=ii(t);return function(t,i){return function(o){return!(n(o,t)||r(o,i))}}},id={equals:rZ.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},ip=n3(id,r9(function(t){return t.valueOf()}));let ih=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:r7,URI:"Ord",between:il,clamp:ic,contramap:r9,equals:it,equalsDefault:r2,fromCompare:r4,geq:ia,getDualOrd:r5,getMonoid:r6,getSemigroup:r8,getTupleOrd:r3,gt:ii,leq:io,lt:ir,max:is,min:iu,ord:r7,ordBoolean:id,ordDate:ip,ordNumber:id,ordString:id,reverse:r5,trivial:ie,tuple:r3},Symbol.toStringTag,{value:"Module"}));var im=function(t){return{concat:function(n,r){return t.concat(r,n)}}},ig=function(t){return function(n){return{concat:function(r,i){return t(r)?n.concat(r,i):i}}}},iy=function(t){return function(n){return{concat:function(r,i){return t(i)?n.concat(r,i):r}}}},iv=function(t){return function(n){return{concat:function(r,i){return n.concat(t(r),t(i))}}}},ib=function(t){return function(n){return function(r){return r.reduce(function(n,r){return t.concat(n,r)},n)}}};let ix=Object.freeze(Object.defineProperty({__proto__:null,concatAll:ib,endo:iv,filterFirst:ig,filterSecond:iy,reverse:im},Symbol.toStringTag,{value:"Module"}));var iM=function(t){return{concat:iu(t)}},iT=function(t){return{concat:is(t)}},iS=function(t){return{concat:function(){return t}}},iw=function(t){return{concat:function(n,r){var i={};for(var o in t)rp.call(t,o)&&(i[o]=t[o].concat(n[o],r[o]));return i}}},iI=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])})}}},i_=function(t){return function(n){return{concat:function(r,i){return n.concat(r,n.concat(t,i))}}}},iO=function(){return{concat:nq}},ik=function(){return{concat:function(t,n){return n}}},iC=iS(void 0),iN=function(){return{concat:function(t,n){return Object.assign({},t,n)}}},ij={concat:function(t,n){return t&&n}},iE={concat:function(t,n){return t||n}},iR={concat:function(t,n){return t+n}},iD={concat:function(t,n){return t+n}},iA={concat:function(t,n){return t*n}};let iL=Object.freeze(Object.defineProperty({__proto__:null,concatAll:ib,constant:iS,first:iO,fold:function(t){var n=ib(t);return function(t,r){return void 0===r?n(t):n(t)(r)}},getDualSemigroup:im,getFirstSemigroup:iO,getFunctionSemigroup:nB,getIntercalateSemigroup:i_,getJoinSemigroup:iT,getLastSemigroup:ik,getMeetSemigroup:iM,getObjectSemigroup:iN,getStructSemigroup:iw,getTupleSemigroup:iI,intercalate:i_,last:ik,max:iT,min:iM,reverse:im,semigroupAll:ij,semigroupAny:iE,semigroupProduct:iA,semigroupString:iR,semigroupSum:iD,semigroupVoid:iC,struct:iw,tuple:iI},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))},iF=function(t,n){return t<0||t>=n.length},iz=function(t){return function(n){return iP([t],n,!0)}},iU=function(t){return function(n){return iP(iP([],n,!0),[t],!1)}},iW=function(t,n,r){if(rs(r)){var i=rh(r);return i.splice(t,0,n),i}return[n]},iB=function(t,n,r){if(r[t]===n)return r;var i=rh(r);return i[t]=n,i},iV=function(t){return function(n){if(1===n.length)return n;for(var r=[o1(n)],i=o2(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}},i$=function(t){if(rs(t)){var n=r6();return i5(t.reduce(n.concat,n.empty))}return nq},iK=function(t){var n=iV(t);return function(t){return function(r){return n(n3(r,i1(t)))}}},iY=function(t){return function(n){var r=n.length,i=Math.round(t)%r;if(iF(Math.abs(i),n)||0===i)return n;if(!(i<0))return iY(i-r)(n);var o=oi(-i)(n),a=o[0];return n3(o[1],i1(a))}},iq=function(t){return rs(t)?rn(t):rt},iG=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}},iZ=function(t){return iG(function(){return t})},iQ=function(t,n){return t<=n?iG(function(n){return t+n})(n-t+1):[t]},iH=function(t){return[o1(t),o2(t)]},iJ=function(t){return[o3(t),o4(t)]},iX=function(t){return iq(t.slice())};function i0(t){return function(n){return n.concat(t)}}function i1(t,n){return n?t.concat(n):function(n){return n.concat(t)}}var i2=function(t){return 1===t.length?t:iP([o4(t)],t.slice(0,-1).reverse(),!0)};function i4(t){return function(n){var r=n.length;if(0===r)return rd;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 i3=function(t){return function(n){for(var r={},i=0;i<n.length;i++){var o=n[i],a=t(o);rp.call(r,a)?r[a].push(o):r[a]=[o]}return r}},i5=function(t){return function(n){return 1===n.length?n:n.slice().sort(t.compare)}},i9=function(t,n){return i8(t,function(){return n})},i8=function(t,n){return function(r){return iF(t,r)?rt:rn(iB(t,n(r[t]),r))}},i6=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},i7=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]},oe=function(t){return function(n){for(var r=[t,n[0]],i=1;i<n.length;i++)r.push(t,n[i]);return r}},ot=function(t){return function(n){var r=o2(n);return rs(r)?n3(r,oe(t),iz(o1(n))):n}},on=function(t){return function(n){for(var r=rh(t(0,o1(n))),i=1;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},or=function(t){return function(n){for(var r=t(n),i=r[0],o=r[1],a=[i],u=o;rs(u);){var s=t(u),c=s[0],l=s[1];a.push(c),u=l}return a}},oi=function(t){return function(n){var r=Math.max(1,t);return r>=n.length?[n,rd]:[n3(n.slice(1,r),iz(o1(n))),n.slice(r)]}},oo=function(t){return or(oi(t))},oa=function(t,n){return n3(t,ok(n))},ou=function(t,n){return n3(t,oC(n))},oc=function(t,n){return n3(t,oS(n))},ol=function(t,n){return n3(t,ow(n))},od=function(t,n){return n3(t,oI(n))},of=function(t,n,r){return n3(t,oN(n,r))},op=function(t){var n=oj(t);return function(t,r){return n3(t,n(r))}},oh=function(t,n,r){return n3(t,oE(n,r))},om=function(t){var n=oL(t);return function(t,r){return n3(t,n(r))}},og=function(t,n){return n3(t,oT(n))},oy=function(t,n,r){return n3(t,oR(n,r))},ov=function(t){var n=oD(t);return function(t,r){return n3(t,n(r))}},ob=function(t,n,r){return n3(t,oA(n,r))},ox=function(t){var n=oF(t);return function(t,r){return n3(t,n(r))}},oM=function(t){return function(n){return n3(n,i0(t()))}},oT=oM,oS=function(t){return ow(function(n){return n3(t,ok(n))})},ow=function(t){return on(function(n,r){return t(r)})},oI=function(t){return function(n){for(var r=o2(n),i=[t(n)];rs(r);)i.push(t(r)),r=o2(r);return i}},o_=oI(nq),oO=ow(nq),ok=function(t){return oC(function(n,r){return t(r)})},oC=function(t){return function(n){for(var r=[t(0,o1(n))],i=1;i<n.length;i++)r.push(t(i,n[i]));return r}},oN=function(t,n){return oR(t,function(t,r,i){return n(r,i)})},oj=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]))}}},oE=function(t,n){return oA(t,function(t,r,i){return n(r,i)})},oR=function(t,n){return function(r){return r.reduce(function(t,r,i){return n(i,t,r)},t)}},oD=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]))}}},oA=function(t,n){return function(r){return r.reduceRight(function(t,r,i){return n(i,r,t)},t)}},oL=function(t){var n=oF(t);return function(t){return n(function(n,r){return t(r)})}},oP=function(t){return oF(t)(n5)},oF=function(t){return function(n){return function(r){for(var i=t.map(n(0,o1(r)),ru),o=1;o<r.length;o++)i=t.ap(t.map(i,function(t){return function(n){return n3(t,iU(n))}}),n(o,r[o]));return i}}},oz="ReadonlyNonEmptyArray",oU=function(t){return{show:function(n){return"[".concat(n.map(t.show).join(", "),"]")}}},oW=function(){return{concat:i1}},oB=function(t){return rK(function(n,r){return n.length===r.length&&n.every(function(n,i){return t.equals(n,r[i])})})},oV=function(t){var n=iK(t);return{concat:function(t,r){return n(r)(t)}}},o$={URI:oz,map:oa},oK=r_(o$),oY={URI:oz,map:oa,ap:oc},oq=rg(oY),oG=ry(oY),oZ={URI:oz,map:oa,ap:oc,chain:ol},oQ=rR(oZ),oH=ru(rf),oJ=rO(o$),oX=rD(oZ),o0=rv(oY),o1=rc,o2=rl,o4=function(t){return t[t.length-1]},o3=function(t){return t.slice(0,-1)},o5=function(t){var n=iM(t);return function(t){return t.reduce(n.concat)}},o9=function(t){var n=iT(t);return function(t){return t.reduce(n.concat)}},o8=function(t){return function(n){return n.reduce(t.concat)}},o6=function(t){return function(n){return t(o1(n),o2(n))}},o7=function(t){return function(n){return t(o3(n),o4(n))}},ae=function(t){return function(n){return iP([t(o1(n))],o2(n),!0)}},at=function(t){return ae(function(){return t})},an=function(t){return function(n){return n3(o3(n),iU(t(o4(n))))}},ar=function(t){return an(function(){return t})},ai=function(t){var n=o8(t);return function(t){return nX(ot(t),n)}},ao=function(t){return function(n){return iq(n.filter(function(n,r){return t(r,n)}))}};function aa(t,n){return void 0===n?iz(t):n3(n,iz(t))}var au=function(t,n){return n3(t,i1([n]))},as=function(t,n){return function(r){return t<0||t>r.length?rt:rn(iW(t,n,r))}};let ac=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:oz,map:oa,alt:og},Applicative:{URI:oz,map:oa,ap:oc,of:ru},Apply:oY,Chain:oZ,Comonad:{URI:oz,map:oa,extend:od,extract:rc},Do:oH,Foldable:{URI:oz,reduce:of,foldMap:op,reduceRight:oh},FoldableWithIndex:{URI:oz,reduce:of,foldMap:op,reduceRight:oh,reduceWithIndex:oy,foldMapWithIndex:ov,reduceRightWithIndex:ob},Functor:o$,FunctorWithIndex:{URI:oz,map:oa,mapWithIndex:ou},Monad:{URI:oz,map:oa,ap:oc,of:ru,chain:ol},Pointed:{URI:oz,of:ru},Traversable:{URI:oz,map:oa,reduce:of,foldMap:op,reduceRight:oh,traverse:om,sequence:oP},TraversableWithIndex:{URI:oz,map:oa,mapWithIndex:ou,reduce:of,foldMap:op,reduceRight:oh,traverse:om,sequence:oP,reduceWithIndex:oy,foldMapWithIndex:ov,reduceRightWithIndex:ob,traverseWithIndex:ox},URI:oz,alt:oT,altW:oM,ap:oS,apFirst:oq,apS:o0,apSecond:oG,append:iU,appendW:iU,bind:oX,bindTo:oJ,chain:ow,chainFirst:oQ,chainWithIndex:on,chop:or,chunksOf:oo,concat:i1,concatAll:o8,concatW:i0,cons:aa,duplicate:o_,empty:rd,extend:oI,extract:rc,filter:function(t){return ao(function(n,r){return t(r)})},filterWithIndex:ao,flap:oK,flatten:oO,fold:o8,foldMap:oj,foldMapWithIndex:oD,fromArray:iX,fromReadonlyArray:iq,getEq:oB,getSemigroup:oW,getShow:oU,getUnionSemigroup:oV,group:i4,groupBy:i3,groupSort:function(t){var n=i5(t),r=i4(t);return function(t){return rs(t)?r(n(t)):rd}},head:o1,init:o3,insertAt:as,intercalate:ai,intersperse:ot,isNonEmpty:rs,isOutOfBound:iF,last:o4,makeBy:iG,map:ok,mapWithIndex:oC,matchLeft:o6,matchRight:o7,max:o9,min:o5,modifyAt:i8,modifyHead:ae,modifyLast:an,of:ru,prepend:iz,prependAll:oe,prependToAll:oe,prependW:iz,range:iQ,readonlyNonEmptyArray:{URI:oz,of:ru,map:oa,mapWithIndex:ou,ap:oc,chain:ol,extend:od,extract:rc,reduce:of,foldMap:op,reduceRight:oh,traverse:om,sequence:oP,reduceWithIndex:oy,foldMapWithIndex:ov,reduceRightWithIndex:ob,traverseWithIndex:ox,alt:og},reduce:oN,reduceRight:oE,reduceRightWithIndex:oA,reduceWithIndex:oR,replicate:iZ,reverse:i2,rotate:iY,sequence:oP,snoc:au,sort:i5,sortBy:i$,splitAt:oi,tail:o2,traverse:oL,traverseWithIndex:oF,unappend:iJ,uncons:iH,union:iK,uniq:iV,unprepend:iH,unsafeInsertAt:iW,unsafeUpdateAt:iB,unsnoc:iJ,unzip:i7,updateAt:i9,updateHead:at,updateLast:ar,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:i6(n,r,function(t,n){return[t,n]})},zipWith:i6},Symbol.toStringTag,{value:"Module"}));var al=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))},ad=function(t){return t.length>0},af=function(t,n){return t<0||t>=n.length},ap=function(t){return function(n){return al([t],n,!0)}},ah=function(t){return function(n){return al(al([],n,!0),[t],!1)}},am=function(t,n,r){if(ad(r)){var i=aM(r);return i.splice(t,0,n),i}return[n]},ag=function(t,n,r){var i=aM(r);return i[t]=n,i},ay=function(t){return function(n){if(1===n.length)return aP(n);for(var r=[uO(n)],i=uk(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}},av=function(t){if(ad(t)){var n=r6();return aR(t.reduce(n.concat,n.empty))}return aP},ab=function(t){var n=ay(t);return function(t){return function(r){return n(n3(r,aC(t)))}}},ax=function(t){return function(n){var r=n.length,i=Math.round(t)%r;if(af(Math.abs(i),n)||0===i)return aP(n);if(!(i<0))return ax(i-r)(n);var o=aK(-i)(n),a=o[0];return n3(o[1],aC(a))}},aM=rh,aT=function(t){return ad(t)?rn(t):rt},aS=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}},aw=function(t){return aS(function(){return t})},aI=function(t,n){return t<=n?aS(function(n){return t+n})(n-t+1):[t]},a_=function(t){return[uO(t),uk(t)]},aO=function(t){return[uN(t),uC(t)]};function ak(t){return function(n){return n.concat(t)}}function aC(t,n){return n?t.concat(n):function(n){return n.concat(t)}}var aN=function(t){return al([uC(t)],t.slice(0,-1).reverse(),!0)};function aj(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 aE=function(t){return function(n){for(var r={},i=0;i<n.length;i++){var o=n[i],a=t(o);rp.call(r,a)?r[a].push(o):r[a]=[o]}return r}},aR=function(t){return function(n){return n.slice().sort(t.compare)}},aD=function(t,n){return function(r){return t<0||t>r.length?rt:rn(am(t,n,r))}},aA=function(t,n){return aL(t,function(){return n})},aL=function(t,n){return function(r){return af(t,r)?rt:rn(ag(t,n(r[t]),r))}},aP=aM,aF=function(t){return[t]},az=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},aU=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]},aW=function(t){return function(n){for(var r=[t,n[0]],i=1;i<n.length;i++)r.push(t,n[i]);return r}},aB=function(t){return function(n){var r=uk(n);return ad(r)?n3(r,aW(t),ap(uO(n))):aP(n)}},aV=function(t){return function(n){for(var r=aM(t(0,uO(n))),i=1;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},a$=function(t){return function(n){for(var r=t(n),i=r[0],o=r[1],a=[i],u=o;ad(u);){var s=t(u),c=s[0],l=s[1];a.push(c),u=l}return a}},aK=function(t){return function(n){var r=Math.max(1,t);return r>=n.length?[aP(n),[]]:[n3(n.slice(1,r),ap(uO(n))),n.slice(r)]}},aY=function(t){return a$(aK(t))},aq=function(t,n){return n3(t,ui(n))},aG=function(t,n){return n3(t,uo(n))},aZ=function(t,n){return n3(t,a7(n))},aQ=function(t,n){return n3(t,ue(n))},aH=function(t,n){return n3(t,ut(n))},aJ=function(t,n,r){return n3(t,ua(n,r))},aX=function(t){var n=oj(t);return function(t,r){return n3(t,n(r))}},a0=function(t,n,r){return n3(t,us(n,r))},a1=function(t){var n=ul(t);return function(t,r){return n3(t,n(r))}},a2=function(t,n){return n3(t,a6(n))},a4=function(t,n,r){return n3(t,uu(n,r))},a3=function(t){var n=oD(t);return function(t,r){return n3(t,n(r))}},a5=function(t,n,r){return n3(t,uc(n,r))},a9=function(t){var n=uf(t);return function(t,r){return n3(t,n(r))}},a8=function(t){return function(n){return n3(n,ak(t()))}},a6=a8,a7=function(t){return ue(function(n){return n3(t,ui(n))})},ue=function(t){return aV(function(n,r){return t(r)})},ut=function(t){return function(n){for(var r=uk(n),i=[t(n)];ad(r);)i.push(t(r)),r=uk(r);return i}},un=ut(nq),ur=ue(nq),ui=function(t){return uo(function(n,r){return t(r)})},uo=function(t){return function(n){for(var r=[t(0,uO(n))],i=1;i<n.length;i++)r.push(t(i,n[i]));return r}},ua=oN,uu=oR,us=oE,uc=oA,ul=function(t){var n=uf(t);return function(t){return n(function(n,r){return t(r)})}},ud=function(t){return uf(t)(function(t,n){return n})},uf=function(t){return function(n){return function(r){for(var i=t.map(n(0,uO(r)),aF),o=1;o<r.length;o++)i=t.ap(t.map(i,function(t){return function(n){return n3(t,ah(n))}}),n(o,r[o]));return i}}},up="NonEmptyArray",uh=function(){return{concat:aC}},um=function(t){var n=ab(t);return{concat:function(t,r){return n(r)(t)}}},ug={URI:up,map:aq},uy=r_(ug),uv={URI:up,map:aq,ap:aZ},ub=rg(uv),ux=ry(uv),uM={URI:up,map:aq,ap:aZ,chain:aQ},uT=rR(uM),uS=aF(rf),uw=rO(ug),uI=rD(uM),u_=rv(uv),uO=o1,uk=function(t){return t.slice(1)},uC=o4,uN=function(t){return t.slice(0,-1)},uj=function(t){return function(n){return n.reduce(t.concat)}},uE=function(t){return function(n){return t(uO(n),uk(n))}},uR=function(t){return function(n){return t(uN(n),uC(n))}},uD=function(t){return function(n){return al([t(uO(n))],uk(n),!0)}},uA=function(t){return uD(function(){return t})},uL=function(t){return function(n){return n3(uN(n),ah(t(uC(n))))}},uP=function(t){return uL(function(){return t})},uF=function(t){return function(n){return aT(n.filter(function(n,r){return t(r,n)}))}};function uz(t,n){return void 0===n?ap(t):n3(n,ap(t))}var uU=function(t,n){return n3(t,ah(n))};let uW=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:up,map:aq,alt:a2},Applicative:{URI:up,map:aq,ap:aZ,of:aF},Apply:uv,Chain:uM,Comonad:{URI:up,map:aq,extend:aH,extract:o1},Do:uS,Foldable:{URI:up,reduce:aJ,foldMap:aX,reduceRight:a0},FoldableWithIndex:{URI:up,reduce:aJ,foldMap:aX,reduceRight:a0,reduceWithIndex:a4,foldMapWithIndex:a3,reduceRightWithIndex:a5},Functor:ug,FunctorWithIndex:{URI:up,map:aq,mapWithIndex:aG},Monad:{URI:up,map:aq,ap:aZ,of:aF,chain:aQ},Pointed:{URI:up,of:aF},Traversable:{URI:up,map:aq,reduce:aJ,foldMap:aX,reduceRight:a0,traverse:a1,sequence:ud},TraversableWithIndex:{URI:up,map:aq,mapWithIndex:aG,reduce:aJ,foldMap:aX,reduceRight:a0,traverse:a1,sequence:ud,reduceWithIndex:a4,foldMapWithIndex:a3,reduceRightWithIndex:a5,traverseWithIndex:a9},URI:up,alt:a6,altW:a8,ap:a7,apFirst:ub,apS:u_,apSecond:ux,append:ah,appendW:ah,bind:uI,bindTo:uw,chain:ue,chainFirst:uT,chainWithIndex:aV,chop:a$,chunksOf:aY,concat:aC,concatAll:uj,concatW:ak,cons:uz,copy:aP,duplicate:un,extend:ut,extract:o1,filter:function(t){return uF(function(n,r){return t(r)})},filterWithIndex:uF,flap:uy,flatten:ur,fold:o8,foldMap:oj,foldMapWithIndex:oD,fromArray:aT,fromReadonlyNonEmptyArray:aM,getEq:oB,getSemigroup:uh,getShow:oU,getUnionSemigroup:um,group:aj,groupBy:aE,groupSort:function(t){var n=aR(t),r=aj(t);return function(t){return ad(t)?r(n(t)):[]}},head:uO,init:uN,insertAt:aD,intercalate:ai,intersperse:aB,isNonEmpty:ad,isOutOfBound:af,last:uC,makeBy:aS,map:ui,mapWithIndex:uo,matchLeft:uE,matchRight:uR,max:o9,min:o5,modifyAt:aL,modifyHead:uD,modifyLast:uL,nonEmptyArray:{URI:up,of:aF,map:aq,mapWithIndex:aG,ap:aZ,chain:aQ,extend:aH,extract:o1,reduce:aJ,foldMap:aX,reduceRight:a0,traverse:a1,sequence:ud,reduceWithIndex:a4,foldMapWithIndex:a3,reduceRightWithIndex:a5,traverseWithIndex:a9,alt:a2},of:aF,prepend:ap,prependAll:aW,prependToAll:aW,prependW:ap,range:aI,reduce:ua,reduceRight:us,reduceRightWithIndex:uc,reduceWithIndex:uu,replicate:aw,reverse:aN,rotate:ax,sequence:ud,snoc:uU,sort:aR,sortBy:av,splitAt:aK,tail:uk,traverse:ul,traverseWithIndex:uf,unappend:aO,uncons:a_,union:ab,uniq:ay,unprepend:a_,unsafeInsertAt:am,unsafeUpdateAt:ag,unsnoc:aO,unzip:aU,updateAt:aA,updateHead:uA,updateLast:uP,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:az(n,r,function(t,n){return[t,n]})},zipWith:az},Symbol.toStringTag,{value:"Module"}));var uB=function(t){return"number"==typeof t},uV={equals:function(t,n){return t===n}},u$={equals:uV.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},uK={equals:uV.equals,compare:u$.compare,top:1/0,bottom:-1/0},uY={concat:function(t,n){return t-n}},uq={concat:function(t,n){return t+n}},uG={concat:function(t,n){return t*n}},uZ={concat:uq.concat,empty:0},uQ={concat:uG.concat,empty:1},uH={add:uq.concat,zero:0,mul:uG.concat,one:1,sub:uY.concat,degree:function(t){return 1},div:function(t,n){return t/n},mod:function(t,n){return t%n}};let uJ=Object.freeze(Object.defineProperty({__proto__:null,Bounded:uK,Eq:uV,Field:uH,MagmaSub:uY,MonoidProduct:uQ,MonoidSum:uZ,Ord:u$,SemigroupProduct:uG,SemigroupSum:uq,Show:{show:function(t){return JSON.stringify(t)}},isNumber:uB},Symbol.toStringTag,{value:"Module"}));var uX=function(t,n){return{left:t,right:n}},u0=function(t,n){return n3(t,u4(n))},u1=function(t,n,r){return n3(t,u3(n,r))},u2=function(t){return function(n){return uX(u6(n),t(u7(n)))}},u4=function(t){return function(n){return uX(t(u6(n)),u7(n))}},u3=function(t,n){return function(r){return uX(t(u6(r)),n(u7(r)))}},u5="Separated",u9={URI:u5,map:function(t,n){return n3(t,u2(n))}},u8=r_(u9),u6=function(t){return t.left},u7=function(t){return t.right};let se=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:u5,mapLeft:u0,bimap:u1},Functor:u9,URI:u5,bimap:u3,flap:u8,left:u6,map:u2,mapLeft:u4,right:u7,separated:uX},Symbol.toStringTag,{value:"Module"}));function st(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.separate)}}}function sn(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.compact)}}}function sr(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?rn(r):rt})})}}}}let si=Object.freeze(Object.defineProperty({__proto__:null,filterE:sr,wiltDefault:st,witherDefault:sn},Symbol.toStringTag,{value:"Module"}));function so(t,n){return function(r){return r?n.of(void 0):t.zero()}}let sa=Object.freeze(Object.defineProperty({__proto__:null,guard:so},Symbol.toStringTag,{value:"Module"}));var su=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))},ss=function(t){return 0===t.length},sc=function(t,n){return t<=0?lT:iG(n)(t)},sl=function(t,n){return sc(t,function(){return n})},sd=function(t){return n7(t)?lT:[t.value]},sf=function(t){return rr(t)?lT:[t.right]},sp=function(t,n){return function(r){return rs(r)?n(r):t()}},sh=function(t,n){return function(r){return rs(r)?n(o1(r),o2(r)):t()}},sm=function(t,n){return function(r){return rs(r)?n(o3(r),o4(r)):t()}},sg=function(t){return function(n){if(ss(n))return lT;for(var r=[],i=0;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},sy=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}},sv=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}},sb=function(t){return t.length};function sx(t,n){return void 0===n?function(n){return sx(t,n)}:iF(t,n)?rt:rn(n[t])}var sM=function(t){return rs(t)?rn(o1(t)):rt},sT=function(t){return rs(t)?rn(o4(t)):rt},sS=function(t){return rs(t)?rn(o2(t)):rt},sw=function(t){return rs(t)?rn(o3(t)):rt},sI=function(t){return function(n){return iF(t,n)?n:0===t?lT:n.slice(0,t)}},s_=function(t){return function(n){return iF(t,n)?n:0===t?lT:n.slice(-t)}},sO=function(t,n){for(var r=t.length,i=0;i<r&&n(t[i]);i++);return i},sk=function(t){return function(n){return t<=0||ss(n)?n:t>=n.length?lT:n.slice(t,n.length)}},sC=function(t){return function(n){return t<=0||ss(n)?n:t>=n.length?lT:n.slice(0,n.length-t)}},sN=function(t){return function(n){for(var r=0;r<n.length;r++)if(t(n[r]))return rn(r);return rt}};function sj(t){return function(n){for(var r=0;r<n.length;r++)if(t(n[r]))return rn(n[r]);return rt}}var sE=function(t){return function(n){for(var r=0;r<n.length;r++){var i=t(n[r]);if(re(i))return i}return rt}};function sR(t){return function(n){for(var r=n.length-1;r>=0;r--)if(t(n[r]))return rn(n[r]);return rt}}var sD=function(t){return function(n){for(var r=n.length-1;r>=0;r--){var i=t(n[r]);if(re(i))return i}return rt}},sA=function(t){return function(n){for(var r=n.length-1;r>=0;r--)if(t(n[r]))return rn(r);return rt}},sL=function(t,n){return function(r){return t<0||t>r.length?rt:rn(iW(t,n,r))}},sP=function(t,n){return sz(t,function(){return n})},sF=function(t){return function(n){return iF(t,n)?rt:rn(lb(t,n))}},sz=function(t,n){return function(r){return iF(t,r)?rt:rn(lv(t,n(r[t]),r))}},sU=function(t){return t.length<=1?t:t.slice().reverse()},sW=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Right"===i._tag&&n.push(i.right)}return n},sB=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Left"===i._tag&&n.push(i.left)}return n},sV=function(t){return function(n){return n.length<=1?n:n.slice().sort(t.compare)}},s$=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},sK=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]},sY=function(t){var n=oe(t);return function(t){return rs(t)?n(t):t}},sq=function(t){var n=ot(t);return function(t){return rs(t)?n(t):t}},sG=function(t){var n=iY(t);return function(t){return rs(t)?n(t):t}};function sZ(t){return function(n,r){if(void 0===r){var i,o=sZ(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 sQ=function(t){var n=iV(t);return function(t){return rs(t)?n(t):t}},sH=function(t){var n=i$(t);return function(t){return rs(t)?n(t):t}},sJ=function(t){var n=or(t);return function(t){return rs(t)?n(t):lT}},sX=function(t){return function(n){return t>=1&&rs(n)?oi(t)(n):ss(n)?[n,lT]:[lT,n]}},s0=function(t){var n=oo(t);return function(t){return rs(t)?n(t):lT}},s1=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return sd(t.apply(void 0,n))}},s2=function(t){return function(n){return ss(n)?t:ss(t)?n:n.concat(t)}};function s4(t){var n=iK(t);return function(r,i){if(void 0===i){var o=s4(t);return function(t){return o(t,r)}}return rs(r)&&rs(i)?n(i)(r):rs(r)?r:i}}function s3(t){var n=sZ(t);return function(r,i){if(void 0===i){var o=s3(t);return function(t){return o(t,r)}}return r.filter(function(t){return n(t,i)})}}function s5(t){var n=sZ(t);return function(r,i){if(void 0===i){var o=s5(t);return function(t){return o(t,r)}}return r.filter(function(t){return!n(t,i)})}}var s9=function(t,n){return n3(t,c_(n))},s8=function(t,n){return n3(t,cO(n))},s6=function(t,n){return n3(t,cS(n))},s7=function(t,n){return n3(t,cw(n))},ce=function(t,n){return n3(t,cC(n))},ct=function(t,n){return n3(t,cj(n))},cn=function(t,n){return n3(t,cR(n))},cr=function(t,n){return n3(t,cA(n))},ci=function(t,n){return n3(t,cD(n))},co=function(t,n){return n3(t,cL(n))},ca=function(t,n){return n3(t,cT(n))},cu=function(t,n,r){return n3(t,cW(n,r))},cs=function(t){var n=cB(t);return function(t,r){return n3(t,n(r))}},cc=function(t,n,r){return n3(t,c$(n,r))},cl=function(t,n,r){return n3(t,cV(n,r))},cd=function(t){var n=cU(t);return function(t,r){return n3(t,n(r))}},cf=function(t,n,r){return n3(t,cK(n,r))},cp=function(t,n){return n3(t,cN(n))},ch=function(t,n){return n3(t,cP(n))},cm=function(t,n){return n3(t,cF(n))},cg=function(t){var n=cY(t);return function(t,r){return n3(t,n(r))}},cy=function(t){var n=cG(t);return function(t,r){return n3(t,n(r))}},cv=function(t,n){return n3(t,ll(n))},cb=function(t,n){return n3(t,ld(n))},cx=function(){return lT},cM=function(t){return function(n){return n.concat(t())}},cT=cM,cS=function(t){return cw(function(n){return n3(t,c_(n))})},cw=function(t){return function(n){return n3(n,sg(function(n,r){return t(r)}))}},cI=cw(nq),c_=function(t){return function(n){return n.map(function(n){return t(n)})}},cO=function(t){return function(n){return n.map(function(n,r){return t(r,n)})}},ck=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 uX(n,r)},cC=function(t){return function(n){return n.filter(t)}},cN=function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=t(i,n[i]);re(o)&&r.push(o.value)}return r}},cj=function(t){return cN(function(n,r){return t(r)})},cE=cj(nq),cR=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=n[o];t(o,a)?i.push(a):r.push(a)}return uX(r,i)}},cA=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=t(o,n[o]);"Left"===a._tag?r.push(a.left):i.push(a.right)}return uX(r,i)}},cP=function(t){return function(n){return n.filter(function(n,r){return t(r,n)})}},cF=function(t){return function(n){return n.map(function(r,i){return t(n.slice(i))})}},cz=cF(nq),cU=function(t){return function(n){return function(r){return r.reduce(function(r,i,o){return t.concat(r,n(o,i))},t.empty)}}},cW=function(t,n){return cV(t,function(t,r,i){return n(r,i)})},cB=function(t){var n=cU(t);return function(t){return n(function(n,r){return t(r)})}},cV=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}},c$=function(t,n){return cK(t,function(t,r,i){return n(r,i)})},cK=function(t,n){return function(r){return r.reduceRight(function(t,r,i){return n(i,r,t)},t)}},cY=function(t){var n=cG(t);return function(t){return n(function(n,r){return t(r)})}},cq=function(t){return function(n){return cu(n,t.of(cx()),function(n,r){return t.ap(t.map(n,function(t){return function(n){return n3(t,iU(n))}}),r)})}},cG=function(t){return function(n){return cV(t.of(cx()),function(r,i,o){return t.ap(t.map(i,function(t){return function(n){return n3(t,iU(n))}}),n(r,o))})}},cZ=function(t){var n=lf(t);return function(t){return function(r){return n(r,t)}}},cQ=function(t){var n=lp(t);return function(t){return function(r){return n(r,t)}}},cH=function(t,n){for(var r=[],i=t;;){var o=n(i);if(re(o)){var a=o.value,u=a[0],s=a[1];r.push(u),i=s}else break}return r},cJ="ReadonlyArray",cX=function(t){return{show:function(n){return"[".concat(n.map(t.show).join(", "),"]")}}},c0=function(){return{concat:function(t,n){return ss(t)?n:ss(n)?t:t.concat(n)}}},c1=function(){return{concat:c0().concat,empty:lT}},c2=function(t){return rK(function(n,r){return n.length===r.length&&n.every(function(n,i){return t.equals(n,r[i])})})},c4=function(t){return r4(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 u$.compare(i,o)})},c3=function(t){var n=s4(t);return{concat:function(t,r){return n(r)(t)}}},c5=function(t){return{concat:c3(t).concat,empty:lT}},c9=function(t){var n=s3(t);return{concat:function(t,r){return n(r)(t)}}},c8=function(t){var n=s5(t);return{concat:function(t,r){return n(r)(t)}}},c6={URI:cJ,map:s9},c7=r_(c6),le={URI:cJ,of:ru},lt={URI:cJ,map:s9,ap:s6},ln=rg(lt),lr=ry(lt),li={URI:cJ,map:s9,ap:s6,chain:s7},lo=rR(li),la={URI:cJ,zero:cx},lu=so(la,le),ls={URI:cJ,compact:cE,separate:ck},lc={URI:cJ,map:s9,reduce:cu,foldMap:cs,reduceRight:cc,traverse:cg,sequence:cq},ll=function(t){return function(n){for(var r=su([],t(n),!0),i=[];r.length>0;){var o=r.shift();rr(o)?r.unshift.apply(r,t(o.left)):i.push(o.right)}return i}},ld=function(t){return function(n){var r=t(n),i=[],o=[];function a(n){rr(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}},lf=sn(lc,ls),lp=st(lc,ls),lh={URI:cJ,map:s9,compact:cE,separate:ck,filter:ce,filterMap:ct,partition:cn,partitionMap:cr,reduce:cu,foldMap:cs,reduceRight:cc,traverse:cg,sequence:cq,wither:lf,wilt:lp},lm=sr(lh),lg={URI:cJ,fromEither:sf},ly=rU(lg),lv=function(t,n,r){return rs(r)?iB(t,n,r):r},lb=function(t,n){var r=n.slice();return r.splice(t,1),r},lx=function(t){return t.slice()},lM=function(t){return ss(t)?lT:t.slice()},lT=rd;function lS(t){return function(n){return n.every(t)}}var lw=function(t){return function(n){return n.some(t)}},lI=function(t){var n=ai(t);return function(r){return sp(function(){return t.empty},n(r))}},l_=ru(rf),lO=rO(c6),lk=rD(li),lC=rv(lt);let lN=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:cJ,map:s9,alt:ca},Alternative:{URI:cJ,map:s9,ap:s6,of:ru,alt:ca,zero:cx},Applicative:{URI:cJ,map:s9,ap:s6,of:ru},Apply:lt,Chain:li,ChainRecBreadthFirst:{URI:cJ,map:s9,ap:s6,chain:s7,chainRec:cb},ChainRecDepthFirst:{URI:cJ,map:s9,ap:s6,chain:s7,chainRec:cv},Compactable:ls,Do:l_,Extend:{URI:cJ,map:s9,extend:cm},Filterable:{URI:cJ,map:s9,compact:cE,separate:ck,filter:ce,filterMap:ct,partition:cn,partitionMap:cr},FilterableWithIndex:{URI:cJ,map:s9,mapWithIndex:s8,compact:cE,separate:ck,filter:ce,filterMap:ct,partition:cn,partitionMap:cr,partitionMapWithIndex:co,partitionWithIndex:ci,filterMapWithIndex:cp,filterWithIndex:ch},Foldable:{URI:cJ,reduce:cu,foldMap:cs,reduceRight:cc},FoldableWithIndex:{URI:cJ,reduce:cu,foldMap:cs,reduceRight:cc,reduceWithIndex:cl,foldMapWithIndex:cd,reduceRightWithIndex:cf},FromEither:lg,Functor:c6,FunctorWithIndex:{URI:cJ,map:s9,mapWithIndex:s8},Monad:{URI:cJ,map:s9,ap:s6,of:ru,chain:s7},Pointed:le,Traversable:lc,TraversableWithIndex:{URI:cJ,map:s9,mapWithIndex:s8,reduce:cu,foldMap:cs,reduceRight:cc,reduceWithIndex:cl,foldMapWithIndex:cd,reduceRightWithIndex:cf,traverse:cg,sequence:cq,traverseWithIndex:cy},URI:cJ,Unfoldable:{URI:cJ,unfold:cH},Witherable:lh,Zero:la,_chainRecBreadthFirst:cb,_chainRecDepthFirst:cv,alt:cT,altW:cM,ap:cS,apFirst:ln,apS:lC,apSecond:lr,append:iU,appendW:iU,bind:lk,bindTo:lO,chain:cw,chainFirst:lo,chainRecBreadthFirst:ld,chainRecDepthFirst:ll,chainWithIndex:sg,chop:sJ,chunksOf:s0,compact:cE,comprehension:function(t,n,r){void 0===r&&(r=function(){return!0});var i=function(t,o){return rs(o)?n3(o1(o),cw(function(n){return i(n3(t,iU(n)),o2(o))})):r.apply(void 0,t)?[n.apply(void 0,t)]:lT};return i(lT,t)},concat:s2,concatW:s2,cons:aa,deleteAt:sF,difference:s5,dropLeft:sk,dropLeftWhile:function(t){return function(n){var r=sO(n,t);return 0===r?n:r===n.length?lT:n.slice(r)}},dropRight:sC,duplicate:cz,elem:sZ,empty:lT,every:lS,exists:lw,extend:cF,filter:cC,filterE:lm,filterMap:cj,filterMapWithIndex:cN,filterWithIndex:cP,findFirst:sj,findFirstMap:sE,findIndex:sN,findLast:sR,findLastIndex:sA,findLastMap:sD,flap:c7,flatten:cI,foldLeft:sh,foldMap:cB,foldMapWithIndex:cU,foldRight:sm,fromArray:lM,fromEither:sf,fromEitherK:ly,fromOption:sd,fromOptionK:s1,fromPredicate:function(t){return function(n){return t(n)?[n]:lT}},getDifferenceMagma:c8,getEq:c2,getIntersectionSemigroup:c9,getMonoid:c1,getOrd:c4,getSemigroup:c0,getShow:cX,getUnionMonoid:c5,getUnionSemigroup:c3,guard:lu,head:sM,init:sw,insertAt:sL,intercalate:lI,intersection:s3,intersperse:sq,isEmpty:ss,isNonEmpty:rs,isOutOfBound:iF,last:sT,lefts:sB,lookup:sx,makeBy:sc,map:c_,mapWithIndex:cO,match:sp,matchLeft:sh,matchLeftW:sh,matchRight:sm,matchRightW:sm,matchW:sp,modifyAt:sz,of:ru,partition:cR,partitionMap:cA,partitionMapWithIndex:cL,partitionWithIndex:cD,prepend:iz,prependAll:sY,prependToAll:sY,prependW:iz,range:iQ,readonlyArray:{URI:cJ,compact:cE,separate:ck,map:s9,ap:s6,of:ru,chain:s7,filter:ce,filterMap:ct,partition:cn,partitionMap:cr,mapWithIndex:s8,partitionMapWithIndex:co,partitionWithIndex:ci,filterMapWithIndex:cp,filterWithIndex:ch,alt:ca,zero:cx,unfold:cH,reduce:cu,foldMap:cs,reduceRight:cc,traverse:cg,sequence:cq,reduceWithIndex:cl,foldMapWithIndex:cd,reduceRightWithIndex:cf,traverseWithIndex:cy,extend:cm,wither:lf,wilt:lp},reduce:cW,reduceRight:c$,reduceRightWithIndex:cK,reduceWithIndex:cV,replicate:sl,reverse:sU,rights:sW,rotate:sG,scanLeft:sy,scanRight:sv,separate:ck,sequence:cq,size:sb,snoc:au,some:lw,sort:sV,sortBy:sH,spanLeft:function(t){return function(n){var r,i=sX(sO(n,t))(n);return{init:i[0],rest:i[1]}}},splitAt:sX,tail:sS,takeLeft:sI,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?lT:r}},takeRight:s_,toArray:lx,traverse:cY,traverseWithIndex:cG,unfold:cH,union:s4,uniq:sQ,unsafeDeleteAt:lb,unsafeInsertAt:iW,unsafeUpdateAt:lv,unzip:sK,updateAt:sP,wilt:cQ,wither:cZ,zero:cx,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:s$(n,r,function(t,n){return[t,n]})},zipWith:s$},Symbol.toStringTag,{value:"Module"}));var lj=function(t){return 0===t.length},lE=function(t,n){return t<=0?[]:aS(n)(t)},lR=function(t,n){return lE(t,function(){return n})},lD=function(t){return n7(t)?[]:[t.value]},lA=function(t){return rr(t)?[]:[t.right]},lL=function(t,n){return function(r){return ad(r)?n(r):t()}},lP=function(t,n){return function(r){return ad(r)?n(uO(r),uk(r)):t()}},lF=function(t,n){return function(r){return ad(r)?n(uN(r),uC(r)):t()}},lz=function(t){return function(n){for(var r=[],i=0;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},lU=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}},lW=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}},lB=function(t){return t.length},lV=function(t){return ad(t)?rn(uk(t)):rt},l$=function(t){return ad(t)?rn(uN(t)):rt},lK=function(t){return function(n){return af(t,n)?lJ(n):n.slice(0,t)}},lY=function(t){return function(n){return af(t,n)?lJ(n):0===t?[]:n.slice(-t)}},lq=function(t,n){for(var r=t.length,i=0;i<r&&n(t[i]);i++);return i},lG=function(t){return function(n){return t<=0||lj(n)?lJ(n):t>=n.length?[]:n.slice(t,n.length)}},lZ=function(t){return function(n){return t<=0||lj(n)?lJ(n):t>=n.length?[]:n.slice(0,n.length-t)}};function lQ(t){return sj(t)}function lH(t){return sR(t)}var lJ=function(t){return t.slice()},lX=function(t,n){return function(r){return t<0||t>r.length?rt:rn(fC(t,n,r))}},l0=function(t,n){return l2(t,function(){return n})},l1=function(t){return function(n){return af(t,n)?rt:rn(fj(t,n))}},l2=function(t,n){return function(r){return af(t,r)?rt:rn(fN(t,n(r[t]),r))}},l4=function(t){return lj(t)?[]:t.slice().reverse()},l3=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Right"===i._tag&&n.push(i.right)}return n},l5=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Left"===i._tag&&n.push(i.left)}return n},l9=function(t){return function(n){return n.length<=1?lJ(n):n.slice().sort(t.compare)}},l8=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},l6=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]},l7=function(t){var n=aW(t);return function(t){return ad(t)?n(t):[]}},de=function(t){var n=aB(t);return function(t){return ad(t)?n(t):lJ(t)}},dt=function(t){var n=ax(t);return function(t){return ad(t)?n(t):lJ(t)}},dn=function(t){var n=ay(t);return function(t){return ad(t)?n(t):lJ(t)}},dr=function(t){var n=av(t);return function(t){return ad(t)?n(t):lJ(t)}},di=function(t){var n=a$(t);return function(t){return ad(t)?n(t):[]}},da=function(t){return function(n){return t>=1&&ad(n)?aK(t)(n):lj(n)?[lJ(n),[]]:[[],lJ(n)]}},du=function(t){var n=aY(t);return function(t){return ad(t)?n(t):[]}},ds=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return lD(t.apply(void 0,n))}},dc=function(t){return function(n){return lj(n)?lJ(t):lj(t)?lJ(n):n.concat(t)}};function dl(t){var n=ab(t);return function(r,i){if(void 0===i){var o=dl(t);return function(t){return o(t,r)}}return ad(r)&&ad(i)?n(i)(r):ad(r)?lJ(r):lJ(i)}}function dd(t){var n=sZ(t);return function(r,i){if(void 0===i){var o=dd(t);return function(t){return o(t,r)}}return r.filter(function(t){return n(t,i)})}}function df(t){var n=sZ(t);return function(r,i){if(void 0===i){var o=df(t);return function(t){return o(t,r)}}return r.filter(function(t){return!n(t,i)})}}var dp=function(t,n){return n3(t,dL(n))},dh=function(t,n){return n3(t,dU(n))},dm=function(t,n){return n3(t,dP(n))},dg=function(t,n){return n3(t,dF(n))},dy=function(t,n){return n3(t,dK(n))},dv=function(t,n){return n3(t,dB(n))},db=function(t,n){return n3(t,dY(n))},dx=function(t,n){return n3(t,dG(n))},dM=function(t,n){return n3(t,dq(n))},dT=function(t,n){return n3(t,dZ(n))},dS=function(t,n){return n3(t,dH(n))},dw=function(t,n,r){return n3(t,d4(n,r))},dI=function(t){var n=d1(t);return function(t,r){return n3(t,n(r))}},d_=function(t,n,r){return n3(t,d5(n,r))},dO=function(t,n,r){return n3(t,d3(n,r))},dk=function(t){var n=d2(t);return function(t,r){return n3(t,n(r))}},dC=function(t,n,r){return n3(t,d9(n,r))},dN=function(t,n){return n3(t,dW(n))},dj=function(t,n){return n3(t,dJ(n))},dE=function(t,n){return n3(t,dX(n))},dR=function(t){var n=d8(t);return function(t,r){return n3(t,n(r))}},dD=function(t){var n=d7(t);return function(t,r){return n3(t,n(r))}},dA=function(){return[]},dL=function(t){return function(n){return n.map(function(n){return t(n)})}},dP=function(t){return dF(function(n){return n3(t,dL(n))})},dF=function(t){return function(n){return n3(n,lz(function(n,r){return t(r)}))}},dz=dF(nq),dU=function(t){return function(n){return n.map(function(n,r){return t(r,n)})}},dW=function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=t(i,n[i]);re(o)&&r.push(o.value)}return r}},dB=function(t){return dW(function(n,r){return t(r)})},dV=dB(nq),d$=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 uX(n,r)},dK=function(t){return function(n){return n.filter(t)}},dY=function(t){return dq(function(n,r){return t(r)})},dq=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 uX(r,i)}},dG=function(t){return dZ(function(n,r){return t(r)})},dZ=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 uX(r,i)}},dQ=function(t){return function(n){return n.concat(t())}},dH=dQ,dJ=function(t){return function(n){return n.filter(function(n,r){return t(r,n)})}},dX=function(t){return function(n){return n.map(function(r,i){return t(n.slice(i))})}},d0=dX(nq),d1=cB,d2=cU,d4=cW,d3=cV,d5=c$,d9=cK,d8=function(t){var n=d7(t);return function(t){return n(function(n,r){return t(r)})}},d6=function(t){return function(n){return dw(n,t.of(dA()),function(n,r){return t.ap(t.map(n,function(t){return function(n){return n3(t,ah(n))}}),r)})}},d7=function(t){return function(n){return d3(t.of(dA()),function(r,i,o){return t.ap(t.map(i,function(t){return function(n){return n3(t,ah(n))}}),n(r,o))})}},fe=function(t){var n=fS(t);return function(t){return function(r){return n(r,t)}}},ft=function(t){var n=fw(t);return function(t){return function(r){return n(r,t)}}},fn=function(t,n){for(var r=[],i=t;;){var o=n(i);if(re(o)){var a=o.value,u=a[0],s=a[1];r.push(u),i=s}else break}return r},fr="Array",fi=function(){return{concat:function(t,n){return t.concat(n)}}},fo=function(){return{concat:fi().concat,empty:[]}},fa=function(t){var n=dl(t);return{concat:function(t,r){return n(r)(t)}}},fu=function(t){return{concat:fa(t).concat,empty:[]}},fs=function(t){var n=dd(t);return{concat:function(t,r){return n(r)(t)}}},fc=function(t){var n=df(t);return{concat:function(t,r){return n(r)(t)}}},fl={URI:fr,map:dp},fd=r_(fl),ff={URI:fr,of:aF},fp={URI:fr,map:dp,ap:dm},fh=rg(fp),fm=ry(fp),fg={URI:fr,map:dp,ap:dm,chain:dg},fy=rR(fg),fv={URI:fr,zero:dA},fb=so(fv,ff),fx={URI:fr,compact:dV,separate:d$},fM={URI:fr,reduce:dw,foldMap:dI,reduceRight:d_},fT={URI:fr,map:dp,reduce:dw,foldMap:dI,reduceRight:d_,traverse:dR,sequence:d6},fS=sn(fT,fx),fw=st(fT,fx),fI={URI:fr,map:dp,compact:dV,separate:d$,filter:dy,filterMap:dv,partition:db,partitionMap:dx,reduce:dw,foldMap:dI,reduceRight:d_,traverse:dR,sequence:d6,wither:fS,wilt:fw},f_=sr(fI),fO={URI:fr,fromEither:lA},fk=rU(fO),fC=am,fN=function(t,n,r){return ad(r)?ag(t,n,r):[]},fj=function(t,n){var r=n.slice();return r.splice(t,1),r},fE=function(t){return function(n){return n.some(t)}},fR=aF(rf),fD=rO(fl),fA=rD(fg),fL=rv(fp);let fP=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:fr,map:dp,alt:dS},Alternative:{URI:fr,map:dp,ap:dm,of:aF,alt:dS,zero:dA},Applicative:{URI:fr,map:dp,ap:dm,of:aF},Apply:fp,Chain:fg,ChainRecBreadthFirst:{URI:fr,map:dp,ap:dm,chain:dg,chainRec:cb},ChainRecDepthFirst:{URI:fr,map:dp,ap:dm,chain:dg,chainRec:cv},Compactable:fx,Do:fR,Extend:{URI:fr,map:dp,extend:dE},Filterable:{URI:fr,map:dp,compact:dV,separate:d$,filter:dy,filterMap:dv,partition:db,partitionMap:dx},FilterableWithIndex:{URI:fr,map:dp,mapWithIndex:dh,compact:dV,separate:d$,filter:dy,filterMap:dv,partition:db,partitionMap:dx,partitionMapWithIndex:dT,partitionWithIndex:dM,filterMapWithIndex:dN,filterWithIndex:dj},Foldable:fM,FoldableWithIndex:{URI:fr,reduce:dw,foldMap:dI,reduceRight:d_,reduceWithIndex:dO,foldMapWithIndex:dk,reduceRightWithIndex:dC},FromEither:fO,Functor:fl,FunctorWithIndex:{URI:fr,map:dp,mapWithIndex:dh},Monad:{URI:fr,map:dp,ap:dm,of:aF,chain:dg},Pointed:ff,Traversable:fT,TraversableWithIndex:{URI:fr,map:dp,mapWithIndex:dh,reduce:dw,foldMap:dI,reduceRight:d_,reduceWithIndex:dO,foldMapWithIndex:dk,reduceRightWithIndex:dC,traverse:dR,sequence:d6,traverseWithIndex:dD},URI:fr,Unfoldable:{URI:fr,unfold:fn},Witherable:fI,Zero:fv,alt:dH,altW:dQ,ap:dP,apFirst:fh,apS:fL,apSecond:fm,append:ah,appendW:ah,array:{URI:fr,compact:dV,separate:d$,map:dp,ap:dm,of:aF,chain:dg,filter:dy,filterMap:dv,partition:db,partitionMap:dx,mapWithIndex:dh,partitionMapWithIndex:dT,partitionWithIndex:dM,filterMapWithIndex:dN,filterWithIndex:dj,alt:dS,zero:dA,unfold:fn,reduce:dw,foldMap:dI,reduceRight:d_,traverse:dR,sequence:d6,reduceWithIndex:dO,foldMapWithIndex:dk,reduceRightWithIndex:dC,traverseWithIndex:dD,extend:dE,wither:fS,wilt:fw},bind:fA,bindTo:fD,chain:dF,chainFirst:fy,chainRecBreadthFirst:ld,chainRecDepthFirst:ll,chainWithIndex:lz,chop:di,chunksOf:du,compact:dV,comprehension:function(t,n,r){void 0===r&&(r=function(){return!0});var i=function(t,o){return ad(o)?n3(uO(o),dF(function(n){return i(n3(t,ah(n)),uk(o))})):r.apply(void 0,t)?[n.apply(void 0,t)]:[]};return i([],t)},concat:dc,concatW:dc,cons:uz,copy:lJ,deleteAt:l1,difference:df,dropLeft:lG,dropLeftWhile:function(t){return function(n){return n.slice(lq(n,t))}},dropRight:lZ,duplicate:d0,elem:sZ,empty:[],every:lS,exists:fE,extend:dX,filter:dK,filterE:f_,filterMap:dB,filterMapWithIndex:dW,filterWithIndex:dJ,findFirst:lQ,findFirstMap:sE,findIndex:sN,findLast:lH,findLastIndex:sA,findLastMap:sD,flap:fd,flatten:dz,foldLeft:lP,foldMap:d1,foldMapWithIndex:d2,foldRight:lF,fromEither:lA,fromEitherK:fk,fromOption:lD,fromOptionK:ds,fromPredicate:function(t){return function(n){return t(n)?[n]:[]}},getDifferenceMagma:fc,getEq:c2,getIntersectionSemigroup:fs,getMonoid:fo,getOrd:c4,getSemigroup:fi,getShow:cX,getUnionMonoid:fu,getUnionSemigroup:fa,guard:fb,head:sM,init:l$,insertAt:lX,intercalate:lI,intersection:dd,intersperse:de,isEmpty:lj,isNonEmpty:ad,isOutOfBound:af,last:sT,lefts:l5,lookup:sx,makeBy:lE,map:dL,mapWithIndex:dU,match:lL,matchLeft:lP,matchLeftW:lP,matchRight:lF,matchRightW:lF,matchW:lL,modifyAt:l2,of:aF,partition:dY,partitionMap:dG,partitionMapWithIndex:dZ,partitionWithIndex:dq,prepend:ap,prependAll:l7,prependToAll:l7,prependW:ap,range:aI,reduce:d4,reduceRight:d5,reduceRightWithIndex:d9,reduceWithIndex:d3,replicate:lR,reverse:l4,rights:l3,rotate:dt,scanLeft:lU,scanRight:lW,separate:d$,sequence:d6,size:lB,snoc:uU,some:fE,sort:l9,sortBy:dr,spanLeft:function(t){return function(n){var r,i=da(lq(n,t))(n);return{init:i[0],rest:i[1]}}},splitAt:da,tail:lV,takeLeft:lK,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:lY,traverse:d8,traverseWithIndex:d7,unfold:fn,union:dl,uniq:dn,unsafeDeleteAt:fj,unsafeInsertAt:fC,unsafeUpdateAt:fN,unzip:l6,updateAt:l0,wilt:ft,wither:fe,zero:dA,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:l8(n,r,function(t,n){return[t,n]})},zipWith:l8},Symbol.toStringTag,{value:"Module"})),fF=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var fz=function(t){return"boolean"==typeof t},fU=function(t,n){return function(r){return r?n():t()}},fW={equals:function(t,n){return t===n}},fB={concat:function(t,n){return t&&n}},fV={concat:function(t,n){return t||n}},f$={concat:fB.concat,empty:!0},fK={concat:fV.concat,empty:!1},fY={equals:fW.equals,compare:function(t,n){return t<n?-1:t>n?1:0}};let fq=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:fW,MonoidAll:f$,MonoidAny:fK,Ord:fY,SemigroupAll:fB,SemigroupAny:fV,Show:{show:function(t){return JSON.stringify(t)}},fold:fU,foldW:fU,isBoolean:fz,match:fU,matchW:fU},Symbol.toStringTag,{value:"Module"}));var fG=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 fZ=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:fG,getFunctionBooleanAlgebra:nW,reverse:fG},Symbol.toStringTag,{value:"Module"}));var fQ=function(t){return ic(t)(t.bottom,t.top)},fH=function(t){var n=r5(t);return{equals:n.equals,compare:n.compare,top:t.bottom,bottom:t.top}},fJ={equals:id.equals,compare:id.compare,top:1/0,bottom:-1/0};let fX=Object.freeze(Object.defineProperty({__proto__:null,boundedNumber:fJ,clamp:fQ,reverse:fH},Symbol.toStringTag,{value:"Module"}));function f0(t){return{meet:iu(t),join:is(t)}}let f1=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:f0},Symbol.toStringTag,{value:"Module"})),f2=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:function(t){var n=f0(t);return function(t,r){return{join:n.join,meet:n.meet,zero:t,one:r}}}},Symbol.toStringTag,{value:"Module"})),f4=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),f3=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),f5=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),f9=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var f8=function(t,n){for(var r=n(t);"Left"===r._tag;)r=n(r.left);return r.right};let f6=Object.freeze(Object.defineProperty({__proto__:null,tailRec:f8},Symbol.toStringTag,{value:"Module"}));function f7(t,n){return function(r,i){return n.compose(t.right(i),t.left(r))}}function pe(t,n){var r=f7(t,n);return function(i,o){return n.compose(t.promap(n.id(),function(t){return"Left"===t._tag?t.left:t.right},nq),r(i,o))}}let pt=Object.freeze(Object.defineProperty({__proto__:null,fanIn:pe,fanin:function(t){return pe(t,t)},split:f7,splitChoice:function(t){return f7(t,t)}},Symbol.toStringTag,{value:"Module"})),pn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var pr=function(t,n){return n3(t,pi(n))},pi=function(t){return function(n){return nX(t,n)}},po="Predicate",pa=function(){return{concat:function(t,n){return n3(t,pd(n))}}},pu=function(){return{concat:pa().concat,empty:nQ}},ps=function(){return{concat:function(t,n){return n3(t,pf(n))}}},pc=function(){return{concat:ps().concat,empty:nZ}},pl=function(t){return function(n){return!t(n)}},pd=function(t){return function(n){return function(r){return n(r)||t(r)}}},pf=function(t){return function(n){return function(r){return n(r)&&t(r)}}};let pp=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:{URI:po,contramap:pr},URI:po,and:pf,contramap:pi,getMonoidAll:pc,getMonoidAny:pu,getSemigroupAll:ps,getSemigroupAny:pa,not:pl,or:pd},Symbol.toStringTag,{value:"Module"}));function ph(t){return function(n){return t(n)?rn(n):rt}}var pm=function(t){return"Right"===t._tag?rt:rn(t.left)},pg=function(t){return"Left"===t._tag?rt:rn(t.right)},py=function(t,n){return n3(t,pA(n))},pv=function(t,n){return n3(t,pF(n))},pb=function(t,n){return n3(t,pW(n))},px=function(t,n,r){return n3(t,pV(n,r))},pM=function(t){var n=p$(t);return function(t,r){return n3(t,n(r))}},pT=function(t,n,r){return n3(t,pK(n,r))},pS=function(t){var n=p8(t);return function(t,r){return n3(t,n(r))}},pw=function(t,n){return n3(t,pq(n))},pI=function(t,n){return n3(t,p2(n))},p_=function(t,n){return n3(t,p4(n))},pO=function(t,n){return n3(t,pH(n))},pk=function(t,n){return n3(t,p3(n))},pC=function(t,n){return n3(t,p5(n))},pN="Option",pj=function(t){return{show:function(n){return hu(n)?"none":"some(".concat(t.show(n.value),")")}}},pE=function(t){return{equals:function(n,r){return n===r||(hu(n)?hu(r):!hu(r)&&t.equals(n.value,r.value))}}},pR=function(t){return{equals:pE(t).equals,compare:function(n,r){return n===r?0:ha(n)?ha(r)?t.compare(n.value,r.value):1:-1}}},pD=function(t){return{concat:function(n,r){return hu(n)?r:hu(r)?n:rn(t.concat(n.value,r.value))},empty:rt}},pA=function(t){return function(n){return hu(n)?rt:rn(t(n.value))}},pL={URI:pN,map:py},pP={URI:pN,of:rn},pF=function(t){return function(n){return hu(n)||hu(t)?rt:rn(n.value(t.value))}},pz={URI:pN,map:py,ap:pv},pU={URI:pN,map:py,ap:pv,of:rn},pW=function(t){return function(n){return hu(n)?rt:t(n.value)}},pB={URI:pN,map:py,ap:pv,chain:pb},pV=function(t,n){return function(r){return hu(r)?t:n(t,r.value)}},p$=function(t){return function(n){return function(r){return hu(r)?t.empty:n(r.value)}}},pK=function(t,n){return function(r){return hu(r)?t:n(r.value,t)}},pY=function(t){return function(n){return hu(n)?t():n}},pq=pY,pG=function(){return rt},pZ={URI:pN,zero:pG},pQ=so(pZ,pP),pH=function(t){return function(n){return hu(n)?rt:rn(t(n))}},pJ=pW(nq),pX=uX(rt,rt),p0=function(t){return hu(t)?pX:uX(pm(t.value),pg(t.value))},p1={URI:pN,compact:pJ,separate:p0},p2=function(t){return function(n){return hu(n)?rt:t(n.value)?n:rt}},p4=function(t){return function(n){return hu(n)?rt:t(n.value)}},p3=function(t){return function(n){return uX(pI(n,pl(t)),pI(n,t))}},p5=function(t){return nX(pA(t),p0)},p9={URI:pN,map:py,compact:pJ,separate:p0,filter:pI,filterMap:p_,partition:pk,partitionMap:pC},p8=function(t){return function(n){return function(r){return hu(r)?t.of(rt):t.map(n(r.value),rn)}}},p6=function(t){return function(n){return hu(n)?t.of(rt):t.map(n.value,rn)}},p7={URI:pN,map:py,reduce:px,foldMap:pM,reduceRight:pT,traverse:pS,sequence:p6},he=sn(p7,p1),ht=st(p7,p1),hn=function(t){var n=he(t);return function(t){return function(r){return n(r,t)}}},hr=function(t){var n=ht(t);return function(t){return function(r){return n(r,t)}}},hi=function(){return rt},ho={URI:pN,fromEither:pg},ha=re,hu=function(t){return"None"===t._tag},hs=function(t,n){return function(r){return hu(r)?t():n(r.value)}},hc=function(t){return function(n){return hu(n)?t():n.value}},hl=r_(pL),hd=rg(pz),hf=ry(pz),hp=rR(pB),hh=pH(nq),hm=rU(ho),hg=rW(ho,pB),hy=rB(ho,pB),hv=function(t){return null==t?rt:rn(t)},hb=function(t){try{return rn(t())}catch{return rt}},hx=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return hb(function(){return t.apply(void 0,n)})}},hM=function(t){return nX(t,hv)},hT=function(t){return function(n){return hu(n)?rt:hv(t(n.value))}},hS=hs(nH,nq),hw=hs(nJ,nq),hI=function(t){return function(n){return!hu(n)&&t(n.value)}},h_=rn(rf),hO=rO(pL),hk=rD(pB),hC=rv(pz),hN=rn(rd),hj=function(t){return function(n){var r=t(0,rc(n));if(hu(r))return rt;for(var i=[r.value],o=1;o<n.length;o++){var a=t(o,n[o]);if(hu(a))return rt;i.push(a.value)}return rn(i)}},hE=function(t){var n=hj(t);return function(t){return rs(t)?n(t):hN}},hR=function(t){return hE(function(n,r){return t(r)})},hD=hR(nq),hA={URI:pN,map:py,of:rn,ap:pv,chain:pb,reduce:px,foldMap:pM,reduceRight:pT,traverse:pS,sequence:p6,zero:pG,alt:pw,extend:pO,compact:pJ,separate:p0,filter:pI,filterMap:p_,partition:pk,partitionMap:pC,wither:he,wilt:ht,throwError:hi},hL=rb(pz),hP=rN(pU),hF=function(){return pD(iO())},hz=function(){return pD(ik())};let hU=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:pN,map:py,alt:pw},Alternative:{URI:pN,map:py,ap:pv,of:rn,alt:pw,zero:pG},ApT:hN,Applicative:pU,Apply:pz,Chain:pB,Compactable:p1,Do:h_,Extend:{URI:pN,map:py,extend:pO},Filterable:p9,Foldable:{URI:pN,reduce:px,foldMap:pM,reduceRight:pT},FromEither:ho,Functor:pL,Monad:{URI:pN,map:py,ap:pv,of:rn,chain:pb},MonadThrow:{URI:pN,map:py,ap:pv,of:rn,chain:pb,throwError:hi},Pointed:pP,Traversable:p7,URI:pN,Witherable:{URI:pN,map:py,reduce:px,foldMap:pM,reduceRight:pT,traverse:pS,sequence:p6,compact:pJ,separate:p0,filter:pI,filterMap:p_,partition:pk,partitionMap:pC,wither:he,wilt:ht},Zero:pZ,alt:pq,altW:pY,ap:pF,apFirst:hd,apS:hC,apSecond:hf,bind:hk,bindTo:hO,chain:pW,chainEitherK:hg,chainFirst:hp,chainFirstEitherK:hy,chainNullableK:hT,compact:pJ,duplicate:hh,elem:function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!hu(i)&&n.equals(r,i.value)}},exists:hI,extend:pH,filter:p2,filterMap:p4,flap:hl,flatten:pJ,fold:hs,foldMap:p$,foldW:hs,fromEither:pg,fromEitherK:hm,fromNullable:hv,fromNullableK:hM,fromPredicate:ph,getApplyMonoid:hP,getApplySemigroup:hL,getEq:pE,getFirstMonoid:hF,getLastMonoid:hz,getLeft:pm,getMonoid:pD,getOrElse:hc,getOrElseW:hc,getOrd:pR,getRefinement:function(t){return function(n){return ha(t(n))}},getRight:pg,getShow:pj,guard:pQ,isNone:hu,isSome:ha,map:pA,mapNullable:hT,match:hs,matchW:hs,none:rt,of:rn,option:hA,partition:p3,partitionMap:p5,reduce:pV,reduceRight:pK,separate:p0,sequence:p6,sequenceArray:hD,some:rn,throwError:hi,toNullable:hS,toUndefined:hw,traverse:p8,traverseArray:hR,traverseArrayWithIndex:hE,traverseReadonlyArrayWithIndex:hE,traverseReadonlyNonEmptyArrayWithIndex:hj,tryCatch:hb,tryCatchK:hx,wilt:hr,wither:hn,zero:pG},Symbol.toStringTag,{value:"Module"}));function hW(t,n){return function(r){return t.map(r,n.compact)}}function hB(t,n,r){var i=hW(t,n),o=rI(t,r);return function(t){return uX(i(n3(t,o(pm))),i(n3(t,o(pg))))}}let hV=Object.freeze(Object.defineProperty({__proto__:null,compact:hW,getCompactableComposition:function(t,n){return{map:rk(t,n).map,compact:hW(t,n),separate:hB(t,n,n)}},separate:hB},Symbol.toStringTag,{value:"Module"}));var h$=function(t){return function(){return console.log(t)}},hK=function(t){return function(){return console.warn(t)}},hY=function(t){return function(){return console.error(t)}},hq=function(t){return function(){return console.info(t)}};let hG=Object.freeze(Object.defineProperty({__proto__:null,error:hY,info:hq,log:h$,warn:hK},Symbol.toStringTag,{value:"Module"}));function hZ(t){return{URI:h5,_E:void 0,map:hJ,ap:function(n,r){return nq(t.concat(n,r))}}}function hQ(t){var n=hZ(t);return{URI:h5,_E:void 0,map:n.map,ap:n.ap,of:function(){return nq(t.empty)}}}var hH=function(t,n){return n3(t,h1())},hJ=function(t,n){return n3(t,h2())},hX=function(t,n,r){return n3(t,h4(n))},h0=function(t,n){return n3(t,h3(n))},h1=function(){return nq},h2=function(){return nq},h4=function(t){return function(n){return nq(t(n))}},h3=function(t){return function(n){return nq(t(n))}},h5="Const",h9={URI:h5,map:hJ},h8=r_(h9);let h6=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:h5,bimap:hX,mapLeft:h0},Contravariant:{URI:h5,contramap:hH},Functor:h9,URI:h5,bimap:h4,const_:{URI:h5,map:hJ,contramap:hH,bimap:hX,mapLeft:h0},contramap:h1,flap:h8,getApplicative:hQ,getApply:hZ,getBooleanAlgebra:nq,getBounded:nq,getEq:nq,getHeytingAlgebra:nq,getMonoid:nq,getOrd:nq,getRing:nq,getSemigroup:nq,getSemiring:nq,getShow:function(t){return{show:function(n){return"make(".concat(t.show(n),")")}}},make:nq,map:h2,mapLeft:h3},Symbol.toStringTag,{value:"Module"})),h7=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var me=n3(u$,r9(function(t){return t.valueOf()})),mt=function(){return new Date},mn=function(){return new Date().getTime()};let mr=Object.freeze(Object.defineProperty({__proto__:null,Eq:{equals:function(t,n){return t.valueOf()===n.valueOf()}},Ord:me,create:mt,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:mn},Symbol.toStringTag,{value:"Module"}));var mi=function(t,n){return n3(t,mI(n))},mo=function(t,n){return n3(t,mC(n))},ma=function(t,n){return n3(t,mR(n))},mu=function(t,n,r){return n3(t,mA(n,r))},ms=function(t){return function(n,r){var i=mL(t);return n3(n,i(r))}},mc=function(t,n,r){return n3(t,mP(n,r))},ml=function(t){var n=mF(t);return function(t,r){return n3(t,n(r))}},md=function(t,n,r){return n3(t,mW(n,r))},mf=function(t,n){return n3(t,mB(n))},mp=function(t,n){return n3(t,m$(n))},mh=function(t,n){return n3(t,mK(n))},mm=function(t,n){return f8(n(t),function(t){return mZ(t)?ra(ro(t.left)):mZ(t.right)?ro(n(t.right.left)):ra(ra(t.right.right))})},mg="Either",my=function(t,n){return{show:function(r){return mZ(r)?"left(".concat(t.show(r.left),")"):"right(".concat(n.show(r.right),")")}}},mv=function(t,n){return{equals:function(r,i){return r===i||(mZ(r)?mZ(i)&&t.equals(r.left,i.left):mQ(i)&&n.equals(r.right,i.right))}}},mb=function(t){return{concat:function(n,r){return mZ(r)?n:mZ(n)?r:ra(t.concat(n.right,r.right))}}},mx=function(t){var n=ro(t.empty);return{URI:mg,_E:void 0,compact:function(t){return mZ(t)?t:"None"===t.right._tag?n:ra(t.right.value)},separate:function(t){return mZ(t)?uX(t,t):mZ(t.right)?uX(ra(t.right.left),n):uX(n,ra(t.right.right))}}},mM=function(t){var n,r=ro(t.empty),i=mx(t),o=i.compact;return{URI:mg,_E:void 0,map:mi,compact:o,separate:i.separate,filter:function(t,n){return mZ(t)||n(t.right)?t:r},filterMap:function(t,n){if(mZ(t))return t;var i=n(t.right);return"None"===i._tag?r:ra(i.value)},partition:function(t,n){return mZ(t)?uX(t,t):n(t.right)?uX(r,ra(t.right)):uX(ra(t.right),r)},partitionMap:function(t,n){if(mZ(t))return uX(t,t);var i=n(t.right);return mZ(i)?uX(ra(i.left),r):uX(r,ra(i.right))}}},mT=function(t){var n=mM(t),r=mx(t);return{URI:mg,_E:void 0,map:mi,compact:n.compact,separate:n.separate,filter:n.filter,filterMap:n.filterMap,partition:n.partition,partitionMap:n.partitionMap,traverse:ml,sequence:mz,reduce:mu,foldMap:ms,reduceRight:mc,wither:sn(mU,r),wilt:st(mU,r)}},mS=function(t){return{URI:mg,_E:void 0,map:mi,ap:function(n,r){return mZ(n)?mZ(r)?ro(t.concat(n.left,r.left)):n:mZ(r)?r:ra(n.right(r.right))},of:mO}},mw=function(t){return{URI:mg,_E:void 0,map:mi,alt:function(n,r){if(mQ(n))return n;var i=r();return mZ(i)?ro(t.concat(n.left,i.left)):i}}},mI=function(t){return function(n){return mZ(n)?n:ra(t(n.right))}},m_={URI:mg,map:mi},mO=ra,mk=function(t){return function(n){return mZ(n)?n:mZ(t)?t:ra(n.right(t.right))}},mC=mk,mN={URI:mg,map:mi,ap:mo},mj={URI:mg,map:mi,ap:mo,of:mO},mE=function(t){return function(n){return mZ(n)?n:t(n.right)}},mR=mE,mD={URI:mg,map:mi,ap:mo,chain:ma},mA=function(t,n){return function(r){return mZ(r)?t:n(t,r.right)}},mL=function(t){return function(n){return function(r){return mZ(r)?t.empty:n(r.right)}}},mP=function(t,n){return function(r){return mZ(r)?t:n(r.right,t)}},mF=function(t){return function(n){return function(r){return mZ(r)?t.of(ro(r.left)):t.map(n(r.right),ra)}}},mz=function(t){return function(n){return mZ(n)?t.of(ro(n.left)):t.map(n.right,ra)}},mU={URI:mg,map:mi,reduce:mu,foldMap:ms,reduceRight:mc,traverse:ml,sequence:mz},mW=function(t,n){return function(r){return mZ(r)?ro(t(r.left)):ra(n(r.right))}},mB=function(t){return function(n){return mZ(n)?ro(t(n.left)):n}},mV=function(t){return function(n){return mZ(n)?t():n}},m$=mV,mK=function(t){return function(n){return mZ(n)?n:ra(t(n))}},mY={URI:mg,fromEither:nq},mq=rP(mY),mG=rL(mY),mZ=rr,mQ=ri,mH=function(t,n){return function(r){return mZ(r)?t(r.left):n(r.right)}},mJ=function(t){return function(n){return mZ(n)?t(n.left):n.right}},mX=r_(m_),m0=rg(mN),m1=ry(mN),m2=rR(mD),m4=mE(nq),m3=mK(nq),m5=rF(mY),m9=rz(mY,mD),m8=rV(mY,mD),m6=function(t){return mZ(t)?ra(t.left):ro(t.right)},m7=function(t){return function(n){return mZ(n)?t(n.left):n}},ge=function(t){return function(n){return null==n?ro(t):ra(n)}},gt=function(t,n){try{return ra(t())}catch(r){return ro(n(r))}},gn=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return gt(function(){return t.apply(void 0,r)},n)}},gr=function(t){var n=ge(t);return function(t){return nX(t,n)}},gi=function(t){var n=gr(t);return function(t){return mR(n(t))}},go=mH(nq,nq),ga=function(t){return function(n){return!mZ(n)&&t(n.right)}},gu=mO(rf),gs=rO(m_),gc=rD(mD),gl=rv(mN),gd=mO(rd),gf=function(t){return function(n){var r=t(0,rc(n));if(mZ(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o]);if(mZ(a))return a;i.push(a.right)}return ra(i)}},gp=function(t){var n=gf(t);return function(t){return rs(t)?n(t):gd}},gh=function(t){return gp(function(n,r){return t(r)})},gm=gh(nq),gg=function(t,n){return gt(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},n)},gy=rb(mN),gv=rN(mj),gb=function(t,n){return rb(mS(t))(n)},gx=function(t,n){return rN(mS(t))(n)};let gM=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:mg,map:mi,alt:mp},ApT:gd,Applicative:mj,Apply:mN,Bifunctor:{URI:mg,bimap:md,mapLeft:mf},Chain:mD,ChainRec:{URI:mg,map:mi,ap:mo,chain:ma,chainRec:mm},Do:gu,Extend:{URI:mg,map:mi,extend:mh},Foldable:{URI:mg,reduce:mu,foldMap:ms,reduceRight:mc},FromEither:mY,Functor:m_,Monad:{URI:mg,map:mi,ap:mo,of:mO,chain:ma},MonadThrow:{URI:mg,map:mi,ap:mo,of:mO,chain:ma,throwError:ro},Pointed:{URI:mg,of:mO},Traversable:mU,URI:mg,alt:m$,altW:mV,ap:mC,apFirst:m0,apFirstW:m0,apS:gl,apSW:gl,apSecond:m1,apSecondW:m1,apW:mk,bimap:mW,bind:gc,bindTo:gs,bindW:gc,chain:mR,chainFirst:m2,chainFirstW:m2,chainNullableK:gi,chainOptionK:m9,chainW:mE,duplicate:m3,either:{URI:mg,map:mi,of:mO,ap:mo,chain:ma,reduce:mu,foldMap:ms,reduceRight:mc,traverse:ml,sequence:mz,bimap:md,mapLeft:mf,alt:mp,extend:mh,chainRec:mm,throwError:ro},elem:function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!mZ(i)&&n.equals(r,i.right)}},exists:ga,extend:mK,filterOrElse:m8,filterOrElseW:m8,flap:mX,flatten:m4,flattenW:m4,fold:mH,foldMap:mL,foldW:mH,fromNullable:ge,fromNullableK:gr,fromOption:mG,fromOptionK:m5,fromPredicate:mq,getAltValidation:mw,getApplicativeValidation:mS,getApplyMonoid:gv,getApplySemigroup:gy,getCompactable:mx,getEq:mv,getFilterable:mM,getOrElse:mJ,getOrElseW:mJ,getSemigroup:mb,getShow:my,getValidation:function(t){var n=mS(t).ap,r=mw(t).alt;return{URI:mg,_E:void 0,map:mi,of:mO,chain:ma,bimap:md,mapLeft:mf,reduce:mu,foldMap:ms,reduceRight:mc,extend:mh,traverse:ml,sequence:mz,chainRec:mm,throwError:ro,ap:n,alt:r}},getValidationMonoid:gx,getValidationSemigroup:gb,getWitherable:mT,isLeft:mZ,isRight:mQ,left:ro,map:mI,mapLeft:mB,match:mH,matchW:mH,of:mO,orElse:m7,orElseW:m7,parseJSON:function(t,n){return gt(function(){return JSON.parse(t)},n)},reduce:mA,reduceRight:mP,right:ra,sequence:mz,sequenceArray:gm,stringifyJSON:gg,swap:m6,throwError:ro,toError:function(t){return t instanceof Error?t:Error(String(t))},toUnion:go,traverse:mF,traverseArray:gh,traverseArrayWithIndex:gp,traverseReadonlyArrayWithIndex:gp,traverseReadonlyNonEmptyArrayWithIndex:gf,tryCatch:gt,tryCatchK:gn},Symbol.toStringTag,{value:"Module"}));function gT(t){return nX(ra,t.of)}function gS(t){return nX(ro,t.of)}function gw(t){return function(n){return t.map(n,ra)}}function gI(t){return function(n){return t.map(n,ro)}}function g_(t){return function(n){return nX(ge(n),t.of)}}function gO(t){var n=g_(t);return function(t){var r=n(t);return function(t){return nX(t,r)}}}function gk(t){var n=gj(t),r=gO(t);return function(t){var i=r(t);return function(t){return n(i(t))}}}function gC(t){return rI(t,m_)}function gN(t){return rm(t,mN)}function gj(t){return function(n){return function(r){return t.chain(r,function(r){return mZ(r)?t.of(r):n(r.right)})}}}function gE(t){return function(n){return function(r){return t.chain(r,function(r){return mZ(r)?n():t.of(r)})}}}function gR(t){return function(n,r){return function(i){return t.map(i,mW(n,r))}}}function gD(t){return function(n){return function(r){return t.map(r,mB(n))}}}function gA(t,n){return function(r){return function(i){return t.chain(i,mH(function(i){return t.map(r(),mB(function(t){return n.concat(i,t)}))},gT(t)))}}}function gL(t){return function(n,r){return function(i){return t.map(i,mH(n,r))}}}function gP(t){return function(n,r){return function(i){return t.chain(i,mH(n,r))}}}function gF(t){return function(n){return function(r){return t.chain(r,mH(n,t.of))}}}function gz(t){return function(n){return function(r){return t.chain(r,function(r){return mZ(r)?n(r.left):t.of(r)})}}}function gU(t){var n=gz(t);return function(r){return n(function(n){return t.map(r(n),function(t){return mZ(t)?t:ro(n)})})}}function gW(t){return function(n){return function(r){return t.chain(r,mH(function(r){return t.map(n(r),ro)},function(n){return t.of(ra(n))}))}}}function gB(t){return function(n){return t.map(n,m6)}}function gV(t){return function(n){return t.map(n,go)}}let g$=Object.freeze(Object.defineProperty({__proto__:null,alt:gE,altValidation:gA,ap:gN,bimap:gR,chain:gj,chainNullableK:gk,fromNullable:g_,fromNullableK:gO,getEitherM:function(t){var n=gN(t),r=gC(t),i=gj(t),o=gE(t),a=gR(t),u=gD(t),s=gP(t),c=gF(t),l=gz(t);return{map:function(t,n){return n3(t,r(n))},ap:function(t,r){return n3(t,n(r))},of:gT(t),chain:function(t,n){return n3(t,i(n))},alt:function(t,n){return n3(t,o(n))},bimap:function(t,n,r){return n3(t,a(n,r))},mapLeft:function(t,n){return n3(t,u(n))},fold:function(t,n,r){return n3(t,s(n,r))},getOrElse:function(t,n){return n3(t,c(n))},orElse:function(t,n){return n3(t,l(n))},swap:gB(t),rightM:gw(t),leftM:gI(t),left:gS(t)}},getOrElse:gF,left:gS,leftF:gI,map:gC,mapLeft:gD,match:gL,matchE:gP,orElse:gz,orElseFirst:gU,orLeft:gW,right:gT,rightF:gw,swap:gB,toUnion:gV},Symbol.toStringTag,{value:"Module"}));var gK=function(){return{concat:function(t,n){return nX(t,n)}}},gY=function(){return{concat:gK().concat,empty:nq}};let gq=Object.freeze(Object.defineProperty({__proto__:null,URI:"Endomorphism",getMonoid:gY,getSemigroup:gK},Symbol.toStringTag,{value:"Module"})),gG=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function gZ(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 gQ=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:gZ,lcm:function(t,n){var r=n.zero,i=gZ(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 gH(t,n){return function(r){return function(i){return t.map(i,function(t){return n.filter(t,r)})}}}function gJ(t,n){return function(r){return function(i){return t.map(i,function(t){return n.filterMap(t,r)})}}}function gX(t,n){var r=gH(t,n);return function(t){var n=r(pl(t)),i=r(t);return function(t){return uX(n(t),i(t))}}}function g0(t,n){var r=gJ(t,n);return function(t){return function(n){return uX(n3(n,r(function(n){return pm(t(n))})),n3(n,r(function(n){return pg(t(n))})))}}}let g1=Object.freeze(Object.defineProperty({__proto__:null,filter:gH,filterMap:gJ,getFilterableComposition:function(t,n){var r=rk(t,n).map,i=hW(t,n),o=hB(t,n,n),a=gH(t,n),u=gJ(t,n),s=gX(t,n),c=g0(t,n);return{map:r,compact:i,separate:o,filter:function(t,n){return n3(t,a(n))},filterMap:function(t,n){return n3(t,u(n))},partition:function(t,n){return n3(t,s(n))},partitionMap:function(t,n){return n3(t,c(n))}}},partition:gX,partitionMap:g0},Symbol.toStringTag,{value:"Module"})),g2=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function g4(t,n){return function(r,i){return function(o){return t.reduce(o,r,function(t,r){return n.reduce(r,t,i)})}}}function g3(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 g5(t,n){return function(r,i){return function(o){return t.reduceRight(o,r,function(t,r){return n.reduceRight(t,r,i)})}}}function g9(t){return function(n){return t.reduce(n,[],function(t,n){return t.push(n),t})}}function g8(t,n){var r=g4(t,n),i=g3(t,n),o=g5(t,n);return{reduce:function(t,n,i){return n3(t,r(n,i))},foldMap:function(t){var n=i(t);return function(t,r){return n3(t,n(r))}},reduceRight:function(t,n,r){return n3(t,o(n,r))}}}let g6=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:g3,getFoldableComposition:g8,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:g4,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:g5,toArray:g9,toReadonlyArray:g9,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,nG),a)})}}},Symbol.toStringTag,{value:"Module"}));function g7(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 ye(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 yt(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 yn=Object.freeze(Object.defineProperty({__proto__:null,foldMapWithIndex:ye,getFoldableWithIndexComposition:function(t,n){var r=g8(t,n),i=g7(t,n),o=ye(t,n),a=yt(t,n);return{reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,reduceWithIndex:function(t,n,r){return n3(t,i(n,r))},foldMapWithIndex:function(t){var n=o(t);return function(t,r){return n3(t,n(r))}},reduceRightWithIndex:function(t,n,r){return n3(t,a(n,r))}}},reduceRightWithIndex:yt,reduceWithIndex:g7},Symbol.toStringTag,{value:"Module"}));function yr(t){return function(n){return nX(n,t.fromIO)}}function yi(t,n){return function(r){var i=nX(r,t.fromIO);return function(t){return n.chain(t,i)}}}function yo(t,n){var r=rR(n);return function(n){return r(nX(n,t.fromIO))}}let ya=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:yo,chainIOK:yi,fromIOK:yr},Symbol.toStringTag,{value:"Module"}));var yu=function(){return nq},ys=function(t){return function(n){return function(r){return n(t(r))}}},yc=function(t){return function(n){return t(n)(n)}},yl=function(t,n){return n3(t,ym(n))},yd=function(t,n){return n3(t,yy(n))},yf=function(t,n){return n3(t,yb(n))},yp=function(t,n){return n3(t,yM(n))},yh=function(t,n,r){return n3(t,yT(n,r))},ym=function(t){return function(n){return function(r){return t(n(r))}}},yg=function(t){return function(n){return function(r){return n(r)(t(r))}}},yy=yg,yv=function(t){return function(n){return function(r){return t(n(r))(r)}}},yb=yv,yx=yv(nq),yM=function(t){return function(n){return nX(t,n)}},yT=function(t,n){return function(r){return function(i){return n(r(t(i)))}}},yS=function(){return nq},yw=function(t){return function(n){var r=n[0],i=n[1];return[t(r),i]}},yI=function(t){return function(n){var r;return[n[0],t(n[1])]}},y_=function(t){return mH(function(n){return ro(t(n))},ra)},yO=function(t){return mH(ro,function(n){return ra(t(n))})},yk="Reader",yC={URI:yk,map:yl},yN=r_(yC),yj={URI:yk,of:nG},yE={URI:yk,map:yl,ap:yd},yR=rg(yE),yD=ry(yE),yA={URI:yk,map:yl,ap:yd,of:nG},yL={URI:yk,map:yl,ap:yd,chain:yf},yP={URI:yk,map:yl,of:nG,ap:yd,chain:yf},yF=rR(yL),yz=rO(yC),yU=rD(yL),yW=nG(rf),yB=rv(yE),yV=nG(rd),y$=function(t){return function(n){return function(r){for(var i=[t(0,rc(n))(r)],o=1;o<n.length;o++)i.push(t(o,n[o])(r));return i}}},yK=function(t){var n=y$(t);return function(t){return rs(t)?n(t):yV}},yY=function(t){return yK(function(n,r){return t(r)})},yq=yY(nq),yG=rb(yE),yZ=rN(yA);let yQ=Object.freeze(Object.defineProperty({__proto__:null,ApT:yV,Applicative:yA,Apply:yE,Category:{URI:yk,compose:yp,id:yS},Chain:yL,Choice:{URI:yk,map:yl,promap:yh,left:y_,right:yO},Do:yW,Functor:yC,Monad:yP,Pointed:yj,Profunctor:{URI:yk,map:yl,promap:yh},Strong:{URI:yk,map:yl,promap:yh,first:yw,second:yI},URI:yk,ap:yy,apFirst:yR,apFirstW:yR,apS:yB,apSW:yB,apSecond:yD,apSecondW:yD,apW:yg,ask:yu,asks:nq,asksReader:yc,asksReaderW:yc,bind:yU,bindTo:yz,bindW:yU,chain:yb,chainFirst:yF,chainFirstW:yF,chainW:yv,compose:yM,first:yw,flap:yN,flatten:yx,flattenW:yx,getMonoid:yZ,getSemigroup:yG,id:yS,left:y_,local:ys,map:ym,of:nG,promap:yT,reader:{URI:yk,map:yl,of:nG,ap:yd,chain:yf,promap:yh,compose:yp,id:yS,first:yw,second:yI,left:y_,right:yO},right:yO,second:yI,sequenceArray:yq,traverseArray:yY,traverseArrayWithIndex:yK,traverseReadonlyArrayWithIndex:yK,traverseReadonlyNonEmptyArrayWithIndex:y$},Symbol.toStringTag,{value:"Module"}));function yH(t){return function(){return t.fromReader(yu())}}function yJ(t){return t.fromReader}function yX(t){return function(n){return nX(n,t.fromReader)}}function y0(t,n){var r=yX(t);return function(t){return function(i){return n.chain(i,r(t))}}}function y1(t,n){return nX(yX(t),rR(n))}let y2=Object.freeze(Object.defineProperty({__proto__:null,ask:yH,asks:yJ,chainFirstReaderK:y1,chainReaderK:y0,fromReaderK:yX},Symbol.toStringTag,{value:"Module"}));var y4=function(){return function(t){return[t,t]}},y3=function(t){return function(){return[void 0,t]}},y5=function(t){return function(n){return[void 0,t(n)]}},y9=function(t){return function(n){return[t(n),n]}},y8=function(t,n){return n3(t,ve(n))},y6=function(t,n){return n3(t,vt(n))},y7=function(t,n){return n3(t,vr(n))},ve=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=i[1];return[t(o),a]}}},vt=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]}}},vn=function(t){return function(n){return[t,n]}},vr=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=i[1];return t(o)(a)}}},vi=vr(nq),vo="State",va={URI:vo,map:y8},vu=r_(va),vs={URI:vo,map:y8,ap:y6},vc=rg(vs),vl=ry(vs),vd={URI:vo,map:y8,ap:y6,chain:y7},vf={URI:vo,map:y8,ap:y6,of:vn,chain:y7},vp=rR(vd),vh=function(t){return function(n){return n(t)[0]}},vm=function(t){return function(n){return n(t)[1]}},vg=rO(va),vy=rD(vd),vv=rv(vs),vb=function(t){return function(n){return function(r){for(var i=t(0,rc(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),d=l[0],f=l[1];u.push(d),s=f}return[u,s]}}},vx=function(t){var n=vb(t);return function(t){return rs(t)?n(t):vn(rd)}},vM=function(t){return vx(function(n,r){return t(r)})},vT=vM(nq),vS=function(t,n){return t(n)[0]},vw=function(t,n){return t(n)[1]};let vI=Object.freeze(Object.defineProperty({__proto__:null,Applicative:{URI:vo,map:y8,ap:y6,of:vn},Apply:vs,Chain:vd,FromState:{URI:vo,fromState:nq},Functor:va,Monad:vf,Pointed:{URI:vo,of:vn},URI:vo,ap:vt,apFirst:vc,apS:vv,apSecond:vl,bind:vy,bindTo:vg,chain:vr,chainFirst:vp,evalState:vS,evaluate:vh,execState:vw,execute:vm,flap:vu,flatten:vi,get:y4,gets:y9,map:ve,modify:y5,of:vn,put:y3,sequenceArray:vT,state:vf,traverseArray:vM,traverseArrayWithIndex:vx,traverseReadonlyArrayWithIndex:vx,traverseReadonlyNonEmptyArrayWithIndex:vb},Symbol.toStringTag,{value:"Module"}));function v_(t){return function(){return t.fromState(y4())}}function vO(t){return function(n){return t.fromState(y3(n))}}function vk(t){return nX(y5,t.fromState)}function vC(t){return nX(y9,t.fromState)}function vN(t){return function(n){return nX(n,t.fromState)}}function vj(t,n){var r=vN(t);return function(t){return function(i){return n.chain(i,r(t))}}}let vE=Object.freeze(Object.defineProperty({__proto__:null,chainStateK:vj,fromStateK:vN,get:v_,gets:vC,modify:vk,put:vO},Symbol.toStringTag,{value:"Module"}));function vR(t){return function(n){return nX(n,t.fromTask)}}function vD(t,n){return function(r){var i=nX(r,t.fromTask);return function(t){return n.chain(t,i)}}}function vA(t,n){var r=rR(n);return function(n){return r(nX(n,t.fromTask))}}let vL=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:vA,chainTaskK:vD,fromTaskK:vR},Symbol.toStringTag,{value:"Module"}));function vP(t){return function(n){return nX(n,t.fromThese)}}let vF=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:vP},Symbol.toStringTag,{value:"Module"}));function vz(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 vU=Object.freeze(Object.defineProperty({__proto__:null,getFunctorWithIndexComposition:function(t,n){var r=rk(t,n).map,i=vz(t,n);return{map:r,mapWithIndex:function(t,n){return n3(t,i(n))}}},mapWithIndex:vz},Symbol.toStringTag,{value:"Module"})),vW=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),vB=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),vV=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var v$=function(t,n){return n3(t,vX(n))},vK=function(t,n){return n3(t,v0(n))},vY=function(t,n){return n3(t,v1(n))},vq=function(t,n,r){return n3(t,v5(n,r))},vG=function(t){return function(t,n){return n3(t,v9()(n))}},vZ=function(t,n,r){return n3(t,v8(n,r))},vQ=function(t,n){return n3(t,bt())},vH=function(t,n){return n3(t,v2(n))},vJ=function(t){var n=v6(t);return function(t,r){return n3(t,n(r))}},vX=function(t){return function(n){return t(n)}},v0=function(t){return function(n){return n(t)}},v1=function(t){return function(n){return t(n)}},v2=function(t){return function(n){return t(n)}},v4=v2(nq),v3=v1(nq),v5=function(t,n){return function(r){return n(t,r)}},v9=function(){return function(t){return function(n){return t(n)}}},v8=function(t,n){return function(r){return n(r,t)}},v6=function(t){return function(n){return function(r){return t.map(n(r),nq)}}},v7=function(t){return function(n){return t.map(n,nq)}},be=function(){return nq},bt=be,bn="Identity",br={URI:bn,map:v$},bi=r_(br),bo={URI:bn,map:v$,ap:vK},ba=rg(bo),bu=ry(bo),bs={URI:bn,map:v$,ap:vK,chain:vY},bc=rR(bs),bl=nq(rf),bd=rO(br),bf=rD(bs),bp=rv(bo);let bh=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:bn,map:v$,alt:vQ},Applicative:{URI:bn,map:v$,ap:vK,of:nq},Apply:bo,Chain:bs,ChainRec:{URI:bn,map:v$,ap:vK,chain:vY,chainRec:f8},Comonad:{URI:bn,map:v$,extend:vH,extract:nq},Do:bl,Foldable:{URI:bn,reduce:vq,foldMap:vG,reduceRight:vZ},Functor:br,Monad:{URI:bn,map:v$,ap:vK,of:nq,chain:vY},Pointed:{URI:bn,of:nq},Traversable:{URI:bn,map:v$,reduce:vq,foldMap:vG,reduceRight:vZ,traverse:vJ,sequence:v7},URI:bn,alt:bt,altW:be,ap:v0,apFirst:ba,apS:bp,apSecond:bu,bind:bf,bindTo:bd,chain:v1,chainFirst:bc,duplicate:v4,extend:v2,extract:nq,flap:bi,flatten:v3,foldMap:v9,getEq:nq,getShow:nq,identity:{URI:bn,map:v$,ap:vK,of:nq,chain:vY,reduce:vq,foldMap:vG,reduceRight:vZ,traverse:vJ,sequence:v7,alt:vQ,extract:nq,extend:vH,chainRec:f8},map:vX,of:nq,reduce:v5,reduceRight:v8,sequence:v7,traverse:v6},Symbol.toStringTag,{value:"Module"})),bm=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var bg=function(t,n){return function(){return n(t())}},by=function(t,n){return function(){return t()(n())}},bv=function(t,n){return function(){return n(t())()}},bb=function(t,n){return function(){for(var r=n(t)();"Left"===r._tag;)r=n(r.left)();return r.right}},bx=function(t){return function(n){return bg(n,t)}},bM=function(t){return function(n){return by(n,t)}},bT=function(t){return function(n){return bv(n,t)}},bS=bT(nq),bw={URI:"IO",map:bg},bI=r_(bw),b_={URI:"IO",of:nG},bO={URI:"IO",map:bg,ap:by},bk=rg(bO),bC=ry(bO),bN={URI:"IO",map:bg,ap:by,of:nG},bj={URI:"IO",map:bg,ap:by,chain:bv},bE={URI:"IO",map:bg,ap:by,of:nG,chain:bv},bR=rR(bj),bD=nG(rf),bA=rO(bw),bL=rD(bj),bP=rv(bO),bF=nG(rd),bz=function(t){return function(n){return function(){for(var r=[t(0,rc(n))()],i=1;i<n.length;i++)r.push(t(i,n[i])());return r}}},bU=function(t){var n=bz(t);return function(t){return rs(t)?n(t):bF}},bW=function(t){return bU(function(n,r){return t(r)})},bB=bW(nq),bV=rb(bO),b$=rN(bN);let bK=Object.freeze(Object.defineProperty({__proto__:null,ApT:bF,Applicative:bN,Apply:bO,Chain:bj,ChainRec:{URI:"IO",map:bg,ap:by,chain:bv,chainRec:bb},Do:bD,FromIO:{URI:"IO",fromIO:nq},Functor:bw,Monad:bE,MonadIO:{URI:"IO",map:bg,ap:by,of:nG,chain:bv,fromIO:nq},Pointed:b_,URI:"IO",ap:bM,apFirst:bk,apS:bP,apSecond:bC,bind:bL,bindTo:bA,chain:bT,chainFirst:bR,flap:bI,flatten:bS,fromIO:nq,getMonoid:b$,getSemigroup:bV,io:{URI:"IO",map:bg,of:nG,ap:by,chain:bv,fromIO:nq,chainRec:bb},map:bx,of:nG,sequenceArray:bB,traverseArray:bW,traverseArrayWithIndex:bU,traverseReadonlyArrayWithIndex:bU,traverseReadonlyNonEmptyArrayWithIndex:bz},Symbol.toStringTag,{value:"Module"}));var bY=gS(b_),bq=gT(b_),bG=gw(bw),bZ=gI(bw),bQ=gL(bw),bH=gP(bE),bJ=gF(bE),bX=function(t,n){return function(){return gt(t,n)}},b0=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return bX(function(){return t.apply(void 0,r)},n)}},b1=gV(bw),b2=gz(bE),b4=gU(bE),b3=function(t){return b4(xw(t))},b5=gW(bE),b9=gB(bw),b8=function(t,n){return n3(t,xi(n))},b6=function(t,n){return n3(t,xu(n))},b7=function(t,n){return n3(t,xs(function(t){return n3(n,xi(t))}))},xe=function(t,n){return n3(t,xs(n))},xt=function(t,n,r){return n3(t,xo(n,r))},xn=function(t,n){return n3(t,xa(n))},xr=function(t,n){return n3(t,xl(n))},xi=gC(bw),xo=gR(bw),xa=gD(bw),xu=gN(bO),xs=gj(bE),xc=xs(nq),xl=gE(bE),xd="IOEither";function xf(t){var n=rm(bO,mS(t));return{URI:xd,_E:void 0,map:b8,ap:function(t,r){return n3(t,n(r))},of:bq}}function xp(t){var n=gA(bE,t);return{URI:xd,_E:void 0,map:b8,alt:function(t,r){return n3(t,n(r))}}}var xh=function(t){var n=mx(t);return{URI:xd,_E:void 0,compact:hW(bw,n),separate:hB(bw,n,m_)}},xm={URI:xd,map:b8},xg=r_(xm),xy={URI:xd,map:b8,ap:b6},xv=rg(xy),xb=ry(xy),xx={URI:xd,map:b8,ap:b6,of:bq},xM={URI:xd,map:b8,ap:b6,chain:xe},xT=rR(xM),xS={URI:xd,fromIO:bG},xw=yr(xS),xI=yi(xS,xM),x_=yo(xS,xM),xO={URI:xd,fromEither:nG},xk=rL(xO),xC=rF(xO),xN=rz(xO,xM),xj=rW(xO,xM),xE=rB(xO,xM),xR=rP(xO),xD=rV(xO,xM),xA=rU(xO),xL=function(t,n,r){return xP(t,n,r)},xP=function(t,n,r){return n3(t,xs(function(t){return n3(n(t),bT(function(n){return n3(r(t,n),xs(function(){return nG(n)}))}))}))},xF=bq(rf),xz=rO(xm),xU=rD(xM),xW=rv(xy),xB=bq(rd),xV=function(t){return nX(bz(t),bx(gf(n5)))},x$=function(t){var n=xV(t);return function(t){return rs(t)?n(t):xB}},xK=function(t){return function(n){return function(){var r=t(0,rc(n))();if(rr(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o])();if(rr(a))return a;i.push(a.right)}return ra(i)}}},xY=function(t){var n=xK(t);return function(t){return rs(t)?n(t):xB}},xq=function(t){return x$(function(n,r){return t(r)})},xG=xq(nq),xZ=function(t){return xY(function(n,r){return t(r)})},xQ=xZ(nq),xH=rb(xy),xJ=rN(xx),xX=function(t){return rb(bO)(mb(t))};let x0=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:xd,map:b8,alt:xr},ApT:xB,Applicative:xx,ApplicativePar:xx,ApplicativeSeq:{URI:xd,map:b8,ap:b7,of:bq},ApplyPar:xy,Bifunctor:{URI:xd,bimap:xt,mapLeft:xn},Chain:xM,Do:xF,FromEither:xO,FromIO:xS,Functor:xm,Monad:{URI:xd,map:b8,ap:b6,of:bq,chain:xe},MonadIO:{URI:xd,map:b8,ap:b6,of:bq,chain:xe,fromIO:bG},MonadThrow:{URI:xd,map:b8,ap:b6,of:bq,chain:xe,throwError:bY},Pointed:{URI:xd,of:bq},URI:xd,alt:xl,altW:xl,ap:xu,apFirst:xv,apFirstW:xv,apS:xW,apSW:xW,apSecond:xb,apSecondW:xb,apW:xu,bimap:xo,bind:xU,bindTo:xz,bindW:xU,bracket:xL,bracketW:xP,chain:xs,chainEitherK:xj,chainEitherKW:xj,chainFirst:xT,chainFirstEitherK:xE,chainFirstEitherKW:xE,chainFirstIOK:x_,chainFirstW:xT,chainIOK:xI,chainOptionK:xN,chainW:xs,filterOrElse:xD,filterOrElseW:xD,flap:xg,flatten:xc,flattenW:xc,fold:bH,foldW:bH,fromEither:nG,fromEitherK:xA,fromIO:bG,fromIOK:xw,fromOption:xk,fromOptionK:xC,fromPredicate:xR,getAltIOValidation:xp,getApplicativeIOValidation:xf,getApplyMonoid:xJ,getApplySemigroup:xH,getCompactable:xh,getFilterable:function(t){var n=mM(t),r=xh(t),i=gH(bw,n),o=gJ(bw,n),a=gX(bw,n),u=g0(bw,n);return{URI:xd,_E:void 0,map:b8,compact:r.compact,separate:r.separate,filter:function(t,n){return n3(t,i(n))},filterMap:function(t,n){return n3(t,o(n))},partition:function(t,n){return n3(t,a(n))},partitionMap:function(t,n){return n3(t,u(n))}}},getIOValidation:function(t){var n=xf(t),r=xp(t);return{URI:xd,_E:void 0,map:b8,ap:n.ap,of:bq,chain:xe,bimap:xt,mapLeft:xn,alt:r.alt,fromIO:bG,throwError:bY}},getOrElse:bJ,getOrElseW:bJ,getSemigroup:xX,ioEither:{URI:xd,bimap:xt,mapLeft:xn,map:b8,of:bq,ap:b6,chain:xe,alt:xr,fromIO:bG,throwError:bY},left:bY,leftIO:bZ,map:xi,mapLeft:xa,match:bQ,matchE:bH,matchEW:bH,matchW:bQ,of:bq,orElse:b2,orElseFirst:b4,orElseFirstIOK:b3,orElseFirstW:b4,orElseW:b2,orLeft:b5,right:bq,rightIO:bG,sequenceArray:xG,sequenceSeqArray:xQ,swap:b9,throwError:bY,toUnion:b1,traverseArray:xq,traverseArrayWithIndex:x$,traverseReadonlyArrayWithIndex:x$,traverseReadonlyArrayWithIndexSeq:xY,traverseReadonlyNonEmptyArrayWithIndex:xV,traverseReadonlyNonEmptyArrayWithIndexSeq:xK,traverseSeqArray:xZ,traverseSeqArrayWithIndex:xY,tryCatch:bX,tryCatchK:b0},Symbol.toStringTag,{value:"Module"}));function x1(t){return nX(rn,t.of)}function x2(t){return nG(t.of(rt))}function x4(t){return function(n){return t.map(n,rn)}}function x3(t){return nX(hv,t.of)}function x5(t){var n=x3(t);return function(t){return nX(t,n)}}function x9(t){var n=Ma(t),r=x5(t);return function(t){return n(r(t))}}function x8(t){return function(n){return nX(n,t.of)}}function x6(t){var n=Ma(t),r=x8(t);return function(t){return n(r(t))}}function x7(t){return function(n){return function(r){return t.of(ph(n)(r))}}}function Me(t){return nX(pg,t.of)}function Mt(t){return function(n,r){return function(i){return t.map(i,hs(n,r))}}}function Mn(t){return function(n,r){return function(i){return t.chain(i,hs(n,r))}}}function Mr(t){return function(n){return function(r){return t.chain(r,hs(n,t.of))}}}function Mi(t){return rI(t,pL)}function Mo(t){return rm(t,pz)}function Ma(t){var n=x2(t);return function(r){return function(i){return t.chain(i,hs(function(){return n()},r))}}}function Mu(t){var n=x1(t);return function(r){return function(i){return t.chain(i,hs(r,n))}}}let Ms=Object.freeze(Object.defineProperty({__proto__:null,alt:Mu,ap:Mo,chain:Ma,chainNullableK:x9,chainOptionK:x6,fromEither:Me,fromF:x4,fromNullable:x3,fromNullableK:x5,fromOptionK:x8,fromPredicate:x7,getOptionM:function(t){var n=Mo(t),r=Mi(t),i=Ma(t),o=Mu(t),a=Mn(t),u=Mr(t),s=x2(t);return{map:function(t,n){return n3(t,r(n))},ap:function(t,r){return n3(t,n(r))},of:x1(t),chain:function(t,n){return n3(t,i(n))},alt:function(t,n){return n3(t,o(n))},fold:function(t,n,r){return n3(t,a(n,r))},getOrElse:function(t,n){return n3(t,u(n))},fromM:x4(t),none:function(){return s()}}},getOrElse:Mr,map:Mi,match:Mt,matchE:Mn,some:x1,zero:x2},Symbol.toStringTag,{value:"Module"}));var Mc=x1(b_),Ml=x7(b_),Md=Me(b_),Mf=x4(bw),Mp=bx(pg),Mh=Mt(bw),Mm=Mn(bj),Mg=Mr(bE),My=bx(hw),Mv=bx(hS),Mb=x3(b_),Mx=x5(b_),MM=x9(bE),MT=x8(b_),MS=x6(bE),Mw=Mi(bw),MI=Mo(bO),M_=Ma(bE),MO=M_(nq),Mk=Mu(bE),MC=x2(b_),MN=MC(),Mj=hW(bw,p1),ME=hB(bw,p1,pL),MR=gH(bw,p9),MD=gJ(bw,p9),MA=gX(bw,p9),ML=g0(bw,p9),MP=function(t,n){return n3(t,Mw(n))},MF=function(t,n){return n3(t,MI(n))},Mz=function(t,n){return n3(t,M_(n))},MU=function(t,n){return n3(t,Mk(n))},MW=function(t,n){return n3(t,MR(n))},MB=function(t,n){return n3(t,MD(n))},MV=function(t,n){return n3(t,MA(n))},M$=function(t,n){return n3(t,ML(n))},MK="IOOption",MY={URI:MK,map:MP},Mq=r_(MY),MG={URI:MK,of:Mc},MZ={URI:MK,map:MP,ap:MF},MQ=rg(MZ),MH=ry(MZ),MJ={URI:MK,map:MP,ap:MF,chain:Mz},MX=rR(MJ),M0={URI:MK,zero:MC},M1=so(M0,MG),M2={URI:MK,fromIO:Mf},M4=yr(M2),M3=yi(M2,MJ),M5=yo(M2,MJ),M9={URI:MK,fromEither:Md},M8=rU(M9),M6=rW(M9,MJ),M7=rB(M9,MJ),Te=Mc(rf),Tt=rO(MY),Tn=rD(MJ),Tr=rv(MZ),Ti=Mc(rd),To=function(t){return nX(bz(t),bx(hj(n5)))},Ta=function(t){var n=To(t);return function(t){return rs(t)?n(t):Ti}};let Tu=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:MK,map:MP,alt:MU},Alternative:{URI:MK,map:MP,ap:MF,of:Mc,alt:MU,zero:MC},ApT:Ti,Applicative:{URI:MK,map:MP,ap:MF,of:Mc},Apply:MZ,Chain:MJ,Compactable:{URI:MK,compact:Mj,separate:ME},Do:Te,Filterable:{URI:MK,map:MP,compact:Mj,separate:ME,filter:MW,filterMap:MB,partition:MV,partitionMap:M$},FromEither:M9,FromIO:M2,Functor:MY,Monad:{URI:MK,map:MP,ap:MF,of:Mc,chain:Mz},MonadIO:{URI:MK,map:MP,ap:MF,of:Mc,chain:Mz,fromIO:Mf},Pointed:MG,Zero:M0,alt:Mk,altW:Mk,ap:MI,apFirst:MQ,apS:Tr,apSecond:MH,bind:Tn,bindTo:Tt,chain:M_,chainEitherK:M6,chainFirst:MX,chainFirstEitherK:M7,chainFirstIOK:M5,chainIOK:M3,chainNullableK:MM,chainOptionK:MS,compact:Mj,filter:MR,filterMap:MD,flap:Mq,flatten:MO,fold:Mm,fromEither:Md,fromEitherK:M8,fromIO:Mf,fromIOEither:Mp,fromIOK:M4,fromNullable:Mb,fromNullableK:Mx,fromOption:nG,fromOptionK:MT,fromPredicate:Ml,getOrElse:Mg,getOrElseW:Mg,guard:M1,map:Mw,match:Mh,matchE:Mm,matchEW:Mm,matchW:Mh,none:MN,of:Mc,partition:MA,partitionMap:ML,separate:ME,some:Mc,toNullable:Mv,toUndefined:My,traverseReadonlyArrayWithIndex:Ta,traverseReadonlyNonEmptyArrayWithIndex:To,zero:MC},Symbol.toStringTag,{value:"Module"}));var Ts=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 Tc=Object.freeze(Object.defineProperty({__proto__:null,IORef:Ts,newIORef:function(t){return function(){return new Ts(t)}}},Symbol.toStringTag,{value:"Module"})),Tl=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Td=function(t){return gt(function(){return JSON.parse(t)},nq)},Tf=function(t){return gt(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},nq)};let Tp=Object.freeze(Object.defineProperty({__proto__:null,parse:Td,stringify:Tf},Symbol.toStringTag,{value:"Module"})),Th=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Tm=function(t){return new Map(t)};function Tg(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 Ty=function(t){return t.size},Tv=function(t){return 0===t.size};function Tb(t){var n=TN(t);return function(r,i){if(void 0===i){var o=Tb(t);return function(t){return o(r,t)}}return re(n(r,i))}}function Tx(t){return function(n,r){if(void 0===r){var i=Tx(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 TM=function(t){return function(n){return Array.from(n.keys()).sort(t.compare)}},TT=function(t){return function(n){return Array.from(n.values()).sort(t.compare)}};function TS(t){var n=TM(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 Tw=function(t){return TS(t)(function(t,n){return[t,n]})},TI=function(t){var n=TC(t);return function(t,r){var i=n(t);return function(n){var o=i(n);if(n7(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}}},T_=function(t){var n=TC(t);return function(t){return function(r){var i=n(t,r);if(re(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},TO=function(t){var n=Tk(t);return function(t,r){return n(t,function(){return r})}},Tk=function(t){var n=TC(t);return function(t,r){return function(i){var o=n(t,i);if(n7(o))return rt;var a=o.value,u=a[0],s=a[1],c=r(s);if(c===s)return rn(i);var l=new Map(i);return l.set(u,c),rn(l)}}};function TC(t){return function(n,r){if(void 0===r){var i=TC(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 rn([s,c])}return rt}}function TN(t){var n=TC(t);return function(r,i){if(void 0===i){var o=TN(t);return function(t){return o(r,t)}}return n3(n(r,i),pA(function(t){return t[0],t[1]}))}}function Tj(t,n){var r=TC(t);return function(i,o){if(void 0===o){var a=Tj(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],d=c[1],f=r(l,o);if(n7(f)||!t.equals(l,f.value[0])||!n.equals(d,f.value[1]))return!1}return!0}}var TE=new Map;function TR(t,n){var r=Tj(t,n);return rK(function(t,n){return r(t,n)&&r(n,t)})}var TD=function(t,n){return new Map([[t,n]])},TA=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},TL=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]);rr(c)?i.set(s,c.left):o.set(s,c.right)}return uX(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 uX(i,o)}}var TF=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]);re(s)&&i.set(u,s.value)}return i}};function Tz(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 TU=function(t,n){return TA(t,function(t,r){return n(r)})},TW=function(t,n){return TK(t,function(t,r){return n(r)})},TB=function(t,n){return TY(t,function(t,r){return n(r)})},TV=function(t,n){return Tq(t,function(t,r){return n(r)})},T$=function(t,n){return TG(t,function(t,r){return n(r)})},TK=function(t,n){return n3(t,Tz(n))},TY=function(t,n){return n3(t,TF(n))},Tq=function(t,n){return n3(t,TP(n))},TG=function(t,n){return n3(t,TL(n))},TZ=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];re(u)&&r.set(a,u.value)}return r},TQ=function(t){return function(n){return TW(n,t)}},TH=function(t){return function(n){return TB(n,t)}},TJ=function(t){return function(n){return TU(n,t)}},TX=function(t){return function(n){return TA(n,t)}},T0=function(t){return function(n){return TV(n,t)}},T1=function(t){return function(n){return T$(n,t)}},T2=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];rr(s)?r.set(u,s.left):i.set(u,s.right)}return uX(r,i)},T4="ReadonlyMap",T3=function(t,n){var r=Sf(t,n);return{concat:function(t,n){return r(n)(t)}}},T5=function(t,n){return{concat:T3(t,n).concat,empty:TE}},T9=function(t,n){var r=Sp(t,n);return{concat:function(t,n){return r(n)(t)}}},T8=function(t){return function(){var n=Sh(t);return{concat:function(t,r){return n(r)(t)}}}},T6={URI:T4,map:TU},T7=r_(T6),Se=function(){return{URI:T4,_E:void 0,map:TU,mapWithIndex:TA}},St={URI:T4,compact:TZ,separate:T2},Sn=function(t){var n=Sa(t);return function(t,r){return n(t,function(t,n,i){return r(n,i)})}},Sr=function(t){var n=Su(t);return function(t){var r=n(t);return function(t){return r(function(n,r){return t(r)})}}},Si=function(t){var n=Ss(t);return function(t,r){return n(t,function(t,n,i){return r(n,i)})}},So=function(t){var n=Sn(t),r=Sr(t),i=Si(t);return{URI:T4,_E:void 0,reduce:function(t,r,i){return n3(t,n(r,i))},foldMap:function(t){var n=r(t);return function(t,r){return n3(t,n(r))}},reduceRight:function(t,n,r){return n3(t,i(n,r))}}},Sa=function(t){var n=TM(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}}},Su=function(t){var n=TM(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}}}},Ss=function(t){var n=TM(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}}},Sc=function(t){var n=So(t),r=Sa(t),i=Su(t),o=Ss(t);return{URI:T4,_E:void 0,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(t,n,i){return n3(t,r(n,i))},foldMapWithIndex:function(t){var n=i(t);return function(t,r){return n3(t,n(r))}},reduceRightWithIndex:function(t,n,r){return n3(t,o(n,r))}}},Sl=function(t){var n=Sd(t),r=So(t);return{URI:T4,_E:void 0,map:TU,reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,traverse:n.traverse,sequence:n.sequence}},Sd=function(t){var n=Sc(t),r=TM(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,n5)}};return{URI:T4,_E:void 0,map:TU,mapWithIndex:TA,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverse:o,sequence:a,traverseWithIndex:i}},Sf=function(t,n){var r=TN(t);return function(t){return function(i){if(Tv(i))return t;if(Tv(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],d=r(c)(t);re(d)?a.set(c,n.concat(l,d.value)):a.set(c,l)}for(var f=t.entries();!(o=f.next()).done;){var p=o.value,c=p[0],l=p[1],d=r(c)(a);n7(d)&&a.set(c,l)}return a}}},Sp=function(t,n){var r=TN(t);return function(t){return function(i){if(Tv(i)||Tv(t))return TE;for(var o,a=new Map,u=i.entries();!(o=u.next()).done;){var s=o.value,c=s[0],l=s[1],d=r(c)(t);re(d)&&a.set(c,n.concat(l,d.value))}return a}}},Sh=function(t){var n=Tb(t);return function(t){return function(r){if(Tv(r))return t;if(Tv(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 d=i.value,s=d[0],c=d[1];n(s)(r)||o.set(s,c)}return o}}};let Sm=Object.freeze(Object.defineProperty({__proto__:null,Compactable:St,Filterable:{URI:T4,map:TU,compact:TZ,separate:T2,filter:TW,filterMap:TB,partition:TV,partitionMap:T$},Functor:T6,URI:T4,collect:TS,compact:TZ,deleteAt:T_,difference:Sh,elem:Tx,empty:TE,filter:TQ,filterMap:TH,filterMapWithIndex:TF,filterWithIndex:Tz,flap:T7,foldMap:Sr,foldMapWithIndex:Su,fromFoldable:function(t,n,r){return function(i){var o=TC(t);return r.reduce(i,new Map,function(t,r){var i=r[0],a=r[1],u=o(i,t);return re(u)?t.set(u.value[0],n.concat(u.value[1],a)):t.set(i,a),t})}},fromMap:Tm,getDifferenceMagma:T8,getEq:TR,getFilterableWithIndex:function(){return{URI:T4,_E:void 0,map:TU,mapWithIndex:TA,compact:TZ,separate:T2,filter:TW,filterMap:TB,partition:TV,partitionMap:T$,partitionMapWithIndex:TG,partitionWithIndex:Tq,filterMapWithIndex:TY,filterWithIndex:TK}},getFoldable:So,getFoldableWithIndex:Sc,getFunctorWithIndex:Se,getIntersectionSemigroup:T9,getMonoid:function(t,n){var r=TC(t);return{concat:function(t,i){if(Tv(t))return i;if(Tv(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],d=r(c,t);re(d)?a.set(d.value[0],n.concat(d.value[1],l)):a.set(c,l)}return a},empty:TE}},getShow:Tg,getTraversable:Sl,getTraversableWithIndex:Sd,getUnionMonoid:T5,getUnionSemigroup:T3,getWitherable:function(t){var n=Sd(t);return{URI:T4,_E:void 0,map:TU,compact:TZ,separate:T2,filter:TW,filterMap:TB,partition:TV,partitionMap:T$,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:n.traverse,sequence:n.sequence,mapWithIndex:TA,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverseWithIndex:n.traverseWithIndex,wilt:st(n,St),wither:sn(n,St)}},insertAt:TI,intersection:Sp,isEmpty:Tv,isSubmap:Tj,keys:TM,lookup:TN,lookupWithKey:TC,map:TJ,mapWithIndex:TX,member:Tb,modifyAt:Tk,partition:T0,partitionMap:T1,partitionMapWithIndex:TL,partitionWithIndex:TP,pop:function(t){var n=TN(t),r=T_(t);return function(t){var i=r(t);return function(r){return n3(n(t,r),pA(function(t){return[t,i(r)]}))}}},readonlyMap:{URI:T4,map:TU,compact:TZ,separate:T2,filter:TW,filterMap:TB,partition:TV,partitionMap:T$},reduce:Sn,reduceRight:Si,reduceRightWithIndex:Ss,reduceWithIndex:Sa,separate:T2,singleton:TD,size:Ty,toMap:function(t){return new Map(t)},toReadonlyArray:Tw,toUnfoldable:function(t,n){var r=Tw(t);return function(t){var i=r(t),o=i.length;return n.unfold(0,function(t){return t<o?rn([i[t],t+1]):rt})}},union:Sf,updateAt:TO,upsertAt:TI,values:TT},Symbol.toStringTag,{value:"Module"}));var Sg=globalThis&&globalThis.__assign||function(){return(Sg=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)},Sy=function(t){return function(n){return Array.from(n.keys()).sort(t.compare)}},Sv=function(t){return function(n){return Array.from(n.values()).sort(t.compare)}};function Sb(t){var n=Sy(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 Sx(t){return Sb(t)(function(t,n){return[t,n]})}var SM=function(t){var n=SI(t);return function(t,r){var i=n(t);return function(n){var o=i(n);if(n7(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}}},ST=function(t){var n=SI(t);return function(t){return function(r){var i=n(t,r);if(re(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},SS=function(t){var n=Sw(t);return function(t,r){return n(t,function(){return r})}},Sw=function(t){var n=SI(t);return function(t,r){return function(i){var o=n(t,i);if(n7(o))return rt;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),rn(a)}}};function SI(t){return function(n,r){if(void 0===r){var i=SI(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 rn([s,c])}return rt}}var S_=function(t,n){return new Map([[t,n]])},SO=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},Sk=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]);rr(c)?i.set(s,c.left):o.set(s,c.right)}return uX(i,o)}};function SC(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 uX(i,o)}}var SN=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]);re(s)&&i.set(u,s.value)}return i}};function Sj(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 SE=function(t,n){return SO(t,function(t,r){return n(r)})},SR=function(t,n){return SP(t,function(t,r){return n(r)})},SD=function(t,n){return SF(t,function(t,r){return n(r)})},SA=function(t,n){return Sz(t,function(t,r){return n(r)})},SL=function(t,n){return SU(t,function(t,r){return n(r)})},SP=function(t,n){return n3(t,Sj(n))},SF=function(t,n){return n3(t,SN(n))},Sz=function(t,n){return n3(t,SC(n))},SU=function(t,n){return n3(t,Sk(n))},SW=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];re(u)&&r.set(a,u.value)}return r},SB=function(t){return function(n){return SR(n,t)}},SV=function(t){return function(n){return SD(n,t)}},S$=function(t){return function(n){return SE(n,t)}},SK=function(t){return function(n){return SO(n,t)}},SY=function(t){return function(n){return SA(n,t)}},Sq=function(t){return function(n){return SL(n,t)}},SG=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];rr(s)?r.set(u,s.left):i.set(u,s.right)}return uX(r,i)},SZ=function(t,n){var r=S8(t,n);return{concat:function(t,n){return r(n)(t)}}},SQ=function(t,n){return{concat:SZ(t,n).concat,empty:new Map}},SH=function(t,n){var r=S6(t,n);return{concat:function(t,n){return r(n)(t)}}},SJ=function(t){return function(){var n=S7(t);return{concat:function(t,r){return n(r)(t)}}}},SX=function(t){return Sg(Sg({},So(t)),{URI:"Map"})},S0=function(t){return Sg(Sg({},Sc(t)),{URI:"Map"})},S1=function(t){var n=S0(t),r=Sy(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:SE,mapWithIndex:SO,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverse:o,sequence:a,traverseWithIndex:i}},S2={URI:"Map",map:SE},S4=r_(S2),S3={URI:"Map",compact:SW,separate:SG},S5={URI:"Map",map:SE,compact:SW,separate:SG,filter:SR,filterMap:SD,partition:SA,partitionMap:SL},S9=function(t){return new Map(t)},S8=function(t,n){var r=Sf(t,n);return function(t){return function(n){return Tv(n)?S9(t):Tv(t)?S9(n):r(t)(n)}}},S6=function(t,n){var r=Sp(t,n);return function(t){return function(n){return Tv(n)||Tv(t)?new Map:r(t)(n)}}},S7=function(t){var n=Sh(t);return function(t){return function(r){return Tv(r)?S9(t):Tv(t)?S9(r):n(t)(r)}}},we=new Map;let wt=Object.freeze(Object.defineProperty({__proto__:null,Compactable:S3,Filterable:S5,Functor:S2,URI:"Map",collect:Sb,compact:SW,deleteAt:ST,difference:S7,elem:Tx,empty:we,filter:SB,filterMap:SV,filterMapWithIndex:SN,filterWithIndex:Sj,flap:S4,foldMap:Sr,foldMapWithIndex:Su,fromFoldable:function(t,n,r){return function(i){var o=SI(t);return r.reduce(i,new Map,function(t,r){var i=r[0],a=r[1],u=o(i,t);return re(u)?t.set(u.value[0],n.concat(u.value[1],a)):t.set(i,a),t})}},getDifferenceMagma:SJ,getEq:TR,getFilterableWithIndex:function(){return{URI:"Map",_E:void 0,map:SE,mapWithIndex:SO,compact:SW,separate:SG,filter:SR,filterMap:SD,partition:SA,partitionMap:SL,partitionMapWithIndex:SU,partitionWithIndex:Sz,filterMapWithIndex:SF,filterWithIndex:SP}},getFoldable:SX,getFoldableWithIndex:S0,getIntersectionSemigroup:SH,getMonoid:function(t,n){var r=SI(t);return{concat:function(t,i){if(Tv(t))return i;if(Tv(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],d=r(c,t);re(d)?a.set(d.value[0],n.concat(d.value[1],l)):a.set(c,l)}return a},empty:new Map}},getShow:Tg,getTraversableWithIndex:S1,getUnionMonoid:SQ,getUnionSemigroup:SZ,getWitherable:function(t){var n=S1(t);return{URI:"Map",_E:void 0,map:SE,compact:SW,separate:SG,filter:SR,filterMap:SD,partition:SA,partitionMap:SL,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:n.traverse,sequence:n.sequence,mapWithIndex:SO,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverseWithIndex:n.traverseWithIndex,wilt:st(n,S3),wither:sn(n,S3)}},insertAt:SM,intersection:S6,isEmpty:Tv,isSubmap:Tj,keys:Sy,lookup:TN,lookupWithKey:SI,map:S$,mapWithIndex:SK,map_:S5,member:Tb,modifyAt:Sw,partition:SY,partitionMap:Sq,partitionMapWithIndex:Sk,partitionWithIndex:SC,pop:function(t){var n=TN(t),r=ST(t);return function(t){var i=r(t);return function(r){return n3(n(t,r),pA(function(t){return[t,i(r)]}))}}},reduce:Sn,reduceRight:Si,reduceRightWithIndex:Ss,reduceWithIndex:Sa,separate:SG,singleton:S_,size:Ty,toArray:Sx,toUnfoldable:function(t,n){var r=Sx(t);return function(t){var i=r(t),o=i.length;return n.unfold(0,function(t){return t<o?rn([i[t],t+1]):rt})}},union:S8,updateAt:SS,upsertAt:SM,values:Sv},Symbol.toStringTag,{value:"Module"})),wn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),wr=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),wi=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),wo=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),wa=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var wu=function(t){return{concat:iM(t).concat,empty:t.top}},ws=function(t){return{concat:iT(t).concat,empty:t.bottom}},wc=function(t){return{concat:im(t).concat,empty:t.empty}},wl=function(t){var n={};for(var r in t)rp.call(t,r)&&(n[r]=t[r].empty);return{concat:iw(t).concat,empty:n}},wd=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{concat:iI.apply(iL,t).concat,empty:t.map(function(t){return t.empty})}},wf=function(t){return ib(t)(t.empty)},wp={concat:iC.concat,empty:void 0},wh={concat:ij.concat,empty:!0},wm={concat:iE.concat,empty:!1},wg=function(){return wc(gY())},wy={concat:iR.concat,empty:""},wv={concat:iD.concat,empty:0},wb={concat:iA.concat,empty:1};let wx=Object.freeze(Object.defineProperty({__proto__:null,concatAll:wf,fold:wf,getDualMonoid:wc,getEndomorphismMonoid:wg,getFunctionMonoid:nV,getJoinMonoid:ws,getMeetMonoid:wu,getStructMonoid:wl,getTupleMonoid:wd,max:ws,min:wu,monoidAll:wh,monoidAny:wm,monoidProduct:wb,monoidString:wy,monoidSum:wv,monoidVoid:wp,reverse:wc,struct:wl,tuple:wd},Symbol.toStringTag,{value:"Module"})),wM=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var wT=function(t,n,r){return function(i){return -1===i?t():0===i?n():r()}},wS=function(t){return -1===t?1:1===t?-1:0},ww={equals:function(t,n){return t===n}},wI={concat:function(t,n){return 0!==t?t:n}},w_={concat:wI.concat,empty:0},wO=function(t){return t<=-1?-1:t>=1?1:0};let wk=Object.freeze(Object.defineProperty({__proto__:null,Eq:ww,Monoid:w_,Semigroup:wI,eqOrdering:ww,invert:wS,match:wT,matchW:wT,monoidOrdering:w_,reverse:wS,semigroupOrdering:wI,sign:wO},Symbol.toStringTag,{value:"Module"})),wC=Object.freeze(Object.defineProperty({__proto__:null,pipe:n3,pipeable:function(t){var n,r,i,o,a,u,s,c,l,d,f,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})})}},I=function(n){return t.chain(n,nq)};y.chain=S,y.chainFirst=w,y.flatten=I}if("function"==typeof t.bimap){var _=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=_,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,nq)};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"})),wN=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),wj=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var wE=function(){return Math.random()};function wR(t,n){return n3(wE,bx(function(r){return Math.floor((n-t+1)*r+t)}))}var wD=n3(wE,bx(function(t){return t<.5})),wA=function(t){return n3(wR(0,t.length-1),bx(function(n){return t[n]}))};let wL=Object.freeze(Object.defineProperty({__proto__:null,random:wE,randomBool:wD,randomElem:wA,randomInt:wR,randomRange:function(t,n){return n3(wE,bx(function(r){return(n-t)*r+t}))}},Symbol.toStringTag,{value:"Module"}));var wP=gS(yj),wF=gT(yj),wz=gw(yC),wU=gI(yC),wW=gL(yC),wB=gP(yP),wV=gF(yP),w$=gV(yC),wK=gz(yP),wY=gU(yP),wq=gW(yP),wG=gB(yC),wZ=function(t,n){return n3(t,w1(n))},wQ=function(t,n,r){return n3(t,w2(n,r))},wH=function(t,n){return n3(t,w4(n))},wJ=function(t,n){return n3(t,w3(n))},wX=function(t,n){return n3(t,w5(n))},w0=function(t,n){return n3(t,w8(n))},w1=gC(yC),w2=gR(yC),w4=gD(yC),w3=gN(yE),w5=gj(yP),w9=w5(nq),w8=gE(yP),w6="ReaderEither",w7=function(t){var n=mx(t);return{URI:w6,_E:void 0,compact:hW(yC,n),separate:hB(yC,n,m_)}};function Ie(t){var n=rm(yE,mS(t));return{URI:w6,_E:void 0,map:wZ,ap:function(t,r){return n3(t,n(r))},of:wF}}function It(t){var n=gA(yP,t);return{URI:w6,_E:void 0,map:wZ,alt:function(t,r){return n3(t,n(r))}}}var In={URI:w6,map:wZ},Ir=r_(In),Ii={URI:w6,map:wZ,ap:wJ},Io=rg(Ii),Ia=ry(Ii),Iu={URI:w6,map:wZ,ap:wJ,of:wF},Is={URI:w6,map:wZ,ap:wJ,chain:wX},Ic=rR(Is),Il={URI:w6,fromReader:wz},Id=yH(Il),If=yJ(Il),Ip=yX(Il),Ih=y0(Il,Is),Im=y1(Il,Is),Ig={URI:w6,fromEither:nG},Iy=rL(Ig),Iv=rF(Ig),Ib=rz(Ig,Is),Ix=rW(Ig,Is),IM=rB(Ig,Is),IT=rP(Ig),IS=rV(Ig,Is),Iw=rU(Ig),II=wF(rf),I_=rO(In),IO=rD(Is),Ik=rv(Ii),IC=wF(rd),IN=function(t){return nX(y$(t),ym(gf(n5)))},Ij=function(t){var n=IN(t);return function(t){return rs(t)?n(t):IC}},IE=function(t){return Ij(function(n,r){return t(r)})},IR=IE(nq),ID=rb(Ii),IA=rN(Iu),IL=function(t){return rb(yE)(mb(t))};let IP=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:w6,map:wZ,alt:w0},ApT:IC,Applicative:Iu,Apply:Ii,Bifunctor:{URI:w6,bimap:wQ,mapLeft:wH},Chain:Is,Do:II,FromEither:Ig,FromReader:Il,Functor:In,Monad:{URI:w6,map:wZ,ap:wJ,of:wF,chain:wX},MonadThrow:{URI:w6,map:wZ,ap:wJ,of:wF,chain:wX,throwError:wP},Pointed:{URI:w6,of:wF},URI:w6,alt:w8,altW:w8,ap:w3,apFirst:Io,apFirstW:Io,apS:Ik,apSW:Ik,apSecond:Ia,apSecondW:Ia,apW:w3,ask:Id,asks:If,asksReaderEither:yc,asksReaderEitherW:yc,bimap:w2,bind:IO,bindTo:I_,bindW:IO,chain:w5,chainEitherK:Ix,chainEitherKW:Ix,chainFirst:Ic,chainFirstEitherK:IM,chainFirstEitherKW:IM,chainFirstReaderK:Im,chainFirstReaderKW:Im,chainFirstW:Ic,chainOptionK:Ib,chainReaderK:Ih,chainReaderKW:Ih,chainW:w5,filterOrElse:IS,filterOrElseW:IS,flap:Ir,flatten:w9,flattenW:w9,fold:wB,foldW:wB,fromEither:nG,fromEitherK:Iw,fromOption:Iy,fromOptionK:Iv,fromPredicate:IT,fromReader:wz,fromReaderK:Ip,getAltReaderValidation:It,getApplicativeReaderValidation:Ie,getApplyMonoid:IA,getApplySemigroup:ID,getCompactable:w7,getFilterable:function(t){var n=mM(t),r=w7(t),i=gH(yC,n),o=gJ(yC,n),a=gX(yC,n),u=g0(yC,n);return{URI:w6,_E:void 0,map:wZ,compact:r.compact,separate:r.separate,filter:function(t,n){return n3(t,i(n))},filterMap:function(t,n){return n3(t,o(n))},partition:function(t,n){return n3(t,a(n))},partitionMap:function(t,n){return n3(t,u(n))}}},getOrElse:wV,getOrElseW:wV,getReaderValidation:function(t){var n=Ie(t),r=It(t);return{URI:w6,_E:void 0,map:wZ,ap:n.ap,of:wF,chain:wX,bimap:wQ,mapLeft:wH,alt:r.alt,throwError:wP}},getSemigroup:IL,left:wP,leftReader:wU,local:ys,map:w1,mapLeft:w4,match:wW,matchE:wB,matchEW:wB,matchW:wW,of:wF,orElse:wK,orElseFirst:wY,orElseFirstW:wY,orElseW:wK,orLeft:wq,readerEither:{URI:w6,bimap:wQ,mapLeft:wH,map:wZ,of:wF,ap:wJ,chain:wX,alt:w0,throwError:wP},right:wF,rightReader:wz,sequenceArray:IR,swap:wG,throwError:wP,toUnion:w$,traverseArray:IE,traverseArrayWithIndex:Ij,traverseReadonlyArrayWithIndex:Ij,traverseReadonlyNonEmptyArrayWithIndex:IN},Symbol.toStringTag,{value:"Module"}));function IF(t){return function(n){return function(){return t.of(n)}}}function Iz(t){return function(n){return function(r){return function(i){return t.map(r(i),n)}}}}function IU(t){return function(n){return function(r){return function(i){return t.ap(r(i),n(i))}}}}function IW(t){return function(n){return function(r){return function(i){return t.chain(r(i),function(t){return n(t)(i)})}}}}function IB(t){return function(n){return nX(n,t.of)}}let IV=Object.freeze(Object.defineProperty({__proto__:null,ap:IU,chain:IW,fromNaturalTransformation:function(t){return function(n){return nX(n,t)}},fromReader:IB,getReaderM:function(t){var n=IU(t),r=Iz(t),i=IW(t);return{map:function(t,n){return n3(t,r(n))},ap:function(t,r){return n3(t,n(r))},of:IF(t),chain:function(t,n){return n3(t,i(n))},ask:function(){return t.of},asks:function(n){return nX(n,t.of)},local:function(t,n){return function(r){return t(n(r))}},fromReader:IB(t),fromM:function(t){return function(){return t}}}},map:Iz,of:IF},Symbol.toStringTag,{value:"Module"}));var I$=function(t){return function(){return Promise.resolve().then(t)}},IK=function(t,n){return n3(t,IZ(n))},IY=function(t,n){return n3(t,IQ(n))},Iq=function(t,n){return n3(t,IJ(function(t){return n3(n,IZ(t))}))},IG=function(t,n){return n3(t,IJ(n))},IZ=function(t){return function(n){return function(){return Promise.resolve().then(n).then(t)}}},IQ=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])})}}},IH=function(t){return function(){return Promise.resolve(t)}},IJ=function(t){return function(n){return function(){return Promise.resolve().then(n).then(function(n){return t(n)()})}}},IX=IJ(nq),I0="Task",I1={URI:I0,map:IK},I2=r_(I1),I4={URI:I0,of:IH},I3={URI:I0,map:IK,ap:IY},I5=rg(I3),I9=ry(I3),I8={URI:I0,map:IK,ap:IY,of:IH},I6={URI:I0,map:IK,ap:Iq},I7={URI:I0,map:IK,ap:Iq,of:IH},_e={URI:I0,map:IK,ap:IY,chain:IG},_t={URI:I0,map:IK,of:IH,ap:IY,chain:IG},_n=rR(_e),_r={URI:I0,fromIO:I$},_i=yr(_r),_o=yi(_r,_e),_a=yo(_r,_e),_u=function(){return new Promise(function(t){})},_s=IH(rf),_c=rO(I1),_l=rD(_e),_d=rv(I3),_f=IH(rd),_p=function(t){return function(n){return function(){return Promise.all(n.map(function(n,r){return Promise.resolve().then(function(){return t(r,n)()})}))}}},_h=function(t){var n=_p(t);return function(t){return rs(t)?n(t):_f}},_m=function(t){return function(n){return function(){return rl(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,rc(n))).then(ru))}}},_g=function(t){var n=_m(t);return function(t){return rs(t)?n(t):_f}},_y=function(t){return _h(function(n,r){return t(r)})},_v=_y(nq),_b=function(t){return _g(function(n,r){return t(r)})},_x=_b(nq),_M=rb(I6),_T=rN(I7);let _S=Object.freeze(Object.defineProperty({__proto__:null,ApT:_f,ApplicativePar:I8,ApplicativeSeq:I7,ApplyPar:I3,ApplySeq:I6,Chain:_e,Do:_s,FromIO:_r,FromTask:{URI:I0,fromIO:I$,fromTask:nq},Functor:I1,Monad:_t,MonadIO:{URI:I0,map:IK,of:IH,ap:IY,chain:IG,fromIO:I$},MonadTask:{URI:I0,map:IK,of:IH,ap:IY,chain:IG,fromIO:I$,fromTask:nq},Pointed:I4,URI:I0,ap:IQ,apFirst:I5,apS:_d,apSecond:I9,bind:_l,bindTo:_c,chain:IJ,chainFirst:_n,chainFirstIOK:_a,chainIOK:_o,delay:function(t){return function(n){return function(){return new Promise(function(r){setTimeout(function(){Promise.resolve().then(n).then(r)},t)})}}},flap:I2,flatten:IX,fromIO:I$,fromIOK:_i,fromTask:nq,getMonoid:_T,getRaceMonoid:function(){return{concat:function(t,n){return function(){return Promise.race([Promise.resolve().then(t),Promise.resolve().then(n)])}},empty:_u}},getSemigroup:_M,map:IZ,never:_u,of:IH,sequenceArray:_v,sequenceSeqArray:_x,task:{URI:I0,map:IK,of:IH,ap:IY,chain:IG,fromIO:I$,fromTask:nq},taskSeq:{URI:I0,map:IK,of:IH,ap:Iq,chain:IG,fromIO:I$,fromTask:nq},traverseArray:_y,traverseArrayWithIndex:_h,traverseReadonlyArrayWithIndex:_h,traverseReadonlyArrayWithIndexSeq:_g,traverseReadonlyNonEmptyArrayWithIndex:_p,traverseReadonlyNonEmptyArrayWithIndexSeq:_m,traverseSeqArray:_b,traverseSeqArrayWithIndex:_g},Symbol.toStringTag,{value:"Module"}));var _w=IB(I4),_I=nX(I$,nG),__=function(t,n){return n3(t,_N(n))},_O=function(t,n){return n3(t,_j(n))},_k=function(t,n){return n3(t,_R(function(t){return n3(n,_N(t))}))},_C=function(t,n){return n3(t,_R(n))},_N=Iz(I1),_j=IU(I3),_E=IF(I4),_R=IW(_t),_D=_R(nq),_A="ReaderTask",_L={URI:_A,map:__},_P=r_(_L),_F={URI:_A,of:_E},_z={URI:_A,map:__,ap:_O},_U=rg(_z),_W=ry(_z),_B={URI:_A,map:__,ap:_k},_V={URI:_A,map:__,ap:_k,of:_E},_$={URI:_A,map:__,ap:_O,chain:_C},_K={URI:_A,map:__,of:_E,ap:_O,chain:_C},_Y=rR(_$),_q={URI:_A,fromIO:_I},_G=yr(_q),_Z=yi(_q,_$),_Q=yo(_q,_$),_H={URI:_A,fromReader:_w},_J=yH(_H),_X=yJ(_H),_0=yX(_H),_1=y0(_H,_$),_2=y1(_H,_$),_4={URI:_A,fromIO:_I,fromTask:nG},_3=vR(_4),_5=vD(_4,_$),_9=vA(_4,_$),_8=_E(rf),_6=rO(_L),_7=rD(_$),Oe=rv(_z),Ot=_E(rd),On=function(t){return nX(y$(t),ym(_p(n5)))},Or=function(t){var n=On(t);return function(t){return rs(t)?n(t):Ot}},Oi=function(t){return nX(y$(t),ym(_m(n5)))},Oo=function(t){var n=Oi(t);return function(t){return rs(t)?n(t):Ot}},Oa=function(t){return Or(function(n,r){return t(r)})},Ou=Oa(nq),Os=function(t){return Oo(function(n,r){return t(r)})},Oc=Os(nq),Ol=rb(_B),Od=rN(_V);function Of(t,n){return t(n)()}let Op=Object.freeze(Object.defineProperty({__proto__:null,ApT:Ot,ApplicativePar:{URI:_A,map:__,ap:_O,of:_E},ApplicativeSeq:_V,ApplyPar:_z,ApplySeq:_B,Chain:_$,Do:_8,FromIO:_q,FromReader:_H,FromTask:_4,Functor:_L,Monad:_K,MonadIO:{URI:_A,map:__,of:_E,ap:_O,chain:_C,fromIO:_I},MonadTask:{URI:_A,map:__,of:_E,ap:_O,chain:_C,fromIO:_I,fromTask:nG},Pointed:_F,URI:_A,ap:_j,apFirst:_U,apS:Oe,apSW:Oe,apSecond:_W,apW:_j,ask:_J,asks:_X,asksReaderTask:yc,asksReaderTaskW:yc,bind:_7,bindTo:_6,bindW:_7,chain:_R,chainFirst:_Y,chainFirstIOK:_Q,chainFirstReaderK:_2,chainFirstReaderKW:_2,chainFirstTaskK:_9,chainFirstW:_Y,chainIOK:_Z,chainReaderK:_1,chainReaderKW:_1,chainTaskK:_5,chainW:_R,flap:_P,flatten:_D,flattenW:_D,fromIO:_I,fromIOK:_G,fromReader:_w,fromReaderK:_0,fromTask:nG,fromTaskK:_3,getMonoid:Od,getSemigroup:Ol,local:ys,map:_N,of:_E,readerTask:{URI:_A,map:__,of:_E,ap:_O,chain:_C,fromIO:_I,fromTask:nG},readerTaskSeq:{URI:_A,map:__,of:_E,ap:_k,chain:_C,fromIO:_I,fromTask:nG},run:Of,sequenceArray:Ou,sequenceSeqArray:Oc,traverseArray:Oa,traverseArrayWithIndex:Or,traverseReadonlyArrayWithIndex:Or,traverseReadonlyArrayWithIndexSeq:Oo,traverseReadonlyNonEmptyArrayWithIndex:On,traverseReadonlyNonEmptyArrayWithIndexSeq:Oi,traverseSeqArray:Os,traverseSeqArrayWithIndex:Oo},Symbol.toStringTag,{value:"Module"}));var Oh=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())})},Om=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])}}},Og=gS(I4),Oy=gT(I4),Ov=gw(I1),Ob=gI(I1),Ox=nX(I$,Ov),OM=nX(I$,Ob),OT=function(t){return IZ(mG(t))},OS=gL(I1),Ow=gP(_t),OI=gF(_t),O_=function(t,n){return function(){return Oh(void 0,void 0,void 0,function(){var r;return Om(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t().then(ra)];case 1:return[2,r.sent()];case 2:return[2,ro(n(r.sent()))];case 3:return[2]}})})}},OO=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return O_(function(){return t.apply(void 0,r)},n)}},Ok=gV(I1),OC=g_(I4),ON=gO(I4),Oj=gk(_t),OE=gz(_t),OR=gU(_t),OD=function(t){return OR(kg(t))},OA=function(t){return OR(kx(t))},OL=gW(_t),OP=gB(I1),OF=function(t){var n=OT(t);return function(t){return nX(t,n)}},Oz=function(t){return function(n){return function(r){return n3(r,OX(OF(t)(n)))}}},OU=function(t){return nX(t,I$)},OW=function(t){return O0(OU(t))},OB=function(t,n){return n3(t,OZ(n))},OV=function(t,n){return n3(t,OJ(n))},O$=function(t,n){return n3(t,OX(function(t){return n3(n,OZ(t))}))},OK=function(t,n){return n3(t,OX(n))},OY=function(t,n,r){return n3(t,OQ(n,r))},Oq=function(t,n){return n3(t,OH(n))},OG=function(t,n){return n3(t,O2(n))},OZ=gC(I1),OQ=gR(I1),OH=gD(I1),OJ=gN(I3),OX=gj(_t),O0=OX,O1=O0(nq),O2=gE(_t),O4="TaskEither";function O3(t,n){var r=rm(t,mS(n));return{URI:O4,_E:void 0,map:OB,ap:function(t,n){return n3(t,r(n))},of:Oy}}function O5(t){var n=gA(_t,t);return{URI:O4,_E:void 0,map:OB,alt:function(t,r){return n3(t,n(r))}}}var O9=function(t){var n=mx(t);return{URI:O4,_E:void 0,compact:hW(I1,n),separate:hB(I1,n,m_)}},O8={URI:O4,map:OB},O6=r_(O8),O7={URI:O4,map:OB,ap:OV},ke=rg(O7),kt=ry(O7),kn={URI:O4,map:OB,ap:O$},kr={URI:O4,map:OB,ap:O$,of:Oy},ki={URI:O4,map:OB,ap:OV,chain:OK},ko=rR(ki),ka={URI:O4,fromEither:IH},ku=rL(ka),ks=rF(ka),kc=rz(ka,ki),kl=rW(ka,ki),kd=rB(ka,ki),kf=rP(ka),kp=rV(ka,ki),kh=rU(ka),km={URI:O4,fromIO:Ox},kg=yr(km),ky=yi(km,ki),kv=yo(km,ki),kb={URI:O4,fromIO:Ox,fromTask:Ov},kx=vR(kb),kM=vD(kb,ki),kT=vA(kb,ki),kS=function(t,n,r){return kw(t,n,r)},kw=function(t,n,r){return n3(t,O0(function(t){return n3(n(t),IJ(function(n){return n3(r(t,n),O0(function(){return IH(n)}))}))}))},kI=Oy(rf),k_=rO(O8),kO=rD(ki),kk=rv(O7),kC=Oy(rd),kN=function(t){return nX(_p(t),IZ(gf(n5)))},kj=function(t){var n=kN(t);return function(t){return rs(t)?n(t):kC}},kE=function(t){return function(n){return function(){return rl(n).reduce(function(n,r,i){return n.then(function(o){return rr(o)?n:t(i+1,r)().then(function(t){return rr(t)?t:(o.right.push(t.right),o)})})},t(0,rc(n))().then(mI(ru)))}}},kR=function(t){var n=kE(t);return function(t){return rs(t)?n(t):kC}},kD=function(t){return kj(function(n,r){return t(r)})},kA=kD(nq),kL=function(t){return kR(function(n,r){return t(r)})},kP=kL(nq),kF=rb(kn),kz=rN(kr),kU=function(t){return rb(I6)(mb(t))};let kW=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:O4,map:OB,alt:OG},ApT:kC,ApplicativePar:{URI:O4,map:OB,ap:OV,of:Oy},ApplicativeSeq:kr,ApplyPar:O7,ApplySeq:kn,Bifunctor:{URI:O4,bimap:OY,mapLeft:Oq},Chain:ki,Do:kI,FromEither:ka,FromIO:km,FromTask:kb,Functor:O8,Monad:{URI:O4,map:OB,ap:OV,chain:OK,of:Oy},MonadIO:{URI:O4,map:OB,ap:OV,chain:OK,of:Oy,fromIO:Ox},MonadTask:{URI:O4,map:OB,ap:OV,chain:OK,of:Oy,fromIO:Ox,fromTask:Ov},MonadThrow:{URI:O4,map:OB,ap:OV,chain:OK,of:Oy,throwError:Og},Pointed:{URI:O4,of:Oy},URI:O4,alt:O2,altW:O2,ap:OJ,apFirst:ke,apFirstW:ke,apS:kk,apSW:kk,apSecond:kt,apSecondW:kt,apW:OJ,bimap:OQ,bind:kO,bindTo:k_,bindW:kO,bracket:kS,bracketW:kw,chain:OX,chainEitherK:kl,chainEitherKW:kl,chainFirst:ko,chainFirstEitherK:kd,chainFirstEitherKW:kd,chainFirstIOK:kv,chainFirstTaskK:kT,chainFirstW:ko,chainIOEitherK:OW,chainIOEitherKW:OW,chainIOK:ky,chainNullableK:Oj,chainOptionK:kc,chainTaskK:kM,chainTaskOptionK:Oz,chainTaskOptionKW:Oz,chainW:O0,filterOrElse:kp,filterOrElseW:kp,flap:O6,flatten:O1,flattenW:O1,fold:Ow,foldW:Ow,fromEither:IH,fromEitherK:kh,fromIO:Ox,fromIOEither:I$,fromIOEitherK:OU,fromIOK:kg,fromNullable:OC,fromNullableK:ON,fromOption:ku,fromOptionK:ks,fromPredicate:kf,fromTask:Ov,fromTaskK:kx,fromTaskOption:OT,fromTaskOptionK:OF,getAltTaskValidation:O5,getApplicativeTaskValidation:O3,getApplyMonoid:kz,getApplySemigroup:kF,getCompactable:O9,getFilterable:function(t){var n=mM(t),r=O9(t),i=gH(I1,n),o=gJ(I1,n),a=gX(I1,n),u=g0(I1,n);return{URI:O4,_E:void 0,map:OB,compact:r.compact,separate:r.separate,filter:function(t,n){return n3(t,i(n))},filterMap:function(t,n){return n3(t,o(n))},partition:function(t,n){return n3(t,a(n))},partitionMap:function(t,n){return n3(t,u(n))}}},getOrElse:OI,getOrElseW:OI,getSemigroup:kU,getTaskValidation:function(t){var n=O3(I8,t),r=O5(t);return{URI:O4,_E:void 0,map:OB,ap:n.ap,of:Oy,chain:OK,bimap:OY,mapLeft:Oq,alt:r.alt,fromIO:Ox,fromTask:Ov,throwError:Og}},left:Og,leftIO:OM,leftTask:Ob,map:OZ,mapLeft:OH,match:OS,matchE:Ow,matchEW:Ow,matchW:OS,of:Oy,orElse:OE,orElseFirst:OR,orElseFirstIOK:OD,orElseFirstTaskK:OA,orElseFirstW:OR,orElseW:OE,orLeft:OL,right:Oy,rightIO:Ox,rightTask:Ov,sequenceArray:kA,sequenceSeqArray:kP,swap:OP,taskEither:{URI:O4,bimap:OY,mapLeft:Oq,map:OB,of:Oy,ap:OV,chain:OK,alt:OG,fromIO:Ox,fromTask:Ov,throwError:Og},taskEitherSeq:{URI:O4,bimap:OY,mapLeft:Oq,map:OB,of:Oy,ap:O$,chain:OK,alt:OG,fromIO:Ox,fromTask:Ov,throwError:Og},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(ro(t)):r(ra(n))};t.apply(null,n.concat(i))})}}},throwError:Og,toUnion:Ok,traverseArray:kD,traverseArrayWithIndex:kj,traverseReadonlyArrayWithIndex:kj,traverseReadonlyArrayWithIndexSeq:kR,traverseReadonlyNonEmptyArrayWithIndex:kN,traverseReadonlyNonEmptyArrayWithIndexSeq:kE,traverseSeqArray:kL,traverseSeqArrayWithIndex:kR,tryCatch:O_,tryCatchK:OO},Symbol.toStringTag,{value:"Module"}));var kB=gS(_F),kV=gT(_F),k$=nX(Ov,nG),kK=nX(Ob,nG),kY=function(t){return nX(t,Oy)},kq=function(t){return nX(t,Og)},kG=gw(_L),kZ=gI(_L),kQ=nX(Ox,nG),kH=nX(OM,nG),kJ=nX(I$,nG),kX=function(t){return nX(t,IH)},k0=gL(_L),k1=gP(_$),k2=gF(_K),k4=gV(_L),k3=g_(_F),k5=gO(_F),k9=gk(_K),k8=gz(_K),k6=gU(_K),k7=gW(_K),Ce=gB(_L),Ct=function(t){return nX(t,kJ)},Cn=function(t){return CM(Ct(t))},Cr=function(t){return nX(t,nG)},Ci=function(t){return CM(Cr(t))},Co=function(t){return CF(Cr(t))},Ca=function(t){return nX(t,kX)},Cu=function(t){return CM(Ca(t))},Cs=function(t){return CF(Ca(t))},Cc=function(t,n){return n3(t,Cg(n))},Cl=function(t,n){return n3(t,Cb(n))},Cd=function(t,n){return n3(t,Cx(function(t){return n3(n,Cg(t))}))},Cf=function(t,n){return n3(t,Cx(n))},Cp=function(t,n){return n3(t,CS(n))},Ch=function(t,n,r){return n3(t,Cy(n,r))},Cm=function(t,n){return n3(t,Cv(n))},Cg=gC(_L),Cy=gR(_L),Cv=gD(_L),Cb=gN(_z),Cx=gj(_K),CM=Cx,CT=CM(nq),CS=gE(_K),Cw="ReaderTaskEither",CI=function(t){var n=mx(t);return{URI:Cw,_E:void 0,compact:hW(_L,n),separate:hB(_L,n,m_)}};function C_(t,n){var r=rm(yE,O3(t,n));return{URI:Cw,_E:void 0,map:Cc,ap:function(t,n){return n3(t,r(n))},of:kV}}function CO(t){var n=gA(_K,t);return{URI:Cw,_E:void 0,map:Cc,alt:function(t,r){return n3(t,n(r))}}}var Ck={URI:Cw,map:Cc},CC=r_(Ck),CN={URI:Cw,of:kV},Cj={URI:Cw,map:Cc,ap:Cl},CE=rg(Cj),CR=ry(Cj),CD={URI:Cw,map:Cc,ap:Cd},CA={URI:Cw,map:Cc,ap:Cd,of:kV},CL={URI:Cw,map:Cc,ap:Cl,chain:Cf},CP=rR(CL),CF=CP,Cz={URI:Cw,fromReader:kY},CU=yH(Cz),CW=yJ(Cz),CB=yX(Cz),CV=y0(Cz,CL),C$=y1(Cz,CL),CK=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return kG(t.apply(void 0,n))}},CY=function(t){return CM(CK(t))},Cq=function(t){return CF(CK(t))},CG={URI:Cw,fromEither:_E},CZ=rL(CG),CQ=rF(CG),CH=rz(CG,CL),CJ=rW(CG,CL),CX=rB(CG,CL),C0=rP(CG),C1=rV(CG,CL),C2=rU(CG),C4={URI:Cw,fromIO:kQ},C3=yr(C4),C5=yi(C4,CL),C9=yo(C4,CL),C8={URI:Cw,fromIO:kQ,fromTask:k$},C6=vR(C8),C7=vD(C8,CL),Ne=vA(C8,CL);function Nt(t,n,r){return Nn(t,n,r)}function Nn(t,n,r){return function(i){return kw(t(i),function(t){return n(t)(i)},function(t,n){return r(t,n)(i)})}}var Nr=kV(rf),Ni=rO(Ck),No=rD(CL),Na=rv(Cj),Nu=kV(rd),Ns=function(t){return nX(y$(t),ym(kN(n5)))},Nc=function(t){var n=Ns(t);return function(t){return rs(t)?n(t):Nu}},Nl=function(t){return nX(y$(t),ym(kE(n5)))},Nd=function(t){var n=Nl(t);return function(t){return rs(t)?n(t):Nu}},Nf=function(t){return Nc(function(n,r){return t(r)})},Np=Nf(nq),Nh=function(t){return Nd(function(n,r){return t(r)})},Nm=Nh(nq),Ng=rb(CD),Ny=rN(CA),Nv=function(t){return rb(_B)(mb(t))};function Nb(t,n){return t(n)()}let Nx=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Cw,map:Cc,alt:Cp},ApT:Nu,ApplicativePar:{URI:Cw,map:Cc,ap:Cl,of:kV},ApplicativeSeq:CA,ApplyPar:Cj,ApplySeq:CD,Bifunctor:{URI:Cw,bimap:Ch,mapLeft:Cm},Chain:CL,Do:Nr,FromEither:CG,FromIO:C4,FromReader:Cz,FromTask:C8,Functor:Ck,Monad:{URI:Cw,map:Cc,ap:Cl,chain:Cf,of:kV},MonadIO:{URI:Cw,map:Cc,ap:Cl,chain:Cf,of:kV,fromIO:kQ},MonadTask:{URI:Cw,map:Cc,ap:Cl,chain:Cf,of:kV,fromIO:kQ,fromTask:k$},MonadThrow:{URI:Cw,map:Cc,ap:Cl,chain:Cf,of:kV,throwError:kB},Pointed:CN,URI:Cw,alt:CS,altW:CS,ap:Cb,apFirst:CE,apFirstW:CE,apS:Na,apSW:Na,apSecond:CR,apSecondW:CR,apW:Cb,ask:CU,asks:CW,asksReaderTaskEither:yc,asksReaderTaskEitherW:yc,bimap:Cy,bind:No,bindTo:Ni,bindW:No,bracket:Nt,bracketW:Nn,chain:Cx,chainEitherK:CJ,chainEitherKW:CJ,chainFirst:CP,chainFirstEitherK:CX,chainFirstEitherKW:CX,chainFirstIOK:C9,chainFirstReaderEitherK:Cs,chainFirstReaderEitherKW:Cs,chainFirstReaderK:C$,chainFirstReaderKW:C$,chainFirstReaderTaskK:Cq,chainFirstReaderTaskKW:Cq,chainFirstTaskEitherK:Co,chainFirstTaskEitherKW:Co,chainFirstTaskK:Ne,chainFirstW:CF,chainIOEitherK:Cn,chainIOEitherKW:Cn,chainIOK:C5,chainNullableK:k9,chainOptionK:CH,chainReaderEitherK:Cu,chainReaderEitherKW:Cu,chainReaderK:CV,chainReaderKW:CV,chainReaderTaskK:CY,chainReaderTaskKW:CY,chainTaskEitherK:Ci,chainTaskEitherKW:Ci,chainTaskK:C7,chainW:CM,filterOrElse:C1,filterOrElseW:C1,flap:CC,flatten:CT,flattenW:CT,fold:k1,foldW:k1,fromEither:_E,fromEitherK:C2,fromIO:kQ,fromIOEither:kJ,fromIOEitherK:Ct,fromIOK:C3,fromNullable:k3,fromNullableK:k5,fromOption:CZ,fromOptionK:CQ,fromPredicate:C0,fromReader:kY,fromReaderEither:kX,fromReaderEitherK:Ca,fromReaderK:CB,fromReaderTaskK:CK,fromTask:k$,fromTaskEither:nG,fromTaskEitherK:Cr,fromTaskK:C6,getAltReaderTaskValidation:CO,getApplicativeReaderTaskValidation:C_,getApplyMonoid:Ny,getApplySemigroup:Ng,getCompactable:CI,getFilterable:function(t){var n=mM(t),r=CI(t),i=gH(_L,n),o=gJ(_L,n),a=gX(_L,n),u=g0(_L,n);return{URI:Cw,_E:void 0,map:Cc,compact:r.compact,separate:r.separate,filter:function(t,n){return n3(t,i(n))},filterMap:function(t,n){return n3(t,o(n))},partition:function(t,n){return n3(t,a(n))},partitionMap:function(t,n){return n3(t,u(n))}}},getOrElse:k2,getOrElseW:k2,getReaderTaskValidation:function(t){var n=C_(I8,t),r=CO(t);return{URI:Cw,_E:void 0,map:Cc,of:kV,chain:Cf,bimap:Ch,mapLeft:Cm,ap:n.ap,alt:r.alt,fromIO:kQ,fromTask:k$,throwError:kB}},getSemigroup:Nv,left:kB,leftIO:kH,leftReader:kq,leftReaderTask:kZ,leftTask:kK,local:ys,map:Cg,mapLeft:Cv,match:k0,matchE:k1,matchEW:k1,matchW:k0,of:kV,orElse:k8,orElseFirst:k6,orElseFirstW:k6,orElseW:k8,orLeft:k7,readerTaskEither:{URI:Cw,map:Cc,of:kV,ap:Cl,chain:Cf,alt:Cp,bimap:Ch,mapLeft:Cm,fromIO:kQ,fromTask:k$,throwError:kB},readerTaskEitherSeq:{URI:Cw,map:Cc,of:kV,ap:Cd,chain:Cf,alt:Cp,bimap:Ch,mapLeft:Cm,fromIO:kQ,fromTask:k$,throwError:kB},right:kV,rightIO:kQ,rightReader:kY,rightReaderTask:kG,rightTask:k$,run:Nb,sequenceArray:Np,sequenceSeqArray:Nm,swap:Ce,throwError:kB,toUnion:k4,traverseArray:Nf,traverseArrayWithIndex:Nc,traverseReadonlyArrayWithIndex:Nc,traverseReadonlyArrayWithIndexSeq:Nd,traverseReadonlyNonEmptyArrayWithIndex:Ns,traverseReadonlyNonEmptyArrayWithIndexSeq:Nl,traverseSeqArray:Nh,traverseSeqArrayWithIndex:Nd},Symbol.toStringTag,{value:"Module"}));var NM={equals:function(t,n){return t===n}},NT={concat:function(t,n){return t+n}},NS={concat:NT.concat,empty:""},Nw={equals:NM.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},NI=function(t){return"string"==typeof t},N_=function(t){return t.toUpperCase()},NO=function(t){return t.toLowerCase()},Nk=function(t,n){return function(r){return r.replace(t,n)}},NC=function(t){return t.trim()},NN=function(t){return t.trimLeft()},Nj=function(t){return t.trimRight()},NE=function(t,n){return function(r){return r.slice(t,n)}},NR=function(t){return 0===t.length},ND=function(t){return t.length},NA=function(t){return function(n){var r=n.split(t);return rs(r)?r:[n]}},NL=function(t,n){return function(r){return r.includes(t,n)}},NP=function(t,n){return function(r){return r.startsWith(t,n)}},NF=function(t,n){return function(r){return r.endsWith(t,n)}};let Nz=Object.freeze(Object.defineProperty({__proto__:null,Eq:NM,Monoid:NS,Ord:Nw,Semigroup:NT,Show:{show:function(t){return JSON.stringify(t)}},empty:"",endsWith:NF,includes:NL,isEmpty:NR,isString:NI,replace:Nk,size:ND,slice:NE,split:NA,startsWith:NP,toLowerCase:NO,toUpperCase:N_,trim:NC,trimLeft:NN,trimRight:Nj},Symbol.toStringTag,{value:"Module"}));var NU=function(t){return Object.assign({},t)},NW=function(t){return Object.assign({},t)},NB=function(t){return Object.keys(t).length},NV=function(t){for(var n in t)if(rp.call(t,n))return!1;return!0},N$=function(t){return function(n){return Object.keys(n).sort(t.compare)}},NK=N$(Nw);function NY(t){if("function"==typeof t)return NY(Nw)(t);var n=N$(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 Nq=NY(Nw)(function(t,n){return[t,n]}),NG=function(t,n){return function(r){if(rp.call(r,t)&&r[t]===n)return r;var i=Object.assign({},r);return i[t]=n,i}},NZ=function(t,n){return rp.call(n,t)};function NQ(t){return function(n){if(!rp.call(n,t))return n;var r=Object.assign({},n);return delete r[t],r}}var NH=function(t,n){return function(r){if(!NZ(t,r))return rt;if(r[t]===n)return rn(r);var i=Object.assign({},r);return i[t]=n,rn(i)}},NJ=function(t,n){return function(r){if(!NZ(t,r))return rt;var i=n(r[t]);if(i===r[t])return rn(r);var o=Object.assign({},r);return o[t]=i,rn(o)}};function NX(t){return function(n,r){if(void 0===r){var i=NX(t);return function(t){return i(t,n)}}for(var o in n)if(!rp.call(r,o)||!t.equals(n[o],r[o]))return!1;return!0}}function N0(t,n){return void 0===n?function(n){return N0(t,n)}:rp.call(n,t)?rn(n[t]):rt}var N1={};function N2(t){return function(n){var r={};for(var i in n)rp.call(n,i)&&(r[i]=t(i,n[i]));return r}}function N4(t){return N2(function(n,r){return t(r)})}function N3(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(2===t.length)return N3(Nw).apply(void 0,t);var r=N$(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 N5(t){if("compare"in t){var n=N$(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 N5(Nw)(t)}function N9(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(2===t.length)return N9(Nw).apply(void 0,t);var r=N$(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 N8=function(t,n){var r;return(r={})[t]=n,r};function N6(t){var n=jD(Nw)(t);return function(t){return function(r){return n(r,t)}}}function N7(t){var n=jE(Nw)(t);return function(t){return function(r){return n(r,t)}}}function je(t){return jR(Nw)(t)}var jt=function(t){var n=N7(t);return function(r){return function(i){return t.map(n3(i,n(r)),jB)}}},jn=function(t){var n=N7(t);return function(r){return function(i){return t.map(n3(i,n(r)),jV)}}};function jr(t){return function(n){var r={},i={};for(var o in n)if(rp.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 uX(r,i)}}function ji(t){return function(n){var r={},i={};for(var o in n)if(rp.call(n,o)){var a=n[o];t(o,a)?i[o]=a:r[o]=a}return uX(r,i)}}function jo(t){return function(n){var r={};for(var i in n)if(rp.call(n,i)){var o=t(i,n[i]);re(o)&&(r[i]=o.value)}return r}}function ja(t){return function(n){var r={},i=!1;for(var o in n)if(rp.call(n,o)){var a=n[o];t(o,a)?r[o]=a:i=!0}return i?r:n}}function ju(t,n){var r=js(t,n);return function(t){return r(t,nq)}}function js(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]=rp.call(n,a)?t.concat(n[a],u):u,n})}}var jc=function(t){for(var n={},r=0;r<t.length;r++){var i=t[r];n[i[0]]=i[1]}return n};function jl(t){return function(n){for(var r in n)if(!t(n[r]))return!1;return!0}}function jd(t){return function(n){for(var r in n)if(t(n[r]))return!0;return!1}}function jf(t){return function(n,r){if(void 0===r){var i=jf(t);return function(t){return i(n,t)}}for(var o in r)if(t.equals(r[o],n))return!0;return!1}}var jp=function(t){return function(n){return function(r){if(NV(r))return n;if(NV(n))return r;var i={};for(var o in r)NZ(o,n)?i[o]=t.concat(r[o],n[o]):i[o]=r[o];for(var o in n)NZ(o,i)||(i[o]=n[o]);return i}}},jh=function(t){return function(n){return function(r){if(NV(r)||NV(n))return N1;var i={};for(var o in r)NZ(o,n)&&(i[o]=t.concat(r[o],n[o]));return i}}},jm=function(t){return function(n){if(NV(n))return t;if(NV(t))return n;var r={};for(var i in n)NZ(i,t)||(r[i]=n[i]);for(var i in t)NZ(i,n)||(r[i]=t[i]);return r}},jg=function(t,n){return n3(t,N4(n))},jy=function(t,n){return n3(t,N2(n))},jv=function(t){var n=jz(t);return function(t,r,i){return n3(t,n(r,i))}},jb=function(t){return function(n){var r=jU(t)(n);return function(t,n){return n3(t,r(n))}}},jx=function(t){var n=jW(t);return function(t,r,i){return n3(t,n(r,i))}},jM=function(t,n){return n3(t,jA(n))},jT=function(t,n){return n3(t,jL(n))},jS=function(t,n){return n3(t,jP(n))},jw=function(t,n){return n3(t,jF(n))},jI=function(t){var n=N3(t);return function(t,r,i){return n3(t,n(r,i))}},j_=function(t){var n=N5(t);return function(t){var r=n(t);return function(t,n){return n3(t,r(n))}}},jO=function(t){var n=N9(t);return function(t,r,i){return n3(t,n(r,i))}},jk=function(t,n){return n3(t,jr(n))},jC=function(t,n){return n3(t,ji(n))},jN=function(t,n){return n3(t,jo(n))},jj=function(t,n){return n3(t,ja(n))},jE=function(t){var n=jD(t);return function(t){var r=n(t);return function(t,n){return r(t,nX(n5,n))}}},jR=function(t){var n=jE(t);return function(t){var r=n(t);return function(t){return r(t,nq)}}},jD=function(t){return function(n){var r=N$(t);return function(t,i){var o=r(t);if(0===o.length)return n.of(N1);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}}},jA=function(t){return ja(function(n,r){return t(r)})},jL=function(t){return jo(function(n,r){return t(r)})},jP=function(t){return ji(function(n,r){return t(r)})},jF=function(t){return jr(function(n,r){return t(r)})};function jz(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(1===t.length){var r=N3(t[0]);return function(t,n){return r(t,function(t,r,i){return n(r,i)})}}return jz(Nw).apply(void 0,t)}function jU(t){if("compare"in t){var n=N5(t);return function(t){var r=n(t);return function(t){return r(function(n,r){return t(r)})}}}return jU(Nw)(t)}function jW(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(1===t.length){var r=N9(t[0]);return function(t,n){return r(t,function(t,r,i){return n(r,i)})}}return jW(Nw).apply(void 0,t)}var jB=function(t){var n={};for(var r in t)if(rp.call(t,r)){var i=t[r];re(i)&&(n[r]=i.value)}return n},jV=function(t){var n={},r={};for(var i in t)if(rp.call(t,i)){var o=t[i];rr(o)?n[i]=o.left:r[i]=o.right}return uX(n,r)},j$="ReadonlyRecord";function jK(t){return"compare"in t?function(n){return{show:function(r){var i=NY(t)(function(t,r){return"".concat(JSON.stringify(t),": ").concat(n.show(r))})(r).join(", ");return""===i?"{}":"{ ".concat(i," }")}}}:jK(Nw)(t)}function jY(t){var n=NX(t);return rK(function(t,r){return n(t)(r)&&n(r)(t)})}function jq(t){return{concat:function(n,r){if(NV(n))return r;if(NV(r))return n;var i=Object.assign({},n);for(var o in r)rp.call(r,o)&&(i[o]=rp.call(n,o)?t.concat(n[o],r[o]):r[o]);return i},empty:N1}}var jG={URI:j$,map:jg},jZ=r_(jG),jQ=function(t){return{URI:j$,reduce:jv(t),foldMap:jb(t),reduceRight:jx(t)}},jH=function(t){return{URI:j$,reduce:jv(t),foldMap:jb(t),reduceRight:jx(t),reduceWithIndex:jI(t),foldMapWithIndex:j_(t),reduceRightWithIndex:jO(t)}},jJ={URI:j$,compact:jB,separate:jV},jX=function(t){return{URI:j$,map:jg,reduce:jv(t),foldMap:jb(t),reduceRight:jx(t),traverse:jE(t),sequence:jR(t)}},j0=function(t){return{URI:j$,map:jg,mapWithIndex:jy,reduce:jv(t),foldMap:jb(t),reduceRight:jx(t),reduceWithIndex:jI(t),foldMapWithIndex:j_(t),reduceRightWithIndex:jO(t),traverse:jE(t),sequence:jR(t),traverseWithIndex:jD(t)}},j1=function(t){var n=jX(t);return{URI:j$,map:jg,reduce:jv(t),foldMap:jb(t),reduceRight:jx(t),traverse:n.traverse,sequence:n.sequence,compact:jB,separate:jV,filter:jM,filterMap:jT,partition:jS,partitionMap:jw,wither:sn(n,jJ),wilt:st(n,jJ)}},j2=function(t){var n=jp(t);return{concat:function(t,r){return n(r)(t)}}},j4=function(t){return{concat:j2(t).concat,empty:N1}},j3=function(t){var n=jh(t);return{concat:function(t,r){return n(r)(t)}}},j5=function(){return{concat:function(t,n){return jm(n)(t)}}},j9={URI:j$,reduce:jv(Nw),foldMap:jb(Nw),reduceRight:jx(Nw)},j8={URI:j$,reduce:jv(Nw),foldMap:jb(Nw),reduceRight:jx(Nw),reduceWithIndex:jI(Nw),foldMapWithIndex:j_(Nw),reduceRightWithIndex:jO(Nw)},j6={URI:j$,map:jg,reduce:jv(Nw),foldMap:jb(Nw),reduceRight:jx(Nw),traverse:jE(Nw),sequence:je},j7={URI:j$,map:jg,mapWithIndex:jy,reduce:jv(Nw),foldMap:jb(Nw),reduceRight:jx(Nw),reduceWithIndex:jI(Nw),foldMapWithIndex:j_(Nw),reduceRightWithIndex:jO(Nw),traverse:jE(Nw),sequence:je,traverseWithIndex:jD(Nw)},Ee=sn(j6,jJ),Et=st(j6,jJ),En={URI:j$,map:jg,reduce:jv(Nw),foldMap:jb(Nw),reduceRight:jx(Nw),traverse:jE(Nw),sequence:je,compact:jB,separate:jV,filter:jM,filterMap:jT,partition:jS,partitionMap:jw,wither:Ee,wilt:Et};function Er(t,n){return rp.call(void 0===n?this:n,t)}var Ei={URI:j$,map:jg,reduce:jv(Nw),foldMap:jb(Nw),reduceRight:jx(Nw),traverse:jE(Nw),sequence:je,compact:jB,separate:jV,filter:jM,filterMap:jT,partition:jS,partitionMap:jw,mapWithIndex:jy,reduceWithIndex:jI(Nw),foldMapWithIndex:j_(Nw),reduceRightWithIndex:jO(Nw),filterMapWithIndex:jN,filterWithIndex:jj,partitionMapWithIndex:jk,partitionWithIndex:jC,traverseWithIndex:jD(Nw),wither:Ee,wilt:Et};let Eo=Object.freeze(Object.defineProperty({__proto__:null,Compactable:jJ,Filterable:{URI:j$,map:jg,compact:jB,separate:jV,filter:jM,filterMap:jT,partition:jS,partitionMap:jw},FilterableWithIndex:{URI:j$,map:jg,mapWithIndex:jy,compact:jB,separate:jV,filter:jM,filterMap:jT,partition:jS,partitionMap:jw,filterMapWithIndex:jN,filterWithIndex:jj,partitionMapWithIndex:jk,partitionWithIndex:jC},Foldable:j9,FoldableWithIndex:j8,Functor:jG,FunctorWithIndex:{URI:j$,map:jg,mapWithIndex:jy},Traversable:j6,TraversableWithIndex:j7,URI:j$,Witherable:En,_filter:jM,_filterMap:jT,_filterMapWithIndex:jN,_filterWithIndex:jj,_foldMap:jb,_foldMapWithIndex:j_,_map:jg,_mapWithIndex:jy,_partition:jS,_partitionMap:jw,_partitionMapWithIndex:jk,_partitionWithIndex:jC,_reduce:jv,_reduceRight:jx,_reduceRightWithIndex:jO,_reduceWithIndex:jI,_sequence:jR,_traverse:jE,collect:NY,compact:jB,deleteAt:NQ,difference:jm,elem:jf,empty:N1,every:jl,filter:jA,filterMap:jL,filterMapWithIndex:jo,filterWithIndex:ja,flap:jZ,foldMap:jU,foldMapWithIndex:N5,fromEntries:jc,fromFoldable:ju,fromFoldableMap:js,fromRecord:NU,getDifferenceMagma:j5,getEq:jY,getFoldable:jQ,getFoldableWithIndex:jH,getIntersectionSemigroup:j3,getMonoid:jq,getShow:jK,getTraversable:jX,getTraversableWithIndex:j0,getUnionMonoid:j4,getUnionSemigroup:j2,getWitherable:j1,has:NZ,hasOwnProperty:Er,insertAt:NG,intersection:jh,isEmpty:NV,isSubrecord:NX,keys:NK,lookup:N0,map:N4,mapWithIndex:N2,modifyAt:NJ,partition:jP,partitionMap:jF,partitionMapWithIndex:jr,partitionWithIndex:ji,pop:function(t){var n=NQ(t);return function(r){var i=N0(t,r);return n7(i)?rt:rn([i.value,n(r)])}},readonlyRecord:Ei,reduce:jz,reduceRight:jW,reduceRightWithIndex:N9,reduceWithIndex:N3,separate:jV,sequence:je,singleton:N8,size:NB,some:jd,toEntries:Nq,toReadonlyArray:Nq,toRecord:NW,toUnfoldable:function(t){return function(n){var r=Nq(n),i=r.length;return t.unfold(0,function(t){return t<i?rn([r[t],t+1]):rt})}},traverse:N7,traverseWithIndex:N6,union:jp,updateAt:NH,upsertAt:NG,wilt:jn,wither:jt},Symbol.toStringTag,{value:"Module"}));var Ea=function(t){return new Set(t)},Eu=function(t){return new Set([t])},Es=function(t){return function(n){for(var r=n.length,i=new Set,o=EO(t),a=0;a<r;a++){var u=n[a];o(u,i)||i.add(u)}return i}};function Ec(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 El(t){var n=EO(t);return function(r,i){if(void 0===i){var o=El(t);return function(t){return o(r,t)}}if(ET(r))return i;if(ET(i))return r;var a=new Set(r);return i.forEach(function(t){n(t,a)||a.add(t)}),a}}function Ed(t){var n=EO(t);return function(r,i){if(void 0===i){var o=Ed(t);return function(t){return o(t,r)}}if(ET(r)||ET(i))return EM;var a=new Set;return r.forEach(function(t){n(t,i)&&a.add(t)}),a}}function Ef(t){var n=EO(t);return function(r,i){if(void 0===i){var o=Ef(t);return function(t){return o(t,r)}}return Ec(function(t){return!n(t,i)})(r)}}function Ep(t){var n=Ek(t);return function(t,r){return function(i){return n(i).reduce(r,t)}}}function Eh(t,n){var r=Ek(t);return function(t){return function(i){return r(i).reduce(function(r,i){return n.concat(r,t(i))},n.empty)}}}var Em=function(t){var n=Ek(t);return function(t,r){return function(i){return n(i).reduceRight(function(t,n){return r(n,t)},t)}}};function Eg(t){var n=EO(t);return function(t){return function(r){if(n(t)(r))return r;var i=new Set(r);return i.add(t),i}}}var Ey=function(t){return function(n){return function(r){return Ec(function(r){return!t.equals(n,r)})(r)}}},Ev=function(t){var n=EO(t),r=Ey(t),i=Eg(t);return function(t){return function(o){return(n(t,o)?r:i)(t)(o)}}},Eb=function(t){return Ex(t)(nq)};function Ex(t){var n=EO(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 EM=new Set,ET=function(t){return 0===t.size},ES=function(t){return t.size},Ew=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 EI(t){return pl(Ew(pl(t)))}function E_(t){var n=EO(t);return function(r,i){if(void 0===i){var o=E_(t);return function(t){return o(t,r)}}return EI(function(t){return n(t,i)})(r)}}function EO(t){return function(n,r){if(void 0===r){var i=EO(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 Ek=function(t){return function(n){var r=[];return n.forEach(function(t){return r.push(t)}),r.sort(t.compare)}};function EC(t){return{show:function(n){var r=[];return n.forEach(function(n){r.push(t.show(n))}),"new Set([".concat(r.sort().join(", "),"])")}}}function EN(t){var n=E_(t);return rK(function(t,r){return n(t,r)&&n(r,t)})}var Ej=function(t){return{concat:El(t)}},EE=function(t){return{concat:Ej(t).concat,empty:EM}},ER=function(t){return{concat:Ed(t)}},ED=function(t){return{concat:Ef(t)}};let EA=Object.freeze(Object.defineProperty({__proto__:null,URI:"ReadonlySet",chain:function(t){var n=EO(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:Eb,difference:Ef,elem:EO,empty:EM,every:EI,filter:Ec,filterMap:Ex,foldMap:Eh,fromArray:Es,fromReadonlyArray:Es,fromSet:Ea,getDifferenceMagma:ED,getEq:EN,getIntersectionSemigroup:ER,getShow:EC,getUnionMonoid:EE,getUnionSemigroup:Ej,insert:Eg,intersection:Ed,isEmpty:ET,isSubset:E_,map:function(t){var n=EO(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 uX(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=EO(t),l=EO(n);!(o=a.next()).done;){var d=r(o.value);switch(d._tag){case"Left":c(d.left,u)||u.add(d.left);break;case"Right":l(d.right,s)||s.add(d.right)}}return uX(u,s)}}},reduce:Ep,reduceRight:Em,remove:Ey,separate:function(t,n){return function(r){var i=EO(t),o=EO(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)}}),uX(a,u)}},singleton:Eu,size:ES,some:Ew,toReadonlyArray:Ek,toSet:function(t){return new Set(t)},toggle:Ev,union:El},Symbol.toStringTag,{value:"Module"}));function EL(t){return t[0]}function EP(t){return t[1]}var EF=function(t){var n;return[EP(t),t[0]]};function Ez(t){return{URI:E6,_E:void 0,map:EV,ap:function(n,r){var i,o;return[(0,n[0])(r[0]),t.concat(EP(n),EP(r))]}}}var EU=function(t){return function(n){return[n,t.empty]}};function EW(t){var n=Ez(t);return{URI:E6,_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 EB=function(t,n){return n3(t,E0(n))},EV=function(t,n){return n3(t,EJ(n))},E$=function(t,n,r){return n3(t,EH(n,r))},EK=function(t,n){return n3(t,EX(n))},EY=function(t,n){return n3(t,E1(n))},Eq=function(t,n,r){return n3(t,E4(n,r))},EG=function(t){var n=E3();return function(t,r){return n3(t,n(r))}},EZ=function(t,n,r){return n3(t,E5(n,r))},EQ=function(t){var n=E9(t);return function(t,r){return n3(t,n(r))}},EH=function(t,n){return function(r){var i;return[n(r[0]),t(EP(r))]}},EJ=function(t){return function(n){var r;return[t(n[0]),EP(n)]}},EX=function(t){return function(n){var r;return[n[0],t(EP(n))]}},E0=function(t){return function(n){var r;return[n[0],EP(t)]}},E1=function(t){return function(n){return[t(n),EP(n)]}},E2=E1(nq),E4=function(t,n){return function(r){var i;return n(t,r[0])}},E3=function(){return function(t){return function(n){var r;return t(n[0])}}},E5=function(t,n){return function(r){var i;return n(r[0],t)}},E9=function(t){return function(n){return function(r){var i;return t.map(n(r[0]),function(t){return[t,EP(r)]})}}},E8=function(t){return function(n){var r;return t.map(n[0],function(t){return[t,EP(n)]})}},E6="ReadonlyTuple",E7={URI:E6,map:EV},Re=r_(E7);let Rt=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:E6,bimap:E$,mapLeft:EK},Comonad:{URI:E6,map:EV,extend:EY,extract:EL},Foldable:{URI:E6,reduce:Eq,foldMap:EG,reduceRight:EZ},Functor:E7,Semigroupoid:{URI:E6,compose:EB},Traversable:{URI:E6,map:EV,reduce:Eq,foldMap:EG,reduceRight:EZ,traverse:EQ,sequence:E8},URI:E6,bimap:EH,compose:E0,duplicate:E2,extend:E1,extract:EL,flap:Re,foldMap:E3,fst:EL,getApplicative:function(t){var n=Ez(t);return{URI:E6,_E:void 0,map:n.map,ap:n.ap,of:EU(t)}},getApply:Ez,getChain:EW,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=EW(t);return{URI:E6,_E:void 0,map:r.map,ap:r.ap,chain:r.chain,chainRec:n}},getMonad:function(t){var n=EW(t);return{URI:E6,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,of:EU(t)}},map:EJ,mapFst:EJ,mapLeft:EX,mapSnd:EX,readonlyTuple:{URI:E6,compose:EB,map:EV,bimap:E$,mapLeft:EK,extract:EL,extend:EY,reduce:Eq,foldMap:EG,reduceRight:EZ,traverse:EQ,sequence:E8},reduce:E4,reduceRight:E5,sequence:E8,snd:EP,swap:EF,traverse:E9},Symbol.toStringTag,{value:"Module"}));var Rn=globalThis&&globalThis.__assign||function(){return(Rn=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)},Rr=function(t){return function(n){return Object.keys(n).sort(t.compare)}},Ri=Rr(Nw);function Ro(t){if("function"==typeof t)return Ro(Nw)(t);var n=Rr(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 Ra=Ro(Nw)(function(t,n){return[t,n]});function Ru(t){return function(n){if(!rp.call(n,t))return n;var r=Object.assign({},n);return delete r[t],r}}var Rs=function(t,n){return Rc(t,function(){return n})},Rc=function(t,n){return function(r){if(!NZ(t,r))return rt;var i=Object.assign({},r);return i[t]=n(r[t]),rn(i)}};function Rl(t){return N6(t)}function Rd(t){return N7(t)}function Rf(t){return je(t)}var Rp=function(t){var n,r=N7(t);return function(n){return function(i){return t.map(n3(i,r(n)),Rw)}}},Rh=function(t){var n,r=N7(t);return function(n){return function(i){return t.map(n3(i,r(n)),RI)}}};function Rm(t){return ji(t)}function Rg(t){return ja(t)}function Ry(t,n){return ju(t,n)}var Rv=function(t){var n,r;return(n=ik(),ju(n,fM))(t)};function Rb(t,n){return js(t,n)}var Rx=function(t){var n=jp(t);return function(t){return function(r){return NV(r)?Rn({},t):NV(t)?Rn({},r):n(t)(r)}}},RM=function(t){return function(n){return function(r){return NV(r)||NV(n)?{}:jh(t)(n)(r)}}},RT=function(t){return function(n){return NV(n)?Rn({},t):NV(t)?Rn({},n):jm(t)(n)}},RS=function(t){return function(n){var r=Rr(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}}},Rw=jB,RI=jV,R_="Record",RO={URI:R_,map:jg},Rk=r_(RO),RC=function(t){return{URI:R_,reduce:jv(t),foldMap:jb(t),reduceRight:jx(t)}},RN=function(t){return{URI:R_,reduce:jv(t),foldMap:jb(t),reduceRight:jx(t),reduceWithIndex:jI(t),foldMapWithIndex:j_(t),reduceRightWithIndex:jO(t)}},Rj={URI:R_,compact:Rw,separate:RI},RE=function(t){return{URI:R_,map:jg,reduce:jv(t),foldMap:jb(t),reduceRight:jx(t),traverse:jE(t),sequence:jR(t)}},RR=function(t){return{URI:R_,map:jg,mapWithIndex:jy,reduce:jv(t),foldMap:jb(t),reduceRight:jx(t),reduceWithIndex:jI(t),foldMapWithIndex:j_(t),reduceRightWithIndex:jO(t),traverse:jE(t),sequence:jR(t),traverseWithIndex:RS(t)}},RD=function(t){var n=RE(t);return{URI:R_,map:jg,reduce:jv(t),foldMap:jb(t),reduceRight:jx(t),traverse:n.traverse,sequence:n.sequence,compact:Rw,separate:RI,filter:jM,filterMap:jT,partition:jS,partitionMap:jw,wither:sn(n,Rj),wilt:st(n,Rj)}},RA=function(t){var n=Rx(t);return{concat:function(t,r){return n(r)(t)}}},RL=function(t){return{concat:RA(t).concat,empty:{}}},RP=function(t){var n=RM(t);return{concat:function(t,r){return n(r)(t)}}},RF=function(){return{concat:function(t,n){return RT(n)(t)}}},Rz={URI:R_,reduce:jv(Nw),foldMap:jb(Nw),reduceRight:jx(Nw)},RU={URI:R_,reduce:jv(Nw),foldMap:jb(Nw),reduceRight:jx(Nw),reduceWithIndex:jI(Nw),foldMapWithIndex:j_(Nw),reduceRightWithIndex:jO(Nw)},RW={URI:R_,map:jg,reduce:jv(Nw),foldMap:jb(Nw),reduceRight:jx(Nw),traverse:jE(Nw),sequence:Rf},RB={URI:R_,map:jg,mapWithIndex:jy,reduce:jv(Nw),foldMap:jb(Nw),reduceRight:jx(Nw),reduceWithIndex:jI(Nw),foldMapWithIndex:j_(Nw),reduceRightWithIndex:jO(Nw),traverse:jE(Nw),sequence:Rf,traverseWithIndex:RS(Nw)},RV=sn(RW,Rj),R$=st(RW,Rj),RK={URI:R_,map:jg,reduce:jv(Nw),foldMap:jb(Nw),reduceRight:jx(Nw),traverse:jE(Nw),sequence:Rf,compact:Rw,separate:RI,filter:jM,filterMap:jT,partition:jS,partitionMap:jw,wither:RV,wilt:R$},RY={URI:R_,map:jg,reduce:jv(Nw),foldMap:jb(Nw),reduceRight:jx(Nw),traverse:jE(Nw),sequence:Rf,compact:Rw,separate:RI,filter:jM,filterMap:jT,partition:jS,partitionMap:jw,mapWithIndex:jy,reduceWithIndex:jI(Nw),foldMapWithIndex:j_(Nw),reduceRightWithIndex:jO(Nw),filterMapWithIndex:jN,filterWithIndex:jj,partitionMapWithIndex:jk,partitionWithIndex:jC,traverseWithIndex:RS(Nw),wither:RV,wilt:R$};let Rq=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Rj,Filterable:{URI:R_,map:jg,compact:Rw,separate:RI,filter:jM,filterMap:jT,partition:jS,partitionMap:jw},FilterableWithIndex:{URI:R_,map:jg,mapWithIndex:jy,compact:Rw,separate:RI,filter:jM,filterMap:jT,partition:jS,partitionMap:jw,filterMapWithIndex:jN,filterWithIndex:jj,partitionMapWithIndex:jk,partitionWithIndex:jC},Foldable:Rz,FoldableWithIndex:RU,Functor:RO,FunctorWithIndex:{URI:R_,map:jg,mapWithIndex:jy},Traversable:RW,TraversableWithIndex:RB,URI:R_,Witherable:RK,collect:Ro,compact:Rw,deleteAt:Ru,difference:RT,elem:jf,empty:{},every:jl,filter:jA,filterMap:jL,filterMapWithIndex:jo,filterWithIndex:Rg,flap:Rk,foldMap:function(t){return"compare"in t?jU(t):jU(Nw)(t)},foldMapWithIndex:function(t){return"compare"in t?N5(t):N5(Nw)(t)},fromEntries:Rv,fromFoldable:Ry,fromFoldableMap:Rb,getDifferenceMagma:RF,getEq:jY,getFoldable:RC,getFoldableWithIndex:RN,getIntersectionSemigroup:RP,getMonoid:jq,getShow:function(t){return"compare"in t?jK(t):jK(Nw)(t)},getTraversable:RE,getTraversableWithIndex:RR,getUnionMonoid:RL,getUnionSemigroup:RA,getWitherable:RD,has:NZ,hasOwnProperty:Er,insertAt:NG,intersection:RM,isEmpty:NV,isSubrecord:NX,keys:Ri,lookup:N0,map:N4,mapWithIndex:N2,modifyAt:Rc,partition:jP,partitionMap:jF,partitionMapWithIndex:jr,partitionWithIndex:Rm,pop:function(t){var n=Ru(t);return function(r){var i=N0(t,r);return n7(i)?rt:rn([i.value,n(r)])}},record:RY,reduce:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?jz(t[0]):jz(Nw).apply(void 0,t)},reduceRight:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?jW(t[0]):jW(Nw).apply(void 0,t)},reduceRightWithIndex:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?N9(t[0]):N9(Nw).apply(void 0,t)},reduceWithIndex:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?N3(t[0]):N3(Nw).apply(void 0,t)},separate:RI,sequence:Rf,singleton:N8,size:NB,some:jd,toArray:Ra,toEntries:Ra,toUnfoldable:function(t){return function(n){var r=Ra(n),i=r.length;return t.unfold(0,function(t){return t<i?rn([r[t],t+1]):rt})}},traverse:Rd,traverseWithIndex:Rl,union:Rx,updateAt:Rs,upsertAt:NG,wilt:Rh,wither:Rp},Symbol.toStringTag,{value:"Module"}));var RG=function(t){return function(n){return re(t(n))}},RZ=function(t){return function(n){return ri(t(n))}},RQ=function(){return function(t){return!0}},RH=function(t){return function(n){return!t(n)}},RJ=function(t){return function(n){return function(r){return n(r)||t(r)}}},RX=function(t){return function(n){return function(r){return n(r)&&t(r)}}},R0=function(){return function(t){return!1}},R1=function(t){return function(n){return function(r){return n(r)&&t(r)}}};let R2=Object.freeze(Object.defineProperty({__proto__:null,and:RX,compose:R1,fromEitherK:RZ,fromOptionK:RG,id:RQ,not:RH,or:RJ,zero:R0},Symbol.toStringTag,{value:"Module"}));var R4=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])})}}},R3=function(t){return function(n){return t.sub(t.zero,n)}};let R5=Object.freeze(Object.defineProperty({__proto__:null,getFunctionRing:nK,getTupleRing:R4,negate:R3,tuple:R4},Symbol.toStringTag,{value:"Module"})),R9=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),R8=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:n$},Symbol.toStringTag,{value:"Module"}));function R6(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 R7(t){var n=Dg(t);return function(r,i){if(void 0===i){var o=R7(t);return function(t){return o(r,t)}}if(Dh(r))return i;if(Dh(i))return r;var a=new Set(r);return i.forEach(function(t){n(t,a)||a.add(t)}),a}}function De(t){var n=Dg(t);return function(r,i){if(void 0===i){var o=De(t);return function(t){return o(t,r)}}if(Dh(r)||Dh(i))return new Set;var a=new Set;return r.forEach(function(t){n(t,i)&&a.add(t)}),a}}function Dt(t){var n=Dg(t);return function(r,i){if(void 0===i){var o=Dt(t);return function(t){return o(t,r)}}return R6(function(t){return!n(t,i)})(r)}}var Dn=function(t){return{concat:R7(t)}},Dr=function(t){return{concat:Dn(t).concat,empty:new Set}},Di=function(t){return{concat:De(t)}},Do=function(t){return{concat:Dt(t)}},Da=function(t){return new Set([t])};function Du(t){var n=Dg(t);return function(t){return function(r){if(n(t)(r))return r;var i=new Set(r);return i.add(t),i}}}var Ds=function(t){return function(n){return function(r){return R6(function(r){return!t.equals(n,r)})(r)}}},Dc=function(t){var n=Dg(t),r=Ds(t),i=Du(t);return function(t){return function(o){return(n(t,o)?r:i)(t)(o)}}},Dl=function(t){return function(n){for(var r=n.length,i=new Set,o=Dg(t),a=0;a<r;a++){var u=n[a];o(u,i)||i.add(u)}return i}},Dd=function(t){return Df(t)(nq)};function Df(t){var n=Dg(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 Dp=new Set,Dh=function(t){return 0===t.size},Dm=function(t){return t.size},Dg=EO,Dy=function(t){return function(n){var r=[];return n.forEach(function(t){return r.push(t)}),r.sort(t.compare)}};let Dv=Object.freeze(Object.defineProperty({__proto__:null,chain:function(t){var n=Dg(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:Dd,difference:Dt,elem:Dg,empty:Dp,every:EI,filter:R6,filterMap:Df,foldMap:Eh,fromArray:Dl,getDifferenceMagma:Do,getEq:EN,getIntersectionSemigroup:Di,getShow:EC,getUnionMonoid:Dr,getUnionSemigroup:Dn,insert:Du,intersection:De,isEmpty:Dh,isSubset:E_,map:function(t){var n=Dg(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 uX(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=Dg(t),l=Dg(n);!(o=a.next()).done;){var d=r(o.value);switch(d._tag){case"Left":c(d.left,u)||u.add(d.left);break;case"Right":l(d.right,s)||s.add(d.right)}}return uX(u,s)}}},reduce:Ep,reduceRight:Em,remove:Ds,separate:function(t,n){return function(r){var i=Dg(t),o=Dg(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)}}),uX(a,u)}},singleton:Da,size:Dm,some:Ew,subset:E_,toArray:Dy,toggle:Dc,union:R7},Symbol.toStringTag,{value:"Module"}));var Db=function(t){return{show:function(n){var r="{";for(var i in t)rp.call(t,i)&&(r+=" ".concat(i,": ").concat(t[i].show(n[i]),","));return r.length>1&&(r=r.slice(0,-1)+" "),r+="}"}}},Dx=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 DM=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:Db,getTupleShow:Dx,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:Db,tuple:Dx},Symbol.toStringTag,{value:"Module"}));function DT(t){return function(n){return function(r){return t.of([n,r])}}}function DS(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 Dw(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 DI(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 D_(t){return function(n){return function(r){return t.of(n(r))}}}function DO(t){return function(n){return function(r){return t.map(n,function(t){return[t,r]})}}}function Dk(t){return function(n){return function(r){return t.map(r(n),function(t){return t[0]})}}}function DC(t){return function(n){return function(r){return t.map(r(n),EP)}}}let DN=Object.freeze(Object.defineProperty({__proto__:null,ap:Dw,chain:DI,evaluate:Dk,execute:DC,fromF:DO,fromState:D_,getStateM:function(t){var n=Dw(t),r=DS(t),i=DI(t),o=Dk(t),a=DC(t);return{map:function(t,n){return n3(t,r(n))},ap:function(t,r){return n3(t,n(r))},of:DT(t),chain:function(t,n){return n3(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:D_(t),fromM:DO(t),evalState:function(t,n){return n3(t,o(n))},execState:function(t,n){return n3(t,a(n))}}},map:DS,of:DT},Symbol.toStringTag,{value:"Module"}));var Dj=function(t){return function(){return kB(t)}},DE=DT(CN);function DR(t){return DV(k$(t))}function DD(t){return DV(kY(t))}function DA(t){return DV(kQ(t))}var DL=function(t){return nX(t,kV)},DP=function(t){return function(n){return kB(t(n)[0])}},DF=mH(function(t){return Dj(t)},DE),Dz=D_(CN),DU=function(t){return DV(nG(t))},DW=function(t){return DV(kJ(t))},DB=function(t){return DV(kX(t))},DV=DO(Ck),D$=function(t){return function(n){return nX(n,ys(t))}},DK=function(t){return function(n){return function(r){return t(r)(n)(r)}}},DY=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return DW(t.apply(void 0,n))}},Dq=function(t){return function(n){return n3(n,D7(DY(t)))}},DG=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return DU(t.apply(void 0,n))}},DZ=function(t){return function(n){return n3(n,D7(DG(t)))}},DQ=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return DV(t.apply(void 0,n))}},DH=function(t){return function(n){return n3(n,D7(DQ(t)))}},DJ=function(t,n){return n3(t,D3(n))},DX=function(t,n){return n3(t,D8(n))},D0=function(t,n){return n3(t,D6(n))},D1=function(t,n){return function(r){return n3(t(r),CS(function(){return n()(r)}))}},D2=function(t,n,r){return function(i){return n3(t(i),Cy(n,function(t){var n=t[0],i=t[1];return[r(n),i]}))}},D4=function(t,n){return function(r){return n3(t(r),Cv(n))}},D3=DS(Ck),D5=function(t,n){return function(r){return D2(r,t,n)}},D9=function(t){return function(n){return D4(n,t)}},D8=Dw(CL),D6=DI(CL),D7=D6,Ae=D7(nq),At=function(t){return function(n){return function(r){return n3(n(r),CS(function(){return t()(r)}))}}},An="StateReaderTaskEither",Ar={URI:An,map:DJ},Ai=r_(Ar),Ao={URI:An,map:DJ,ap:DX},Aa=rg(Ao),Au=ry(Ao),As={URI:An,map:DJ,ap:DX,chain:D0},Ac={URI:An,fromState:Dz},Al=v_(Ac),Ad=vO(Ac),Af=vk(Ac),Ap=vC(Ac),Ah=vN(Ac),Am=vj(Ac,As),Ag=rR(As),Ay={URI:An,fromReader:DD},Av=yH(Ay),Ab=yJ(Ay),Ax=yX(Ay),AM=y0(Ay,As),AT=y1(Ay,As),AS={URI:An,fromEither:DF},Aw=rL(AS),AI=rF(AS),A_=rz(AS,As),AO=rW(AS,As),Ak=rB(AS,As),AC=rP(AS),AN=rV(AS,As),Aj=rU(AS),AE={URI:An,fromIO:DA},AR=yr(AE),AD=yi(AE,As),AA=yo(AE,As),AL={URI:An,fromIO:DA,fromTask:DR},AP=vR(AL),AF=vD(AL,As),Az=vA(AL,As),AU=Dk(Ck),AW=DC(Ck),AB=rO(Ar),AV=rD(As),A$=rv(Ao),AK=function(t){return function(n){return function(r){return function(i){return function(){return rl(n).reduce(function(n,r,o){return n.then(function(a){return rr(a)?n:t(o+1,r)(a.right[1])(i)().then(function(t){if(rr(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,rc(n))(r)(i)().then(mI(function(t){var n;return[[t[0]],t[1]]})))}}}}},AY=function(t){var n=AK(t);return function(t){return rs(t)?n(t):DE(rd)}},Aq=function(t){return AY(function(n,r){return t(r)})},AG=Aq(nq),AZ=function(t,n){return n3(t(n),Cg(function(t){return t[0]}))},AQ=function(t,n){return n3(t(n),Cg(function(t){return t[0],t[1]}))};let AH=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:An,map:DJ,alt:D1},Applicative:{URI:An,map:DJ,ap:DX,of:DE},Apply:Ao,Bifunctor:{URI:An,bimap:D2,mapLeft:D4},Chain:As,FromEither:AS,FromIO:AE,FromReader:Ay,FromState:Ac,FromTask:AL,Functor:Ar,Monad:{URI:An,map:DJ,ap:DX,of:DE,chain:D0},MonadIO:{URI:An,map:DJ,ap:DX,of:DE,chain:D0,fromIO:DA},MonadTask:{URI:An,map:DJ,ap:DX,of:DE,chain:D0,fromIO:DA,fromTask:DR},MonadThrow:{URI:An,map:DJ,ap:DX,of:DE,chain:D0,throwError:Dj},Pointed:{URI:An,of:DE},URI:An,alt:At,altW:At,ap:D8,apFirst:Aa,apFirstW:Aa,apS:A$,apSW:A$,apSecond:Au,apSecondW:Au,apW:D8,ask:Av,asks:Ab,asksStateReaderTaskEither:DK,asksStateReaderTaskEitherW:DK,bimap:D5,bind:AV,bindTo:AB,bindW:AV,chain:D6,chainEitherK:AO,chainEitherKW:AO,chainFirst:Ag,chainFirstEitherK:Ak,chainFirstEitherKW:Ak,chainFirstIOK:AA,chainFirstReaderK:AT,chainFirstReaderKW:AT,chainFirstTaskK:Az,chainFirstW:Ag,chainIOEitherK:Dq,chainIOEitherKW:Dq,chainIOK:AD,chainOptionK:A_,chainReaderK:AM,chainReaderKW:AM,chainReaderTaskEitherK:DH,chainReaderTaskEitherKW:DH,chainStateK:Am,chainTaskEitherK:DZ,chainTaskEitherKW:DZ,chainTaskK:AF,chainW:D7,evalState:AZ,evaluate:AU,execState:AQ,execute:AW,filterOrElse:AN,filterOrElseW:AN,flap:Ai,flatten:Ae,flattenW:Ae,fromEither:DF,fromEitherK:Aj,fromIO:DA,fromIOEither:DW,fromIOEitherK:DY,fromIOK:AR,fromOption:Aw,fromOptionK:AI,fromPredicate:AC,fromReader:DD,fromReaderEither:DB,fromReaderK:Ax,fromReaderTaskEither:DV,fromReaderTaskEitherK:DQ,fromState:Dz,fromStateK:Ah,fromTask:DR,fromTaskEither:DU,fromTaskEitherK:DG,fromTaskK:AP,get:Al,gets:Ap,left:Dj,leftIO:function(t){return DV(kH(t))},leftReader:function(t){return DV(kq(t))},leftState:DP,leftTask:function(t){return DV(kK(t))},local:D$,map:D3,mapLeft:D9,modify:Af,of:DE,put:Ad,right:DE,rightIO:DA,rightReader:DD,rightState:DL,rightTask:DR,run:function(t,n,r){return t(n)(r)()},sequenceArray:AG,stateReaderTaskEither:{URI:An,map:DJ,of:DE,ap:DX,chain:D0,bimap:D2,mapLeft:D4,alt:D1,fromIO:DA,fromTask:DR,throwError:Dj},stateReaderTaskEitherSeq:{URI:An,map:DJ,of:DE,ap:DX,chain:D0,bimap:D2,mapLeft:D4,alt:D1,fromIO:DA,fromTask:DR,throwError:Dj},throwError:Dj,traverseArray:Aq,traverseArrayWithIndex:AY,traverseReadonlyArrayWithIndex:AY,traverseReadonlyNonEmptyArrayWithIndex:AK},Symbol.toStringTag,{value:"Module"}));var AJ=function(t,n){return n3(t,A4(n))},AX=function(t,n){return n3(t,A0(n))},A0=function(t){return function(n){return{peek:function(r){return t({peek:n.peek,pos:r})},pos:n.pos}}},A1=function(t){return t.peek(t.pos)},A2=A0(nq),A4=function(t){return function(n){return{peek:function(r){return t(n.peek(r))},pos:n.pos}}},A3="Store",A5={URI:A3,map:AJ},A9=r_(A5),A8={URI:A3,map:AJ,extend:AX,extract:A1};let A6=Object.freeze(Object.defineProperty({__proto__:null,Comonad:A8,Functor:A5,URI:A3,duplicate:A2,experiment:function(t){return function(n){return function(r){return t.map(n(r.pos),function(t){return r.peek(t)})}}},extend:A0,extract:A1,flap:A9,map:A4,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:A8},Symbol.toStringTag,{value:"Module"}));function A7(t,n){return function(r,i){return n.compose(t.second(i),t.first(r))}}function Le(t,n){var r=A7(t,n);return function(i,o){return n.compose(r(i,o),t.promap(n.id(),nq,function(t){return[t,t]}))}}let Lt=Object.freeze(Object.defineProperty({__proto__:null,fanOut:Le,fanout:function(t){return Le(t,t)},split:A7,splitStrong:function(t){return A7(t,t)}},Symbol.toStringTag,{value:"Module"}));var Ln=function(){return{concat:function(t,n){return Object.assign({},t,n)}}},Lr=function(t){return function(n){var r={};for(var i in n)rp.call(n,i)&&(r[i]=t[i](n[i]));return r}};let Li=Object.freeze(Object.defineProperty({__proto__:null,evolve:Lr,getAssignSemigroup:Ln},Symbol.toStringTag,{value:"Module"}));var Lo=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())})},La=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])}}},Lu=x1(I4),Ls=x7(I4),Lc=Me(I4),Ll=function(t){return Ld(I$(t))},Ld=x4(I1),Lf=IZ(pg),Lp=Mt(I1),Lh=Mn(_e),Lm=Mr(_t),Lg=x3(I4),Ly=function(t){return function(){return Lo(void 0,void 0,void 0,function(){return La(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t().then(rn)];case 1:return[2,n.sent()];case 2:return n.sent(),[2,rt];case 3:return[2]}})})}},Lv=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Ly(function(){return t.apply(void 0,n)})}},Lb=x5(I4),Lx=x9(_t),LM=x8(I4),LT=x6(_t),LS=Mi(I1),Lw=Mo(I3),LI=Ma(_t),L_=LI(nq),LO=Mu(_t),Lk=x2(I4),LC=Lk(),LN=hW(I1,p1),Lj=hB(I1,p1,pL),LE=gH(I1,p9),LR=gJ(I1,p9),LD=gX(I1,p9),LA=g0(I1,p9),LL=function(t,n){return n3(t,LS(n))},LP=function(t,n){return n3(t,Lw(n))},LF=function(t,n){return n3(t,LI(n))},Lz=function(t,n){return n3(t,LO(n))},LU=function(t,n){return n3(t,LE(n))},LW=function(t,n){return n3(t,LR(n))},LB=function(t,n){return n3(t,LD(n))},LV=function(t,n){return n3(t,LA(n))},L$="TaskOption",LK={URI:L$,map:LL},LY=r_(LK),Lq={URI:L$,of:Lu},LG={URI:L$,map:LL,ap:LP},LZ=rg(LG),LQ=ry(LG),LH=function(t,n){return n3(t,LI(function(t){return n3(n,LS(t))}))},LJ={URI:L$,map:LL,ap:LP,chain:LF},LX=rR(LJ),L0={URI:L$,zero:Lk},L1=so(L0,Lq),L2={URI:L$,fromIO:Ll},L4=yr(L2),L3=yi(L2,LJ),L5=yo(L2,LJ),L9={URI:L$,fromEither:Lc},L8=rU(L9),L6=rW(L9,LJ),L7=rB(L9,LJ),Pe={URI:L$,fromIO:Ll,fromTask:Ld},Pt=vR(Pe),Pn=vD(Pe,LJ),Pr=vA(Pe,LJ),Pi=Lu(rf),Po=rO(LK),Pa=rD(LJ),Pu=rv(LG),Ps=Lu(rd),Pc=function(t){return nX(_p(t),IZ(hj(n5)))},Pl=function(t){var n=Pc(t);return function(t){return rs(t)?n(t):Ps}},Pd=function(t){return function(n){return function(){return rl(n).reduce(function(n,r,i){return n.then(function(o){return n7(o)?n:t(i+1,r)().then(function(t){return n7(t)?t:(o.value.push(t.value),o)})})},t(0,rc(n))().then(pA(ru)))}}},Pf=function(t){var n=Pd(t);return function(t){return rs(t)?n(t):Ps}},Pp=function(t){return Pl(function(n,r){return t(r)})},Ph=Pp(nq),Pm=function(t){return Pf(function(n,r){return t(r)})},Pg=Pm(nq);let Py=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:L$,map:LL,alt:Lz},Alternative:{URI:L$,map:LL,ap:LP,of:Lu,alt:Lz,zero:Lk},ApT:Ps,ApplicativePar:{URI:L$,map:LL,ap:LP,of:Lu},ApplicativeSeq:{URI:L$,map:LL,ap:LH,of:Lu},ApplyPar:LG,ApplySeq:{URI:L$,map:LL,ap:LH},Chain:LJ,Compactable:{URI:L$,compact:LN,separate:Lj},Do:Pi,Filterable:{URI:L$,map:LL,compact:LN,separate:Lj,filter:LU,filterMap:LW,partition:LB,partitionMap:LV},FromEither:L9,FromIO:L2,FromTask:Pe,Functor:LK,Monad:{URI:L$,map:LL,ap:LP,of:Lu,chain:LF},MonadIO:{URI:L$,map:LL,ap:LP,of:Lu,chain:LF,fromIO:Ll},MonadTask:{URI:L$,map:LL,ap:LP,of:Lu,chain:LF,fromIO:Ll,fromTask:Ld},Pointed:Lq,Zero:L0,alt:LO,altW:LO,ap:Lw,apFirst:LZ,apS:Pu,apSecond:LQ,bind:Pa,bindTo:Po,chain:LI,chainEitherK:L6,chainFirst:LX,chainFirstEitherK:L7,chainFirstIOK:L5,chainFirstTaskK:Pr,chainIOK:L3,chainNullableK:Lx,chainOptionK:LT,chainTaskK:Pn,compact:LN,filter:LE,filterMap:LR,flap:LY,flatten:L_,fold:Lh,foldW:Lh,fromEither:Lc,fromEitherK:L8,fromIO:Ll,fromIOK:L4,fromNullable:Lg,fromNullableK:Lb,fromOption:IH,fromOptionK:LM,fromPredicate:Ls,fromTask:Ld,fromTaskEither:Lf,fromTaskK:Pt,getOrElse:Lm,getOrElseW:Lm,guard:L1,map:LS,match:Lp,matchE:Lh,matchEW:Lh,matchW:Lp,none:LC,of:Lu,partition:LD,partitionMap:LA,separate:Lj,sequenceArray:Ph,sequenceSeqArray:Pg,some:Lu,traverseArray:Pp,traverseArrayWithIndex:Pl,traverseReadonlyArrayWithIndex:Pl,traverseReadonlyArrayWithIndexSeq:Pf,traverseReadonlyNonEmptyArrayWithIndex:Pc,traverseReadonlyNonEmptyArrayWithIndexSeq:Pd,traverseSeqArray:Pm,traverseSeqArrayWithIndex:Pf,tryCatch:Ly,tryCatchK:Lv,zero:Lk},Symbol.toStringTag,{value:"Module"}));var Pv=function(t){return"Left"===t._tag},Pb=function(t){return"Right"===t._tag};function Px(t){return"Both"===t._tag}function PM(t){return{_tag:"Left",left:t}}function PT(t){return{_tag:"Right",right:t}}function PS(t,n){return{_tag:"Both",left:t,right:n}}var Pw=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)}}},PI=Pw(PT,PM,function(t,n){return PS(n,t)});function P_(t,n){return{concat:function(r,i){return Pv(r)?Pv(i)?PM(t.concat(r.left,i.left)):Pb(i)?PS(r.left,i.right):PS(t.concat(r.left,i.left),i.right):Pb(r)?Pv(i)?PS(i.left,r.right):Pb(i)?PT(n.concat(r.right,i.right)):PS(i.left,n.concat(r.right,i.right)):Pv(i)?PS(t.concat(r.left,i.left),r.right):Pb(i)?PS(r.left,n.concat(r.right,i.right)):PS(t.concat(r.left,i.left),n.concat(r.right,i.right))}}}var PO=function(t){return{URI:PK,_E:void 0,map:PN,ap:function(n,r){return Pv(n)?Pv(r)?PM(t.concat(n.left,r.left)):Pb(r)?PM(n.left):PM(t.concat(n.left,r.left)):Pb(n)?Pv(r)?PM(r.left):Pb(r)?PT(n.right(r.right)):PS(r.left,n.right(r.right)):Pv(r)?PM(t.concat(n.left,r.left)):Pb(r)?PS(n.left,n.right(r.right)):PS(t.concat(n.left,r.left),n.right(r.right))}}};function Pk(t){var n=PO(t),r=function(n,r){if(Pv(n))return n;if(Pb(n))return r(n.right);var i=r(n.right);return Pv(i)?PM(t.concat(n.left,i.left)):Pb(i)?PS(n.left,i.right):PS(t.concat(n.left,i.left),i.right)};return{URI:PK,_E:void 0,map:PN,ap:n.ap,chain:r}}var PC=function(t,n){return n7(t)?n7(n)?rt:rn(PT(n.value)):n7(n)?rn(PM(t.value)):rn(PS(t.value,n.value))},PN=function(t,n){return n3(t,Pz(n))},Pj=function(t,n,r){return n3(t,PP(n,r))},PE=function(t,n){return n3(t,PF(n))},PR=function(t,n,r){return n3(t,PU(n,r))},PD=function(t){var n=PW(t);return function(t,r){return n3(t,n(r))}},PA=function(t,n,r){return n3(t,PB(n,r))},PL=function(t){var n=PV(t);return function(t,r){return n3(t,n(r))}},PP=function(t,n){return function(r){return Pv(r)?PM(t(r.left)):Pb(r)?PT(n(r.right)):PS(t(r.left),n(r.right))}},PF=function(t){return function(n){return Pv(n)?PM(t(n.left)):Px(n)?PS(t(n.left),n.right):n}},Pz=function(t){return function(n){return Pv(n)?n:Pb(n)?PT(t(n.right)):PS(n.left,t(n.right))}},PU=function(t,n){return function(r){return Pv(r)?t:n(t,r.right)}},PW=function(t){return function(n){return function(r){return Pv(r)?t.empty:n(r.right)}}},PB=function(t,n){return function(r){return Pv(r)?t:n(r.right,t)}},PV=function(t){return function(n){return function(r){return Pv(r)?t.of(r):Pb(r)?t.map(n(r.right),PT):t.map(n(r.right),function(t){return PS(r.left,t)})}}},P$=function(t){return function(n){return Pv(n)?t.of(n):Pb(n)?t.map(n.right,PT):t.map(n.right,function(t){return PS(n.left,t)})}},PK="These",PY={URI:PK,map:PN},Pq=r_(PY),PG={URI:PK,fromEither:nq},PZ=rL(PG),PQ=rF(PG),PH=function(t){return function(n){return function(r){return!Pv(r)&&t.equals(n,r.right)}}},PJ=function(t){return function(n){return!Pv(n)&&t(n.right)}},PX=function(t,n){return function(r){return Pv(r)?[r.left,n()]:Pb(r)?[t(),r.right]:[r.left,r.right]}},P0=function(t,n){return PX(function(){return t},function(){return n})},P1=PT(rd),P2=function(t){return function(n){return function(r){var i=rt,o=n(0,rc(r));if(Pv(o))return o;Px(o)&&(i=rn(o.left));for(var a=[o.right],u=1;u<r.length;u++){var s=n(u,r[u]);if(Pv(s))return s;Px(s)&&(i=n7(i)?rn(s.left):rn(t.concat(i.value,s.left))),a.push(s.right)}return n7(i)?PT(a):PS(i.value,a)}}},P4=function(t){return function(n){var r=P2(t)(n);return function(t){return rs(t)?r(t):P1}}};let P3=Object.freeze(Object.defineProperty({__proto__:null,ApT:P1,Bifunctor:{URI:PK,bimap:Pj,mapLeft:PE},Foldable:{URI:PK,reduce:PR,foldMap:PD,reduceRight:PA},FromEither:PG,FromThese:{URI:PK,fromThese:nq},Functor:PY,Pointed:{URI:PK,of:PT},Traversable:{URI:PK,map:PN,reduce:PR,foldMap:PD,reduceRight:PA,traverse:PL,sequence:P$},URI:PK,bimap:PP,both:PS,elem:PH,exists:PJ,flap:Pq,fold:Pw,foldMap:PW,foldW:Pw,fromOption:PZ,fromOptionK:PQ,fromOptions:PC,getApplicative:function(t){var n=PO(t);return{URI:PK,_E:void 0,map:PN,ap:n.ap,of:PT}},getApply:PO,getChain:Pk,getEq:function(t,n){return rK(function(r,i){return Pv(r)?Pv(i)&&t.equals(r.left,i.left):Pb(r)?Pb(i)&&n.equals(r.right,i.right):Px(i)&&t.equals(r.left,i.left)&&n.equals(r.right,i.right)})},getLeft:function(t){return Pv(t)?rn(t.left):Pb(t)?rt:rn(t.left)},getLeftOnly:function(t){return Pv(t)?rn(t.left):rt},getMonad:function(t){var n=Pk(t);return{URI:PK,_E:void 0,map:PN,of:PT,ap:n.ap,chain:n.chain,throwError:PM}},getRight:function(t){return Pv(t)?rt:(Pb(t),rn(t.right))},getRightOnly:function(t){return Pb(t)?rn(t.right):rt},getSemigroup:P_,getShow:function(t,n){return{show:Pw(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:Px,isLeft:Pv,isRight:Pb,left:PM,leftOrBoth:function(t){return function(n){return n7(n)?PM(t):PS(t,n.value)}},map:Pz,mapLeft:PF,match:Pw,matchW:Pw,of:PT,reduce:PU,reduceRight:PB,right:PT,rightOrBoth:function(t){return function(n){return n7(n)?PT(t):PS(n.value,t)}},sequence:P$,swap:PI,these:{URI:PK,map:PN,bimap:Pj,mapLeft:PE,reduce:PR,foldMap:PD,reduceRight:PA,traverse:PL,sequence:P$},toTuple:P0,toTuple2:PX,traverse:PV,traverseReadonlyArrayWithIndex:P4,traverseReadonlyNonEmptyArrayWithIndex:P2},Symbol.toStringTag,{value:"Module"}));function P5(t){return nX(PT,t.of)}function P9(t){return nX(PM,t.of)}function P8(t){return nX(PS,t.of)}function P6(t){return function(n){return t.map(n,PT)}}function P7(t){return function(n){return t.map(n,PM)}}function Fe(t){return rI(t,PY)}function Ft(t,n){return rm(t,PO(n))}function Fn(t,n){var r=P9(t);return function(i){return function(o){return t.chain(o,Pw(r,i,function(r,o){return t.map(i(o),Pw(function(t){return PM(n.concat(r,t))},function(t){return PS(r,t)},function(t,i){return PS(n.concat(r,t),i)}))}))}}}function Fr(t){return function(n,r){return function(i){return t.map(i,PP(n,r))}}}function Fi(t){return function(n){return function(r){return t.map(r,PF(n))}}}function Fo(t){return function(n,r,i){return function(o){return t.map(o,Pw(n,r,i))}}}function Fa(t){return function(n,r,i){return function(o){return t.chain(o,Pw(n,r,i))}}}function Fu(t){return function(n){return t.map(n,PI)}}function Fs(t){return function(n,r){return function(i){return t.map(i,PX(n,r))}}}let Fc=Object.freeze(Object.defineProperty({__proto__:null,ap:Ft,bimap:Fr,both:P8,chain:Fn,getTheseM:function(t){var n=Fe(t),r=Fr(t),i=Fi(t),o=Fa(t),a=Fs(t),u=P5(t),s=function(t,r){return n3(t,n(r))};return{map:s,bimap:function(t,n,i){return n3(t,r(n,i))},mapLeft:function(t,n){return n3(t,i(n))},fold:function(t,n,r,i){return n3(t,o(n,r,i))},swap:Fu(t),rightM:P6(t),leftM:P7(t),left:P9(t),right:P5(t),both:P8(t),toTuple:function(t,n,r){return n3(t,a(function(){return n},function(){return r}))},getMonad:function(n){var r=Ft(t,n),i=Fn(t,n);return{_E:void 0,map:s,of:u,ap:function(t,n){return n3(t,r(n))},chain:function(t,n){return n3(t,i(n))}}}}},left:P9,leftF:P7,map:Fe,mapLeft:Fi,match:Fo,matchE:Fa,right:P5,rightF:P6,swap:Fu,toTuple2:Fs},Symbol.toStringTag,{value:"Module"}));var Fl=P9(I4),Fd=P5(I4),Ff=P8(I4),Fp=P6(I1),Fh=P7(I1),Fm=nX(I$,Fp),Fg=nX(I$,Fh),Fy=Fo(I1),Fv=Fa(_t),Fb=Fu(I1),Fx=function(t,n){return n3(t,FS(n))},FM=function(t,n,r){return n3(t,Fw(n,r))},FT=function(t,n){return n3(t,FI(n))},FS=Fe(I1),Fw=Fr(I1),FI=Fi(I1),F_="TaskThese",FO=function(t,n){var r=Ft(t,n);return{URI:F_,_E:void 0,map:Fx,ap:function(t,n){return n3(t,r(n))}}};function Fk(t,n){var r=FO(t,n).ap;return{URI:F_,_E:void 0,map:Fx,ap:r,of:Fd}}function FC(t){var n=FO(I8,t),r=Fn(_t,t);return{URI:F_,_E:void 0,map:Fx,ap:n.ap,chain:function(t,n){return n3(t,r(n))}}}var FN={URI:F_,map:Fx},Fj=r_(FN),FE={URI:F_,fromEither:IH},FR=rL(FE),FD=rF(FE),FA=rP(FE),FL={URI:F_,fromThese:IH},FP=vP(FL),FF={URI:F_,fromIO:Fm},Fz=yr(FF),FU={URI:F_,fromIO:Fm,fromTask:Fp},FW=vR(FU),FB=Fs(I1),FV=Fd(rd),F$=function(t){var n=P2(t);return function(t){return nX(_p(t),IZ(n(n5)))}},FK=function(t){return function(n){var r=F$(t)(n);return function(t){return rs(t)?r(t):FV}}},FY=function(t){return function(n){return function(r){return function(){return rl(r).reduce(function(r,i,o){return r.then(function(a){return Pv(a)?r:n(o+1,i)().then(function(n){if(Pv(n))return n;if(Px(n)){var r=a.right;return r.push(n.right),Px(a)?PS(t.concat(a.left,n.left),r):PS(n.left,r)}return a.right.push(n.right),a})})},n(0,rc(r))().then(Pz(ru)))}}}},Fq=function(t){return function(n){var r=FY(t)(n);return function(t){return rs(t)?r(t):FV}}},FG=function(t,n){return FB(function(){return t},function(){return n})},FZ=function(t,n){return rb(I6)(P_(t,n))};let FQ=Object.freeze(Object.defineProperty({__proto__:null,ApT:FV,Bifunctor:{URI:F_,bimap:FM,mapLeft:FT},FromEither:FE,FromIO:FF,FromTask:FU,FromThese:FL,Functor:FN,Pointed:{URI:F_,of:Fd},URI:F_,bifunctorTaskThese:{URI:F_,bimap:FM,mapLeft:FT},bimap:Fw,both:Ff,flap:Fj,fold:Fv,foldW:Fv,fromEither:IH,fromIO:Fm,fromIOEither:I$,fromIOK:Fz,fromOption:FR,fromOptionK:FD,fromPredicate:FA,fromTask:Fp,fromTaskK:FW,fromThese:IH,fromTheseK:FP,functorTaskThese:{URI:F_,map:Fx},getApplicative:Fk,getApply:FO,getChain:FC,getMonad:function(t){var n=Fk(I8,t),r=FC(t);return{URI:F_,_E:void 0,map:Fx,ap:n.ap,of:Fd,chain:r.chain,fromIO:Fm,fromTask:Fp}},getSemigroup:FZ,left:Fl,leftIO:Fg,leftTask:Fh,map:FS,mapLeft:FI,match:Fy,matchE:Fv,matchEW:Fv,matchW:Fy,of:Fd,right:Fd,rightIO:Fm,rightTask:Fp,swap:Fb,taskThese:{URI:F_,map:Fx,bimap:FM,mapLeft:FT},toTuple:FG,toTuple2:FB,traverseReadonlyArrayWithIndex:FK,traverseReadonlyArrayWithIndexSeq:Fq,traverseReadonlyNonEmptyArrayWithIndex:F$,traverseReadonlyNonEmptyArrayWithIndexSeq:FY},Symbol.toStringTag,{value:"Module"}));var FH=function(t,n){return n3(t,FJ(n))},FJ=function(t){return function(n){return function(r){return t(n(r))}}},FX="Traced",F0={URI:FX,map:FH},F1=r_(F0);let F2=Object.freeze(Object.defineProperty({__proto__:null,Functor:F0,URI:FX,censor:function(t){return function(n){return function(r){return n(t(r))}}},flap:F1,getComonad:function(t){return{URI:FX,_E:void 0,map:FH,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:FJ,traced:F0,tracks:function(t,n){return function(r){return r(n(r(t.empty)))}}},Symbol.toStringTag,{value:"Module"}));function F4(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 F3(t,n){return function(r){var i=t.sequence(r),o=n.sequence(r);return function(n){return i(t.map(n,o))}}}let F5=Object.freeze(Object.defineProperty({__proto__:null,getTraversableComposition:function(t,n){var r=rk(t,n).map,i=g8(t,n),o=F4(t,n),a=F3(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 n3(t,n(r))}},sequence:function(t){var n=a(t);return function(t){return n3(t,n)}}}},sequence:F3,traverse:F4},Symbol.toStringTag,{value:"Module"})),F9=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function F8(t,n){return void 0===n&&(n=[]),{value:t,forest:n}}var F6=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+=F6(t+(o>1&&!u?"│ ":" "),r.forest)}return i};function F7(t){return F6(`
|
|
2
|
-
`,t)}function ze(t,n){var r,i=n(t);return{value:i[0],forest:zt(i[1],n)}}function zt(t,n){return t.map(function(t){return ze(t,n)})}function zn(t){var n=zr(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 zr(t){var n=d8(t);return function(r,i){return n3(r,n(function(n){return zn(t)(n,i)}))}}var zi=function(t,n){return n3(t,zy(n))},zo=function(t,n){return n3(t,zp(function(t){return n3(n,zy(t))}))},za=function(t,n){return n3(t,zp(n))},zu=function(t,n,r){return n3(t,zv(n,r))},zs=function(t){var n=zb(t);return function(t,r){return n3(t,n(r))}},zc=function(t,n,r){return n3(t,zx(n,r))},zl=function(t,n){return n3(t,zh(n))},zd=function(t){var n=zT(t);return function(t,r){return n3(t,n(r))}},zf=function(t){return function(n){return zo(n,t)}},zp=function(t){return function(n){var r=t(n.value),i=r.value,o=r.forest,a=fo().concat;return{value:i,forest:a(o,n.forest.map(zp(t)))}}},zh=function(t){return function(n){return{value:t(n),forest:n.forest.map(zh(t))}}},zm=zh(nq),zg=zp(nq),zy=function(t){return function(n){return{value:t(n.value),forest:n.forest.map(zy(t))}}},zv=function(t,n){return function(r){for(var i=n(t,r.value),o=r.forest.length,a=0;a<o;a++)i=n3(r.forest[a],zv(i,n));return i}},zb=function(t){return function(n){return zv(t.empty,function(r,i){return t.concat(r,n(i))})}},zx=function(t,n){return function(r){for(var i=t,o=r.forest.length,a=o-1;a>=0;a--)i=n3(r.forest[a],zx(i,n));return n(r.value,i)}},zM=function(t){return t.value},zT=function(t){var n=d8(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}}}),n3(o.forest,n(r(i))))}};return r},zS=function(t){return zT(t)(nq)},zw=function(t){return F8(t)},zI="Tree",z_={URI:zI,map:zi},zO=r_(z_),zk={URI:zI,map:zi,ap:zo},zC=rg(zk),zN=ry(zk),zj={URI:zI,map:zi,ap:zo,chain:za},zE=rR(zj),zR=zw(rf),zD=rO(z_),zA=rD(zj),zL=rv(zk),zP=function(t){return function(n){return t(n.value)||n.forest.some(zP(t))}};let zF=Object.freeze(Object.defineProperty({__proto__:null,Applicative:{URI:zI,map:zi,ap:zo,of:zw},Apply:zk,Chain:zj,Comonad:{URI:zI,map:zi,extend:zl,extract:zM},Do:zR,Foldable:{URI:zI,reduce:zu,foldMap:zs,reduceRight:zc},Functor:z_,Monad:{URI:zI,map:zi,ap:zo,of:zw,chain:za},Pointed:{URI:zI,of:zw},Traversable:{URI:zI,map:zi,reduce:zu,foldMap:zs,reduceRight:zc,traverse:zd,sequence:zS},URI:zI,ap:zf,apFirst:zC,apS:zL,apSecond:zN,bind:zA,bindTo:zD,chain:zp,chainFirst:zE,drawForest:F7,drawTree:function(t){return t.value+F7(t.forest)},duplicate:zm,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:zh,extract:zM,flap:zO,flatten:zg,fold:function(t){var n=function(r){return t(r.value,r.forest.map(n))};return n},foldMap:zb,getEq:function(t){var n,r=rK(function(r,i){return t.equals(r.value,i.value)&&n.equals(r.forest,i.forest)});return n=c2(r),r},getShow:function(t){var n=function(r){return lj(r.forest)?"make(".concat(t.show(r.value),")"):"make(".concat(t.show(r.value),", [").concat(r.forest.map(n).join(", "),"])")};return{show:n}},make:F8,map:zy,of:zw,reduce:zv,reduceRight:zx,sequence:zS,traverse:zT,tree:{URI:zI,map:zi,of:zw,ap:zo,chain:za,reduce:zu,foldMap:zs,reduceRight:zc,traverse:zd,sequence:zS,extract:zM,extend:zl},unfoldForest:zt,unfoldForestM:zr,unfoldTree:ze,unfoldTreeM:zn},Symbol.toStringTag,{value:"Module"}));var zz=function(t){var n;return[EP(t),(n=t,n[0])]};function zU(t){return{URI:z7,_E:void 0,map:z$,ap:function(n,r){var i,o;return[(i=n,i[0])((o=r,o[0])),t.concat(EP(n),EP(r))]}}}var zW=function(t){return function(n){return[n,t.empty]}};function zB(t){var n=zU(t);return{URI:z7,_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 zV=function(t,n){return n3(t,z1(n))},z$=function(t,n){return n3(t,zX(n))},zK=function(t,n,r){return n3(t,zJ(n,r))},zY=function(t,n){return n3(t,z0(n))},zq=function(t,n){return n3(t,z2(n))},zG=function(t,n,r){return n3(t,z5(n,r))},zZ=function(t){var n=z3();return function(t,r){return n3(t,n(r))}},zQ=function(t,n,r){return n3(t,z9(n,r))};function zH(t){var n=z8(t);return function(t,r){return n3(t,n(r))}}var zJ=function(t,n){return function(r){var i;return[n((i=r,i[0])),t(EP(r))]}},zX=function(t){return function(n){var r;return[t((r=n,r[0])),EP(n)]}},z0=function(t){return function(n){var r;return[(r=n,r[0]),t(EP(n))]}},z1=function(t){return function(n){var r;return[(r=n,r[0]),EP(t)]}},z2=function(t){return function(n){return[t(n),EP(n)]}},z4=z2(nq),z3=E3,z5=E4,z9=E5,z8=function(t){return function(n){return function(r){var i;return t.map(n((i=r,i[0])),function(t){return[t,EP(r)]})}}},z6=function(t){return function(n){var r;return t.map((r=n,r[0]),function(t){return[t,EP(n)]})}},z7="Tuple",Ue={URI:z7,map:z$},Ut=r_(Ue);let Un=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:z7,bimap:zK,mapLeft:zY},Comonad:{URI:z7,map:z$,extend:zq,extract:EL},Foldable:{URI:z7,reduce:zG,foldMap:zZ,reduceRight:zQ},Functor:Ue,Semigroupoid:{URI:z7,compose:zV},Traversable:{URI:z7,map:z$,reduce:zG,foldMap:zZ,reduceRight:zQ,traverse:zH,sequence:z6},URI:z7,bimap:zJ,compose:z1,duplicate:z4,extend:z2,extract:EL,flap:Ut,foldMap:z3,fst:EL,getApplicative:function(t){var n=zU(t);return{URI:z7,_E:void 0,map:n.map,ap:n.ap,of:zW(t)}},getApply:zU,getChain:zB,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=zB(t);return{URI:z7,_E:void 0,map:r.map,ap:r.ap,chain:r.chain,chainRec:n}},getMonad:function(t){var n=zB(t);return{URI:z7,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,of:zW(t)}},map:zX,mapFst:zX,mapLeft:z0,mapSnd:z0,reduce:z5,reduceRight:z9,sequence:z6,snd:EP,swap:zz,traverse:z8,tuple:{URI:z7,compose:zV,map:z$,bimap:zK,mapLeft:zY,extract:EL,extend:zq,reduce:zG,foldMap:zZ,reduceRight:zQ,traverse:zH,sequence:z6}},Symbol.toStringTag,{value:"Module"})),Ur=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Ui=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:function(t,n){var r=rj(n,mS(t));return{map:r.map,ap:r.ap,of:r.of,chain:function(t,r){return n.chain(t,function(t){return rr(t)?n.of(ro(t.left)):r(t.right)})},alt:function(r,i){return n.chain(r,function(r){return ri(r)?n.of(r):n.map(i(),function(n){return rr(n)?ro(t.concat(r.left,n.left)):n})})}}}},Symbol.toStringTag,{value:"Module"}));var Uo=iS(void 0),Ua={concat:Uo.concat,empty:void 0};let Uu=Object.freeze(Object.defineProperty({__proto__:null,Monoid:Ua,Semigroup:Uo},Symbol.toStringTag,{value:"Module"}));var Us=function(t){return function(){return[void 0,t]}},Uc=function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,i],i]}},Ul=function(t){return function(){var n,r=t(),i=r[0],o=i[0];return[o,(0,i[1])(r[1])]}},Ud=function(t){return function(n){return function(){var r=n(),i=r[0],o=r[1];return[[i,t(o)],o]}}},Uf=function(t){return function(n){return function(){var r,i=n();return[i[0],t(i[1])]}}},Up=function(t,n){return n3(t,Uh(n))},Uh=function(t){return function(n){return function(){var r=n(),i=r[0],o=r[1];return[t(i),o]}}},Um="Writer",Ug=function(t){return{URI:Um,_E:void 0,of:function(n){return function(){return[n,t.empty]}}}},Uy=function(t){return{URI:Um,_E:void 0,map:Up,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)]}}}},Uv=function(t){var n=Uy(t),r=Ug(t);return{URI:Um,_E:void 0,map:Up,ap:n.ap,of:r.of}};function Ub(t){var n=Uy(t);return{URI:Um,_E:void 0,map:Up,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 Ux={URI:Um,map:Up},UM=r_(Ux),UT=function(t){return t()[0]},US=function(t){return t()[1]},Uw=function(t){return t()[0]},UI=function(t){return t()[1]};let U_=Object.freeze(Object.defineProperty({__proto__:null,Functor:Ux,URI:Um,censor:Uf,evalWriter:Uw,evaluate:UT,execWriter:UI,execute:US,flap:UM,getApplicative:Uv,getApply:Uy,getChain:Ub,getMonad:function(t){var n=Uv(t),r=Ub(t);return{URI:Um,_E:void 0,map:Up,ap:n.ap,of:n.of,chain:r.chain}},getPointed:Ug,listen:Uc,listens:Ud,map:Uh,pass:Ul,tell:Us,writer:Ux},Symbol.toStringTag,{value:"Module"})),UO=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"})),Uk=Object.freeze(Object.defineProperty({__proto__:null,alt:nz,alternative:nU,applicative:rE,apply:rw,array:fP,bifunctor:fF,boolean:fq,booleanAlgebra:fZ,bounded:fX,boundedDistributiveLattice:f2,boundedJoinSemilattice:f4,boundedLattice:f3,boundedMeetSemilattice:f5,category:f9,chain:rA,chainRec:f6,choice:pt,comonad:pn,compactable:hV,console:hG,const:h6,contravariant:h7,date:mr,distributiveLattice:f1,either:gM,eitherT:g$,endomorphism:gq,eq:r1,extend:gG,field:gQ,filterable:g1,filterableWithIndex:g2,foldable:g6,foldableWithIndex:yn,fromEither:r$,fromIO:ya,fromReader:y2,fromState:vE,fromTask:vL,fromThese:vF,function:n8,functor:rC,functorWithIndex:vU,group:vW,heytingAlgebra:vB,hkt:vV,identity:bh,invariant:bm,io:bK,ioEither:x0,ioOption:Tu,ioRef:Tc,joinSemilattice:Tl,json:Tp,lattice:Th,magma:ix,map:wt,meetSemilattice:wn,monad:wr,monadIO:wi,monadTask:wo,monadThrow:wa,monoid:wx,naturalTransformation:wM,nonEmptyArray:uW,number:uJ,option:hU,optionT:Ms,ord:ih,ordering:wk,pipeable:wC,pointed:wN,predicate:pp,profunctor:wj,random:wL,reader:yQ,readerEither:IP,readerT:IV,readerTask:Op,readerTaskEither:Nx,readonlyArray:lN,readonlyMap:Sm,readonlyNonEmptyArray:ac,readonlyRecord:Eo,readonlySet:EA,readonlyTuple:Rt,record:Rq,refinement:R2,ring:R5,semigroup:iL,semigroupoid:R9,semiring:R8,separated:se,set:Dv,show:DM,state:vI,stateReaderTaskEither:AH,stateT:DN,store:A6,string:Nz,strong:Lt,struct:Li,task:_S,taskEither:kW,taskOption:Py,taskThese:FQ,these:P3,theseT:Fc,traced:F2,traversable:F5,traversableWithIndex:F9,tree:zF,tuple:Un,unfoldable:Ur,validationT:Ui,void:Uu,witherable:si,writer:U_,writerT:UO,zero:sa},Symbol.toStringTag,{value:"Module"})),UC=_(Uk);var UN={},Uj={},UE={},UR={};!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 d(t){return t+1}function f(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=d,t.decrement=f,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],d=1;d<arguments.length;d++)l=arguments[d](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}(UR);var UD={},UA=I&&I.__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(UD,"__esModule",{value:!0}),UD.fromReadonlyNonEmptyArray=UD.has=UD.emptyRecord=UD.emptyReadonlyArray=UD.tail=UD.head=UD.isNonEmpty=UD.singleton=UD.right=UD.left=UD.isRight=UD.isLeft=UD.some=UD.none=UD.isSome=UD.isNone=void 0;var UL=function(t){return"None"===t._tag};UD.isNone=UL;var UP=function(t){return"Some"===t._tag};UD.isSome=UP,UD.none={_tag:"None"};var UF=function(t){return{_tag:"Some",value:t}};UD.some=UF;var Uz=function(t){return"Left"===t._tag};UD.isLeft=Uz;var UU=function(t){return"Right"===t._tag};UD.isRight=UU;var UW=function(t){return{_tag:"Left",left:t}};UD.left=UW;var UB=function(t){return{_tag:"Right",right:t}};UD.right=UB;var UV=function(t){return[t]};UD.singleton=UV;var U$=function(t){return t.length>0};UD.isNonEmpty=U$;var UK=function(t){return t[0]};UD.head=UK;var UY=function(t){return t.slice(1)};UD.tail=UY,UD.emptyReadonlyArray=[],UD.emptyRecord={},UD.has=Object.prototype.hasOwnProperty;var Uq=function(t){return UA([t[0]],t.slice(1),!0)};UD.fromReadonlyNonEmptyArray=Uq;var UG=I&&I.__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=I&&I.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),UQ=I&&I.__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)&&UG(n,t,r);return UZ(n,t),n};Object.defineProperty(UE,"__esModule",{value:!0}),UE.sequenceS=UE.sequenceT=UE.getApplySemigroup=UE.apS=UE.apSecond=UE.apFirst=UE.ap=void 0;var UH=UQ(UD);function UJ(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):UJ(t,n-1,o)}}UE.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)}}},UE.apFirst=function(t){return function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}}},UE.apSecond=function(t){return function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}},UE.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)}}},UE.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 UX={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 U0(t){return UH.has.call(UX,t)||(UX[t]=UJ(UR.tuple,t-1,[])),UX[t]}function U1(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 UJ(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,[])}}UE.sequenceT=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=n.length,o=U0(i),a=t.map(n[0],o),u=1;u<i;u++)a=t.ap(a,n[u]);return a}},UE.sequenceS=function(t){return function(n){for(var r=Object.keys(n),i=r.length,o=U1(r),a=t.map(n[r[0]],o),u=1;u<i;u++)a=t.ap(a,n[r[u]]);return a}};var U2={};function U4(t,n){return function(r){return function(i){return t.map(i,function(t){return n.map(t,r)})}}}Object.defineProperty(U2,"__esModule",{value:!0}),U2.getFunctorComposition=U2.bindTo=U2.flap=U2.map=void 0,U2.map=U4,U2.flap=function(t){return function(n){return function(r){return t.map(r,function(t){return t(n)})}}},U2.bindTo=function(t){return function(n){return function(r){return t.map(r,function(t){var r;return(r={})[n]=t,r})}}},U2.getFunctorComposition=function(t,n){var r=U4(t,n);return{map:function(t,n){return(0,UR.pipe)(t,r(n))}}},Object.defineProperty(Uj,"__esModule",{value:!0}),Uj.getApplicativeComposition=Uj.getApplicativeMonoid=void 0,Uj.getApplicativeMonoid=function(t){var n=(0,UE.getApplySemigroup)(t);return function(r){return{concat:n(r).concat,empty:t.of(r.empty)}}},Uj.getApplicativeComposition=function(t,n){var r=(0,U2.getFunctorComposition)(t,n).map,i=(0,UE.ap)(t,n);return{map:r,of:function(r){return t.of(n.of(r))},ap:function(t,n){return(0,UR.pipe)(t,i(n))}}};var U3={};Object.defineProperty(U3,"__esModule",{value:!0}),U3.bind=U3.chainFirst=void 0,U3.chainFirst=function(t){return function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}}},U3.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 U5={};Object.defineProperty(U5,"__esModule",{value:!0}),U5.tailRec=void 0;var U9=function(t,n){for(var r=n(t);"Left"===r._tag;)r=n(r.left);return r.right};U5.tailRec=U9;var U8={},U6=I&&I.__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]}),U7=I&&I.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),We=I&&I.__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)&&U6(n,t,r);return U7(n,t),n};Object.defineProperty(U8,"__esModule",{value:!0}),U8.filterOrElse=U8.chainFirstEitherK=U8.chainEitherK=U8.fromEitherK=U8.chainOptionK=U8.fromOptionK=U8.fromPredicate=U8.fromOption=void 0;var Wt=We(UD);function Wn(t){return function(n){return function(r){return t.fromEither(Wt.isNone(r)?Wt.left(n()):Wt.right(r.value))}}}function Wr(t){var n=Wn(t);return function(t){var r=n(t);return function(t){return(0,UR.flow)(t,r)}}}function Wi(t){return function(n){return(0,UR.flow)(n,t.fromEither)}}U8.fromOption=Wn,U8.fromPredicate=function(t){return function(n,r){return function(i){return t.fromEither(n(i)?Wt.right(i):Wt.left(r(i)))}}},U8.fromOptionK=Wr,U8.chainOptionK=function(t,n){var r=Wr(t);return function(t){var i=r(t);return function(t){return function(r){return n.chain(r,i(t))}}}},U8.fromEitherK=Wi,U8.chainEitherK=function(t,n){var r=Wi(t);return function(t){return function(i){return n.chain(i,r(t))}}},U8.chainFirstEitherK=function(t,n){return(0,UR.flow)(Wi(t),(0,U3.chainFirst)(n))},U8.filterOrElse=function(t,n){return function(r,i){return function(o){return n.chain(o,function(n){return t.fromEither(r(n)?Wt.right(n):Wt.left(i(n)))})}}};var Wo,Wa,Wu,Ws,Wc,Wl,Wd,Wf,Wp,Wh,Wm={};Object.defineProperty(Wo=Wm,"__esModule",{value:!0}),Wo.right=Wo.left=Wo.flap=Wo.Functor=Wo.Bifunctor=Wo.URI=Wo.bimap=Wo.mapLeft=Wo.map=Wo.separated=void 0,Wa=function(t,n){return{left:t,right:n}},Wo.separated=Wa,Wu=function(t,n){return(0,UR.pipe)(t,(0,Wo.map)(n))},Ws=function(t,n){return(0,UR.pipe)(t,(0,Wo.mapLeft)(n))},Wc=function(t,n,r){return(0,UR.pipe)(t,(0,Wo.bimap)(n,r))},Wl=function(t){return function(n){return(0,Wo.separated)((0,Wo.left)(n),t((0,Wo.right)(n)))}},Wo.map=Wl,Wd=function(t){return function(n){return(0,Wo.separated)(t((0,Wo.left)(n)),(0,Wo.right)(n))}},Wo.mapLeft=Wd,Wf=function(t,n){return function(r){return(0,Wo.separated)(t((0,Wo.left)(r)),n((0,Wo.right)(r)))}},Wo.bimap=Wf,Wo.URI="Separated",Wo.Bifunctor={URI:Wo.URI,mapLeft:Ws,bimap:Wc},Wo.Functor={URI:Wo.URI,map:Wu},Wo.flap=(0,U2.flap)(Wo.Functor),Wp=function(t){return t.left},Wo.left=Wp,Wh=function(t){return t.right},Wo.right=Wh;var Wg={},Wy=I&&I.__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]}),Wv=I&&I.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Wb=I&&I.__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)&&Wy(n,t,r);return Wv(n,t),n};Object.defineProperty(Wg,"__esModule",{value:!0}),Wg.filterE=Wg.witherDefault=Wg.wiltDefault=void 0;var Wx=Wb(UD);Wg.wiltDefault=function(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.separate)}}},Wg.witherDefault=function(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.compact)}}},Wg.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?Wx.some(r):Wx.none})})}}}},Bl=UN,Bd=I&&I.__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]}),Bf=I&&I.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Bp=I&&I.__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)&&Bd(n,t,r);return Bf(n,t),n},Object.defineProperty(Bl,"__esModule",{value:!0}),Bl.fold=Bl.match=Bl.foldW=Bl.matchW=Bl.isRight=Bl.isLeft=Bl.fromOption=Bl.fromPredicate=Bl.FromEither=Bl.MonadThrow=Bl.throwError=Bl.ChainRec=Bl.Extend=Bl.extend=Bl.Alt=Bl.alt=Bl.altW=Bl.Bifunctor=Bl.mapLeft=Bl.bimap=Bl.Traversable=Bl.sequence=Bl.traverse=Bl.Foldable=Bl.reduceRight=Bl.foldMap=Bl.reduce=Bl.Monad=Bl.Chain=Bl.chain=Bl.chainW=Bl.Applicative=Bl.Apply=Bl.ap=Bl.apW=Bl.Pointed=Bl.of=Bl.Functor=Bl.map=Bl.getAltValidation=Bl.getApplicativeValidation=Bl.getWitherable=Bl.getFilterable=Bl.getCompactable=Bl.getSemigroup=Bl.getEq=Bl.getShow=Bl.URI=Bl.right=Bl.left=void 0,Bl.getValidation=Bl.getValidationMonoid=Bl.getValidationSemigroup=Bl.getApplyMonoid=Bl.getApplySemigroup=Bl.either=Bl.stringifyJSON=Bl.parseJSON=Bl.sequenceArray=Bl.traverseArray=Bl.traverseArrayWithIndex=Bl.traverseReadonlyArrayWithIndex=Bl.traverseReadonlyNonEmptyArrayWithIndex=Bl.ApT=Bl.apSW=Bl.apS=Bl.bindW=Bl.bind=Bl.bindTo=Bl.Do=Bl.exists=Bl.elem=Bl.toError=Bl.toUnion=Bl.chainNullableK=Bl.fromNullableK=Bl.tryCatchK=Bl.tryCatch=Bl.fromNullable=Bl.orElse=Bl.orElseW=Bl.swap=Bl.filterOrElseW=Bl.filterOrElse=Bl.chainOptionK=Bl.fromOptionK=Bl.duplicate=Bl.flatten=Bl.flattenW=Bl.chainFirstW=Bl.chainFirst=Bl.apSecondW=Bl.apSecond=Bl.apFirstW=Bl.apFirst=Bl.flap=Bl.getOrElse=Bl.getOrElseW=void 0,Bh=Bp(UD),Bl.left=Bh.left,Bl.right=Bh.right,Bm=function(t,n){return(0,UR.pipe)(t,(0,Bl.map)(n))},Bg=function(t,n){return(0,UR.pipe)(t,(0,Bl.ap)(n))},By=function(t,n){return(0,UR.pipe)(t,(0,Bl.chain)(n))},Bv=function(t,n,r){return(0,UR.pipe)(t,(0,Bl.reduce)(n,r))},Bb=function(t){return function(n,r){var i=(0,Bl.foldMap)(t);return(0,UR.pipe)(n,i(r))}},Bx=function(t,n,r){return(0,UR.pipe)(t,(0,Bl.reduceRight)(n,r))},BM=function(t){var n=(0,Bl.traverse)(t);return function(t,r){return(0,UR.pipe)(t,n(r))}},BT=function(t,n,r){return(0,UR.pipe)(t,(0,Bl.bimap)(n,r))},BS=function(t,n){return(0,UR.pipe)(t,(0,Bl.mapLeft)(n))},Bw=function(t,n){return(0,UR.pipe)(t,(0,Bl.alt)(n))},BI=function(t,n){return(0,UR.pipe)(t,(0,Bl.extend)(n))},B_=function(t,n){return(0,U5.tailRec)(n(t),function(t){return(0,Bl.isLeft)(t)?(0,Bl.right)((0,Bl.left)(t.left)):(0,Bl.isLeft)(t.right)?(0,Bl.left)(n(t.right.left)):(0,Bl.right)((0,Bl.right)(t.right.right))})},Bl.URI="Either",BO=function(t,n){return{show:function(r){return(0,Bl.isLeft)(r)?"left(".concat(t.show(r.left),")"):"right(".concat(n.show(r.right),")")}}},Bl.getShow=BO,Bk=function(t,n){return{equals:function(r,i){return r===i||((0,Bl.isLeft)(r)?(0,Bl.isLeft)(i)&&t.equals(r.left,i.left):(0,Bl.isRight)(i)&&n.equals(r.right,i.right))}}},Bl.getEq=Bk,BC=function(t){return{concat:function(n,r){return(0,Bl.isLeft)(r)?n:(0,Bl.isLeft)(n)?r:(0,Bl.right)(t.concat(n.right,r.right))}}},Bl.getSemigroup=BC,BN=function(t){var n=(0,Bl.left)(t.empty);return{URI:Bl.URI,_E:void 0,compact:function(t){return(0,Bl.isLeft)(t)?t:"None"===t.right._tag?n:(0,Bl.right)(t.right.value)},separate:function(t){return(0,Bl.isLeft)(t)?(0,Wm.separated)(t,t):(0,Bl.isLeft)(t.right)?(0,Wm.separated)((0,Bl.right)(t.right.left),n):(0,Wm.separated)(n,(0,Bl.right)(t.right.right))}}},Bl.getCompactable=BN,Bj=function(t){var n=(0,Bl.left)(t.empty),r=(0,Bl.getCompactable)(t),i=r.compact,o=r.separate,a=function(t,r){return(0,Bl.isLeft)(t)||r(t.right)?t:n},u=function(t,r){return(0,Bl.isLeft)(t)?(0,Wm.separated)(t,t):r(t.right)?(0,Wm.separated)(n,(0,Bl.right)(t.right)):(0,Wm.separated)((0,Bl.right)(t.right),n)};return{URI:Bl.URI,_E:void 0,map:Bm,compact:i,separate:o,filter:a,filterMap:function(t,r){if((0,Bl.isLeft)(t))return t;var i=r(t.right);return"None"===i._tag?n:(0,Bl.right)(i.value)},partition:u,partitionMap:function(t,r){if((0,Bl.isLeft)(t))return(0,Wm.separated)(t,t);var i=r(t.right);return(0,Bl.isLeft)(i)?(0,Wm.separated)((0,Bl.right)(i.left),n):(0,Wm.separated)(n,(0,Bl.right)(i.right))}}},Bl.getFilterable=Bj,BE=function(t){var n=(0,Bl.getFilterable)(t),r=(0,Bl.getCompactable)(t);return{URI:Bl.URI,_E:void 0,map:Bm,compact:n.compact,separate:n.separate,filter:n.filter,filterMap:n.filterMap,partition:n.partition,partitionMap:n.partitionMap,traverse:BM,sequence:Bl.sequence,reduce:Bv,foldMap:Bb,reduceRight:Bx,wither:(0,Wg.witherDefault)(Bl.Traversable,r),wilt:(0,Wg.wiltDefault)(Bl.Traversable,r)}},Bl.getWitherable=BE,BR=function(t){return{URI:Bl.URI,_E:void 0,map:Bm,ap:function(n,r){return(0,Bl.isLeft)(n)?(0,Bl.isLeft)(r)?(0,Bl.left)(t.concat(n.left,r.left)):n:(0,Bl.isLeft)(r)?r:(0,Bl.right)(n.right(r.right))},of:Bl.of}},Bl.getApplicativeValidation=BR,BD=function(t){return{URI:Bl.URI,_E:void 0,map:Bm,alt:function(n,r){if((0,Bl.isRight)(n))return n;var i=r();return(0,Bl.isLeft)(i)?(0,Bl.left)(t.concat(n.left,i.left)):i}}},Bl.getAltValidation=BD,BA=function(t){return function(n){return(0,Bl.isLeft)(n)?n:(0,Bl.right)(t(n.right))}},Bl.map=BA,Bl.Functor={URI:Bl.URI,map:Bm},Bl.of=Bl.right,Bl.Pointed={URI:Bl.URI,of:Bl.of},BL=function(t){return function(n){return(0,Bl.isLeft)(n)?n:(0,Bl.isLeft)(t)?t:(0,Bl.right)(n.right(t.right))}},Bl.apW=BL,Bl.ap=Bl.apW,Bl.Apply={URI:Bl.URI,map:Bm,ap:Bg},Bl.Applicative={URI:Bl.URI,map:Bm,ap:Bg,of:Bl.of},BP=function(t){return function(n){return(0,Bl.isLeft)(n)?n:t(n.right)}},Bl.chainW=BP,Bl.chain=Bl.chainW,Bl.Chain={URI:Bl.URI,map:Bm,ap:Bg,chain:By},Bl.Monad={URI:Bl.URI,map:Bm,ap:Bg,of:Bl.of,chain:By},BF=function(t,n){return function(r){return(0,Bl.isLeft)(r)?t:n(t,r.right)}},Bl.reduce=BF,Bz=function(t){return function(n){return function(r){return(0,Bl.isLeft)(r)?t.empty:n(r.right)}}},Bl.foldMap=Bz,BU=function(t,n){return function(r){return(0,Bl.isLeft)(r)?t:n(r.right,t)}},Bl.reduceRight=BU,Bl.Foldable={URI:Bl.URI,reduce:Bv,foldMap:Bb,reduceRight:Bx},BW=function(t){return function(n){return function(r){return(0,Bl.isLeft)(r)?t.of((0,Bl.left)(r.left)):t.map(n(r.right),Bl.right)}}},Bl.traverse=BW,BB=function(t){return function(n){return(0,Bl.isLeft)(n)?t.of((0,Bl.left)(n.left)):t.map(n.right,Bl.right)}},Bl.sequence=BB,Bl.Traversable={URI:Bl.URI,map:Bm,reduce:Bv,foldMap:Bb,reduceRight:Bx,traverse:BM,sequence:Bl.sequence},BV=function(t,n){return function(r){return(0,Bl.isLeft)(r)?(0,Bl.left)(t(r.left)):(0,Bl.right)(n(r.right))}},Bl.bimap=BV,B$=function(t){return function(n){return(0,Bl.isLeft)(n)?(0,Bl.left)(t(n.left)):n}},Bl.mapLeft=B$,Bl.Bifunctor={URI:Bl.URI,bimap:BT,mapLeft:BS},BK=function(t){return function(n){return(0,Bl.isLeft)(n)?t():n}},Bl.altW=BK,Bl.alt=Bl.altW,Bl.Alt={URI:Bl.URI,map:Bm,alt:Bw},BY=function(t){return function(n){return(0,Bl.isLeft)(n)?n:(0,Bl.right)(t(n))}},Bl.extend=BY,Bl.Extend={URI:Bl.URI,map:Bm,extend:BI},Bl.ChainRec={URI:Bl.URI,map:Bm,ap:Bg,chain:By,chainRec:B_},Bl.throwError=Bl.left,Bl.MonadThrow={URI:Bl.URI,map:Bm,ap:Bg,of:Bl.of,chain:By,throwError:Bl.throwError},Bl.FromEither={URI:Bl.URI,fromEither:UR.identity},Bl.fromPredicate=(0,U8.fromPredicate)(Bl.FromEither),Bl.fromOption=(0,U8.fromOption)(Bl.FromEither),Bl.isLeft=Bh.isLeft,Bl.isRight=Bh.isRight,Bq=function(t,n){return function(r){return(0,Bl.isLeft)(r)?t(r.left):n(r.right)}},Bl.matchW=Bq,Bl.foldW=Bl.matchW,Bl.match=Bl.matchW,Bl.fold=Bl.match,BG=function(t){return function(n){return(0,Bl.isLeft)(n)?t(n.left):n.right}},Bl.getOrElseW=BG,Bl.getOrElse=Bl.getOrElseW,Bl.flap=(0,U2.flap)(Bl.Functor),Bl.apFirst=(0,UE.apFirst)(Bl.Apply),Bl.apFirstW=Bl.apFirst,Bl.apSecond=(0,UE.apSecond)(Bl.Apply),Bl.apSecondW=Bl.apSecond,Bl.chainFirst=(0,U3.chainFirst)(Bl.Chain),Bl.chainFirstW=Bl.chainFirst,Bl.flattenW=(0,Bl.chainW)(UR.identity),Bl.flatten=Bl.flattenW,Bl.duplicate=(0,Bl.extend)(UR.identity),Bl.fromOptionK=(0,U8.fromOptionK)(Bl.FromEither),Bl.chainOptionK=(0,U8.chainOptionK)(Bl.FromEither,Bl.Chain),Bl.filterOrElse=(0,U8.filterOrElse)(Bl.FromEither,Bl.Chain),Bl.filterOrElseW=Bl.filterOrElse,BZ=function(t){return(0,Bl.isLeft)(t)?(0,Bl.right)(t.left):(0,Bl.left)(t.right)},Bl.swap=BZ,BQ=function(t){return function(n){return(0,Bl.isLeft)(n)?t(n.left):n}},Bl.orElseW=BQ,Bl.orElse=Bl.orElseW,BH=function(t){return function(n){return null==n?(0,Bl.left)(t):(0,Bl.right)(n)}},Bl.fromNullable=BH,BJ=function(t,n){try{return(0,Bl.right)(t())}catch(r){return(0,Bl.left)(n(r))}},Bl.tryCatch=BJ,BX=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(0,Bl.tryCatch)(function(){return t.apply(void 0,r)},n)}},Bl.tryCatchK=BX,B0=function(t){var n=(0,Bl.fromNullable)(t);return function(t){return(0,UR.flow)(t,n)}},Bl.fromNullableK=B0,B1=function(t){var n=(0,Bl.fromNullableK)(t);return function(t){return(0,Bl.chain)(n(t))}},Bl.chainNullableK=B1,Bl.toUnion=(0,Bl.foldW)(UR.identity,UR.identity),Bl.toError=function(t){return t instanceof Error?t:Error(String(t))},Bl.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,Bl.isLeft)(i)&&n.equals(r,i.right)}},B2=function(t){return function(n){return!(0,Bl.isLeft)(n)&&t(n.right)}},Bl.exists=B2,Bl.Do=(0,Bl.of)(Bh.emptyRecord),Bl.bindTo=(0,U2.bindTo)(Bl.Functor),Bl.bind=(0,U3.bind)(Bl.Chain),Bl.bindW=Bl.bind,Bl.apS=(0,UE.apS)(Bl.Apply),Bl.apSW=Bl.apS,Bl.ApT=(0,Bl.of)(Bh.emptyReadonlyArray),B4=function(t){return function(n){var r=t(0,Bh.head(n));if((0,Bl.isLeft)(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o]);if((0,Bl.isLeft)(a))return a;i.push(a.right)}return(0,Bl.right)(i)}},Bl.traverseReadonlyNonEmptyArrayWithIndex=B4,B3=function(t){var n=(0,Bl.traverseReadonlyNonEmptyArrayWithIndex)(t);return function(t){return Bh.isNonEmpty(t)?n(t):Bl.ApT}},Bl.traverseReadonlyArrayWithIndex=B3,Bl.traverseArrayWithIndex=Bl.traverseReadonlyArrayWithIndex,B5=function(t){return(0,Bl.traverseReadonlyArrayWithIndex)(function(n,r){return t(r)})},Bl.traverseArray=B5,Bl.sequenceArray=(0,Bl.traverseArray)(UR.identity),Bl.parseJSON=function(t,n){return(0,Bl.tryCatch)(function(){return JSON.parse(t)},n)},B9=function(t,n){return(0,Bl.tryCatch)(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},n)},Bl.stringifyJSON=B9,Bl.either={URI:Bl.URI,map:Bm,of:Bl.of,ap:Bg,chain:By,reduce:Bv,foldMap:Bb,reduceRight:Bx,traverse:BM,sequence:Bl.sequence,bimap:BT,mapLeft:BS,alt:Bw,extend:BI,chainRec:B_,throwError:Bl.throwError},Bl.getApplySemigroup=(0,UE.getApplySemigroup)(Bl.Apply),Bl.getApplyMonoid=(0,Uj.getApplicativeMonoid)(Bl.Applicative),B8=function(t,n){return(0,UE.getApplySemigroup)((0,Bl.getApplicativeValidation)(t))(n)},Bl.getValidationSemigroup=B8,B6=function(t,n){return(0,Uj.getApplicativeMonoid)((0,Bl.getApplicativeValidation)(t))(n)},Bl.getValidationMonoid=B6,Bl.getValidation=function(t){var n=(0,Bl.getApplicativeValidation)(t).ap,r=(0,Bl.getAltValidation)(t).alt;return{URI:Bl.URI,_E:void 0,map:Bm,of:Bl.of,chain:By,bimap:BT,mapLeft:BS,reduce:Bv,foldMap:Bb,reduceRight:Bx,extend:BI,traverse:BM,sequence:Bl.sequence,chainRec:B_,throwError:Bl.throwError,ap:n,alt:r}};var WM=globalThis&&globalThis.__extends||(B7=function(t,n){return(B7=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}B7(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),WT=globalThis&&globalThis.__assign||function(){return(WT=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)},WS=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))},Ww=function(t,n,r){return ro([{value:t,context:n,message:r}])},WI=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 mZ(o)?o:n.validate(o.right,r)},this.encode===W_&&n.encode===W_?W_: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}(),W_=function(t){return t};function WO(t){return t.displayName||t.name||"<function".concat(t.length,">")}function Wk(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 WC(t,n){for(var r=n.length,i=0;i<r;i++)t.push(n[i])}var WN=Object.prototype.hasOwnProperty;function Wj(t){return Object.keys(t).map(function(n){return"".concat(n,": ").concat(t[n].name)}).join(", ")}function WE(t){for(var n=0;n<t.length;n++)if(t[n].encode!==W_)return!1;return!0}function WR(t){return"{ ".concat(Wj(t)," }")}function WD(t){return"Partial<".concat(t,">")}function WA(t){if(WV(t)){var n,r,i=t.value;if(W3.is(i))return(n={})[i]=null,n}else{if(r=t,"KeyofType"===r._tag)return t.keys;if(WK(t)){var o=t.types.map(function(t){return WA(t)});return o.some(WJ.is)?void 0:Object.assign.apply(Object,WS([{}],o,!1))}}}function WL(t){return"("+t.map(function(t){return t.name}).join(" | ")+")"}function WP(t,n){for(var r=!0,i=!0,o=!Bi.is(t),a=0;a<n.length;a++){var u=n[a];u!==t&&(r=!1),Bi.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)(!WN.call(s,l)||o||u[l]!==t[l])&&(s[l]=u[l])}return s}function WF(t,n){for(var r=Object.getOwnPropertyNames(t),i=!1,o={},a=0;a<r.length;a++){var u=r[a];WN.call(n,u)?o[u]=t[u]:i=!0}return i?o:t}function Wz(t){return t.length>0}var WU={};function WW(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 WB(t){return"AnyType"===t._tag}function WV(t){return"LiteralType"===t._tag}function W$(t){return"InterfaceType"===t._tag}function WK(t){return"UnionType"===t._tag}var WY=[];function Wq(t){if(-1!==WY.indexOf(t))return WU;if(W$(t)||"StrictType"===(n=t)._tag){var n,r,i,o,a,u=WU;for(var s in t.props){var c=t.props[s];WV(c)&&(u===WU&&(u={}),u[s]=[c.value])}return u}if("ExactType"===t._tag||"RefinementType"===t._tag)return Wq(t.type);if("IntersectionType"===t._tag)return t.types.reduce(function(t,n){return function(t,n){if(t===WU)return n;if(n===WU)return t;var r=Object.assign({},t);for(var i in n)if(WN.call(t,i)){var o=WW(t[i],n[i]);if(Wz(o))r[i]=o;else{r=WU;break}}else r[i]=n[i];return r}(t,Wq(n))},WU);if(WK(t))return t.types.slice(1).reduce(function(t,n){return function(t,n){if(t===WU||n===WU)return WU;var r=WU;for(var i in t)WN.call(n,i)&&0===WW(t[i],n[i]).length&&(r===WU&&(r={}),r[i]=t[i].concat(n[i]));return r}(t,Wq(n))},Wq(t.types[0]));if("RecursiveType"===t._tag){WY.push(t);var l=Wq(t.type);return WY.pop(),l}return WU}function WG(t){var n=Wq(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=Wq(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 WZ=function(t){function n(){var n=t.call(this,"null",function(t){return null===t},function(t,r){return n.is(t)?ra(t):Ww(t,r)},W_)||this;return n._tag="NullType",n}return WM(n,t),n}(WI),WQ=new WZ,WH=function(t){function n(){var n=t.call(this,"undefined",function(t){return void 0===t},function(t,r){return n.is(t)?ra(t):Ww(t,r)},W_)||this;return n._tag="UndefinedType",n}return WM(n,t),n}(WI),WJ=new WH,WX=function(t){function n(){var n=t.call(this,"void",WJ.is,WJ.validate,W_)||this;return n._tag="VoidType",n}return WM(n,t),n}(WI),W0=new WX,W1=function(t){function n(){var n=t.call(this,"unknown",function(t){return!0},ra,W_)||this;return n._tag="UnknownType",n}return WM(n,t),n}(WI),W2=new W1,W4=function(t){function n(){var n=t.call(this,"string",function(t){return"string"==typeof t},function(t,r){return n.is(t)?ra(t):Ww(t,r)},W_)||this;return n._tag="StringType",n}return WM(n,t),n}(WI),W3=new W4,W5=function(t){function n(){var n=t.call(this,"number",function(t){return"number"==typeof t},function(t,r){return n.is(t)?ra(t):Ww(t,r)},W_)||this;return n._tag="NumberType",n}return WM(n,t),n}(WI),W9=new W5,W8=function(t){function n(){var n=t.call(this,"bigint",function(t){return"bigint"==typeof t},function(t,r){return n.is(t)?ra(t):Ww(t,r)},W_)||this;return n._tag="BigIntType",n}return WM(n,t),n}(WI),W6=new W8,W7=function(t){function n(){var n=t.call(this,"boolean",function(t){return"boolean"==typeof t},function(t,r){return n.is(t)?ra(t):Ww(t,r)},W_)||this;return n._tag="BooleanType",n}return WM(n,t),n}(WI),Be=new W7,Bt=function(t){function n(){var n=t.call(this,"UnknownArray",Array.isArray,function(t,r){return n.is(t)?ra(t):Ww(t,r)},W_)||this;return n._tag="AnyArrayType",n}return WM(n,t),n}(WI),Bn=new Bt,Br=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)?ra(t):Ww(t,r)},W_)||this;return n._tag="AnyDictionaryType",n}return WM(n,t),n}(WI),Bi=new Br,Bo=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 WM(n,t),n}(WI);function Ba(t,n){void 0===n&&(n=JSON.stringify(t));var r=function(n){return n===t};return new Bo(n,r,function(n,i){return r(n)?ra(t):Ww(n,i)},W_,t)}var Bu=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 WM(n,t),n}(WI),Bs=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 WM(n,t),n}(WI);function Bc(t,n,r){return VD(t,n,r)}var Bl,Bd,Bf,Bp,Bh,Bm,Bg,By,Bv,Bb,Bx,BM,BT,BS,Bw,BI,B_,BO,Bk,BC,BN,Bj,BE,BR,BD,BA,BL,BP,BF,Bz,BU,BW,BB,BV,B$,BK,BY,Bq,BG,BZ,BQ,BH,BJ,BX,B0,B1,B2,B4,B3,B5,B9,B8,B6,B7,Ve,Vt,Vn=VD(W9,Vt=function(t){return Number.isInteger(t)},"Int"),Vr=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 WM(n,t),n}(WI);function Vi(t,n){var r,i=function(){return r||((r=n(o)).name=t),r},o=new Vr(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(Vr.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});var Vo=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 WM(n,t),n}(WI);function Va(t,n){return void 0===n&&(n="Array<".concat(t.name,">")),new Vo(n,function(n){return Bn.is(n)&&n.every(t.is)},function(n,r){var i=Bn.validate(n,r);if(mZ(i))return i;for(var o=i.right,a=o.length,u=o,s=[],c=0;c<a;c++){var l=o[c],d=t.validate(l,Wk(r,String(c),t,l));if(mZ(d))WC(s,d.left);else{var f=d.right;f!==l&&(u===o&&(u=o.slice()),u[c]=f)}}return s.length>0?ro(s):ra(u)},t.encode===W_?W_:function(n){return n.map(t.encode)},t)}var Vu=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 WM(n,t),n}(WI);function Vs(t,n){void 0===n&&(n=WR(t));var r=Object.keys(t),i=r.map(function(n){return t[n]}),o=r.length;return new Vu(n,function(t){if(Bi.is(t)){for(var n=0;n<o;n++){var a=r[n],u=t[a];if(void 0===u&&!WN.call(t,a)||!i[n].is(u))return!1}return!0}return!1},function(t,n){var a=Bi.validate(t,n);if(mZ(a))return a;for(var u=a.right,s=u,c=[],l=0;l<o;l++){var d=r[l],f=s[d],p=i[l],h=p.validate(f,Wk(n,d,p,f));if(mZ(h))WC(c,h.left);else{var m=h.right;m===f&&(void 0!==m||WN.call(s,d))||(s===u&&(s=WT({},u)),s[d]=m)}}return c.length>0?ro(c):ra(s)},WE(i)?W_:function(t){for(var n=WT({},t),a=0;a<o;a++){var u=r[a],s=i[a].encode;s!==W_&&(n[u]=s(t[u]))}return n},t)}var Vc=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 WM(n,t),n}(WI),Vl=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 WM(n,t),n}(WI);function Vd(t,n,r){var i,o,a,u,s,c,l,d,f=WA(t);return f?(i=Object.keys(f),void 0===(u=r)&&(u="{ [K in ".concat(t.name,"]: ").concat(n.name," }")),s=i.length,new Vl(u,function(t){return Bi.is(t)&&i.every(function(r){return n.is(t[r])})},function(t,r){var o=Bi.validate(t,r);if(mZ(o))return o;for(var a=o.right,u={},c=[],l=!1,d=0;d<s;d++){var f=i[d],p=a[f],h=n.validate(p,Wk(r,f,n,p));if(mZ(h))WC(c,h.left);else{var m=h.right;l=l||m!==p,u[f]=m}}return c.length>0?ro(c):ra(l||Object.keys(a).length!==s?u:a)},n.encode===W_?W_: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===(d=r)&&(d="{ [K in ".concat(c.name,"]: ").concat(n.name," }")),new Vl(d,function(t){return Bi.is(t)?Object.keys(t).every(function(r){return c.is(r)&&n.is(t[r])}):WB(n)&&Array.isArray(t)},function(t,r){if(Bi.is(t)){for(var i={},o=[],a=Object.keys(t),u=a.length,s=!1,l=0;l<u;l++){var d=a[l],f=t[d],p=c.validate(d,Wk(r,d,c,d));if(mZ(p))WC(o,p.left);else{var h=p.right;s=s||h!==d,d=h;var m=n.validate(f,Wk(r,d,n,f));if(mZ(m))WC(o,m.left);else{var g=m.right;s=s||g!==f,i[d]=g}}}return o.length>0?ro(o):ra(s?i:t)}return WB(n)&&Array.isArray(t)?ra(t):Ww(t,r)},c.encode===W_&&n.encode===W_?W_: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 Vf=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 WM(n,t),n}(WI);function Vp(t,n){void 0===n&&(n=WL(t));var r=WG(t);if(void 0===r||!(t.length>0))return new Vf(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,Wk(r,String(o),a,n));if(!mZ(u))return ra(u.right);WC(i,u.left)}return ro(i)},WE(t)?W_: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 Vw(n,function(n){if(Bi.is(n)){var r=u(n[i]);return void 0!==r&&t[r].is(n)}return!1},function(n,r){var o=Bi.validate(n,r);if(mZ(o))return o;var a=o.right,s=u(a[i]);if(void 0===s)return Ww(n,r);var c=t[s];return c.validate(a,Wk(r,String(s),c,a))},WE(t)?W_: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 Vh=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 WM(n,t),n}(WI),Vm=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 WM(n,t),n}(WI),Vg=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 WM(n,t),n}(WI),Vy=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 WM(n,t),n}(WI);function Vv(t,n){void 0===n&&(n="ReadonlyArray<".concat(t.name,">"));var r=Va(t);return new Vy(n,r.is,r.validate,r.encode,t)}var Vb=function(t,n){return VM(Vs(t),n)},Vx=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 WM(n,t),n}(WI);function VM(t,n){void 0===n&&(n=W$(i=t)?"{| ".concat(Wj(i.props)," |}"):(r=i,"PartialType"===r._tag)?WD("{| ".concat(Wj(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 Vx(n,t.is,function(n,r){var i=Bi.validate(n,r);if(mZ(i))return i;var a=t.validate(n,r);return mZ(a)?a:ra(WF(a.right,o))},function(n){return t.encode(WF(n,o))},t)}var VT=function(t){function n(){var n=t.call(this,"Function",function(t){return"function"==typeof t},function(t,r){return n.is(t)?ra(t):Ww(t,r)},W_)||this;return n._tag="FunctionType",n}return WM(n,t),n}(WI),VS=new VT,Vw=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 WM(n,t),n}(Vf),VI=function(t,n,r){void 0===r&&(r=WL(n));var i=Vp(n,r);return i instanceof Vw?i:(console.warn("[io-ts] Cannot build a tagged union for ".concat(r,", returning a de-optimized union")),new Vw(r,i.is,i.validate,i.encode,n,t))},V_=function(t,n){return{value:t,context:n}},VO=function(t){return[{key:"",type:t}]},Vk=function(t){function n(){var n=t.call(this,"never",function(t){return!1},function(t,n){return Ww(t,n)},function(){throw Error("cannot encode never")})||this;return n._tag="NeverType",n}return WM(n,t),n}(WI),VC=new Vk,VN=function(t){function n(){var n=t.call(this,"any",function(t){return!0},ra,W_)||this;return n._tag="AnyType",n}return WM(n,t),n}(WI),Vj=new VN,VE=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)?ra(t):Ww(t,r)},W_)||this;return n._tag="ObjectType",n}return WM(n,t),n}(WI),VR=new VE;function VD(t,n,r){return void 0===r&&(r="(".concat(t.name," | ").concat(WO(n),")")),new Bs(r,function(r){return t.is(r)&&n(r)},function(r,i){var o=t.validate(r,i);if(mZ(o))return o;var a=o.right;return n(a)?ra(a):Ww(a,i)},t.encode,t,n)}var VA=VD(W9,Number.isInteger,"Integer"),VL=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 WM(n,t),n}(WI);function VP(t){return t}let VF=Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:Bt,AnyDictionaryType:Br,AnyType:VN,Array:Bn,ArrayType:Vo,BigIntType:W8,BooleanType:W7,Dictionary:Bi,DictionaryType:Vl,ExactType:Vx,Function:VS,FunctionType:VT,Int:Vn,Integer:VA,InterfaceType:Vu,IntersectionType:Vh,KeyofType:Bu,LiteralType:Bo,NeverType:Vk,NullType:WZ,NumberType:W5,ObjectType:VE,PartialType:Vc,ReadonlyArrayType:Vy,ReadonlyType:Vg,RecursiveType:Vr,RefinementType:Bs,StrictType:VL,StringType:W4,TaggedUnionType:Vw,TupleType:Vm,Type:WI,UndefinedType:WH,UnionType:Vf,UnknownArray:Bn,UnknownRecord:Bi,UnknownType:W1,VoidType:WX,alias:function(t){return function(){return t}},any:Vj,appendContext:Wk,array:Va,bigint:W6,boolean:Be,brand:Bc,clean:VP,dictionary:Vd,emptyTags:WU,exact:VM,failure:Ww,failures:ro,getContextEntry:function(t,n){return{key:t,type:n}},getDefaultContext:VO,getDomainKeys:WA,getFunctionName:WO,getIndex:WG,getTags:Wq,getValidationError:V_,identity:W_,interface:Vs,intersection:function(t,n){void 0===n&&(n="(".concat(t.map(function(t){return t.name}).join(" & "),")"));var r=t.length;return new Vh(n,function(n){return t.every(function(t){return t.is(n)})},0===t.length?ra:function(n,i){for(var o=[],a=[],u=0;u<r;u++){var s=t[u],c=s.validate(n,Wk(i,String(u),s,n));mZ(c)?WC(a,c.left):o.push(c.right)}return a.length>0?ro(a):ra(WP(n,o))},0===t.length?W_: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 W3.is(n)&&WN.call(t,n)};return new Bu(n,r,function(t,n){return r(t)?ra(t):Ww(t,n)},W_,t)},literal:Ba,mergeAll:WP,never:VC,null:WQ,nullType:WQ,number:W9,object:VR,partial:function(t,n){void 0===n&&(n=WD(WR(t)));var r=Object.keys(t),i=r.map(function(n){return t[n]}),o=r.length;return new Vc(n,function(n){if(Bi.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=Bi.validate(n,i);if(mZ(a))return a;for(var u=a.right,s=u,c=[],l=0;l<o;l++){var d=r[l],f=s[d],p=t[d],h=p.validate(f,Wk(i,d,p,f));if(mZ(h))void 0!==f&&WC(c,h.left);else{var m=h.right;m!==f&&(s===u&&(s=WT({},u)),s[d]=m)}}return c.length>0?ro(c):ra(s)},WE(i)?W_:function(t){for(var n=WT({},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 Vg(n,t.is,t.validate,t.encode,t)},readonlyArray:Vv,record:Vd,recursion:Vi,refinement:VD,strict:Vb,string:W3,success:ra,taggedUnion:VI,tuple:function(t,n){void 0===n&&(n="[".concat(t.map(function(t){return t.name}).join(", "),"]"));var r=t.length;return new Vm(n,function(n){return Bn.is(n)&&n.length===r&&t.every(function(t,r){return t.is(n[r])})},function(n,i){var o=Bn.validate(n,i);if(mZ(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],d=t[c],f=d.validate(l,Wk(i,String(c),d,l));if(mZ(f))WC(s,f.left);else{var p=f.right;p!==l&&(u===a&&(u=a.slice()),u[c]=p)}}return s.length>0?ro(s):ra(u)},WE(t)?W_:function(n){return t.map(function(t,r){return t.encode(n[r])})},t)},type:Vs,undefined:WJ,union:Vp,unknown:W2,void:W0,voidType:W0},Symbol.toStringTag,{value:"Module"})),Vz=_(VF);var VU={};Object.defineProperty(VU,"__esModule",{value:!0}),VU.ContentPath=void 0,VU.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 VW={},VB={};Object.defineProperty(VB,"__esModule",{value:!0}),VB.getAssetOrThrow=void 0;let VV=t=>n=>{let r=t[n];if(!r)throw Error(`Missing asset with id '${n}'!`);return r};VB.getAssetOrThrow=VV;var V$={};Object.defineProperty(V$,"__esModule",{value:!0}),V$.getEmbedOrThrow=void 0;let VK=t=>n=>{let r=t[n];if(!r)throw Error(`Missing embed with url '${n}'`);return r};V$.getEmbedOrThrow=VK;var VY={},Vq={};let VG=_(n8);function VZ(t,n,r){return void 0===r&&(r=t.name),new WI(r,t.is,t.validate,function(r){return n(t.encode(r))})}let VQ=Object.freeze(Object.defineProperty({__proto__:null,mapOutput:VZ},Symbol.toStringTag,{value:"Module"}));var VH,VJ,VX,V0=VD(W3,VJ=function(t){return t.length>0},"NonEmptyString");function V1(t,n){void 0===n&&(n="NonEmptyArray<"+t.name+">");var r=Va(t);return new WI(n,function(t){return r.is(t)&&ad(t)},function(t,n){return n3(r.validate(t,n),mR(function(r){var i=aT(r);return hu(i)?Ww(t,n):ra(i.value)}))},function(t){return r.encode(t)})}function V2(t,n,r){void 0===r&&(r="Set<"+t.name+">");var i=Va(t),o=Dy(n),a=Dl(n);return new WI(r,function(n){return n instanceof Set&&EI(t.is)(n)},function(t,n){return n3(i.validate(t,n),mR(function(r){var i=a(r);return i.size!==r.length?Ww(t,n):ra(i)}))},function(t){return i.encode(o(t))})}function V4(t,n){return new WI(t,n,function(t,r){return n(t)?ra(t):Ww(t,r)},W_)}var V3=V4("Date",function(t){return t instanceof Date}),V5=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))},V9=function(t,n){return{get:t,reverseGet:n}},V8=function(t){return $t(t.get,nX(t.reverseGet,nG))},V6=function(t){return $f(nX(t.get,rn),t.reverseGet)},V7=function(t){return $y(nX(t.get,rn),nX(t.reverseGet,nG))},$e=function(t){return $S(function(n){return function(r){return function(i){return n.map(r(t.get(i)),function(n){return t.reverseGet(n)})}}})},$t=function(t,n){return{get:t,set:n}},$n=function(t){return $y(nX(t.get,rn),t.set)},$r=function(t){return $S(function(n){return function(r){return function(i){return n.map(r(t.get(i)),function(n){return t.set(n)(i)})}}})},$i=function(t){return function(n){return $t(function(r){return t.get(n.get(r))},function(r){return function(i){return n.set(t.set(r)(n.get(i)))(i)}})}},$o=function(t){return function(n){return $f(nX(n.getOption,pW(t.getOption)),nX(t.reverseGet,n.reverseGet))}},$a=function(t){return function(n){return $M($p(t))($n(n))}},$u=function(){return $t(nq,nG)},$s=function(t){return function(n){return $t(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)}})}},$c=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(n){return $t(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}})}},$l=function(t){return function(n){return $t(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)}})}},$d=function(t){return function(n){var r;return n3(n,$i(({at:r=function(t){return $t(function(n){return N0(t,n)},hs(function(){return NQ(t)},function(n){return NG(t,n)}))}}).at(t)))}},$f=function(t,n){return{getOption:t,reverseGet:n}},$p=function(t){return $y(t.getOption,function(n){return $m(n)(t)})},$h=function(t){return $S(function(n){return function(r){return function(i){return n3(t.getOption(i),hs(function(){return n.of(i)},function(o){return n.map(r(o),function(n){return $m(n)(t)(i)})}))}}})},$m=function(t){var n;return n=function(){return t},function(t){var r,i,o=(r=t,function(t){return n3(r.getOption(t),pA(function(i){var o=n(i);return o===i?t:r.reverseGet(o)}))});return function(t){return n3(o(t),hc(function(){return t}))}}},$g=function(t){return $f(ph(t),nq)},$y=function(t,n){return{getOption:t,set:n}},$v=function(t){return $S(function(n){return function(r){return function(i){return n3(t.getOption(i),hs(function(){return n.of(i)},function(o){return n.map(r(o),function(n){return t.set(n)(i)})}))}}})},$b=function(t){return function(n){return function(r){return n3(n.getOption(r),pA(function(i){var o=t(i);return o===i?r:n.set(o)(r)}))}}},$x=function(t){return function(n){var r=$b(t)(n);return function(t){return n3(r(t),hc(function(){return t}))}}},$M=function(t){return function(n){return $y(nX(n.getOption,pW(t.getOption)),function(r){return $x(t.set(r))(n)})}},$T=function(t,n,r){if(r[t]===n)return r;var i=V5([r[0]],r.slice(1),!0);return i[t]=n,i},$S=function(t){return{modifyF:t}};function $w(t){return function(n){return $S(function(r){return function(i){return n.modifyF(r)(t.modifyF(r)(i))}})}}var $I={URI:"Identity",map:function(t,n){return n(t)},of:nq,ap:function(t,n){return t(n)}},$_=function(t){return{index:t}},$O=nX(V8,$i),$k=function(t){return nX($n,$M(t))},$C=function(t){return nX($r,$w(t))},$N=function(t){return function(n){return function(r){var i=n.get(r),o=t(i);return i===o?r:n.set(o)(r)}}},$j=function(t){return $a($f(hv,nq))(t)},$E=function(t){var n;return nX($n,function(n){return n3(n,$M($_(function(t){return $y(function(n){return sx(t,n)},function(n){return function(r){return n3(sx(t,r),hs(function(){return r},function(){return lv(t,n,r)}))}})}).index(t)))})},$R=function(t){var n;return nX($n,function(n){return n3(n,$M($_(function(t){return $y(function(n){return sx(t,n)},function(n){return function(r){return n3(sx(t,r),hs(function(){return r},function(){return $T(t,n,r)}))}})}).index(t)))})},$D=function(t){var n;return nX($n,function(n){return n3(n,$M($_(function(t){return $y(function(n){return N0(t,n)},function(n){return function(r){return r[t]===n||hu(N0(t,r))?r:NG(t,n)(r)}})}).index(t)))})},$A=$a($f(nq,rn)),$L=$a($f(pg,ra)),$P=$a($f(function(t){return mZ(t)?rn(t.left):rt},ro)),$F=function(t,n){return function(r){return $z(r,t,n)}},$z=function(t,n,r){return $t(nX(t.get,n),nX(r,t.set))},$U="monocle-ts/Lens",$W={URI:$U,compose:function(t,n){return $i(t)(n)}},$B={URI:$U,compose:$W.compose,id:$u};let $V=Object.freeze(Object.defineProperty({__proto__:null,Category:$B,Invariant:{URI:$U,imap:$z},Semigroupoid:$W,URI:$U,asOptional:$n,asTraversal:$r,atKey:$d,component:$l,compose:$i,composeIso:$O,composeLens:$i,composeOptional:$k,composePrism:$a,composeTraversal:$C,filter:function(t){return $a($g(t))},findFirst:function(t){var n;return $k($y(sj(t),function(n){return function(r){return n3(sN(t)(r),hs(function(){return r},function(t){return lv(t,n,r)}))}}))},findFirstNonEmpty:function(t){var n;return $k($y(sj(t),function(n){return function(r){return n3(sN(t)(r),hs(function(){return r},function(t){return $T(t,n,r)}))}}))},fromNullable:$j,id:$u,imap:$F,index:$E,indexNonEmpty:$R,key:$D,left:$P,lens:$t,modify:$N,modifyF:function(t){return function(n){return function(r){return function(i){return n3(r.get(i),n,function(n){return t.map(n,function(t){return r.set(t)(i)})})}}}},prop:$s,props:$c,right:$L,some:$A,traverse:function(t){var n,r;return nX($r,$w($S(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 $$=function(t){return function(n){return n.modifyF($I)(t)}},$K=function(t){return new $H(t.get,t.reverseGet)},$Y=function(t){return new $J(t.get,t.set)},$q=function(t){return new $X(t.getOption,t.reverseGet)},$G=function(t){return new $1(t.getOption,t.set)},$Z=function(t){return new $2(t.modifyF)},$Q=function(t,n,r){var i;return r===t[n]?t:Object.assign({},t,((i={})[n]=r,i))},$H=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 $K(V9(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 $Y(V8(this))},t.prototype.asPrism=function(){return $q(V6(this))},t.prototype.asOptional=function(){return $G(V7(this))},t.prototype.asTraversal=function(){return $Z($e(this))},t.prototype.asFold=function(){var t=this;return new $3(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.asGetter=function(){var t=this;return new $4(function(n){return t.get(n)})},t.prototype.asSetter=function(){var t=this;return new $5(function(n){return t.modify(n)})},t.prototype.compose=function(t){var n,r;return $K((r=this,V9(nX(r.get,t.get),nX(t.reverseGet,r.reverseGet))))},t.prototype.composeIso=function(t){return this.compose(t)},t.prototype.composeLens=function(t){return $Y(n3(this,V8,$i(t)))},t.prototype.composePrism=function(t){return $q(n3(this,V6,$o(t)))},t.prototype.composeOptional=function(t){return $G(n3(this,V7,$M(t)))},t.prototype.composeTraversal=function(t){return $Z(n3(this,$e,$w(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}(),$J=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 $Y(n3($u(),$s(t)))}},t.fromProps=function(){return function(t){return $Y(n3($u(),$c.apply($V,t)))}},t.fromNullableProp=function(){return function(n,r){return new t(function(t){var i=hv(t[n]);return hu(i)?r:i.value},function(t){return function(r){return $Q(r,n,t)}})}},t.prototype.modify=function(t){return $N(t)(this)},t.prototype.asOptional=function(){return $G($n(this))},t.prototype.asTraversal=function(){return $Z($r(this))},t.prototype.asSetter=function(){var t=this;return new $5(function(n){return t.modify(n)})},t.prototype.asGetter=function(){var t=this;return new $4(function(n){return t.get(n)})},t.prototype.asFold=function(){var t=this;return new $3(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.compose=function(t){return $Y($i(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 $G(n3(this,$n,$M(t)))},t.prototype.composeTraversal=function(t){return $Z(n3(this,$r,$w(t)))},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeIso=function(t){return $Y(n3(this,$i(n3(t,V8))))},t.prototype.composePrism=function(t){return $G($a(t)(this))},t}(),$X=function(){function t(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return t.fromPredicate=function(t){return $q($g(t))},t.some=function(){return $0},t.prototype.modify=function(t){var n=this;return function(r){var i=n.modifyOption(t)(r);return hu(i)?r:i.value}},t.prototype.modifyOption=function(t){var n=this;return function(r){return hA.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 $G($p(this))},t.prototype.asTraversal=function(){return $Z($h(this))},t.prototype.asSetter=function(){var t=this;return new $5(function(n){return t.modify(n)})},t.prototype.asFold=function(){var t=this;return new $3(function(n){return function(r){return function(i){var o=t.getOption(i);return hu(o)?n.empty:r(o.value)}}})},t.prototype.compose=function(t){return $q($o(t)(this))},t.prototype.composePrism=function(t){return this.compose(t)},t.prototype.composeOptional=function(t){return $G(n3(this,$p,$M(t)))},t.prototype.composeTraversal=function(t){return $Z(n3(this,$h,$w(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 $q(n3(this,$o(n3(t,V6))))},t.prototype.composeLens=function(t){var n;return $G((n=t,function(t){return $M($n(n))($p(t))})(this))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),$0=new $X(nq,rn),$1=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 hv(t[n])},function(t){return function(r){return null==r[n]?r:$Q(r,n,t)}})}},t.fromOptionProp=function(){var t=$J.fromProp();return function(n){return t(n).composePrism($0)}},t.prototype.modify=function(t){return $x(t)(this)},t.prototype.modifyOption=function(t){return $b(t)(this)},t.prototype.asTraversal=function(){return $Z($v(this))},t.prototype.asFold=function(){var t=this;return new $3(function(n){return function(r){return function(i){var o=t.getOption(i);return hu(o)?n.empty:r(o.value)}}})},t.prototype.asSetter=function(){var t=this;return new $5(function(n){return t.modify(n)})},t.prototype.compose=function(t){return $G($M(t)(this))},t.prototype.composeOptional=function(t){return this.compose(t)},t.prototype.composeTraversal=function(t){return $Z(n3(this,$v,$w(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 $G(n3(this,$M(n3(t,$n))))},t.prototype.composePrism=function(t){return $G(n3(this,$M(n3(t,$p))))},t.prototype.composeIso=function(t){return $G(n3(this,$M(n3(t,V7))))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),$2=function(){function t(t){this.modifyF=t,this._tag="Traversal"}return t.prototype.modify=function(t){return $$(t)(this)},t.prototype.set=function(t){var n;return $$(function(){return t})(this)},t.prototype.filter=function(t){var n;return $Z($w($h($g(t)))(this))},t.prototype.asFold=function(){var t=this;return new $3(function(n){return function(r){return t.modifyF(hQ(n))(function(t){return nq(r(t))})}})},t.prototype.asSetter=function(){var t=this;return new $5(function(n){return t.modify(n)})},t.prototype.compose=function(t){return $Z($w(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 $Z(n3(this,$w(n3(t,$r))))},t.prototype.composePrism=function(t){return $Z(n3(this,$w(n3(t,$h))))},t.prototype.composeIso=function(t){return $Z(n3(this,$w(n3(t,$e))))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),$4=function(){function t(t){this.get=t,this._tag="Getter"}return t.prototype.asFold=function(){var t=this;return new $3(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}(),$3=function(){function t(t){this.foldMap=t,this._tag="Fold",this.getAll=t(fo())(aF),this.exist=t(wm),this.all=t(wh),this.foldMapFirst=t(hF())}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(ph(t))},t.prototype.headOption=function(t){return this.find(function(){return!0})(t)},t}(),$5=function(){function t(t){this.modify=t,this._tag="Setter"}return t.prototype.set=function(t){return this.modify(nG(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}(),$9=new $H(nq,nq),$8=Vb({_tag:Ba("None")}),$6=Ba("Some");function $7(t,n){return void 0===n&&(n="Option<"+t.name+">"),Vp([$8,Vb({_tag:$6,value:t},"Some<"+t.name+">")],n)}var Ke=new WI("DateFromISOString",function(t){return t instanceof Date},function(t,n){return n3(W3.validate(t,n),mR(function(r){var i=new Date(r);return isNaN(i.getTime())?Ww(t,n):ra(i)}))},function(t){return t.toISOString()});function Kt(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n}var Kn=new WI("DateFromNumber",function(t){return t instanceof Date},function(t,n){return n3(W9.validate(t,n),mR(function(r){var i=new Date(r);return isNaN(i.getTime())?Ww(t,n):ra(i)}))},function(t){return t.getTime()});function Kr(t,n,r){void 0===r&&(r=t.name);var i=Kt(t);return i.validate=n,i.decode=function(t){return n(t,VO(i))},i.name=r,i}var Ki,Ko,Ka,Ku=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Ks=VD(W3,Ko=function(t){return Ku.test(t)},"UUID"),Kc=new WI("BooleanFromString",Be.is,function(t,n){return n3(W3.validate(t,n),mR(function(r){return"true"===r?ra(!0):"false"===r?ra(!1):Ww(t,n)}))},String);function Kl(t){switch(t._tag){case"InterfaceType":return t.props;case"ExactType":return Kl(t.type)}}var Kd=$J.fromProp(),Kf=V4("RegExp",function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}),Kp=new WI("DateFromUnixTime",function(t){return t instanceof Date},function(t,n){return n3(Vn.validate(t,n),mR(function(r){var i=new Date(1e3*r);return isNaN(i.getTime())?Ww(t,n):ra(i)}))},function(t){return Math.floor(t.getTime()/1e3)}),Kh=new WI("NumberFromString",W9.is,function(t,n){return n3(W3.validate(t,n),mR(function(r){var i=+r;return isNaN(i)||""===r.trim()?Ww(t,n):ra(i)}))},String),Km=new WI("IntFromString",Vn.is,function(t,n){return n3(Kh.validate(t,n),mR(function(r){return Vn.is(r)?ra(r):Ww(t,n)}))},Kh.encode),Kg=Vi("JsonArray",function(){return Vv(Kv)}),Ky=Vi("JsonRecord",function(){return Vd(W3,Kv)}),Kv=Vp([Be,W9,W3,WQ,Kg,Ky],"Json"),Kb=new WI("JsonFromString",Kv.is,function(t,n){try{return ra(JSON.parse(t))}catch{return Ww(t,n)}},function(t){return JSON.stringify(t)}),Kx=Ba("Left"),KM=Ba("Right"),KT=new WI("BigIntFromString",function(t){return"bigint"==typeof t},function(t,n){return n3(W3.validate(t,n),mR(function(r){if(!V0.is(r.trim()))return Ww(t,n);try{return ra(BigInt(r))}catch{return Ww(t,n)}}))},String),KS=new WI("BooleanFromNumber",Be.is,function(t,n){return n3(W9.validate(t,n),mI(function(t){return 0!==t}))},Number);let Kw=Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:KT,BooleanFromNumber:KS,BooleanFromString:Kc,DateFromISOString:Ke,DateFromNumber:Kn,DateFromUnixTime:Kp,IntFromString:Km,Json:Kv,JsonArray:Kg,JsonFromString:Kb,JsonRecord:Ky,NonEmptyString:V0,NumberFromString:Kh,UUID:Ks,clone:Kt,date:V3,either:function(t,n,r){return void 0===r&&(r="Either<"+t.name+", "+n.name+">"),Vp([Vb({_tag:Kx,left:t},"Left<"+t.name+">"),Vb({_tag:KM,right:n},"Right<"+t.name+">")],r)},fromNewtype:function(t,n){return void 0===n&&(n="fromNewtype("+t.name+")"),new WI(n,function(n){return t.is(n)},function(n,r){return n3(t.validate(n,r),mI($9.wrap))},function(n){return t.encode($9.unwrap(n))})},fromNullable:function(t,n,r){return void 0===r&&(r="fromNullable("+t.name+")"),Kr(t,function(r,i){return null==r?ra(n):t.validate(r,i)},r)},fromRefinement:V4,getLenses:function(t){var n={};for(var r in Kl(t))n[r]=Kd(r);return n},mapOutput:VZ,nonEmptyArray:V1,option:$7,optionFromNullable:function(t,n){return void 0===n&&(n="Option<"+t.name+">"),new WI(n,$7(t).is,function(n,r){return null==n?ra(rt):n3(t.validate(n,r),mI(rn))},function(n){return hS(n3(n,pA(t.encode)))})},readonlyNonEmptyArray:function(t,n){return void 0===n&&(n="ReadonlyNonEmptyArray<"+t.name+">"),V1(t,n)},readonlySetFromArray:function(t,n,r){return void 0===r&&(r="ReadonlySet<"+t.name+">"),V2(t,n,r)},regexp:Kf,setFromArray:V2,withEncode:function(t,n,r){return void 0===r&&(r=t.name),new WI(r,t.is,t.validate,n)},withFallback:function(t,n,r){return void 0===r&&(r="withFallback("+t.name+")"),Kr(t,function(r,i){return m7(function(){return ra(n)})(t.validate(r,i))},r)},withMessage:function(t,n){return Kr(t,function(r,i){return mB(function(){return[{value:r,context:i,message:n(r,i),actual:r}]})(t.validate(r,i))})},withValidate:Kr},Symbol.toStringTag,{value:"Module"})),KI=_(Kw),K_=_(VQ);Object.defineProperty(Vq,"__esModule",{value:!0}),Vq.withCustomError=Vq.addType=Vq.isEmpty=Vq.objectToMap=Vq.grouped=Vq.formatDate=Vq.formatDateTime=Vq.filterDouble=Vq.refineType=Vq.nullable=void 0;let KO=nL,Kk=(0,KO.__importStar)(Vz);Vq.nullable=function(t){return Kk.union([t,Kk.null,Kk.undefined])},Vq.refineType=function(t,n,r){return new Kk.Type(n,t.is,(n,i)=>(0,VG.pipe)(t.validate(n,i),UC.either.chain(t=>r(t)?Kk.success(t):Kk.failure(n,i))),t.encode)},Vq.filterDouble=function(t){if(""===t)return null;let n=Number(t);return Number.isNaN(n)?null:n},Vq.formatDateTime=function(t){return t.toISOString().replace(/\.\d{3}Z$/,"+0000")},Vq.formatDate=function(t){return t.toISOString().replace(/T.*/,"")},Vq.grouped=function(t,n){return t.reduce((t,r,i)=>(i%n==0?t.push([r]):t[Math.floor(i/n)].push(r),t),[])},Vq.objectToMap=function(t){return new Map(Object.entries(t))},Vq.isEmpty=function(t){for(let n in t)return!1;return!0},Vq.addType=function(t,n){return(0,K_.mapOutput)(t,t=>({...t,__TYPE__:n}))},Vq.withCustomError=function(t,n){return(0,KI.withValidate)(t,(r,i)=>UC.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(VY,"__esModule",{value:!0}),VY.WidgetKey=void 0;let KC=nL,KN=(0,KC.__importStar)(Vz),Kj=RegExp("^[^<>]+$");VY.WidgetKey=(0,Vq.refineType)(KN.string,"WidgetKey",t=>0===t.length||Kj.test(t)),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nL;(0,n.__exportStar)(VB,t),(0,n.__exportStar)(V$,t),(0,n.__exportStar)(VY,t)}(VW);var KE={},KR={},KD={},KA={},KL={};Object.defineProperty(KL,"__esModule",{value:!0}),KL.clone=void 0,KL.clone=function(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n};var KP=I&&I.__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]}),KF=I&&I.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Kz=I&&I.__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 KF(n,t),n};Object.defineProperty(KA,"__esModule",{value:!0}),KA.withValidate=void 0;var KU=Kz(Vz);KA.withValidate=function(t,n,r){void 0===r&&(r=t.name);var i=KL.clone(t);return i.validate=n,i.decode=function(t){return n(t,KU.getDefaultContext(i))},i.name=r,i};var KW=I&&I.__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]}),KB=I&&I.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),KV=I&&I.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&KW(n,t,r);return KB(n,t),n};Object.defineProperty(KD,"__esModule",{value:!0}),KD.withFallback=void 0;var K$=KV(Vz);KD.withFallback=function(t,n,r){return void 0===r&&(r="withFallback("+t.name+")"),KA.withValidate(t,function(r,i){return UN.orElse(function(){return K$.success(n)})(t.validate(r,i))},r)};var KK={},KY={};Object.defineProperty(KY,"__esModule",{value:!0}),KY.EmptyArray=KY.EmptyObject=KY.Boolean=KY.NumberOrNull=KY.Number=KY.StringOrNull=KY.String=void 0;let Kq=nL,KG=(0,Kq.__importStar)(Vz);KY.String=(0,Vq.withCustomError)(KG.string,()=>"The value must be a string"),KY.StringOrNull=(0,Vq.withCustomError)(KG.union([KG.string,KG.null]),()=>"The value must be a string or null"),KY.Number=(0,Vq.withCustomError)(KG.number,()=>"The value must be a number"),KY.NumberOrNull=(0,Vq.withCustomError)(KG.union([KG.number,KG.null]),()=>"The value must be a number or null"),KY.Boolean=(0,Vq.withCustomError)(KG.boolean,()=>"The value must be a boolean"),KY.EmptyObject=KG.UnknownRecord.pipe(new KG.Type("emptyObject",t=>KG.UnknownRecord.is(t),(t,n)=>Object.keys(t).length>0?KG.failure(t,n,"The object is not empty."):KG.success({}),KG.identity)),KY.EmptyArray=new KG.Type("emptyArray",t=>KG.UnknownArray.is(t)&&0===t.length,(t,n)=>(0,UR.pipe)(KG.UnknownArray.decode(t),UC.either.chain(r=>r.length>0?KG.failure(t,n,"The array is not empty."):KG.success([]))),()=>[]);var KZ={};let KQ=_(gM);var KH={};Object.defineProperty(KH,"__esModule",{value:!0});let KJ=nL,KX=(0,KJ.__importStar)(Vz);KH.default=new KX.Type("dateFromStringOrNumber",t=>t instanceof Date,(t,n)=>(0,VG.pipe)(KX.union([KX.number,KX.string]).validate(t,n),(0,KQ.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?KX.failure(t,n):KX.success(i)})),t=>t);var K0={};Object.defineProperty(K0,"__esModule",{value:!0});let K1=nL,K2=(0,K1.__importStar)(Vz);K0.default=new K2.Type("dateFromTsMs",t=>t instanceof Date,(t,n)=>(0,VG.pipe)(K2.number.validate(t,n),(0,KQ.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?K2.failure(t,n):K2.success(i)})),t=>t.getTime());var K4={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyArrayOrElse=t.EmptyObjectOrElse=t.NullOrElse=t.DefaultOrElse=void 0;let n=nL,r=(0,n.__importStar)(Vz),i=t=>n=>new r.Type(`DefaultOrElse<${t.name}, ${n.name}>`,t=>null===t||n.is(t),(i,o)=>(0,UN.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)(KY.EmptyObject)(n);t.EmptyObjectOrElse=a;let u=n=>(0,t.DefaultOrElse)(KY.EmptyArray)(n);t.EmptyArrayOrElse=u}(K4);var K3={};Object.defineProperty(K3,"__esModule",{value:!0});let K5=nL,K9=(0,K5.__importStar)(Vz);K3.default=new K9.Type("IntFromNumber",K9.Int.is,(t,n)=>(0,VG.pipe)(K9.number.validate(t,n),(0,KQ.chain)(t=>K9.Int.is(t)?K9.success(t):K9.success(Math.round(t)))),K9.Int.encode);var K8={};Object.defineProperty(K8,"__esModule",{value:!0});let K6=nL,K7=(0,K6.__importStar)(Vz),Ye=/^([0-9]+)px$/;K8.default=new K7.Type("IntFromPixels",K7.Int.is,(t,n)=>(0,VG.pipe)(K7.string.validate(t,n),(0,KQ.chain)(r=>{try{let i=r.match(Ye);if(!i)return K7.failure(t,n);let o=parseInt(i[1]);return K7.success(o)}catch{return K7.failure(t,n)}})),String);var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0});let Yn=nL,Yr=(0,Yn.__importStar)(Vz);Yt.default=(0,Vq.withCustomError)((0,Vq.refineType)(Yr.string,"nonEmptyString",t=>t.trim().length>0),()=>"The value must be a non-empty string");var Yi={},Yo={};Object.defineProperty(Yo,"__esModule",{value:!0});let Ya=nL,Yu=(0,Ya.__importStar)(Vz);Yo.default=(0,Vq.nullable)(Yu.string),Object.defineProperty(Yi,"__esModule",{value:!0});let Ys=nL,Yc=(0,Ys.__importDefault)(Yo);Yi.default=new Vz.Type("nonEmptyStringOrNull",t=>"string"==typeof t||null===t,(t,n)=>(0,VG.pipe)(Yc.default.validate(t,n),(0,KQ.chain)(t=>"string"==typeof t&&t.length>0?(0,Vz.success)(t):(0,Vz.success)(null))),t=>t);var Yl={};Object.defineProperty(Yl,"__esModule",{value:!0});let Yd=nL,Yf=(0,Yd.__importStar)(Vz);Yl.default=(0,Vq.nullable)(Yf.number);var Yp={};Object.defineProperty(Yp,"__esModule",{value:!0});let Yh=nL,Ym=(0,Yh.__importStar)(Vz);Yp.default=(t,n,r)=>KY.Number.pipe(new Ym.Type("numberInRange",t=>KY.Number.is(t),(i,o)=>i>n||i<t?Ym.failure(i,o,`${r} must be a number between ${t} and ${n}`):Ym.success(i),Ym.identity));var Yg={};Object.defineProperty(Yg,"__esModule",{value:!0});let Yy=nL,Yv=(0,Yy.__importStar)(Vz);Yg.default=new Yv.Type("StringFromInt",Yv.string.is,(t,n)=>(0,VG.pipe)(Yv.boolean.validate(t,n),(0,KQ.chain)(t=>Yv.success(t.toString()))),t=>t);var Yb={};Object.defineProperty(Yb,"__esModule",{value:!0});let Yx=nL,YM=(0,Yx.__importStar)(Vz);function YT(){return qY||(qY=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=nL;(0,n.__exportStar)(KY,t);var r=function(){if(qK)return KZ;qK=1,Object.defineProperty(KZ,"__esModule",{value:!0});let t=nL,n=(0,t.__importStar)(Vz),r=YT();return KZ.default=new n.Type("dateFromString",t=>t instanceof Date,(t,i)=>(0,VG.pipe)(r.String.validate(t,i),(0,KQ.chain)(r=>{let o=new Date(r);return isNaN(o.getTime())?n.failure(t,i):n.success(o)})),t=>t.toISOString()),KZ}();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)(KH).default}}),Object.defineProperty(t,"DateFromTsMs",{enumerable:!0,get:function(){return(0,n.__importDefault)(K0).default}}),(0,n.__exportStar)(K4,t),t.Function=(0,n.__importStar)(Vq),Object.defineProperty(t,"IntFromNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(K3).default}}),Object.defineProperty(t,"IntFromPixels",{enumerable:!0,get:function(){return(0,n.__importDefault)(K8).default}}),Object.defineProperty(t,"NonEmptyString",{enumerable:!0,get:function(){return(0,n.__importDefault)(Yt).default}}),Object.defineProperty(t,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(Yi).default}}),Object.defineProperty(t,"NumberOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(Yl).default}}),Object.defineProperty(t,"NumberRange",{enumerable:!0,get:function(){return(0,n.__importDefault)(Yp).default}}),Object.defineProperty(t,"StringFromBoolean",{enumerable:!0,get:function(){return(0,n.__importDefault)(Yg).default}}),Object.defineProperty(t,"StringFromNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(Yb).default}}),Object.defineProperty(t,"StringOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(Yo).default}})}(KK)),KK}Yb.default=new YM.Type("StringFromInt",YM.string.is,(t,n)=>(0,VG.pipe)(YM.number.validate(t,n),(0,KQ.chain)(t=>YM.success(t.toString()))),t=>t);var YS={},Yw={},YI={},Y_={},YO={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanField=t.BooleanConfig=t.BooleanFieldType=void 0;let n=(0,nL.__importStar)(Vz),r=YT();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})]))}(YO);var Yk={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Color=t.ColorConfig=t.ColorFieldType=void 0;let n=(0,nL.__importStar)(Vz),r=YT();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})]))}(Yk);var YC={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Date=t.DateConfig=t.DateFieldType=void 0;let n=(0,nL.__importStar)(Vz),r=YT();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})]))}(YC);var YN={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Embed=t.EmbedConfig=t.EmbedFieldType=void 0;let n=(0,nL.__importStar)(Vz),r=YT();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})]))}(YN);var Yj={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPoint=t.GeoPointConfig=t.GeoPointFieldType=void 0;let n=(0,nL.__importStar)(Vz),r=YT();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})]))}(Yj);var YE={},YR={},YD={},YA={},YL={};Object.defineProperty(YL,"__esModule",{value:!0}),YL.pipe=YL.pipeable=void 0,YL.pipeable=function(t){var n,r,i,o,a,u,s,c,l,d,f,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})})}},I=function(n){return t.chain(n,UR.identity)};y.chain=S,y.chainFirst=w,y.flatten=I}if("function"==typeof t.bimap){var _=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=_,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,UR.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},YL.pipe=UR.pipe;var YP=I&&I.__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]}),YF=I&&I.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),Yz=I&&I.__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 YF(n,t),n};Object.defineProperty(YA,"__esModule",{value:!0}),YA.NumberFromString=void 0;var YU=Yz(Vz);YA.NumberFromString=new YU.Type("NumberFromString",YU.number.is,function(t,n){return YL.pipe(YU.string.validate(t,n),UN.chain(function(r){var i=+r;return isNaN(i)||""===r.trim()?YU.failure(t,n):YU.success(i)}))},String);var YW=I&&I.__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]}),YB=I&&I.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),YV=I&&I.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&YW(n,t,r);return YB(n,t),n};Object.defineProperty(YD,"__esModule",{value:!0}),YD.IntFromString=void 0;var Y$=YV(Vz);YD.IntFromString=new Y$.Type("IntFromString",Y$.Int.is,function(t,n){return YL.pipe(YA.NumberFromString.validate(t,n),UN.chain(function(r){return Y$.Int.is(r)?Y$.success(r):Y$.failure(t,n)}))},YA.NumberFromString.encode),Object.defineProperty(YR,"__esModule",{value:!0});let YK=nL,YY=(0,YK.__importStar)(Vz),Yq=YT(),YG=new YY.Type("SideConstraints",t=>!t||"number"==typeof t,(t,n)=>UN.either.chain(YY.union([YY.literal("auto"),YY.literal(""),YY.Int,YD.IntFromString,Yq.IntFromNumber,Yq.IntFromPixels,YY.null]).validate(t,n),t=>"auto"===t||""===t?YY.success(null):YY.success(t)),t=>t),YZ=YY.partial({width:YG,height:YG});YR.default=YZ,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Image=t.ImageConfig=t.Thumbnail=t.ImageFieldType=void 0;let n=nL,r=(0,n.__importStar)(Vz),i=YT(),o=(0,n.__importDefault)(YR);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})]))}(YE);var YQ={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationField=t.IntegrationFieldConfig=t.IntegrationFieldType=void 0;let n=(0,nL.__importStar)(Vz),r=YT();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})]))}(YQ);var YH={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Link=t.LinkConfig=t.LinkFieldType=void 0;let n=nL,r=(0,n.__importStar)(Vz),i=YT(),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)=>UN.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,KD.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})]))}(YH);var YJ={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Number=t.NumberConfig=t.NumberFieldType=void 0;let n=(0,nL.__importStar)(Vz),r=YT();t.NumberFieldType="Number",t.NumberConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,min:n.union([n.number,YA.NumberFromString]),max:n.union([n.number,YA.NumberFromString]),step:n.union([n.number,YA.NumberFromString])})),t.Number=n.exact(n.intersection([n.type({type:n.literal(t.NumberFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.NumberConfig})]))}(YJ);var YX={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Range=t.RangeConfig=t.RangeFieldType=void 0;let n=(0,nL.__importStar)(Vz),r=YT();t.RangeFieldType="Range",t.RangeConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,min:n.union([n.number,YA.NumberFromString]),max:n.union([n.number,YA.NumberFromString]),step:n.union([n.number,YA.NumberFromString])})),t.Range=n.exact(n.intersection([n.type({type:n.literal(t.RangeFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.RangeConfig})]))}(YX);var Y0={};!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=nL,r=(0,n.__importStar)(Vz),i=YT(),o=(0,n.__importDefault)(YR);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,UR.pipe)(r.union([r.string,r.null]).decode(n),UC.either.map(n=>{if(!n)return t.DEFAULT_OPTION;let r=n.split(",").map(t=>t.trim()).filter(n=>(0,UN.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])},d=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,UR.pipe)(r.union([i,o,r.string,r.null]).decode(t),UC.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:d,allowTargetBlank:r.boolean})),t.RichText=r.exact(r.intersection([r.type({type:r.literal(t.RichTextFieldType)}),r.partial({fieldset:i.StringOrNull,config:t.RichTextConfig})]))}(Y0);var Y1={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Select=t.SelectConfig=t.SelectFieldType=void 0;let n=(0,nL.__importStar)(Vz),r=YT();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})]))}(Y1);var Y2={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Separator=t.SeparatorConfig=t.SeparatorFieldType=void 0;let n=(0,nL.__importStar)(Vz),r=YT();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})]))}(Y2);var Y4={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Text=t.TextConfig=t.TextFieldType=void 0;let n=(0,nL.__importStar)(Vz),r=YT();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})]))}(Y4);var Y3={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Timestamp=t.TimestampConfig=t.TimestampFieldType=void 0;let n=(0,nL.__importStar)(Vz),r=YT();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})]))}(Y3),Object.defineProperty(Y_,"__esModule",{value:!0}),Y_.NestableWidget=void 0;let Y5=nL,Y9=(0,Y5.__importStar)(Vz);Y_.NestableWidget=Y9.union([Yk.Color,YO.BooleanField,YN.Embed,Yj.GeoPoint,YC.Date,YJ.Number,YX.Range,Y0.RichText,Y1.Select,Y2.Separator,Y4.Text,Y3.Timestamp,YH.Link,YE.Image,YQ.IntegrationField]),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Group=t.GroupConfig=t.GroupFieldType=void 0;let n=(0,nL.__importStar)(Vz),r=YT();t.GroupFieldType="Group",t.GroupConfig=n.exact(n.partial({label:r.StringOrNull,repeat:n.boolean,fields:n.record(VW.WidgetKey,Y_.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})]))}(YI);var Y8={};!function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nL;(0,n.__exportStar)(YO,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)(YQ,t),(0,n.__exportStar)(YH,t),(0,n.__exportStar)(Y_,t),(0,n.__exportStar)(YJ,t),(0,n.__exportStar)(YX,t),(0,n.__exportStar)(Y0,t),(0,n.__exportStar)(Y1,t),(0,n.__exportStar)(Y2,t),(0,n.__exportStar)(Y4,t),(0,n.__exportStar)(Y3,t)}(Y8);var Y6={},Y7={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isCompositeSlice=t.CompositeSlice=t.CompositeSliceConfig=t.CompositeSliceType=void 0;let n=(0,nL.__importStar)(Vz),r=YT();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(VW.WidgetKey,Y_.NestableWidget),repeat:n.record(VW.WidgetKey,Y_.NestableWidget),config:t.CompositeSliceConfig})])),t.isCompositeSlice=function(t){return"Slice"===t.type}}(Y7);var qe={};Object.defineProperty(qe,"__esModule",{value:!0}),qe.isLegacySlice=qe.LegacySlice=void 0;let qt=nL,qn=(0,qt.__importStar)(Vz);qe.LegacySlice=qn.union([Y_.NestableWidget,YI.Group]),qe.isLegacySlice=function(t){return"Slice"!==t.type&&"SharedSlice"!==t.type};var qr={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isDynamicSharedSlice=t.isStaticSharedSlice=t.SharedSlice=t.SharedSliceType=t.Variation=void 0;let n=(0,nL.__importStar)(Vz);t.Variation=n.exact(n.intersection([n.type({id:n.string,name:n.string,description:n.string,imageUrl:(0,KD.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(VW.WidgetKey,Y_.NestableWidget),items:n.record(VW.WidgetKey,Y_.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}}(qr);var qi={};Object.defineProperty(qi,"__esModule",{value:!0}),qi.SharedSliceRef=void 0;let qo=nL,qa=(0,qo.__importStar)(Vz);qi.SharedSliceRef=qa.exact(qa.type({type:qa.literal(qr.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,nL.__importStar)(Vz),r=YT();function i(i){return n.exact(n.partial({label:r.StringOrNull,labels:t.SlicesLabels,choices:n.record(VW.WidgetKey,n.union([qe.LegacySlice,Y7.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(qr.SharedSlice),t.DynamicSlicesConfig=i(qi.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}}(Y6);var qu={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UID=t.UIDConfig=t.UIDFieldType=void 0;let n=(0,nL.__importStar)(Vz),r=YT();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})]))}(qu),Object.defineProperty(Yw,"__esModule",{value:!0}),Yw.Widgets=Yw.FieldType=Yw.DynamicWidget=Yw.StaticWidget=Yw.widgetReader=void 0;let qs=nL,qc=(0,qs.__importStar)(Vz);function ql(t){return qc.union([qu.UID,Y_.NestableWidget,YI.Group,t])}Yw.widgetReader=ql,Yw.StaticWidget=ql(Y6.StaticSlices),Yw.DynamicWidget=ql(Y6.DynamicSlices),Yw.FieldType=qc.keyof({[Y8.ColorFieldType]:null,[Y8.BooleanFieldType]:null,[Y8.NumberFieldType]:null,[Y8.EmbedFieldType]:null,[Y8.GeoPointFieldType]:null,[Y8.DateFieldType]:null,[Y8.RangeFieldType]:null,[Y8.RichTextFieldType]:null,[Y8.SelectFieldType]:null,[Y8.SeparatorFieldType]:null,[Y8.TextFieldType]:null,[Y8.TimestampFieldType]:null,[Y8.LinkFieldType]:null,[Y8.ImageFieldType]:null,[Y8.IntegrationFieldType]:null,[qu.UIDFieldType]:null,[YI.GroupFieldType]:null,[Y6.SlicesFieldType]:null,[Y6.LegacySlicesFieldType]:null}),Yw.Widgets={toStatic(t,n){switch(t.type){case"Choice":case"Slices":return Y6.Slices.toStatic(t,n);default:return t}}},Object.defineProperty(YS,"__esModule",{value:!0}),YS.Sections=YS.DynamicSection=YS.StaticSection=YS.sectionReader=void 0;let qd=nL,qf=(0,qd.__importStar)(Vz);function qp(t){return qf.record(VW.WidgetKey,t)}YS.sectionReader=qp,YS.StaticSection=qp(Yw.StaticWidget),YS.DynamicSection=qp(Yw.DynamicWidget),YS.Sections={toStatic:(t,n)=>Object.entries(t).reduce((t,[r,i])=>({...t,[r]:Yw.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=nL,r=(0,n.__importStar)(Vz),i=YT();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,KD.withFallback)(r.boolean,!0),json:r.record(r.string,n),status:(0,KD.withFallback)(r.boolean,!0)}),r.partial({hash:r.string,format:(0,KD.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(YS.StaticSection),t.CustomType=a(YS.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]:YS.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,UN.left)(new o(r)):(0,UN.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},{})}}(KR);var qh,qm,qg={},qy={};Object.defineProperty(qh=qy,"__esModule",{value:!0}),qh.DiffOperation=void 0,(qm=qh.DiffOperation||(qh.DiffOperation={})).Added="added",qm.Removed="removed",qm.Updated="updated";var qv={},qb={},qx={};Object.defineProperty(qx,"__esModule",{value:!0}),qx.HexaColor=void 0;let qM=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;qx.HexaColor={is:t=>qM.test(t)};var qT={};Object.defineProperty(qT,"__esModule",{value:!0}),qT.toRecord=void 0,qT.toRecord=function(t,n){return t.reduce((t,r)=>{let i=n(r);return{...t,[i]:r}},{})};var qS={};Object.defineProperty(qS,"__esModule",{value:!0}),qS.mapValues=qS.isObject=qS.withOptionals=qS.isNotEmpty=qS.zipObjects=void 0;let qw=nL,qI=(0,qw.__importStar)(Vz);qS.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}}},{})},qS.isNotEmpty=function(t){return Boolean(Object.keys(t).length)},qS.withOptionals=function(t,n){return{...t,...n.reduce((t,[n,r])=>r?{...t,[n]:r}:t,{})}};let q_=qI.record(qI.string,qI.unknown);qS.isObject=function(t){return(0,UN.isRight)(q_.decode(t))},qS.mapValues=function(t,n){return Object.entries(t).reduce((t,[r,i])=>({...t,[r]:n(i,r)}),{})},Object.defineProperty(qb,"__esModule",{value:!0}),qb.Objects=qb.Arrays=qb.HexaColorCode=void 0;let qO=nL;qb.HexaColorCode=(0,qO.__importStar)(qx),qb.Arrays=(0,qO.__importStar)(qT),qb.Objects=(0,qO.__importStar)(qS);var qk={};function qC(t,n){let r=qb.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:qy.DiffOperation.Removed}:!(null!=r&&r.left)&&null!=r&&r.right?{op:qy.DiffOperation.Added,value:r.right}:{op:qy.DiffOperation.Updated,value:r.right}})();return i?{...t,[n]:i}:t},{});return qb.Objects.isNotEmpty(i)?i:void 0}Object.defineProperty(qk,"__esModule",{value:!0}),qk.VariationComparator=void 0,qk.VariationComparator={compare(t,n){if(t&&!n)return{op:qy.DiffOperation.Removed};if(!t&&n)return{op:qy.DiffOperation.Added,value:n};let r=function(t,n){let r=qb.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=qC(null==t?void 0:t.primary,null==n?void 0:n.primary),o=qC(null==t?void 0:t.items,null==n?void 0:n.items),a={...r,...i?{primary:i}:{},...o?{items:o}:{}};if(qb.Objects.isNotEmpty(a))return{op:qy.DiffOperation.Updated,value:a}}},Object.defineProperty(qv,"__esModule",{value:!0}),qv.SliceComparator=void 0,qv.SliceComparator={compare(t,n){if(!t&&n)return{op:qy.DiffOperation.Added,value:n};if(t&&!n)return{op:qy.DiffOperation.Removed};let r=function(t,n){let r=qb.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=qb.Objects.zipObjects(t&&qb.Arrays.toRecord(t.variations,t=>t.id),n&&qb.Arrays.toRecord(n.variations,t=>t.id)),o=Object.entries(i).reduce((t,[n,r])=>{if(!r)return t;let i=qk.VariationComparator.compare(r.left,r.right);return i?{...t,[n]:i}:t},{}),a={...r,...qb.Objects.isNotEmpty(o)?{variations:o}:{}};if(qb.Objects.isNotEmpty(a))return{op:qy.DiffOperation.Updated,value:a}}},function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nL;(0,n.__exportStar)(qy,t),(0,n.__exportStar)(qv,t),(0,n.__exportStar)(qk,t)}(qg);var qN,qj,qE={},qR={};qN=qR,qj=I&&I.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Object.defineProperty(qN,"__esModule",{value:!0}),qN.ImageConstraint=void 0,Object.defineProperty(qN,"ImageConstraint",{enumerable:!0,get:function(){return qj(YR).default}});var qD={},qA={};Object.defineProperty(qA,"__esModule",{value:!0});var qL={};Object.defineProperty(qL,"__esModule",{value:!0}),qL.SlicesTypes=void 0;let qP=nL,qF=(0,qP.__importStar)(Vz);qL.SlicesTypes=qF.keyof({[Y7.CompositeSliceType]:null,[qr.SharedSliceType]:null}),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nL;(0,n.__exportStar)(Y7,t),(0,n.__exportStar)(qe,t),(0,n.__exportStar)(qr,t),(0,n.__exportStar)(qi,t),(0,n.__exportStar)(qA,t),(0,n.__exportStar)(Y6,t),(0,n.__exportStar)(qL,t)}(qD),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nL;(0,n.__exportStar)(YI,t),(0,n.__exportStar)(Y8,t),(0,n.__exportStar)(qR,t),(0,n.__exportStar)(qD,t),(0,n.__exportStar)(qu,t),(0,n.__exportStar)(Yw,t)}(qE),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nL;(0,n.__exportStar)(KR,t),(0,n.__exportStar)(qg,t),(0,n.__exportStar)(YS,t),(0,n.__exportStar)(qE,t)}(KE);var qz,qU,qW,qB,qV,q$,qK,qY,qq,qG={},qZ={},qQ={};function qH(){if(qq)return qQ;qq=1,Object.defineProperty(qQ,"__esModule",{value:!0}),qQ.hasContentType=qQ.hasFieldContentType=void 0;let t=Zw();function n(t){return"object"==typeof t&&null!==t&&"__TYPE__"in t}return qQ.hasFieldContentType=function(r){return n(r)&&r.__TYPE__===t.FieldContentType&&(null==r?void 0:r.type)!==void 0&&"string"==typeof r.type&&(0,UN.isRight)(t.FieldType.decode(r.type))},qQ.hasContentType=n,qQ}function qJ(){return q3||(q3=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyContent=t.EmptyLegacy=t.isEmptyContent=t.EmptyContentType=void 0;let n=nL,r=(0,n.__importStar)(Vz),i=qH();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,UR.pipe)(a.decode(r),UC.either.map(()=>({type:n,__TYPE__:t.EmptyContentType}))),()=>null);t.EmptyLegacy=u,t.EmptyContent=r.strict({type:r.string,__TYPE__:r.literal(t.EmptyContentType)})}(qZ)),qZ}var qX={},q0={};Object.defineProperty(q0,"__esModule",{value:!0}),q0.defaultCtx=q0.getFieldCtx=q0.LegacyContentCtx=q0.FieldOrSliceType=void 0;let q1=nL,q2=(0,q1.__importStar)(Vz);q0.FieldOrSliceType=q2.union([qE.FieldType,qE.SlicesTypes]);class q4{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)}}q0.LegacyContentCtx=q4,q0.getFieldCtx=function(t,n,r){return new q4(t,[...n.fieldPath,n.fieldKey,...r||[]],n.allTypes)},q0.defaultCtx=function(t,n=new Map){return new q4(t,[],n)};var q3,q5,q9={},q8={};function q6(){return q5||(q5=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanContentDefaultValue=t.BooleanContent=t.BooleanLegacy=t.isBooleanContent=t.BooleanContentType=void 0;let n=nL,r=(0,n.__importStar)(Vz),i=qH();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,UR.pipe)(r.boolean.decode(n),UC.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}(q8)),q8}var q7,Ge={};function Gt(){return q7||(q7=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmbedContent=t.EmbedLegacy=t.EmbedContentLegacy=t.isEmbedContent=t.EmbedContentType=void 0;let n=nL,r=(0,n.__importStar)(Vz),i=YT(),o=qH();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,UR.pipe)(t.EmbedContentLegacy.decode(n),UC.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})])}(Ge)),Ge}var Gn={},Gr={},Gi={};Object.defineProperty(Gi,"__esModule",{value:!0});let Go=nL,Ga=(0,Go.__importStar)(Vz);Gi.default=new Ga.Type("TrimmedString",Ga.string.is,(t,n)=>(0,VG.pipe)(Ga.string.validate(t,n),(0,KQ.chain)(t=>Ga.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 Gu={};function Gs(){return Gc||(Gc=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContent=t.ColorLegacy=t.isColorContent=void 0;let n=nL,r=(0,n.__importStar)(Vz),i=(0,n.__importDefault)(Gi),o=qH(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===Gu.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Color"===t.type;t.isColorContent=a;let u=n=>new r.Type("ColorLegacy",t.isColorContent,n=>(0,UR.pipe)(i.default.decode(n),UC.either.map(n=>t.ColorContent.encode({value:n,type:qE.ColorFieldType,__TYPE__:Gu.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qE.ColorFieldType}}));t.ColorLegacy=u,t.ColorContent=r.strict({type:r.literal(qE.ColorFieldType),value:i.default,__TYPE__:r.literal(Gu.FieldContentType)})}(Gr)),Gr}Object.defineProperty(Gu,"__esModule",{value:!0}),Gu.FieldContentType=void 0,Gu.FieldContentType="FieldContent";var Gc,Gl,Gd={};function Gf(){return Gl||(Gl=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DateContent=t.DateLegacy=t.isDateContent=void 0;let n=nL,r=(0,n.__importStar)(Vz),i=(0,n.__importDefault)(Gi),o=qH(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===Gu.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Date"===t.type;t.isDateContent=a;let u=n=>new r.Type("DateLegacy",t.isDateContent,n=>(0,UR.pipe)(i.default.decode(n),UC.either.map(n=>t.DateContent.encode({value:n,type:qE.DateFieldType,__TYPE__:Gu.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qE.DateFieldType}}));t.DateLegacy=u,t.DateContent=r.strict({type:r.literal(qE.DateFieldType),value:i.default,__TYPE__:r.literal(Gu.FieldContentType)})}(Gd)),Gd}var Gp,Gh={};function Gm(){return Gp||(Gp=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NumberContent=t.NumberLegacy=t.isNumberContent=void 0;let n=nL,r=(0,n.__importStar)(Vz),i=(0,n.__importDefault)(Gi),o=qH(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===Gu.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Number"===t.type;t.isNumberContent=a;let u=n=>new r.Type("NumberLegacy",t.isNumberContent,n=>(0,UR.pipe)(i.default.decode(n),UC.either.map(n=>t.NumberContent.encode({value:n,type:qE.NumberFieldType,__TYPE__:Gu.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qE.NumberFieldType}}));t.NumberLegacy=u,t.NumberContent=r.strict({type:r.literal(qE.NumberFieldType),value:i.default,__TYPE__:r.literal(Gu.FieldContentType)})}(Gh)),Gh}var Gg,Gy={};function Gv(){return Gg||(Gg=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RangeContent=t.RangeLegacy=t.isRangeContent=void 0;let n=nL,r=(0,n.__importStar)(Vz),i=(0,n.__importDefault)(Gi),o=qH(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===Gu.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Range"===t.type;t.isRangeContent=a;let u=n=>new r.Type("RangeLegacy",t.isRangeContent,n=>(0,UR.pipe)(i.default.decode(n),UC.either.map(n=>t.RangeContent.encode({value:n,type:qE.RangeFieldType,__TYPE__:Gu.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qE.RangeFieldType}}));t.RangeLegacy=u,t.RangeContent=r.strict({type:r.literal(qE.RangeFieldType),value:i.default,__TYPE__:r.literal(Gu.FieldContentType)})}(Gy)),Gy}var Gb,Gx={};function GM(){return Gb||(Gb=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectContentDefaultValue=t.SelectContent=t.SelectLegacy=t.isSelectContent=void 0;let n=nL,r=(0,n.__importStar)(Vz),i=(0,n.__importDefault)(Gi),o=qH(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===Gu.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Select"===t.type;t.isSelectContent=a;let u=n=>new r.Type("SelectLegacy",t.isSelectContent,n=>(0,UR.pipe)(i.default.decode(n),UC.either.map(n=>t.SelectContent.encode({value:n,type:qE.SelectFieldType,__TYPE__:Gu.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qE.SelectFieldType}}));t.SelectLegacy=u,t.SelectContent=r.strict({type:r.literal(qE.SelectFieldType),value:i.default,__TYPE__:r.literal(Gu.FieldContentType)});let s=t=>{var n;return!(null===(n=t.config)||void 0===n)&&n.default_value?{__TYPE__:Gu.FieldContentType,type:qE.SelectFieldType,value:t.config.default_value||""}:void 0};t.SelectContentDefaultValue=s}(Gx)),Gx}var GT,GS={};function Gw(){return GT||(GT=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TextContent=t.TextLegacy=t.isTextContent=void 0;let n=nL,r=(0,n.__importStar)(Vz),i=(0,n.__importDefault)(Gi),o=qH(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===Gu.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Text"===t.type;t.isTextContent=a;let u=n=>new r.Type("TextLegacy",t.isTextContent,n=>(0,UR.pipe)(i.default.decode(n),UC.either.map(n=>t.TextContent.encode({value:n,type:qE.TextFieldType,__TYPE__:Gu.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qE.TextFieldType}}));t.TextLegacy=u,t.TextContent=r.strict({type:r.literal(qE.TextFieldType),value:i.default,__TYPE__:r.literal(Gu.FieldContentType)})}(GS)),GS}var GI,G_={};function GO(){return GI||(GI=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TimestampContent=t.TimestampLegacy=t.isTimestampContent=void 0;let n=nL,r=(0,n.__importStar)(Vz),i=(0,n.__importDefault)(Gi),o=qH(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===Gu.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Timestamp"===t.type;t.isTimestampContent=a;let u=n=>new r.Type("TimestampLegacy",t.isTimestampContent,n=>(0,UR.pipe)(i.default.decode(n),UC.either.map(n=>t.TimestampContent.encode({value:n,type:qE.TimestampFieldType,__TYPE__:Gu.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:qE.TimestampFieldType}}));t.TimestampLegacy=u,t.TimestampContent=r.strict({type:r.literal(qE.TimestampFieldType),value:i.default,__TYPE__:r.literal(Gu.FieldContentType)})}(G_)),G_}function Gk(){return GC||(GC=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FieldContent=t.FieldType=void 0;let n=nL,r=(0,n.__importStar)(Vz),i=Gs(),o=Gf(),a=Gm(),u=Gv(),s=GM(),c=Gw(),l=GO();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)(Gs(),t),(0,n.__exportStar)(Gu,t),(0,n.__exportStar)(Gf(),t),(0,n.__exportStar)(Gm(),t),(0,n.__exportStar)(Gv(),t),(0,n.__exportStar)(GM(),t),(0,n.__exportStar)(Gw(),t),(0,n.__exportStar)(GO(),t)}(Gn)),Gn}var GC,GN,Gj={};function GE(){return GN||(GN=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPointContent=t.GeoPointLegacy=t.isGeoPointContent=t.GeoPointContentType=void 0;let n=nL,r=(0,n.__importStar)(Vz),i=qH();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,VG.pipe)(a.decode(n),UC.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)})])}(Gj)),Gj}var GR,GD={};function GA(){return GR||(GR=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageContent=t.ImageLegacy=t.ImageContentView=t.isImageContent=t.ImageContentType=void 0;let n=nL,r=(0,n.__importStar)(Vz),i=YT(),o=qH();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,UR.pipe)(s.decode(n),UC.either.map(n=>t.ImageContent.encode({...n,__TYPE__:t.ImageContentType}))),t=>({content:(0,qS.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)})])}(GD)),GD}var GL,GP={};function GF(){return GL||(GL=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationFieldContent=t.IntegrationFieldLegacy=t.isIntegrationFieldContent=t.IntegrationFieldContentType=void 0;let n=nL,r=(0,n.__importStar)(Vz),i=qH();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,UR.pipe)(r.string.decode(n),UC.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 Gz,GU={};function GW(){return Gz||(Gz=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=nL,r=(0,n.__importStar)(Vz),i=YT(),o=qH();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,UR.pipe)(a.decode(n),UC.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,KI.withFallback)(r.string,"0")}),r.partial({date:(0,Vq.nullable)(r.string)})])),c=new r.Type("FileLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.FileLinkType,n=>(0,UR.pipe)(s.decode(n),UC.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,KI.withFallback)(r.string,"0")})]))]),t.DocumentLinkType="DocumentLink";let l=r.strict({id:i.NonEmptyString}),d=new r.Type("DocumentLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.DocumentLinkType,n=>(0,UR.pipe)(l.decode(n),UC.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 f=r.exact(r.intersection([r.type({url:r.string}),r.partial({kind:r.literal("web"),target:i.StringOrNull,preview:(0,Vq.nullable)(r.partial({title:r.string}))})])),p=new r.Type("ExternalLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.ExternalLinkType,n=>(0,UR.pipe)(f.decode(n),UC.either.map(n=>t.ExternalLinkContent.encode({...n,__TYPE__:t.ExternalLinkType}))),t=>f.encode(t));t.ExternalLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.ExternalLinkType)}),f]),t.LinkContentType="LinkContent";let h=n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.LinkContentType;t.isLinkContent=h,t.LinkLegacy=r.union([u,c,d,p]);let m=n=>new r.Type("LinkLegacy",t.isLinkContent,n=>(0,UR.pipe)(t.LinkLegacy.decode(n),UC.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})}(GU)),GU}var GB,GV={},G$={},GK={};function GY(){return GB||(GB=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=nL,r=(0,n.__importStar)(Vz),i=YT(),o=Gt(),a=GA(),u=GW(),s=t=>r.strict({data:t,start:r.number,end:r.number,type:r.literal(Y8.RichTextNodeType.hyperlink)}),c=r.strict({data:(0,KI.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({[Y8.RichTextNodeType.strong]:null,[Y8.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 d=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,UN.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=d;let f=t=>r.exact(r.intersection([r.type({type:r.literal(Y8.RichTextNodeType.image),data:r.intersection([a.ImageContentView,r.partial({linkTo:(0,Vq.nullable)(t)})])}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})]));t.ImageBlock=f(u.Link);let p=f(u.LinkLegacy);t.checkImageBlock=function(t){return t.type===Y8.RichTextNodeType.image};let h=r.exact(r.intersection([r.type({type:r.literal(Y8.RichTextNodeType.embed),data:r.unknown}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})])),m=new r.Type("EmbedBlockLegacy",t=>"embed"===t.type,n=>(0,UR.pipe)(h.decode(n),UC.either.chain(t=>UC.either.map(n=>[t,n])(o.EmbedContentLegacy.decode(t.data))),UC.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(Y8.RichTextNodeType.embed),data:o.EmbedContent}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})])),t.checkEmbedBlock=function(t){return t.type===Y8.RichTextNodeType.embed};let g=n=>r.exact(r.intersection([r.type({type:(0,Vq.refineType)(Y8.RichTextNodeTypeCodec,`string which isn't ${Y8.RichTextNodeType.image} ${Y8.RichTextNodeType.embed}`,t=>t!==Y8.RichTextNodeType.image&&t!==Y8.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])}(GK)),GK}function Gq(){return GG||(GG=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RichTextLegacy=t.RichTextContent=t.isRichTextContent=t.RichTextContentType=void 0;let n=nL,r=(0,n.__importStar)(Vz),i=qH(),o=GY();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)(GY(),t);let s=n=>new r.Type("RichTextLegacy",t.isRichTextContent,n=>(0,UR.pipe)(u.decode(n),UC.either.map(n=>({value:n,__TYPE__:t.RichTextContentType}))),t=>({content:u.encode(t.value),types:{[n.keyOfType]:"StructuredText"}}));t.RichTextLegacy=s}(G$)),G$}var GG,GZ,GQ={};function GH(){return GZ||(GZ=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SeparatorContent=t.SeparatorLegacy=t.isSeparatorContent=t.SeparatorContentType=void 0;let n=(0,nL.__importStar)(Vz),r=qH();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)})}(GQ)),GQ}function GJ(){return G0||(G0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nL;(0,n.__exportStar)(q6(),t),(0,n.__exportStar)(Gt(),t),(0,n.__exportStar)(Gk(),t),(0,n.__exportStar)(GE(),t),(0,n.__exportStar)(GA(),t),(0,n.__exportStar)(GF(),t),(0,n.__exportStar)(GW(),t),(0,n.__exportStar)(function(){if(GX)return GV;GX=1,Object.defineProperty(GV,"__esModule",{value:!0}),GV.NestableLegacy=GV.isNestableContent=GV.NestableContentDefaultValue=GV.NestableContent=void 0;let t=nL,n=(0,t.__importStar)(Vz),r=qJ(),i=q6(),o=Gt(),a=Gk(),u=GE(),s=GA(),c=GF(),l=GW(),d=Gq(),f=GH();GV.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,d.RichTextContent,f.SeparatorContent]);let p=t=>{switch(t.type){case"Boolean":return(0,i.BooleanContentDefaultValue)(t);case"Select":return(0,a.SelectContentDefaultValue)(t);default:return}};GV.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,d.isRichTextContent)(t)||(0,i.isBooleanContent)(t)||(0,o.isEmbedContent)(t)||(0,s.isImageContent)(t)||(0,c.isIntegrationFieldContent)(t)||(0,l.isLinkContent)(t)||(0,f.isSeparatorContent)(t)||(0,r.isEmptyContent)(t);GV.isNestableContent=h;let m=t=>({decode(n){if(!t.fieldType)return;let p=(0,r.EmptyLegacy)(t.fieldType).decode(n);if((0,UN.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,d.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,f.SeparatorLegacy)(t);default:return}})();if(h)return h.decode(n)},encode(n){switch(n.__TYPE__){case Gu.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 d.RichTextContentType:return(0,d.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 f.SeparatorContentType:return(0,f.SeparatorLegacy)(t).encode(n);default:return}}});return GV.NestableLegacy=m,GV}(),t),(0,n.__exportStar)(Gq(),t),(0,n.__exportStar)(GH(),t)}(q9)),q9}var GX,G0,G1,G2={};function G4(){if(G1)return G2;G1=1,Object.defineProperty(G2,"__esModule",{value:!0}),G2.repeatableContentWithDefaultNestableContentValues=G2.withDefaultNestableContentValues=void 0;let t=GJ();return G2.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)},G2.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))},G2}function G3(){return G5||(G5=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=nL,r=(0,n.__importStar)(Vz),i=qH(),o=GJ(),a=G4();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,UR.pipe)(u.decode(r),UC.either.map(r=>({value:Object.entries(r).reduce((t,[r,i])=>{let a=(0,q0.getFieldCtx)(r,n),u=(0,o.NestableLegacy)(a).decode(i);return!u||(0,UN.isLeft)(u)?t:[...t,[r,u.right]]},[]),__TYPE__:t.GroupItemContentType}))),t=>t.value.reduce((t,[r,i])=>{let a=(0,q0.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,UR.pipe)(i.decode(n),UC.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 d({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=d({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=d}(qX)),qX}var G5,G9,G8={},G6={},G7={},Ze={};function Zt(){if(G9)return Ze;G9=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.RepeatableWidgets=Ze.RepeatableWidgetsLegacy=void 0;let t=(0,nL.__importStar)(Vz),n=G3(),r=GJ(),i=r=>t.array((0,n.GroupItemLegacy)(r));Ze.RepeatableWidgetsLegacy=i;let o=t.tuple([t.string,r.NestableContent]),a=t.strict({__TYPE__:t.literal(n.GroupItemContentType),value:t.array(o)});return Ze.RepeatableWidgets=t.array(a),Ze}function Zn(){return Zr||(Zr=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=nL,r=(0,n.__importStar)(Vz),i=qH(),o=G3(),a=GJ(),u=G4(),s=Zt();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})),d=n=>new r.Type("CompositeSliceLegacy",t.isCompositeSliceContent,r=>(0,UR.pipe)(l.decode(r),UC.either.map(r=>{let i=(()=>{let t=(0,q0.getFieldCtx)("repeat",n),i=(0,s.RepeatableWidgetsLegacy)(t).decode(r.repeat);if(!(!i||(0,UN.isLeft)(i)))return i.right})()||[];return{nonRepeat:Object.entries(r["non-repeat"]||{}).reduce((t,[r,i])=>{let o=(0,q0.getFieldCtx)(r,n,["non-repeat"]);if(!o)return t;let u=(0,a.NestableLegacy)(o).decode(i);return!u||(0,UN.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,q0.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,q0.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=d,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,d,f;let p=(null==i?void 0:i.type)==="SharedSlice"?null===(d=null===(l=null==i?void 0:i.fields)||void 0===l?void 0:l.primary)||void 0===d?void 0:d[u]:null===(f=null==i?void 0:i["non-repeat"])||void 0===f?void 0:f[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},{}),d=(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:d,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)},[])}),[])}}}}(G7)),G7}var Zr,Zi,Zo={};function Za(){return Zi||(Zi=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=nL,r=(0,n.__importStar)(Vz),i=qH(),o=G3(),a=GJ(),u=G4(),s=Zt();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,KI.withFallback)(r.array(r.unknown),[]),primary:(0,KI.withFallback)(r.UnknownRecord,{})})),d=n=>new r.Type("SharedSliceLegacy",t.isSharedSliceContent,r=>(0,UR.pipe)(l.decode(r),UC.either.map(r=>{let i=(()=>{let t=(0,q0.getFieldCtx)("items",n,["variations",r.variation]),i=(0,s.RepeatableWidgetsLegacy)(t).decode(r.items);if(!(!i||(0,UN.isLeft)(i)))return i.right})()||[],o=Object.entries(r.primary).reduce((t,[i,o])=>{let u=(0,q0.getFieldCtx)(i,n,["variations",r.variation,"primary"]),s=(0,a.NestableLegacy)(u).decode(o);return!s||(0,UN.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,q0.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,q0.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=d,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,d;let f=null===(d=null===(l=null==i?void 0:i.fields)||void 0===l?void 0:l.primary)||void 0===d?void 0:d[u],p=s({path:t.concat([{key:"primary",type:"primary"},{key:u,type:"Widget"}]),key:u,apiId:r,model:f,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},{}),d=(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:d}}})}}}(Zo)),Zo}var Zu,Zs={};function Zc(){if(Zu)return Zs;Zu=1,Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.migrateSimpleSlice=Zs.traverseSimpleSliceContent=Zs.SimpleSliceLegacy=Zs.isSimpleSliceContent=Zs.SimpleSliceContent=void 0;let t=(0,nL.__importStar)(Vz),n=G3(),r=GJ();Zs.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);let i=t=>(0,r.isNestableContent)(t)||(0,n.isGroupContent)(t);Zs.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 Zs.SimpleSliceLegacy=o,Zs.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 d=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 d&&s({key:r,apiId:i,path:t,model:o,content:{...a,widget:d}})}},Zs.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:[]}}},Zs}function Zl(){return Zd||(Zd=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SliceContent=t.SliceLegacy=void 0;let n=nL,r=(0,n.__importStar)(Vz),i=Zn(),o=Za(),a=Zc(),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)(Zn(),t),(0,n.__exportStar)(Za(),t),(0,n.__exportStar)(Zc(),t)}(G6)),G6}var Zd,Zf,Zp={};function Zh(){if(Zf)return Zp;Zf=1,Object.defineProperty(Zp,"__esModule",{value:!0}),Zp.migrateSliceItem=Zp.SlicesItemLegacy=Zp.sliceItemContentWithDefaultValues=Zp.isSimpleSliceItemContent=Zp.isCompositeSliceItemContent=Zp.isSharedSliceItemContent=Zp.SliceItemContent=void 0;let t=nL,n=(0,t.__importStar)(Vz),r=G3(),i=GJ(),o=G4(),a=Zl(),u=Zn(),s=Za(),c=Zc();function l(t){return(0,u.isCompositeSliceContent)(t.widget)}function d(t){return(0,r.isGroupContent)(t.widget)||(0,i.isNestableContent)(t.widget)}Zp.SliceItemContent=n.type({key:n.string,name:n.string,maybeLabel:n.union([n.string,n.undefined]),widget:a.SliceContent}),Zp.isSharedSliceItemContent=function(t){return(0,s.isSharedSliceContent)(t.widget)},Zp.isCompositeSliceItemContent=l,Zp.isSimpleSliceItemContent=d,Zp.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 f=n.exact(n.intersection([n.type({key:n.string,value:n.unknown}),n.partial({label:(0,Vq.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,UR.pipe)(f.decode(r),UC.either.chain(o=>{var u;let s=o.key.indexOf("$"),c=o.key.substring(0,s>0?s:void 0),l=(0,q0.getFieldCtx)(c,t),d=(0,a.SliceLegacy)(l).decode(o.value);return!d||(0,UN.isLeft)(d)?n.failure(r,i):n.success({key:o.key,name:c,maybeLabel:null!==(u=o.label)&&void 0!==u?u:void 0,widget:d.right})})),n=>{let r=(0,q0.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)||{}}});Zp.SlicesItemLegacy=p;let h=({model:t,content:n})=>l(n)&&(null==t?void 0:t.type)==="SharedSlice"?(0,u.migrateCompositeSlice)(t,n):d(n)&&(null==t?void 0:t.type)==="SharedSlice"?(0,c.migrateSimpleSlice)(t,n):n;return Zp.migrateSliceItem=h,Zp}var Zm,Zg={};function Zy(){return Zv||(Zv=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nL;(0,n.__exportStar)(Zl(),t),(0,n.__exportStar)(Zh(),t),(0,n.__exportStar)((Zm||(Zm=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=nL,r=(0,n.__importStar)(Vz),i=qH(),o=Zn(),a=Za(),u=Zc(),s=Zh();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,UR.pipe)(i.decode(n),UC.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 d=i.value.reduce((n,i)=>{let d=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,KE.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=VU.ContentPath.append(VU.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,KE.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,KE.isCompositeSlice)(a))return{type:"Slice","non-repeat":a["non-repeat"]||{},repeat:a.repeat||{}};if((0,KE.isLegacySlice)(a))return a}})()}(t,r,i),f=(0,s.isSharedSliceItemContent)(i)?(0,a.traverseSharedSliceContent)({path:t.concat({key:i.key,type:"SharedSlice"}),sliceKey:i.key,sliceName:i.name,model:(null==d?void 0:d.type)==="SharedSlice"?d: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==d?void 0:d.type)==="Slice"||(null==d?void 0:d.type)==="SharedSlice"?d: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:d&&(null==d?void 0:d.type)!=="Slice"?d:void 0,content:i})(c,l):void 0;return f?n.concat(f):n},[]);return c({path:t,key:n,apiId:n,model:r,content:{__TYPE__:i.__TYPE__,value:d}})}}}(Zg)),Zg),t)}(G8)),G8}var Zv,Zb,Zx={};function ZM(){return Zb||(Zb=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UIDContent=t.UIDLegacy=t.isUIDContent=t.UIDContentType=void 0;let n=nL,r=(0,n.__importStar)(Vz),i=qH();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,UR.pipe)(r.string.decode(n),UC.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})}(Zx)),Zx}var ZT,ZS={};function Zw(){return i||(i=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nL;(0,n.__exportStar)(qJ(),t),(0,n.__exportStar)(G3(),t),(0,n.__exportStar)(GJ(),t),(0,n.__exportStar)(Zy(),t),(0,n.__exportStar)(ZM(),t),(0,n.__exportStar)(function(){if(ZT)return ZS;ZT=1,Object.defineProperty(ZS,"__esModule",{value:!0}),ZS.WidgetLegacy=ZS.isWidgetContent=ZS.WidgetContent=void 0;let t=(0,nL.__importStar)(Vz),n=G3(),r=GJ(),i=Zy(),o=ZM();ZS.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);ZS.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 ZS.WidgetLegacy=u,ZS}(),t)}(qG)),qG}Object.defineProperty(nP,"__esModule",{value:!0}),nP.migrateDocument=nP.collectWidgets=nP.traverseDocument=nP.fillDocumentWithDefaultValues=nP.DocumentLegacy=nP.Document=void 0;let ZI=nL,Z_=(0,ZI.__importStar)(Vz),ZO=Zw();nP.Document=Z_.record(VW.WidgetKey,ZO.WidgetContent);let Zk=Z_.record(VW.WidgetKey,Z_.unknown),ZC=t=>new Z_.Type("Document",t=>!!t&&"object"==typeof t,n=>(0,UR.pipe)(Zk.decode(n),UC.either.map(n=>Object.entries(n).reduce((n,[r,i])=>{let o=(0,q0.defaultCtx)(r,t),a=(0,ZO.WidgetLegacy)(o).decode(i);return!a||(0,UN.isLeft)(a)?n:{...n,[r]:a.right}},{}))),n=>Object.entries(n).reduce((n,[r,i])=>{let o=(0,q0.defaultCtx)(r,t),a=(0,ZO.WidgetLegacy)(o).encode(i);return a?{content:{...n.content,[r]:a.content},types:{...n.types,...a.types}}:n},{content:{},types:{}}));function ZN(t){let n=Object.entries(t),{types:r,widgets:i}=n.reduce((t,[n,r])=>{if(n.endsWith("_TYPE")){let i=q0.FieldOrSliceType.decode(r);if((0,UN.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 Zj(t){return{customTypeId:null==t?void 0:t.id,fields:Object.fromEntries((0,KE.flattenSections)(t))}}function ZE({document:t,customType:n}){let r=n&&KE.StaticCustomType.is(n)?Zj(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=VU.ContentPath.make([{key:null==r?void 0:r.customTypeId,type:"CustomType"},{key:a,type:"Widget"}]),l=(()=>{switch(u.__TYPE__){case"SliceContentType":return(0,ZO.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,ZO.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 ZR(t,n){let r=KE.StaticCustomType.is(n)?Zj(n):n;return Object.values((0,KE.collectSharedSlices)(r)).some(t=>Boolean(t.legacyPaths))?ZE({document:t,customType:n})({transformSlice:ZO.migrateSliceItem}):t}nP.DocumentLegacy={_codec:ZC,extractMetadata:ZN,parse:function(t,n){let r=(0,UR.pipe)(Z_.record(VW.WidgetKey,Z_.unknown).decode(t),UC.either.chain(t=>{let{types:n,widgets:r}=ZN(t);return ZC(n).decode(r)}));return(0,UN.isLeft)(r)?void 0:ZR(r.right,n)},encode:function(t){let n=ZC().encode(t);return{...n.content,...n.types}}},nP.fillDocumentWithDefaultValues=function(t,n){let{fields:r}=t&&KE.StaticCustomType.is(t)?Zj(t):t;return Object.entries(r).reduce((t,[r,i])=>{let o=n[r],a=(()=>{switch(i.type){case"Group":return(0,ZO.isGroupContent)(o)?(0,ZO.groupContentWithDefaultValues)(i,o):o;case"Choice":case"Slices":return(0,ZO.isSlicesContent)(o)?(0,ZO.slicesContentWithDefaultValues)(i,o):o;default:return void 0===o&&KE.NestableWidget.is(i)?(0,ZO.NestableContentDefaultValue)(i):o}})();return a?{...t,[r]:a}:t},n)},nP.traverseDocument=ZE,nP.collectWidgets=function(t,n){let r={};return ZE({document:t})({transformWidget({content:t,path:i}){let o=VU.ContentPath.serialize(i);return n(t,i)&&(r[o]=t),t}}),r},nP.migrateDocument=ZR,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nL;(0,n.__exportStar)(nP,t),(0,n.__exportStar)(Zw(),t),(0,n.__exportStar)(q0,t)}(nA);let ZD=(0,o.createContext)({update(){}});function ZA(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 ZL(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,readOnly:a,onContentChange:s}=t,c=(null==r?void 0:r.value)??(null==(n=i.config)?void 0:n.default_value)??!1;return N.jsxs(u.gN,{children:[N.jsx(u.fw,{name:"toggleOff"}),N.jsx(u.Qy,{htmlFor:o,children:ZA(i)}),N.jsxs(u.JO,{children:[N.jsx(u.xu,{padding:4,alignItems:"center",children:N.jsx(u.xv,{children:ZL(i,c)})}),N.jsx(u.rs,{id:o,sx:{alignSelf:"center",marginLeft:"auto",marginRight:12},checked:c,onCheckedChange(t){var n;a||s((n=t,{__TYPE__:"BooleanContent",value:n}))}})]})]})}function ZF(t){let{id:n,field:r,content:i,onContentChange:o}=t;return N.jsxs(u.gN,{children:[N.jsx(u.fw,{name:"colorLens"}),N.jsx(u.Qy,{id:n,children:ZA(r)}),N.jsx(u.JO,{children:N.jsx(u.xu,{padding:{left:4},alignItems:"center",children:N.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:ZL(r)})})})]})}function Zz(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 N.jsxs(u.gN,{children:[N.jsx(u.fw,{name:"dateRange"}),N.jsx(u.Qy,{id:n,children:ZA(i)}),N.jsx(u.JO,{children:N.jsx(u.xu,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:N.jsx(u.Wr,{mode:"date","aria-labelledby":n,disabled: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 ZU(t){return N.jsx(u.oi,{...t,padding:ZW})}let ZW={input:{inline:4},adornment:{inline:12}};function ZB(t){this.content=t}ZB.prototype={constructor:ZB,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 ZB(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 ZB(r)},addToStart:function(t,n){return new ZB([t,n].concat(this.remove(t).content))},addToEnd:function(t,n){var r=this.remove(t).content.slice();return r.push(t,n),new ZB(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 ZB(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=ZB.from(t)).size?new ZB(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=ZB.from(t)).size?new ZB(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var n=this;t=ZB.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}},ZB.from=function(t){if(t instanceof ZB)return t;var n=[];if(t)for(var r in t)n.push(r,t[r]);return new ZB(n)};class ZV{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 ZV(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 ZV(r,i)}cutByIndex(t,n){return t==n?ZV.empty:0==t&&n==this.content.length?this:new ZV(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 ZV(i,o)}addToStart(t){return new ZV([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new ZV(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 d=0,f=Math.min(s.text.length,c.text.length);for(;d<f&&s.text[s.text.length-d-1]==c.text[c.text.length-d-1];)d++,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 ZK(0,t);if(t==this.size)return ZK(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?ZK(r+1,o):ZK(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 ZV.empty;if(!Array.isArray(n))throw RangeError("Invalid input for Fragment.fromJSON");return new ZV(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return ZV.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 ZV(n||t,r)}static from(t){if(!t)return ZV.empty;if(t instanceof ZV)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new ZV([t],t.nodeSize);throw RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}ZV.empty=new ZV([],0);let Z$={index:0,offset:0};function ZK(t,n){return Z$.index=t,Z$.offset=n,Z$}function ZY(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(!ZY(t[i],n[i]))return!1}else{for(let o in t)if(!(o in n)||!ZY(t[o],n[o]))return!1;for(let a in n)if(!(a in t))return!1}return!0}let Zq=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&&ZY(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}};Zq.none=[];class ZG extends Error{}class ZZ{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 ZZ(r,this.openStart,this.openEnd)}removeBetween(t,n){return new ZZ(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 ZZ.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 ZZ(ZV.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 ZZ(t,r,i)}}function ZQ(t,n){if(!n.type.compatibleContent(t.type))throw new ZG("Cannot join "+n.type.name+" onto "+t.type.name)}function ZH(t,n,r){let i=t.node(r);return ZQ(i,n.node(r)),i}function ZJ(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 ZX(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&&(ZJ(t.nodeAfter,i),a++));for(let s=a;s<u;s++)ZJ(o.child(s),i);n&&n.depth==r&&n.textOffset&&ZJ(n.nodeBefore,i)}function Z0(t,n){return t.type.checkContent(n),t.copy(n)}function Z1(t,n,r){let i=[];return ZX(null,t,r,i),t.depth>r&&ZJ(Z0(ZH(t,n,r+1),Z1(t,n,r+1)),i),ZX(n,null,r,i),new ZV(i)}ZZ.empty=new ZZ(ZV.empty,0,0);class Z2{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 Zq.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 Z9(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 Z2(n,r,o)}static resolveCached(t,n){for(let r=0;r<Z4.length;r++){let i=Z4[r];if(i.pos==n&&i.doc==t)return i}let o=Z4[Z3]=Z2.resolve(t,n);return Z3=(Z3+1)%Z5,o}}let Z4=[],Z3=0,Z5=12;class Z9{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 Z8=Object.create(null),Z6=class t{constructor(t,n,r,i=Zq.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||ZV.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&&ZY(this.attrs,n||t.defaultAttrs||Z8)&&Zq.sameSet(this.marks,r||Zq.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 ZZ.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 ZZ(s,i.depth-a,o.depth-a)}replace(t,n,r){return function(t,n,r){if(r.openStart>t.depth)throw new ZG("Inserted content deeper than insertion position");if(t.depth-r.openStart!=n.depth-r.openEnd)throw new ZG("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 Z0(u,Z1(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(ZV.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}(i,n);return Z0(u,function t(n,r,i,o,a){let u=n.depth>a&&ZH(n,r,a+1),s=o.depth>a&&ZH(i,o,a+1),c=[];return ZX(null,n,a,c),u&&s&&r.index(a)==i.index(a)?(ZQ(u,s),ZJ(Z0(u,t(n,r,i,o,a+1)),c)):(u&&ZJ(Z0(u,Z1(n,r,a+1)),c),ZX(r,i,a,c),s&&ZJ(Z0(s,Z1(i,o,a+1)),c)),ZX(o,null,a,c),new ZV(c)}(n,c,l,r,o))}{let d=n.parent,f=d.content;return Z0(d,f.cut(0,n.parentOffset).append(i.content).append(f.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 Z2.resolveCached(this,t)}resolveNoCache(t){return Z2.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()+")"),Qe(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=ZV.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=Zq.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!Zq.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=ZV.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}};Z6.prototype.text=void 0;class Z7 extends Z6{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):Qe(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 Z7(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Z7(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 Qe(t,n){for(let r=t.length-1;r>=0;r--)n=t[r].type.name+"("+n+")";return n}class Qt{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){var r;let i=new Qn(t,n);if(null==i.next)return Qt.empty;let o=Qr(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 d=n;for(let f=0;f<t.min;f++){let p=r();o(a(t.expr,d),p),d=p}if(-1==t.max)o(a(t.expr,d),d);else for(let h=t.min;h<t.max;h++){let m=r();i(d,m),o(a(t.expr,d),m),d=m}return[i(d)]}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]);Ql(r,n).forEach(n=>{o||i.push([t,o=[]]),-1==o.indexOf(n)&&o.push(n)})})});let o=a[n.join(",")]=new Qt(n.indexOf(r.length-1)>-1);for(let u=0;u<i.length;u++){let s=i[u][1].sort(Qc);o.next.push({type:i[u][0],next:a[s.join(",")]||t(s)})}return o}(Ql(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 ZV.from(u.map(t=>t.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:l,next:d}=a.next[c];if(!(l.isText||l.hasRequiredAttrs())&&-1==i.indexOf(d)){i.push(d);let f=o(d,u.concat(l));if(f)return f}}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
|
-
`)}}Qt.empty=new Qt(!0);class Qn{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 Qr(t){let n=[];do n.push(Qi(t));while(t.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}function Qi(t){let n=[];do n.push(Qo(t));while(t.next&&")"!=t.next&&"|"!=t.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}function Qo(t){let n=Qs(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=Qu(t,n);else break;return n}function Qa(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let n=Number(t.next);return t.pos++,n}function Qu(t,n){let r=Qa(t),i=r;return t.eat(",")&&(i="}"!=t.next?Qa(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:i,expr:n}}function Qs(t){if(t.eat("(")){let n=Qr(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 Qc(t,n){return n-t}function Ql(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(Qc)}function Qd(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 Qf(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 Qp(t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Qm(t[r]);return n}let Qh=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=Qp(r.attrs),this.defaultAttrs=Qd(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==Qt.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:Qf(this.attrs,t)}create(t=null,n,r){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new Z6(this,this.computeAttrs(t),ZV.from(n),Zq.setFrom(r))}createChecked(t=null,n,r){return n=ZV.from(n),this.checkContent(n),new Z6(this,this.computeAttrs(t),n,Zq.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),(n=ZV.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(ZV.empty,!0);return a?new Z6(this,t,n.append(a),Zq.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:Zq.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 Qm{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Qg{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=Qp(i.attrs),this.excluded=null;let o=Qd(this.attrs);this.instance=o?new Zq(this,o):null}create(t=null){return!t&&this.instance?this.instance:new Zq(this,Qf(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,o)=>r[t]=new Qg(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 Qy{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let r in t)n[r]=t[r];n.nodes=ZB.from(t.nodes),n.marks=ZB.from(t.marks||{}),this.nodes=Qh.compile(this.spec.nodes,this),this.marks=Qg.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]=Qt.parse(u,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.markSet="_"==s?null:s?Qv(this,s.split(" ")):""!=s&&a.inlineContent?null:[]}for(let c in this.marks){let l=this.marks[c],d=l.spec.excludes;l.excluded=null==d?[l]:""==d?[]:Qv(this,d.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 Qh){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 Z7(r,r.defaultAttrs,t,Zq.setFrom(n))}mark(t,n){return"string"==typeof t&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return Z6.fromJSON(this,t)}markFromJSON(t){return Zq.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw RangeError("Unknown node type: "+t);return n}}function Qv(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 Qb{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 QI(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new QI(this,n,!0);return r.addAll(t,n.from,n.to),ZZ.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(Q_(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=QO(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=QO(t)),t.node||t.ignore||t.mark||(t.node=a)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Qb(t,Qb.schemaRules(t)))}}let Qx={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},QM={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},QT={ol:!0,ul:!0};function QS(t,n,r){return null!=n?(n?1:0)|("full"===n?2:0):t&&"pre"==t.whitespace?3:-5&r}class Qw{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=Zq.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(ZV.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=ZV.from(this.content);return!t&&this.match&&(i=i.append(this.match.fillBefore(ZV.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):Qk(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&&!Qx.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class QI{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=QS(null,n.preserveWhitespace,0)|(r?4:0);o=i?new Qw(i.type,i.attrs,Zq.none,Zq.none,!0,n.topMatch||i.type.contentMatch,a):r?new Qw(null,null,Zq.none,Zq.none,!0,null,a):new Qw(t.schema.topNodeType,null,Zq.none,Zq.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;QT.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&&QT.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:QM.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(Qx.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=Zq.none,r=Zq.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=QS(t,i,o.options);4&o.options&&0==o.content.length&&(a|=4),this.nodes.push(new Qw(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 Q_(t,n){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,n)}function QO(t){let n={};for(let r in t)n[r]=t[r];return n}function Qk(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 QC{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=Qj(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}=QC.renderSpec(Qj(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&&QC.renderSpec(Qj(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 d=l.indexOf(" ");d>0?u.setAttributeNS(l.slice(0,d),l.slice(d+1),s[l]):u.setAttribute(l,s[l])}}for(let f=c;f<n.length;f++){let p=n[f];if(0===p){if(f<n.length-1||f>c)throw RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}{let{dom:h,contentDOM:m}=QC.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 QC(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=QN(t.nodes);return n.text||(n.text=t=>t.text),n}static marksFromSchema(t){return QN(t.marks)}}function QN(t){let n={};for(let r in t){let i=t[r].spec.toDOM;i&&(n[r]=i)}return n}function Qj(t){return t.document||window.document}function QE(t,n){return t+65536*n}function QR(t){return 65535&t}class QD{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 QA{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&QA.empty)return QA.empty}recover(t){var n;let r=0,i=QR(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],d=s+c;if(t<=d){let f=c?t==s?-1:t==d?1:n:n,p=s+i+(f<0?0:l);if(r)return p;let h=t==(n<0?s:d)?null:QE(u/3,t-s),m=t==s?2:t==d?1:4;return(n<0?t!=s:t!=d)&&(m|=8),new QD(p,m,h)}i+=l-c}return r?t+i:new QD(t+i,0,null)}touches(t,n){let r=0,i=QR(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 QA(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?QA.empty:new QA(t<0?[0,-t,0]:[0,0,t])}}QA.empty=new QA([]);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 QD(t,i,null)}}let QP=Object.create(null);class QF{getMap(){return QA.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw RangeError("Invalid input for Step.fromJSON");let r=QP[n.stepType];if(!r)throw RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in QP)throw RangeError("Duplicate use of step JSON ID "+t);return QP[t]=n,n.prototype.jsonID=t,n}}class Qz{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Qz(t,null)}static fail(t){return new Qz(null,t)}static fromReplace(t,n,r,i){try{return Qz.ok(t.replace(n,r,i))}catch(o){if(o instanceof ZG)return Qz.fail(o.message);throw o}}}function QU(t,n,r){let i=[];for(let o=0;o<t.childCount;o++){let a=t.child(o);a.content.size&&(a=a.copy(QU(a.content,n,a))),a.isInline&&(a=n(a,r,o)),i.push(a)}return ZV.fromArray(i)}class QW extends QF{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 ZZ(QU(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 Qz.fromReplace(t,this.from,this.to,o)}invert(){return new QB(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 QW(n.pos,r.pos,this.mark)}merge(t){return t instanceof QW&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new QW(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 QW(n.from,n.to,t.markFromJSON(n.mark))}}QF.jsonID("addMark",QW);class QB extends QF{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 ZZ(QU(n.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),n.openStart,n.openEnd);return Qz.fromReplace(t,this.from,this.to,r)}invert(){return new QW(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 QB(n.pos,r.pos,this.mark)}merge(t){return t instanceof QB&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new QB(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 QB(n.from,n.to,t.markFromJSON(n.mark))}}QF.jsonID("removeMark",QB);class QV extends QF{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Qz.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Qz.fromReplace(t,this.pos,this.pos+1,new ZZ(ZV.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 QV(this.pos,n.marks[i]);return new QV(this.pos,this.mark)}}return new Q$(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new QV(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 QV(n.pos,t.markFromJSON(n.mark))}}QF.jsonID("addNodeMark",QV);class Q$ extends QF{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Qz.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Qz.fromReplace(t,this.pos,this.pos+1,new ZZ(ZV.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return n&&this.mark.isInSet(n.marks)?new QV(this.pos,this.mark):this}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Q$(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 Q$(n.pos,t.markFromJSON(n.mark))}}QF.jsonID("removeNodeMark",Q$);class QK extends QF{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&Qq(t,this.from,this.to)?Qz.fail("Structure replace would overwrite content"):Qz.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new QA([this.from,this.to-this.from,this.slice.size])}invert(t){return new QK(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 QK(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof QK)||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?ZZ.empty:new ZZ(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new QK(t.from,this.to,n,this.structure)}}{let r=this.slice.size+t.slice.size==0?ZZ.empty:new ZZ(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new QK(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 QK(n.from,n.to,ZZ.fromJSON(t,n.slice),!!n.structure)}}QF.jsonID("replace",QK);class QY extends QF{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&&(Qq(t,this.from,this.gapFrom)||Qq(t,this.gapTo,this.to)))return Qz.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Qz.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Qz.fromReplace(t,this.from,this.to,r):Qz.fail("Content does not fit in gap")}getMap(){return new QA([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 QY(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 QY(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 QY(n.from,n.to,n.gapFrom,n.gapTo,ZZ.fromJSON(t,n.slice),n.insert,!!n.structure)}}function Qq(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 QG(t,n,r){return(0==n||t.canReplace(n,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function QZ(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||!QG(i,o,a))break}return null}function QQ(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(QH).concat({type:n,attrs:r}).concat(a.map(QH)):null}function QH(t){return{type:t,attrs:null}}function QJ(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),d=o.index(s);if(l.type.spec.isolating)return!1;let f=l.content.cutByIndex(d,l.childCount),p=i&&i[c+1];p&&(f=f.replaceChild(0,p.type.create(p.attrs)));let h=i&&i[c]||l;if(!l.canReplace(d+1,l.childCount)||!h.type.validContent(f))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 QX(t,n){let r=t.resolve(n),i=r.index();return Q0(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(i,i+1)}function Q0(t,n){return!!(t&&n&&!t.isLeaf&&t.canAppend(n))}function Q1(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&&Q0(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 Q2(t,n,r=n,i=ZZ.empty){if(n==r&&!i.size)return null;let o=t.resolve(n),a=t.resolve(r);return Q4(o,a,i)?new QK(n,r,i):new Q3(o,a,i).fit()}function Q4(t,n,r){return!r.openStart&&!r.openEnd&&t.start()==n.start()&&t.parent.canReplace(t.index(),n.index(),r.content)}QF.jsonID("replaceAround",QY);class Q3{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=ZV.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=ZV.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 ZZ(a,u,s);return n>-1?new QY(i.pos,n,this.$to.pos,this.$to.end(),c,r):c.size||i.pos!=this.$to.pos?new QK(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=Q8(this.unplaced.content,u-1).firstChild).content:this.unplaced.content).firstChild;for(let d=this.depth;d>=0;d--){let{type:f,match:p}=this.frontier[d],h,m=null;if(1==a&&(l?p.matchType(l.type)||(m=p.fillBefore(ZV.from(l),!1)):c&&f.compatibleContent(c.type)))return{sliceDepth:u,frontierDepth:d,parent:c,inject:m};if(2==a&&l&&(h=p.findWrapping(l.type)))return{sliceDepth:u,frontierDepth:d,parent:c,wrap:h};if(c&&p.matchType(c.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=Q8(t,n);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new ZZ(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=Q8(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new ZZ(Q5(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new ZZ(Q5(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,d=[],{match:f,type:p}=this.frontier[n];if(i){for(let h=0;h<i.childCount;h++)d.push(i.child(h));f=f.matchFragment(i)}let m=s.size+t-(u.content.size-u.openEnd);for(;l<s.childCount;){let g=s.child(l),y=f.matchType(g.type);if(!y)break;(++l>1||0==c||g.content.size)&&(f=y,d.push(Q6(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=Q9(this.placed,n,ZV.from(d)),this.frontier[n].match=f,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?ZZ.empty:new ZZ(Q5(u.content,t-1,1),t-1,m<0?u.openEnd:t-1):new ZZ(Q5(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||!Q7(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=Q7(t,n,i,r,o);if(a){for(let u=n-1;u>=0;u--){let{match:s,type:c}=this.frontier[u],l=Q7(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=Q9(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=Q9(this.placed,this.depth,ZV.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(ZV.empty,!0);t.childCount&&(this.placed=Q9(this.placed,this.frontier.length,t))}}function Q5(t,n,r){return 0==n?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(Q5(t.firstChild.content,n-1,r)))}function Q9(t,n,r){return 0==n?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(Q9(t.lastChild.content,n-1,r)))}function Q8(t,n){for(let r=0;r<n;r++)t=t.firstChild.content;return t}function Q6(t,n,r){if(n<=0)return t;let i=t.content;return n>1&&(i=i.replaceChild(0,Q6(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(ZV.empty,!0)))),t.copy(i)}function Q7(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 He(t){return t.spec.defining||t.spec.definingForContent}function Ht(t,n,r,i,o){if(n<r){let a=t.firstChild;t=t.replaceChild(0,a.copy(Ht(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(ZV.empty,!0))}return t}function Hn(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 Hr extends QF{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 Qz.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 Qz.fromReplace(t,this.pos,this.pos+1,new ZZ(ZV.from(o),0,n.isLeaf?0:1))}getMap(){return QA.empty}invert(t){return new Hr(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 Hr(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 Hr(n.pos,n.attr,n.value)}}QF.jsonID("attr",Hr);let Hi=class extends Error{};(Hi=function t(n){let r=Error.call(this,n);return r.__proto__=t.prototype,r}).prototype=Object.create(Error.prototype),Hi.prototype.constructor=Hi,Hi.prototype.name="TransformError";class Ho{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 Hi(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=ZZ.empty){let i=Q2(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new ZZ(ZV.from(r),0,0))}delete(t,n){return this.replace(t,n,ZZ.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(Q4(o,a,i))return t.step(new QK(n,r,i));let u=Hn(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 d=o.node(c).type.spec;if(d.defining||d.definingAsContext||d.isolating)break;u.indexOf(c)>-1?s=c:o.before(c)==l&&u.splice(1,0,-c)}let f=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=He(b);if(x&&o.node(f).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 I=u[(w+f)%u.length],_=!0;I<0&&(_=!1,I=-I);let O=o.node(I-1),k=o.index(I-1);if(O.canReplaceWith(k,k,S.type,S.marks))return t.replace(o.before(I),_?a.after(I):r,new ZZ(Ht(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 ZZ(ZV.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=Hn(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,d=ZV.empty,f=0;for(let p=a,h=!1;p>r;p--)h||i.index(p)>0?(h=!0,d=ZV.from(i.node(p).copy(d)),f++):c--;let m=ZV.empty,g=0;for(let y=a,v=!1;y>r;y--)v||o.after(y+1)<o.end(y)?(v=!0,m=ZV.from(o.node(y).copy(m)),g++):l++;t.step(new QY(c,l,u,s,new ZZ(d.append(m),f,g),d.size-f,!0))}(this,t,n),this}join(t,n=1){return function(t,n,r){let i=new QK(n-r,n+r,ZZ.empty,!0);t.step(i)}(this,t,n),this}wrap(t,n){return function(t,n,r){let i=ZV.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=ZV.from(r[o].type.create(r[o].attrs,i))}let u=n.start,s=n.end;t.step(new QY(u,s,u,s,new ZZ(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,d;if(n.isTextblock&&!n.hasMarkup(i,o)&&(u=t.doc,s=t.mapping.slice(a).map(r),c=i,l=u.resolve(s),d=l.index(),l.parent.canReplaceWith(d,d+1,c))){t.clearIncompatible(t.mapping.slice(a).map(r,1),i);let f=t.mapping.slice(a),p=f.map(r,1),h=f.map(r+n.nodeSize,1);return t.step(new QY(p,h,p+1,h-1,new ZZ(ZV.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 QY(n,n+a.nodeSize,n+1,n+a.nodeSize-1,new ZZ(ZV.from(u),0,0),1,!0))}(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new Hr(t,n,r)),this}addNodeMark(t,n){return this.step(new QV(t,n)),this}removeNodeMark(t,n){if(!(n instanceof Zq)){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 Q$(t,n)),this}split(t,n=1,r){return function(t,n,r=1,i){let o=t.doc.resolve(n),a=ZV.empty,u=ZV.empty;for(let s=o.depth,c=o.depth-r,l=r-1;s>c;s--,l--){a=ZV.from(o.node(s).copy(a));let d=i&&i[l];u=ZV.from(d?d.type.create(d.attrs,u):o.node(s).copy(u))}t.step(new QK(n,n,new ZZ(a.append(u),r,r),!0))}(this,t,n,r),this}addMark(t,n,r){var i,o,a,u;let s,c,l,d;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 f=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==f&&l.mark.eq(u[m])?l.to=p:s.push(l=new QB(f,p,u[m])));d&&d.to==f?d.to=p:c.push(d=new QW(f,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 Qg){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 d=Math.min(o+i.nodeSize,n);for(let f=0;f<a.length;f++){let p=a[f],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=d,h.step=c):s.push({style:p,from:Math.max(o,t),to:d,step:c})}}}),s.forEach(t=>i.step(new QB(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,d=i.matchType(c.type);if(d){i=d;for(let f=0;f<c.marks.length;f++)r.allowsMarkType(c.marks[f].type)||t.step(new QB(u,l,c.marks[f]))}else a.push(new QK(u,l,ZZ.empty));u=l}if(!i.validEnd){let p=i.fillBefore(ZV.empty,!0);t.replace(u,u,new ZZ(p,0,0))}for(let h=a.length-1;h>=0;h--)t.step(a[h])}(this,t,n,r),this}}let Ha=Object.create(null);class Hu{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new Hs(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=ZZ.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],d=t.mapping.slice(a);t.replaceRange(d.map(c.pos),d.map(l.pos),s?ZZ.empty:n),0==s&&Hv(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),Hv(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new Hd(t):Hy(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?Hy(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):Hy(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 Hm(t.node(0))}static atStart(t){return Hy(t,t,0,0,1)||new Hm(t)}static atEnd(t){return Hy(t,t,t.content.size,t.childCount,-1)||new Hm(t)}static fromJSON(t,n){if(!n||!n.type)throw RangeError("Invalid input for Selection.fromJSON");let r=Ha[n.type];if(!r)throw RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Ha)throw RangeError("Duplicate use of selection JSON ID "+t);return Ha[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Hd.between(this.$anchor,this.$head).getBookmark()}}Hu.prototype.visible=!0;class Hs{constructor(t,n){this.$from=t,this.$to=n}}let Hc=!1;function Hl(t){Hc||t.parent.inlineContent||(Hc=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Hd extends Hu{constructor(t,n=t){Hl(t),Hl(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 Hu.near(r);let i=t.resolve(n.map(this.anchor));return new Hd(i.parent.inlineContent?i:r,r)}replace(t,n=ZZ.empty){if(super.replace(t,n),n==ZZ.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Hd&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Hf(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 Hd(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=Hu.findFrom(n,r,!0)||Hu.findFrom(n,-r,!0);if(!o)return Hu.near(n,r);n=o.$head}return t.parent.inlineContent||(0==i?t=n:(t=(Hu.findFrom(t,-r,!0)||Hu.findFrom(t,r,!0)).$anchor).pos<n.pos!=i<0&&(t=n)),new Hd(t,n)}}Hu.jsonID("text",Hd);class Hf{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Hf(t.map(this.anchor),t.map(this.head))}resolve(t){return Hd.between(t.resolve(this.anchor),t.resolve(this.head))}}class Hp extends Hu{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?Hu.near(o):new Hp(o)}content(){return new ZZ(ZV.from(this.node),0,0)}eq(t){return t instanceof Hp&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Hh(this.anchor)}static fromJSON(t,n){if("number"!=typeof n.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new Hp(t.resolve(n.anchor))}static create(t,n){return new Hp(t.resolve(n))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}Hp.prototype.visible=!1,Hu.jsonID("node",Hp);class Hh{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Hf(r,r):new Hh(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&Hp.isSelectable(r)?new Hp(n):Hu.near(n)}}class Hm extends Hu{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=ZZ.empty){if(n==ZZ.empty){t.delete(0,t.doc.content.size);let r=Hu.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Hm(t)}map(t){return new Hm(t)}eq(t){return t instanceof Hm}getBookmark(){return Hg}}Hu.jsonID("all",Hm);let Hg={map(){return this},resolve:t=>new Hm(t)};function Hy(t,n,r,i,o,a=!1){if(n.inlineContent)return Hd.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&&Hp.isSelectable(s))return Hp.create(t,r-(o<0?s.nodeSize:0))}else{let c=Hy(t,s,r+o,o<0?s.childCount:0,o,a);if(c)return c}r+=s.nodeSize*o}return null}function Hv(t,n,r){let i=t.steps.length-1;if(i<n)return;let o=t.steps[i];if(!(o instanceof QK||o instanceof QY))return;let a;t.mapping.maps[i].forEach((t,n,r,i)=>{null==a&&(a=i)}),t.setSelection(Hu.near(t.doc.resolve(a),r))}class Hb extends Ho{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 Zq.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)||Zq.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(Hu.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 Hx(t,n){return n&&t?t.bind(n):t}class HM{constructor(t,n,r){this.name=t,this.init=Hx(n.init,r),this.apply=Hx(n.apply,r)}}let HT=[new HM("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new HM("selection",{init:(t,n)=>t.selection||Hu.atStart(n.doc),apply:t=>t.selection}),new HM("storedMarks",{init:t=>t.storedMarks||null,apply:(t,n,r,i)=>i.selection.$cursor?t.storedMarks:null}),new HM("scrollToSelection",{init:()=>0,apply:(t,n)=>t.scrolledIntoView?n+1:n})];class HS{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=HT.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 HM(t.key,t.spec.state,t))})}}class Hw{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 d=0;d<this.config.plugins.length;d++)i.push(d<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 Hw(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 Hb(this)}static create(t){let n=new HS(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new Hw(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 HS(this.schema,t.plugins),r=n.fields,i=new Hw(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 HS(t.schema,t.plugins),o=new Hw(i);return i.fields.forEach(i=>{if("doc"==i.name)o.doc=Z6.fromJSON(t.schema,n.doc);else if("selection"==i.name)o.selection=Hu.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 HI{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:HO("plugin")}getState(t){return t[this.key]}}let H_=Object.create(null);function HO(t){return t in H_?t+"$"+ ++H_[t]:(H_[t]=0,t+"$")}class Hk{constructor(t="key"){this.key=HO(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}let HC=function(t){for(var n=0;;n++)if(!(t=t.previousSibling))return n},HN=function(t){let n=t.assignedSlot||t.parentNode;return n&&11==n.nodeType?n.host:n},Hj=null,HE=function(t,n,r){let i=Hj||(Hj=document.createRange());return i.setEnd(t,r??t.nodeValue.length),i.setStart(t,n||0),i},HR=function(t,n,r,i){return r&&(HA(t,n,r,i,-1)||HA(t,n,r,i,1))},HD=/^(img|br|input|textarea|hr)$/i;function HA(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||HP(t)||HD.test(t.nodeName)||"false"==t.contentEditable)return!1;n=HC(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 HP(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 HF=function(t){return t.focusNode&&HR(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Hz(t,n){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=n,r}function HU(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 HW="u">typeof navigator?navigator:null,HB="u">typeof document?document:null,HV=HW&&HW.userAgent||"",H$=/Edge\/(\d+)/.exec(HV),HK=/MSIE \d/.exec(HV),HY=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(HV),Hq=!!(HK||HY||H$),HG=HK?document.documentMode:HY?+HY[1]:H$?+H$[1]:0,HZ=!Hq&&/gecko\/(\d+)/i.test(HV);HZ&&(/Firefox\/(\d+)/.exec(HV)||[0,0])[1];let HQ=!Hq&&/Chrome\/(\d+)/.exec(HV),HH=!!HQ,HJ=HQ?+HQ[1]:0,HX=!Hq&&!!HW&&/Apple Computer/.test(HW.vendor),H0=HX&&(/Mobile\/\w+/.test(HV)||!!HW&&HW.maxTouchPoints>2),H1=H0||!!HW&&/Mac/.test(HW.platform),H2=!!HW&&/Win/.test(HW.platform),H4=/Android \d/.test(HV),H3=!!HB&&"webkitFontSmoothing"in HB.documentElement.style,H5=H3?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function H9(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function H8(t,n){return"number"==typeof t?t:t[n]}function H6(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 H7(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=HN(u)){if(1!=u.nodeType)continue;let s=u,c=s==a.body,l=c?H9(a):H6(s),d=0,f=0;if(n.top<l.top+H8(i,"top")?f=-(l.top-n.top+H8(o,"top")):n.bottom>l.bottom-H8(i,"bottom")&&(f=n.bottom-l.bottom+H8(o,"bottom")),n.left<l.left+H8(i,"left")?d=-(l.left-n.left+H8(o,"left")):n.right>l.right-H8(i,"right")&&(d=n.right-l.right+H8(o,"right")),d||f){if(c)a.defaultView.scrollBy(d,f);else{let p=s.scrollLeft,h=s.scrollTop;f&&(s.scrollTop+=f),d&&(s.scrollLeft+=d);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 Je(t){let n=[],r=t.ownerDocument;for(let i=t;i&&(n.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),t!=r);i=HN(i));return n}function Jt(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 Jn=null;function Jr(t,n){return t.left>=n.left-1&&t.left<=n.right+1&&t.top>=n.top-1&&t.top<=n.bottom+1}function Ji(t){return t.top<t.bottom||t.left<t.right}function Jo(t,n){let r=t.getClientRects();if(r.length){let i=r[n<0?0:r.length-1];if(Ji(i))return i}return Array.prototype.find.call(r,Ji)||t.getBoundingClientRect()}let Ja=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Ju(t,n,r){let{node:i,offset:o,atom:a}=t.docView.domFromPos(n,r<0?-1:1),u=H3||HZ;if(3==i.nodeType){if(u&&(Ja.test(i.nodeValue)||(r<0?!o:o==i.nodeValue.length))){let s=Jo(HE(i,o,o),r);if(HZ&&o&&/\s/.test(i.nodeValue[o-1])&&o<i.nodeValue.length){let c=Jo(HE(i,o-1,o-1),-1);if(c.top==s.top){let l=Jo(HE(i,o,o+1),-1);if(l.top!=s.top)return Js(l,l.left<c.left)}}return s}{let d=o,f=o,p=r<0?1:-1;return r<0&&!o?(f++,p=-1):r>=0&&o==i.nodeValue.length?(d--,p=1):r<0?d--:f++,Js(Jo(HE(i,d,f),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 Jc(h.getBoundingClientRect(),!1)}if(null==a&&o<HL(i)){let m=i.childNodes[o];if(1==m.nodeType)return Jc(m.getBoundingClientRect(),!0)}return Jc(i.getBoundingClientRect(),r>=0)}if(null==a&&o&&(r<0||o==HL(i))){let g=i.childNodes[o-1],y=3==g.nodeType?HE(g,HL(g)-(u?0:1)):1!=g.nodeType||"BR"==g.nodeName&&g.nextSibling?null:g;if(y)return Js(Jo(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?HE(v,0,u?0:1):1==v.nodeType?v:null:null;if(b)return Js(Jo(b,-1),!0)}return Js(Jo(3==i.nodeType?HE(i):i,-r),r>=0)}function Js(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 Jc(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 Jl(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 Jd=/[\u0590-\u08ac]/,Jf=null,Jp=null,Jh=!1;class Jm{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>HC(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 JT){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 Jg&&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?HC(c.dom)+1:0}}{let d,f=!0;for(;!(!(d=r<this.children.length?this.children[r]:null)||d.dom.parentNode==this.contentDOM);r++,f=!1);return d&&f&&!d.border&&!d.domAtom?d.domFromPos(0,n):{node:this.contentDOM,offset:d?HC(d.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 d=u;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=HC(f.dom)+1;break}t-=f.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=HC(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 d=this.domFromPos(t,t?-1:1),f=n==t?d:this.domFromPos(n,n?-1:1),p=r.getSelection(),h=!1;if((HZ||HX)&&t==n){let{node:m,offset:g}=d;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&&(d=f={node:v.parentNode,offset:HC(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(HZ&&p.focusNode&&p.focusNode!=f.node&&1==p.focusNode.nodeType){let M=p.focusNode.childNodes[p.focusOffset];M&&"false"==M.contentEditable&&(i=!0)}if(!(i||h&&HX)&&HR(d.node,d.offset,p.anchorNode,p.anchorOffset)&&HR(f.node,f.offset,p.focusNode,p.focusOffset))return;let T=!1;if((p.extend||t==n)&&!h){p.collapse(d.node,d.offset);try{t!=n&&p.extend(f.node,f.offset),T=!0}catch{}}if(!T){if(t>n){let S=d;d=f,f=S}let w=document.createRange();w.setEnd(f.node,f.offset),w.setStart(d.node,d.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 Jg extends Jm{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 Jy extends Jm{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 Jv extends Jm{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=QC.renderSpec(document,n.type.spec.toDOM(n,r))),new Jv(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=Jv.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;n<a&&(o=JD(o,n,a,r)),t>0&&(o=JD(o,0,t,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}}class Jb extends Jm{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,d=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:d}=QC.renderSpec(document,n.type.spec.toDOM(n)));d||n.isText||"BR"==l.nodeName||(l.hasAttribute("contenteditable")||(l.contentEditable="false"),n.type.spec.draggable&&(l.draggable=!0));let f=l;return l=JC(l,r,n),c?s=new JS(t,n,r,i,l,d||null,f,c,o,a+1):n.isText?new JM(t,n,r,i,l,f,o):new Jb(t,n,r,i,l,d||null,f,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=()=>ZV.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)&&JN(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 JE(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=[],d=null;for(let f=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(JR);for(let m=0;m<h.length;m++)r(h[m],f,!!d)}else r(p,f,!!d)}let g,y;if(d)y=-1,g=d,d=null;else if(f<t.childCount)y=f,g=t.child(f++);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&&(d=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?Zq.none:this.node.child(o).marks,r,t),s.placeWidget(n,t,i)},(n,a,c,l)=>{s.syncToMarks(n.marks,r,t);let d;s.findNodeMatch(n,a,c,l)||u&&t.state.selection.from>i&&t.state.selection.to<i+n.nodeSize&&(d=s.findIndexWithChild(o.node))>-1&&s.updateNodeAt(n,a,c,d,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=Jj(o),a=!0;o=o.nextSibling}else a=!0,n.insertBefore(c,o);if(s instanceof Jv){let l=o?o.previousSibling:n.lastChild;t(s.contentDOM,s.children,i),o=l?l.nextSibling:n.firstChild}}for(;o;)o=Jj(o),a=!0;a&&i.trackWrites==n&&(i.trackWrites=null)}(this.contentDOM,this.children,t),H0&&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 Hd)||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 Jy(this,o,n,i);t.input.compositionNodes.push(a),this.children=JD(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(JN(t,this.outerDeco))return;let n=1!=this.nodeDOM.nodeType,r=this.dom;this.dom=JO(this.dom,this.nodeDOM,J_(this.outerDeco,this.node,n),J_(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 Jx(t,n,r,i,o){JC(i,n,t);let a=new Jb(void 0,t,n,r,i,i,i,o,0);return a.contentDOM&&a.updateChildren(o,0),a}class JM extends Jb{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 JM(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 JT extends Jm{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 JS extends Jb{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 Jw=function(t){t&&(this.nodeName=t)};Jw.prototype=Object.create(null);let JI=[new Jw];function J_(t,n,r){if(0==t.length)return JI;let i=r?JI[0]:new Jw,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 Jw(u.nodeName)),u){let c=u[s];null!=c&&(r&&1==o.length&&o.push(i=new Jw(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 JO(t,n,r,i){if(r==JI&&i==JI)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=JI[0]),o=c}Jk(o,s||JI[0],u)}return o}function Jk(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,d;for(;d=l.exec(n.style);)t.style.removeProperty(d[1])}r.style&&(t.style.cssText+=r.style)}}function JC(t,n,r){return JO(t,t,JI,J_(n,r,1!=t.nodeType))}function JN(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 Jj(t){let n=t.nextSibling;return t.parentNode.removeChild(t),n}class JE{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 Jv)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=Jv.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 Jb){let c=this.preMatch.matched.get(s);if(null!=c&&c!=o)return!1;let l=s.dom,d,f=this.isLocked(l)&&!(t.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==t.text&&3!=s.dirty&&JN(n,s.outerDeco));if(!f&&s.update(t,n,r,i))return this.destroyBetween(this.index,u),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(s,t,n,r,i,a)))return this.top.children[this.index]=d,d.dirty=2,d.updateChildren(i,a+1),d.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=Jb.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=Jb.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 Jg(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 Jv;)t=(n=t).children[n.children.length-1];(!t||!(t instanceof JM)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((HX||HH)&&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 JT(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 JR(t,n){return t.type.side-n.type.side}function JD(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 JA(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(HF(r)){for(c=s;o&&!o.node;)o=o.parent;let d=o.node;if(o&&d.isAtom&&Hp.isSelectable(d)&&o.parent&&!(d.isInline&&function(t,n,r){for(let i=0==n,o=n==HL(t);i||o;){if(t==r)return!0;let a=HC(t);if(!(t=t.parentNode))return!1;i=i&&0==a,o=o&&a==HL(t)}}(r.focusNode,r.focusOffset,o.dom))){let f=o.posBefore;l=new Hp(u==f?s:i.resolve(f))}}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=J$(t,c,s,h)}return l}function JL(t){return t.editable?t.hasFocus():JY(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function JP(t,n=!1){let r=t.state.selection;if(JB(t,r),JL(t)){var i,o;if(!n&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&HH){let a=t.domSelectionRange(),u=t.domObserver.currentSelection;if(a.anchorNode&&u.anchorNode&&HR(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,d;i=t,s=i.domSelection(),c=document.createRange(),l=i.cursorWrapper.dom,d="IMG"==l.nodeName,d?c.setEnd(l.parentNode,HC(l)+1):c.setEnd(l,0),c.collapse(!1),s.removeAllRanges(),s.addRange(c),!d&&!i.state.selection.visible&&Hq&&HG<=11&&(l.disabled=!0,l.disabled=!1)}else{let{anchor:f,head:p}=r,h,m,g,y,v,b;!JF||r instanceof Hd||(r.$from.parent.inlineContent||(h=Jz(t,r.from)),r.empty||r.$from.parent.inlineContent||(m=Jz(t,r.to))),t.docView.setSelection(f,p,t.root,n),JF&&(h&&JW(h),m&&JW(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 JF=HX||HH&&HJ<63;function Jz(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(HX&&o&&"false"==o.contentEditable)return JU(o);if((!o||"false"==o.contentEditable)&&(!a||"false"==a.contentEditable)){if(o)return JU(o);if(a)return JU(a)}}function JU(t){return t.contentEditable="true",HX&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function JW(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function JB(t,n){if(n instanceof Hp){let r=t.docView.descAt(n.from);r!=t.lastSelectedViewDesc&&(JV(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else JV(t)}function JV(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function J$(t,n,r,i){return t.someProp("createSelectionBetween",i=>i(t,n,r))||Hd.between(n,r,i)}function JK(t){return(!t.editable||!!t.hasFocus())&&JY(t)}function JY(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 Jq(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&&Hu.findFrom(a,n)}function JG(t,n){return t.dispatch(t.state.tr.setSelection(n).scrollIntoView()),!0}function JZ(t,n,r){let i=t.state.selection;if(i instanceof Hd){if(!i.empty||r.indexOf("s")>-1)return!1;if(t.endOfTextblock(n>0?"forward":"backward")){let o=Jq(t.state,n);return!!o&&o instanceof Hp&&JG(t,o)}if(!(H1&&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)&&(Hp.isSelectable(u)?JG(t,new Hp(n<0?t.state.doc.resolve(a.pos-u.nodeSize):a)):!!H3&&JG(t,new Hd(t.state.doc.resolve(n<0?c:c+u.nodeSize))))}}else{if(i instanceof Hp&&i.node.isInline)return JG(t,new Hd(n>0?i.$to:i.$from));{let l=Jq(t.state,n);return!!l&&JG(t,l)}}}function JQ(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function JH(t){let n=t.pmViewDesc;return n&&0==n.size&&(t.nextSibling||"BR"!=t.nodeName)}function JJ(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(HZ&&1==r.nodeType&&i<JQ(r)&&JH(r.childNodes[i])&&(u=!0);;)if(i>0){if(1!=r.nodeType)break;{let s=r.childNodes[i-1];if(JH(s))o=r,a=--i;else if(3==s.nodeType)i=(r=s).nodeValue.length;else break}}else{if(J0(r))break;{let c=r.previousSibling;for(;c&&JH(c);)o=r.parentNode,a=HC(c),c=c.previousSibling;if(c)i=JQ(r=c);else{if((r=r.parentNode)==t.dom)break;i=0}}}u?J1(t,r,i):o&&J1(t,o,a)}(t):JX(t)}function JX(t){let n=t.domSelectionRange(),r=n.focusNode,i=n.focusOffset;if(!r)return;let o=JQ(r),a,u;for(;;)if(i<o){if(1!=r.nodeType)break;if(JH(r.childNodes[i]))a=r,u=++i;else break}else{if(J0(r))break;{let s=r.nextSibling;for(;s&&JH(s);)a=s.parentNode,u=HC(s)+1,s=s.nextSibling;if(s)i=0,o=JQ(r=s);else{if((r=r.parentNode)==t.dom)break;i=o=0}}}a&&J1(t,a,u)}function J0(t){let n=t.pmViewDesc;return n&&n.node&&n.node.isBlock}function J1(t,n,r){let i=t.domSelection();if(HF(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&&JP(t)},50)}function J2(t,n){let r=t.state.doc.resolve(n);if(!(HH||H2)&&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 J4(t,n,r){let i=t.state.selection;if(i instanceof Hd&&!i.empty||r.indexOf("s")>-1||H1&&r.indexOf("m")>-1)return!1;let{$from:o,$to:a}=i;if(!o.parent.inlineContent||t.endOfTextblock(n<0?"up":"down")){let u=Jq(t.state,n);if(u&&u instanceof Hp)return JG(t,u)}if(!o.parent.inlineContent){let s=n<0?o:a,c=i instanceof Hm?Hu.near(s,n):Hu.findFrom(s,n);return!!c&&JG(t,c)}return!1}function J3(t,n){if(!(t.state.selection instanceof Hd))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 J5(t,n,r){t.domObserver.stop(),n.contentEditable=r,t.domObserver.start()}function J9(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")||QC.fromSchema(t.state.schema),c=Xa(),l=c.createElement("div");l.appendChild(s.serializeFragment(i,{document:c}));let d=l.firstChild,f,p=0;for(;d&&1==d.nodeType&&(f=Xi[d.nodeName.toLowerCase()]);){for(let h=f.length-1;h>=0;h--){let m=c.createElement(f[h]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),p++}d=l.firstChild}return d&&1==d.nodeType&&d.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 J8(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 ZZ(ZV.from(t.state.schema.text(n.replace(/\r\n?/g,`
|
|
12
|
-
`))),0,0):ZZ.empty;let l=t.someProp("clipboardTextParser",r=>r(n,o,i,t));if(l)s=l;else{let d=o.marks(),{schema:f}=t.state,p=QC.fromSchema(f);u=document.createElement("div"),n.split(/(?:\r\n?|\n)+/).forEach(t=>{let n=u.appendChild(document.createElement("p"));t&&n.appendChild(p.serializeNode(f.text(t,d)))})}}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=Xa().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t),o;if((o=i&&Xi[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),H3&&function(t){let n=t.querySelectorAll(HH?"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")||Qb.fromSchema(t.state.schema)).parseSlice(u,{preserveWhitespace:!!(c||m),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||J6.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=ZV.from(c.create(i[s+1],o)),a++,u++}return new ZZ(o,a,u)}(Xr(s,+m[1],+m[2]),m[4]);else if((s=ZZ.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&&Xe(n,o,t,a[a.length-1],0))a[a.length-1]=r;else{a.length&&(a[a.length-1]=Xt(a[a.length-1],o.length));let u=J7(t,n);a.push(u),i=i.matchType(u.type),o=n}}),a)return ZV.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=Xr(s,v,b)}return t.someProp("transformPasted",n=>{s=n(s,t)}),s}let J6=/^(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 J7(t,n,r=0){for(let i=n.length-1;i>=r;i--)t=n[i].create(null,ZV.from(t));return t}function Xe(t,n,r,i,o){if(o<t.length&&o<n.length&&t[o]==n[o]){let a=Xe(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(ZV.from(J7(r,t,o+1))))}}function Xt(t,n){if(0==n)return t;let r=t.content.replaceChild(t.childCount-1,Xt(t.lastChild,n-1)),i=t.contentMatchAt(t.childCount).fillBefore(ZV.empty,!0);return t.copy(r.append(i))}function Xn(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=Xn(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(ZV.empty,!0))),t.replaceChild(n<0?0:t.childCount-1,u.copy(s))}function Xr(t,n,r){return n<t.openStart&&(t=new ZZ(Xn(t.content,-1,n,t.openStart,0,t.openEnd),n,t.openEnd)),r<t.openEnd&&(t=new ZZ(Xn(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}let Xi={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Xo=null;function Xa(){return Xo||(Xo=document.implementation.createHTMLDocument("title"))}let Xu={},Xs={},Xc={touchstart:!0,touchmove:!0};class Xl{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 Xd(t,n){t.input.lastSelectionOrigin=n,t.input.lastSelectionTime=Date.now()}function Xf(t){t.someProp("handleDOMEvents",n=>{for(let r in n)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=n=>Xp(t,n))})}function Xp(t,n){return t.someProp("handleDOMEvents",r=>{let i=r[n.type];return!!i&&(i(t,n)||n.defaultPrevented)})}function Xh(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 Xm(t){return{left:t.clientX,top:t.clientY}}function Xg(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 Xy(t,n,r){t.focused||t.focus();let i=t.state.tr.setSelection(n);"pointer"==r&&i.setMeta("pointer",!0),t.dispatch(i)}function Xv(t,n,r,i){return Xg(t,"handleDoubleClickOn",n,r,i)||t.someProp("handleDoubleClick",r=>r(t,n,i))}function Xb(t,n,r,i){return Xg(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&&(Xy(t,Hd.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)Xy(t,Hd.create(i,s+1,s+1+u.content.size),"pointer");else{if(!Hp.isSelectable(u))continue;Xy(t,Hp.create(i,s),"pointer")}return!0}}(t,r,i)}Xs.keydown=(t,n)=>{if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!XT(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(H4&&HH&&13==n.keyCode))){if(229!=n.keyCode&&t.domObserver.forceFlush(),!H0||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||H1&&72==o&&"c"==a)return J3(t,-1)||JJ(t,-1);if(46==o&&!n.shiftKey||H1&&68==o&&"c"==a)return J3(t,1)||JJ(t,1);if(13==o||27==o)return!0;if(37==o||H1&&66==o&&"c"==a){let u=37==o?"ltr"==J2(t,t.state.selection.from)?-1:1:-1;return JZ(t,u,a)||JJ(t,u)}if(39==o||H1&&70==o&&"c"==a){let s=39==o?"ltr"==J2(t,t.state.selection.from)?1:-1:1;return JZ(t,s,a)||JJ(t,s)}return 38==o||H1&&80==o&&"c"==a?J4(t,-1,a)||JJ(t,-1):40==o||H1&&78==o&&"c"==a?function(t){if(!HX||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;J5(t,i,"true"),setTimeout(()=>J5(t,i,"false"),20)}return!1}(t)||J4(t,1,a)||JX(t):a==(H1?"m":"c")&&(66==o||73==o||89==o||90==o)}(t,n)?n.preventDefault():Xd(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,Hz(13,"Enter"))),t.input.lastIOSEnter=0)},200)}}},Xs.keyup=(t,n)=>{16==n.keyCode&&(t.input.shiftKey=!1)},Xs.keypress=(t,n)=>{if(XT(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||H1&&n.metaKey)return;if(t.someProp("handleKeyPress",r=>r(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Hd)||!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 Xx=H1?"metaKey":"ctrlKey";Xu.mousedown=(t,n)=>{var r,i,o;t.input.shiftKey=n.shiftKey;let a=X_(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[Xx]&&("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 d=t.posAtCoords(Xm(n));d&&("singleClick"==s?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new XM(t,d,n,!!a)):("doubleClick"==s?Xv:Xb)(t,d.pos,d.inside,n)?n.preventDefault():Xd(t,"pointer"))};class XM{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[Xx],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 Hp&&l.from<=a&&l.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&HZ&&!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)),Xd(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(()=>JP(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(Xm(t))),this.updateAllowDefault(t),this.allowDefault||!u?Xd(this.view,"pointer"):(n=this.view,r=u.pos,i=u.inside,a=this.selectNode,Xg(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 Hp&&(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(Hp.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&&(Xy(t,Hp.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&&Hp.isSelectable(i))&&(Xy(t,new Hp(r),"pointer"),!0)}(n,i)))?t.preventDefault():0==t.button&&(this.flushed||HX&&this.mightDrag&&!this.mightDrag.node.isAtom||HH&&!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)))?(Xy(this.view,Hu.near(this.view.state.doc.resolve(u.pos)),"pointer"),t.preventDefault()):Xd(this.view,"pointer")}move(t){this.updateAllowDefault(t),Xd(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 XT(t,n){return!!t.composing||!!(HX&&500>Math.abs(n.timeStamp-t.input.compositionEndedAt))&&(t.input.compositionEndedAt=-2e8,!0)}Xu.touchstart=t=>{t.input.lastTouch=Date.now(),X_(t),Xd(t,"pointer")},Xu.touchmove=t=>{t.input.lastTouch=Date.now(),Xd(t,"pointer")},Xu.contextmenu=t=>{var n;return X_(t)};let XS=H4?5e3:-1;function Xw(t,n){clearTimeout(t.input.composingTimeout),n>-1&&(t.input.composingTimeout=setTimeout(()=>X_(t),n))}function XI(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 X_(t,n=!1){if(!(H4&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),XI(t),n||t.docView&&t.docView.dirty){let r=JA(t);return r&&!r.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(r)):t.updateState(t.state),!0}return!1}}Xs.compositionstart=Xs.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(),X_(t,!0),t.markCursor=null;else if(X_(t),HZ&&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}Xw(t,XS)},Xs.compositionend=(t,n)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=n.timeStamp,t.input.compositionID++,Xw(t,20))};let XO=Hq&&HG<15||H0&&H5<604;function Xk(t,n,r,i,o){var a;let u=J8(t,n,r,i,t.state.selection.$from);if(t.someProp("handlePaste",n=>n(t,o,u||ZZ.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}Xu.copy=Xs.cut=(t,n)=>{let r=t.state.selection,i="cut"==n.type;if(r.empty)return;let o=XO?null:n.clipboardData,{dom:a,text:u}=J9(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"))},Xs.paste=(t,n)=>{if(t.composing&&!H4)return;let r=XO?null:n.clipboardData,i=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&Xk(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?Xk(t,i.value,null,o,n):Xk(t,i.textContent,i.innerHTML,o,n)},50)}(t,n)};class XC{constructor(t,n){this.slice=t,this.move=n}}let XN=H1?"altKey":"ctrlKey";for(let Xj in Xu.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(Xm(r));if(!(a&&a.pos>=o.from&&a.pos<=(o instanceof Hp?o.to-1:o.to))){if(i&&i.mightDrag)t.dispatch(t.state.tr.setSelection(Hp.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(Hp.create(t.state.doc,u.posBefore)))}}let s=t.state.selection.content(),{dom:c,text:l}=J9(t,s);r.dataTransfer.clearData(),r.dataTransfer.setData(XO?"Text":"text/html",c.innerHTML),r.dataTransfer.effectAllowed="copyMove",XO||r.dataTransfer.setData("text/plain",l),t.dragging=new XC(s,!r[XN])},Xu.dragend=t=>{let n=t.dragging;window.setTimeout(()=>{t.dragging==n&&(t.dragging=null)},50)},Xs.dragover=Xs.dragenter=(t,n)=>n.preventDefault(),Xs.drop=(t,n)=>{let r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Xm(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=J8(t,n.dataTransfer.getData(XO?"Text":"text/plain"),XO?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[XN]);if(t.someProp("handleDrop",r=>r(t,n,a||ZZ.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),d=i.node(s),f=!1;if(1==u)f=d.canReplace(l,l,o);else{let p=d.contentMatchAt(l).findWrapping(o.firstChild.type);f=p&&d.canReplaceWith(l,l,p[0])}if(f)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),d=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,f=c.doc;if(d?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(f))return;let p=c.doc.resolve(l);if(d&&Hp.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new Hp(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(J$(t,p,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},Xu.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())&&JP(t)},20))},Xu.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)},Xu.beforeinput=(t,n)=>{if(HH&&H4&&"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,Hz(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)}},Xs)Xu[Xj]=Xs[Xj];function XE(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 XR{constructor(t,n){this.toDOM=t,this.spec=n||XF,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 XR&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&XE(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class XD{constructor(t,n){this.attrs=t,this.spec=n||XF}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 XD&&XE(this.attrs,t.attrs)&&XE(this.spec,t.spec)}static is(t){return t.type instanceof XD}destroy(){}}let XA=class t{constructor(t,n){this.attrs=t,this.spec=n||XF}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&&XE(this.attrs,n.attrs)&&XE(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 XR(n,r))}static inline(t,n,r,i){return new XL(t,n,new XD(r,i))}static node(t,n,r,i){return new XL(t,n,new XA(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof XD}}let XP=[],XF={};class Xz{constructor(t,n){this.local=t.length?t:XP,this.children=n.length?n:XP}static create(t,n){return n.length?XK(n,t,0,XF):XU}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==XU||0==t.maps.length?this:this.mapInner(t,n,0,0,r||XF)}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 d=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-d)continue;let f=s[u]+l-d;n>=f?s[u+1]=t<=f?-2:-1:r>=o&&a&&(s[u]+=a,s[u+1]+=a)}d+=a}),l=r.maps[c].map(l,-1)}let f=!1;for(let p=0;p<s.length;p+=3)if(s[p+1]<0){if(-2==s[p+1]){f=!0,s[p+1]=-1;continue}let h=r.map(t[p]+a),m=h-o;if(m<0||m>=i.content.size){f=!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!=XU?(s[p]=m,s[p+1]=g,s[p+2]=x):(s[p+1]=-2,f=!0)}else f=!0}if(f){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=XK(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,I=0;w<T.children.length;w+=3){let _=T.children[w];for(;I<s.length&&s[I]<_;)I+=3;s.splice(I,0,T.children[w],T.children[w+1],T.children[w+2])}}return new Xz(n.sort(XY),s)}(this.children,a||[],t,n,r,i,o):a?new Xz(a.sort(XY),XP):XU}add(t,n){return n.length?this==XU?Xz.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=XV(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,XK(s,t,u+1,XF)),o+=3}});let a=XB(o?X$(n):n,-r);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||a.splice(u--,1);return new Xz(a.length?this.local.concat(a).sort(XY):this.local,i||this.children)}remove(t){return 0==t.length||this==XU?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 d=r[o+2].removeInner(a,u+1);d!=XU?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let f=0,p;f<t.length;f++)if(p=t[f])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 Xz(i,r):XU}forChild(t,n){if(this==XU)return this;if(n.isLeaf)return Xz.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 XD){let l=Math.max(a,c.from)-a,d=Math.min(u,c.to)-a;l<d&&(i||(i=[])).push(c.copy(l,d))}}if(i){let f=new Xz(i.sort(XY),XP);return r?new XW([f,r]):f}return r||XU}eq(t){if(this==t)return!0;if(!(t instanceof Xz)||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 Xq(this.localsInner(t))}localsInner(t){if(this==XU)return XP;if(t.inlineContent||!this.local.some(XD.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof XD||n.push(this.local[r]);return n}}Xz.empty=new Xz([],[]),Xz.removeOverlap=Xq;let XU=Xz.empty;class XW{constructor(t){this.members=t}map(t,n){let r=this.members.map(r=>r.map(t,n,XF));return XW.from(r)}forChild(t,n){if(n.isLeaf)return Xz.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=XU&&(o instanceof XW?r=r.concat(o.members):r.push(o))}return XW.from(r)}eq(t){if(!(t instanceof XW)||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?Xq(r?n:n.sort(XY)):XP}static from(t){switch(t.length){case 0:return XU;case 1:return t[0];default:return new XW(t.every(t=>t instanceof Xz)?t:t.reduce((t,n)=>t.concat(n instanceof Xz?n:n.members),[]))}}}function XB(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 XV(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 X$(t){let n=[];for(let r=0;r<t.length;r++)null!=t[r]&&n.push(t[r]);return n}function XK(t,n,r,i){let o=[],a=!1;n.forEach((n,u)=>{let s=XV(t,n,u+r);if(s){a=!0;let c=XK(s,n,r+u+1,i);c!=XU&&o.push(u,u+n.nodeSize,c)}});let u=XB(a?X$(t):t,-r).sort(XY);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 Xz(u,o):XU}function XY(t,n){return t.from-n.from||t.to-n.to}function Xq(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),XG(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),XG(n,o,i.copy(a.from,i.to)));break}}return n}function XG(t,n,r){for(;n<t.length&&XY(r,t[n])>0;)n++;t.splice(n,0,r)}function XZ(t){let n=[];return t.someProp("decorations",r=>{let i=r(t.state);i&&i!=XU&&n.push(i)}),t.cursorWrapper&&n.push(Xz.create(t.state.doc,[t.cursorWrapper.deco])),XW.from(n)}let XQ={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},XH=Hq&&HG<=11;class XJ{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 XX{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new XJ,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]);Hq&&HG<=11&&t.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),XH&&(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,XQ)),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(JK(this.view)){if(this.suppressingSelectionUpdates)return JP(this.view);if(Hq&&HG<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&HR(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=HN(i))n.add(i);for(let o=t.anchorNode;o;o=HN(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)&&JK(n)&&!this.ignoreSelectionChange(i),a=-1,u=-1,s=!1,c=[];if(n.editable)for(let l=0;l<r.length;l++){let d=this.registerMutation(r[l],c);d&&(a=a<0?d.from:Math.min(d.from,a),u=u<0?d.to:Math.max(d.to,u),d.typeOver&&(s=!0))}if(HZ&&c.length>1){let f=c.filter(t=>"BR"==t.nodeName);if(2==f.length){let p=f[0],h=f[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&&HF(i)&&(m=JA(n))&&m.eq(Hu.near(n.state.doc.resolve(0),1))?(n.input.lastFocus=0,JP(n),this.currentSelection.set(i),n.scrollToSelection()):(a>-1||o)&&(a>-1&&(n.docView.markDirty(a,u),t=n,X0.has(t)||(X0.set(t,null),-1===["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace))||(t.requiresGeckoHackNode=HZ,X1||(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."),X1=!0))),this.handleDOMChange(a,u,s,c),n.docView&&n.docView.dirty?n.updateState(n.state):this.currentSelection.eq(i)||JP(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(Hq&&HG<=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?HC(o)+1:0,d=r.localPosFromDOM(t.target,l,-1),f=a&&a.parentNode==t.target?HC(a):t.target.childNodes.length,p=r.localPosFromDOM(t.target,f,1);return{from:d,to:p}}}}let X0=new WeakMap,X1=!1;function X2(t){let n=t.pmViewDesc;if(n)return n.parseRule();if("BR"==t.nodeName&&t.parentNode){if(HX&&/^(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||HX&&/^(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 X4=/^(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 X3(t,n,r){return Math.max(r.anchor,r.head)>n.content.size?null:J$(t,n.resolve(r.anchor),n.resolve(r.head))}function X5(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 X9{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 Xl,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(eet),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=X7(this),X6(this),this.nodeViews=eee(this),this.docView=Jx(this.state.doc,X8(this),XZ(this),this.dom,this),this.domObserver=new XX(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=JA(t,a);if(u&&!t.state.selection.eq(u)){if(HH&&H4&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",n=>n(t,Hz(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 d=t.state.selection,f=function(t,n,r){let{node:i,fromOffset:o,toOffset:a,from:u,to:s}=t.docView.parseRange(n,r),c=t.domSelectionRange(),l,d=c.anchorNode;if(d&&t.dom.contains(1==d.nodeType?d:d.parentNode)&&(l=[{node:d,offset:c.anchorOffset}],HF(c)||l.push({node:c.focusNode,offset:c.focusOffset})),HH&&8===t.input.lastKeyCode)for(let f=a;f>o;f--){let p=i.childNodes[f-1],h=p.pmViewDesc;if("BR"==p.nodeName&&!h){a=f;break}if(!h||h.size)break}let m=t.state.doc,g=t.someProp("domParser")||Qb.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:X2,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(f.from,f.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 d=i<=a&&i>=s?a-i:0;a-=d,u=a+(u-s),s=a}return{start:a,endA:u,endB:s}}(h.content,f.doc.content,f.from,m,g);if((H0&&t.input.lastIOSEnter>Date.now()-225||H4)&&o.some(t=>1==t.nodeType&&!X4.test(t.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",n=>n(t,Hz(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y){if(i&&d instanceof Hd&&!d.empty&&d.$head.sameParent(d.$anchor)&&!t.composing&&!(f.sel&&f.sel.anchor!=f.sel.head))y={start:d.from,endA:d.to,endB:d.to};else{if(f.sel){let v=X3(t,t.state.doc,f.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(HH&&t.cursorWrapper&&f.sel&&f.sel.anchor==t.cursorWrapper.deco.from&&f.sel.head==f.sel.anchor){let x=y.endB-y.start;f.sel={anchor:f.sel.anchor+x,head:f.sel.anchor+x}}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&y.start==y.endB&&t.state.selection instanceof Hd&&(y.start>t.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=f.from?y.start=t.state.selection.from:y.endA<t.state.selection.to&&y.endA>=t.state.selection.to-2&&t.state.selection.to<=f.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),Hq&&HG<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>f.from&&" \xa0"==f.doc.textBetween(y.start-f.from-1,y.start-f.from+1)&&(y.start--,y.endA--,y.endB--);let M=f.doc.resolveNoCache(y.start-f.from),T=f.doc.resolveNoCache(y.endB-f.from),S=p.resolve(y.start),w=M.sameParent(T)&&M.parent.inlineContent&&S.end()>=y.endA,I;if((H0&&t.input.lastIOSEnter>Date.now()-225&&(!w||o.some(t=>"DIV"==t.nodeName||"P"==t.nodeName))||!w&&M.pos<f.doc.content.size&&!M.sameParent(T)&&(I=Hu.findFrom(f.doc.resolve(M.pos+1),1,!0))&&I.head==T.pos)&&t.someProp("handleKeyDown",n=>n(t,Hz(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||X5(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(X5(a,!0,!0));return!(!u.parent.isTextblock||u.pos>r||X5(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,Hz(8,"Backspace")))){H4&&HH&&t.domObserver.suppressSelectionUpdates();return}HH&&H4&&y.endB==y.start&&(t.input.lastAndroidDelete=Date.now()),H4&&!w&&M.start()!=T.start()&&0==T.parentOffset&&M.depth==T.depth&&f.sel&&f.sel.anchor==f.sel.head&&f.sel.head==y.endA&&(y.endB-=2,T=f.doc.resolveNoCache(y.endB-f.from),setTimeout(()=>{t.someProp("handleKeyDown",function(n){return n(t,Hz(13,"Enter"))})},20));let _=y.start,O=y.endA,k,C,N;if(w){if(M.pos==T.pos)Hq&&HG<=11&&0==M.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>JP(t),20)),k=t.state.tr.delete(_,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 d=0;d<r.length;d++)a=r[d].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 f=[];for(let p=0;p<n.childCount;p++)f.push(c(n.child(p)));if(ZV.from(f).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(_,O,N.mark):k.removeMark(_,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,_,O,j)))return;k=t.state.tr.insertText(j,_,O)}}if(k||(k=t.state.tr.replace(_,O,f.doc.slice(y.start-f.from,y.endB-f.from))),f.sel){let E=X3(t,k.doc,f.sel);E&&!(HH&&H4&&t.composing&&E.empty&&(y.start!=y.endB||t.input.lastAndroidDelete<Date.now()-100)&&(E.head==_||E.head==k.mapping.map(O)-1)||Hq&&E.empty&&E.head==_)&&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 Xu){let r=Xu[n];t.dom.addEventListener(n,t.input.eventHandlers[n]=n=>{!Xh(t,n)||Xp(t,n)||!t.editable&&n.type in Xs||r(t,n)},Xc[n]?{passive:!0}:void 0)}HX&&t.dom.addEventListener("input",()=>null),Xf(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&&Xf(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(eet),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&&(XI(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=eee(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)&&Xf(this),this.editable=X7(this),X6(this);let s=XZ(this),c=X8(this),l=r.plugins==t.plugins||r.doc.eq(t.doc)?t.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",d=i||!this.docView.matchesNode(t.doc,c,s);(d||!t.selection.eq(r.selection))&&(o=!0);let f="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:Je(t.dom)}}(this);if(o){var p,h,m;this.domObserver.stop();let g,y=d&&(Hq||HH)&&!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(d){let v=HH?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(t.doc,c,s,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Jx(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(),HR(b.node,b.offset,x.anchorNode,x.anchorOffset)))?JP(this,y):(JB(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():f&&function({refDOM:t,refTop:n,stack:r}){let i=t?t.getBoundingClientRect().top:0;Jt(r,0==i?0:i-n)}(f)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this))){if(this.state.selection instanceof Hp){let n=this.docView.domAfterPos(this.state.selection.from);1==n.nodeType&&H7(this,n.getBoundingClientRect(),t)}else H7(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(Hq){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(Jn)return t.focus(Jn);let n=Je(t);t.focus(null==Jn?{get preventScroll(){return Jn={preventScroll:!0},!0}}:void 0),Jn||(Jn=!1,Jt(n,0))}(this.dom),JP(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=HU(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 d=t.dom.getBoundingClientRect();if(!Jr(n,d)||!(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 d=c[l];if(Jr(r,d))return t(s,r,d)}}if((u=(u+1)%o)==a)break}return n}(t.dom,n,d)))return null}if(HX)for(let f=c;a&&f;f=HN(f))f.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(HZ&&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,d;for(let f=n.firstChild,p=0;f;f=f.nextSibling,p++){let h;if(1==f.nodeType)h=f.getClientRects();else{if(3!=f.nodeType)continue;h=HE(f).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=f,o=y,a=y&&3==i.nodeType?{left:g.right<r.left?g.right:g.left,top:r.top}:r,1==f.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=f,d={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=d,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=Jo(i,1);if(a.top!=a.bottom&&Jr(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 Ju(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 Jf==(i=n||this.state)&&Jp==t?Jh:(Jf=i,Jp=t,Jh="up"==t||"down"==t?(a=this,c=i.selection,l="up"==t?c.$from:c.$to,Jl(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=Ju(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=HE(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 Jd.test(i.parent.textContent)&&u.modify?Jl(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:d,focusOffset:f}=t.domSelectionRange(),p=d&&!l.contains(1==d.nodeType?d:d.parentNode)||n==d&&o==f;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 Xk(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Xk(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,[],XZ(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;Xp(this,t)||!Xu[t.type]||!this.editable&&t.type in Xs||Xu[t.type](this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return HX&&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 HR(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 X8(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 X6(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 X7(t){return!t.someProp("editable",n=>!1===n(t.state))}function eee(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 eet(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 een={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:"'"},eer={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},eei="u">typeof navigator&&/Mac/.test(navigator.platform),eeo="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),eea=0;eea<10;eea++)een[48+eea]=een[96+eea]=String(eea);for(var eea=1;eea<=24;eea++)een[eea+111]="F"+eea;for(var eea=65;eea<=90;eea++)een[eea]=String.fromCharCode(eea+32),eer[eea]=String.fromCharCode(eea);for(var eeu in een)eer.hasOwnProperty(eeu)||(eer[eeu]=een[eeu]);let ees="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function eec(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))ees?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 eel(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 eed=(t,n)=>!t.selection.empty&&(n&&n(t.tr.deleteSelection().scrollIntoView()),!0),eef=(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=eem(i);if(!o){let a=i.blockRange(),u=a&&QZ(a);return null!=u&&(n&&n(t.tr.lift(a,u).scrollIntoView()),!0)}let s=o.nodeBefore;if(!s.type.spec.isolating&&eek(t,o,n))return!0;if(0==i.parent.content.size&&(eep(s,"end")||Hp.isSelectable(s))){let c=Q2(t.doc,i.before(),i.after(),ZZ.empty);if(c&&c.slice.size<c.to-c.from){if(n){let l=t.tr.step(c);l.setSelection(eep(s,"end")?Hu.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):Hp.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 eep(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 eeh=(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=eem(i)}let u=a&&a.nodeBefore;return!!(u&&Hp.isSelectable(u))&&(n&&n(t.tr.setSelection(Hp.create(t.doc,a.pos-u.nodeSize)).scrollIntoView()),!0)};function eem(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 eeg=(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=eev(i);if(!o)return!1;let a=o.nodeAfter;if(eek(t,o,n))return!0;if(0==i.parent.content.size&&(eep(a,"start")||Hp.isSelectable(a))){let u=Q2(t.doc,i.before(),i.after(),ZZ.empty);if(u&&u.slice.size<u.to-u.from){if(n){let s=t.tr.step(u);s.setSelection(eep(a,"start")?Hu.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):Hp.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)},eey=(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=eev(i)}let u=a&&a.nodeAfter;return!!(u&&Hp.isSelectable(u))&&(n&&n(t.tr.setSelection(Hp.create(t.doc,a.pos)).scrollIntoView()),!0)};function eev(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 eeb=(t,n)=>{let r=t.selection,i=r instanceof Hp,o;if(i){if(r.node.isTextblock||!QX(t.doc,r.from))return!1;o=r.from}else if(null==(o=Q1(t.doc,r.from,-1)))return!1;if(n){let a=t.tr.join(o);i&&a.setSelection(Hp.create(a.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),n(a.scrollIntoView())}return!0},eex=(t,n)=>{let r=t.selection,i;if(r instanceof Hp){if(r.node.isTextblock||!QX(t.doc,r.to))return!1;i=r.to}else if(null==(i=Q1(t.doc,r.to,1)))return!1;return n&&n(t.tr.join(i).scrollIntoView()),!0},eeM=(t,n)=>{let{$from:r,$to:i}=t.selection,o=r.blockRange(i),a=o&&QZ(o);return null!=a&&(n&&n(t.tr.lift(o,a).scrollIntoView()),!0)},eeT=(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 eeS(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 eew=(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=eeS(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(Hu.near(c.doc.resolve(s),1)),n(c.scrollIntoView())}return!0},eeI=(t,n)=>{let r=t.selection,{$from:i,$to:o}=r;if(r instanceof Hm||i.parent.inlineContent||o.parent.inlineContent)return!1;let a=eeS(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(Hd.create(s.doc,u+1)),n(s.scrollIntoView())}return!0},ee_=(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(QJ(t.doc,i))return n&&n(t.tr.split(i).scrollIntoView()),!0}let o=r.blockRange(),a=o&&QZ(o);return null!=a&&(n&&n(t.tr.lift(o,a).scrollIntoView()),!0)},eeO=(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(Hp.create(t.doc,o))),!0)};function eek(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 d,f,p;if(d=n.nodeBefore,f=n.nodeAfter,p=n.index(),d&&f&&d.type.compatibleContent(f.type)&&(!d.content.size&&n.parent.canReplace(p-1,p)?(r&&r(t.tr.delete(n.pos-d.nodeSize,n.pos).scrollIntoView()),!0):!!(n.parent.canReplace(p,p+1)&&(f.isTextblock||QX(t.doc,n.pos)))&&(r&&r(t.tr.clearIncompatible(n.pos,d.type,d.contentMatchAt(d.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=ZV.empty;for(let y=c.length-1;y>=0;y--)g=ZV.from(c[y].create(null,g));g=ZV.from(u.copy(g));let v=t.tr.step(new QY(n.pos-1,m,n.pos,m,new ZZ(g,1,0),c.length,!0)),b=m+2*c.length;QX(v.doc,b)&&v.join(b),r(v.scrollIntoView())}return!0}let x=Hu.findFrom(n,1),M=x&&x.$from.blockRange(x.$to),T=M&&QZ(M);if(null!=T&&T>=n.depth)return r&&r(t.tr.lift(M,T).scrollIntoView()),!0;if(h&&eep(s,"start",!0)&&eep(u,"end")){let S=u,w=[];for(;w.push(S),!S.isTextblock;)S=S.lastChild;let I=s,_=1;for(;!I.isTextblock;I=I.firstChild)_++;if(S.canReplace(S.childCount,S.childCount,I.content)){if(r){let O=ZV.empty;for(let k=w.length-1;k>=0;k--)O=ZV.from(w[k].copy(O));let C=t.tr.step(new QY(n.pos-w.length,n.pos+s.nodeSize,n.pos+_,n.pos+s.nodeSize-_,new ZZ(O,w.length,0),0,!0));r(C.scrollIntoView())}return!0}}return!1}function eeC(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(Hd.create(n.doc,t<0?o.start(a):o.end(a)))),!0)}}let eeN=eeC(-1),eej=eeC(1);function eeE(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:d},$to:{pos:f}}=r.selection.ranges[l];c.setBlockType(d,f,t,n)}i(c.scrollIntoView())}return!0}}function eeR(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 eeD{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)),d={...Object.fromEntries(Object.entries(r).map(([t,r])=>[t,(...t)=>{let i=this.buildProps(c,n),o=r(...t)(i);return u.push(o),d}])),run:l};return d}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:eeR({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 eeA{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 eeP(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 eeF(t){let n=[],{nodeExtensions:r,markExtensions:i}=eeP(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 eez(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 eeU(...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 eeW(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)=>eeU(t,n),{})}function eeB(t){return"function"==typeof t}function eeV(t,n,...r){return eeB(t)?n?t.bind(n)(...r):t(...r):t}function ee$(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 eeK(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 eeY(t,n){var r;let i=eeF(t),{nodeExtensions:o,markExtensions:a}=eeP(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=eeK({...u,content:eeV(eeL(r,"content",a)),marks:eeV(eeL(r,"marks",a)),group:eeV(eeL(r,"group",a)),inline:eeV(eeL(r,"inline",a)),atom:eeV(eeL(r,"atom",a)),selectable:eeV(eeL(r,"selectable",a)),draggable:eeV(eeL(r,"draggable",a)),code:eeV(eeL(r,"code",a)),defining:eeV(eeL(r,"defining",a)),isolating:eeV(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=eeV(eeL(r,"parseHTML",a));c&&(s.parseDOM=c.map(t=>ee$(t,o)));let l=eeL(r,"renderHTML",a);l&&(s.toDOM=t=>l({node:t,HTMLAttributes:eeW(t,o)}));let d=eeL(r,"renderText",a);return d&&(s.toText=d),[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=eeK({...u,inclusive:eeV(eeL(r,"inclusive",a)),excludes:eeV(eeL(r,"excludes",a)),group:eeV(eeL(r,"group",a)),spanning:eeV(eeL(r,"spanning",a)),code:eeV(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=eeV(eeL(r,"parseHTML",a));c&&(s.parseDOM=c.map(t=>ee$(t,o)));let l=eeL(r,"renderHTML",a);return l&&(s.toDOM=t=>l({mark:t,HTMLAttributes:eeW(t,o)})),[r.name,s]}));return new Qy({topNode:u,nodes:s,marks:c})}function eeq(t,n){return n.nodes[t]||n.marks[t]||null}function eeG(t,n){return Array.isArray(n)?n.some(n=>("string"==typeof n?n:n.name)===t.name):n}let eeZ=(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 eeQ(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class eeH{constructor(t){this.find=t.find,this.handler=t.handler}}let eeJ=(t,n)=>{if(eeQ(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 eeX(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 d=!1,f=eeZ(l)+a;return u.forEach(t=>{if(d)return;let n=eeJ(f,t.find);if(!n)return;let u=c.state.tr,l=eeR({state:c.state,transaction:u}),p={from:i-(n[0].length-a.length),to:o},{commands:h,chain:m,can:g}=new eeD({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),d=!0)}),d}class ee0{constructor(t){this.find=t.find,this.handler=t.handler}}let ee1=(t,n)=>{if(eeQ(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 ee2{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=ee2.resolve(t),this.schema=eeY(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:eeq(t.name,this.schema)};"mark"===t.type&&(!(null!==(n=eeV(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 d=eeL(t,"onDestroy",r);d&&this.editor.on("destroy",d)})}static resolve(t){let n=ee2.sort(ee2.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:eeq(n.name,this.schema)},i=eeL(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){let{editor:t}=this,n=ee2.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:eeq(n.name,this.schema)},s=[],c=eeL(n,"addKeyboardShortcuts",u),l={};if("mark"===n.type&&n.config.exitable&&(l.ArrowRight=()=>en_.handleExit({editor:t,mark:n})),c){let d=Object.fromEntries(Object.entries(c()).map(([n,r])=>[n,()=>r({editor:t})]));l={...l,...d}}let f,p=(o=l,new HI({props:{handleKeyDown:(a=o,f=function(t){let n=Object.create(null);for(let r in t)n[eec(r)]=t[r];return n}(a),function(t,n){var r,i;let o=("Esc"==(i=!(eei&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||eeo&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?eer:een)[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=f[eel(o,n)];if(u&&u(t.state,t.dispatch,t))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let s=f[eel(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=een[n.keyCode])&&a!=o){let c=f[eel(a,n)];if(c&&c(t.state,t.dispatch,t))return!0}}return!1})}}));s.push(p);let h=eeL(n,"addInputRules",u);eeG(n,t.options.enableInputRules)&&h&&r.push(...h());let m=eeL(n,"addPasteRules",u);eeG(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 HI({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)=>eeX({editor:n,from:o,to:a,text:u,rules:r,plugin:i}),handleDOMEvents:{compositionend:t=>(setTimeout(()=>{let{$cursor:o}=t.state.selection;o&&eeX({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&&eeX({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 HI({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,d="drop"===c.getMeta("uiEvent")&&!a;if(!l&&!d)return;let f=i.doc.content.findDiffStart(u.doc.content),p=i.doc.content.findDiffEnd(u.doc.content);if("number"!=typeof f||!p||f===p.b)return;let h=u.tr,m=eeR({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 eeD({editor:n,state:r}),l=[];return r.doc.nodesBetween(i,o,(t,n)=>{if(!t.isTextblock||t.type.spec.code)return;let d=Math.max(i,n),f=Math.min(o,n+t.content.size),p=t.textBetween(d-n,f-n,void 0,"");ee1(p,a.find).forEach(t=>{if(void 0===t.index)return;let n=d+t.index+1,i=n+t[0].length,o={from:r.tr.mapping.map(n),to:r.tr.mapping.map(i)},f=a.handler({state:r,range:o,match:t,commands:u,chain:s,can:c});l.push(f)})}),l.every(t=>null!==t)}({editor:n,state:m,from:Math.max(f-1,0),to:p.b-1,rule:t})||!h.steps.length))return h}}))}({editor:t,rules:i}),...o]}get attributes(){return eeF(this.extensions)}get nodeViews(){let{editor:t}=this,{nodeExtensions:n}=eeP(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:eez(n.name,this.schema)},o=eeL(n,"addNodeView",i);if(!o)return[];let a=(i,a,u,s)=>{let c=eeW(i,r);return o()({editor:t,node:i,getPos:u,decorations:s,HTMLAttributes:c,extension:n})};return[n.name,a]}))}}function ee4(t){var n;return"Object"===Object.prototype.toString.call(t).slice(8,-1)&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function ee3(t,n){let r={...t};return ee4(t)&&ee4(n)&&Object.keys(n).forEach(i=>{ee4(n[i])&&i in t?r[i]=ee3(t[i],n[i]):Object.assign(r,{[i]:n[i]})}),r}class ee5{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=eeV(eeL(this,"addOptions",{name:this.name}))),this.storage=eeV(eeL(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new ee5(t)}configure(t={}){let n=this.extend();return n.options=ee3(this.options,t),n.storage=eeV(eeL(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){let n=new ee5(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=eeV(eeL(n,"addOptions",{name:n.name})),n.storage=eeV(eeL(n,"addStorage",{name:n.name,options:n.options})),n}}function ee9(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,d)=>{var f;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:d,range:n}))):t.isText?(s+=null===(f=null==t?void 0:t.text)||void 0===f?void 0:f.slice(Math.max(i,r)-r,o-r),c=!1):t.isBlock&&!c&&(s+=a,c=!0)}),s}function ee8(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}let ee6=ee5.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new HI({key:new Hk("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=ee8(r);return ee9(i,{from:u,to:s},{textSerializers:c})}}})]}}),ee7=()=>({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),ete=(t=!1)=>({commands:n})=>n.setContent("",t),ett=()=>({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=QZ(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},etn=t=>n=>t(n),etr=()=>({state:t,dispatch:n})=>eeI(t,n),eti=()=>({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},eto=t=>({tr:n,state:r,dispatch:i})=>{let o=eez(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},eta=t=>({tr:n,dispatch:r})=>{let{from:i,to:o}=t;return r&&n.delete(i,o),!0},etu=()=>({state:t,dispatch:n})=>eed(t,n),ets=()=>({commands:t})=>t.keyboardShortcut("Enter"),etc=()=>({state:t,dispatch:n})=>eew(t,n);function etl(t,n,r={strict:!0}){let i=Object.keys(n);return!i.length||i.every(i=>r.strict?n[i]===t[i]:eeQ(n[i])?n[i].test(t[i]):n[i]===t[i])}function etd(t,n,r={}){return t.find(t=>t.type===n&&etl(t.attrs,r))}function etf(t,n,r={}){return!!etd(t,n,r)}function etp(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=etd([...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(etd([...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&&etf([...t.parent.child(s).marks],n,r);)c+=t.parent.child(s).nodeSize,s+=1;return{from:u,to:c}}function eth(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 etm=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let a=eth(t,i.schema),{doc:u,selection:s}=r,{$from:c,from:l,to:d}=s;if(o){let f=etp(c,a,n);if(f&&f.from<=l&&f.to>=d){let p=Hd.create(u,f.from,f.to);r.setSelection(p)}}return!0},etg=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 ety(t){return t instanceof Hd}function etv(t=0,n=0,r=0){return Math.min(Math.max(t,n),r)}function etb(t,n=null){if(!n)return null;let r=Hu.atStart(t),i=Hu.atEnd(t);if("start"===n||!0===n)return r;if("end"===n)return i;let o=r.from,a=i.to;return"all"===n?Hd.create(t,etv(0,o,a),etv(t.content.size,o,a)):Hd.create(t,etv(n,o,a),etv(n,o,a))}function etx(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}let etM=(t=null,n={})=>({editor:r,view:i,tr:o,dispatch:a})=>{n={scrollIntoView:!0,...n};let u=()=>{etx()&&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&&!ety(r.state.selection))return u(),!0;let s=etb(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},etT=(t,n)=>r=>t.every((t,i)=>n(t,{...r,index:i})),etS=(t,n)=>({tr:r,commands:i})=>i.insertContentAt({from:r.selection.from,to:r.selection.to},t,n);function etw(t){let n=`<body>${t}</body>`;return new window.DOMParser().parseFromString(n,"text/html").body}function etI(t,n,r){if(r={slice:!0,parseOptions:{},...r},"object"==typeof t&&null!==t)try{return Array.isArray(t)&&t.length>0?ZV.fromArray(t.map(t=>n.nodeFromJSON(t))):n.nodeFromJSON(t)}catch(i){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),etI("",n,r)}if("string"==typeof t){let o=Qb.fromSchema(n);return r.slice?o.parseSlice(etw(t),r.parseOptions).content:o.parse(etw(t),r.parseOptions)}return etI("",n,r)}let et_=t=>t.toString().startsWith("<"),etO=(t,n,r)=>({tr:i,dispatch:o,editor:a})=>{if(o){r={parseOptions:{},updateSelection:!0,...r};let u=etI(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,d=!0;if((et_(u)?u:[u]).forEach(t=>{t.check(),l=!!l&&t.isText&&0===t.marks.length,d=!!d&&t.isBlock}),s===c&&d){let{parent:f}=i.doc.resolve(s);!f.isTextblock||f.type.spec.code||f.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 QK||o instanceof QY))return;let a=t.mapping.maps[i],u=0;a.forEach((t,n,r,i)=>{0===u&&(u=i)}),t.setSelection(Hu.near(t.doc.resolve(u),-1))}(i,i.steps.length-1,-1)}return!0},etk=()=>({state:t,dispatch:n})=>eeb(t,n),etC=()=>({state:t,dispatch:n})=>eex(t,n),etN=()=>({state:t,dispatch:n})=>eef(t,n),etj=()=>({state:t,dispatch:n})=>eeg(t,n);function etE(){return"u">typeof navigator&&/Mac/.test(navigator.platform)}let etR=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))etx()||etE()?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 etD(t,n,r={}){let{from:i,to:o,empty:a}=t.selection,u=n?eez(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=>etl(t.node.attrs,r,{strict:!1}));return a?!!c.length:c.reduce((t,n)=>t+n.to-n.from,0)>=o-i}let etA=(t,n={})=>({state:r,dispatch:i})=>{let o=eez(t,r.schema);return!!etD(r,o,n)&&eeM(r,i)},etL=()=>({state:t,dispatch:n})=>ee_(t,n),etP=t=>({state:n,dispatch:r})=>{var i;let o=eez(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 QY(a-1,u,a,u,new ZZ(ZV.from(r.create(null,i.parent.copy())),1,0),1,!0)),i=new Z9(o.doc.resolve(i.$from.pos),o.doc.resolve(u),i.depth));let s=QZ(i);if(null==s)return!1;o.lift(i,s);let c=o.mapping.map(a,-1)-1;return QX(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 d=0==r.startIndex,f=r.endIndex==o.childCount,p=c.node(-1),h=c.index(-1);if(!p.canReplace(h+(d?0:1),h+1,l.content.append(f?ZV.empty:ZV.from(o))))return!1;let m=c.pos,g=m+l.nodeSize;return i.step(new QY(m-(d?1:0),g+(f?1:0),m+1,g-1,new ZZ((d?ZV.empty:ZV.from(o.copy(ZV.empty))).append(f?ZV.empty:ZV.from(o.copy(ZV.empty))),d?0:1,f?0:1),d?0:1)),n(i.scrollIntoView()),!0}(t,n,a)))}(n,r)},etF=()=>({state:t,dispatch:n})=>eeT(t,n);function etz(t,n){return n.nodes[t]?"node":n.marks[t]?"mark":null}function etU(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 etW=(t,n)=>({tr:r,state:i,dispatch:o})=>{let a=null,u=null,s=etz("string"==typeof t?t:t.name,i.schema);return!!s&&("node"===s&&(a=eez(t,i.schema)),"mark"===s&&(u=eth(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,etU(t.attrs,n)),u&&t.marks.length&&t.marks.forEach(o=>{u===o.type&&r.addMark(i,i+t.nodeSize,u.create(etU(o.attrs,n)))})})}),!0)},etB=()=>({tr:t,dispatch:n})=>(n&&t.scrollIntoView(),!0),etV=()=>({tr:t,commands:n})=>n.setTextSelection({from:0,to:t.doc.content.size}),et$=()=>({state:t,dispatch:n})=>eeh(t,n),etK=()=>({state:t,dispatch:n})=>eey(t,n),etY=()=>({state:t,dispatch:n})=>eeO(t,n),etq=()=>({state:t,dispatch:n})=>eej(t,n),etG=()=>({state:t,dispatch:n})=>eeN(t,n);function etZ(t,n,r={}){return etI(t,n,{slice:!1,parseOptions:r})}let etQ=(t,n=!1,r={})=>({tr:i,editor:o,dispatch:a})=>{let{doc:u}=i,s=etZ(t,o.schema,r);return a&&i.replaceWith(0,u.content.size,s).setMeta("preventUpdate",!n),!0};function etH(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 etJ(t,n){let r=eth(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 etX(t,n,r){let i=[];return t===n?r.resolve(t).marks().forEach(n=>{let o=r.resolve(t-1),a=etp(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 et0(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 et1(t,n,r={}){let{empty:i,ranges:o}=t.selection,a=n?eth(n,t.schema):null;if(i)return!!(t.storedMarks||t.selection.$from.marks()).filter(t=>!a||a.name===t.type.name).find(t=>etl(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=>etl(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 et2(t,n){let{nodeExtensions:r}=eeP(n),i=r.find(n=>n.name===t);if(!i)return!1;let o={name:i.name,options:i.options,storage:i.storage},a=eeV(eeL(i,"group",o));return"string"==typeof a&&a.split(" ").includes("list")}let et4=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let{selection:a}=r,{empty:u,ranges:s}=a,c=eth(t,i.schema);if(o){if(u){let l=etJ(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(ety(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)},et3=(t,n)=>({tr:r})=>(r.setMeta(t,n),!0),et5=(t,n={})=>({state:r,dispatch:i,chain:o})=>{let a=eez(t,r.schema);return a.isTextblock?o().command(({commands:t})=>!!eeE(a,n)(r)||t.clearNodes()).command(({state:t})=>eeE(a,n)(t,i)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},et9=t=>({tr:n,dispatch:r})=>{if(r){let{doc:i}=n,o=etv(t,0,i.content.size),a=Hp.create(i,o);n.setSelection(a)}return!0},et8=t=>({tr:n,dispatch:r})=>{if(r){let{doc:i}=n,{from:o,to:a}="number"==typeof t?{from:t,to:t}:t,u=Hd.atStart(i).from,s=Hd.atEnd(i).to,c=etv(o,u,s),l=etv(a,u,s),d=Hd.create(i,c,l);n.setSelection(d)}return!0},et6=t=>({state:n,dispatch:r})=>{var i;let o=eez(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,d=ZV.from(l?o.create():null),f=new ZZ(ZV.from(o.create(null,ZV.from(s.type.create(null,d)))),l?3:1,0),p=a.start,h=a.end;n(t.tr.step(new QY(p-(l?3:1),h,p,h,f,1,!0)).scrollIntoView())}return!0}(n,r)};function et7(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 ene=({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,d=et0(l,s.node().type.name,s.node().attrs);if(a instanceof Hp&&a.node.isBlock)return!!(s.parentOffset&&QJ(u,s.pos))&&(i&&(t&&et7(r,o.extensionManager.splittableMarks),n.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;if(i){let f=c.parentOffset===c.parent.content.size;a instanceof Hd&&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=f&&p?[{type:p,attrs:d}]:void 0,m=QJ(n.doc,n.mapping.map(s.pos),1,h);if(!h&&!m&&QJ(n.doc,n.mapping.map(s.pos),1,p?[{type:p}]:void 0)&&(m=!0,h=p?[{type:p,attrs:d}]:void 0),m&&(n.split(n.mapping.map(s.pos),1,h),p&&!f&&!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&&et7(r,o.extensionManager.splittableMarks),n.scrollIntoView()}return!0},ent=t=>({tr:n,state:r,dispatch:i,editor:o})=>{var a;let u=eez(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 d=s.node(-1);if(d.type!==u)return!1;let f=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=ZV.empty,h=s.index(-1)?1:s.index(-2)?2:3;for(let m=s.depth-h;m>=s.depth-3;m-=1)p=ZV.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=et0(f,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(ZV.from(u.createAndFill(null,v)||void 0));let b=s.before(s.depth-(h-1));n.replace(b,s.after(-g),new ZZ(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(Hd.near(n.doc.resolve(x))),n.scrollIntoView()}return!0}let M=c.pos===s.end()?d.contentMatchAt(0).defaultType:null,T=et0(f,d.type.name,d.attrs),S=et0(f,s.node().type.name,s.node().attrs);if(n.delete(s.pos,c.pos),!QJ(n.doc,s.pos,2))return!1;if(i){let{selection:w,storedMarks:I}=r,{splittableMarks:_}=o.extensionManager,O=I||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=>_.includes(t.type.name));n.ensureMarks(k)}return!0},enn=(t,n)=>{let r=etH(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)&&QX(t.doc,r.pos)&&t.join(r.pos),!0},enr=(t,n)=>{let r=etH(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)&&QX(t.doc,i)&&t.join(i),!0},eni=(t,n,r,i={})=>({editor:o,tr:a,state:u,dispatch:s,chain:c,commands:l,can:d})=>{let{extensions:f,splittableMarks:p}=o.extensionManager,h=eez(t,u.schema),m=eez(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=etH(t=>et2(t.type.name,f))(g);if(x.depth>=1&&T&&x.depth-T.depth<=1){if(T.node.type===h)return l.liftListItem(m);if(et2(T.node.type.name,f)&&h.validContent(T.node.content)&&s)return c().command(()=>(a.setNodeMarkup(T.pos,h),!0)).command(()=>enn(a,h)).command(()=>enr(a,h)).run()}return r&&M&&s?c().command(()=>{let t=d().wrapInList(h,i),n=M.filter(t=>p.includes(t.type.name));return a.ensureMarks(n),!!t||l.clearNodes()}).wrapInList(h,i).command(()=>enn(a,h)).command(()=>enr(a,h)).run():c().command(()=>!!d().wrapInList(h,i)||l.clearNodes()).wrapInList(h,i).command(()=>enn(a,h)).command(()=>enr(a,h)).run()},eno=(t,n={},r={})=>({state:i,commands:o})=>{let{extendEmptyMarkRange:a=!1}=r,u=eth(t,i.schema);return et1(i,u,n)?o.unsetMark(u,{extendEmptyMarkRange:a}):o.setMark(u,n)},ena=(t,n,r={})=>({state:i,commands:o})=>{let a=eez(t,i.schema),u=eez(n,i.schema);return etD(i,a,r)?o.setNode(u):o.setNode(a,r)},enu=(t,n={})=>({state:r,commands:i})=>{let o=eez(t,r.schema);return etD(r,o,n)?i.lift(o):i.wrapIn(o,n)},ens=()=>({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},enc=()=>({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},enl=(t,n={})=>({tr:r,state:i,dispatch:o})=>{var a;let{extendEmptyMarkRange:u=!1}=n,{selection:s}=r,c=eth(t,i.schema),{$from:l,empty:d,ranges:f}=s;if(!o)return!0;if(d&&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=etp(l,c,m);g&&(p=g.from,h=g.to),r.removeMark(p,h,c)}else f.forEach(t=>{r.removeMark(t.$from.pos,t.$to.pos,c)});return r.removeStoredMark(c),!0},end=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let a=null,u=null,s=etz("string"==typeof t?t:t.name,i.schema);return!!s&&("node"===s&&(a=eez(t,i.schema)),"mark"===s&&(u=eth(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)},enf=(t,n={})=>({state:r,dispatch:i})=>{let o=eez(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&&QQ(u,t,n);return!!s&&(i&&i(r.tr.wrap(u,s).scrollIntoView()),!0)}})(o,n)(r,i)},enp=(t,n={})=>({state:r,dispatch:i})=>{let o=eez(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 Z9(l,l,u.depth),u.endIndex<u.parent.childCount&&(u=new Z9(o,r.doc.resolve(a.end(u.depth)),u.depth)),s=!0}let d=QQ(c,t,n,u);return!!d&&(i&&i((function(t,n,r,i,o){let a=ZV.empty;for(let u=r.length-1;u>=0;u--)a=ZV.from(r[u].type.create(r[u].attrs,a));t.step(new QY(n.start-(i?2:0),n.end,n.start,n.end,new ZZ(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,d=n.start+r.length-(i?2:0),f=n.parent;for(let p=n.startIndex,h=n.endIndex,m=!0;p<h;p++,m=!1)!m&&QJ(t.doc,d,l)&&(t.split(d,l),d+=2*l),d+=f.child(p).nodeSize;return t})(r.tr,u,d,s,t).scrollIntoView()),!0)}})(o,n)(r,i)};var enh=Object.freeze({__proto__:null,blur:ee7,clearContent:ete,clearNodes:ett,command:etn,createParagraphNear:etr,deleteCurrentNode:eti,deleteNode:eto,deleteRange:eta,deleteSelection:etu,enter:ets,exitCode:etc,extendMarkRange:etm,first:etg,focus:etM,forEach:etT,insertContent:etS,insertContentAt:etO,joinUp:etk,joinDown:etC,joinBackward:etN,joinForward:etj,keyboardShortcut:etR,lift:etA,liftEmptyBlock:etL,liftListItem:etP,newlineInCode:etF,resetAttributes:etW,scrollIntoView:etB,selectAll:etV,selectNodeBackward:et$,selectNodeForward:etK,selectParentNode:etY,selectTextblockEnd:etq,selectTextblockStart:etG,setContent:etQ,setMark:et4,setMeta:et3,setNode:et5,setNodeSelection:et9,setTextSelection:et8,sinkListItem:et6,splitBlock:ene,splitListItem:ent,toggleList:eni,toggleMark:eno,toggleNode:ena,toggleWrap:enu,undoInputRule:ens,unsetAllMarks:enc,unsetMark:enl,updateAttributes:end,wrapIn:enf,wrapInList:enp});let enm=ee5.create({name:"commands",addCommands:()=>({...enh})}),eng=ee5.create({name:"editable",addProseMirrorPlugins(){return[new HI({key:new Hk("editable"),props:{editable:()=>this.editor.options.editable}})]}}),eny=ee5.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new HI({key:new Hk("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}}}})]}}),env=ee5.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=Hu.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 etx()||etE()?o:i},addProseMirrorPlugins(){return[new HI({key:new Hk("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=Hu.atStart(n.doc).from,s=Hu.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=eeR({state:r,transaction:c}),{commands:d}=new eeD({editor:this.editor,state:l});if(d.clearNodes(),c.steps.length)return c}})]}}),enb=ee5.create({name:"tabindex",addProseMirrorPlugins(){return[new HI({key:new Hk("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var enx=Object.freeze({__proto__:null,ClipboardTextSerializer:ee6,Commands:enm,Editable:eng,FocusEvents:eny,Keymap:env,Tabindex:enb});let enM=`.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
|
-
}`,enT=class extends eeA{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}(enM,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=eeB(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(enx):[],...this.options.extensions].filter(t=>["extension","node","mark"].includes(null==t?void 0:t.type));this.extensionManager=new ee2(t,this)}createCommandManager(){this.commandManager=new eeD({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let t=etZ(this.options.content,this.schema,this.options.parseOptions),n=etb(t,this.options.autofocus);this.view=new X9(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Hw.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=etz("string"==typeof n?n:n.name,t.schema);return"node"===r?function(t,n){let r=eez(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?etJ(t,n):{}}(this.state,t)}isActive(t,n){return function(t,n,r={}){if(!n)return etD(t,null,r)||et1(t,null,r);let i=etz(n,t.schema);return"node"===i?etD(t,n,r):"mark"===i&&et1(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=QC.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 ee9(t,r,n)}(this.state.doc,{blockSeparator:n,textSerializers:{...ee8(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 enS(t){return new eeH({find:t.find,handler({state:n,range:r,match:i}){let o=eeV(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/),d=r.from+s.indexOf(u),f=d+u.length;if(etX(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>d).length)return null;f<r.to&&a.delete(f,r.to),d>r.from&&a.delete(r.from+l,d),c=r.from+l+u.length,a.addMark(r.from+l,c,t.type.create(o||{})),a.removeStoredMark(t.type)}}})}function enw(t){return new eeH({find:t.find,handler({state:n,range:r,match:i}){let o=n.doc.resolve(r.from),a=eeV(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 enI(t){return new eeH({find:t.find,handler({state:n,range:r,match:i,chain:o}){let a=eeV(t.getAttributes,void 0,i)||{},u=n.tr.delete(r.from,r.to),s=u.doc.resolve(r.from).blockRange(),c=s&&QQ(s,t.type,a);if(!c)return null;if(u.wrap(s,c),t.keepMarks&&t.editor){let{selection:l,storedMarks:d}=n,{splittableMarks:f}=t.editor.extensionManager,p=d||l.$to.parentOffset&&l.$from.marks();if(p){let h=p.filter(t=>f.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&&QX(u.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(i,g))&&u.join(r.from-1)}})}let en_=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=eeV(eeL(this,"addOptions",{name:this.name}))),this.storage=eeV(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=ee3(this.options,t),n.storage=eeV(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=eeV(eeL(r,"addOptions",{name:r.name})),r.storage=eeV(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 enO{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=eeV(eeL(this,"addOptions",{name:this.name}))),this.storage=eeV(eeL(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new enO(t)}configure(t={}){let n=this.extend();return n.options=ee3(this.options,t),n.storage=eeV(eeL(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){let n=new enO(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=eeV(eeL(n,"addOptions",{name:n.name})),n.storage=eeV(eeL(n,"addStorage",{name:n.name,options:n.options})),n}}class enk{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,d=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)||!d)return;let f=0,p=0;if(this.dom!==d){let h=this.dom.getBoundingClientRect(),m=d.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;f=m.x-h.x+g,p=m.y-h.y+y}null===(s=t.dataTransfer)||void 0===s||s.setDragImage(this.dom,f,p);let v=Hp.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=Hp.isSelectable(this.node),l="copy"===t.type,d="paste"===t.type,f="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||d||f||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&&etx()&&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 enC(t){return new ee0({find:t.find,handler({state:n,range:r,match:i}){let o=eeV(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/),d=r.from+s.indexOf(u),f=d+u.length;if(etX(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>d).length)return null;f<r.to&&a.delete(f,r.to),d>r.from&&a.delete(r.from+l,d),c=r.from+l+u.length,a.addMark(r.from+l,c,t.type.create(o||{})),a.removeStoredMark(t.type)}}})}var enN="bottom",enj="right",enE="left",enR="auto",enD=["top",enN,enj,enE],enA="start",enL="viewport",enP="popper",enF=enD.reduce(function(t,n){return t.concat([n+"-"+enA,n+"-end"])},[]),enz=[].concat(enD,[enR]).reduce(function(t,n){return t.concat([n,n+"-"+enA,n+"-end"])},[]),enU=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function enW(t){return t?(t.nodeName||"").toLowerCase():null}function enB(t){if(null==t)return window;if("[object Window]"!==t.toString()){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function enV(t){var n=enB(t).Element;return t instanceof n||t instanceof Element}function en$(t){var n=enB(t).HTMLElement;return t instanceof n||t instanceof HTMLElement}function enK(t){if(typeof ShadowRoot>"u")return!1;var n=enB(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}let enY={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];en$(o)&&enW(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},{});en$(i)&&enW(i)&&(Object.assign(i.style,a),Object.keys(o).forEach(function(t){i.removeAttribute(t)}))})}},requires:["computeStyles"]};function enq(t){return t.split("-")[0]}var enG=Math.max,enZ=Math.min,enQ=Math.round;function enH(){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 enJ(){return!/^((?!chrome|android).)*safari/i.test(enH())}function enX(t,n,r){void 0===n&&(n=!1),void 0===r&&(r=!1);var i=t.getBoundingClientRect(),o=1,a=1;n&&en$(t)&&(o=t.offsetWidth>0&&enQ(i.width)/t.offsetWidth||1,a=t.offsetHeight>0&&enQ(i.height)/t.offsetHeight||1);var u=(enV(t)?enB(t):window).visualViewport,s=!enJ()&&r,c=(i.left+(s&&u?u.offsetLeft:0))/o,l=(i.top+(s&&u?u.offsetTop:0))/a,d=i.width/o,f=i.height/a;return{width:d,height:f,top:l,right:c+d,bottom:l+f,left:c,x:c,y:l}}function en0(t){var n=enX(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 en1(t,n){var r=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(r&&enK(r)){var i=n;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function en2(t){return enB(t).getComputedStyle(t)}function en4(t){return["table","td","th"].indexOf(enW(t))>=0}function en3(t){return((enV(t)?t.ownerDocument:t.document)||window.document).documentElement}function en5(t){return"html"===enW(t)?t:t.assignedSlot||t.parentNode||(enK(t)?t.host:null)||en3(t)}function en9(t){return en$(t)&&"fixed"!==en2(t).position?t.offsetParent:null}function en8(t){for(var n=enB(t),r=en9(t);r&&en4(r)&&"static"===en2(r).position;)r=en9(r);return r&&("html"===enW(r)||"body"===enW(r)&&"static"===en2(r).position)?n:r||function(t){var n=/firefox/i.test(enH());if(/Trident/i.test(enH())&&en$(t)&&"fixed"===en2(t).position)return null;var r=en5(t);for(enK(r)&&(r=r.host);en$(r)&&0>["html","body"].indexOf(enW(r));){var i=en2(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 en6(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function en7(t,n,r){return enG(t,enZ(n,r))}function ere(){return{top:0,right:0,bottom:0,left:0}}function ert(t){return Object.assign({},ere(),t)}function ern(t,n){return n.reduce(function(n,r){return n[r]=t,n},{})}function err(t){return t.split("-")[1]}var eri={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ero(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,d=t.adaptive,f=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 f?f({x:m,y:y}):{x:m,y:y};m=v.x,y=v.y;var b=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),M=enE,T="top",S=window;if(d){var w=en8(i),I="clientHeight",_="clientWidth";w===enB(i)&&(w=en3(i),"static"!==en2(w).position&&"absolute"===c&&(I="scrollHeight",_="scrollWidth")),("top"===a||(a===enE||a===enj)&&"end"===u)&&(T=enN,y-=(p&&w===S&&S.visualViewport?S.visualViewport.height:w[I])-o.height,y*=l?1:-1),(a===enE||("top"===a||a===enN)&&"end"===u)&&(M=enj,m-=(p&&w===S&&S.visualViewport?S.visualViewport.width:w[_])-o.width,m*=l?1:-1)}var O,k,C,N,j,E=Object.assign({position:c},d&&eri),R=!0===f?(O={x:m,y:y},k=enB(i),C=O.x,N=O.y,{x:enQ(C*(j=k.devicePixelRatio||1))/j||0,y:enQ(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 era={passive:!0},eru={left:"right",right:"left",bottom:"top",top:"bottom"};function ers(t){return t.replace(/left|right|bottom|top/g,function(t){return eru[t]})}var erc={start:"end",end:"start"};function erl(t){return t.replace(/start|end/g,function(t){return erc[t]})}function erd(t){var n,r=enB(t);return{scrollLeft:r.pageXOffset,scrollTop:r.pageYOffset}}function erf(t){return enX(en3(t)).left+erd(t).scrollLeft}function erp(t){var n=en2(t),r=n.overflow,i=n.overflowX,o=n.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+i)}function erh(t,n){void 0===n&&(n=[]);var r,i=function t(n){return["html","body","#document"].indexOf(enW(n))>=0?n.ownerDocument.body:en$(n)&&erp(n)?n:t(en5(n))}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=enB(i),u=o?[a].concat(a.visualViewport||[],erp(i)?i:[]):i,s=n.concat(u);return o?s:s.concat(erh(en5(u)))}function erm(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function erg(t,n,r){var i,o,a,u,s,c,l,d,f,p,h,m;return n===enL?erm(function(t,n){var r=enB(t),i=en3(t),o=r.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,c=0;if(o){a=o.width,u=o.height;var l=enJ();(l||!l&&"fixed"===n)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:a,height:u,x:s+erf(t),y:c}}(t,r)):enV(n)?((a=enX(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):erm((u=en3(t),c=en3(u),l=erd(u),d=null==(s=u.ownerDocument)?void 0:s.body,f=enG(c.scrollWidth,c.clientWidth,d?d.scrollWidth:0,d?d.clientWidth:0),p=enG(c.scrollHeight,c.clientHeight,d?d.scrollHeight:0,d?d.clientHeight:0),h=-l.scrollLeft+erf(u),m=-l.scrollTop,"rtl"===en2(d||c).direction&&(h+=enG(c.clientWidth,d?d.clientWidth:0)-f),{width:f,height:p,x:h,y:m}))}function ery(t){var n,r=t.reference,i=t.element,o=t.placement,a=o?enq(o):null,u=o?err(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 enN:n={x:s,y:r.y+r.height};break;case enj:n={x:r.x+r.width,y:c};break;case enE:n={x:r.x-i.width,y:c};break;default:n={x:r.x,y:r.y}}var l=a?en6(a):null;if(null!=l){var d="y"===l?"height":"width";switch(u){case enA:n[l]=n[l]-(r[d]/2-i[d]/2);break;case"end":n[l]=n[l]+(r[d]/2-i[d]/2)}}return n}function erv(t,n){void 0===n&&(n={});var r,i,o,a,u,s,c,l,d,f,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?enP:x,T=p.altBoundary,S=p.padding,w=void 0===S?0:S,I=ert("number"!=typeof w?w:ern(w,enD)),_=t.rects.popper,O=t.elements[void 0!==T&&T?M===enP?"reference":enP:M],k=(r=enV(O)?O:O.contextElement||en3(t.elements.popper),d=(l=[].concat("clippingParents"===(i=void 0===v?"clippingParents":v)?(s=erh(en5(r)),c=["absolute","fixed"].indexOf(en2(r).position)>=0&&en$(r)?en8(r):r,enV(c)?s.filter(function(t){return enV(t)&&en1(t,c)&&"body"!==enW(t)}):[]):[].concat(i),[void 0===b?enL:b]))[0],(f=l.reduce(function(t,n){var i=erg(r,n,y);return t.top=enG(i.top,t.top),t.right=enZ(i.right,t.right),t.bottom=enZ(i.bottom,t.bottom),t.left=enG(i.left,t.left),t},erg(r,d,y))).width=f.right-f.left,f.height=f.bottom-f.top,f.x=f.left,f.y=f.top,f),C=enX(t.elements.reference),N=ery({reference:C,element:_,strategy:"absolute",placement:m}),j=erm(Object.assign({},_,N)),E=M===enP?j:C,R={top:k.top-E.top+I.top,bottom:E.bottom-k.bottom+I.bottom,left:k.left-E.left+I.left,right:E.right-k.right+I.right},D=t.modifiersData.offset;if(M===enP&&D){var A=D[m];Object.keys(R).forEach(function(t){var n=[enj,enN].indexOf(t)>=0?1:-1,r=["top",enN].indexOf(t)>=0?"y":"x";R[t]+=A[r]*n})}return R}function erb(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 erx(t){return["top",enj,enN,enE].some(function(n){return t[n]>=0})}var erM={placement:"bottom",modifiers:[],strategy:"absolute"};function erT(){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 erS,erw,erI,er_,erO,erk,erC=(erS={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=enB(n.elements.popper),l=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&l.forEach(function(t){t.addEventListener("scroll",r.update,era)}),s&&c.addEventListener("resize",r.update,era),function(){a&&l.forEach(function(t){t.removeEventListener("scroll",r.update,era)}),s&&c.removeEventListener("resize",r.update,era)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var n=t.state,r=t.name;n.modifiersData[r]=ery({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:enq(n.placement),variation:err(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,ero(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,ero(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:{}},enY,{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=enz.reduce(function(t,r){var i,o,u,s,c,l,d,f;return t[r]=(o=n.rects,c=[enE,"top"].indexOf(s=enq(r))>=0?-1:1,d=(l="function"==typeof a?a(Object.assign({},o,{placement:r})):a)[0],f=l[1],d=d||0,f=(f||0)*c,[enE,enj].indexOf(s)>=0?{x:f,y:d}:{x:d,y:f}),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,d=r.boundary,f=r.rootBoundary,p=r.altBoundary,h=r.flipVariations,m=void 0===h||h,g=r.allowedAutoPlacements,y=n.options.placement,v=enq(y),b=c||(v!==y&&m?function(t){if(enq(t)===enR)return[];var n=ers(t);return[erl(t),n,erl(n)]}(y):[ers(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(enq(r)===enR?(o={placement:r,boundary:d,rootBoundary:f,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)?enz:y,0===(M=(x=(b=err(u))?h?enF:enF.filter(function(t){return err(t)===b}):enD).filter(function(t){return v.indexOf(t)>=0})).length&&(M=x),Object.keys(T=M.reduce(function(t,r){return t[r]=erv(n,{placement:r,boundary:s,rootBoundary:c,padding:p})[enq(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,I=x[0],_=0;_<x.length;_++){var O=x[_],k=enq(O),C=err(O)===enA,N=["top",enN].indexOf(k)>=0,j=N?"width":"height",E=erv(n,{placement:O,boundary:d,rootBoundary:f,altBoundary:p,padding:l}),R=N?C?enj:enE:C?enN:"top";M[j]>T[j]&&(R=ers(R));var D=ers(R),A=[];if(a&&A.push(E[k]<=0),s&&A.push(E[R]<=0,E[D]<=0),A.every(function(t){return t})){I=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 I=n,"break"},F=L;F>0&&"break"!==P(F);F--);n.placement!==I&&(n.modifiersData[i]._skip=!0,n.placement=I,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,d=i.padding,f=i.tether,p=void 0===f||f,h=i.tetherOffset,m=void 0===h?0:h,g=erv(r,{boundary:s,rootBoundary:c,padding:d,altBoundary:l}),y=enq(r.placement),v=err(r.placement),b=!v,x=en6(y),M="x"===x?"y":"x",T=r.modifiersData.popperOffsets,S=r.rects.reference,w=r.rects.popper,I="function"==typeof m?m(Object.assign({},r.rects,{placement:r.placement})):m,_="number"==typeof I?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),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":enE,j="y"===x?enN:enj,E="y"===x?"height":"width",R=T[x],D=R+g[N],A=R-g[j],L=p?-w[E]/2:0,P=v===enA?S[E]:w[E],F=v===enA?-w[E]:-S[E],z=r.elements.arrow,U=p&&z?en0(z):{width:0,height:0},W=r.modifiersData["arrow#persistent"]?r.modifiersData["arrow#persistent"].padding:ere(),B=W[N],V=W[j],$=en7(0,S[E],U[E]),K=b?S[E]/2-L-$-B-_.mainAxis:P-$-B-_.mainAxis,Y=b?-S[E]/2+L+$+V+_.mainAxis:F+$+V+_.mainAxis,q=r.elements.arrow&&en8(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=en7(p?enZ(D,R+K-Z-G):D,R,p?enG(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":enE],eo=en-g["x"===x?enN:enj],ea=-1!==["top",enE].indexOf(y),eu=null!=(et=null==O?void 0:O[M])?et:0,es=ea?ei:en-S[er]-w[er]-eu+_.altAxis,ec=ea?en+S[er]+w[er]-eu-_.altAxis:eo,el=p&&ea?(ee=en7(es,en,ec))>ec?ec:ee:en7(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=enq(r.placement),c=en6(s),l=[enE,enj].indexOf(s)>=0?"height":"width";if(!(!a||!u)){var d,f,p=ert("number"!=typeof(d="function"==typeof(d=o.padding)?d(Object.assign({},r.rects,{placement:r.placement})):d)?d:ern(d,enD)),h=en0(a),m=r.rects.reference[l]+r.rects.reference[c]-u[c]-r.rects.popper[l],g=u[c]-r.rects.reference[c],y=en8(a),v=y?"y"===c?y.clientHeight||0:y.clientWidth||0:0,b=p["y"===c?"top":enE],x=v-h[l]-p["y"===c?enN:enj],M=v/2-h[l]/2+(m/2-g/2),T=en7(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)))&&en1(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=erv(n,{elementContext:"reference"}),s=erv(n,{altBoundary:!0}),c=erb(u,i),l=erb(s,o,a),d=erx(c),f=erx(l);n.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:d,hasPopperEscaped:f},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}}]},er_=void 0===(erI=(erw=erS).defaultModifiers)?[]:erI,erk=void 0===(erO=erw.defaultOptions)?erM:erO,function(t,n,r){void 0===r&&(r=erk);var i,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},erM,erk),modifiersData:{},elements:{reference:t,popper:n},attributes:{},styles:{}},u=[],s=!1,c={state:a,setOptions:function(r){var i,o,s,d,f,p,h,m,g="function"==typeof r?r(a.options):r;l(),a.options=Object.assign({},erk,a.options,g),a.scrollParents={reference:enV(t)?erh(t):t.contextElement?erh(t.contextElement):[],popper:erh(n)};var y=(s=Object.keys(o=(i=[].concat(er_,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]}),f=new Map,p=new Set,h=[],s.forEach(function(t){f.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=f.get(n);r&&t(r)}}),h.push(n)}(t)}),enU.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,d,f,p,h,m,g,y,v,b=a.elements,x=b.reference,M=b.popper;if(erT(x,M)){a.rects={reference:(t=x,n=en8(M),r="fixed"===a.options.strategy,d=en$(n),f=en$(n)&&(u=enQ((o=(i=n).getBoundingClientRect()).width)/i.offsetWidth||1,l=enQ(o.height)/i.offsetHeight||1,1!==u||1!==l),p=en3(n),h=enX(t,f,r),m={scrollLeft:0,scrollTop:0},g={x:0,y:0},(d||!d&&!r)&&(("body"!==enW(n)||erp(p))&&(m=(y=n)!==enB(y)&&en$(y)?{scrollLeft:(v=y).scrollLeft,scrollTop:v.scrollTop}:erd(y)),en$(n)?(g=enX(n,!0),g.x+=n.clientLeft,g.y+=n.clientTop):p&&(g.x=erf(p))),{x:h.left+m.scrollLeft-g.x,y:h.top+m.scrollTop-g.y,width:h.width,height:h.height}),popper:en0(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,I=S.options,_=void 0===I?{}:I,O=S.name;"function"==typeof w&&(a=w({state:a,options:_,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(!erT(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}),erN="tippy-content",erj="tippy-arrow",erE="tippy-svg-arrow",erR={passive:!0,capture:!0},erD=function(){return document.body};function erA(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 erP(t,n){return"function"==typeof t?t.apply(void 0,n):t}function erF(t,n){var r;return 0===n?t:function(i){clearTimeout(r),r=setTimeout(function(){t(i)},n)}}function erz(t){return[].concat(t)}function erU(t,n){-1===t.indexOf(n)&&t.push(n)}function erW(t){return[].slice.call(t)}function erB(t){return Object.keys(t).reduce(function(n,r){return void 0!==t[r]&&(n[r]=t[r]),n},{})}function erV(){return document.createElement("div")}function er$(t){return["Element","Fragment"].some(function(n){return erL(t,n)})}function erK(t,n){t.forEach(function(t){t&&(t.style.transitionDuration=n+"ms")})}function erY(t,n){t.forEach(function(t){t&&t.setAttribute("data-state",n)})}function erq(t,n,r){var i=n+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){t[i](n,r)})}function erG(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 erZ={isTouch:!1},erQ=0;function erH(){erZ.isTouch||(erZ.isTouch=!0,window.performance&&document.addEventListener("mousemove",erJ))}function erJ(){var t=performance.now();t-erQ<20&&(erZ.isTouch=!1,document.removeEventListener("mousemove",erJ)),erQ=t}function erX(){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 er0=!!("u">typeof window&&"u">typeof document)&&!!window.msCrypto,er1=Object.assign({appendTo:erD,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}),er2=Object.keys(er1),er4=function(t){Object.keys(t).forEach(function(n){er1[n]=t[n]})};function er3(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=er1[o])?i:a),n},{});return Object.assign({},t,n)}function er5(t,n){var r,i,o=Object.assign({},n,{content:erP(n.content,[t])},n.ignoreAttributes?{}:((i=n.plugins)?Object.keys(er3(Object.assign({},er1,{plugins:i}))):er2).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({},er1.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 er9=function(){return"innerHTML"};function er8(t,n){t[er9()]=n}function er6(t){var n=erV();return!0===t?n.className=erj:(n.className=erE,er$(t)?n.appendChild(t):er8(n,t)),n}function er7(t,n){er$(n.content)?(er8(t,""),t.appendChild(n.content)):"function"!=typeof n.content&&(n.allowHTML?er8(t,n.content):t.textContent=n.content)}function eie(t){var n=t.firstElementChild,r=erW(n.children);return{box:n,content:r.find(function(t){return t.classList.contains(erN)}),arrow:r.find(function(t){return t.classList.contains(erj)||t.classList.contains(erE)}),backdrop:r.find(function(t){return t.classList.contains("tippy-backdrop")})}}function eit(t){var n=erV(),r=erV();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var i=erV();function o(r,i){var o=eie(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)&&er7(u,t.props),i.arrow?s?r.arrow!==i.arrow&&(a.removeChild(s),a.appendChild(er6(i.arrow))):a.appendChild(er6(i.arrow)):s&&a.removeChild(s)}return i.className=erN,i.setAttribute("data-state","hidden"),er7(i,t.props),n.appendChild(r),r.appendChild(i),o(t.props,t.props),{popper:n,onUpdate:o}}eit.$$tippy=!0;var ein=1,eir=[],eii=[];function eio(t,n){void 0===n&&(n={});var r,i,o=er1.plugins.concat(n.plugins||[]);document.addEventListener("touchstart",erH,erR),window.addEventListener("blur",erX);var a,u=Object.assign({},n,{plugins:o}),s=(er$(t)?[t]:erL(t,"NodeList")?erW(t):Array.isArray(t)?t:erW(document.querySelectorAll(t))).reduce(function(t,n){var r=n&&function(t,n){var r,i,o,a,u,s,c,l,d=er5(t,Object.assign({},er1,er3(erB(n)))),f=!1,p=!1,h=!1,m=!1,g=[],y=erF(G,d.interactiveDebounce),v=ein++,b=(r=d.plugins).filter(function(t,n){return r.indexOf(t)===n}),x={id:v,reference:t,popper:erV(),popperInstance:null,props:d,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=er5(t,Object.assign({},r,erB(n),{ignoreAttributes:!0}));x.props=i,K(),r.interactiveDebounce!==i.interactiveDebounce&&(P(),y=erF(G,i.interactiveDebounce)),r.triggerTarget&&!i.triggerTarget?erz(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=erZ.isTouch&&!x.props.touch,o=erA(x.props.duration,0,er1.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,d=j();erK([d.box,d.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;erK([a,u],o),erY([a,u],"visible")}A(),L(),erU(eii,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===erD||"parent"===u?s.parentNode:erP(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=erA(x.props.duration,1,er1.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,f=!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&&(erK([s,c],i),erY([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),erU(eir,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),eii=eii.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(!d.render)return x;var M=d.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)}),I=t.hasAttribute("aria-expanded");return K(),L(),R(),D("onCreate",[x]),d.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 _(){var t=x.props.touch;return Array.isArray(t)?t:[t,0]}function O(){return"hold"===_()[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=erz(i)[0])&&null!=(n=r.ownerDocument)&&n.body?r.ownerDocument:document}function j(){return eie(T)}function E(t){return x.state.isMounted&&!x.state.isVisible||erZ.isTouch||u&&"focus"===u.type?0:erA(x.props.delay,t?0:1,er1.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;erz(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(){!(I||!x.props.aria.expanded)&&erz(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),eir=eir.filter(function(t){return t!==y})}function F(n){if(!(erZ.isTouch&&(h||"mousedown"===n.type))){var r=n.composedPath&&n.composedPath()[0]||n.target;if(!(x.props.interactive&&erG(T,r))){if(erz(x.props.triggerTarget||t).some(function(t){return erG(t,r)})){if(erZ.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,erR),t.addEventListener("touchstart",U,erR),t.addEventListener("touchmove",z,erR)}function B(){var t=N();t.removeEventListener("mousedown",F,!0),t.removeEventListener("touchend",F,erR),t.removeEventListener("touchstart",U,erR),t.removeEventListener("touchmove",z,erR)}function V(t,n){var r=j().box;function i(t){t.target===r&&(erq(r,"remove",i),n())}if(0===t)return n();erq(r,"remove",s),erq(r,"add",i),s=i}function $(n,r,i){void 0===i&&(i=!1),erz(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":$(er0?"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")&&eir.forEach(function(n){return n(t)}),"click"===t.type&&(0>x.props.trigger.indexOf("mouseenter")||f)&&!1!==x.props.hideOnClick&&x.state.isVisible?r=!0:et(t),"click"===t.type&&(f=!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:d}: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,d="top"===s?c.bottom.y:0,f="right"===s?c.left.x:0,p="left"===s?c.right.x:0,h=r.top-o+l>u,m=o-r.bottom-d>u,g=r.left-i+f>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&&f)){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!!erZ.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()?eie(T).arrow:null,l=a?{getBoundingClientRect:a,contextElement:a.contextElement||C()}:t,d=[{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&&d.push({name:"arrow",options:{element:s,padding:3}}),d.push.apply(d,(null==r?void 0:r.modifiers)||[]),x.popperInstance=erC(l,T,Object.assign({},r,{placement:i,onFirstUpdate:c,modifiers:d}))}function X(){x.popperInstance&&(x.popperInstance.destroy(),x.popperInstance=null)}function ee(){return erW(T.querySelectorAll("[data-tippy-root]"))}function et(t){x.clearDelayTimeouts(),t&&D("onTrigger",[x,t]),W();var n=E(!0),r=_(),o=r[0],a=r[1];erZ.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&&f)){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 er$(t)?s[0]:s}eio.defaultProps=er1,eio.setDefaultProps=er4,eio.currentInput=erZ,Object.assign({},enY,{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)}}),eio.setDefaultProps({render:eit});class eia{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&&ety(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:d}=l,f=Math.min(...d.map(t=>t.$from.pos)),p=Math.max(...d.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:f,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 Hp){let r=t.nodeDOM(f),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=etv(n,0,i),a=etv(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),d=Math.min(u.left,s.left),f=Math.max(u.right,s.right),p={top:c,bottom:l,left:d,right:f,width:f-d,height:l-c,x:d,y:c};return{...p,toJSON:()=>p}}(t,f,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=eio(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 eiu=t=>new HI({key:"string"==typeof t.pluginKey?new Hk(t.pluginKey):t.pluginKey,view:n=>new eia({view:n,...t})});ee5.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[eiu({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});let eis=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=eiu({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 eic extends enT{constructor(){super(...arguments),this.contentComponent=null}}let eil=({renderers:t})=>o.createElement(o.Fragment,null,Object.entries(t).map(([t,n])=>b.createPortal(n.reactElement,n.element,t)));class eid 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,b.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(eil,{renderers:this.state.renderers}))}}let eif=o.memo(eid),eip=(0,o.createContext)({onDragStart:void 0}),eih=()=>(0,o.useContext)(eip),eim=o.forwardRef((t,n)=>{let{onDragStart:r}=eih(),i=t.as||"div";return o.createElement(i,{...t,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})});class eig{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 eiy extends enk{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(eip.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 eig(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 eiv(t,n){return r=>r.editor.contentComponent?new eiy(t,r,n):{}}function eib(t){return setTimeout(()=>{t()})}function eix(t){let{debouncedUrl:n,content:r,onContentChange:i,selected:a}=t,c=(0,o.useRef)(null),[l,d]=(0,o.useState)(!1);return(0,s.pQ)(n,()=>{var t;l&&(d(!1),null==(t=c.current)||t.reset())}),(0,h.ju)(n)?n===(null==r?void 0:r.embed_url)?N.jsx(eiT,{content:r,selected:a}):N.jsx(u.SV,{ref:c,renderError:eiM,onError:function(){d(!0),i(void 0)},children:N.jsx(o.Suspense,{fallback:r&&N.jsx(eiT,{content:r,selected:a}),children:N.jsx(eiS,{url:n,selected:a,onContentChange:i})})}):null}function eiM(){return N.jsx(u.yO,{title:"There is no embed data available."})}function eiT(t){let{content:n,selected:r}=t;return N.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 eiS(t){let{url:n,onContentChange:r,selected:i}=t,a=function(t){let{url:n,onContentChange:r}=t,{embedsUrl:i}=tC(),a=(0,f.QT)(eiw,[n,i]),u=(0,s.R9)(r);return(0,o.useEffect)(()=>{let t=eib(()=>u(a));return()=>{clearTimeout(t)}},[a,u]),a}({url:n,onContentChange:r});return N.jsx(eiT,{content:a,selected:i})}function eiw(t,n){var r;let i=new URL(n);return i.search=new URLSearchParams({url:t}).toString(),(0,d.WY)(i.toString(),{okType:(r=t,tO.object({type:tO.string(),version:tO.string().or(tO.number()).nullish(),title:tO.string().nullish(),author_name:tO.string().nullish(),author_url:tO.string().nullish(),provider_name:tO.string().nullish(),provider_url:tO.string().nullish(),cache_age:tO.string().or(tO.number()).nullish(),thumbnail_url:tO.string().nullish(),thumbnail_width:tO.number().nullish(),thumbnail_height:tO.number().nullish(),html:tO.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 eiI(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 d(t){l.set(t),(0,h.ju)(t)||c(void 0)}return N.jsxs(u.gN,{footer:(0,h.ju)(l.value)&&N.jsx(u.mS,{children:N.jsx(eix,{debouncedUrl:l.debouncedValue,content:a,onContentChange:c})}),children:[N.jsx(u.fw,{name:"cloud"}),N.jsx(u.Qy,{htmlFor:n,children:ZA(i)}),N.jsx(u.JO,{children:N.jsx(ZU,{id:n,readOnly:r,placeholder:ZL(i),value:l.value,onValueChange:d,variant:(0,h.ju)(l.value)?"link":"normal",endAdornment:N.jsx(u.zx,{startIcon:"close",color:"grey",size:"small",disabled:!l,onClick:()=>d("")})})})]})}function ei_(t){return!(t.lat>85||t.lat<-85||t.lng>180||t.lng<-180)}function eiO(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(ei_(o))return o}function eik(t){return t?`${t.lat}, ${t.lng}`:""}function eiC(t){let n=t.match(/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/);if(!n)return eiO(t);let r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return eiO(t);let o={lat:r,lng:i};return ei_(o)?o:eiO(t)}function eiN(t){let{field:n,id:r,readOnly:i,...a}=t,{onValueChange:s,displayedValue:c,onBlur:l,clearValue:d,isValidCoordinates:f}=function(t){let{content:n,onContentChange:r}=t,i=eik(null==n?void 0:n.position),[a,u]=(0,o.useState)(i),s=Boolean(eiC(a));return{displayedValue:a,isValidCoordinates:s,onValueChange:u,onBlur:function(){let t=eiC(a);if(!t)return u(""),r(void 0);let{lat:n,lng:i}=t;u(eik({lat:n,lng:i})),r({__TYPE__:"GeoPointContent",position:{lat:n,lng:i}})},clearValue:function(){u(""),r(void 0)}}}(a);return N.jsxs(u.gN,{children:[N.jsx(u.fw,{name:"place"}),N.jsx(u.Qy,{htmlFor:r,children:ZA(n)}),N.jsx(u.JO,{children:N.jsx(ZU,{id:r,onValueChange:s,placeholder:"...",readOnly:i,value:c,onBlur:l,variant:f?"link":"normal",endAdornment:N.jsx(u.zx,{startIcon:"close",color:"grey",size:"small",disabled:!c,onClick:d})})})]})}let eij="__MAIN_THUMBNAIL__";function eiE(t,n,r){let i=t.name===eij?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 eiR(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 eiD(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 eiA(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 eiL(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?eiA(t.url):void 0}let eiF=ti({id:e0(),width:e1(),height:e1(),urls:ti({full:e0(),small:e0().transform(eiL)}),alt_description:e0().optional(),description:e0().nullable()}),eiz=ti({results:tr(eiF)}).transform(t=>t.results);function eiU(t,n){let r=new URLSearchParams({page:"1",per_page:"28",query:n});return(0,d.WY)(`${t}/search/photos?${r.toString()}`,{okType:eiz})}function eiW(t,n){return(0,f.QT)(eiU,[t,n])}function eiB(t){let{onSelectedChange:n}=t,[r,i]=(0,o.useTransition)(),a=(0,s.$P)({initialState:"",ms:300,startTransition:i});return N.jsxs(u.xu,{flexDirection:"column",gap:16,width:"100%",position:"relative",children:[N.jsx(u.CR,{value:a.value,placeholder:"Search on Unsplash.com",onValueChange:a.set}),N.jsx(u.SV,{renderError:()=>N.jsx(tJ,{}),children:N.jsx(o.Suspense,{children:N.jsx(eiV,{onSelectedChange:n,term:a.debouncedValue})})}),N.jsx(ei$,{open:r})]})}function eiV(t){let{media:n,toggleSelected:r,selectedImageId:i}=function(t){var n;let{term:r,onSelectedChange:i}=t,a=tC(),u=eiW(a.unsplashUrl,r||"citrus fruit"),s=null==(n=null==u?void 0:u[0])?void 0:n.id,[c,l]=(0,o.useState)();return(0,o.useEffect)(()=>{null==i||i([]),l(void 0)},[s,i]),{media:u,toggleSelected:function(t){if(t.id===c)return l(void 0),null==i?void 0:i([]);l(t.id),null==i||i([{...t,url:t.urls.full,alt:t.alt_description}])},selectedImageId:c}}(t);return N.jsx(u.xr,{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 250px), 1fr))",gap:16,paddingBottom:16,position:"relative",width:"100%"},children:null==n?void 0:n.map(t=>{let n=new URL(t.urls.full).searchParams.get("fm")??"jpg";return N.jsx(u.PB,{url:t.urls.small,filename:t.description??"Unsplash Image",selected:i===t.id,onCardClick:()=>r(t),extension:n,width:t.width,height:t.height},t.id)})})}function ei$(t){let{open:n}=t;return N.jsx(u.FN,{anchor:N.jsx(u.xu,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),loadingIndicator:!0,open:n,title:"Loading media ...",seconds:1})}function eiK(t){let{open:n,setIsOpen:r,onMediaSelected:i,assetType:a}=t,[c,l]=(0,o.useState)("media"),[d,f]=(0,o.useState)([]);function p(t){t||f([]),r(t)}let{containerRef:h}=(0,u.VY)();return N.jsxs(u.Vq,{open:n,onOpenChange:p,size:{width:1216,height:868},onPointerDownOutside(t){h&&(0,s.DX)(h,t.target)&&t.preventDefault()},children:[N.jsx(u.fK,{icon:"image",title:"Media library"}),N.jsxs(u.Zp,{value:c,onValueChange:function(t){if("media"!==t&&"unsplash"!==t)throw Error(`Invalid option ${t}.`);l(t)},padding:"small",width:"auto",children:[N.jsx(u.T9,{value:"media",icon:"photo"}),N.jsx(u.T9,{value:"unsplash",icon:"unsplash"})]}),N.jsx(u.cZ,{children:N.jsxs(u.xu,{overflow:"hidden",backgroundColor:"grey3",padding:{top:16,right:16,left:16},minHeight:"100%",children:["media"===c&&N.jsx(nt,{assetType:a,onSelectedChange:f}),"unsplash"===c&&N.jsx(eiB,{onSelectedChange:f})]})}),N.jsx(u.kX,{asFooter:!0,ok:{text:"Add to page",onClick:function(){let[t]=d||[];t&&(i(t),p(!1))},disabled:(null==d?void 0:d.length)!==1,disabledTooltip:0===d.length?"Select a media item to add to the page":d.length>1?"Only one media item can be added to the page":void 0},cancel:{text:"Cancel"}})]})}function eiY(){let t=new URL(location.href),n=tC(),r=t.searchParams.has("medialib");return"dev"===n.env||r}function eiq(t){let{onFilesSelected:n,assetType:r}=t,[i,a]=(0,o.useTransition)(),c=(0,s.$P)({initialState:i,ms:100});return N.jsx(u.SV,{renderError:eiX,children:N.jsx(o.Suspense,{children:N.jsxs(u.Zz,{onFilesSelected:n,overlay:N.jsx(eiQ,{}),assetType:r,children:[N.jsx(eiG,{...t,startTransition:a,assetType:r}),N.jsx(u.xu,{position:"relative",width:"100%",justifyContent:"center",children:N.jsx(u.FN,{anchor:N.jsx(u.xu,{position:"fixed",bottom:72}),loadingIndicator:!0,open:c.debouncedValue,title:"Loading media ...",seconds:1})})]})})})}function eiG(t){let{uploadingFiles:n,isUploading:r,onFilesSelected:i,onMediaSelected:a,startTransition:c,onRetry:l,assetType:d}=t,{media:f,limit:p,onHasReachedBottom:h,response:m,updateMedia:g}=tA({assetType:d});return(0,s.pQ)(n,()=>{if(r)return;let t=n.flatMap(t=>"success"!==t.status?[]:f.find(n=>n.id===t.id)?[]:[t.response]);t.length>0&&g(t)}),0===f.length?N.jsx(eiZ,{onFilesSelected:i}):N.jsxs(eiH,{onScrollToBottom:function(){m.total===p&&c(h)},children:[N.jsx(u.Fp,{enterDuration:400,exitDuration:400,children:n.length?N.jsx(u.xu,{flexDirection:"column",gap:6,children:n.map((t,n)=>N.jsx(u.tK,{file:t.file,status:t.status,onRetry:0!==n||r?void 0:l},t.id))},n.length):null}),N.jsx(u.Rk,{items:f,getItemInfo:eiJ,children:t=>N.jsxs(o.Suspense,{fallback:N.jsx(u.Od,{width:"100%",height:"100%"}),children:["image"===t.kind&&N.jsx(u.P0,{url:eiL(t.url),onClick:()=>a({...t,width:t.width??2e3,height:t.height??2e3})}),"all"===t.kind&&N.jsx(u.Ti,{extension:t.extension,filename:t.filename,onClick:()=>a(t)})]})})]})}function eiZ(t){let{onFilesSelected:n}=t;return N.jsx(u.xu,{justifyContent:"center",flexDirection:"column",height:"100%",padding:24,children:N.jsx(u.xu,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:"grey2",borderRadius:4,padding:{inline:80},children:N.jsxs(u.R$,{children:[N.jsx(u.av,{name:"cloudUpload",lineColor:"purple10",backgroundColor:"purple3"}),N.jsx(u._T,{size:"big",children:"Drop files here or"}),N.jsx(u.nf,{children:N.jsxs(u.xv,{color:"grey11",align:"center",variant:"normal",children:["Explore our documentation to find out the"," ",N.jsx(u.hh,{underline:!0,color:"grey11",href:" https://prismic.io/docs/guides/manage-images#maximum-file-size",children:"maximum size"})," ","and"," ",N.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."]})}),N.jsx(u.Qj,{children:N.jsx(u.KH,{onFilesSelected:n,children:"Upload Media"})})]})})})}function eiQ(){return N.jsx(u.xu,{justifyContent:"center",flexDirection:"column",height:"100%",children:N.jsxs(u.R$,{children:[N.jsx(u.av,{name:"cloudUpload",lineColor:"purple10",backgroundColor:"purple3"}),N.jsx(u._T,{size:"big",children:"Drop files here"}),N.jsx(u.nf,{children:"Drop your files to upload them instantly to your media library"})]})})}function eiH(t){let{children:n,onScrollToBottom:r}=t;return N.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 eiJ(t){return"pdf"===t.extension?{key:t.id,aspectRatio:193/154}:{key:t.id,aspectRatio:(t.width??2e3)/(t.height??2e3)}}function eiX(){return N.jsx(u.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:N.jsx(u.Iq,{title:"Request failed",description:"An error occurred while searching for your image.",errorImageSrc:u.Os})})}f.Fs.registerFetcherConfig(eiU,{cacheCapacity:5,revalidationStrategy:{type:"never"}});let ei0=t=>{let{onMediaSelected:n}=t,[r,i]=(0,o.useTransition)(),a=(0,s.$P)({initialState:"",ms:200,startTransition:i});return N.jsxs(N.Fragment,{children:[N.jsx(u.xu,{padding:{inline:24,top:16},flexDirection:"column",children:N.jsx(u.CR,{value:a.value,placeholder:"Search on Unsplash.com",onValueChange:a.set})}),N.jsx(ei2,{children:N.jsx(u.SV,{renderError:ei3,children:N.jsx(o.Suspense,{fallback:N.jsx(u.DW,{}),children:N.jsx(ei1,{term:a.debouncedValue,isUpdating:r,onMediaSelected:n})})})})]})},ei1=t=>{var n;let{term:r,isUpdating:i,onMediaSelected:o}=t,a=tC(),s=eiW(a.unsplashUrl,r||"fruit"),c=(n=i,{opacity:n?.4:1,transitionProperty:n?"opacity":"none",transitionDuration:u.TV.transitionDuration[300],transitionTimingFunction:u.TV.transitionTimingFunction.easeInOut});return s.length?N.jsx(u.Rk,{items:s,getItemInfo:ei4,style:c,children:t=>N.jsx(u.P0,{url:t.urls.small,onClick:()=>o({id:t.id,url:t.urls.full,width:t.width,height:t.height,alt:t.alt_description})})}):N.jsxs(u.R$,{style:{marginTop:"auto",marginBottom:"auto",...c},children:[N.jsx(u.u2,{children:N.jsx("img",{src:u.Os,alt:"No results"})}),N.jsx(u._T,{size:"big",children:"Oh no ..."}),N.jsx(u.nf,{children:"The search returned no result."})]})},ei2=({children:t})=>N.jsx(u.xr,{style:{height:"100%",paddingInline:u.TV.space[24],paddingTop:u.TV.space[4]},children:t});function ei4(t){return{key:t.id,aspectRatio:t.width/t.height}}function ei3(){return N.jsx(u.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:N.jsx(u.Iq,{title:"Request failed",description:"An error occurred while searching for your image.",errorImageSrc:u.Os})})}function ei5(t){let{onMediaSelected:n,assetType:r="all",open:i,onOpenChange:a}=t,s=tC(),[c,l]=(0,o.useState)(s.mediaLibrary?"media":"unsplash"),{uploadingFiles:f,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=tC();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,d.WY)(r,{headers:{repository:i,"Content-Type":"multipart/form-data"},method:"POST",body:a,credentials:(0,d.xb)(o),okType:tE})})({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:tV(),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 N.jsxs(u.Vq,{open:i,onOpenChange:a,children:[N.jsx(u.fK,{icon:"folder",title:"Add an image"}),N.jsxs(u.Zp,{value:c,onValueChange:g,children:[s.mediaLibrary&&N.jsx(u.T9,{value:"media",title:"Media library",subtitle:"From Prismic",icon:"photo"}),N.jsx(u.T9,{value:"unsplash",title:"Unsplash",subtitle:"Source of free images",icon:"unsplash"}),s.mediaLibrary&&N.jsx(u.xu,{flexDirection:"column",justifyContent:"end",flexGrow:1,animation:{name:"fadeIn"},children:N.jsx(u.KH,{startIcon:"cloudUpload",disabled:p,onFilesSelected:h,size:"large",color:"grey",children:"Upload media"})})]}),N.jsx(u.cZ,{children:N.jsx(ei9,{option:c,uploadingFiles:f,isUploading:p,onFilesSelected:h,onRetry:m,onMediaSelected(t){a(!1),null==n||n(t)},assetType:r})})]})}function ei9(t){let{option:n,onMediaSelected:r,assetType:i,...o}=t,a=tC();switch(n){case"media":return a.mediaLibrary?N.jsx(eiq,{onMediaSelected:r,assetType:i,...o}):null;case"unsplash":return N.jsx(ei0,{onMediaSelected:r})}}function ei8(t){let{onMediaSelected:n,readOnly:r,isUpdating:i}=t,[a,s]=(0,o.useState)(!1),c=eiY();return N.jsxs(u.aY,{children:[N.jsx(u.Zb,{color:"grey3",variant:"outlined",radius:4,children:N.jsx(u.aY,{children:N.jsx(u.xu,{padding:{block:48},flexDirection:"column",children:N.jsxs(u.R$,{children:[N.jsx(u.av,{name:"cloudUpload"}),N.jsx(u._T,{children:i?"Preparing your image...":"You haven't selected an image"}),!r&&N.jsx(u.Qj,{children:N.jsx(u.zx,{disabled:i,onClick:()=>s(!0),children:"Select image"})})]})})})}),c?N.jsx(eiK,{open:a,setIsOpen:s,onMediaSelected:n,assetType:"image"}):N.jsx(ei5,{open:a,onOpenChange:s,onMediaSelected:n,assetType:"image"})]})}function ei6(t){let{id:n,readOnly:r,altText:i,onValueChange:o,selected:a}=t;return N.jsxs(u.gN,{labelPosition:"side",selected:a,children:[N.jsx(u.Qy,{htmlFor:n,children:"Alt text"}),N.jsx(u.JO,{children:N.jsx(u.oi,{id:n,placeholder:"Short description for the visually impaired",readOnly:r,padding:{input:{inline:16}},value:i,onValueChange:o})})]})}let ei7=({contentView:t,constraints:n,croppedImage:r})=>{let[i,o]=eiR(t.origin,n),a=eiD(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}}}},eoe=({field:t,content:n,thumbnail:r,croppedImage:i})=>{var o,a,u,s;if(r===eij){let c=ei7({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),d=null==(s=n.thumbnails)?void 0:s[r];if(!l||!d)return n;let f=ei7({contentView:d,constraints:l,croppedImage:i});return f.url===d.url?n:{...n,thumbnails:{...n.thumbnails,[r]:f}}},eot=({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)}},eon=({contentView:t,constraints:n})=>{let r=eot({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}},eor={x:0,y:0,width:0,height:0,zoom:1},eoi=({selectedImage:{thumbnail:t,contentView:n}})=>t.width&&t.height?t.width/t.height:n?n.origin.width/n.origin.height:1,eoo=({trigger:t,initialImages:n,initialOption:r,onClose:i})=>{var a;let[s,c]=(0,o.useState)({}),[l,d]=(0,o.useState)({}),[f,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]??eor;c({...s,[n]:{...r,zoom:t}})},x=t=>{if(!v)return;let n=v.thumbnail.name,r=s[n]??eor;c({...s,[n]:{...r,...t}})},M=t=>{if(!v)return;let n=v.thumbnail.name,r=l[n];d({...l,[n]:{...r,crop:t}})},T=t=>{if(!v)return;let n=v.thumbnail.name,r=l[n]??{};d({...l,[n]:{...r,aspectRatio:t}})},S=s[(null==v?void 0:v.thumbnail.name)??""],w=f?S??((null==v?void 0:v.contentView)&&eon({contentView:v.contentView,constraints:v.thumbnail})):void 0,I=l[(null==v?void 0:v.thumbnail.name)??""];return N.jsxs(u.Vq,{trigger:t,onAnimationEnd:()=>m(!0),open:f,onOpenChange(t){t?(y(r),c({}),d({})):(m(!1),i({option:g,croppedImages:s})),p(t)},children:[N.jsx(u.fK,{icon:"photo",title:"Image editor"}),N.jsx(u.Zp,{value:String(g),onValueChange:t=>y(Number(t)),children:n.map((t,n)=>N.jsx(u.T9,{value:String(n),icon:"photo",title:t.labels[0]??"Main",subtitle:t.labels[1]??""},t.thumbnail.name))}),v&&N.jsx(u.cZ,{children:h&&N.jsx(u.tP,{image:(null==(a=v.contentView)?void 0:a.origin.url)??"",crop:(null==I?void 0:I.crop)??{x:0,y:0},onCropChange:M,zoom:(null==S?void 0:S.zoom)??1,onZoomChange:b,aspectRatio:eoi({selectedImage:v,cropper:I}),onAspectRatioChange:T,initialCroppedArea:w,onCropAreaChange:x},v.thumbnail.name)})]})};function eoa(t){var n,r;let{content:i,selected:a,fieldLabel:s,readOnly:c,imageLabel:l,onMediaSelected:d,initialImages:f,initialOption:p=0,onCropperDialogClose:h,onClear:m,children:g}=t,[y,v]=(0,o.useState)(!1),b=eiY(),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 N.jsxs(u.Zb,{color:a?"indigo2":"grey2",variant:a?"selected":"dashed",radius:4,children:[N.jsxs(u.Ol,{children:[N.jsxs(u.wP,{children:[s,0!==l.length&&N.jsx(u.xv,{color:"grey11",noSelect:!0,children:` • ${l.join(" • ")}`})]}),N.jsxs(u.Pf,{sx:{visibility:M},children:[N.jsx(eoo,{trigger:N.jsx(u.zx,{startIcon:"crop",disabled:x,children:"Crop & Resize"}),initialImages:f,initialOption:p,onClose:h}),N.jsx(u.zx,{startIcon:"imageSearch",onClick:()=>v(!0),children:"Replace"}),N.jsx(u.zx,{onClick:m,startIcon:"delete",children:"Clear"})]})]}),g,b?N.jsx(eiK,{open:y,setIsOpen:v,onMediaSelected:d,assetType:"image"}):N.jsx(ei5,{open:y,onOpenChange:v,onMediaSelected:d,assetType:"image"})]})}function eou(t,n){let{width:r,height:i,rect:o}=function(t,n){let[r,i]=eiR(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:eiD(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 eos(t){let{content:n,field:r,id:i,onContentChange:u,readOnly:s}=t,c=n&&n.origin.url.length>0,{onCropperDialogClose:d,onPageChange:f,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,d]=(0,o.useTransition)(),f=(n=u,(0,o.useMemo)(()=>{var t,r,i;return[{...null==(r=n.config)?void 0:r.constraint,name:eij}].concat((null==(i=n.config)?void 0:i.thumbnails)??[])},[n])),p=f[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])=>eoe({field:u,content:t,thumbnail:n,croppedImage:r}),r);o!==r&&d(()=>i(o))},onPageChange:function(t){d(()=>c(t))},onMediaSelected:function(t){if(!p)return;let n=function(t,n,r,i){var o,u,s,c,l,d;if(!r){let f=null==(o=n.config)?void 0:o.thumbnails,p=f&&Object.fromEntries(f.map(t=>[t.name,eou(i,t)]));return{__TYPE__:"ImageContent",...eou(i,null==(u=n.config)?void 0:u.constraint),thumbnails:p}}if(t===eij){let h=eou(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==(d=r.thumbnails)?void 0:d[t],y=eou(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&&d(()=>i(n))},isUpdating:l,page:s,thumbnail:p,allThumbnails:f,allContentViews:h,contentView:m,onClear:function(){null==c||c(0),i(void 0)}}}({field:r,content:n,onContentChange:u}),M=ZA(r),T=y.map((t,r)=>{let i=null==v?void 0:v[r];return{thumbnail:t,contentView:i,labels:eiE(t,n,i)}}),S=g&&c?eiE(g,n,b).filter(l.$):[];return N.jsx(eoa,{content:n,fieldLabel:M,imageLabel:S,initialOption:m,initialImages:T,readOnly:s,onMediaSelected:p,onCropperDialogClose:d,onClear:x,children:N.jsx(o.Suspense,{fallback:N.jsx("div",{style:{height:466}}),children:g&&n&&c&&v?N.jsx(eoc,{allContentViews:v,content:n,contentView:b,id:i,onContentChange:u,onPageChange:f,page:m,readOnly:s,thumbnailName:g.name,isUpdating:h}):N.jsx(ei8,{onMediaSelected:p,readOnly:s,isUpdating:h})})})}function eoc(t){let{allContentViews:n,content:r,contentView:i,id:o,onContentChange:a,onPageChange:s,page:c,readOnly:l,thumbnailName:d,isUpdating:f}=t;return N.jsxs(u.aY,{children:[N.jsx(u.lr,{getItemSource:eiP,items:n,onPageChange:s,page:c,style:{height:400},children:t=>(null==t?void 0:t.url)&&N.jsx(u.d$,{src:eiA(t.url),alt:t.alt??void 0,isUpdating:f},`${d}_${t.url}`)}),N.jsx(ei6,{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===eij?{...n,alt:o}:{...n,thumbnails:{...n.thumbnails,[t]:{...r,alt:o}}}}(d,r,i,t))}})]})}function eol(t){let{content:n,field:r,id:i,onContentChange:o,readOnly:a}=t;return N.jsxs(u.gN,{children:[N.jsx(u.fw,{name:"notes"}),N.jsx(u.Qy,{htmlFor:i,children:ZA(r)}),N.jsx(u.JO,{children:N.jsx(u.Kx,{id:i,placeholder:ZL(r),readOnly:a,paddingLeft:4,paddingRight:12,sx:{flexGrow:1},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 eod(t,n,r,i){return(0,y.W7)(t,r,i,30,n)}function eof(){let t=tC();t.searchDocuments||tj("searchDocuments");let{coreApiUrl:n,env:r}=t,i=`${n}/repository`,o=(0,f.QT)(y.Ag,[i,r]);return new Set(o.languages.map(t=>({id:t.id,label:t.name})))}function eop(){let t=tC();t.searchDocuments||tj("searchDocuments");let{coreApiUrl:n,env:r}=t,i=`${n}/repository`,o=(0,f.QT)(y.Mi,[i,r]);return new Set(o.results.map(t=>({id:t,label:t})))}function eoh(){let t=tC();t.searchDocuments||tj("searchDocuments");let{customTypesApiUrl:n,env:r,repository:i}=t,o=(0,f.QT)(y.JY,[n,i,r]);return new Set(o)}function eom(t){return t?(0,v.UI)(t,t=>({id:t,label:t})):new Set}function eog(t){let{filteredLocales:n,setFilteredLocales:r,filteredTags:i,setFilteredTags:a,filteredCustomTypes:s,setFilteredCustomTypes:c,fixedTags:l,fixedCustomTypes:d}=t;return N.jsxs(N.Fragment,{children:[N.jsx(u.SV,{children:N.jsx(o.Suspense,{fallback:N.jsx(eoy,{selectedValues:n,onSelectedValuesChange:r,label:"Locale",icon:"public",fetchFilters:eof,multiple:!1}),children:N.jsx(eob,{selectedValues:n,onSelectedValuesChange:r})})}),N.jsx(eoy,{selectedValues:i,fixedSelectedValues:eom(l),onSelectedValuesChange:a,label:"Tags",icon:"label",fetchFilters:eop}),N.jsx(eoy,{selectedValues:s,fixedSelectedValues:eom(d),onSelectedValuesChange:c,label:"Type",icon:"description",fetchFilters:eoh})]})}function eoy(t){let[n,r]=(0,o.useState)(!1),i=(0,o.useContext)(f.Nk);return N.jsx(u.SV,{renderError:()=>N.jsx(u.R0,{mode:"error",onErrorRetry:null==i?void 0:i.reset,open:n,setOpen:r,values:new Set,...t}),children:N.jsx(o.Suspense,{fallback:N.jsx(u.R0,{mode:"loading",open:n,setOpen:r,values:new Set,...t}),children:N.jsx(eov,{open:n,setOpen:r,...t})})})}function eov(t){let{open:n,setOpen:r,onSelectedValuesChange:i,fixedSelectedValues:o,selectedValues:a,label:s,icon:c,fetchFilters:l,multiple:d}=t,f=l();return N.jsx(u.R0,{open:n,setOpen:r,label:s,icon:c,selectedValues:a,values:new Set(f),fixedSelectedValues:o,onSelectedValuesChange:i,multiple:d})}function eob(t){let{selectedValues:n,onSelectedValuesChange:r}=t,[i,a]=(0,o.useState)((0,v.Ps)(n)),u=(0,v.sE)(eof(),t=>{var r;return t.id===(null==(r=(0,v.Ps)(n))?void 0:r.id)});return(null==u?void 0:u.label)!==(null==i?void 0:i.label)&&a(u),N.jsx(eoy,{selectedValues:new Set(i?[i]:[]),onSelectedValuesChange:function(t){r(t),a((0,v.Ps)(t))},label:"Locale",icon:"public",fetchFilters:eof,multiple:!1})}function eox(t){let{onSelectDocument:n,fixedCustomTypes:r,fixedTags:i,...a}=t,c=tC(),{searchTerm:l,filteredTags:d,setFilteredTags:f,filteredCustomTypes:p,setFilteredCustomTypes:h,filteredLocales:m,setFilteredLocales:g,typesFilter:y,tagsFilter:b}=function(t,n){let r=tC(),i=(0,s.$P)({initialState:""}),[a,u]=(0,o.useState)(new Set),[c,l]=(0,o.useState)(new Set),[d,f]=(0,o.useState)(function(){return r.searchDocuments&&r.localeId?new Set([{id:r.localeId,label:r.localeId}]):new Set}),p=(0,v.G0)(c,eom(t)),h=(0,v.G0)(a,eom(n));return{searchTerm:i,filteredTags:a,setFilteredTags:u,filteredCustomTypes:c,setFilteredCustomTypes:l,filteredLocales:d,setFilteredLocales:f,typesFilter:p,tagsFilter:h}}(r,i),[x,M]=(0,o.useTransition)(),T=(0,s.$P)({initialState:x,ms:100}),{searchDocuments:S}=tC();return N.jsx(u.Vq,{size:{height:727,width:656},hasClose:!1,...a,children:N.jsx(u.cZ,{children:N.jsxs(u.xu,{flexDirection:"column",height:"100%",children:[N.jsxs(u.xu,{padding:{top:16,inline:16},flexDirection:"column",gap:12,children:[N.jsx(u.yt,{value:l.value,onValueChange:l.set,placeholder:"Search a page",icon:"search"}),S&&N.jsx(eog,{filteredTags:d,setFilteredTags:f,filteredCustomTypes:p,setFilteredCustomTypes:h,filteredLocales:m,setFilteredLocales:g,fixedTags:i,fixedCustomTypes:r}),N.jsx(u.xv,{variant:"smallBold",color:"grey11",children:"Link to a document"})]}),c.searchDocuments?N.jsx(u.SV,{renderError:eoT,children:N.jsx(o.Suspense,{children:N.jsx(eoS,{searchTerm:l.debouncedValue,tagsFilter:b,typesFilter:y,localesFilter:m,startTransition:M,onSelectDocument:n})})}):N.jsx(eow,{message:"Slice Machine does not yet support mock data for linked documents in the simulator."}),N.jsx(eoM,{debouncedIsLoading:T.debouncedValue})]})})})}function eoM(t){return N.jsx(u.FN,{anchor:N.jsx(u.xu,{position:"relative",width:"100%",justifyContent:"center",bottom:72}),loadingIndicator:!0,open:t.debouncedIsLoading,title:"Loading more results ...",seconds:1})}function eoT(){return N.jsx(u.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:N.jsx(u.Iq,{title:"Request failed",description:"An error occurred while fetching documents.",errorImageSrc:u.Os})})}function eoS(t){let{searchTerm:n,tagsFilter:r,typesFilter:i,localesFilter:a,startTransition:s,onSelectDocument:c}=t,{documents:l,onHasReachedBottom:d}=function(t){var n,r;let{searchTerm:i,tagsFilter:a,typesFilter:u,localesFilter:s}=t,c=tC();c.searchDocuments||tj("searchDocuments");let{coreApiUrl:l,env:d,status:p}=c,[h,g]=(0,o.useState)(""),[b,x]=(0,o.useState)([]),[M,T]=(0,o.useState)(""),S=new URLSearchParams((0,y.fW)([{name:"tags",values:[...(0,v.UI)(a,t=>t.id)]},{name:"customTypes",values:[...(0,v.UI)(u,t=>t.id)]},{name:"language",values:[...(0,v.UI)(s,t=>t.id)]},{name:"status",values:y.Vu[p]},{name:"term",values:[i]}])).toString(),w=(0,f.QT)(eod,[l,S===M?h:"",d,S]);return S!==M?(T(S),g(""),x(w.results)):w.results.length>0&&(null==(n=(0,m.Z$)(b))?void 0:n.id)!==(null==(r=(0,m.Z$)(w.results))?void 0:r.id)&&x(t=>t.concat(w.results)),{documents:b,onHasReachedBottom:function(){w.cursor&&g(w.cursor)},response:w}}({searchTerm:n,tagsFilter:r,localesFilter:a,typesFilter:i}),p=tC();return N.jsx(u.xr,{onScrollToBottom:()=>s(d),style:{height:"100%",gap:u.TV.space[16],paddingTop:u.TV.space[10],paddingBottom:u.TV.space[16],paddingInline:u.TV.space[16]},children:N.jsxs(u.xu,{flexDirection:"column",gap:12,children:[0===l.length&&N.jsx(eow,{}),l.map(t=>{let n=t.versions[0];if(!n)return null;let i=(0,g.u)({documentId:t.id,versionId:"archived"===n.status?n.version_id:void 0,releaseId:"release"===n.status?n.release_id:void 0,status:n.status,env:p.env}),o=function(t){let{tags:n,tagsFilter:r}=t,i=[...r].map(t=>t.label).reverse();return(0,m.DY)(n,t=>-i.indexOf(t))}({tags:n.tags,tagsFilter:r});return N.jsx(u.z4,{documentType:n.custom_type_label,documentURL:i,description:n.preview_summary,tags:o,title:t.title,previewImageUrl:n.preview_image,onSelect:()=>c(t.id),statusColor:w[n.status].color},`${t.id}-${n.status}`)})]})})}function eow(t){let{message:n="There are no versions matching this request"}=t;return N.jsxs(u.xu,{justifyContent:"center",flexDirection:"column",alignItems:"center",gap:16,children:[N.jsx(u.xu,{height:56,width:56,backgroundColor:"purple3",alignItems:"center",justifyContent:"center",borderRadius:"100%",children:N.jsx(u.I5,{name:"close",size:"large",color:"purple10"})}),N.jsx(u.xu,{maxWidth:204,children:N.jsx(u.xv,{color:"grey11",align:"center",children:n})})]})}function eoI(t){let{hasLink:n,onUnlink:r,selectEnabled:i,selectedType:o,onValueChange:a,openInNewTab:s=!0,setOpenInNewTab:c}=t;return N.jsxs(N.Fragment,{children:[c&&"web"===o&&N.jsx(u.zx,{startIcon:s?"checkBox":"checkBoxOutlinedBlank",color:"grey",size:"small",onClick:()=>c(!s),children:"Open in new tab"}),N.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:[N.jsx(u.Ql,{value:"web",icon:"public",children:"Link to web page"}),N.jsx(u.Ql,{value:"document",icon:"description",children:"Link to Prismic page"}),N.jsx(u.Ql,{value:"media",icon:"image",children:"Link to media"})]}),N.jsx(u.zx,{startIcon:"close",color:"grey",size:"small",disabled:!n,onClick:r})]})}f.Fs.registerFetcherConfig(eod,{cacheCapacity:500,revalidationStrategy:{type:"never"}});let eo_={DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media"},eoO={document:"DocumentLink",web:"ExternalLink",media:"FileLink"},eok=ti({id:e0(),title:e0()});function eoC(t,n,r){return(0,d.WY)(`${t}/documents/${r}`,{credentials:(0,d.xb)(n),okType:eok})}function eoN(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 eoj(t){var n,r;let{content:i,field:a,id:c,onContentChange:l,readOnly:d}=t,f=eiY(),[p,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:I,onError:_,onMediaSelected:O,...k}=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__:eoO[null==(n=r.config)?void 0:n.select]}),[d,f]=(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?eo_[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:d}});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(eoO[t]),y("")},placeholder:ZL(r),isTypeSelectEnabled:!(null!=(n=r.config)&&n.select),onDocumentSelected:v,onError:function(){h(!0)},errorBoundaryRef:m,isTargetNewTab:"_blank"===d,updateWebLinkTarget:function(t){let n=t?"_blank":null;f(n),a({__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:u,target:n}})},onMediaSelected:function(t){a(eoN({media:t}))}}}({content:i,field:a,onContentChange:l}),C="ExternalLink"===T&&(0,h.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:d||!T,textType:C||"ImageLink"===T||"FileLink"===T?"link":"normal",value:S,...k},{searchDocuments:E}=tC();return N.jsxs(N.Fragment,{children:[N.jsxs(u.J2,{onMouseOverChange:y,open:p||g,align:"start",sideOffset:-3,openDelay:100,closeDelay:200,focusOnEnter:!1,anchor:N.jsxs(u.gN,{onMouseOverChange:m,children:[N.jsx(u.fw,{name:"link"}),N.jsx(u.Qy,{htmlFor:c,children:ZA(a)}),N.jsx(u.JO,{children:"DocumentLink"===T&&""!==S&&E?N.jsx(eoD,{errorBoundaryRef:w,onError:_,fallback:N.jsx(eoE,{...j,value:"..."}),renderError(){var t;return t=j,N.jsx(eoE,{...t,textType:"link"})},children:N.jsx(eoR,{...j,documentId:S,openDocumentListModal:()=>b(!0)})}):N.jsx(eoE,{...j})})]}),children:[C&&N.jsx(u.oZ,{url:C,title:(0,h.S$)(C)??"",subTitle:C.toString()}),(null==i?void 0:i.value.__TYPE__)==="ImageLink"&&N.jsx(u.Qi,{url:i.value.url,title:i.value.name,subTitle:`${i.value.width} x ${i.value.height} pixels`})]}),f?N.jsx(eiK,{open:x,setIsOpen:M,onMediaSelected:O,assetType:"all"}):N.jsx(ei5,{open:x,onOpenChange:M,onMediaSelected:O}),N.jsx(eox,{open:v,onOpenChange:b,onSelectDocument(t){b(!1),I(t)},fixedCustomTypes:new Set(null==(n=a.config)?void 0:n.customtypes),fixedTags:new Set(null==(r=a.config)?void 0:r.tags)})]})}function eoE(t){let{id:n,onValueChange:r,placeholder:i,readOnly:o,value:a,textType:u,onFocus:s,onBlur:c,contentType:l,isTypeSelectEnabled:d,selectType:f,onTypeChange:p,isTargetNewTab:h,updateWebLinkTarget:m}=t,g="DocumentLink"===l||"ImageLink"===l||"FileLink"===l;return N.jsx(ZU,{id:n,onValueChange:r,placeholder:i,readOnly:o||g,value:a,variant:u,onFocus:s,onBlur:c,cursor:g?"pointer":"text",endAdornment:N.jsx(eoI,{hasLink:Boolean(a),onUnlink:()=>r(""),selectEnabled:d,selectedType:f,onValueChange:p,openInNewTab:h,setOpenInNewTab:m})})}function eoR(t){let{id:n,documentId:r,openDocumentListModal:i,onValueChange:o,isTypeSelectEnabled:a,selectType:u,onTypeChange:s}=t,c=function(t){let n=tC();n.searchDocuments||tj("searchDocuments");let{coreApiUrl:r,env:i}=n;return(0,f.QT)(eoC,[r,i,t]).title}(r);return N.jsx(ZU,{id:n,readOnly:!0,value:c,variant:"link",onFocus:i,cursor:"pointer",endAdornment:N.jsx(eoI,{hasLink:!0,onUnlink:()=>o(""),selectEnabled:a,selectedType:u,onValueChange:s})})}function eoD(t){let{errorBoundaryRef:n,onError:r,children:i,fallback:a,renderError:s}=t;return N.jsx(u.SV,{ref:n,onError:r,renderError:s,children:N.jsx(o.Suspense,{fallback:a,children:i})})}let eoA=({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 N.jsxs(u.gN,{children:[N.jsx(u.fw,{name:"pin"}),N.jsx(u.Qy,{htmlFor:r,children:ZA(n)}),N.jsx(u.JO,{children:N.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,padding:ZW,placeholder:ZL(n),readOnly:o,onValueChange(t){var n;return i((n=t,void 0===n?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(n)}))}})})]})};var eoL=function(){};eoL.prototype.append=function(t){return t.length?(t=eoL.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},eoL.prototype.prepend=function(t){return t.length?eoL.from(t).append(this):this},eoL.prototype.appendInner=function(t){return new eoF(this,t)},eoL.prototype.slice=function(t,n){return void 0===t&&(t=0),void 0===n&&(n=this.length),t>=n?eoL.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))},eoL.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},eoL.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)},eoL.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},eoL.from=function(t){return t instanceof eoL?t:t&&t.length?new eoP(t):eoL.empty};var eoP=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}(eoL);eoL.empty=new eoP([]);var eoF=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}(eoL);class eoz{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 eoU(t.map));let d=t.step.map(i.slice(o)),f;d&&a.maybeStep(d).doc&&(f=a.mapping.maps[a.mapping.maps.length-1],c.push(new eoU(f,void 0,void 0,c.length+l.length))),o--,f&&i.appendMap(f,o)}else a.maybeStep(t.step);if(t.selection)return u=i?t.selection.map(i.slice(o)):t.selection,s=new eoz(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 d=0;d<t.steps.length;d++){let f=t.steps[d].invert(t.docs[d]),p=new eoU(t.mapping.maps[d],f,n),h;(h=l&&l.merge(p))&&(p=h,d?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 eoz(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 eoz(this.items.append(t.map(t=>new eoU(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]),d=n.selection&&n.selection.map(o.slice(s+1,i));d&&u++,r.push(new eoU(c,l,d))}else r.push(new eoU(c))},i);let c=[];for(let l=n;l<a;l++)c.push(new eoU(o.maps[l]));let d=this.items.slice(0,i).append(c).append(r),f=new eoz(d,u);return f.emptyItemCount()>500&&(f=f.compress(this.items.length-r.length)),f}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 d=new eoU(c.invert(),s,l),f,p=i.length-1;(f=i.length&&i[p].merge(d))?i[p]=f:i.push(d)}}else a.map&&r--},this.items.length,0),new eoz(eoL.from(i.reverse()),o)}}eoz.empty=new eoz(eoL.empty,0);class eoU{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 eoU(n.getMap().invert(),n,this.selection)}}}class eoW{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 eoV(t){let n=[];return t.forEach((t,r,i,o)=>n.push(i,o)),n}function eo$(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 eoK(t,n,r,i){let o=eoG(n),a=eoZ.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 eoW(i?c:u.remaining,i?u.remaining:c,null,0,-1);r(u.transform.setSelection(s).setMeta(eoZ,{redo:i,historyState:l}).scrollIntoView())}let eoY=!1,eoq=null;function eoG(t){let n=t.plugins;if(eoq!=n){eoY=!1,eoq=n;for(let r=0;r<n.length;r++)if(n[r].spec.historyPreserveItems){eoY=!0;break}}return eoY}let eoZ=new Hk("history"),eoQ=new Hk("closeHistory"),eoH=(t,n)=>{let r=eoZ.getState(t);return!!r&&0!=r.done.eventCount&&(n&&eoK(r,t,n,!1),!0)},eoJ=(t,n)=>{let r=eoZ.getState(t);return!!r&&0!=r.undone.eventCount&&(n&&eoK(r,t,n,!0),!0)},eoX=ee5.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:n})=>eoH(t,n),redo:()=>({state:t,dispatch:n})=>eoJ(t,n)}),addProseMirrorPlugins(){return[function(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new HI({key:eoZ,state:{init:()=>new eoW(eoz.empty,eoz.empty,null,0,-1),apply:(n,r,i)=>(function(t,n,r,i){let o=r.getMeta(eoZ),a;if(o)return o.historyState;r.getMeta(eoQ)&&(t=new eoW(t.done,t.undone,null,0,-1));let u=r.getMeta("appendedTransaction");if(0==r.steps.length)return t;if(u&&u.getMeta(eoZ))return u.getMeta(eoZ).redo?new eoW(t.done.addTransform(r,void 0,i,eoG(n)),t.undone,eoV(r.mapping.maps[r.steps.length-1]),t.prevTime,t.prevComposition):new eoW(t.done,t.undone.addTransform(r,void 0,i,eoG(n)),null,t.prevTime,t.prevComposition);if(!1===r.getMeta("addToHistory")||u&&!1===u.getMeta("addToHistory"))return(a=r.getMeta("rebased"))?new eoW(t.done.rebased(r,a),t.undone.rebased(r,a),eo$(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new eoW(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),eo$(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?eo$(t.prevRanges,r.mapping):eoV(r.mapping.maps[r.steps.length-1]);return new eoW(t.done.addTransform(r,c?n.selection.getBookmark():void 0,i,eoG(n)),eoz.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?eoH:"historyRedo"==r?eoJ: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()}}}),eo0=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,eo1=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,eo2=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,eo4=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,eo3=en_.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",eeU(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[enS({find:eo0,type:this.type}),enS({find:eo2,type:this.type})]},addPasteRules(){return[enC({find:eo1,type:this.type}),enC({find:eo4,type:this.type})]}});var eo5,eo9,eo8=((eo5=eo8||{}).Document="document",eo5.Mark="mark",eo5.Node="node",eo5),eo6=((eo9=eo6||{}).Text="text",eo9.Embed="embed",eo9.Image="image",eo9);class eo7{constructor(t,n,r,i,o,a=!1){S(this,"extType","node"),S(this,"nodeType","text"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a}}function eae(t){return t instanceof eo7}class eat extends eo7{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class ean extends eo7{constructor(t,n,r,i){super(t,n,r,i)}}function ear(t){return t instanceof ean}let eai=enO.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",eeU(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()}}}),eao={isHardBreak:t=>t.type.name===eai.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 eaa(){return{extensions:ecr(),defaultTextConverter:void 0}}let eau=eo3.extend({name:"bold"}),eas=new class{constructor(t,n,r){S(this,"extType",eo8.Mark),S(this,"richTextNodeTypes",KE.RichTextNodeType.strong),this.name=t,this.component=n,this.converter=r}}(eau.name,eau,{fromPrismic:t=>function(){var n;return null==(n=t.marks[eau.name])?void 0:n.create()},toPrismic(){}}),eac=enO.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",eeU(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)}}}),eal=en_.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",eeU(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:n})=>{let r=etJ(t,this.type);return!!Object.entries(r).some(([,t])=>!!t)||n.unsetMark(this.name)}}}}),ead=/^\s*([-+*])\s$/,eaf=enO.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",eeU(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(eac.name,this.editor.getAttributes(eal.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=enI({find:ead,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=enI({find:ead,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(eal.name),editor:this.editor})),[t]}}),eap=enO.create({name:"doc",topNode:!0,content:"block+"}),eah=enO.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",eeU(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)}}}),eam=eah.extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),eag={component:eam,converter:{fromPrismic:t=>function(n){var r;let i=esm.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[eam.name])?void 0:r.create({},i)},toPrismic:(t,n)=>eao.children.reduce(t,(t,r)=>{let i=esm.converter.toPrismic(r),o=i instanceof Array?i.map(t=>({...t,type:n})):i?[{...i,type:n}]:[];return[...t,...o]},[])},placeholder:"List"},eay="document",eav=t=>eap.extend({name:eay,content:t?"block+":"block"}),eab=t=>({fromPrismic(n,r){function i(t,n){return!n&&r&&nA.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 eo6.Embed:return nA.EmbedBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;case eo6.Text:return nA.TextBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;case eo6.Image:return nA.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,m.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===esw.name||i.type.name===ect.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[eay])?void 0:o.create({},a)}},toPrismic:n=>({__TYPE__:"StructuredTextContent",value:[...eao.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},[])]})}),eax=new class{constructor(t,n,r){S(this,"extType","document"),this.name=t,this.component=n,this.converter=r}}(eay,eav,eab),eaM=eai.extend({name:"hard_break"}),eaT=`
|
|
94
|
-
`,eaS={fromPrismic:t=>function(n){var r;if(n===eaT)return null==(r=t.nodes[eaM.name])?void 0:r.create({})},toPrismic(t){if(t.type.name===eaM.name)return eaT}},eaw={isEmptyLine:t=>0===t.length,isFirst:t=>0===t},eaI={name:eaM.name,component:eaM,converter:eaS,splitTextToNodes:function(t,n){return function(r){let i=eaS.fromPrismic(t)(eaT);if(!i)return[r(n)];let o=n.split(eaT);return 1===o.length?n.length?[r(n)]:[i]:o.reduce((t,n,o)=>eaw.isFirst(o)?eaw.isEmptyLine(n)?t:[...t,r(n)]:eaw.isEmptyLine(n)?[...t,i]:[...t,i,r(n)],[])}}},ea_=ee5.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new HI({key:new Hk("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}),Xz.create(t,o)}}})]}}),eaO=t=>ea_.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=!eao.children.exists(i.state.doc,t=>t===a),d=i.isEditable,f=i.isFocused&&o,p=a.type.name!==esm.name,h=f||p||l,m=c.length>1,g=function(){if(l)return eag.placeholder;let t=u[a.type.name];return"string"==typeof t?t:null==t?void 0:t(a.attrs)}();return s&&!f&&i.isEmpty?s:("Type '/' for commands"===g?d&&h&&m:d&&h)&&g||""})({props:n,params:t}),showOnlyCurrent:!1,showOnlyWhenEditable:!1});function eak(t){return t.split("-")[1]}function eaC(t){return"y"===t?"height":"width"}function eaN(t){return t.split("-")[0]}function eaj(t){return["top","bottom"].includes(eaN(t))?"x":"y"}function eaE(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=eaj(n),c=eaC(s),l=i[c]/2-o[c]/2,d=eaN(n),f="x"===s,p;switch(d){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(eak(n)){case"start":p[s]-=l*(r&&f?-1:1);break;case"end":p[s]+=l*(r&&f?-1:1)}return p}let eaR=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:d,y:f}=eaE(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:d,y:f,initialPlacement:i,placement:p,strategy:o,middlewareData:h,rects:l,platform:u,elements:{reference:t,floating:n}});if(d=b??d,f=x??f,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:d,y:f}=eaE(l,p,c)),g=-1;continue}}return{x:d,y:f,placement:p,strategy:o,middlewareData:h}};function eaD(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function eaA(t,n){var r,i,o;void 0===n&&(n={});let{x:a,y:u,platform:s,rects:c,elements:l,strategy:d}=t,{boundary:f="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=eaD(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:f,rootBoundary:p,strategy:d})),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=eaD(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:M,strategy:d}):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 eaL=Math.min,eaP=Math.max;function eaF(t,n,r){return eaP(t,eaL(n,r))}let eaz={left:"right",right:"left",bottom:"top",top:"bottom"};function eaU(t){return t.replace(/left|right|bottom|top/g,t=>eaz[t])}let eaW={start:"end",end:"start"};function eaB(t){return t.replace(/start|end/g,t=>eaW[t])}async function eaV(t,n){let{placement:r,platform:i,elements:o}=t,a=await (null==i.isRTL?void 0:i.isRTL(o.floating)),u=eaN(r),s=eak(r),c="x"===eaj(r),l=["left","top"].includes(u)?-1:1,d=a&&c?-1:1,f="function"==typeof n?n(t):n,{mainAxis:p,crossAxis:h,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&"number"==typeof m&&(h="end"===s?-1*m:m),c?{x:h*d,y:p*l}:{x:p*l,y:h*d}}function ea$(t){return"x"===t?"y":"x"}function eaK(t){var n;return(null==(n=t.ownerDocument)?void 0:n.defaultView)||window}function eaY(t){return eaK(t).getComputedStyle(t)}let eaq=Math.min,eaG=Math.max,eaZ=Math.round;function eaQ(t){let n=eaY(t),r=parseFloat(n.width),i=parseFloat(n.height),o=t.offsetWidth,a=t.offsetHeight,u=eaZ(r)!==o||eaZ(i)!==a;return u&&(r=o,i=a),{width:r,height:i,fallback:u}}function eaH(t){return ea2(t)?(t.nodeName||"").toLowerCase():""}let eaJ;function eaX(){if(eaJ)return eaJ;let t=navigator.userAgentData;return t&&Array.isArray(t.brands)?eaJ=t.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function ea0(t){return t instanceof eaK(t).HTMLElement}function ea1(t){return t instanceof eaK(t).Element}function ea2(t){return t instanceof eaK(t).Node}function ea4(t){if(typeof ShadowRoot>"u")return!1;let n=eaK(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}function ea3(t){let{overflow:n,overflowX:r,overflowY:i,display:o}=eaY(t);return/auto|scroll|overlay|hidden|clip/.test(n+i+r)&&!["inline","contents"].includes(o)}function ea5(t){return["table","td","th"].includes(eaH(t))}function ea9(t){let n=/firefox/i.test(eaX()),r=eaY(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 ea8(){return/^((?!chrome|android).)*safari/i.test(eaX())}function ea6(t){return["html","body","#document"].includes(eaH(t))}function ea7(t){return ea1(t)?t:t.contextElement}let eue={x:1,y:1};function eut(t){let n=ea7(t);if(!ea0(n))return eue;let r=n.getBoundingClientRect(),{width:i,height:o,fallback:a}=eaQ(n),u=(a?eaZ(r.width):r.width)/i,s=(a?eaZ(r.height):r.height)/o;return u&&Number.isFinite(u)||(u=1),s&&Number.isFinite(s)||(s=1),{x:u,y:s}}function eun(t,n,r,i){var o,a;void 0===n&&(n=!1),void 0===r&&(r=!1);let u=t.getBoundingClientRect(),s=ea7(t),c=eue;n&&(i?ea1(i)&&(c=eut(i)):c=eut(t));let l=s?eaK(s):window,d=ea8()&&r,f=(u.left+(d&&(null==(o=l.visualViewport)?void 0:o.offsetLeft)||0))/c.x,p=(u.top+(d&&(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=eaK(s),y=i&&ea1(i)?eaK(i):i,v=g.frameElement;for(;v&&i&&y!==g;){let b=eut(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,f*=b.x,p*=b.y,h*=b.x,m*=b.y,f+=x.x,p+=x.y,v=eaK(v).frameElement}}return{width:h,height:m,top:p,right:f+h,bottom:p+m,left:f,x:f,y:p}}function eur(t){return((ea2(t)?t.ownerDocument:t.document)||window.document).documentElement}function eui(t){return ea1(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function euo(t){return eun(eur(t)).left+eui(t).scrollLeft}function eua(t){if("html"===eaH(t))return t;let n=t.assignedSlot||t.parentNode||ea4(t)&&t.host||eur(t);return ea4(n)?n.host:n}function euu(t,n){var r;void 0===n&&(n=[]);let i=function t(n){let r=eua(n);return ea6(r)?r.ownerDocument.body:ea0(r)&&ea3(r)?r:t(r)}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=eaK(i);return o?n.concat(a,a.visualViewport||[],ea3(i)?i:[]):n.concat(i,euu(i))}function eus(t,n,r){let i;if("viewport"===n)i=function(t,n){let r=eaK(t),i=eur(t),o=r.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,c=0;if(o){a=o.width,u=o.height;let l=ea8();(!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=eur(t),r=eui(t),i=t.ownerDocument.body,o=eaG(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),a=eaG(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight),u=-r.scrollLeft+euo(t),s=-r.scrollTop;return"rtl"===eaY(i).direction&&(u+=eaG(n.clientWidth,i.clientWidth)-o),{width:o,height:a,x:u,y:s}}(eur(t));else if(ea1(n))i=function(t,n){let r=eun(t,!0,"fixed"===n),i=r.top+t.clientTop,o=r.left+t.clientLeft,a=ea0(t)?eut(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(ea8()){var a,u;let s=eaK(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 eaD(i)}function euc(t,n){return ea0(t)&&"fixed"!==eaY(t).position?n?n(t):t.offsetParent:null}function eul(t,n){let r=eaK(t),i=euc(t,n);for(;i&&ea5(i)&&"static"===eaY(i).position;)i=euc(i,n);return i&&("html"===eaH(i)||"body"===eaH(i)&&"static"===eaY(i).position&&!ea9(i))?r:i||function(t){let n=eua(t);for(;ea0(n)&&!ea6(n);){if(ea9(n))return n;n=eua(n)}return null}(t)||r}let eud={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=euu(t).filter(t=>ea1(t)&&"body"!==eaH(t)),o=null,a="fixed"===eaY(t).position,u=a?eua(t):t;for(;ea1(u)&&!ea6(u);){let s=eaY(u),c=ea9(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=eua(u)}return n.set(t,i),i}(n,this._c):[].concat(r),i],u=a[0],s=a.reduce((t,r)=>{let i=eus(n,r,o);return t.top=eaG(i.top,t.top),t.right=eaq(i.right,t.right),t.bottom=eaq(i.bottom,t.bottom),t.left=eaG(i.left,t.left),t},eus(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=ea0(r),a=eur(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"!==eaH(r)||ea3(a))&&(u=eui(r)),ea0(r))){let l=eun(r);s=eut(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:ea1,getDimensions:function(t){return ea0(t)?eaQ(t):t.getBoundingClientRect()},getOffsetParent:eul,getDocumentElement:eur,getScale:eut,async getElementRects(t){let{reference:n,floating:r,strategy:i}=t,o=this.getOffsetParent||eul,a=this.getDimensions;return{reference:function(t,n,r){let i=ea0(n),o=eur(n),a=eun(t,!0,"fixed"===r,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(i||!i&&"fixed"!==r){if(("body"!==eaH(n)||ea3(o))&&(u=eui(n)),ea0(n)){let c=eun(n,!0);s.x=c.x+n.clientLeft,s.y=c.y+n.clientTop}else o&&(s.x=euo(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"===eaY(t).direction};function euf(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?[...ea1(t)?euu(t):t.contextElement?euu(t.contextElement):[],...euu(n)]:[];l.forEach(t=>{c&&t.addEventListener("scroll",r,{passive:!0}),a&&t.addEventListener("resize",r)});let d=null;if(u){let f=!0;d=new ResizeObserver(()=>{f||r(),f=!1}),ea1(t)&&!s&&d.observe(t),ea1(t)||!t.contextElement||s||d.observe(t.contextElement),d.observe(n)}let p,h=s?eun(t):null;return s&&function n(){let i=eun(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=d)||t.disconnect(),d=null,s&&cancelAnimationFrame(p)}}let eup=(t,n,r)=>{let i=new Map,o={platform:eud,...r},a={...o.platform,_c:i};return eaR(t,n,{...o,platform:a})};var euh="u">typeof document?o.useLayoutEffect:o.useEffect;function eum(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(!eum(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)&&!eum(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}function eug(t){let n=o.useRef(t);return euh(()=>{n.current=t}),n}var euy="u">typeof document?o.useLayoutEffect:o.useEffect;let euv=!1,eub=0,eux=()=>"floating-ui-"+eub++,euM=(qz||(qz=r.t(o,2)))["useId".toString()],euT=euM??function(){let[t,n]=o.useState(()=>euv?eux():void 0);return euy(()=>{null==t&&n(eux())},[]),o.useEffect(()=>{euv||(euv=!0)},[]),t},euS=o.createContext(null),euw=o.createContext(null),euI=()=>{var t,n;return null!=(t=null==(n=o.useContext(euS))?void 0:n.id)?t:null},eu_=()=>o.useContext(euw);function euO(t){var n;return null!=(n=null==t?void 0:t.ownerDocument)?n:document}function euk(t){var n;return null!=(n=euO(t).defaultView)?n:window}function euC(t){return!!t&&t instanceof euk(t).Element}let euN=(qz||(qz=r.t(o,2)))["useInsertionEffect".toString()];function euj(t){let n=o.useRef(()=>{});return euN?euN(()=>{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 euE(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 euR(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 euD(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 euA(t){t.preventDefault(),t.stopPropagation()}function euL(t){let n=(0,o.useRef)();return euy(()=>{n.current=t},[t]),n.current}let euP=function(t,n){let{open:r}=t,{enabled:i=!0,role:o="dialog"}=void 0===n?{}:n,a=euT(),u=euT(),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 euF(t,n){return null!=n&&("composedPath"in t?t.composedPath().includes(n):null!=t.target&&n.contains(t.target))}let euz=function(t,n){let{open:r,onOpenChange:i,refs:a,events:u,nodeId:s}=t,{enabled:c=!0,escapeKey:l=!0,outsidePointerDown:d=!0,referencePointerDown:f=!1,ancestorScroll:p=!1,bubbles:h=!0}=void 0===n?{}:n,m=eu_(),g=null!=euI(),y=o.useRef(!1);return o.useEffect(()=>{if(!r||!c)return;function t(t){"Escape"!==t.key||!h&&m&&euR(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(euC(c)&&a.floating.current){let l=null!=(r=a.floating.current.ownerDocument.defaultView)?r:window,d=c.scrollWidth>c.clientWidth,f=c.scrollHeight>c.clientHeight,p=f&&t.offsetX>c.clientWidth;if(f&&"rtl"===l.getComputedStyle(c).direction&&(p=t.offsetX<=c.offsetWidth-c.clientWidth),p||d&&t.offsetY>c.clientHeight)return}let v=m&&euR(m.nodesRef.current,s).some(n=>{var r;return euF(t,null==(r=n.context)?void 0:r.refs.floating.current)});euF(t,a.floating.current)||euF(t,a.domReference.current)||v||!h&&m&&euR(m.nodesRef.current,s).length>0||(u.emit("dismiss",!!g&&{preventScroll:!0}),i(!1))}function o(){i(!1)}let f=euO(a.floating.current);l&&f.addEventListener("keydown",t),d&&f.addEventListener("pointerdown",n);let v=(p?[...euC(a.reference.current)?euu(a.reference.current):[],...euC(a.floating.current)?euu(a.floating.current):[]]:[]).filter(t=>{var n;return t!==(null==(n=f.defaultView)?void 0:n.visualViewport)});return v.forEach(t=>t.addEventListener("scroll",o,{passive:!0})),()=>{l&&f.removeEventListener("keydown",t),d&&f.removeEventListener("pointerdown",n),v.forEach(t=>t.removeEventListener("scroll",o))}},[l,d,u,m,s,r,i,p,c,h,a,g]),c?{reference:{onPointerDown(){f&&(u.emit("dismiss"),i(!1))}},floating:{onPointerDownCapture(){y.current=!0}}}:{}},euU="ArrowUp",euW="ArrowDown",euB="ArrowLeft",euV="ArrowRight";function eu$(t,n,r){return Math.floor(t/n)!==r}function euK(t,n){return n<0||n>=t.current.length}function euY(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 euq(t,n,r){switch(t){case"vertical":return n;case"horizontal":return r;default:return n||r}}function euG(t,n){return euq(n,t===euU||t===euW,t===euB||t===euV)}function euZ(t,n,r){return euq(n,t===euW,r?t===euB:t===euV)||"Enter"===t||" "==t||""===t}function euQ(t,n){return euY(t,{disabledIndices:n})}function euH(t,n){return euY(t,{decrement:!0,startingIndex:t.current.length,disabledIndices:n})}let euJ=function(t,n){let{open:r,onOpenChange:i,refs:a}=t,{listRef:u,activeIndex:s,onNavigate:c=()=>{},enabled:l=!0,selectedIndex:d=null,allowEscape:f=!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=euI(),w=eu_(),I=euL(r),_=euj(c),O=euj(euL(c)),k=o.useRef(y),C=o.useRef(d??-1),N=o.useRef(null),j=function(t){let n=(0,o.useRef)(t);return euy(()=>{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,euq(M,m?n===euV:n===euB,n===euU))){euA(t),i(!1),(c=a.domReference.current)&&c instanceof euk(c).HTMLElement&&a.domReference.current.focus();return}let l=C.current,d=euQ(u,x),y=euH(u,x);if("Home"===t.key&&(C.current=d,_(C.current)),"End"===t.key&&(C.current=y,_(C.current)),T>1){let v=C.current;if(t.key===euU){if(euA(t),-1===v)C.current=y;else if(C.current=euY(u,{startingIndex:v,amount:T,decrement:!0,disabledIndices:x}),p&&(v-T<d||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}euK(u,C.current)&&(C.current=v),_(C.current)}if(t.key===euW&&(euA(t),-1===v?C.current=d:(C.current=euY(u,{startingIndex:v,amount:T,disabledIndices:x}),p&&v+T>y&&(C.current=euY(u,{startingIndex:v%T-T,amount:T,disabledIndices:x}))),euK(u,C.current)&&(C.current=v),_(C.current)),"both"===M){let I=Math.floor(v/T);t.key===euV&&(euA(t),v%T!=T-1?(C.current=euY(u,{startingIndex:v,disabledIndices:x}),p&&eu$(C.current,T,I)&&(C.current=euY(u,{startingIndex:v-v%T-1,disabledIndices:x}))):p&&(C.current=euY(u,{startingIndex:v-v%T-1,disabledIndices:x})),eu$(C.current,T,I)&&(C.current=v)),t.key===euB&&(euA(t),v%T!=0?(C.current=euY(u,{startingIndex:v,disabledIndices:x,decrement:!0}),p&&eu$(C.current,T,I)&&(C.current=euY(u,{startingIndex:v+(T-v%T),decrement:!0,disabledIndices:x}))):p&&(C.current=euY(u,{startingIndex:v+(T-v%T),decrement:!0,disabledIndices:x})),eu$(C.current,T,I)&&(C.current=v)),euK(u,C.current)&&(p&&Math.floor(y/T)===I?C.current=t.key===euB?y:euY(u,{startingIndex:v-v%T-1,disabledIndices:x}):C.current=v),_(C.current);return}}if(euG(t.key,M)){if(euA(t),r&&!g&&euD(t.currentTarget.ownerDocument)===t.currentTarget){C.current=euZ(t.key,M,m)?d:y,_(C.current);return}euZ(t.key,M,m)?p?C.current=l>=y?f&&l!==u.current.length?-1:d:euY(u,{startingIndex:l,disabledIndices:x}):C.current=Math.min(y,euY(u,{startingIndex:l,disabledIndices:x})):p?C.current=l<=d?f&&-1!==l?u.current.length:y:euY(u,{startingIndex:l,decrement:!0,disabledIndices:x}):C.current=Math.max(d,euY(u,{startingIndex:l,decrement:!0,disabledIndices:x})),euK(u,C.current)?_(null):_(C.current)}}return euy(()=>{l&&(!I&&r&&k.current&&null!=d&&_(d),I&&!r&&(cancelAnimationFrame(R.current),C.current=-1,O(null)))},[r,I,d,u,L,l,_,O]),euy(()=>{l&&r&&(null==s?null==d&&(I&&(C.current=-1,L(u,C)),!I&&k.current&&(null!=N.current||!0===k.current&&null==N.current)&&(C.current=null==N.current||euZ(N.current,M,m)||h?euQ(u,j.current):euH(u,j.current),_(C.current),L(u,C))):euK(u,s)||(C.current=s,L(u,C)))},[r,I,s,d,h,u,_,L,l,f,M,m,g,j]),euy(()=>{if(l&&!r&&I){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(euD(euO(i)))&&i.focus({preventScroll:!0})}},[l,r,I,w,S]),euy(()=>{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,euq(M,m?n===euB:n===euV,n===euW)&&(euA(t),r?(C.current=euQ(u,x),_(C.current)):i(!0));return}euG(t.key,M)&&(null!=d&&(C.current=d),euA(t),!r&&b?i(!0):P(t),r&&_(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&&_(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&&_(r)}},onPointerLeave(){if(!E.current&&(C.current=-1,L(u,C),_(null),!g)){var t;null==(t=a.floating.current)||t.focus({preventScroll:!0})}}}}}:{}},euX=new Hk("suggestion");function eu0(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=eu0(t[n]))&&(i&&(i+=" "),i+=r);else for(n in t)t[n]&&(i&&(i+=" "),i+=n)}return i}function eu1(){for(var t,n,r=0,i="";r<arguments.length;)(t=arguments[r++])&&(n=eu0(t))&&(i&&(i+=" "),i+=n);return i}let eu2=enO.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",eeU(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),eu4={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"},eu3=()=>(++eu3.i).toString();eu3.i=0;let eu5=t=>{let n=eu6(t),r=[];for(let i=0;i<n.length;i++)r.push(eu7(n[i]));return{key:eu3(),children:r}},eu9=(t,n=[])=>({key:eu3(),type:t.type,text:"text"in t?t.text:void 0,node:t,children:n}),eu8=t=>eu9({type:eu4.span,text:t,spans:[]}),eu6=t=>{let n=t.slice(0);for(let r=0;r<n.length;r++){let i=n[r];if(i.type===eu4.listItem||i.type===eu4.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===eu4.listItem?n[r]={type:eu4.list,items:o}:n[r]={type:eu4.oList,items:o}}}return n},eu7=t=>{if("text"in t)return eu9(t,ese(t.spans,t));if("items"in t){let n=[];for(let r=0;r<t.items.length;r++)n.push(eu7(t.items[r]));return eu9(t,n)}return eu9(t)},ese=(t,n,r)=>{if(!t.length)return[eu8(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,d=n.text.slice(c,l),f=[];for(let p=a;p<i.length;p++){let h=i[p];h!==u&&h.start>=u.start&&h.end<=u.end&&(f.push(h),i.splice(p,1),p--)}0===a&&c>0&&o.push(eu8(n.text.slice(0,c)));let m={...u,text:d};o.push(eu9(m,ese(f,{...n,text:d},u))),l<n.text.length&&o.push(eu8(n.text.slice(l,i[a+1]?i[a+1].start-s:void 0)))}return o},est=(t,n)=>esn(eu5(t).children,n),esn=(t,n)=>{let r=[];for(let i=0;i<t.length;i++){let o=t[i],a=n(o.type,o.node,o.text,esn(o.children,n),o.key);null!=a&&r.push(a)}return r};eu4.listItem,eu4.oListItem,eu4.list,eu4.oList;let esr=enO.create({name:"text",group:"inline"}),esi={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)}},eso={fromPrismic:t=>n=>{switch(n.type){case"hyperlink":return es2.converter.fromPrismic(t)(n);case"em":return es0.converter.fromPrismic(t)(n);case"strong":return eas.converter.fromPrismic(t)(n);default:return}},toPrismic(t,n,r){let i=ecn.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}}},esa=esr.extend({name:"text"}),esu={name:esa.name,component:esa,converter:{fromPrismic:t=>function(n,r,i=!1){let o={type:n,text:r.content.text,spans:r.content.spans||[]};return est([o],function(t,n=!1){return(r,i,o,a)=>{if("span"===r&&o&&o.length)return n?[t.text(o)]:eaI.splitTextToNodes(t,o)(n=>t.text(n));{let u=eso.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=eao.children.reduce(t,(t,n)=>{let r=n.type.name===eaI.name?eaI.converter.toPrismic(n):n.textContent,i=r?t.text+r:t.text,o=t.text.length,a=i.length,u=n.marks.length?eao.marks.map(n,t=>eso.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:[...esi.mergeOverlap(i.spans)].sort((t,n)=>t.type.localeCompare(n.type))},...r}}}};var ess,esc=((ess=esc||{}).LeftToRight="ltr",ess.RightToLeft="rtl",ess);let esl=KE.RichTextNodeType.rtl,esd=ee5.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()}}}),esf={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)}}},esp=eu2.extend({name:"paragraph",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",eeU(this.options.HTMLAttributes,t),0]}}),esh=new eo7([KE.RichTextNodeType.paragraph],esp.name,esp,{fromPrismic:t=>function(n){var r;let i=esu.converter.fromPrismic(t)(esp.name,n);return null==(r=t.nodes[esp.name])?void 0:r.create(esf.fromPrismic(n),i)},toPrismic:t=>esu.converter.toPrismic(t,KE.RichTextNodeType.paragraph,esf.toPrismic(t))},"Type '/' for commands"),esm=esh,esg=["ArrowDown","ArrowUp","End","Home"],esy=["Enter"],esv=["Escape",...esg,...esy],esb=ee5.create({name:"slash-commands",addOptions:()=>({nodeTypes:[]}),addProseMirrorPlugins(){let t=ecc(eci,this.options.nodeTypes);return t.length>1?[function({pluginKey:t=euX,editor:n,char:r="@",allowSpaces:i=!1,allowedPrefixes:o=[" "],startOfLine:a=!1,decorationTag:u="span",decorationClass:s="suggestion",command:c=()=>null,items:l=()=>[],render:d=()=>({}),allow:f=()=>!0}){let p,h=null==d?void 0:d(),m=new HI({key:t,view(){return{update:async(t,r)=>{var i,o,a,u,s,d,f;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,I=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:I,clientRect:I?()=>{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===(d=null==h?void 0:h.onUpdate)||void 0===d||d.call(h,p)),M&&(null===(f=null==h?void 0:h.onStart)||void 0===f||f.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:d}=n.view,{selection:p}=t,{empty:h,from:m}=p,g={...u};if(g.composing=d,l&&(h||n.view.composing)){(m<u.range.from||m>u.range.to)&&!d&&!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}$`),d=u?"^":"",f=o?RegExp(`${d}${c}.*?(?=\\s${c}|$)`,"gm"):RegExp(`${d}(?:^)?${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(f)).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&&f({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?Xz.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===esm.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 eig(esx,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate(n){null==t||t.updateProps(n)},onKeyDown({event:n}){var r;return Boolean(esv.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()}}}})]:[]}}),esx=(0,o.forwardRef)(function({command:t,decorationNode:n,editor:r,items:i},a){var c,l,d,f,p;let[h,m]=(0,o.useState)(!0),g=parseFloat(u.TV.space[0]),{context:y,floating:v,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,d]=o.useState(null),f=eu_(),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}),[d,f]=o.useState(i);eum(d,i)||f(i);let p=o.useRef(null),h=o.useRef(null),m=o.useRef(c),g=eug(u),y=eug(a),[v,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))},[]),I=o.useCallback(()=>{if(!p.current||!h.current)return;let t={placement:n,strategy:r,middleware:d};y.current&&(t.platform=y.current),eup(p.current,h.current,t).then(t=>{let n={...t,isPositioned:!0};_.current&&!eum(m.current,n)&&(m.current=n,b.flushSync(()=>{l(n)}))})},[d,n,r,y]);euh(()=>{!1===s&&m.current.isPositioned&&(m.current.isPositioned=!1,l(t=>({...t,isPositioned:!1})))},[s]);let _=o.useRef(!1);euh(()=>(_.current=!0,()=>{_.current=!1}),[]),euh(()=>{if(v&&M){if(g.current)return g.current(v,M,I);I()}},[v,M,I,g]);let O=o.useMemo(()=>({reference:p,floating:h,setReference:S,setFloating:w}),[S,w]),k=o.useMemo(()=>({reference:v,floating:M}),[v,M]);return o.useMemo(()=>({...c,update:I,refs:O,elements:k,reference:S,floating:w}),[c,I,O,k,S,w])}({placement:a,middleware:u,strategy:s,whileElementsMounted:i}),y=euj(r),v=o.useMemo(()=>({...g.refs,domReference:p}),[g.refs]),x=o.useMemo(()=>({...g,refs:v,dataRef:h,nodeId:c,events:m,open:n,onOpenChange:y,_:{domReference:l}}),[g,c,m,n,y,v,l]);euy(()=>{let t=null==f?void 0:f.nodesRef.current.find(t=>t.id===c);t&&(t.context=x)});let{reference:M}=g,T=o.useCallback(t=>{(euC(t)||null===t)&&(x.refs.domReference.current=t,d(t)),M(t)},[M,x.refs]);return o.useMemo(()=>({...g,context:x,refs:v,reference:T}),[g,v,x,T])}({middleware:[(void 0===(c=g)&&(c=0),{name:"offset",options:c,async fn(t){let{x:n,y:r}=t,i=await eaV(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:d,elements:f}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...b}=l,x=eaN(a),M=eaN(c)===c,T=await (null==d.isRTL?void 0:d.isRTL(f.floating)),S=m||(M||!v?[eaU(c)]:function(t){let n=eaU(t);return[eaB(t),n,eaB(n)]}(c));m||"none"===y||S.push(...function(t,n,r,i){let o=eak(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[]}}(eaN(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 eaA(t,b),I=[],_=(null==(n=u.flip)?void 0:n.overflows)||[];if(p&&I.push(w[x]),h){let{main:O,cross:k}=function(t,n,r){void 0===r&&(r=!1);let i=eak(t),o=eaj(t),a=eaC(o),u="x"===o?i===(r?"end":"start")?"right":"left":"start"===i?"bottom":"top";return n.reference[a]>n.floating[a]&&(u=eaU(u)),{main:u,cross:eaU(u)}}(a,s,T);I.push(w[O],w[k])}if(_=[..._,{placement:a,overflows:I}],!I.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:_},reset:{placement:N}};let j=null==(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=_.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{}}}),(f={limiter:(void 0===d&&(d={}),{options:d,fn(t){let{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:u=0,mainAxis:s=!0,crossAxis:c=!0}=d,l={x:n,y:r},f=eaj(i),p=ea$(f),h=l[f],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"===f?"height":"width",b=o.reference[f]-o.floating[v]+y.mainAxis,x=o.reference[f]+o.reference[v]-y.mainAxis;h<b?h=b:h>x&&(h=x)}if(c){var M,T;let S="y"===f?"width":"height",w=["top","left"].includes(eaN(i)),I=o.reference[p]-o.floating[S]+(w&&(null==(M=a.offset)?void 0:M[p])||0)+(w?0:y.crossAxis),_=o.reference[p]+o.reference[S]+(w?0:(null==(T=a.offset)?void 0:T[p])||0)-(w?y.crossAxis:0);m<I?m=I:m>_&&(m=_)}return{[f]:h,[p]:m}}})},{name:"shift",options:f,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}=f,c={x:n,y:r},l=await eaA(t,s),d=eaj(eaN(i)),p=ea$(d),h=c[d],m=c[p];if(o){let g=h+l["y"===d?"top":"left"],y=h-l["y"===d?"bottom":"right"];h=eaF(g,h,y)}if(a){let v=m+l["y"===p?"top":"left"],b=m-l["y"===p?"bottom":"right"];m=eaF(v,m,b)}let x=u.fn({...t,[d]:h,[p]:m});return{...x,data:{x:x.x-n,y:x.y-r}}}})],onOpenChange:m,open:h,placement:"top-start",strategy:"fixed",whileElementsMounted:euf});(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,I]=(0,o.useState)(0),_=(0,o.useRef)([]);(0,s.pQ)(i,()=>{I(0),_.current=[]});let{getFloatingProps:O,getItemProps:k,getReferenceProps:C}=(p=[euz(y,{outsidePointerDown:!1}),euJ(y,{activeIndex:w,listRef:_,onNavigate(t){I(n=>t??n)},openOnArrowKeyDown:!1,virtual:!0}),euP(y,{role:"menu"})],{getReferenceProps:t=>euE(t,p,"reference"),getFloatingProps:t=>euE(t,p,"floating"),getItemProps:t=>euE(t,p,"item")}),j=C().onKeyDown;(0,o.useImperativeHandle)(a,()=>({handleKeyDown(n){if(!h)return!1;if(esg.includes(n.key)&&j(n),esy.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?N.jsxs("div",{...O(),className:u._s.content,ref:v,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)(esM,{...k({onClick(){t(n)},onPointerDown(t){t.preventDefault()}}),"data-highlighted":r===w?"":void 0,id:`${E}[${r}]`,key:n.nodeType,ref(t){_.current[r]=t},shortcut:`/${n.shortText??""}`,startIcon:n.icon},n.text)),0===i.length?N.jsx(esM,{...k({onPointerDown(t){t.preventDefault()}}),disabled:!0,id:`${E}[0]`,ref(t){_.current[0]=t},children:"No results"}):null]}):null}),esM=(0,o.forwardRef)(function({children:t,disabled:n,shortcut:r,startIcon:i,...a},s){return N.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:eu1(i.props.className,u._s.itemStartIcon)}):null,N.jsx(u.xv,{className:eu1(u._s.itemText,u._s.itemTextColor.grey),component:"span",children:t}),r?N.jsx(u.xv,{className:u._s.itemShortcut,color:"inherit",component:"span",variant:"inherit",children:r}):null]})}),esT=eaf.extend({name:"bulletList",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",eeU(this.options.HTMLAttributes,t),0]}}).configure({itemTypeName:"listItem"}),esS=new ean([KE.RichTextNodeType.list],esT.name,esT,{fromPrismic:t=>function(n){var r;let i=eag.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[esT.name])?void 0:r.create(esf.fromPrismic(n),i)},toPrismic:t=>eao.children.map(t,t=>eag.converter.toPrismic(t,KE.RichTextNodeType.list).filter(l.$)).flat()}),esw=esS,esI=/^```([a-z]+)?[\s\n]$/,es_=/^~~~([a-z]+)?[\s\n]$/,esO=enO.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",eeU(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[enw({find:esI,type:this.type,getAttributes:t=>({language:t[1]})}),enw({find:es_,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new HI({key:new Hk("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(Hd.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}}})]}}),esk=esO.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",eeU(this.options.HTMLAttributes),["code",t,0]]}}).configure({exitOnTripleEnter:!1}),esC=new eo7([KE.RichTextNodeType.preformatted],esk.name,esk,{fromPrismic:t=>function(n){var r;let i=esu.converter.fromPrismic(t)(esk.name,n,!0);return null==(r=t.nodes[esk.name])?void 0:r.create(esf.fromPrismic(n),i)},toPrismic:t=>esu.converter.toPrismic(t,KE.RichTextNodeType.preformatted,esf.toPrismic(t))},"",!0);function esN(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 esj(t){let n=(0,o.useRef)(null),r=(0,o.useRef)(null),{onKeyDown:i,url:a,urlChanged:c,onContentChange:l,debouncedUrl:d,content:f}=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:d}=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&&eib(()=>{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:d,url:c.value,urlChanged:function(t){c.set(t),(0,h.ju)(t)||l(void 0)},onContentChange:l,debouncedUrl:c.debouncedValue,content:t.node.attrs.content}}(t,n,r),{selected:p}=esN(t);return N.jsx(eim,{className:"custom-embed",children:N.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:N.jsxs(u.xu,{flexDirection:"column",children:[N.jsxs(u.xu,{flexGrow:1,alignItems:"center",children:[N.jsx(u.I5,{size:"small",name:"cloud",color:"grey11"}),N.jsx(u.xu,{flexGrow:1,flexDirection:"column",ref:r,children:N.jsx(u.oi,{id:"id",ref:n,value:a,variant:(0,h.ju)(a)?"link":"normal",placeholder:"Paste your link here",onValueChange:c,onKeyDown:i})})]}),(0,h.ju)(a)&&N.jsx(eix,{selected:p,debouncedUrl:d,onContentChange:l,content:f})]})})})}let esE=enO.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:()=>eiv(esj)}),esR=new class{constructor(t,n,r,i){S(this,"extType","node"),S(this,"nodeType","embed"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}([KE.RichTextNodeType.embed],esE.name,esE,{fromPrismic:t=>function(n){var r;return null==(r=t.nodes[esE.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}}}),esD=enO.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]}`,eeU(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=>enw({find:RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),esA="heading";function esL(t){switch(t){case 1:return KE.RichTextNodeType.heading1;case 2:return KE.RichTextNodeType.heading2;case 3:return KE.RichTextNodeType.heading3;case 4:return KE.RichTextNodeType.heading4;case 5:return KE.RichTextNodeType.heading5;case 6:return KE.RichTextNodeType.heading6}}function esP(t){return{fullName:esL(t),level:t}}let esF=[1,2,3,4,5,6];function esz(t,n=esF){let r=RegExp(`^heading([${n.join(",")}]){1}$`),i=t.match(r);if(!i||!i[1])return;let o=parseInt(i[1]);return{fullName:esL(o),level:o}}function esU(t,n){let r=t.level;if(n.includes(r))return{fullName:esL(r),level:r}}let esW=t=>{let n=t[0]??1;return{fromPrismic:r=>function(i){var o;let a=esu.converter.fromPrismic(r)(esA,i),u=esz(i.type,t)||esP(n);return null==(o=r.nodes[esA])?void 0:o.create({level:u.level,...esf.fromPrismic(i)},a)},toPrismic(r){let{fullName:i}=esU(r.attrs,t)||esP(n);return esu.converter.toPrismic(r,i,esf.toPrismic(r))}}},esB={name:esA,build(t){var n,r;let i=t?t.size?Array.from(t.values()).reduce((t,n)=>{let r=esz(n);return r?[...t,r.level]:t},[]).sort((t,n)=>t-n):[]:esF;if(!i)return;let o=i.map(t=>esL(t));return new eat(o,esD.extend({name:"heading"}).configure({levels:i}),i,esW(i),t=>{let n=esU(t,i);return n&&`Heading ${n.level}`})}};function esV(t){let{node:n}=t,r=n.attrs.content,{selected:i}=esN(t),a={width:null==r?void 0:r.width,height:null==r?void 0:r.height,name:eij},{onMediaSelected:s,onCropperDialogClose:c,isUpdating:l,updateContent:d,onClear:f}=function(t){let{content:n,thumbnail:r,imageViewProps:{getPos:i,updateAttributes:a,editor:u,node:s}}=t,[c,l]=(0,o.useTransition)();function d(t){l(()=>a({content:t}))}return{onMediaSelected:function(t){let r=eou(t),o=i()+s.nodeSize;d({__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=eoe({content:n,thumbnail:r.name,croppedImage:i});o!==n&&d(o)},isUpdating:c,updateContent:d,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:eiE(a,r,r)};return N.jsx(eim,{className:"custom-image",children:N.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:N.jsx(eoa,{content:r,selected:i,fieldLabel:"Feature image",imageLabel:h,initialImages:[g],readOnly:!1,onMediaSelected:s,onCropperDialogClose:c,onClear:f,children:N.jsx(o.Suspense,{fallback:es$,children:null!=r&&r.url?N.jsxs(u.aY,{children:[N.jsx(u.hM,{children:N.jsx(u.xu,{flexDirection:"column",alignItems:"center",position:"relative",height:400,children:N.jsx(u.xu,{justifyContent:"center",flexGrow:1,maxHeight:"100%",maxWidth:"100%",children:N.jsx(u.kg,{src:eiA(r.url),alt:m,sizing:"contain"})})})}),N.jsx(ei6,{onValueChange(t){d({...r,alt:t})},altText:m,readOnly:!r,selected:i})]}):N.jsx(ei8,{isUpdating:l,readOnly:!1,onMediaSelected:s})})})})})}let es$=N.jsx("div",{style:{height:468}}),esK=enO.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",eeU(t)],addNodeView:()=>eiv(esV)}),esY=new class{constructor(t,n,r,i){S(this,"extType","node"),S(this,"nodeType","image"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}([KE.RichTextNodeType.image],esK.name,esK,{fromPrismic:t=>function(n){var r;return null==(r=t.nodes[esK.name])?void 0:r.create({content:n.data})},toPrismic(t){if(void 0!==t.attrs.content)return{type:"image",data:{...t.attrs.content}}}}),esq=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,esG=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,esZ=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,esQ=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,esH=en_.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",eeU(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[enS({find:esq,type:this.type}),enS({find:esZ,type:this.type})]},addPasteRules(){return[enC({find:esG,type:this.type}),enC({find:esQ,type:this.type})]}}),esJ=esH.extend({name:"em"}),esX=new class{constructor(t,n,r){S(this,"extType",eo8.Mark),S(this,"richTextNodeTypes",KE.RichTextNodeType.em),this.name=t,this.component=n,this.converter=r}}(esJ.name,esJ,{fromPrismic:t=>function(){var n;return null==(n=t.marks[esJ.name])?void 0:n.create()},toPrismic(){}}),es0=esX,es1=en_.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",eeU(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=es4(eoN({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()}}}),es2=new class{constructor(t,n,r){S(this,"extType",eo8.Mark),S(this,"richTextNodeTypes",KE.RichTextNodeType.hyperlink),this.name=t,this.component=n,this.converter=r}}(es1.name,es1,{fromPrismic:t=>function(n){var r,i,o,a;let u=n.data;if("DocumentLink"===u.__TYPE__){let s={type:es1.name,id:u.id};return null==(r=t.marks[es1.name])?void 0:r.create(s)}if("ImageLink"===u.__TYPE__){let c={type:es1.name,media:es4(u)};return null==(i=t.marks[es1.name])?void 0:i.create(c)}if("FileLink"===u.__TYPE__){let l={type:es1.name,media:es4(u)};return null==(o=t.marks[es1.name])?void 0:o.create(l)}if("ExternalLink"===u.__TYPE__){let d={type:es1.name,url:u.url,href:u.url,target:u.target};return null==(a=t.marks[es1.name])?void 0:a.create(d)}},toPrismic:t=>t.attrs.media?es3(t.attrs.media):t.attrs.id?{__TYPE__:"DocumentLink",id:t.attrs.id}:{__TYPE__:"ExternalLink",url:t.attrs.href,target:t.attrs.target}});function es4(t){return JSON.stringify(t)}function es3(t){return JSON.parse(t)}let es5=enO.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",eeU(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)}}}),es9=en_.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",eeU(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:n})=>{let r=etJ(t,this.type);return!!Object.entries(r).some(([,t])=>!!t)||n.unsetMark(this.name)}}}}),es8=/^(\d+)\.\s$/,es6=enO.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",eeU(this.options.HTMLAttributes,r),0]:["ol",eeU(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(es5.name,this.editor.getAttributes(es9.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=enI({find:es8,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=enI({find:es8,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(es9.name)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[t]}}),es7=es6.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",eeU(this.options.HTMLAttributes,r),0]:["ol",eeU(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"}),ece=new ean([KE.RichTextNodeType.orderedList],es7.name,es7,{fromPrismic:t=>function(n){var r;let i=eag.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[es7.name])?void 0:r.create(esf.fromPrismic(n),i)},toPrismic:t=>eao.children.map(t,t=>eag.converter.toPrismic(t,KE.RichTextNodeType.orderedList).filter(l.$)).flat()}),ect=ece,ecn=[eas,es0,es2];function ecr(t){return[esm,esw,ect,esB.build(t),esC,esR,esY,...ecn].filter(l.$)}let eci=[{nodeType:KE.RichTextNodeType.paragraph,icon:"textFields",isActive:t=>t.isActive(esm.name)&&!t.isActive(esw.name)&&!t.isActive(ect.name),runCommands:ecu((t,n)=>t.clearNodes().setDirection(ecs(n))),shortText:"par",text:"Paragraph"},{nodeType:KE.RichTextNodeType.heading1,icon:"looks1",isActive:t=>t.isActive(esB.name,{level:1}),runCommands:ecu((t,n)=>t.setHeading({level:1}).setDirection(ecs(n))),shortText:"h1",text:"Heading 1"},{nodeType:KE.RichTextNodeType.heading2,icon:"looks2",isActive:t=>t.isActive(esB.name,{level:2}),runCommands:ecu((t,n)=>t.setHeading({level:2}).setDirection(ecs(n))),shortText:"h2",text:"Heading 2"},{nodeType:KE.RichTextNodeType.heading3,icon:"looks3",isActive:t=>t.isActive(esB.name,{level:3}),runCommands:ecu((t,n)=>t.setHeading({level:3}).setDirection(ecs(n))),shortText:"h3",text:"Heading 3"},{nodeType:KE.RichTextNodeType.heading4,icon:"looks4",isActive:t=>t.isActive(esB.name,{level:4}),runCommands:ecu((t,n)=>t.setHeading({level:4}).setDirection(ecs(n))),shortText:"h4",text:"Heading 4"},{nodeType:KE.RichTextNodeType.heading5,icon:"looks5",isActive:t=>t.isActive(esB.name,{level:5}),runCommands:ecu((t,n)=>t.setHeading({level:5}).setDirection(ecs(n))),shortText:"h5",text:"Heading 5"},{nodeType:KE.RichTextNodeType.heading6,icon:"looks6",isActive:t=>t.isActive(esB.name,{level:6}),runCommands:ecu((t,n)=>t.setHeading({level:6}).setDirection(ecs(n))),shortText:"h6",text:"Heading 6"},{nodeType:KE.RichTextNodeType.list,icon:"formatListBulleted",isActive:t=>t.isActive(esw.name),runCommands:ecu((t,n)=>t.toggleBulletList().setDirection(ecs(n))),shortText:"bull",text:"Bulleted list"},{nodeType:KE.RichTextNodeType.orderedList,icon:"formatListNumbered",isActive:t=>t.isActive(ect.name),runCommands:ecu((t,n)=>t.toggleOrderedList().setDirection(ecs(n))),shortText:"num",text:"Numbered list"},{nodeType:KE.RichTextNodeType.preformatted,icon:"dataObject",isActive:t=>t.isActive(esC.name),runCommands:ecu((t,n)=>t.setCodeBlock().setDirection(ecs(n))),shortText:"code",text:"Code"},{nodeType:KE.RichTextNodeType.embed,icon:"cloud",isActive:t=>t.isActive(esR.name),runCommands:ecu(t=>t.setEmbed()),shortText:"emb",text:"Embed"},{nodeType:KE.RichTextNodeType.image,icon:"image",isActive:t=>t.isActive(esY.name),runCommands:ecu(t=>t.setImage()),shortText:"img",text:"Image"}],eco=[{nodeType:KE.RichTextNodeType.strong,icon:"formatBold",isActive:t=>t.isActive(eas.name),runCommands:ecu(t=>t.toggleBold())},{nodeType:KE.RichTextNodeType.em,icon:"formatItalic",isActive:t=>t.isActive(es0.name),runCommands:ecu(t=>t.toggleItalic())}],eca=[{nodeType:KE.RichTextNodeType.rtl,icon:"formatTextDirectionRToL",isActive:t=>t.isActive({dir:esc.RightToLeft}),runCommands:ecu((t,n)=>t.toggleDirection(ecs(n)))}];function ecu(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 ecs(t){let n=t.state.selection.$from.parent.attrs;return esf.parseNodeAttrsDirection(n)}function ecc(t,n){return t.filter(t=>n.includes(t.nodeType))}function ecl(t){let{items:n,editor:r}=t;return 0===n.length?null:N.jsxs(N.Fragment,{children:[N.jsx(u.Jf,{}),n.map(t=>N.jsx(u.r8,{disabled:!t.runCommands(r,{can:!0}),onPressedChange(){t.runCommands(r)},pressed:t.isActive(r),startIcon:t.icon},t.nodeType))]})}function ecd(t){let{disabled:n,showWebLinkModal:r,showDocumentsLinkModal:i,showMediaLinkModal:o}=function(t){let{editor:n,setModal:r}=t;return{disabled:!ecu(t=>t.setWebLink({href:""}))(n,{can:!0}),showWebLinkModal:function(){r("webLink")},showDocumentsLinkModal:function(){r("documentLink")},showMediaLinkModal:function(){r("mediaLink")}}}(t);return N.jsxs(N.Fragment,{children:[N.jsx(u.Jf,{}),N.jsxs(u.yM,{density:"compact",children:[N.jsx(u.hA,{disabled:n,startIcon:"link",onClick:r},KE.RichTextNodeType.hyperlink),N.jsxs(u.h_,{children:[N.jsx(u.$F,{children:N.jsx(u.hA,{startIcon:"arrowDropDown"})}),N.jsxs(u.AW,{align:"end",asPortal:!1,children:[N.jsx(u.Xi,{startIcon:N.jsx(u.I5,{name:"public"}),onSelect:r,children:"Link to web page"}),N.jsx(u.Xi,{startIcon:N.jsx(u.I5,{name:"description"}),onSelect:i,children:"Link to document"}),N.jsx(u.Xi,{startIcon:N.jsx(u.I5,{name:"image"}),onSelect:o,children:"Link to media"})]})]})]})]})}function ecf(t){let{docId:n,onEdit:r,onUnlink:i}=t,o=function(t){let n=tC();n.searchDocuments||tj("searchDocuments");let{coreApiUrl:r,env:i}=n;return(0,f.QT)(y.EK,[r,i,t])}(n),a=tC();if(!o)return null;let s=o.versions[0],c=(0,g.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)??"",d=(null==s?void 0:s.custom_type_label)??"";return N.jsx(u.oZ,{url:c,title:o.title,subTitle:d,description:l,onEdit:r,onUnlink:i,largeIconName:"description"})}function ecp(t){let{editor:n}=t,{searchDocuments:r}=tC(),i=n.getAttributes(KE.RichTextNodeType.hyperlink);if(i.id&&r){let o=i.id;return N.jsx(ech,{docId:o,...t})}if(i.href){let a=i.href;return N.jsx(ecm,{url:a,...t})}if(i.media){let u=es3(i.media);return N.jsx(ecg,{media:u,...t})}return null}function ech(t){let{editor:n,onEditDocumentLink:r,docId:i}=t;return N.jsx(u.SV,{renderError:()=>N.jsx(u.oZ,{url:"",title:"Failed to Load Linked Document Data",subTitle:"",error:!0,onEdit:r,onUnlink:()=>ecy(n)}),children:N.jsx(o.Suspense,{fallback:N.jsx(u.oZ,{url:"",title:"",subTitle:"",loading:!0,onEdit:r,onUnlink:()=>ecy(n)}),children:N.jsx(ecf,{docId:i,onEdit:r,onUnlink:()=>ecy(n)})})})}function ecm(t){let{url:n,editor:r,onEditWebLink:i}=t,o=(0,h.ju)(n);return o?N.jsx(u.oZ,{url:n,title:(0,h.S$)(o),subTitle:n,onEdit:i,onUnlink:()=>ecy(r)}):N.jsx(u.oZ,{url:n,title:"",subTitle:n,onEdit:i,onUnlink:()=>ecy(r)})}function ecg(t){let{media:n,editor:r,onEditMediaLink:i}=t;return"ImageLink"===n.__TYPE__?N.jsx(u.Qi,{url:n.url,title:n.name,subTitle:`${n.width} x ${n.height} pixels`,onEdit:i,onUnlink:()=>ecy(r)}):"FileLink"===n.__TYPE__?N.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:()=>ecy(r),largeIconName:"insertDriveFile"}):null}function ecy(t){ecu(t=>t.unsetLink())(t)}function ecv(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){ecu(n=>n.extendMarkRange(KE.RichTextNodeType.hyperlink).setDocumentLink({id:t}))(n),r(!1)},onOpenChange:i}}(t);return N.jsx(eox,{open:n,onOpenChange:r,onSelectDocument:i})}function ecb(t){let{open:n}=t,{onOpenChange:r,onMediaSelected:i}=function(t){let{editor:n,setOpen:r}=t;return{onMediaSelected:function(t){ecu(n=>n.extendMarkRange(KE.RichTextNodeType.hyperlink).setMediaLink({media:t}))(n),r(!1)},onOpenChange:r}}(t);return eiY()?N.jsx(eiK,{open:n,setIsOpen:r,onMediaSelected:i,assetType:"all"}):N.jsx(ei5,{open:n,onOpenChange:r,onMediaSelected:i})}function ecx(t){let{open:n}=t,{url:r,setUrl:i,onOpenChange:a,onKeyDown:s,openInNewTab:c,setOpenInNewTab:l,onSetUrl:d,selectionUrl:f,selectionUrlTitle:p}=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(KE.RichTextNodeType.hyperlink);return n.href?n.href:void 0}(r),d=(n=r,"_blank"===n.getAttributes(KE.RichTextNodeType.hyperlink).target);(0,o.useEffect)(()=>{u(l??"")},[l]),(0,o.useEffect)(()=>{c(d??!1)},[d]);let f=l?(0,h.ju)(l):void 0,p=f?(0,h.S$)(f):"";function m(t){let n=s?"_blank":"_self";ecu(r=>r.extendMarkRange(KE.RichTextNodeType.hyperlink).setWebLink({href:t,target:n}))(r),i(!1)}return{url:a,setUrl:u,onSetUrl:m,selectionUrl:l,selectionUrlTitle:p,openInNewTab:s,selectionOpenInNewTab:d,setOpenInNewTab:c,onKeyDown:function(t){"Enter"===t.key&&m(a)},onOpenChange:function(t){u(""),c(!1),i(t)}}}(t);return N.jsx(u.Vq,{open:n,onOpenChange:a,hasClose:!1,size:"small",children:N.jsx(u.cZ,{children:N.jsxs(u.xu,{flexDirection:"column",children:[N.jsxs(u.xu,{flexDirection:"column",height:"100%",padding:16,gap:4,children:[N.jsx(u.yt,{value:r,onValueChange:i,placeholder:"Paste URL",icon:"public",onKeyDown:s}),f&&N.jsxs(u.xu,{flexDirection:"column",padding:{top:8},gap:4,children:[N.jsx(u.xv,{variant:"smallBold",color:"grey11",children:"Linked to"}),N.jsxs(u.xu,{backgroundColor:"grey4",borderRadius:6,padding:8,alignItems:"center",gap:8,children:[N.jsx(u.pI,{largeIconName:"public",smallIconName:"link"}),N.jsxs(u.xu,{flexDirection:"column",children:[N.jsx(u.xv,{variant:"bold",color:"grey12",children:p}),N.jsx(u.xv,{color:"grey11",variant:"small",children:"Web page"})]})]})]})]}),r&&N.jsxs(u.xu,{flexDirection:"column",padding:{block:8},border:{top:!0},children:[N.jsx(u.UN,{onSelect:()=>l(!c),icon:c?"checkBox":"checkBoxOutlinedBlank",textContent:"Open in new tab"}),N.jsx(u.UN,{onSelect:()=>d(r),icon:"link",textContent:"Link to URL"})]})]})})})}function ecM(t){let{items:n,editor:r}=t;return 0===n.length?null:N.jsxs(N.Fragment,{children:[N.jsx(u.Jf,{}),N.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=>N.jsx(u.nG,{disabled:!t.runCommands(r,{can:!0}),startIcon:t.icon,value:t.nodeType},t.nodeType))},"mark")]})}function ecT(t){var n;let{items:r,editor:i}=t;return 0===r.length?null:N.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=>N.jsx(u.KG,{value:t.nodeType,children:t.text},t.nodeType))})}let ecS={duration:100,hideOnClick:!0,offset:[-48,8],placement:"top-start",zIndex:30};function ecw(t){let{editor:n,nodeTypes:r}=t,[i,a]=(0,o.useState)(),u=r.includes(KE.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(KE.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});return N.jsxs(N.Fragment,{children:[N.jsx(eis,{editor:n,tippyOptions:ecS,shouldShow:c,children:s&&N.jsx(ecI,{...t,setModal:a})}),N.jsx(eis,{editor:n,tippyOptions:ecS,shouldShow:l,children:s&&N.jsx(ecp,{editor:n,onEditWebLink:()=>a("webLink"),onEditDocumentLink:()=>a("documentLink"),onEditMediaLink:()=>a("mediaLink")})}),u&&N.jsxs(N.Fragment,{children:[N.jsx(ecx,{open:"webLink"===i,setOpen:function(t){a(t?"webLink":void 0)},editor:n}),N.jsx(ecv,{open:"documentLink"===i,setOpen:function(t){a(t?"documentLink":void 0)},editor:n}),N.jsx(ecb,{open:"mediaLink"===i,setOpen:function(t){a(t?"mediaLink":void 0)},editor:n})]})]})}function ecI(t){let{editor:n,nodeTypes:r}=t,i=r.includes("hyperlink"),o=ecc(eci,r),a=ecc(eco,r),s=ecc(eca,r),c=o.length+a.length+s.length+Number(i);return 0===c?null:N.jsxs(u.o8,{children:[N.jsx(ecT,{items:o,editor:n}),N.jsx(ecM,{items:a,editor:n}),i&&N.jsx(ecd,{...t}),N.jsx(ecl,{items:s,editor:n}),c>1&&N.jsxs(N.Fragment,{children:[N.jsx(u.Jf,{}),N.jsx(u.hA,{onClick(){n.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:"formatClear"},"clear")]})]})}function ec_(t){var n;let{content:r,field:i,id:a,readOnly:c}=t,d=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 eaa();let r=function(t){let n=(t.single||t.multi||"").split(/\s*,\s*/).map(t=>{let n=KE.RichTextNodeTypeCodec.decode(t);return"Right"===n._tag?n.right:void 0}).filter(l.$);return new Set(n)}(t);if(!(null!=r&&r.size))return eaa();let i=(n=r,ecr(n).filter(t=>(0,v.G)(n,n=>t.richTextNodeTypes.includes(n)))),o=function(t){let n=new Set(t);return(0,v.G)(n,ear)&&n.add(esm),(0,v.G)(n,eae)||n.add(esm),[...n]}(i);return{extensions:o,defaultTextConverter:function(t){let n=t.find(eae)??esm;return function(t){return r=>n.converter.fromPrismic(t)({...r,type:n.richTextNodeTypes[0]??"heading1"})}}(o)}}(t.config),i=n.filter(ecO),o=n.flatMap(t=>t.richTextNodeTypes),a=n.map(t=>t.component),u=n.filter(eck).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===eo6.Text&&(t[n.name]=n.placeholder),t),{})),unfocusedPlaceholder:null==(r=t.config)?void 0:r.placeholder,nodeExtensions:n},s=a.includes(KE.RichTextNodeType.orderedList)||a.includes(KE.RichTextNodeType.list);return[eax.component((null==(i=t.config)?void 0:i.single)===void 0),esu.component,eaI.component,eaO(u),s?eag.component:void 0,esb.configure({nodeTypes:a})].filter(l.$)}(t,i),esd.configure({supportedExtensionNames:u}),eoX],c=s.map(t=>t.name),d=function(t,n){let r=ee2.resolve(t);return eeY(r,void 0)}(s);return{allComponents:s,extensionNames:c,defaultTextConverter:r,nodeExtensions:i,names:o,schema:d}},[i])}(i),f=r&&eax.converter(d.nodeExtensions).fromPrismic(d.schema,null==(n=d.defaultTextConverter)?void 0:n.call(d,d.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 eic(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==f?void 0:f.toJSON(),editable:!c,editorProps:{attributes:{class:u.rk,id:a,tabIndex:"0"}},extensions:d.allComponents,injectCSS:!1,onUpdate({editor:t}){if(t.isEmpty)return p(void 0);let n=eax.converter(d.nodeExtensions).toPrismic(t.state.doc);p(n)}},[d,c]);return N.jsxs(u.gN,{children:[N.jsx(u.Qy,{htmlFor:a,children:ZA(i)}),N.jsxs(u.JO,{children:[N.jsx(eif,{editor:h??null,style:{flex:1}}),(null==h?void 0:h.isEditable)&&N.jsx(ecw,{editor:h,nodeTypes:d.names.concat(esl)})]})]})}function ecO(t){return t.extType===eo8.Node}function eck(t){return!(t.extType!==eo8.Node||t.nodeType!==eo6.Text||t.lockedFormat)}function ecC(t){var n,r,i,o,a;let{content:s,field:c,id:l,onContentChange:d,readOnly:f}=t,p=ZL(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 N.jsxs(u.gN,{children:[N.jsx(u.fw,{name:"arrowDropDownCircle"}),N.jsx(u.Qy,{htmlFor:l,children:ZA(c)}),N.jsx(u.JO,{children:N.jsx(u.Ph,{id:l,size:"large",color:"grey",value:m,renderTrigger:()=>N.jsx(u.JF,{id:l,placeholder:p}),onValueChange(t){var n;f||d((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=>N.jsx(u.Ql,{value:t,children:t},t))})})]})}function ecN(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 N.jsxs(u.gN,{children:[N.jsx(u.fw,{name:"event"}),N.jsx(u.Qy,{id:n,children:ZA(i)}),N.jsx(u.JO,{children:N.jsx(u.xu,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:N.jsx(u.Wr,{mode:"date-time","aria-labelledby":n,disabled: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 ecj(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?N.jsx(ZP,{...t,field:a,content:nA.isBooleanContent(i)?i:void 0}):"Date"===a.type?N.jsx(Zz,{...t,field:a,content:nA.isDateContent(i)?i:void 0}):"Timestamp"===a.type?N.jsx(ecN,{...t,field:a,content:nA.isTimestampContent(i)?i:void 0}):"Image"===a.type?N.jsx(eos,{...t,field:a,content:nA.isImageContent(i)?i:void 0}):"Link"===a.type?N.jsx(eoj,{...t,field:a,content:nA.isLinkContent(i)?i:void 0}):"Number"===a.type?N.jsx(eoA,{...t,field:a,content:nA.isNumberContent(i)?i:void 0}):"StructuredText"===a.type?N.jsx(ec_,{...t,field:a,content:nA.isRichTextContent(i)?i:void 0}):"Select"===a.type?N.jsx(ecC,{...t,field:a,content:nA.isSelectContent(i)?i:void 0}):"Text"===a.type?N.jsx(eol,{...t,field:a,content:nA.isTextContent(i)?i:void 0}):"Embed"===a.type?N.jsx(eiI,{...t,field:a,content:nA.isEmbedContent(i)?i:void 0}):"Color"===a.type?N.jsx(ZF,{...t,field:a,content:nA.isColorContent(i)?i:void 0}):"GeoPoint"===a.type?N.jsx(eiN,{...t,field:a,content:nA.isGeoPointContent(i)?i:void 0}):null},[i,n,a,u,r])}function ecE(t){let{content:n,id:r,nonRepeatableZone:i,onContentChange:u,readOnly:s}=t,c=(0,o.useMemo)(()=>Object.entries(i),[i]);return N.jsx(N.Fragment,{children:c.map(([t,i])=>{let o=n[t];return N.jsx(ecj,{id:`${r}.${t}`,readOnly:s,nestableWidget:i,content:nA.isNestableContent(o)?o:void 0,onContentChange(r){var i,o,s;u((i=n,o=t,s=r,s?{...i,[o]:s}:(0,a.ud)(i,o)))}},t)})})}function ecR(t){let{id:n,title:r,content:i,onContentChange:a,readOnly:s,repeatable:c=!0,repeatableZone:l}=t,d=(0,o.useMemo)(()=>Object.entries(l),[l]),f=i??[ecD];!c&&f.length>1&&(f=f.slice(0,1));let p=(0,o.useRef)(new Map);function h(t){return p.current.get(t)??"!bugged!"}function g(t){let{index:n,offset:r}=t;a((0,m.pB)(f,n,n+r))}function y(t){let{index:n}=t;a((0,m.$E)(f,n))}return!function(t,n){let r=new Set(n);n.forEach(n=>{t.has(n)||t.set(n,(0,x.d)())}),(0,o.useLayoutEffect)(()=>{for(let[n]of t)r.has(n)||t.delete(n)})}(p.current,f),0===Object.keys(l).length?null:N.jsx(u.ZA,{title:"Repeatable zone"+(r?` • ${r}`:""),addItemButtonTitle:"Add item in group",items:f,maxItems:c?void 0:1,getItemKey:h,onAddItem:function(){a(f.concat(ecA()))},children(t,r){let i=new Map(t.value),o=h(t);return N.jsx(u.MN,{index:r,title:"Item",onMove:g,onDelete:y,children:d.map(([u,c])=>{let l=i.get(u),d=nA.isNestableContent(l)?l:void 0;return N.jsx(ecj,{id:`${n}[${o}].${u}`,content:d,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 ecA(o)}let a=Array.from(new Map(t.value).set(r,i));return ecA(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)})(p.current,t,o),a(u)})(t,r,u,n),readOnly:s},u)})})}})}let ecD={__TYPE__:"GroupItemContent",value:[]};function ecA(t=[]){return{__TYPE__:"GroupItemContent",value:t}}function ecL(t){var n,r,i,a;let{config:s,content:c,sliceKey:l,readOnly:d=!1,sharedSlice:f,onContentChange:p,...h}=t,m=(n=f,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:d},{selected:v,selectionId:b,selection:x}=function(t){let{sliceKey:n}=t||{},r=(0,o.useContext)(ZD),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:N.jsx(tk.Provider,{value:s,children:N.jsxs(u.C3,{id:b,selected:v,onFocus:M,children:[N.jsx(u.ax,{children:(i=f,a=m,[i.name,a.name].join(" • "))}),N.jsxs(u.En,{heightEstimate:400,box:{gap:u.jM},children:[N.jsx(ecE,{...y,nonRepeatableZone:m.primary??{},content:c.primary,onContentChange(t){p({...c,primary:t})}}),N.jsx(ecR,{...y,repeatableZone:m.items??{},content:c.items,onContentChange(t){p({...c,items:t})}})]})]})})}(0,o.createContext)({editedUID:!1,onEditUID(){}})}}]);
|