slice-machine-ui 1.23.2-beta.9 → 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/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-9928a9413d9f0730.js +0 -1
- package/out/_next/static/chunks/904-1ff7519adece2b55.js +0 -1
- package/out/_next/static/chunks/pages/_app-9448839a9d20924d.js +0 -432
- package/out/_next/static/chunks/pages/changes-92c84f6cac0285fd.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-fecb771f91e70853.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/sysU54bHKiGDh8pmVpi41/_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/{sysU54bHKiGDh8pmVpi41 → 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
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[851],{71463:function(t,n,r){r.d(n,{kS:function(){return elA}});var i,o=r(2784),a=r(98863),u=r(22715),s=r(74217),l=r(50054),c=r(86579),d=r(53429),f=r(87322),p=r(1611),h=r(661),m=r(17329),g=r(47124),y=r(77252),v=r(16247),b=r(52393),x=r(28316),_=r(87598),S=Object.defineProperty,T=(t,n,r)=>n in t?S(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,w=(t,n,r)=>(T(t,"symbol"!=typeof n?n+"":n,r),r);let O={unclassified:{title:"Draft",color:"amber"},published:{title:"Live",color:"green"},release:{title:"Planned",color:"purple"},archived:{title:"Archived",color:"grey"}};var k="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{};function C(t){if(t.__esModule)return t;var n=t.default;if("function"==typeof n){var r=function t(){if(this instanceof t){var r=[null];return r.push.apply(r,arguments),new(Function.bind.apply(n,r))}return n.apply(this,arguments)};r.prototype=n.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var I,M={},R={get exports(){return M},set exports(e){M=e}},E={};function j(){return M.jsx(u.xu,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:"grey3",children:M.jsxs(u.R$,{children:[M.jsx(u.av,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),M.jsx(u._T,{size:"big",children:'"Oops!"'}),M.jsx(u.nf,{width:360,children:'"We can\'t find any items with that name"'})]})})}(I=R).exports=function(){if(H3)return E;H3=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,l={},c=null,d=null;for(s in void 0!==u&&(c=""+u),void 0!==o.key&&(c=""+o.key),void 0!==o.ref&&(d=o.ref),o)r.call(o,s)&&!a.hasOwnProperty(s)&&(l[s]=o[s]);if(n&&n.defaultProps)for(s in o=n.defaultProps)void 0===l[s]&&(l[s]=o[s]);return{$$typeof:t,type:n,key:c,ref:d,props:l,_owner:i.current}}return E.Fragment=n,E.jsx=u,E.jsxs=u,E}();let A={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."}}};(nv=H4||(H4={})).assertEqual=t=>t,nv.assertIs=function(t){},nv.assertNever=function(t){throw Error()},nv.arrayToEnum=t=>{let n={};for(let r of t)n[r]=r;return n},nv.getValidEnumValues=t=>{let n=nv.objectKeys(t).filter(n=>"number"!=typeof t[t[n]]),r={};for(let i of n)r[i]=t[i];return nv.objectValues(r)},nv.objectValues=t=>nv.objectKeys(t).map(function(n){return t[n]}),nv.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},nv.find=(t,n)=>{for(let r of t)if(n(r))return r},nv.isInteger="function"==typeof Number.isInteger?t=>Number.isInteger(t):t=>"number"==typeof t&&isFinite(t)&&Math.floor(t)===t,nv.joinValues=function(t,n=" | "){return t.map(t=>"string"==typeof t?`'${t}'`:t).join(n)},nv.jsonStringifyReplacer=(t,n)=>"bigint"==typeof n?n.toString():n,(nb=H5||(H5={})).mergeShapes=(t,n)=>({...t,...n});let N=H4.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),P=t=>{switch(typeof t){case"undefined":return N.undefined;case"string":return N.string;case"number":return isNaN(t)?N.nan:N.number;case"boolean":return N.boolean;case"function":return N.function;case"bigint":return N.bigint;case"symbol":return N.symbol;case"object":return Array.isArray(t)?N.array:null===t?N.null:t.then&&"function"==typeof t.then&&t.catch&&"function"==typeof t.catch?N.promise:"u">typeof Map&&t instanceof Map?N.map:"u">typeof Set&&t instanceof Set?N.set:"u">typeof Date&&t instanceof Date?N.date:N.object;default:return N.unknown}},L=H4.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),D=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class F 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,H4.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()}}F.create=t=>new F(t);let W=(t,n)=>{let r;switch(t.code){case L.invalid_type:r=t.received===N.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case L.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,H4.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:r=`Unrecognized key(s) in object: ${H4.joinValues(t.keys,", ")}`;break;case L.invalid_union:r="Invalid input";break;case L.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${H4.joinValues(t.options)}`;break;case L.invalid_enum_value:r=`Invalid enum value. Expected ${H4.joinValues(t.options)}, received '${t.received}'`;break;case L.invalid_arguments:r="Invalid function arguments";break;case L.invalid_return_type:r="Invalid function return type";break;case L.invalid_date:r="Invalid date";break;case L.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}"`:H4.assertNever(t.validation):r="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case L.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 L.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 L.custom:r="Invalid input";break;case L.invalid_intersection_types:r="Intersection results could not be merged";break;case L.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case L.not_finite:r="Number must be finite";break;default:r=n.defaultError,H4.assertNever(t)}return{message:r}},U=W;function z(t){U=t}function B(){return U}let V=t=>{let{data:n,path:r,errorMaps:i,issueData:o}=t,a=[...r,...o.path||[]],u={...o,path:a},s="",l=i.filter(t=>!!t).slice().reverse();for(let c of l)s=c(u,{data:n,defaultError:s}).message;return{...o,path:a,message:o.message||s}};function $(t,n){let r=V({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,U,W].filter(t=>!!t)});t.common.issues.push(r)}class q{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 q.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"}),H=t=>({status:"dirty",value:t}),G=t=>({status:"valid",value:t}),Z=t=>"aborted"===t.status,Y=t=>"dirty"===t.status,J=t=>"valid"===t.status,Q=t=>"u">typeof Promise&&t instanceof Promise;(nx=H6||(H6={})).errToObj=t=>"string"==typeof t?{message:t}:t||{},nx.toString=t=>"string"==typeof t?t:null==t?void 0:t.message;class X{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 ee=(t,n)=>{if(J(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 F(t.common.issues);return this._error=r,this._error}}};function et(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 en{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 P(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:P(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new q,ctx:{common:t.parent.common,data:t.data,parsedType:P(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(Q(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:P(t)},o=this._parseSync({data:t,path:i.path,parent:i});return ee(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:P(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await (Q(i)?i:Promise.resolve(i));return ee(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:L.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 eV({schema:this,typeName:H9.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return e$.create(this,this._def)}nullable(){return eq.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ek.create(this,this._def)}promise(){return eB.create(this,this._def)}or(t){return eI.create([this,t],this._def)}and(t){return eE.create(this,t,this._def)}transform(t){return new eV({...et(this._def),schema:this,typeName:H9.ZodEffects,effect:{type:"transform",transform:t}})}default(t){return new eK({...et(this._def),innerType:this,defaultValue:"function"==typeof t?t:()=>t,typeName:H9.ZodDefault})}brand(){return new eY({typeName:H9.ZodBranded,type:this,...et(this._def)})}catch(t){return new eH({...et(this._def),innerType:this,catchValue:"function"==typeof t?t:()=>t,typeName:H9.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return eJ.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let er=/^c[^\s-]{8,}$/i,ei=/^[a-z][a-z0-9]*$/,eo=/[0-9A-HJKMNP-TV-Z]{26}/,ea=/^([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,eu=/^(([^<>()[\]\\.,;:\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,})+))$/,es=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,el=/^(((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})))$/,ed=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 ef(t,n){return!!(("v4"===n||!n)&&el.test(t)||("v6"===n||!n)&&ec.test(t))}class ep extends en{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(n=>t.test(n),{validation:n,code:L.invalid_string,...H6.errToObj(r)}),this.nonempty=t=>this.min(1,H6.errToObj(t)),this.trim=()=>new ep({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new ep({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new ep({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==N.string){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.string,received:n.parsedType}),K}let r=new q,i;for(let o of this._def.checks)if("min"===o.kind)t.data.length<o.value&&($(i=this._getOrReturnCtx(t,i),{code:L.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&&($(i=this._getOrReturnCtx(t,i),{code:L.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?$(i,{code:L.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&$(i,{code:L.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if("email"===o.kind)eu.test(t.data)||($(i=this._getOrReturnCtx(t,i),{validation:"email",code:L.invalid_string,message:o.message}),r.dirty());else if("emoji"===o.kind)es.test(t.data)||($(i=this._getOrReturnCtx(t,i),{validation:"emoji",code:L.invalid_string,message:o.message}),r.dirty());else if("uuid"===o.kind)ea.test(t.data)||($(i=this._getOrReturnCtx(t,i),{validation:"uuid",code:L.invalid_string,message:o.message}),r.dirty());else if("cuid"===o.kind)er.test(t.data)||($(i=this._getOrReturnCtx(t,i),{validation:"cuid",code:L.invalid_string,message:o.message}),r.dirty());else if("cuid2"===o.kind)ei.test(t.data)||($(i=this._getOrReturnCtx(t,i),{validation:"cuid2",code:L.invalid_string,message:o.message}),r.dirty());else if("ulid"===o.kind)eo.test(t.data)||($(i=this._getOrReturnCtx(t,i),{validation:"ulid",code:L.invalid_string,message:o.message}),r.dirty());else if("url"===o.kind)try{new URL(t.data)}catch{$(i=this._getOrReturnCtx(t,i),{validation:"url",code:L.invalid_string,message:o.message}),r.dirty()}else"regex"===o.kind?(o.regex.lastIndex=0,o.regex.test(t.data)||($(i=this._getOrReturnCtx(t,i),{validation:"regex",code:L.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)||($(i=this._getOrReturnCtx(t,i),{code:L.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)||($(i=this._getOrReturnCtx(t,i),{code:L.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):"endsWith"===o.kind?t.data.endsWith(o.value)||($(i=this._getOrReturnCtx(t,i),{code:L.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):"datetime"===o.kind?ed(o).test(t.data)||($(i=this._getOrReturnCtx(t,i),{code:L.invalid_string,validation:"datetime",message:o.message}),r.dirty()):"ip"===o.kind?ef(t.data,o.version)||($(i=this._getOrReturnCtx(t,i),{validation:"ip",code:L.invalid_string,message:o.message}),r.dirty()):H4.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new ep({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...H6.errToObj(t)})}url(t){return this._addCheck({kind:"url",...H6.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...H6.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...H6.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...H6.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...H6.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...H6.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...H6.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,...H6.errToObj(null==t?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...H6.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:null==n?void 0:n.position,...H6.errToObj(null==n?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...H6.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...H6.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...H6.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...H6.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...H6.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 eh(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)}ep.create=t=>{var n;return new ep({checks:[],typeName:H9.ZodString,coerce:null!==(n=null==t?void 0:t.coerce)&&void 0!==n&&n,...et(t)})};class em extends en{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)!==N.number){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.number,received:n.parsedType}),K}let r,i=new q;for(let o of this._def.checks)"int"===o.kind?H4.isInteger(t.data)||($(r=this._getOrReturnCtx(t,r),{code:L.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):"min"===o.kind?(o.inclusive?t.data<o.value:t.data<=o.value)&&($(r=this._getOrReturnCtx(t,r),{code:L.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)&&($(r=this._getOrReturnCtx(t,r),{code:L.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):"multipleOf"===o.kind?0!==eh(t.data,o.value)&&($(r=this._getOrReturnCtx(t,r),{code:L.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):"finite"===o.kind?Number.isFinite(t.data)||($(r=this._getOrReturnCtx(t,r),{code:L.not_finite,message:o.message}),i.dirty()):H4.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,H6.toString(n))}gt(t,n){return this.setLimit("min",t,!1,H6.toString(n))}lte(t,n){return this.setLimit("max",t,!0,H6.toString(n))}lt(t,n){return this.setLimit("max",t,!1,H6.toString(n))}setLimit(t,n,r,i){return new em({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:H6.toString(i)}]})}_addCheck(t){return new em({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:H6.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:H6.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:H6.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:H6.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:H6.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:H6.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:H6.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:H6.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:H6.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&&H4.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)}}em.create=t=>new em({checks:[],typeName:H9.ZodNumber,coerce:(null==t?void 0:t.coerce)||!1,...et(t)});class eg extends en{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)!==N.bigint){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.bigint,received:n.parsedType}),K}let r,i=new q;for(let o of this._def.checks)"min"===o.kind?(o.inclusive?t.data<o.value:t.data<=o.value)&&($(r=this._getOrReturnCtx(t,r),{code:L.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)&&($(r=this._getOrReturnCtx(t,r),{code:L.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):"multipleOf"===o.kind?t.data%o.value!==BigInt(0)&&($(r=this._getOrReturnCtx(t,r),{code:L.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):H4.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,H6.toString(n))}gt(t,n){return this.setLimit("min",t,!1,H6.toString(n))}lte(t,n){return this.setLimit("max",t,!0,H6.toString(n))}lt(t,n){return this.setLimit("max",t,!1,H6.toString(n))}setLimit(t,n,r,i){return new eg({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:H6.toString(i)}]})}_addCheck(t){return new eg({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:H6.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:H6.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:H6.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:H6.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:H6.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}}eg.create=t=>{var n;return new eg({checks:[],typeName:H9.ZodBigInt,coerce:null!==(n=null==t?void 0:t.coerce)&&void 0!==n&&n,...et(t)})};class ey extends en{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==N.boolean){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.boolean,received:n.parsedType}),K}return G(t.data)}}ey.create=t=>new ey({typeName:H9.ZodBoolean,coerce:(null==t?void 0:t.coerce)||!1,...et(t)});class ev extends en{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==N.date){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.date,received:n.parsedType}),K}if(isNaN(t.data.getTime())){let r=this._getOrReturnCtx(t);return $(r,{code:L.invalid_date}),K}let i=new q,o;for(let a of this._def.checks)"min"===a.kind?t.data.getTime()<a.value&&($(o=this._getOrReturnCtx(t,o),{code:L.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),i.dirty()):"max"===a.kind?t.data.getTime()>a.value&&($(o=this._getOrReturnCtx(t,o),{code:L.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),i.dirty()):H4.assertNever(a);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ev({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:H6.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:H6.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}}ev.create=t=>new ev({checks:[],coerce:(null==t?void 0:t.coerce)||!1,typeName:H9.ZodDate,...et(t)});class eb extends en{_parse(t){if(this._getType(t)!==N.symbol){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.symbol,received:n.parsedType}),K}return G(t.data)}}eb.create=t=>new eb({typeName:H9.ZodSymbol,...et(t)});class ex extends en{_parse(t){if(this._getType(t)!==N.undefined){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.undefined,received:n.parsedType}),K}return G(t.data)}}ex.create=t=>new ex({typeName:H9.ZodUndefined,...et(t)});class e_ extends en{_parse(t){if(this._getType(t)!==N.null){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.null,received:n.parsedType}),K}return G(t.data)}}e_.create=t=>new e_({typeName:H9.ZodNull,...et(t)});class eS extends en{constructor(){super(...arguments),this._any=!0}_parse(t){return G(t.data)}}eS.create=t=>new eS({typeName:H9.ZodAny,...et(t)});class eT extends en{constructor(){super(...arguments),this._unknown=!0}_parse(t){return G(t.data)}}eT.create=t=>new eT({typeName:H9.ZodUnknown,...et(t)});class ew extends en{_parse(t){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.never,received:n.parsedType}),K}}ew.create=t=>new ew({typeName:H9.ZodNever,...et(t)});class eO extends en{_parse(t){if(this._getType(t)!==N.undefined){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.void,received:n.parsedType}),K}return G(t.data)}}eO.create=t=>new eO({typeName:H9.ZodVoid,...et(t)});class ek extends en{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==N.array)return $(n,{code:L.invalid_type,expected:N.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)&&($(n,{code:o?L.too_big:L.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&&($(n,{code:L.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&&($(n,{code:L.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 X(n,t,n.path,r)))).then(t=>q.mergeArray(r,t));let u=[...n.data].map((t,r)=>i.type._parseSync(new X(n,t,n.path,r)));return q.mergeArray(r,u)}get element(){return this._def.type}min(t,n){return new ek({...this._def,minLength:{value:t,message:H6.toString(n)}})}max(t,n){return new ek({...this._def,maxLength:{value:t,message:H6.toString(n)}})}length(t,n){return new ek({...this._def,exactLength:{value:t,message:H6.toString(n)}})}nonempty(t){return this.min(1,t)}}ek.create=(t,n)=>new ek({type:t,minLength:null,maxLength:null,exactLength:null,typeName:H9.ZodArray,...et(n)});class eC extends en{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=H4.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==N.object){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.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 ew&&"strip"===this._def.unknownKeys))for(let s in i.data)a.includes(s)||u.push(s);let l=[];for(let c of a){let d=o[c],f=i.data[c];l.push({key:{status:"valid",value:c},value:d._parse(new X(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof ew){let p=this._def.unknownKeys;if("passthrough"===p)for(let h of u)l.push({key:{status:"valid",value:h},value:{status:"valid",value:i.data[h]}});else if("strict"===p)u.length>0&&($(i,{code:L.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];l.push({key:{status:"valid",value:g},value:m._parse(new X(i,y,i.path,g)),alwaysSet:g in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let t=[];for(let n of l){let r=await n.key;t.push({key:r,value:await n.value,alwaysSet:n.alwaysSet})}return t}).then(t=>q.mergeObjectSync(r,t)):q.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return H6.errToObj,new eC({...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=H6.errToObj(t).message)&&void 0!==u?u:s}:{message:s}}}:{}})}strip(){return new eC({...this._def,unknownKeys:"strip"})}passthrough(){return new eC({...this._def,unknownKeys:"passthrough"})}extend(t){return new eC({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new eC({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:H9.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new eC({...this._def,catchall:t})}pick(t){let n={};return H4.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new eC({...this._def,shape:()=>n})}omit(t){let n={};return H4.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new eC({...this._def,shape:()=>n})}deepPartial(){return function t(n){if(!(n instanceof eC))return n instanceof ek?new ek({...n._def,type:t(n.element)}):n instanceof e$?e$.create(t(n.unwrap())):n instanceof eq?eq.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]=e$.create(t(o))}return new eC({...n._def,shape:()=>r})}}(this)}partial(t){let n={};return H4.objectKeys(this.shape).forEach(r=>{let i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new eC({...this._def,shape:()=>n})}required(t){let n={};return H4.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof e$;)i=i._def.innerType;n[r]=i}}),new eC({...this._def,shape:()=>n})}keyof(){return eW(H4.objectKeys(this.shape))}}eC.create=(t,n)=>new eC({shape:()=>t,unknownKeys:"strip",catchall:ew.create(),typeName:H9.ZodObject,...et(n)}),eC.strictCreate=(t,n)=>new eC({shape:()=>t,unknownKeys:"strict",catchall:ew.create(),typeName:H9.ZodObject,...et(n)}),eC.lazycreate=(t,n)=>new eC({shape:t,unknownKeys:"strip",catchall:ew.create(),typeName:H9.ZodObject,...et(n)});class eI extends en{_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 F(t.ctx.common.issues));return $(n,{code:L.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 l=o.map(t=>new F(t));return $(n,{code:L.invalid_union,unionErrors:l}),K}}get options(){return this._def.options}}eI.create=(t,n)=>new eI({options:t,typeName:H9.ZodUnion,...et(n)});let eM=t=>t instanceof eD?eM(t.schema):t instanceof eV?eM(t.innerType()):t instanceof eF?[t.value]:t instanceof eU?t.options:t instanceof ez?Object.keys(t.enum):t instanceof eK?eM(t._def.innerType):t instanceof ex?[void 0]:t instanceof e_?[null]:null;class eR extends en{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==N.object)return $(n,{code:L.invalid_type,expected:N.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}):($(n,{code:L.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=eM(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 eR({typeName:H9.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...et(r)})}}class eE extends en{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=(t,i)=>{if(Z(t)||Z(i))return K;let o=function t(n,r){let i=P(n),o=P(r);if(n===r)return{valid:!0,data:n};if(i===N.object&&o===N.object){let a=H4.objectKeys(r),u=H4.objectKeys(n).filter(t=>-1!==a.indexOf(t)),s={...n,...r};for(let l of u){let c=t(n[l],r[l]);if(!c.valid)return{valid:!1};s[l]=c.data}return{valid:!0,data:s}}if(i!==N.array||o!==N.array)return i===N.date&&o===N.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?((Y(t)||Y(i))&&n.dirty(),{status:n.value,value:o.data}):($(r,{code:L.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}))}}eE.create=(t,n,r)=>new eE({left:t,right:n,typeName:H9.ZodIntersection,...et(r)});class ej extends en{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==N.array)return $(r,{code:L.invalid_type,expected:N.array,received:r.parsedType}),K;if(r.data.length<this._def.items.length)return $(r,{code:L.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),K;!this._def.rest&&r.data.length>this._def.items.length&&($(r,{code:L.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 X(r,t,r.path,n)):null}).filter(t=>!!t);return r.common.async?Promise.all(i).then(t=>q.mergeArray(n,t)):q.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:H9.ZodTuple,rest:null,...et(n)})};class eA extends en{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!==N.object)return $(r,{code:L.invalid_type,expected:N.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 X(r,u,r.path,u)),value:a._parse(new X(r,r.data[u],r.path,u))});return r.common.async?q.mergeObjectAsync(n,i):q.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return new eA(n instanceof en?{keyType:t,valueType:n,typeName:H9.ZodRecord,...et(r)}:{keyType:ep.create(),valueType:t,typeName:H9.ZodRecord,...et(n)})}}class eN extends en{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==N.map)return $(r,{code:L.invalid_type,expected:N.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 X(r,t,r.path,[a,"key"])),value:o._parse(new X(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 l of a){let c=l.key,d=l.value;if("aborted"===c.status||"aborted"===d.status)return K;("dirty"===c.status||"dirty"===d.status)&&n.dirty(),s.set(c.value,d.value)}return{status:n.value,value:s}}}}eN.create=(t,n,r)=>new eN({valueType:n,keyType:t,typeName:H9.ZodMap,...et(r)});class eP extends en{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==N.set)return $(r,{code:L.invalid_type,expected:N.set,received:r.parsedType}),K;let i=this._def;null!==i.minSize&&r.data.size<i.minSize.value&&($(r,{code:L.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&&($(r,{code:L.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 X(r,t,r.path,n)));return r.common.async?Promise.all(u).then(t=>a(t)):a(u)}min(t,n){return new eP({...this._def,minSize:{value:t,message:H6.toString(n)}})}max(t,n){return new eP({...this._def,maxSize:{value:t,message:H6.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}eP.create=(t,n)=>new eP({valueType:t,minSize:null,maxSize:null,typeName:H9.ZodSet,...et(n)});class eL extends en{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==N.function)return $(n,{code:L.invalid_type,expected:N.function,received:n.parsedType}),K;function r(t,r){return V({data:t,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,U,W].filter(t=>!!t),issueData:{code:L.invalid_arguments,argumentsError:r}})}function i(t,r){return V({data:t,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,U,W].filter(t=>!!t),issueData:{code:L.invalid_return_type,returnTypeError:r}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof eB?G(async(...t)=>{let n=new F([]),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})}):G((...t)=>{let n=this._def.args.safeParse(t,o);if(!n.success)throw new F([r(t,n.error)]);let u=a(...n.data),s=this._def.returns.safeParse(u,o);if(!s.success)throw new F([i(u,s.error)]);return s.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new eL({...this._def,args:ej.create(t).rest(eT.create())})}returns(t){return new eL({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new eL({args:t||ej.create([]).rest(eT.create()),returns:n||eT.create(),typeName:H9.ZodFunction,...et(r)})}}class eD extends en{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}eD.create=(t,n)=>new eD({getter:t,typeName:H9.ZodLazy,...et(n)});class eF extends en{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return $(n,{received:n.data,code:L.invalid_literal,expected:this._def.value}),K}return{status:"valid",value:t.data}}get value(){return this._def.value}}function eW(t,n){return new eU({values:t,typeName:H9.ZodEnum,...et(n)})}eF.create=(t,n)=>new eF({value:t,typeName:H9.ZodLiteral,...et(n)});class eU extends en{_parse(t){if("string"!=typeof t.data){let n=this._getOrReturnCtx(t),r=this._def.values;return $(n,{expected:H4.joinValues(r),received:n.parsedType,code:L.invalid_type}),K}if(-1===this._def.values.indexOf(t.data)){let i=this._getOrReturnCtx(t),o=this._def.values;return $(i,{received:i.data,code:L.invalid_enum_value,options:o}),K}return G(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 eU.create(t)}exclude(t){return eU.create(this.options.filter(n=>!t.includes(n)))}}eU.create=eW;class ez extends en{_parse(t){let n=H4.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==N.string&&r.parsedType!==N.number){let i=H4.objectValues(n);return $(r,{expected:H4.joinValues(i),received:r.parsedType,code:L.invalid_type}),K}if(-1===n.indexOf(t.data)){let o=H4.objectValues(n);return $(r,{received:r.data,code:L.invalid_enum_value,options:o}),K}return G(t.data)}get enum(){return this._def.values}}ez.create=(t,n)=>new ez({values:t,typeName:H9.ZodNativeEnum,...et(n)});class eB extends en{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==N.promise&&!1===n.common.async)return $(n,{code:L.invalid_type,expected:N.promise,received:n.parsedType}),K;let r=n.parsedType===N.promise?n.data:Promise.resolve(n.data);return G(r.then(t=>this._def.type.parseAsync(t,{path:n.path,errorMap:n.common.contextualErrorMap})))}}eB.create=(t,n)=>new eB({type:t,typeName:H9.ZodPromise,...et(n)});class eV extends en{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===H9.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){$(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=>J(t)?Promise.resolve(i.transform(t.value,a)).then(t=>({status:n.value,value:t})):t);{let l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!J(l))return l;let c=i.transform(l.value,a);if(c instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}}H4.assertNever(i)}}eV.create=(t,n,r)=>new eV({schema:t,typeName:H9.ZodEffects,effect:n,...et(r)}),eV.createWithPreprocess=(t,n,r)=>new eV({schema:n,effect:{type:"preprocess",transform:t},typeName:H9.ZodEffects,...et(r)});class e$ extends en{_parse(t){return this._getType(t)===N.undefined?G(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}e$.create=(t,n)=>new e$({innerType:t,typeName:H9.ZodOptional,...et(n)});class eq extends en{_parse(t){return this._getType(t)===N.null?G(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}eq.create=(t,n)=>new eq({innerType:t,typeName:H9.ZodNullable,...et(n)});class eK extends en{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===N.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:H9.ZodDefault,defaultValue:"function"==typeof n.default?n.default:()=>n.default,...et(n)});class eH extends en{_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 Q(i)?i.then(t=>({status:"valid",value:"valid"===t.status?t.value:this._def.catchValue({get error(){return new F(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new F(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}eH.create=(t,n)=>new eH({innerType:t,typeName:H9.ZodCatch,catchValue:"function"==typeof n.catch?n.catch:()=>n.catch,...et(n)});class eG extends en{_parse(t){if(this._getType(t)!==N.nan){let n=this._getOrReturnCtx(t);return $(n,{code:L.invalid_type,expected:N.nan,received:n.parsedType}),K}return{status:"valid",value:t.data}}}eG.create=t=>new eG({typeName:H9.ZodNaN,...et(t)});let eZ=Symbol("zod_brand");class eY extends en{_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 eJ extends en{_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(),H(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 eJ({in:t,out:n,typeName:H9.ZodPipeline})}}let eQ=(t,n={},r)=>t?eS.create().superRefine((i,o)=>{var a,u;if(!t(i)){let s="function"==typeof n?n(i):"string"==typeof n?{message:n}:n,l=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:l})}}):eS.create(),eX={object:eC.lazycreate};(n_=H9||(H9={})).ZodString="ZodString",n_.ZodNumber="ZodNumber",n_.ZodNaN="ZodNaN",n_.ZodBigInt="ZodBigInt",n_.ZodBoolean="ZodBoolean",n_.ZodDate="ZodDate",n_.ZodSymbol="ZodSymbol",n_.ZodUndefined="ZodUndefined",n_.ZodNull="ZodNull",n_.ZodAny="ZodAny",n_.ZodUnknown="ZodUnknown",n_.ZodNever="ZodNever",n_.ZodVoid="ZodVoid",n_.ZodArray="ZodArray",n_.ZodObject="ZodObject",n_.ZodUnion="ZodUnion",n_.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n_.ZodIntersection="ZodIntersection",n_.ZodTuple="ZodTuple",n_.ZodRecord="ZodRecord",n_.ZodMap="ZodMap",n_.ZodSet="ZodSet",n_.ZodFunction="ZodFunction",n_.ZodLazy="ZodLazy",n_.ZodLiteral="ZodLiteral",n_.ZodEnum="ZodEnum",n_.ZodEffects="ZodEffects",n_.ZodNativeEnum="ZodNativeEnum",n_.ZodOptional="ZodOptional",n_.ZodNullable="ZodNullable",n_.ZodDefault="ZodDefault",n_.ZodCatch="ZodCatch",n_.ZodPromise="ZodPromise",n_.ZodBranded="ZodBranded",n_.ZodPipeline="ZodPipeline";let e0=(t,n={message:`Input not instance of ${t.name}`})=>eQ(n=>n instanceof t,n),e1=ep.create,e2=em.create,e3=eG.create,e4=eg.create,e5=ey.create,e6=ev.create,e9=eb.create,e8=ex.create,e7=e_.create,te=eS.create,tt=eT.create,tn=ew.create,tr=eO.create,ti=ek.create,to=eC.create,ta=eC.strictCreate,tu=eI.create,ts=eR.create,tl=eE.create,tc=ej.create,td=eA.create,tf=eN.create,tp=eP.create,th=eL.create,tm=eD.create,tg=eF.create,ty=eU.create,tv=ez.create,tb=eB.create,tx=eV.create,t_=e$.create,tS=eq.create,tT=eV.createWithPreprocess,tw=eJ.create,tO=()=>e1().optional(),tk=()=>e2().optional(),tC=()=>e5().optional();var tI=Object.freeze({__proto__:null,defaultErrorMap:W,setErrorMap:z,getErrorMap:B,makeIssue:V,EMPTY_PATH:[],addIssueToContext:$,ParseStatus:q,INVALID:K,DIRTY:H,OK:G,isAborted:Z,isDirty:Y,isValid:J,isAsync:Q,get util(){return H4},get objectUtil(){return H5},ZodParsedType:N,getParsedType:P,ZodType:en,ZodString:ep,ZodNumber:em,ZodBigInt:eg,ZodBoolean:ey,ZodDate:ev,ZodSymbol:eb,ZodUndefined:ex,ZodNull:e_,ZodAny:eS,ZodUnknown:eT,ZodNever:ew,ZodVoid:eO,ZodArray:ek,ZodObject:eC,ZodUnion:eI,ZodDiscriminatedUnion:eR,ZodIntersection:eE,ZodTuple:ej,ZodRecord:eA,ZodMap:eN,ZodSet:eP,ZodFunction:eL,ZodLazy:eD,ZodLiteral:eF,ZodEnum:eU,ZodNativeEnum:ez,ZodPromise:eB,ZodEffects:eV,ZodTransformer:eV,ZodOptional:e$,ZodNullable:eq,ZodDefault:eK,ZodCatch:eH,ZodNaN:eG,BRAND:eZ,ZodBranded:eY,ZodPipeline:eJ,custom:eQ,Schema:en,ZodSchema:en,late:eX,get ZodFirstPartyTypeKind(){return H9},coerce:{string:t=>ep.create({...t,coerce:!0}),number:t=>em.create({...t,coerce:!0}),boolean:t=>ey.create({...t,coerce:!0}),bigint:t=>eg.create({...t,coerce:!0}),date:t=>ev.create({...t,coerce:!0})},any:te,array:ti,bigint:e4,boolean:e5,date:e6,discriminatedUnion:ts,effect:tx,enum:ty,function:th,instanceof:e0,intersection:tl,lazy:tm,literal:tg,map:tf,nan:e3,nativeEnum:tv,never:tn,null:e7,nullable:tS,number:e2,object:to,oboolean:tC,onumber:tk,optional:t_,ostring:tO,pipeline:tw,preprocess:tT,promise:tb,record:td,set:tp,strictObject:ta,string:e1,symbol:e9,transformer:tx,tuple:tc,undefined:e8,union:tu,unknown:tt,void:tr,NEVER:K,ZodIssueCode:L,quotelessJson:D,ZodError:F});let tM=(0,o.createContext)(void 0);function tR(){let t=(0,o.useContext)(tM);if(!t)throw Error("Missing EditorConfigContext.Provider");return t}class tE extends Error{}function tj(t){throw new tE(`Missing EditorConfig.${t}`)}let tA=to({id:e1(),kind:e1(),extension:e1(),filename:e1(),width:e2().optional(),height:e2().optional(),last_modified:e2(),url:e1(),alt:e1().optional(),size:e2(),notes:e1().optional(),credits:e1().optional()}),tN={"X-Prismic-Source":"Wroom"},tP=to({total:e2(),cursor:e1().optional(),items:ti(tA)});function tL(t,n,r,i,o,a,u){let s=new URLSearchParams((0,h.fW)([{name:"limit",values:["30"]},{name:"cursor",values:[u??""]},{name:"keyword",values:[o]},{name:"assetType",values:[i]}])).toString(),l=tP.transform(t=>({...t,assetType:i,keyword:o,page:a}));return(0,p.WY)(`${t}?${s}`,{headers:{repository:n,...tN},credentials:(0,p.xb)(r),okType:l})}function tD(t){(0,m.YC)(tL,n=>{let{items:r,total:i}=n,o=t(r,n);if(o)return{...n,total:i+(o.length-r.length),items:o}})}m.Fs.registerFetcherConfig(tL,{cacheCapacity:100,revalidationStrategy:{type:"never"}});let tF,tW=new Uint8Array(16);function tU(){if(!tF&&!(tF="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 tF(tW)}let tz=[];for(let tB=0;tB<256;++tB)tz.push((tB+256).toString(16).slice(1));let tV="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),t$={randomUUID:tV};function tq(t,n,r){if(t$.randomUUID&&!n&&!t)return t$.randomUUID();t=t||{};let i=t.random||(t.rng||tU)();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 tK=(0,o.createContext)(void 0);function tH(t){let{children:n,assetType:r="all",onSelectedChange:i,actionContainerRef:a}=t,[l,c]=(0,o.useState)(new Set),[d,h]=(0,o.useTransition)(),[y,v]=(0,o.useTransition)(),[b,x]=(0,o.useState)(""),{media:_,onHasReachedBottom:S,updateMedia:T,unshiftMedia:w,deleteMedia:O,mediaTotal:k,revalidateFirstPage:C}=function(t){let{assetType:n="all",keyword:r}=t,i=tR(),[a,u]=(0,o.useState)({page:0});i.mediaLibrary||tj("mediaLibrary");let{assetsUrl:l,repository:c}=i,d=(0,m.QT)(tL,[l,c,i.env,n,r,a.page,a.cursor]),p=function(t,n){let r=(0,m.q_)(tL).filter(r=>r.assetType===t&&r.keyword===n);return(0,f.DY)(r,t=>t.page).flatMap(t=>t.items)}(n,r);function h(){u({page:0})}return(0,s.pQ)(n,h),(0,s.pQ)(r,h),{media:p,mediaTotal:d.total,limit:30,onHasReachedBottom:function(){0!==d.total&&u(t=>({page:t.page+1,cursor:d.cursor}))},updateMedia:function(t){tD(n=>n.flatMap(n=>{let r=t.find(t=>t.id===n.id);return r?void 0===r.response?[]:r.response:n}))},unshiftMedia:function(t){h(),tD((r,i)=>{if(0===i.page&&!(""!==i.keyword||i.assetType!==n))return[...t,...r]})},deleteMedia:function(t){tD(n=>n.filter(n=>n.id!==t))},revalidateFirstPage:function(){(0,m.gw)(tL,[l,c,i.env,n,"",0])}}}({assetType:r,keyword:b}),{isUploading:I,onFilesSelected:R,uploadingFiles:E}=function(t){let{onBeforeUpload:n,onComplete:r,onError:i}=t,[a,s]=(0,o.useState)([]),l=a.some(t=>"idle"===t.status||"uploading"===t.status),{showAlert:c}=(0,u.VY)(),{env:d}=tR(),f=tR(),h=(0,o.useCallback)(t=>{let r=[{...t,id:`retry-${tq()}`,status:"idle"}];s(r),n(r)},[n]);function m(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(()=>{m(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,p.WY)(i,{headers:{repository:o,"Content-Type":"multipart/form-data",...tN},method:"POST",body:u,credentials:(0,p.xb)(a),okType:tA})})({file:t.file,config:f}).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,g.tx)(t.file.name,30);c({id:t.id,title:`The specified file "${n}" could not be uploaded.`,subtitle:M.jsxs(u.xv,{color:"inherit",children:["Read more about our"," ",M.jsx(u.hh,{color:"tomato11",href:"https://prismic.io/docs/guides/manage-images#supported-media",underline:!0,children:"supported media"}),"."]}),..."dev"===d&&{buttons:[{text:"Retry upload",icon:"cloudUpload",onClick:()=>h(t)}]}}),m(i)})},[f,a,r,i,h,c,d]),{isUploading:l,uploadingFiles:a,onFilesSelected:function(t){let r=t.map(t=>({id:`temp-${tq()}`,file:t,status:"idle"}));s(r),n(r)},onRetry:h}}({onBeforeUpload(t){x("");let n=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}));w(n);let[r]=n??[];r&&c(new Set([r.id]))},onComplete(t){let n=t.flatMap(t=>"success"===t.status?(c(n=>(n.delete(t.id)&&(n.add(t.response.id),null==i||i([t.response])),n)),t):{id:t.id,response:void 0});T(n),C()},onError(t){let n=t.flatMap(t=>"error"===t.status?{id:t.id,response:void 0}:[]);setTimeout(()=>T(n),2e3)}});function j(t,n){c(r=>{let o=E.some(n=>n.id===t&&"success"!==n.status);if("replace"===n){let a=_.find(n=>n.id===t);return a?(null==i||i(o?[]:[a]),new Set([t])):r}let u=new Set(r);if(u[n](t),"add"===n&&o)return u;let s=Array.from(u).flatMap(t=>_.find(n=>n.id===t)??[]);return null==i||i(s),u})}return M.jsx(tK.Provider,{value:{isFetchingMedia:d,media:_,mediaTotal:k,onScrollToBottom:function(){h(S)},selectedMediaIds:l,actionContainerRef:a,onFilesUpload:function(t){I||R(t)},isUploading:I,uploadingFiles:E,addMediaItemSelection:function(t){j(t,"add")},removeMediaItemSelection:function(t){j(t,"delete")},replaceMediaItemSelection:function(t){j(t,"replace")},deleteMedia:O,updateMedia:function(t,n){T([{id:t,response:n}])},keyword:b,onKeywordChange:function(t){v(()=>{x(t),null==i||i([]),c(new Set([]))})},isSearchingMedia:y,assetType:r},children:n})}function tG(){let t=(0,o.useContext)(tK);if(!t)throw Error("useMediaLibrary must be used within a MediaLibraryProvider");return t}function tZ(){let{actionContainerRef:t,isUploading:n,onFilesUpload:r}=tG(),i=null==t?void 0:t.current;return M.jsx(tJ,{actionContainerRef:t,children:M.jsxs(u.xu,{width:"100%",gap:16,children:[M.jsx(tY,{}),M.jsx(u.u,{title:A.warning.uploadWhileUploading.title,content:A.warning.uploadWhileUploading.description,visible:n,stableMount:!0,children:M.jsx(u.KH,{disabled:n,onFilesSelected:r,startIcon:"cloudUpload",color:i?"purple":"grey",size:"large",children:"Upload media"})})]})})}function tY(){let{keyword:t,onKeywordChange:n,isFetchingMedia:r}=tG(),[i,a]=(0,o.useState)(t);return(0,s.pQ)(t,()=>{""===t&&a("")}),(0,s.Nr)(i,300,(0,s.R9)(t=>n(t))),M.jsx(u.xu,{width:"100%",flexDirection:"column",children:M.jsx(u.CR,{value:i,placeholder:"Search",onValueChange:a,maxLength:200,isLoading:r&&t!==i})})}function tJ(t){let{children:n,actionContainerRef:r}=t,i=null==r?void 0:r.current,a=i?u.Uv:o.Fragment,s=i?{container:r.current,asChild:!0}:{};return M.jsx(a,{...s,children:n})}function tQ(t){let{children:n}=t,{onFilesUpload:r,assetType:i}=tG();return M.jsx(u.Zz,{overlay:M.jsx(tX,{}),overlayVariant:"simple",onFilesSelected:r,assetType:i,children:n})}function tX(){let{isUploading:t}=tG(),n=t?A.warning.uploadWhileUploading.title:"Drop files here",r=t?A.warning.uploadWhileUploading.description:"Drop your files to upload them instantly to the media library.";return M.jsx(u.xu,{justifyContent:"center",flexDirection:"column",height:"100%",backgroundColor:"grey3",children:M.jsxs(u.R$,{children:[M.jsx(u.av,{name:t?"block":"cloudUpload",lineColor:t?"tomato11":"purple10",backgroundColor:t?"tomato2":"purple3",borderColor:t?"tomato6":"purple6",borderStyle:"dashed",size:"xlarge"}),M.jsx(u._T,{size:"big",children:n}),M.jsx(u.nf,{width:360,children:r})]})})}function t0(){return M.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 t1(t){let{mediaList:n,mediaActions:r,sidePane:i}=t;return M.jsxs(u.xu,{display:"grid",gridTemplateRows:"1fr 1fr",gridTemplateColumns:"1fr 292px",width:"100%",height:"100%",gap:16,children:[M.jsxs(u.xu,{position:"relative",display:"grid",gap:16,gridColumn:"1",gridRow:"1 / -1",children:[r,n]}),i]})}function t2(){var t;let{onScrollToBottom:n,media:r,selectedMediaIds:i,removeMediaItemSelection:a,replaceMediaItemSelection:s,isUploading:l,uploadingFiles:c,isSearchingMedia:d}=tG(),f=(0,o.useRef)(null);function p(t){if(i.has(t))return a(t);s(t)}return l&&(null==(t=f.current)||t.scrollTo({top:0,behavior:"instant"})),M.jsx(t3,{onScrollToBottom:n,scrollAreaRef:f,children:null==r?void 0:r.map(t=>{var n;return M.jsx(u.PB,{...t,loading:d,status:null==(n=c.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 t3(t){let{children:n,scrollAreaRef:r,onScrollToBottom:i}=t;return M.jsx(u.xr,{ref:r,style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 250px), 1fr))",gridTemplateRows:"1fr 1fr 1fr ",gap:16,paddingBottom:16,position:"relative"},onScrollToBottom:i,threshold:500,children:n})}function t4(t){let{children:n,hasSelectedMedia:r}=t;return M.jsx(u.xu,{overflow:"hidden",borderStyle:r?"solid":"dashed",border:{top:!0,right:!0,left:!0,bottom:!1},borderRadius:{topRight:8,topLeft:8},gridColumn:"2",gridRow:"1 / -1",children:n})}function t5(t){let{onFilesUpload:n,isUploading:r,isInitialLoad:i=!1}=t,o=i||r;return M.jsxs(u.xu,{flexDirection:"column",justifyContent:"center",alignItems:"center",padding:16,gap:16,width:"100%",children:[M.jsx(u.av,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),M.jsx(u.xu,{flexDirection:"column",gap:4,children:M.jsxs(u.xv,{align:"center",children:["Select or"," ",M.jsx(u.KH,{disabled:o,onFilesSelected:n,renderButton:t=>M.jsx(u.u,{title:A.warning.uploadWhileUploading.title,content:A.warning.uploadWhileUploading.description,visible:r,children:M.jsx(u.iC,{disabled:o,onClick:t,buttonText:"upload",inline:!0})})})," ","media."]})}),M.jsx(u.KH,{disabled:o,onFilesSelected:n,color:"grey",children:"Upload media"})]})}function t6(t){let{actionContainerRef:n}=t;return M.jsx(t1,{sidePane:M.jsx(t7,{}),mediaActions:M.jsx(t8,{actionContainerRef:n}),mediaList:M.jsxs(M.Fragment,{children:[M.jsx(u.xu,{width:"100%",height:24,alignItems:"center",children:M.jsx(u.Od,{color:"grey5",height:16,width:56,borderRadius:12})}),M.jsx(t9,{})]})})}function t9(){return M.jsx(t3,{children:(0,d.N)(12,M.jsx(ne,{}))})}function t8(t){let{actionContainerRef:n}=t,r=(0,s.NW)();return(0,o.useLayoutEffect)(()=>{r()},[r]),M.jsx(tJ,{actionContainerRef:n,children:M.jsxs(u.xu,{width:"100%",gap:16,children:[M.jsx(u.xu,{width:"100%",flexDirection:"column",children:M.jsx(u.CR,{placeholder:"Search",maxLength:200,value:"",disabled:!0,onValueChange:()=>null})}),M.jsx(u.KH,{disabled:!0,onFilesSelected:()=>null,startIcon:"cloudUpload",color:n?"purple":"grey",size:"large",children:"Upload media"})]})})}function t7(){return M.jsx(t4,{hasSelectedMedia:!1,children:M.jsx(t5,{onFilesUpload:()=>null,isUploading:!1,isInitialLoad:!0})})}function ne(){return M.jsxs(u.xu,{height:302,width:"100%",flexDirection:"column",padding:16,backgroundColor:"grey1",border:!0,borderStyle:"solid",borderRadius:6,children:[M.jsx(u.Od,{height:164,width:"100%"}),M.jsx(u.Od,{height:16,width:"100%",sx:{marginTop:12}}),M.jsx(u.Od,{height:10,width:100,sx:{marginTop:8}}),M.jsx(u.Od,{height:1,width:"100%",sx:{marginTop:20,marginBottom:16}}),M.jsxs(u.xu,{flexDirection:"row",gap:8,children:[M.jsx(u.Od,{height:24,width:54}),M.jsx(u.Od,{height:24,width:45}),M.jsx(u.Od,{height:24,width:62})]})]})}let nt=(0,o.createContext)({showToast:()=>null});function nn(t){let{children:n}=t,{isFetchingMedia:r}=tG(),[i,a]=(0,o.useState)({title:"",seconds:5}),[s,l]=(0,o.useState)(!1),{title:c,action:d,seconds:f=1,icon:p="check"}=i,h=(0,o.useMemo)(()=>({showToast(t){a({seconds:f,...t}),l(!0)}}),[f]);return M.jsxs(M.Fragment,{children:[M.jsx(nr,{open:r}),M.jsx(u.FN,{anchor:M.jsx(u.xu,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:s,onOpenChange:l,title:c,action:d,seconds:f,icon:p}),M.jsx(nt.Provider,{value:h,children:n})]})}function nr(t){let{open:n}=t;return M.jsx(u.FN,{anchor:M.jsx(u.xu,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),loadingIndicator:!0,open:n,title:"Loading more items ...",seconds:1})}function ni(){let{media:t,selectedMediaIds:n}=tG();return t.filter(({id:t})=>n.has(t))}function no(){let[t,n]=(0,o.useState)(!1),r=ni(),{uploadingFiles:i}=tG(),[a]=r;if(!a)return null;if(r.length>1)return M.jsxs(u.xu,{gap:8,alignItems:"center",children:[M.jsxs(u.xv,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:[r.length," media selected"]}),M.jsx(u.u,{content:"Open all selected media in new tabs",children:M.jsx(u.hU,{icon:"openInFull",variant:"solid",size:"small",onClick:()=>r.forEach(t=>window.open(t.url,"_blank"))})})]});let s=i.some(t=>t.id===a.id&&"success"!==t.status);return M.jsxs(u.xu,{gap:8,alignItems:"center",children:[M.jsx(u.xv,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:a.filename}),M.jsxs(u.xu,{gap:8,children:[M.jsx(u.u,{content:"Open media in new tab",children:M.jsx(u.hU,{icon:"openInFull",variant:"solid",size:"small",hiddenLabel:"Open media in new tab",onClick:()=>window.open(a.url,"_blank"),disabled:s})}),M.jsx(u.u,{content:"Copy media URL",children:M.jsx(u.hU,{icon:"link",variant:"solid",size:"small",hiddenLabel:"Copy media URL",onClick:()=>navigator.clipboard.writeText(a.url),disabled:s})}),M.jsx(u.u,{content:"Remove media",children:M.jsx(u.hU,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>n(!0),disabled:s})}),M.jsx(na,{open:t,onOpenChange:n,media:a})]})]})}function na(t){let{open:n,onOpenChange:r,media:i}=t,a=tR(),{showAlert:s}=(0,u.VY)(),{deleteMedia:l}=tG(),[c,d]=(0,o.useState)(!1);return M.jsxs(u.Vq,{onOpenChange:r,open:n,size:"small",children:[M.jsx(u.fK,{icon:"alert",title:"Remove this item from your media library?"}),M.jsx(u.cZ,{children:M.jsx(u.xu,{padding:16,children:M.jsxs(u.xv,{children:["You are about to delete this item: ",M.jsx("b",{children:i.filename})]})})}),M.jsx(u.kX,{asFooter:!0,ok:{onClick(){var t;return t=i.id,void(d(!0),(function(t){let{id:n,config:r}=t;if(!r.mediaLibrary)throw Error("Media Library not configured.");let{assetsUrl:i,repository:o,env:a}=r;return(0,p.WY)(`${i}/${n}`,{headers:{repository:o},method:"DELETE",credentials:(0,p.xb)(a),okType:tI.unknown()})})({id:t,config:a}).then(()=>{r(!1),l(t)}).catch(()=>{r(!1),s({title:"Error",subtitle:"Something went wrong when removing the item."})}).finally(()=>{d(!1)}))},text:"Yes, I want to remove this item",color:"tomato",loading:c},cancel:{text:"Cancel"}})]})}function nu(){var t;let n=ni(),{uploadingFiles:r}=tG(),[i]=n;if(!i)return null;if(2===n.length)return M.jsx(ns,{children:n.map((t,n)=>M.jsx("div",{style:{position:"absolute",transform:0===n?"translateX(25%) rotate(15deg) ":"translateX(-25%) rotate(-15deg) "},children:M.jsx(nl,{media:t})},t.id))});if(n.length>2)return M.jsx(ns,{children:n.slice(-4).map((t,n)=>M.jsx("div",{style:{position:"absolute",paddingRight:16*n},children:M.jsx(nl,{media:t})},t.id))});let o=null==(t=r.find(t=>t.id===i.id))?void 0:t.status,a=i.kind.startsWith("image");return M.jsx(u.xu,{flexDirection:"column",children:M.jsx(u.hM,{children:M.jsx(ns,{uploadStatus:o,hasImage:a,children:a?M.jsx(u.Ee,{src:i.url,alt:i.alt,sizing:"contain"}):M.jsx(u.Sp,{extension:i.extension,filename:i.filename})})})})}function ns(t){let{children:n,uploadStatus:r,hasImage:i}=t;return M.jsxs(u.xu,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:200,width:"100%",backgroundColor:i?"transparent":"purple2",children:[n,r&&M.jsx(u.xu,{position:"absolute",backgroundColor:"greyAlpha1",width:"100%",height:"100%",padding:{inline:16},justifyContent:"end",flexDirection:"column",children:M.jsx(u.wI,{status:r})})]})}function nl(t){let{media:n}=t;return M.jsx(u.xu,{width:111,height:152,children:"image"===n.kind?M.jsx(u.Ee,{borderRadius:8,src:n.url,alt:n.alt,sizing:"cover"}):M.jsx(u.Sp,{extension:n.extension,filename:n.filename})})}function nc(){var t,n;let[r,i]=(0,o.useState)("description"),a=ni();if(0===a.length||a.length>1)return null;let s="description"===r,l="more-info"===r;return M.jsxs(M.Fragment,{children:[M.jsxs(u.xu,{border:!0,borderStyle:"solid",borderRadius:8,backgroundColor:"grey2",children:[M.jsx(u.OK,{title:"Description",selected:s,onSelect:()=>i("description"),outline:s,background:s?void 0:"transparent",sx:{flexGrow:1,flexBasis:0}}),M.jsx(u.OK,{title:"More info",selected:l,onSelect:()=>i("more-info"),outline:l,background:l?void 0:"transparent",sx:{flexGrow:1,flexBasis:0}})]}),M.jsxs(u.xu,{gap:16,flexDirection:"column",children:[s&&M.jsx(nd,{},null==(t=a[0])?void 0:t.id),l&&M.jsx(nf,{},null==(n=a[0])?void 0:n.id)]})]})}function nd(){let{title:t,setTitle:n,alt:r,setAlt:i,onBlur:o,isUploading:a,selectedMedia:s}=np();return s?M.jsxs(u.xu,{flexDirection:"column",gap:16,children:[M.jsx(u.yt,{value:t,onValueChange:n,label:"Image title",placeholder:"Image title",onBlur:o,disabled:a}),M.jsx(u.Wi,{label:"Alternative text",children:M.jsx(u.Kx,{value:r,onChange:i,placeholder:"A short description of the image for accessibility",onBlur:o,disabled:a})})]}):null}function nf(){let{credits:t,setCredits:n,notes:r,setNotes:i,onBlur:o,isUploading:a,selectedMedia:s}=np();if(!s)return null;let d=function(t){let{width:n,height:r,last_modified:i,size:o,extension:a}=t,u=n&&r,s={label:"Date",value:(0,l._L)(new Date(i))},d={label:"File size",value:(0,g.td)(o)},f=u?{label:"Dimensions",value:`${n}x${r}`}:void 0,p=u?{label:"Ratio",value:((n??0)/(r??0)).toFixed(1)}:void 0,h={label:"Extension",value:a.toUpperCase()};return[s,d,f,p,h].filter(c.$)}(s);return M.jsxs(u.xu,{gap:8,flexDirection:"column",children:[d.map(t=>M.jsxs(u.xu,{gap:8,children:[M.jsxs(u.xv,{color:"grey11",children:[t.label,":"]}),M.jsx(u.xv,{children:t.value})]},t.label)),M.jsx(u.Wi,{label:"Copyright",children:M.jsx(u.Kx,{value:t,onChange:n,placeholder:"Copyrights or credits are applicable to this media item",onBlur:o,disabled:a})}),M.jsx(u.Wi,{label:"Private notes",children:M.jsx(u.Kx,{value:r,onChange:i,placeholder:"Private notes are never shared publicly",onBlur:o,disabled:a})})]})}function np(){let[t]=ni(),{updateMedia:n,uploadingFiles:r}=tG(),i=tR(),{showToast:a}=(0,o.useContext)(nt),u=(null==t?void 0:t.id)??"",s=(null==t?void 0:t.credits)??"",l=(null==t?void 0:t.notes)??"",c=(null==t?void 0:t.filename)??"",d=(null==t?void 0:t.alt)??"",[f,h]=(0,o.useState)(c),[m,g]=(0,o.useState)(d),[y,v]=(0,o.useState)(s),[b,x]=(0,o.useState)(l),_=r.some(n=>n.id===(null==t?void 0:t.id)&&"success"!==n.status);return{selectedMedia:t,onBlur:function(){t&&(f!==c||m!==d||y!==s||b!==l)&&(function(t){let{id:n,config:r,metadata:i}=t;if(!r.mediaLibrary)throw Error("Media Library not configured.");let{assetsUrl:o,repository:a,env:u}=r;return(0,p.WY)(`${o}/${n}`,{headers:{repository:a},body:{...i},method:"PATCH",credentials:(0,p.xb)(u),okType:tA})})({id:u,config:i,metadata:{filename:f,credits:y,alt:m,notes:b}}).then(t=>{n(u,t),a({title:"Media metadata has been saved.",seconds:3})}).catch(t=>{console.error(t)})},isUploading:_,title:f,setTitle:h,alt:m,setAlt:g,credits:y,setCredits:v,notes:b,setNotes:x}}function nh(){let t=ni(),{onFilesUpload:n,isUploading:r}=tG();return 0===t.length?M.jsx(t5,{onFilesUpload:n,isUploading:r}):M.jsxs(u.xu,{flexDirection:"column",backgroundColor:"grey1",width:"100%",overflowY:"auto",padding:16,gap:16,children:[M.jsx(no,{}),M.jsx(nu,{}),M.jsx(nc,{})]})}function nm(){let{selectedMediaIds:t}=tG(),n=t.size>0;return M.jsx(t4,{hasSelectedMedia:n,children:M.jsx(nh,{})})}function ng(t){let{assetType:n,onSelectedChange:r,actionContainerRef:i}=t;return M.jsx(u.SV,{renderError:()=>M.jsx(t0,{}),children:M.jsx(o.Suspense,{fallback:M.jsx(t6,{actionContainerRef:i}),children:M.jsx(tH,{assetType:n,actionContainerRef:i,onSelectedChange:r,children:M.jsx(tQ,{children:M.jsx(ny,{})})})})})}function ny(){let{media:t,mediaTotal:n}=tG();return M.jsx(nn,{children:M.jsx(t1,{sidePane:M.jsx(nm,{}),mediaActions:M.jsx(tZ,{}),mediaList:M.jsxs(M.Fragment,{children:[0===t.length?M.jsx(j,{}):M.jsx(u.xu,{width:"100%",children:M.jsxs(u.xv,{variant:"bold",children:[n," items"]})}),M.jsx(t2,{})]})})})}var nv,nb,nx,n_,nS,nT,nw,nO,nk,nC,nI,nM,nR,nE,nj,nA,nN,nP,nL,nD,nF,nW,nU,nz,nB,nV,n$,nq,nK,nH,nG,nZ,nY,nJ,nQ={},nX={};nS={get exports(){return nX},set exports(e){nX=e}},function(t){var n="object"==typeof k?k:"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(nS.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])};nT=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)},nw=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},nO=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},nk=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},nC=function(t,n){return function(r,i){n(r,i,t)}},nI=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,l=i.kind,c="getter"===l?"get":"setter"===l?"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"===l?{get:f.get,set:f.set}:f[c],m);if("accessor"===l){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"===l?o.push(s):f[c]=s)}d&&Object.defineProperty(d,i.name,f),p=!0},nM=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},nR=function(t){return"symbol"==typeof t?t:"".concat(t)},nE=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})},nj=function(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)},nA=function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{l(i.next(t))}catch(n){a(n)}}function s(t){try{l(i.throw(t))}catch(n){a(n)}}function l(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}l((i=i.apply(t,n||[])).next())})},nN=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(l){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(l){s=[6,l],i=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},nP=function(t,n){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||nJ(n,t,r)},nJ=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]},nL=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.")},nD=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},nF=function(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(nD(arguments[n]));return t},nW=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},nU=function(t,n,r){if(r||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))},nz=function(t){return this instanceof nz?(this.v=t,this):new nz(t)},nB=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 nz?Promise.resolve(r.value.v).then(l,c):d(a[0][2],r)}catch(i){d(a[0][3],i)}}function l(t){s("next",t)}function c(t){s("throw",t)}function d(t,n){t(n),a.shift(),a.length&&s(a[0][0],a[0][1])}},nV=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:nz(t[i](n)),done:!1}:o?o(n):n}:o}},n$=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 nL?nL(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)})}}},nq=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};nK=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)&&nJ(n,t,i);return r(n,t),n},nH=function(t){return t&&t.__esModule?t:{default:t}},nG=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)},nZ=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},nY=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",nT),t("__assign",nw),t("__rest",nO),t("__decorate",nk),t("__param",nC),t("__esDecorate",nI),t("__runInitializers",nM),t("__propKey",nR),t("__setFunctionName",nE),t("__metadata",nj),t("__awaiter",nA),t("__generator",nN),t("__exportStar",nP),t("__createBinding",nJ),t("__values",nL),t("__read",nD),t("__spread",nF),t("__spreadArrays",nW),t("__spreadArray",nU),t("__await",nz),t("__asyncGenerator",nB),t("__asyncDelegator",nV),t("__asyncValues",n$),t("__makeTemplateObject",nq),t("__importStar",nK),t("__importDefault",nH),t("__classPrivateFieldGet",nG),t("__classPrivateFieldSet",nZ),t("__classPrivateFieldIn",nY)});var n0={};function n1(t){return function(n){return function(r){return r.reduce(function(n,r){return t.alt(n,function(){return r})},n)}}}let n2=Object.freeze(Object.defineProperty({__proto__:null,altAll:n1},Symbol.toStringTag,{value:"Module"})),n3=Object.freeze(Object.defineProperty({__proto__:null,altAll:function(t){return n1(t)(t.zero())}},Symbol.toStringTag,{value:"Module"}));var n4=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))}}}}},n5=function(t){return function(){return{concat:function(n,r){return function(i){return t.concat(n(i),r(i))}}}}},n6=function(t){var n=n5(t);return function(){return{concat:n().concat,empty:function(){return t.empty}}}},n9=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}}},n8=function(t){var n=n9(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))}}}},n7=function(t){return function(n){return n(t)}};function re(t){return t}function rt(t){return function(){return t}}var rn=rt(!0),rr=rt(!1),ri=rt(null),ro=rt(void 0);function ra(t,n,r,i,o,a,u,s,l){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 l(s(u(a(o(i(r(n(t.apply(this,arguments)))))))))}}}function ru(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t}function rs(t){return t+1}function rl(t){return t-1}function rc(t){throw Error("Called `absurd` function which should be uncallable")}function rd(t,n,r,i,o,a,u,s,l){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 l(s(u(a(o(i(r(n(t))))))));default:for(var c=arguments[0],d=1;d<arguments.length;d++)c=arguments[d](c);return c}}var rf=function(t,n){return n},rp=function(){return{concat:function(t,n){return ra(t,n)},empty:re}};let rh=Object.freeze(Object.defineProperty({__proto__:null,SK:rf,absurd:rc,apply:n7,constFalse:rr,constNull:ri,constTrue:rn,constUndefined:ro,constVoid:ro,constant:rt,decrement:rl,flip:function(t){return function(n,r){return t(r,n)}},flow:ra,getBooleanAlgebra:n4,getEndomorphismMonoid:rp,getMonoid:n6,getRing:n8,getSemigroup:n5,getSemiring:n9,hole:rc,identity:re,increment:rs,not:function(t){return function(n){return!t(n)}},pipe:rd,tuple:ru,tupled:function(t){return function(n){return t.apply(void 0,n)}},unsafeCoerce:re,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 rm=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))},rg=function(t){return"None"===t._tag},ry=function(t){return"Some"===t._tag},rv={_tag:"None"},rb=function(t){return{_tag:"Some",value:t}},rx=function(t){return"Left"===t._tag},r_=function(t){return"Right"===t._tag},rS=function(t){return{_tag:"Left",left:t}},rT=function(t){return{_tag:"Right",right:t}},rw=function(t){return[t]},rO=function(t){return t.length>0},rk=function(t){return t[0]},rC=function(t){return t.slice(1)},rI=[],rM={},rR=Object.prototype.hasOwnProperty,rE=function(t){return rm([t[0]],t.slice(1),!0)};function rj(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 rA(t){return function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}}}function rN(t){return function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}}function rP(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 rL(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 rD(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):rD(t,n-1,o)}}var rF={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 rW(t){return rR.call(rF,t)||(rF[t]=rD(ru,t-1,[])),rF[t]}function rU(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 rD(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 rz=Object.freeze(Object.defineProperty({__proto__:null,ap:rj,apFirst:rA,apS:rP,apSecond:rN,getApplySemigroup:rL,sequenceS:function(t){return function(n){for(var r=Object.keys(n),i=r.length,o=rU(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=rW(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 rB(t,n){return function(r){return function(i){return t.map(i,function(t){return n.map(t,r)})}}}function rV(t){return function(n){return function(r){return t.map(r,function(t){return t(n)})}}}function r$(t){return function(n){return function(r){return t.map(r,function(t){var r;return(r={})[n]=t,r})}}}function rq(t,n){var r=rB(t,n);return{map:function(t,n){return rd(t,r(n))}}}let rK=Object.freeze(Object.defineProperty({__proto__:null,bindTo:r$,flap:rV,getFunctorComposition:rq,map:rB},Symbol.toStringTag,{value:"Module"}));function rH(t){var n=rL(t);return function(r){return{concat:n(r).concat,empty:t.of(r.empty)}}}function rG(t,n){var r=rq(t,n).map,i=rj(t,n);return{map:r,of:function(r){return t.of(n.of(r))},ap:function(t,n){return rd(t,i(n))}}}let rZ=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeComposition:rG,getApplicativeMonoid:rH},Symbol.toStringTag,{value:"Module"}));function rY(t){return function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}}}function rJ(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 rQ=Object.freeze(Object.defineProperty({__proto__:null,bind:rJ,chainFirst:rY},Symbol.toStringTag,{value:"Module"}));function rX(t){return function(n){return function(r){return t.fromEither(rg(r)?rS(n()):rT(r.value))}}}function r0(t){return function(n,r){return function(i){return t.fromEither(n(i)?rT(i):rS(r(i)))}}}function r1(t){var n=rX(t);return function(t){var r=n(t);return function(t){return ra(t,r)}}}function r2(t,n){var r=r1(t);return function(t){var i=r(t);return function(t){return function(r){return n.chain(r,i(t))}}}}function r3(t){return function(n){return ra(n,t.fromEither)}}function r4(t,n){var r=r3(t);return function(t){return function(i){return n.chain(i,r(t))}}}function r5(t,n){return ra(r3(t),rY(n))}function r6(t,n){return function(r,i){return function(o){return n.chain(o,function(n){return t.fromEither(r(n)?rT(n):rS(i(n)))})}}}let r9=Object.freeze(Object.defineProperty({__proto__:null,chainEitherK:r4,chainFirstEitherK:r5,chainOptionK:r2,filterOrElse:r6,fromEitherK:r3,fromOption:rX,fromOptionK:r1,fromPredicate:r0},Symbol.toStringTag,{value:"Module"}));var r8=function(t){return{equals:function(n,r){return n===r||t(n,r)}}},r7=function(t){return r8(function(n,r){for(var i in t)if(!t[i].equals(n[i],r[i]))return!1;return!0})},ie=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r8(function(n,r){return t.every(function(t,i){return t.equals(n[i],r[i])})})},it=function(t){return function(n){return r8(function(r,i){return n.equals(t(r),t(i))})}},ir={equals:function(t,n){return t===n}},ii={equals:function(){return!0}},io=function(){return{concat:function(t,n){return r8(function(r,i){return t.equals(r,i)&&n.equals(r,i)})}}},ia=function(){return{concat:io().concat,empty:ii}},iu={URI:"Eq",contramap:function(t,n){return rd(t,it(n))}},is=ir.equals;let il=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:iu,URI:"Eq",contramap:it,eq:iu,eqBoolean:ir,eqDate:{equals:function(t,n){return t.valueOf()===n.valueOf()}},eqNumber:ir,eqStrict:ir,eqString:ir,fromEquals:r8,getMonoid:ia,getSemigroup:io,getStructEq:r7,getTupleEq:ie,strictEqual:is,struct:r7,tuple:ie},Symbol.toStringTag,{value:"Module"}));var ic=function(t){return function(n,r){return n===r||0===t(n,r)}},id=function(t){return{equals:ic(t),compare:function(n,r){return n===r?0:t(n,r)}}},ip=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return id(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])})},ih=function(t){return id(function(n,r){return t.compare(r,n)})},im=function(t){return function(n){return id(function(r,i){return n.compare(t(r),t(i))})}},ig=function(){return{concat:function(t,n){return id(function(r,i){var o=t.compare(r,i);return 0!==o?o:n.compare(r,i)})}}},iy=function(){return{concat:ig().concat,empty:id(function(){return 0})}},iv={URI:"Ord",contramap:function(t,n){return rd(t,im(n))}},ib={equals:rn,compare:rt(0)},ix=function(t){return function(n){return function(r){return r===n||0===t.compare(r,n)}}},i_=function(t){return function(n,r){return -1===t.compare(n,r)}},iS=function(t){return function(n,r){return 1===t.compare(n,r)}},iT=function(t){return function(n,r){return 1!==t.compare(n,r)}},iw=function(t){return function(n,r){return -1!==t.compare(n,r)}},iO=function(t){return function(n,r){return n===r||1>t.compare(n,r)?n:r}},ik=function(t){return function(n,r){return n===r||t.compare(n,r)>-1?n:r}},iC=function(t){var n=iO(t),r=ik(t);return function(t,i){return function(o){return r(n(o,i),t)}}},iI=function(t){var n=i_(t),r=iS(t);return function(t,i){return function(o){return!(n(o,t)||r(o,i))}}},iM={equals:ir.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},iR=rd(iM,im(function(t){return t.valueOf()}));let iE=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:iv,URI:"Ord",between:iI,clamp:iC,contramap:im,equals:ix,equalsDefault:ic,fromCompare:id,geq:iw,getDualOrd:ih,getMonoid:iy,getSemigroup:ig,getTupleOrd:ip,gt:iS,leq:iT,lt:i_,max:ik,min:iO,ord:iv,ordBoolean:iM,ordDate:iR,ordNumber:iM,ordString:iM,reverse:ih,trivial:ib,tuple:ip},Symbol.toStringTag,{value:"Module"}));var ij=function(t){return{concat:function(n,r){return t.concat(r,n)}}},iA=function(t){return function(n){return{concat:function(r,i){return t(r)?n.concat(r,i):i}}}},iN=function(t){return function(n){return{concat:function(r,i){return t(i)?n.concat(r,i):r}}}},iP=function(t){return function(n){return{concat:function(r,i){return n.concat(t(r),t(i))}}}},iL=function(t){return function(n){return function(r){return r.reduce(function(n,r){return t.concat(n,r)},n)}}};let iD=Object.freeze(Object.defineProperty({__proto__:null,concatAll:iL,endo:iP,filterFirst:iA,filterSecond:iN,reverse:ij},Symbol.toStringTag,{value:"Module"}));var iF=function(t){return{concat:iO(t)}},iW=function(t){return{concat:ik(t)}},iU=function(t){return{concat:function(){return t}}},iz=function(t){return{concat:function(n,r){var i={};for(var o in t)rR.call(t,o)&&(i[o]=t[o].concat(n[o],r[o]));return i}}},iB=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])})}}},iV=function(t){return function(n){return{concat:function(r,i){return n.concat(r,n.concat(t,i))}}}},i$=function(){return{concat:re}},iq=function(){return{concat:function(t,n){return n}}},iK=iU(void 0),iH=function(){return{concat:function(t,n){return Object.assign({},t,n)}}},iG={concat:function(t,n){return t&&n}},iZ={concat:function(t,n){return t||n}},iY={concat:function(t,n){return t+n}},iJ={concat:function(t,n){return t+n}},iQ={concat:function(t,n){return t*n}};let iX=Object.freeze(Object.defineProperty({__proto__:null,concatAll:iL,constant:iU,first:i$,fold:function(t){var n=iL(t);return function(t,r){return void 0===r?n(t):n(t)(r)}},getDualSemigroup:ij,getFirstSemigroup:i$,getFunctionSemigroup:n5,getIntercalateSemigroup:iV,getJoinSemigroup:iW,getLastSemigroup:iq,getMeetSemigroup:iF,getObjectSemigroup:iH,getStructSemigroup:iz,getTupleSemigroup:iB,intercalate:iV,last:iq,max:iW,min:iF,reverse:ij,semigroupAll:iG,semigroupAny:iZ,semigroupProduct:iQ,semigroupString:iY,semigroupSum:iJ,semigroupVoid:iK,struct:iz,tuple:iB},Symbol.toStringTag,{value:"Module"}));var i0=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))},i1=function(t,n){return t<0||t>=n.length},i2=function(t){return function(n){return i0([t],n,!0)}},i3=function(t){return function(n){return i0(i0([],n,!0),[t],!1)}},i4=function(t,n,r){if(rO(r)){var i=rE(r);return i.splice(t,0,n),i}return[n]},i5=function(t,n,r){if(r[t]===n)return r;var i=rE(r);return i[t]=n,i},i6=function(t){return function(n){if(1===n.length)return n;for(var r=[as(n)],i=al(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}},i9=function(t){if(rO(t)){var n=iy();return op(t.reduce(n.concat,n.empty))}return re},i8=function(t){var n=i6(t);return function(t){return function(r){return n(rd(r,ol(t)))}}},i7=function(t){return function(n){var r=n.length,i=Math.round(t)%r;if(i1(Math.abs(i),n)||0===i)return n;if(!(i<0))return i7(i-r)(n);var o=oS(-i)(n),a=o[0];return rd(o[1],ol(a))}},oe=function(t){return rO(t)?rb(t):rv},ot=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}},on=function(t){return ot(function(){return t})},or=function(t,n){return t<=n?ot(function(n){return t+n})(n-t+1):[t]},oi=function(t){return[as(t),al(t)]},oo=function(t){return[ad(t),ac(t)]},oa=function(t){return oe(t.slice())};function ou(t){return function(n){return n.concat(t)}}function ol(t,n){return n?t.concat(n):function(n){return n.concat(t)}}var oc=function(t){return 1===t.length?t:i0([ac(t)],t.slice(0,-1).reverse(),!0)};function od(t){return function(n){var r=n.length;if(0===r)return rI;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 of=function(t){return function(n){for(var r={},i=0;i<n.length;i++){var o=n[i],a=t(o);rR.call(r,a)?r[a].push(o):r[a]=[o]}return r}},op=function(t){return function(n){return 1===n.length?n:n.slice().sort(t.compare)}},oh=function(t,n){return om(t,function(){return n})},om=function(t,n){return function(r){return i1(t,r)?rv:rb(i5(t,n(r[t]),r))}},og=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},oy=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]},ov=function(t){return function(n){for(var r=[t,n[0]],i=1;i<n.length;i++)r.push(t,n[i]);return r}},ob=function(t){return function(n){var r=al(n);return rO(r)?rd(r,ov(t),i2(as(n))):n}},ox=function(t){return function(n){for(var r=rE(t(0,as(n))),i=1;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},o_=function(t){return function(n){for(var r=t(n),i=r[0],o=r[1],a=[i],u=o;rO(u);){var s=t(u),l=s[0],c=s[1];a.push(l),u=c}return a}},oS=function(t){return function(n){var r=Math.max(1,t);return r>=n.length?[n,rI]:[rd(n.slice(1,r),i2(as(n))),n.slice(r)]}},oT=function(t){return o_(oS(t))},ow=function(t,n){return rd(t,oq(n))},oO=function(t,n){return rd(t,oK(n))},ok=function(t,n){return rd(t,oU(n))},oC=function(t,n){return rd(t,oz(n))},oI=function(t,n){return rd(t,oB(n))},oM=function(t,n,r){return rd(t,oH(n,r))},oR=function(t){var n=oG(t);return function(t,r){return rd(t,n(r))}},oE=function(t,n,r){return rd(t,oZ(n,r))},oj=function(t){var n=oX(t);return function(t,r){return rd(t,n(r))}},oA=function(t,n){return rd(t,oW(n))},oN=function(t,n,r){return rd(t,oY(n,r))},oP=function(t){var n=oJ(t);return function(t,r){return rd(t,n(r))}},oL=function(t,n,r){return rd(t,oQ(n,r))},oD=function(t){var n=o1(t);return function(t,r){return rd(t,n(r))}},oF=function(t){return function(n){return rd(n,ou(t()))}},oW=oF,oU=function(t){return oz(function(n){return rd(t,oq(n))})},oz=function(t){return ox(function(n,r){return t(r)})},oB=function(t){return function(n){for(var r=al(n),i=[t(n)];rO(r);)i.push(t(r)),r=al(r);return i}},oV=oB(re),o$=oz(re),oq=function(t){return oK(function(n,r){return t(r)})},oK=function(t){return function(n){for(var r=[t(0,as(n))],i=1;i<n.length;i++)r.push(t(i,n[i]));return r}},oH=function(t,n){return oY(t,function(t,r,i){return n(r,i)})},oG=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]))}}},oZ=function(t,n){return oQ(t,function(t,r,i){return n(r,i)})},oY=function(t,n){return function(r){return r.reduce(function(t,r,i){return n(i,t,r)},t)}},oJ=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]))}}},oQ=function(t,n){return function(r){return r.reduceRight(function(t,r,i){return n(i,r,t)},t)}},oX=function(t){var n=o1(t);return function(t){return n(function(n,r){return t(r)})}},o0=function(t){return o1(t)(rf)},o1=function(t){return function(n){return function(r){for(var i=t.map(n(0,as(r)),rw),o=1;o<r.length;o++)i=t.ap(t.map(i,function(t){return function(n){return rd(t,i3(n))}}),n(o,r[o]));return i}}},o2="ReadonlyNonEmptyArray",o3=function(t){return{show:function(n){return"[".concat(n.map(t.show).join(", "),"]")}}},o4=function(){return{concat:ol}},o5=function(t){return r8(function(n,r){return n.length===r.length&&n.every(function(n,i){return t.equals(n,r[i])})})},o6=function(t){var n=i8(t);return{concat:function(t,r){return n(r)(t)}}},o9={URI:o2,map:ow},o8=rV(o9),o7={URI:o2,map:ow,ap:ok},ae=rA(o7),at=rN(o7),an={URI:o2,map:ow,ap:ok,chain:oC},ar=rY(an),ai=rw(rM),ao=r$(o9),aa=rJ(an),au=rP(o7),as=rk,al=rC,ac=function(t){return t[t.length-1]},ad=function(t){return t.slice(0,-1)},af=function(t){var n=iF(t);return function(t){return t.reduce(n.concat)}},ap=function(t){var n=iW(t);return function(t){return t.reduce(n.concat)}},ah=function(t){return function(n){return n.reduce(t.concat)}},am=function(t){return function(n){return t(as(n),al(n))}},ag=function(t){return function(n){return t(ad(n),ac(n))}},ay=function(t){return function(n){return i0([t(as(n))],al(n),!0)}},av=function(t){return ay(function(){return t})},ab=function(t){return function(n){return rd(ad(n),i3(t(ac(n))))}},ax=function(t){return ab(function(){return t})},a_=function(t){var n=ah(t);return function(t){return ra(ob(t),n)}},aS=function(t){return function(n){return oe(n.filter(function(n,r){return t(r,n)}))}};function aT(t,n){return void 0===n?i2(t):rd(n,i2(t))}var aw=function(t,n){return rd(t,ol([n]))},aO=function(t,n){return function(r){return t<0||t>r.length?rv:rb(i4(t,n,r))}};let ak=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:o2,map:ow,alt:oA},Applicative:{URI:o2,map:ow,ap:ok,of:rw},Apply:o7,Chain:an,Comonad:{URI:o2,map:ow,extend:oI,extract:rk},Do:ai,Foldable:{URI:o2,reduce:oM,foldMap:oR,reduceRight:oE},FoldableWithIndex:{URI:o2,reduce:oM,foldMap:oR,reduceRight:oE,reduceWithIndex:oN,foldMapWithIndex:oP,reduceRightWithIndex:oL},Functor:o9,FunctorWithIndex:{URI:o2,map:ow,mapWithIndex:oO},Monad:{URI:o2,map:ow,ap:ok,of:rw,chain:oC},Pointed:{URI:o2,of:rw},Traversable:{URI:o2,map:ow,reduce:oM,foldMap:oR,reduceRight:oE,traverse:oj,sequence:o0},TraversableWithIndex:{URI:o2,map:ow,mapWithIndex:oO,reduce:oM,foldMap:oR,reduceRight:oE,traverse:oj,sequence:o0,reduceWithIndex:oN,foldMapWithIndex:oP,reduceRightWithIndex:oL,traverseWithIndex:oD},URI:o2,alt:oW,altW:oF,ap:oU,apFirst:ae,apS:au,apSecond:at,append:i3,appendW:i3,bind:aa,bindTo:ao,chain:oz,chainFirst:ar,chainWithIndex:ox,chop:o_,chunksOf:oT,concat:ol,concatAll:ah,concatW:ou,cons:aT,duplicate:oV,empty:rI,extend:oB,extract:rk,filter:function(t){return aS(function(n,r){return t(r)})},filterWithIndex:aS,flap:o8,flatten:o$,fold:ah,foldMap:oG,foldMapWithIndex:oJ,fromArray:oa,fromReadonlyArray:oe,getEq:o5,getSemigroup:o4,getShow:o3,getUnionSemigroup:o6,group:od,groupBy:of,groupSort:function(t){var n=op(t),r=od(t);return function(t){return rO(t)?r(n(t)):rI}},head:as,init:ad,insertAt:aO,intercalate:a_,intersperse:ob,isNonEmpty:rO,isOutOfBound:i1,last:ac,makeBy:ot,map:oq,mapWithIndex:oK,matchLeft:am,matchRight:ag,max:ap,min:af,modifyAt:om,modifyHead:ay,modifyLast:ab,of:rw,prepend:i2,prependAll:ov,prependToAll:ov,prependW:i2,range:or,readonlyNonEmptyArray:{URI:o2,of:rw,map:ow,mapWithIndex:oO,ap:ok,chain:oC,extend:oI,extract:rk,reduce:oM,foldMap:oR,reduceRight:oE,traverse:oj,sequence:o0,reduceWithIndex:oN,foldMapWithIndex:oP,reduceRightWithIndex:oL,traverseWithIndex:oD,alt:oA},reduce:oH,reduceRight:oZ,reduceRightWithIndex:oQ,reduceWithIndex:oY,replicate:on,reverse:oc,rotate:i7,sequence:o0,snoc:aw,sort:op,sortBy:i9,splitAt:oS,tail:al,traverse:oX,traverseWithIndex:o1,unappend:oo,uncons:oi,union:i8,uniq:i6,unprepend:oi,unsafeInsertAt:i4,unsafeUpdateAt:i5,unsnoc:oo,unzip:oy,updateAt:oh,updateHead:av,updateLast:ax,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:og(n,r,function(t,n){return[t,n]})},zipWith:og},Symbol.toStringTag,{value:"Module"}));var aC=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))},aI=function(t){return t.length>0},aM=function(t,n){return t<0||t>=n.length},aR=function(t){return function(n){return aC([t],n,!0)}},aE=function(t){return function(n){return aC(aC([],n,!0),[t],!1)}},aj=function(t,n,r){if(aI(r)){var i=aF(r);return i.splice(t,0,n),i}return[n]},aA=function(t,n,r){var i=aF(r);return i[t]=n,i},aN=function(t){return function(n){if(1===n.length)return a0(n);for(var r=[u$(n)],i=uq(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}},aP=function(t){if(aI(t)){var n=iy();return aY(t.reduce(n.concat,n.empty))}return a0},aL=function(t){var n=aN(t);return function(t){return function(r){return n(rd(r,aK(t)))}}},aD=function(t){return function(n){var r=n.length,i=Math.round(t)%r;if(aM(Math.abs(i),n)||0===i)return a0(n);if(!(i<0))return aD(i-r)(n);var o=a8(-i)(n),a=o[0];return rd(o[1],aK(a))}},aF=rE,aW=function(t){return aI(t)?rb(t):rv},aU=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}},az=function(t){return aU(function(){return t})},aB=function(t,n){return t<=n?aU(function(n){return t+n})(n-t+1):[t]},aV=function(t){return[u$(t),uq(t)]},a$=function(t){return[uH(t),uK(t)]};function aq(t){return function(n){return n.concat(t)}}function aK(t,n){return n?t.concat(n):function(n){return n.concat(t)}}var aH=function(t){return aC([uK(t)],t.slice(0,-1).reverse(),!0)};function aG(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 aZ=function(t){return function(n){for(var r={},i=0;i<n.length;i++){var o=n[i],a=t(o);rR.call(r,a)?r[a].push(o):r[a]=[o]}return r}},aY=function(t){return function(n){return n.slice().sort(t.compare)}},aJ=function(t,n){return function(r){return t<0||t>r.length?rv:rb(aj(t,n,r))}},aQ=function(t,n){return aX(t,function(){return n})},aX=function(t,n){return function(r){return aM(t,r)?rv:rb(aA(t,n(r[t]),r))}},a0=aF,a1=function(t){return[t]},a2=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},a3=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]},a4=function(t){return function(n){for(var r=[t,n[0]],i=1;i<n.length;i++)r.push(t,n[i]);return r}},a5=function(t){return function(n){var r=uq(n);return aI(r)?rd(r,a4(t),aR(u$(n))):a0(n)}},a6=function(t){return function(n){for(var r=aF(t(0,u$(n))),i=1;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},a9=function(t){return function(n){for(var r=t(n),i=r[0],o=r[1],a=[i],u=o;aI(u);){var s=t(u),l=s[0],c=s[1];a.push(l),u=c}return a}},a8=function(t){return function(n){var r=Math.max(1,t);return r>=n.length?[a0(n),[]]:[rd(n.slice(1,r),aR(u$(n))),n.slice(r)]}},a7=function(t){return a9(a8(t))},ue=function(t,n){return rd(t,u_(n))},ut=function(t,n){return rd(t,uS(n))},un=function(t,n){return rd(t,ug(n))},ur=function(t,n){return rd(t,uy(n))},ui=function(t,n){return rd(t,uv(n))},uo=function(t,n,r){return rd(t,uT(n,r))},ua=function(t){var n=oG(t);return function(t,r){return rd(t,n(r))}},uu=function(t,n,r){return rd(t,uO(n,r))},us=function(t){var n=uC(t);return function(t,r){return rd(t,n(r))}},ul=function(t,n){return rd(t,um(n))},uc=function(t,n,r){return rd(t,uw(n,r))},ud=function(t){var n=oJ(t);return function(t,r){return rd(t,n(r))}},uf=function(t,n,r){return rd(t,uk(n,r))},up=function(t){var n=uM(t);return function(t,r){return rd(t,n(r))}},uh=function(t){return function(n){return rd(n,aq(t()))}},um=uh,ug=function(t){return uy(function(n){return rd(t,u_(n))})},uy=function(t){return a6(function(n,r){return t(r)})},uv=function(t){return function(n){for(var r=uq(n),i=[t(n)];aI(r);)i.push(t(r)),r=uq(r);return i}},ub=uv(re),ux=uy(re),u_=function(t){return uS(function(n,r){return t(r)})},uS=function(t){return function(n){for(var r=[t(0,u$(n))],i=1;i<n.length;i++)r.push(t(i,n[i]));return r}},uT=oH,uw=oY,uO=oZ,uk=oQ,uC=function(t){var n=uM(t);return function(t){return n(function(n,r){return t(r)})}},uI=function(t){return uM(t)(function(t,n){return n})},uM=function(t){return function(n){return function(r){for(var i=t.map(n(0,u$(r)),a1),o=1;o<r.length;o++)i=t.ap(t.map(i,function(t){return function(n){return rd(t,aE(n))}}),n(o,r[o]));return i}}},uR="NonEmptyArray",uE=function(){return{concat:aK}},uj=function(t){var n=aL(t);return{concat:function(t,r){return n(r)(t)}}},uA={URI:uR,map:ue},uN=rV(uA),uP={URI:uR,map:ue,ap:un},uL=rA(uP),uD=rN(uP),uF={URI:uR,map:ue,ap:un,chain:ur},uW=rY(uF),uU=a1(rM),uz=r$(uA),uB=rJ(uF),uV=rP(uP),u$=as,uq=function(t){return t.slice(1)},uK=ac,uH=function(t){return t.slice(0,-1)},uG=function(t){return function(n){return n.reduce(t.concat)}},uZ=function(t){return function(n){return t(u$(n),uq(n))}},uY=function(t){return function(n){return t(uH(n),uK(n))}},uJ=function(t){return function(n){return aC([t(u$(n))],uq(n),!0)}},uQ=function(t){return uJ(function(){return t})},uX=function(t){return function(n){return rd(uH(n),aE(t(uK(n))))}},u0=function(t){return uX(function(){return t})},u1=function(t){return function(n){return aW(n.filter(function(n,r){return t(r,n)}))}};function u2(t,n){return void 0===n?aR(t):rd(n,aR(t))}var u3=function(t,n){return rd(t,aE(n))};let u4=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:uR,map:ue,alt:ul},Applicative:{URI:uR,map:ue,ap:un,of:a1},Apply:uP,Chain:uF,Comonad:{URI:uR,map:ue,extend:ui,extract:as},Do:uU,Foldable:{URI:uR,reduce:uo,foldMap:ua,reduceRight:uu},FoldableWithIndex:{URI:uR,reduce:uo,foldMap:ua,reduceRight:uu,reduceWithIndex:uc,foldMapWithIndex:ud,reduceRightWithIndex:uf},Functor:uA,FunctorWithIndex:{URI:uR,map:ue,mapWithIndex:ut},Monad:{URI:uR,map:ue,ap:un,of:a1,chain:ur},Pointed:{URI:uR,of:a1},Traversable:{URI:uR,map:ue,reduce:uo,foldMap:ua,reduceRight:uu,traverse:us,sequence:uI},TraversableWithIndex:{URI:uR,map:ue,mapWithIndex:ut,reduce:uo,foldMap:ua,reduceRight:uu,traverse:us,sequence:uI,reduceWithIndex:uc,foldMapWithIndex:ud,reduceRightWithIndex:uf,traverseWithIndex:up},URI:uR,alt:um,altW:uh,ap:ug,apFirst:uL,apS:uV,apSecond:uD,append:aE,appendW:aE,bind:uB,bindTo:uz,chain:uy,chainFirst:uW,chainWithIndex:a6,chop:a9,chunksOf:a7,concat:aK,concatAll:uG,concatW:aq,cons:u2,copy:a0,duplicate:ub,extend:uv,extract:as,filter:function(t){return u1(function(n,r){return t(r)})},filterWithIndex:u1,flap:uN,flatten:ux,fold:ah,foldMap:oG,foldMapWithIndex:oJ,fromArray:aW,fromReadonlyNonEmptyArray:aF,getEq:o5,getSemigroup:uE,getShow:o3,getUnionSemigroup:uj,group:aG,groupBy:aZ,groupSort:function(t){var n=aY(t),r=aG(t);return function(t){return aI(t)?r(n(t)):[]}},head:u$,init:uH,insertAt:aJ,intercalate:a_,intersperse:a5,isNonEmpty:aI,isOutOfBound:aM,last:uK,makeBy:aU,map:u_,mapWithIndex:uS,matchLeft:uZ,matchRight:uY,max:ap,min:af,modifyAt:aX,modifyHead:uJ,modifyLast:uX,nonEmptyArray:{URI:uR,of:a1,map:ue,mapWithIndex:ut,ap:un,chain:ur,extend:ui,extract:as,reduce:uo,foldMap:ua,reduceRight:uu,traverse:us,sequence:uI,reduceWithIndex:uc,foldMapWithIndex:ud,reduceRightWithIndex:uf,traverseWithIndex:up,alt:ul},of:a1,prepend:aR,prependAll:a4,prependToAll:a4,prependW:aR,range:aB,reduce:uT,reduceRight:uO,reduceRightWithIndex:uk,reduceWithIndex:uw,replicate:az,reverse:aH,rotate:aD,sequence:uI,snoc:u3,sort:aY,sortBy:aP,splitAt:a8,tail:uq,traverse:uC,traverseWithIndex:uM,unappend:a$,uncons:aV,union:aL,uniq:aN,unprepend:aV,unsafeInsertAt:aj,unsafeUpdateAt:aA,unsnoc:a$,unzip:a3,updateAt:aQ,updateHead:uQ,updateLast:u0,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:a2(n,r,function(t,n){return[t,n]})},zipWith:a2},Symbol.toStringTag,{value:"Module"}));var u5=function(t){return"number"==typeof t},u6={equals:function(t,n){return t===n}},u9={equals:u6.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},u8={equals:u6.equals,compare:u9.compare,top:1/0,bottom:-1/0},u7={concat:function(t,n){return t-n}},se={concat:function(t,n){return t+n}},st={concat:function(t,n){return t*n}},sn={concat:se.concat,empty:0},sr={concat:st.concat,empty:1},si={add:se.concat,zero:0,mul:st.concat,one:1,sub:u7.concat,degree:function(t){return 1},div:function(t,n){return t/n},mod:function(t,n){return t%n}};let so=Object.freeze(Object.defineProperty({__proto__:null,Bounded:u8,Eq:u6,Field:si,MagmaSub:u7,MonoidProduct:sr,MonoidSum:sn,Ord:u9,SemigroupProduct:st,SemigroupSum:se,Show:{show:function(t){return JSON.stringify(t)}},isNumber:u5},Symbol.toStringTag,{value:"Module"}));var sa=function(t,n){return{left:t,right:n}},su=function(t,n){return rd(t,sc(n))},ss=function(t,n,r){return rd(t,sd(n,r))},sl=function(t){return function(n){return sa(sm(n),t(sg(n)))}},sc=function(t){return function(n){return sa(t(sm(n)),sg(n))}},sd=function(t,n){return function(r){return sa(t(sm(r)),n(sg(r)))}},sf="Separated",sp={URI:sf,map:function(t,n){return rd(t,sl(n))}},sh=rV(sp),sm=function(t){return t.left},sg=function(t){return t.right};let sy=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:sf,mapLeft:su,bimap:ss},Functor:sp,URI:sf,bimap:sd,flap:sh,left:sm,map:sl,mapLeft:sc,right:sg,separated:sa},Symbol.toStringTag,{value:"Module"}));function sv(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.separate)}}}function sb(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.compact)}}}function sx(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?rb(r):rv})})}}}}let s_=Object.freeze(Object.defineProperty({__proto__:null,filterE:sx,wiltDefault:sv,witherDefault:sb},Symbol.toStringTag,{value:"Module"}));function sS(t,n){return function(r){return r?n.of(void 0):t.zero()}}let sT=Object.freeze(Object.defineProperty({__proto__:null,guard:sS},Symbol.toStringTag,{value:"Module"}));var sw=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))},sO=function(t){return 0===t.length},sk=function(t,n){return t<=0?cW:ot(n)(t)},sC=function(t,n){return sk(t,function(){return n})},sI=function(t){return rg(t)?cW:[t.value]},sM=function(t){return rx(t)?cW:[t.right]},sR=function(t,n){return function(r){return rO(r)?n(r):t()}},sE=function(t,n){return function(r){return rO(r)?n(as(r),al(r)):t()}},sj=function(t,n){return function(r){return rO(r)?n(ad(r),ac(r)):t()}},sA=function(t){return function(n){if(sO(n))return cW;for(var r=[],i=0;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},sN=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}},sP=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}},sL=function(t){return t.length};function sD(t,n){return void 0===n?function(n){return sD(t,n)}:i1(t,n)?rv:rb(n[t])}var sF=function(t){return rO(t)?rb(as(t)):rv},sW=function(t){return rO(t)?rb(ac(t)):rv},sU=function(t){return rO(t)?rb(al(t)):rv},sz=function(t){return rO(t)?rb(ad(t)):rv},sB=function(t){return function(n){return i1(t,n)?n:0===t?cW:n.slice(0,t)}},sV=function(t){return function(n){return i1(t,n)?n:0===t?cW:n.slice(-t)}},s$=function(t,n){for(var r=t.length,i=0;i<r&&n(t[i]);i++);return i},sq=function(t){return function(n){return t<=0||sO(n)?n:t>=n.length?cW:n.slice(t,n.length)}},sK=function(t){return function(n){return t<=0||sO(n)?n:t>=n.length?cW:n.slice(0,n.length-t)}},sH=function(t){return function(n){for(var r=0;r<n.length;r++)if(t(n[r]))return rb(r);return rv}};function sG(t){return function(n){for(var r=0;r<n.length;r++)if(t(n[r]))return rb(n[r]);return rv}}var sZ=function(t){return function(n){for(var r=0;r<n.length;r++){var i=t(n[r]);if(ry(i))return i}return rv}};function sY(t){return function(n){for(var r=n.length-1;r>=0;r--)if(t(n[r]))return rb(n[r]);return rv}}var sJ=function(t){return function(n){for(var r=n.length-1;r>=0;r--){var i=t(n[r]);if(ry(i))return i}return rv}},sQ=function(t){return function(n){for(var r=n.length-1;r>=0;r--)if(t(n[r]))return rb(r);return rv}},sX=function(t,n){return function(r){return t<0||t>r.length?rv:rb(i4(t,n,r))}},s0=function(t,n){return s2(t,function(){return n})},s1=function(t){return function(n){return i1(t,n)?rv:rb(cL(t,n))}},s2=function(t,n){return function(r){return i1(t,r)?rv:rb(cP(t,n(r[t]),r))}},s3=function(t){return t.length<=1?t:t.slice().reverse()},s4=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Right"===i._tag&&n.push(i.right)}return n},s5=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Left"===i._tag&&n.push(i.left)}return n},s6=function(t){return function(n){return n.length<=1?n:n.slice().sort(t.compare)}},s9=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},s8=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]},s7=function(t){var n=ov(t);return function(t){return rO(t)?n(t):t}},le=function(t){var n=ob(t);return function(t){return rO(t)?n(t):t}},lt=function(t){var n=i7(t);return function(t){return rO(t)?n(t):t}};function ln(t){return function(n,r){if(void 0===r){var i,o=ln(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 lr=function(t){var n=i6(t);return function(t){return rO(t)?n(t):t}},li=function(t){var n=i9(t);return function(t){return rO(t)?n(t):t}},lo=function(t){var n=o_(t);return function(t){return rO(t)?n(t):cW}},la=function(t){return function(n){return t>=1&&rO(n)?oS(t)(n):sO(n)?[n,cW]:[cW,n]}},lu=function(t){var n=oT(t);return function(t){return rO(t)?n(t):cW}},ls=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return sI(t.apply(void 0,n))}},ll=function(t){return function(n){return sO(n)?t:sO(t)?n:n.concat(t)}};function lc(t){var n=i8(t);return function(r,i){if(void 0===i){var o=lc(t);return function(t){return o(t,r)}}return rO(r)&&rO(i)?n(i)(r):rO(r)?r:i}}function ld(t){var n=ln(t);return function(r,i){if(void 0===i){var o=ld(t);return function(t){return o(t,r)}}return r.filter(function(t){return n(t,i)})}}function lf(t){var n=ln(t);return function(r,i){if(void 0===i){var o=lf(t);return function(t){return o(t,r)}}return r.filter(function(t){return!n(t,i)})}}var lp=function(t,n){return rd(t,lV(n))},lh=function(t,n){return rd(t,l$(n))},lm=function(t,n){return rd(t,lU(n))},lg=function(t,n){return rd(t,lz(n))},ly=function(t,n){return rd(t,lK(n))},lv=function(t,n){return rd(t,lG(n))},lb=function(t,n){return rd(t,lY(n))},lx=function(t,n){return rd(t,lQ(n))},l_=function(t,n){return rd(t,lJ(n))},lS=function(t,n){return rd(t,lX(n))},lT=function(t,n){return rd(t,lW(n))},lw=function(t,n,r){return rd(t,l4(n,r))},lO=function(t){var n=l5(t);return function(t,r){return rd(t,n(r))}},lk=function(t,n,r){return rd(t,l9(n,r))},lC=function(t,n,r){return rd(t,l6(n,r))},lI=function(t){var n=l3(t);return function(t,r){return rd(t,n(r))}},lM=function(t,n,r){return rd(t,l8(n,r))},lR=function(t,n){return rd(t,lH(n))},lE=function(t,n){return rd(t,l0(n))},lj=function(t,n){return rd(t,l1(n))},lA=function(t){var n=l7(t);return function(t,r){return rd(t,n(r))}},lN=function(t){var n=ct(t);return function(t,r){return rd(t,n(r))}},lP=function(t,n){return rd(t,cC(n))},lL=function(t,n){return rd(t,cI(n))},lD=function(){return cW},lF=function(t){return function(n){return n.concat(t())}},lW=lF,lU=function(t){return lz(function(n){return rd(t,lV(n))})},lz=function(t){return function(n){return rd(n,sA(function(n,r){return t(r)}))}},lB=lz(re),lV=function(t){return function(n){return n.map(function(n){return t(n)})}},l$=function(t){return function(n){return n.map(function(n,r){return t(r,n)})}},lq=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 sa(n,r)},lK=function(t){return function(n){return n.filter(t)}},lH=function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=t(i,n[i]);ry(o)&&r.push(o.value)}return r}},lG=function(t){return lH(function(n,r){return t(r)})},lZ=lG(re),lY=function(t){return lJ(function(n,r){return t(r)})},lJ=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 sa(r,i)}},lQ=function(t){return lX(function(n,r){return t(r)})},lX=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 sa(r,i)}},l0=function(t){return function(n){return n.filter(function(n,r){return t(r,n)})}},l1=function(t){return function(n){return n.map(function(r,i){return t(n.slice(i))})}},l2=l1(re),l3=function(t){return function(n){return function(r){return r.reduce(function(r,i,o){return t.concat(r,n(o,i))},t.empty)}}},l4=function(t,n){return l6(t,function(t,r,i){return n(r,i)})},l5=function(t){var n=l3(t);return function(t){return n(function(n,r){return t(r)})}},l6=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}},l9=function(t,n){return l8(t,function(t,r,i){return n(r,i)})},l8=function(t,n){return function(r){return r.reduceRight(function(t,r,i){return n(i,r,t)},t)}},l7=function(t){var n=ct(t);return function(t){return n(function(n,r){return t(r)})}},ce=function(t){return function(n){return lw(n,t.of(lD()),function(n,r){return t.ap(t.map(n,function(t){return function(n){return rd(t,i3(n))}}),r)})}},ct=function(t){return function(n){return l6(t.of(lD()),function(r,i,o){return t.ap(t.map(i,function(t){return function(n){return rd(t,i3(n))}}),n(r,o))})}},cn=function(t){var n=cM(t);return function(t){return function(r){return n(r,t)}}},cr=function(t){var n=cR(t);return function(t){return function(r){return n(r,t)}}},ci=function(t,n){for(var r=[],i=t;;){var o=n(i);if(ry(o)){var a=o.value,u=a[0],s=a[1];r.push(u),i=s}else break}return r},co="ReadonlyArray",ca=function(t){return{show:function(n){return"[".concat(n.map(t.show).join(", "),"]")}}},cu=function(){return{concat:function(t,n){return sO(t)?n:sO(n)?t:t.concat(n)}}},cs=function(){return{concat:cu().concat,empty:cW}},cl=function(t){return r8(function(n,r){return n.length===r.length&&n.every(function(n,i){return t.equals(n,r[i])})})},cc=function(t){return id(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 u9.compare(i,o)})},cd=function(t){var n=lc(t);return{concat:function(t,r){return n(r)(t)}}},cf=function(t){return{concat:cd(t).concat,empty:cW}},cp=function(t){var n=ld(t);return{concat:function(t,r){return n(r)(t)}}},ch=function(t){var n=lf(t);return{concat:function(t,r){return n(r)(t)}}},cm={URI:co,map:lp},cg=rV(cm),cy={URI:co,of:rw},cv={URI:co,map:lp,ap:lm},cb=rA(cv),cx=rN(cv),c_={URI:co,map:lp,ap:lm,chain:lg},cS=rY(c_),cT={URI:co,zero:lD},cw=sS(cT,cy),cO={URI:co,compact:lZ,separate:lq},ck={URI:co,map:lp,reduce:lw,foldMap:lO,reduceRight:lk,traverse:lA,sequence:ce},cC=function(t){return function(n){for(var r=sw([],t(n),!0),i=[];r.length>0;){var o=r.shift();rx(o)?r.unshift.apply(r,t(o.left)):i.push(o.right)}return i}},cI=function(t){return function(n){var r=t(n),i=[],o=[];function a(n){rx(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}},cM=sb(ck,cO),cR=sv(ck,cO),cE={URI:co,map:lp,compact:lZ,separate:lq,filter:ly,filterMap:lv,partition:lb,partitionMap:lx,reduce:lw,foldMap:lO,reduceRight:lk,traverse:lA,sequence:ce,wither:cM,wilt:cR},cj=sx(cE),cA={URI:co,fromEither:sM},cN=r3(cA),cP=function(t,n,r){return rO(r)?i5(t,n,r):r},cL=function(t,n){var r=n.slice();return r.splice(t,1),r},cD=function(t){return t.slice()},cF=function(t){return sO(t)?cW:t.slice()},cW=rI;function cU(t){return function(n){return n.every(t)}}var cz=function(t){return function(n){return n.some(t)}},cB=function(t){var n=a_(t);return function(r){return sR(function(){return t.empty},n(r))}},cV=rw(rM),c$=r$(cm),cq=rJ(c_),cK=rP(cv);let cH=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:co,map:lp,alt:lT},Alternative:{URI:co,map:lp,ap:lm,of:rw,alt:lT,zero:lD},Applicative:{URI:co,map:lp,ap:lm,of:rw},Apply:cv,Chain:c_,ChainRecBreadthFirst:{URI:co,map:lp,ap:lm,chain:lg,chainRec:lL},ChainRecDepthFirst:{URI:co,map:lp,ap:lm,chain:lg,chainRec:lP},Compactable:cO,Do:cV,Extend:{URI:co,map:lp,extend:lj},Filterable:{URI:co,map:lp,compact:lZ,separate:lq,filter:ly,filterMap:lv,partition:lb,partitionMap:lx},FilterableWithIndex:{URI:co,map:lp,mapWithIndex:lh,compact:lZ,separate:lq,filter:ly,filterMap:lv,partition:lb,partitionMap:lx,partitionMapWithIndex:lS,partitionWithIndex:l_,filterMapWithIndex:lR,filterWithIndex:lE},Foldable:{URI:co,reduce:lw,foldMap:lO,reduceRight:lk},FoldableWithIndex:{URI:co,reduce:lw,foldMap:lO,reduceRight:lk,reduceWithIndex:lC,foldMapWithIndex:lI,reduceRightWithIndex:lM},FromEither:cA,Functor:cm,FunctorWithIndex:{URI:co,map:lp,mapWithIndex:lh},Monad:{URI:co,map:lp,ap:lm,of:rw,chain:lg},Pointed:cy,Traversable:ck,TraversableWithIndex:{URI:co,map:lp,mapWithIndex:lh,reduce:lw,foldMap:lO,reduceRight:lk,reduceWithIndex:lC,foldMapWithIndex:lI,reduceRightWithIndex:lM,traverse:lA,sequence:ce,traverseWithIndex:lN},URI:co,Unfoldable:{URI:co,unfold:ci},Witherable:cE,Zero:cT,_chainRecBreadthFirst:lL,_chainRecDepthFirst:lP,alt:lW,altW:lF,ap:lU,apFirst:cb,apS:cK,apSecond:cx,append:i3,appendW:i3,bind:cq,bindTo:c$,chain:lz,chainFirst:cS,chainRecBreadthFirst:cI,chainRecDepthFirst:cC,chainWithIndex:sA,chop:lo,chunksOf:lu,compact:lZ,comprehension:function(t,n,r){void 0===r&&(r=function(){return!0});var i=function(t,o){return rO(o)?rd(as(o),lz(function(n){return i(rd(t,i3(n)),al(o))})):r.apply(void 0,t)?[n.apply(void 0,t)]:cW};return i(cW,t)},concat:ll,concatW:ll,cons:aT,deleteAt:s1,difference:lf,dropLeft:sq,dropLeftWhile:function(t){return function(n){var r=s$(n,t);return 0===r?n:r===n.length?cW:n.slice(r)}},dropRight:sK,duplicate:l2,elem:ln,empty:cW,every:cU,exists:cz,extend:l1,filter:lK,filterE:cj,filterMap:lG,filterMapWithIndex:lH,filterWithIndex:l0,findFirst:sG,findFirstMap:sZ,findIndex:sH,findLast:sY,findLastIndex:sQ,findLastMap:sJ,flap:cg,flatten:lB,foldLeft:sE,foldMap:l5,foldMapWithIndex:l3,foldRight:sj,fromArray:cF,fromEither:sM,fromEitherK:cN,fromOption:sI,fromOptionK:ls,fromPredicate:function(t){return function(n){return t(n)?[n]:cW}},getDifferenceMagma:ch,getEq:cl,getIntersectionSemigroup:cp,getMonoid:cs,getOrd:cc,getSemigroup:cu,getShow:ca,getUnionMonoid:cf,getUnionSemigroup:cd,guard:cw,head:sF,init:sz,insertAt:sX,intercalate:cB,intersection:ld,intersperse:le,isEmpty:sO,isNonEmpty:rO,isOutOfBound:i1,last:sW,lefts:s5,lookup:sD,makeBy:sk,map:lV,mapWithIndex:l$,match:sR,matchLeft:sE,matchLeftW:sE,matchRight:sj,matchRightW:sj,matchW:sR,modifyAt:s2,of:rw,partition:lY,partitionMap:lQ,partitionMapWithIndex:lX,partitionWithIndex:lJ,prepend:i2,prependAll:s7,prependToAll:s7,prependW:i2,range:or,readonlyArray:{URI:co,compact:lZ,separate:lq,map:lp,ap:lm,of:rw,chain:lg,filter:ly,filterMap:lv,partition:lb,partitionMap:lx,mapWithIndex:lh,partitionMapWithIndex:lS,partitionWithIndex:l_,filterMapWithIndex:lR,filterWithIndex:lE,alt:lT,zero:lD,unfold:ci,reduce:lw,foldMap:lO,reduceRight:lk,traverse:lA,sequence:ce,reduceWithIndex:lC,foldMapWithIndex:lI,reduceRightWithIndex:lM,traverseWithIndex:lN,extend:lj,wither:cM,wilt:cR},reduce:l4,reduceRight:l9,reduceRightWithIndex:l8,reduceWithIndex:l6,replicate:sC,reverse:s3,rights:s4,rotate:lt,scanLeft:sN,scanRight:sP,separate:lq,sequence:ce,size:sL,snoc:aw,some:cz,sort:s6,sortBy:li,spanLeft:function(t){return function(n){var r,i=la(s$(n,t))(n);return{init:i[0],rest:i[1]}}},splitAt:la,tail:sU,takeLeft:sB,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?cW:r}},takeRight:sV,toArray:cD,traverse:l7,traverseWithIndex:ct,unfold:ci,union:lc,uniq:lr,unsafeDeleteAt:cL,unsafeInsertAt:i4,unsafeUpdateAt:cP,unzip:s8,updateAt:s0,wilt:cr,wither:cn,zero:lD,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:s9(n,r,function(t,n){return[t,n]})},zipWith:s9},Symbol.toStringTag,{value:"Module"}));var cG=function(t){return 0===t.length},cZ=function(t,n){return t<=0?[]:aU(n)(t)},cY=function(t,n){return cZ(t,function(){return n})},cJ=function(t){return rg(t)?[]:[t.value]},cQ=function(t){return rx(t)?[]:[t.right]},cX=function(t,n){return function(r){return aI(r)?n(r):t()}},c0=function(t,n){return function(r){return aI(r)?n(u$(r),uq(r)):t()}},c1=function(t,n){return function(r){return aI(r)?n(uH(r),uK(r)):t()}},c2=function(t){return function(n){for(var r=[],i=0;i<n.length;i++)r.push.apply(r,t(i,n[i]));return r}},c3=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}},c4=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}},c5=function(t){return t.length},c6=function(t){return aI(t)?rb(uq(t)):rv},c9=function(t){return aI(t)?rb(uH(t)):rv},c8=function(t){return function(n){return aM(t,n)?da(n):n.slice(0,t)}},c7=function(t){return function(n){return aM(t,n)?da(n):0===t?[]:n.slice(-t)}},de=function(t,n){for(var r=t.length,i=0;i<r&&n(t[i]);i++);return i},dt=function(t){return function(n){return t<=0||cG(n)?da(n):t>=n.length?[]:n.slice(t,n.length)}},dn=function(t){return function(n){return t<=0||cG(n)?da(n):t>=n.length?[]:n.slice(0,n.length-t)}};function dr(t){return sG(t)}function di(t){return sY(t)}var da=function(t){return t.slice()},du=function(t,n){return function(r){return t<0||t>r.length?rv:rb(fK(t,n,r))}},ds=function(t,n){return dc(t,function(){return n})},dl=function(t){return function(n){return aM(t,n)?rv:rb(fG(t,n))}},dc=function(t,n){return function(r){return aM(t,r)?rv:rb(fH(t,n(r[t]),r))}},dd=function(t){return cG(t)?[]:t.slice().reverse()},df=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Right"===i._tag&&n.push(i.right)}return n},dp=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r];"Left"===i._tag&&n.push(i.left)}return n},dh=function(t){return function(n){return n.length<=1?da(n):n.slice().sort(t.compare)}},dm=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},dg=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]},dy=function(t){var n=a4(t);return function(t){return aI(t)?n(t):[]}},dv=function(t){var n=a5(t);return function(t){return aI(t)?n(t):da(t)}},db=function(t){var n=aD(t);return function(t){return aI(t)?n(t):da(t)}},dx=function(t){var n=aN(t);return function(t){return aI(t)?n(t):da(t)}},d_=function(t){var n=aP(t);return function(t){return aI(t)?n(t):da(t)}},dS=function(t){var n=a9(t);return function(t){return aI(t)?n(t):[]}},dT=function(t){return function(n){return t>=1&&aI(n)?a8(t)(n):cG(n)?[da(n),[]]:[[],da(n)]}},dw=function(t){var n=a7(t);return function(t){return aI(t)?n(t):[]}},dO=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return cJ(t.apply(void 0,n))}},dk=function(t){return function(n){return cG(n)?da(t):cG(t)?da(n):n.concat(t)}};function dC(t){var n=aL(t);return function(r,i){if(void 0===i){var o=dC(t);return function(t){return o(t,r)}}return aI(r)&&aI(i)?n(i)(r):aI(r)?da(r):da(i)}}function dI(t){var n=ln(t);return function(r,i){if(void 0===i){var o=dI(t);return function(t){return o(t,r)}}return r.filter(function(t){return n(t,i)})}}function dM(t){var n=ln(t);return function(r,i){if(void 0===i){var o=dM(t);return function(t){return o(t,r)}}return r.filter(function(t){return!n(t,i)})}}var dR=function(t,n){return rd(t,dX(n))},dE=function(t,n){return rd(t,d3(n))},dj=function(t,n){return rd(t,d0(n))},dA=function(t,n){return rd(t,d1(n))},dN=function(t,n){return rd(t,d8(n))},dP=function(t,n){return rd(t,d5(n))},dL=function(t,n){return rd(t,d7(n))},dD=function(t,n){return rd(t,ft(n))},dF=function(t,n){return rd(t,fe(n))},dW=function(t,n){return rd(t,fn(n))},dU=function(t,n){return rd(t,fi(n))},dz=function(t,n,r){return rd(t,fc(n,r))},dB=function(t){var n=fs(t);return function(t,r){return rd(t,n(r))}},dV=function(t,n,r){return rd(t,ff(n,r))},d$=function(t,n,r){return rd(t,fd(n,r))},dq=function(t){var n=fl(t);return function(t,r){return rd(t,n(r))}},dK=function(t,n,r){return rd(t,fp(n,r))},dH=function(t,n){return rd(t,d4(n))},dG=function(t,n){return rd(t,fo(n))},dZ=function(t,n){return rd(t,fa(n))},dY=function(t){var n=fh(t);return function(t,r){return rd(t,n(r))}},dJ=function(t){var n=fg(t);return function(t,r){return rd(t,n(r))}},dQ=function(){return[]},dX=function(t){return function(n){return n.map(function(n){return t(n)})}},d0=function(t){return d1(function(n){return rd(t,dX(n))})},d1=function(t){return function(n){return rd(n,c2(function(n,r){return t(r)}))}},d2=d1(re),d3=function(t){return function(n){return n.map(function(n,r){return t(r,n)})}},d4=function(t){return function(n){for(var r=[],i=0;i<n.length;i++){var o=t(i,n[i]);ry(o)&&r.push(o.value)}return r}},d5=function(t){return d4(function(n,r){return t(r)})},d6=d5(re),d9=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 sa(n,r)},d8=function(t){return function(n){return n.filter(t)}},d7=function(t){return fe(function(n,r){return t(r)})},fe=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 sa(r,i)}},ft=function(t){return fn(function(n,r){return t(r)})},fn=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 sa(r,i)}},fr=function(t){return function(n){return n.concat(t())}},fi=fr,fo=function(t){return function(n){return n.filter(function(n,r){return t(r,n)})}},fa=function(t){return function(n){return n.map(function(r,i){return t(n.slice(i))})}},fu=fa(re),fs=l5,fl=l3,fc=l4,fd=l6,ff=l9,fp=l8,fh=function(t){var n=fg(t);return function(t){return n(function(n,r){return t(r)})}},fm=function(t){return function(n){return dz(n,t.of(dQ()),function(n,r){return t.ap(t.map(n,function(t){return function(n){return rd(t,aE(n))}}),r)})}},fg=function(t){return function(n){return fd(t.of(dQ()),function(r,i,o){return t.ap(t.map(i,function(t){return function(n){return rd(t,aE(n))}}),n(r,o))})}},fy=function(t){var n=fU(t);return function(t){return function(r){return n(r,t)}}},fv=function(t){var n=fz(t);return function(t){return function(r){return n(r,t)}}},fb=function(t,n){for(var r=[],i=t;;){var o=n(i);if(ry(o)){var a=o.value,u=a[0],s=a[1];r.push(u),i=s}else break}return r},fx="Array",f_=function(){return{concat:function(t,n){return t.concat(n)}}},fS=function(){return{concat:f_().concat,empty:[]}},fT=function(t){var n=dC(t);return{concat:function(t,r){return n(r)(t)}}},fw=function(t){return{concat:fT(t).concat,empty:[]}},fO=function(t){var n=dI(t);return{concat:function(t,r){return n(r)(t)}}},fk=function(t){var n=dM(t);return{concat:function(t,r){return n(r)(t)}}},fC={URI:fx,map:dR},fI=rV(fC),fM={URI:fx,of:a1},fR={URI:fx,map:dR,ap:dj},fE=rA(fR),fj=rN(fR),fA={URI:fx,map:dR,ap:dj,chain:dA},fN=rY(fA),fP={URI:fx,zero:dQ},fL=sS(fP,fM),fD={URI:fx,compact:d6,separate:d9},fF={URI:fx,reduce:dz,foldMap:dB,reduceRight:dV},fW={URI:fx,map:dR,reduce:dz,foldMap:dB,reduceRight:dV,traverse:dY,sequence:fm},fU=sb(fW,fD),fz=sv(fW,fD),fB={URI:fx,map:dR,compact:d6,separate:d9,filter:dN,filterMap:dP,partition:dL,partitionMap:dD,reduce:dz,foldMap:dB,reduceRight:dV,traverse:dY,sequence:fm,wither:fU,wilt:fz},fV=sx(fB),f$={URI:fx,fromEither:cQ},fq=r3(f$),fK=aj,fH=function(t,n,r){return aI(r)?aA(t,n,r):[]},fG=function(t,n){var r=n.slice();return r.splice(t,1),r},fZ=function(t){return function(n){return n.some(t)}},fY=a1(rM),fJ=r$(fC),fQ=rJ(fA),fX=rP(fR);let f0=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:fx,map:dR,alt:dU},Alternative:{URI:fx,map:dR,ap:dj,of:a1,alt:dU,zero:dQ},Applicative:{URI:fx,map:dR,ap:dj,of:a1},Apply:fR,Chain:fA,ChainRecBreadthFirst:{URI:fx,map:dR,ap:dj,chain:dA,chainRec:lL},ChainRecDepthFirst:{URI:fx,map:dR,ap:dj,chain:dA,chainRec:lP},Compactable:fD,Do:fY,Extend:{URI:fx,map:dR,extend:dZ},Filterable:{URI:fx,map:dR,compact:d6,separate:d9,filter:dN,filterMap:dP,partition:dL,partitionMap:dD},FilterableWithIndex:{URI:fx,map:dR,mapWithIndex:dE,compact:d6,separate:d9,filter:dN,filterMap:dP,partition:dL,partitionMap:dD,partitionMapWithIndex:dW,partitionWithIndex:dF,filterMapWithIndex:dH,filterWithIndex:dG},Foldable:fF,FoldableWithIndex:{URI:fx,reduce:dz,foldMap:dB,reduceRight:dV,reduceWithIndex:d$,foldMapWithIndex:dq,reduceRightWithIndex:dK},FromEither:f$,Functor:fC,FunctorWithIndex:{URI:fx,map:dR,mapWithIndex:dE},Monad:{URI:fx,map:dR,ap:dj,of:a1,chain:dA},Pointed:fM,Traversable:fW,TraversableWithIndex:{URI:fx,map:dR,mapWithIndex:dE,reduce:dz,foldMap:dB,reduceRight:dV,reduceWithIndex:d$,foldMapWithIndex:dq,reduceRightWithIndex:dK,traverse:dY,sequence:fm,traverseWithIndex:dJ},URI:fx,Unfoldable:{URI:fx,unfold:fb},Witherable:fB,Zero:fP,alt:fi,altW:fr,ap:d0,apFirst:fE,apS:fX,apSecond:fj,append:aE,appendW:aE,array:{URI:fx,compact:d6,separate:d9,map:dR,ap:dj,of:a1,chain:dA,filter:dN,filterMap:dP,partition:dL,partitionMap:dD,mapWithIndex:dE,partitionMapWithIndex:dW,partitionWithIndex:dF,filterMapWithIndex:dH,filterWithIndex:dG,alt:dU,zero:dQ,unfold:fb,reduce:dz,foldMap:dB,reduceRight:dV,traverse:dY,sequence:fm,reduceWithIndex:d$,foldMapWithIndex:dq,reduceRightWithIndex:dK,traverseWithIndex:dJ,extend:dZ,wither:fU,wilt:fz},bind:fQ,bindTo:fJ,chain:d1,chainFirst:fN,chainRecBreadthFirst:cI,chainRecDepthFirst:cC,chainWithIndex:c2,chop:dS,chunksOf:dw,compact:d6,comprehension:function(t,n,r){void 0===r&&(r=function(){return!0});var i=function(t,o){return aI(o)?rd(u$(o),d1(function(n){return i(rd(t,aE(n)),uq(o))})):r.apply(void 0,t)?[n.apply(void 0,t)]:[]};return i([],t)},concat:dk,concatW:dk,cons:u2,copy:da,deleteAt:dl,difference:dM,dropLeft:dt,dropLeftWhile:function(t){return function(n){return n.slice(de(n,t))}},dropRight:dn,duplicate:fu,elem:ln,empty:[],every:cU,exists:fZ,extend:fa,filter:d8,filterE:fV,filterMap:d5,filterMapWithIndex:d4,filterWithIndex:fo,findFirst:dr,findFirstMap:sZ,findIndex:sH,findLast:di,findLastIndex:sQ,findLastMap:sJ,flap:fI,flatten:d2,foldLeft:c0,foldMap:fs,foldMapWithIndex:fl,foldRight:c1,fromEither:cQ,fromEitherK:fq,fromOption:cJ,fromOptionK:dO,fromPredicate:function(t){return function(n){return t(n)?[n]:[]}},getDifferenceMagma:fk,getEq:cl,getIntersectionSemigroup:fO,getMonoid:fS,getOrd:cc,getSemigroup:f_,getShow:ca,getUnionMonoid:fw,getUnionSemigroup:fT,guard:fL,head:sF,init:c9,insertAt:du,intercalate:cB,intersection:dI,intersperse:dv,isEmpty:cG,isNonEmpty:aI,isOutOfBound:aM,last:sW,lefts:dp,lookup:sD,makeBy:cZ,map:dX,mapWithIndex:d3,match:cX,matchLeft:c0,matchLeftW:c0,matchRight:c1,matchRightW:c1,matchW:cX,modifyAt:dc,of:a1,partition:d7,partitionMap:ft,partitionMapWithIndex:fn,partitionWithIndex:fe,prepend:aR,prependAll:dy,prependToAll:dy,prependW:aR,range:aB,reduce:fc,reduceRight:ff,reduceRightWithIndex:fp,reduceWithIndex:fd,replicate:cY,reverse:dd,rights:df,rotate:db,scanLeft:c3,scanRight:c4,separate:d9,sequence:fm,size:c5,snoc:u3,some:fZ,sort:dh,sortBy:d_,spanLeft:function(t){return function(n){var r,i=dT(de(n,t))(n);return{init:i[0],rest:i[1]}}},splitAt:dT,tail:c6,takeLeft:c8,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:c7,traverse:fh,traverseWithIndex:fg,unfold:fb,union:dC,uniq:dx,unsafeDeleteAt:fG,unsafeInsertAt:fK,unsafeUpdateAt:fH,unzip:dg,updateAt:ds,wilt:fv,wither:fy,zero:dQ,zip:function t(n,r){return void 0===r?function(r){return t(r,n)}:dm(n,r,function(t,n){return[t,n]})},zipWith:dm},Symbol.toStringTag,{value:"Module"})),f1=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var f2=function(t){return"boolean"==typeof t},f3=function(t,n){return function(r){return r?n():t()}},f4={equals:function(t,n){return t===n}},f5={concat:function(t,n){return t&&n}},f6={concat:function(t,n){return t||n}},f9={concat:f5.concat,empty:!0},f8={concat:f6.concat,empty:!1},f7={equals:f4.equals,compare:function(t,n){return t<n?-1:t>n?1:0}};let pe=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:f4,MonoidAll:f9,MonoidAny:f8,Ord:f7,SemigroupAll:f5,SemigroupAny:f6,Show:{show:function(t){return JSON.stringify(t)}},fold:f3,foldW:f3,isBoolean:f2,match:f3,matchW:f3},Symbol.toStringTag,{value:"Module"}));var pt=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 pn=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:pt,getFunctionBooleanAlgebra:n4,reverse:pt},Symbol.toStringTag,{value:"Module"}));var pr=function(t){return iC(t)(t.bottom,t.top)},pi=function(t){var n=ih(t);return{equals:n.equals,compare:n.compare,top:t.bottom,bottom:t.top}},po={equals:iM.equals,compare:iM.compare,top:1/0,bottom:-1/0};let pa=Object.freeze(Object.defineProperty({__proto__:null,boundedNumber:po,clamp:pr,reverse:pi},Symbol.toStringTag,{value:"Module"}));function pu(t){return{meet:iO(t),join:ik(t)}}let ps=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:pu},Symbol.toStringTag,{value:"Module"})),pl=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:function(t){var n=pu(t);return function(t,r){return{join:n.join,meet:n.meet,zero:t,one:r}}}},Symbol.toStringTag,{value:"Module"})),pc=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),pd=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),pf=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),pp=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var ph=function(t,n){for(var r=n(t);"Left"===r._tag;)r=n(r.left);return r.right};let pm=Object.freeze(Object.defineProperty({__proto__:null,tailRec:ph},Symbol.toStringTag,{value:"Module"}));function pg(t,n){return function(r,i){return n.compose(t.right(i),t.left(r))}}function py(t,n){var r=pg(t,n);return function(i,o){return n.compose(t.promap(n.id(),function(t){return"Left"===t._tag?t.left:t.right},re),r(i,o))}}let pv=Object.freeze(Object.defineProperty({__proto__:null,fanIn:py,fanin:function(t){return py(t,t)},split:pg,splitChoice:function(t){return pg(t,t)}},Symbol.toStringTag,{value:"Module"})),pb=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var px=function(t,n){return rd(t,p_(n))},p_=function(t){return function(n){return ra(t,n)}},pS="Predicate",pT=function(){return{concat:function(t,n){return rd(t,pI(n))}}},pw=function(){return{concat:pT().concat,empty:rr}},pO=function(){return{concat:function(t,n){return rd(t,pM(n))}}},pk=function(){return{concat:pO().concat,empty:rn}},pC=function(t){return function(n){return!t(n)}},pI=function(t){return function(n){return function(r){return n(r)||t(r)}}},pM=function(t){return function(n){return function(r){return n(r)&&t(r)}}};let pR=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:{URI:pS,contramap:px},URI:pS,and:pM,contramap:p_,getMonoidAll:pk,getMonoidAny:pw,getSemigroupAll:pO,getSemigroupAny:pT,not:pC,or:pI},Symbol.toStringTag,{value:"Module"}));function pE(t){return function(n){return t(n)?rb(n):rv}}var pj=function(t){return"Right"===t._tag?rv:rb(t.left)},pA=function(t){return"Left"===t._tag?rv:rb(t.right)},pN=function(t,n){return rd(t,pQ(n))},pP=function(t,n){return rd(t,p1(n))},pL=function(t,n){return rd(t,p4(n))},pD=function(t,n,r){return rd(t,p6(n,r))},pF=function(t){var n=p9(t);return function(t,r){return rd(t,n(r))}},pW=function(t,n,r){return rd(t,p8(n,r))},pU=function(t){var n=hh(t);return function(t,r){return rd(t,n(r))}},pz=function(t,n){return rd(t,he(n))},pB=function(t,n){return rd(t,hl(n))},pV=function(t,n){return rd(t,hc(n))},p$=function(t,n){return rd(t,hi(n))},pq=function(t,n){return rd(t,hd(n))},pK=function(t,n){return rd(t,hf(n))},pH="Option",pG=function(t){return{show:function(n){return hw(n)?"none":"some(".concat(t.show(n.value),")")}}},pZ=function(t){return{equals:function(n,r){return n===r||(hw(n)?hw(r):!hw(r)&&t.equals(n.value,r.value))}}},pY=function(t){return{equals:pZ(t).equals,compare:function(n,r){return n===r?0:hT(n)?hT(r)?t.compare(n.value,r.value):1:-1}}},pJ=function(t){return{concat:function(n,r){return hw(n)?r:hw(r)?n:rb(t.concat(n.value,r.value))},empty:rv}},pQ=function(t){return function(n){return hw(n)?rv:rb(t(n.value))}},pX={URI:pH,map:pN},p0={URI:pH,of:rb},p1=function(t){return function(n){return hw(n)||hw(t)?rv:rb(n.value(t.value))}},p2={URI:pH,map:pN,ap:pP},p3={URI:pH,map:pN,ap:pP,of:rb},p4=function(t){return function(n){return hw(n)?rv:t(n.value)}},p5={URI:pH,map:pN,ap:pP,chain:pL},p6=function(t,n){return function(r){return hw(r)?t:n(t,r.value)}},p9=function(t){return function(n){return function(r){return hw(r)?t.empty:n(r.value)}}},p8=function(t,n){return function(r){return hw(r)?t:n(r.value,t)}},p7=function(t){return function(n){return hw(n)?t():n}},he=p7,ht=function(){return rv},hn={URI:pH,zero:ht},hr=sS(hn,p0),hi=function(t){return function(n){return hw(n)?rv:rb(t(n))}},ho=p4(re),ha=sa(rv,rv),hu=function(t){return hw(t)?ha:sa(pj(t.value),pA(t.value))},hs={URI:pH,compact:ho,separate:hu},hl=function(t){return function(n){return hw(n)?rv:t(n.value)?n:rv}},hc=function(t){return function(n){return hw(n)?rv:t(n.value)}},hd=function(t){return function(n){return sa(pB(n,pC(t)),pB(n,t))}},hf=function(t){return ra(pQ(t),hu)},hp={URI:pH,map:pN,compact:ho,separate:hu,filter:pB,filterMap:pV,partition:pq,partitionMap:pK},hh=function(t){return function(n){return function(r){return hw(r)?t.of(rv):t.map(n(r.value),rb)}}},hm=function(t){return function(n){return hw(n)?t.of(rv):t.map(n.value,rb)}},hg={URI:pH,map:pN,reduce:pD,foldMap:pF,reduceRight:pW,traverse:pU,sequence:hm},hy=sb(hg,hs),hv=sv(hg,hs),hb=function(t){var n=hy(t);return function(t){return function(r){return n(r,t)}}},hx=function(t){var n=hv(t);return function(t){return function(r){return n(r,t)}}},h_=function(){return rv},hS={URI:pH,fromEither:pA},hT=ry,hw=function(t){return"None"===t._tag},hO=function(t,n){return function(r){return hw(r)?t():n(r.value)}},hk=function(t){return function(n){return hw(n)?t():n.value}},hC=rV(pX),hI=rA(p2),hM=rN(p2),hR=rY(p5),hE=hi(re),hj=r3(hS),hA=r4(hS,p5),hN=r5(hS,p5),hP=function(t){return null==t?rv:rb(t)},hL=function(t){try{return rb(t())}catch{return rv}},hD=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return hL(function(){return t.apply(void 0,n)})}},hF=function(t){return ra(t,hP)},hW=function(t){return function(n){return hw(n)?rv:hP(t(n.value))}},hU=hO(ri,re),hz=hO(ro,re),hB=function(t){return function(n){return!hw(n)&&t(n.value)}},hV=rb(rM),h$=r$(pX),hq=rJ(p5),hK=rP(p2),hH=rb(rI),hG=function(t){return function(n){var r=t(0,rk(n));if(hw(r))return rv;for(var i=[r.value],o=1;o<n.length;o++){var a=t(o,n[o]);if(hw(a))return rv;i.push(a.value)}return rb(i)}},hZ=function(t){var n=hG(t);return function(t){return rO(t)?n(t):hH}},hY=function(t){return hZ(function(n,r){return t(r)})},hJ=hY(re),hQ={URI:pH,map:pN,of:rb,ap:pP,chain:pL,reduce:pD,foldMap:pF,reduceRight:pW,traverse:pU,sequence:hm,zero:ht,alt:pz,extend:p$,compact:ho,separate:hu,filter:pB,filterMap:pV,partition:pq,partitionMap:pK,wither:hy,wilt:hv,throwError:h_},hX=rL(p2),h0=rH(p3),h1=function(){return pJ(i$())},h2=function(){return pJ(iq())};let h3=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:pH,map:pN,alt:pz},Alternative:{URI:pH,map:pN,ap:pP,of:rb,alt:pz,zero:ht},ApT:hH,Applicative:p3,Apply:p2,Chain:p5,Compactable:hs,Do:hV,Extend:{URI:pH,map:pN,extend:p$},Filterable:hp,Foldable:{URI:pH,reduce:pD,foldMap:pF,reduceRight:pW},FromEither:hS,Functor:pX,Monad:{URI:pH,map:pN,ap:pP,of:rb,chain:pL},MonadThrow:{URI:pH,map:pN,ap:pP,of:rb,chain:pL,throwError:h_},Pointed:p0,Traversable:hg,URI:pH,Witherable:{URI:pH,map:pN,reduce:pD,foldMap:pF,reduceRight:pW,traverse:pU,sequence:hm,compact:ho,separate:hu,filter:pB,filterMap:pV,partition:pq,partitionMap:pK,wither:hy,wilt:hv},Zero:hn,alt:he,altW:p7,ap:p1,apFirst:hI,apS:hK,apSecond:hM,bind:hq,bindTo:h$,chain:p4,chainEitherK:hA,chainFirst:hR,chainFirstEitherK:hN,chainNullableK:hW,compact:ho,duplicate:hE,elem:function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!hw(i)&&n.equals(r,i.value)}},exists:hB,extend:hi,filter:hl,filterMap:hc,flap:hC,flatten:ho,fold:hO,foldMap:p9,foldW:hO,fromEither:pA,fromEitherK:hj,fromNullable:hP,fromNullableK:hF,fromPredicate:pE,getApplyMonoid:h0,getApplySemigroup:hX,getEq:pZ,getFirstMonoid:h1,getLastMonoid:h2,getLeft:pj,getMonoid:pJ,getOrElse:hk,getOrElseW:hk,getOrd:pY,getRefinement:function(t){return function(n){return hT(t(n))}},getRight:pA,getShow:pG,guard:hr,isNone:hw,isSome:hT,map:pQ,mapNullable:hW,match:hO,matchW:hO,none:rv,of:rb,option:hQ,partition:hd,partitionMap:hf,reduce:p6,reduceRight:p8,separate:hu,sequence:hm,sequenceArray:hJ,some:rb,throwError:h_,toNullable:hU,toUndefined:hz,traverse:hh,traverseArray:hY,traverseArrayWithIndex:hZ,traverseReadonlyArrayWithIndex:hZ,traverseReadonlyNonEmptyArrayWithIndex:hG,tryCatch:hL,tryCatchK:hD,wilt:hx,wither:hb,zero:ht},Symbol.toStringTag,{value:"Module"}));function h4(t,n){return function(r){return t.map(r,n.compact)}}function h5(t,n,r){var i=h4(t,n),o=rB(t,r);return function(t){return sa(i(rd(t,o(pj))),i(rd(t,o(pA))))}}let h6=Object.freeze(Object.defineProperty({__proto__:null,compact:h4,getCompactableComposition:function(t,n){return{map:rq(t,n).map,compact:h4(t,n),separate:h5(t,n,n)}},separate:h5},Symbol.toStringTag,{value:"Module"}));var h9=function(t){return function(){return console.log(t)}},h8=function(t){return function(){return console.warn(t)}},h7=function(t){return function(){return console.error(t)}},me=function(t){return function(){return console.info(t)}};let mt=Object.freeze(Object.defineProperty({__proto__:null,error:h7,info:me,log:h9,warn:h8},Symbol.toStringTag,{value:"Module"}));function mn(t){return{URI:mf,_E:void 0,map:mo,ap:function(n,r){return re(t.concat(n,r))}}}function mr(t){var n=mn(t);return{URI:mf,_E:void 0,map:n.map,ap:n.ap,of:function(){return re(t.empty)}}}var mi=function(t,n){return rd(t,ms())},mo=function(t,n){return rd(t,ml())},ma=function(t,n,r){return rd(t,mc(n))},mu=function(t,n){return rd(t,md(n))},ms=function(){return re},ml=function(){return re},mc=function(t){return function(n){return re(t(n))}},md=function(t){return function(n){return re(t(n))}},mf="Const",mp={URI:mf,map:mo},mh=rV(mp);let mm=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:mf,bimap:ma,mapLeft:mu},Contravariant:{URI:mf,contramap:mi},Functor:mp,URI:mf,bimap:mc,const_:{URI:mf,map:mo,contramap:mi,bimap:ma,mapLeft:mu},contramap:ms,flap:mh,getApplicative:mr,getApply:mn,getBooleanAlgebra:re,getBounded:re,getEq:re,getHeytingAlgebra:re,getMonoid:re,getOrd:re,getRing:re,getSemigroup:re,getSemiring:re,getShow:function(t){return{show:function(n){return"make(".concat(t.show(n),")")}}},make:re,map:ml,mapLeft:md},Symbol.toStringTag,{value:"Module"})),mg=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var my=rd(u9,im(function(t){return t.valueOf()})),mv=function(){return new Date},mb=function(){return new Date().getTime()};let mx=Object.freeze(Object.defineProperty({__proto__:null,Eq:{equals:function(t,n){return t.valueOf()===n.valueOf()}},Ord:my,create:mv,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:mb},Symbol.toStringTag,{value:"Module"}));var m_=function(t,n){return rd(t,mB(n))},mS=function(t,n){return rd(t,mK(n))},mT=function(t,n){return rd(t,mY(n))},mw=function(t,n,r){return rd(t,mQ(n,r))},mO=function(t){return function(n,r){var i=mX(t);return rd(n,i(r))}},mk=function(t,n,r){return rd(t,m0(n,r))},mC=function(t){var n=m1(t);return function(t,r){return rd(t,n(r))}},mI=function(t,n,r){return rd(t,m4(n,r))},mM=function(t,n){return rd(t,m5(n))},mR=function(t,n){return rd(t,m9(n))},mE=function(t,n){return rd(t,m8(n))},mj=function(t,n){return ph(n(t),function(t){return gn(t)?rT(rS(t.left)):gn(t.right)?rS(n(t.right.left)):rT(rT(t.right.right))})},mA="Either",mN=function(t,n){return{show:function(r){return gn(r)?"left(".concat(t.show(r.left),")"):"right(".concat(n.show(r.right),")")}}},mP=function(t,n){return{equals:function(r,i){return r===i||(gn(r)?gn(i)&&t.equals(r.left,i.left):gr(i)&&n.equals(r.right,i.right))}}},mL=function(t){return{concat:function(n,r){return gn(r)?n:gn(n)?r:rT(t.concat(n.right,r.right))}}},mD=function(t){var n=rS(t.empty);return{URI:mA,_E:void 0,compact:function(t){return gn(t)?t:"None"===t.right._tag?n:rT(t.right.value)},separate:function(t){return gn(t)?sa(t,t):gn(t.right)?sa(rT(t.right.left),n):sa(n,rT(t.right.right))}}},mF=function(t){var n,r=rS(t.empty),i=mD(t),o=i.compact;return{URI:mA,_E:void 0,map:m_,compact:o,separate:i.separate,filter:function(t,n){return gn(t)||n(t.right)?t:r},filterMap:function(t,n){if(gn(t))return t;var i=n(t.right);return"None"===i._tag?r:rT(i.value)},partition:function(t,n){return gn(t)?sa(t,t):n(t.right)?sa(r,rT(t.right)):sa(rT(t.right),r)},partitionMap:function(t,n){if(gn(t))return sa(t,t);var i=n(t.right);return gn(i)?sa(rT(i.left),r):sa(r,rT(i.right))}}},mW=function(t){var n=mF(t),r=mD(t);return{URI:mA,_E:void 0,map:m_,compact:n.compact,separate:n.separate,filter:n.filter,filterMap:n.filterMap,partition:n.partition,partitionMap:n.partitionMap,traverse:mC,sequence:m2,reduce:mw,foldMap:mO,reduceRight:mk,wither:sb(m3,r),wilt:sv(m3,r)}},mU=function(t){return{URI:mA,_E:void 0,map:m_,ap:function(n,r){return gn(n)?gn(r)?rS(t.concat(n.left,r.left)):n:gn(r)?r:rT(n.right(r.right))},of:m$}},mz=function(t){return{URI:mA,_E:void 0,map:m_,alt:function(n,r){if(gr(n))return n;var i=r();return gn(i)?rS(t.concat(n.left,i.left)):i}}},mB=function(t){return function(n){return gn(n)?n:rT(t(n.right))}},mV={URI:mA,map:m_},m$=rT,mq=function(t){return function(n){return gn(n)?n:gn(t)?t:rT(n.right(t.right))}},mK=mq,mH={URI:mA,map:m_,ap:mS},mG={URI:mA,map:m_,ap:mS,of:m$},mZ=function(t){return function(n){return gn(n)?n:t(n.right)}},mY=mZ,mJ={URI:mA,map:m_,ap:mS,chain:mT},mQ=function(t,n){return function(r){return gn(r)?t:n(t,r.right)}},mX=function(t){return function(n){return function(r){return gn(r)?t.empty:n(r.right)}}},m0=function(t,n){return function(r){return gn(r)?t:n(r.right,t)}},m1=function(t){return function(n){return function(r){return gn(r)?t.of(rS(r.left)):t.map(n(r.right),rT)}}},m2=function(t){return function(n){return gn(n)?t.of(rS(n.left)):t.map(n.right,rT)}},m3={URI:mA,map:m_,reduce:mw,foldMap:mO,reduceRight:mk,traverse:mC,sequence:m2},m4=function(t,n){return function(r){return gn(r)?rS(t(r.left)):rT(n(r.right))}},m5=function(t){return function(n){return gn(n)?rS(t(n.left)):n}},m6=function(t){return function(n){return gn(n)?t():n}},m9=m6,m8=function(t){return function(n){return gn(n)?n:rT(t(n))}},m7={URI:mA,fromEither:re},ge=r0(m7),gt=rX(m7),gn=rx,gr=r_,gi=function(t,n){return function(r){return gn(r)?t(r.left):n(r.right)}},go=function(t){return function(n){return gn(n)?t(n.left):n.right}},ga=rV(mV),gu=rA(mH),gs=rN(mH),gl=rY(mJ),gc=mZ(re),gd=m8(re),gf=r1(m7),gp=r2(m7,mJ),gh=r6(m7,mJ),gm=function(t){return gn(t)?rT(t.left):rS(t.right)},gg=function(t){return function(n){return gn(n)?t(n.left):n}},gy=function(t){return function(n){return null==n?rS(t):rT(n)}},gv=function(t,n){try{return rT(t())}catch(r){return rS(n(r))}},gb=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return gv(function(){return t.apply(void 0,r)},n)}},gx=function(t){var n=gy(t);return function(t){return ra(t,n)}},g_=function(t){var n=gx(t);return function(t){return mY(n(t))}},gS=gi(re,re),gT=function(t){return function(n){return!gn(n)&&t(n.right)}},gw=m$(rM),gO=r$(mV),gk=rJ(mJ),gC=rP(mH),gI=m$(rI),gM=function(t){return function(n){var r=t(0,rk(n));if(gn(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o]);if(gn(a))return a;i.push(a.right)}return rT(i)}},gR=function(t){var n=gM(t);return function(t){return rO(t)?n(t):gI}},gE=function(t){return gR(function(n,r){return t(r)})},gj=gE(re),gA=function(t,n){return gv(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},n)},gN=rL(mH),gP=rH(mG),gL=function(t,n){return rL(mU(t))(n)},gD=function(t,n){return rH(mU(t))(n)};let gF=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:mA,map:m_,alt:mR},ApT:gI,Applicative:mG,Apply:mH,Bifunctor:{URI:mA,bimap:mI,mapLeft:mM},Chain:mJ,ChainRec:{URI:mA,map:m_,ap:mS,chain:mT,chainRec:mj},Do:gw,Extend:{URI:mA,map:m_,extend:mE},Foldable:{URI:mA,reduce:mw,foldMap:mO,reduceRight:mk},FromEither:m7,Functor:mV,Monad:{URI:mA,map:m_,ap:mS,of:m$,chain:mT},MonadThrow:{URI:mA,map:m_,ap:mS,of:m$,chain:mT,throwError:rS},Pointed:{URI:mA,of:m$},Traversable:m3,URI:mA,alt:m9,altW:m6,ap:mK,apFirst:gu,apFirstW:gu,apS:gC,apSW:gC,apSecond:gs,apSecondW:gs,apW:mq,bimap:m4,bind:gk,bindTo:gO,bindW:gk,chain:mY,chainFirst:gl,chainFirstW:gl,chainNullableK:g_,chainOptionK:gp,chainW:mZ,duplicate:gd,either:{URI:mA,map:m_,of:m$,ap:mS,chain:mT,reduce:mw,foldMap:mO,reduceRight:mk,traverse:mC,sequence:m2,bimap:mI,mapLeft:mM,alt:mR,extend:mE,chainRec:mj,throwError:rS},elem:function t(n){return function(r,i){if(void 0===i){var o=t(n);return function(t){return o(r,t)}}return!gn(i)&&n.equals(r,i.right)}},exists:gT,extend:m8,filterOrElse:gh,filterOrElseW:gh,flap:ga,flatten:gc,flattenW:gc,fold:gi,foldMap:mX,foldW:gi,fromNullable:gy,fromNullableK:gx,fromOption:gt,fromOptionK:gf,fromPredicate:ge,getAltValidation:mz,getApplicativeValidation:mU,getApplyMonoid:gP,getApplySemigroup:gN,getCompactable:mD,getEq:mP,getFilterable:mF,getOrElse:go,getOrElseW:go,getSemigroup:mL,getShow:mN,getValidation:function(t){var n=mU(t).ap,r=mz(t).alt;return{URI:mA,_E:void 0,map:m_,of:m$,chain:mT,bimap:mI,mapLeft:mM,reduce:mw,foldMap:mO,reduceRight:mk,extend:mE,traverse:mC,sequence:m2,chainRec:mj,throwError:rS,ap:n,alt:r}},getValidationMonoid:gD,getValidationSemigroup:gL,getWitherable:mW,isLeft:gn,isRight:gr,left:rS,map:mB,mapLeft:m5,match:gi,matchW:gi,of:m$,orElse:gg,orElseW:gg,parseJSON:function(t,n){return gv(function(){return JSON.parse(t)},n)},reduce:mQ,reduceRight:m0,right:rT,sequence:m2,sequenceArray:gj,stringifyJSON:gA,swap:gm,throwError:rS,toError:function(t){return t instanceof Error?t:Error(String(t))},toUnion:gS,traverse:m1,traverseArray:gE,traverseArrayWithIndex:gR,traverseReadonlyArrayWithIndex:gR,traverseReadonlyNonEmptyArrayWithIndex:gM,tryCatch:gv,tryCatchK:gb},Symbol.toStringTag,{value:"Module"}));function gW(t){return ra(rT,t.of)}function gU(t){return ra(rS,t.of)}function gz(t){return function(n){return t.map(n,rT)}}function gB(t){return function(n){return t.map(n,rS)}}function gV(t){return function(n){return ra(gy(n),t.of)}}function g$(t){var n=gV(t);return function(t){var r=n(t);return function(t){return ra(t,r)}}}function gq(t){var n=gG(t),r=g$(t);return function(t){var i=r(t);return function(t){return n(i(t))}}}function gK(t){return rB(t,mV)}function gH(t){return rj(t,mH)}function gG(t){return function(n){return function(r){return t.chain(r,function(r){return gn(r)?t.of(r):n(r.right)})}}}function gZ(t){return function(n){return function(r){return t.chain(r,function(r){return gn(r)?n():t.of(r)})}}}function gY(t){return function(n,r){return function(i){return t.map(i,m4(n,r))}}}function gJ(t){return function(n){return function(r){return t.map(r,m5(n))}}}function gQ(t,n){return function(r){return function(i){return t.chain(i,gi(function(i){return t.map(r(),m5(function(t){return n.concat(i,t)}))},gW(t)))}}}function gX(t){return function(n,r){return function(i){return t.map(i,gi(n,r))}}}function g0(t){return function(n,r){return function(i){return t.chain(i,gi(n,r))}}}function g1(t){return function(n){return function(r){return t.chain(r,gi(n,t.of))}}}function g2(t){return function(n){return function(r){return t.chain(r,function(r){return gn(r)?n(r.left):t.of(r)})}}}function g3(t){var n=g2(t);return function(r){return n(function(n){return t.map(r(n),function(t){return gn(t)?t:rS(n)})})}}function g4(t){return function(n){return function(r){return t.chain(r,gi(function(r){return t.map(n(r),rS)},function(n){return t.of(rT(n))}))}}}function g5(t){return function(n){return t.map(n,gm)}}function g6(t){return function(n){return t.map(n,gS)}}let g9=Object.freeze(Object.defineProperty({__proto__:null,alt:gZ,altValidation:gQ,ap:gH,bimap:gY,chain:gG,chainNullableK:gq,fromNullable:gV,fromNullableK:g$,getEitherM:function(t){var n=gH(t),r=gK(t),i=gG(t),o=gZ(t),a=gY(t),u=gJ(t),s=g0(t),l=g1(t),c=g2(t);return{map:function(t,n){return rd(t,r(n))},ap:function(t,r){return rd(t,n(r))},of:gW(t),chain:function(t,n){return rd(t,i(n))},alt:function(t,n){return rd(t,o(n))},bimap:function(t,n,r){return rd(t,a(n,r))},mapLeft:function(t,n){return rd(t,u(n))},fold:function(t,n,r){return rd(t,s(n,r))},getOrElse:function(t,n){return rd(t,l(n))},orElse:function(t,n){return rd(t,c(n))},swap:g5(t),rightM:gz(t),leftM:gB(t),left:gU(t)}},getOrElse:g1,left:gU,leftF:gB,map:gK,mapLeft:gJ,match:gX,matchE:g0,orElse:g2,orElseFirst:g3,orLeft:g4,right:gW,rightF:gz,swap:g5,toUnion:g6},Symbol.toStringTag,{value:"Module"}));var g8=function(){return{concat:function(t,n){return ra(t,n)}}},g7=function(){return{concat:g8().concat,empty:re}};let ye=Object.freeze(Object.defineProperty({__proto__:null,URI:"Endomorphism",getMonoid:g7,getSemigroup:g8},Symbol.toStringTag,{value:"Module"})),yt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function yn(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 yr=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:yn,lcm:function(t,n){var r=n.zero,i=yn(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 yi(t,n){return function(r){return function(i){return t.map(i,function(t){return n.filter(t,r)})}}}function yo(t,n){return function(r){return function(i){return t.map(i,function(t){return n.filterMap(t,r)})}}}function ya(t,n){var r=yi(t,n);return function(t){var n=r(pC(t)),i=r(t);return function(t){return sa(n(t),i(t))}}}function yu(t,n){var r=yo(t,n);return function(t){return function(n){return sa(rd(n,r(function(n){return pj(t(n))})),rd(n,r(function(n){return pA(t(n))})))}}}let ys=Object.freeze(Object.defineProperty({__proto__:null,filter:yi,filterMap:yo,getFilterableComposition:function(t,n){var r=rq(t,n).map,i=h4(t,n),o=h5(t,n,n),a=yi(t,n),u=yo(t,n),s=ya(t,n),l=yu(t,n);return{map:r,compact:i,separate:o,filter:function(t,n){return rd(t,a(n))},filterMap:function(t,n){return rd(t,u(n))},partition:function(t,n){return rd(t,s(n))},partitionMap:function(t,n){return rd(t,l(n))}}},partition:ya,partitionMap:yu},Symbol.toStringTag,{value:"Module"})),yl=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function yc(t,n){return function(r,i){return function(o){return t.reduce(o,r,function(t,r){return n.reduce(r,t,i)})}}}function yd(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 yf(t,n){return function(r,i){return function(o){return t.reduceRight(o,r,function(t,r){return n.reduceRight(t,r,i)})}}}function yp(t){return function(n){return t.reduce(n,[],function(t,n){return t.push(n),t})}}function yh(t,n){var r=yc(t,n),i=yd(t,n),o=yf(t,n);return{reduce:function(t,n,i){return rd(t,r(n,i))},foldMap:function(t){var n=i(t);return function(t,r){return rd(t,n(r))}},reduceRight:function(t,n,r){return rd(t,o(n,r))}}}let ym=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:yd,getFoldableComposition:yh,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:yc,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:yf,toArray:yp,toReadonlyArray:yp,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,rt),a)})}}},Symbol.toStringTag,{value:"Module"}));function yg(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 yy(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 yv(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 yb=Object.freeze(Object.defineProperty({__proto__:null,foldMapWithIndex:yy,getFoldableWithIndexComposition:function(t,n){var r=yh(t,n),i=yg(t,n),o=yy(t,n),a=yv(t,n);return{reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,reduceWithIndex:function(t,n,r){return rd(t,i(n,r))},foldMapWithIndex:function(t){var n=o(t);return function(t,r){return rd(t,n(r))}},reduceRightWithIndex:function(t,n,r){return rd(t,a(n,r))}}},reduceRightWithIndex:yv,reduceWithIndex:yg},Symbol.toStringTag,{value:"Module"}));function yx(t){return function(n){return ra(n,t.fromIO)}}function y_(t,n){return function(r){var i=ra(r,t.fromIO);return function(t){return n.chain(t,i)}}}function yS(t,n){var r=rY(n);return function(n){return r(ra(n,t.fromIO))}}let yT=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:yS,chainIOK:y_,fromIOK:yx},Symbol.toStringTag,{value:"Module"}));var yw=function(){return re},yO=function(t){return function(n){return function(r){return n(t(r))}}},yk=function(t){return function(n){return t(n)(n)}},yC=function(t,n){return rd(t,yj(n))},yI=function(t,n){return rd(t,yN(n))},yM=function(t,n){return rd(t,yL(n))},yR=function(t,n){return rd(t,yF(n))},yE=function(t,n,r){return rd(t,yW(n,r))},yj=function(t){return function(n){return function(r){return t(n(r))}}},yA=function(t){return function(n){return function(r){return n(r)(t(r))}}},yN=yA,yP=function(t){return function(n){return function(r){return t(n(r))(r)}}},yL=yP,yD=yP(re),yF=function(t){return function(n){return ra(t,n)}},yW=function(t,n){return function(r){return function(i){return n(r(t(i)))}}},yU=function(){return re},yz=function(t){return function(n){var r=n[0],i=n[1];return[t(r),i]}},yB=function(t){return function(n){var r;return[n[0],t(n[1])]}},yV=function(t){return gi(function(n){return rS(t(n))},rT)},y$=function(t){return gi(rS,function(n){return rT(t(n))})},yq="Reader",yK={URI:yq,map:yC},yH=rV(yK),yG={URI:yq,of:rt},yZ={URI:yq,map:yC,ap:yI},yY=rA(yZ),yJ=rN(yZ),yQ={URI:yq,map:yC,ap:yI,of:rt},yX={URI:yq,map:yC,ap:yI,chain:yM},y0={URI:yq,map:yC,of:rt,ap:yI,chain:yM},y1=rY(yX),y2=r$(yK),y3=rJ(yX),y4=rt(rM),y5=rP(yZ),y6=rt(rI),y9=function(t){return function(n){return function(r){for(var i=[t(0,rk(n))(r)],o=1;o<n.length;o++)i.push(t(o,n[o])(r));return i}}},y8=function(t){var n=y9(t);return function(t){return rO(t)?n(t):y6}},y7=function(t){return y8(function(n,r){return t(r)})},ve=y7(re),vt=rL(yZ),vn=rH(yQ);let vr=Object.freeze(Object.defineProperty({__proto__:null,ApT:y6,Applicative:yQ,Apply:yZ,Category:{URI:yq,compose:yR,id:yU},Chain:yX,Choice:{URI:yq,map:yC,promap:yE,left:yV,right:y$},Do:y4,Functor:yK,Monad:y0,Pointed:yG,Profunctor:{URI:yq,map:yC,promap:yE},Strong:{URI:yq,map:yC,promap:yE,first:yz,second:yB},URI:yq,ap:yN,apFirst:yY,apFirstW:yY,apS:y5,apSW:y5,apSecond:yJ,apSecondW:yJ,apW:yA,ask:yw,asks:re,asksReader:yk,asksReaderW:yk,bind:y3,bindTo:y2,bindW:y3,chain:yL,chainFirst:y1,chainFirstW:y1,chainW:yP,compose:yF,first:yz,flap:yH,flatten:yD,flattenW:yD,getMonoid:vn,getSemigroup:vt,id:yU,left:yV,local:yO,map:yj,of:rt,promap:yW,reader:{URI:yq,map:yC,of:rt,ap:yI,chain:yM,promap:yE,compose:yR,id:yU,first:yz,second:yB,left:yV,right:y$},right:y$,second:yB,sequenceArray:ve,traverseArray:y7,traverseArrayWithIndex:y8,traverseReadonlyArrayWithIndex:y8,traverseReadonlyNonEmptyArrayWithIndex:y9},Symbol.toStringTag,{value:"Module"}));function vi(t){return function(){return t.fromReader(yw())}}function vo(t){return t.fromReader}function va(t){return function(n){return ra(n,t.fromReader)}}function vu(t,n){var r=va(t);return function(t){return function(i){return n.chain(i,r(t))}}}function vs(t,n){return ra(va(t),rY(n))}let vl=Object.freeze(Object.defineProperty({__proto__:null,ask:vi,asks:vo,chainFirstReaderK:vs,chainReaderK:vu,fromReaderK:va},Symbol.toStringTag,{value:"Module"}));var vc=function(){return function(t){return[t,t]}},vd=function(t){return function(){return[void 0,t]}},vf=function(t){return function(n){return[void 0,t(n)]}},vp=function(t){return function(n){return[t(n),n]}},vh=function(t,n){return rd(t,vy(n))},vm=function(t,n){return rd(t,vv(n))},vg=function(t,n){return rd(t,vx(n))},vy=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=i[1];return[t(o),a]}}},vv=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]}}},vb=function(t){return function(n){return[t,n]}},vx=function(t){return function(n){return function(r){var i=n(r),o=i[0],a=i[1];return t(o)(a)}}},v_=vx(re),vS="State",vT={URI:vS,map:vh},vw=rV(vT),vO={URI:vS,map:vh,ap:vm},vk=rA(vO),vC=rN(vO),vI={URI:vS,map:vh,ap:vm,chain:vg},vM={URI:vS,map:vh,ap:vm,of:vb,chain:vg},vR=rY(vI),vE=function(t){return function(n){return n(t)[0]}},vj=function(t){return function(n){return n(t)[1]}},vA=r$(vT),vN=rJ(vI),vP=rP(vO),vL=function(t){return function(n){return function(r){for(var i=t(0,rk(n))(r),o=i[0],a=i[1],u=[o],s=a,l=1;l<n.length;l++){var c=t(l,n[l])(s),d=c[0],f=c[1];u.push(d),s=f}return[u,s]}}},vD=function(t){var n=vL(t);return function(t){return rO(t)?n(t):vb(rI)}},vF=function(t){return vD(function(n,r){return t(r)})},vW=vF(re),vU=function(t,n){return t(n)[0]},vz=function(t,n){return t(n)[1]};let vB=Object.freeze(Object.defineProperty({__proto__:null,Applicative:{URI:vS,map:vh,ap:vm,of:vb},Apply:vO,Chain:vI,FromState:{URI:vS,fromState:re},Functor:vT,Monad:vM,Pointed:{URI:vS,of:vb},URI:vS,ap:vv,apFirst:vk,apS:vP,apSecond:vC,bind:vN,bindTo:vA,chain:vx,chainFirst:vR,evalState:vU,evaluate:vE,execState:vz,execute:vj,flap:vw,flatten:v_,get:vc,gets:vp,map:vy,modify:vf,of:vb,put:vd,sequenceArray:vW,state:vM,traverseArray:vF,traverseArrayWithIndex:vD,traverseReadonlyArrayWithIndex:vD,traverseReadonlyNonEmptyArrayWithIndex:vL},Symbol.toStringTag,{value:"Module"}));function vV(t){return function(){return t.fromState(vc())}}function v$(t){return function(n){return t.fromState(vd(n))}}function vq(t){return ra(vf,t.fromState)}function vK(t){return ra(vp,t.fromState)}function vH(t){return function(n){return ra(n,t.fromState)}}function vG(t,n){var r=vH(t);return function(t){return function(i){return n.chain(i,r(t))}}}let vZ=Object.freeze(Object.defineProperty({__proto__:null,chainStateK:vG,fromStateK:vH,get:vV,gets:vK,modify:vq,put:v$},Symbol.toStringTag,{value:"Module"}));function vY(t){return function(n){return ra(n,t.fromTask)}}function vJ(t,n){return function(r){var i=ra(r,t.fromTask);return function(t){return n.chain(t,i)}}}function vQ(t,n){var r=rY(n);return function(n){return r(ra(n,t.fromTask))}}let vX=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:vQ,chainTaskK:vJ,fromTaskK:vY},Symbol.toStringTag,{value:"Module"}));function v0(t){return function(n){return ra(n,t.fromThese)}}let v1=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:v0},Symbol.toStringTag,{value:"Module"}));function v2(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 v3=Object.freeze(Object.defineProperty({__proto__:null,getFunctorWithIndexComposition:function(t,n){var r=rq(t,n).map,i=v2(t,n);return{map:r,mapWithIndex:function(t,n){return rd(t,i(n))}}},mapWithIndex:v2},Symbol.toStringTag,{value:"Module"})),v4=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),v5=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),v6=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var v9=function(t,n){return rd(t,ba(n))},v8=function(t,n){return rd(t,bu(n))},v7=function(t,n){return rd(t,bs(n))},be=function(t,n,r){return rd(t,bf(n,r))},bt=function(t){return function(t,n){return rd(t,bp()(n))}},bn=function(t,n,r){return rd(t,bh(n,r))},br=function(t,n){return rd(t,bv())},bi=function(t,n){return rd(t,bl(n))},bo=function(t){var n=bm(t);return function(t,r){return rd(t,n(r))}},ba=function(t){return function(n){return t(n)}},bu=function(t){return function(n){return n(t)}},bs=function(t){return function(n){return t(n)}},bl=function(t){return function(n){return t(n)}},bc=bl(re),bd=bs(re),bf=function(t,n){return function(r){return n(t,r)}},bp=function(){return function(t){return function(n){return t(n)}}},bh=function(t,n){return function(r){return n(r,t)}},bm=function(t){return function(n){return function(r){return t.map(n(r),re)}}},bg=function(t){return function(n){return t.map(n,re)}},by=function(){return re},bv=by,bb="Identity",bx={URI:bb,map:v9},b_=rV(bx),bS={URI:bb,map:v9,ap:v8},bT=rA(bS),bw=rN(bS),bO={URI:bb,map:v9,ap:v8,chain:v7},bk=rY(bO),bC=re(rM),bI=r$(bx),bM=rJ(bO),bR=rP(bS);let bE=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:bb,map:v9,alt:br},Applicative:{URI:bb,map:v9,ap:v8,of:re},Apply:bS,Chain:bO,ChainRec:{URI:bb,map:v9,ap:v8,chain:v7,chainRec:ph},Comonad:{URI:bb,map:v9,extend:bi,extract:re},Do:bC,Foldable:{URI:bb,reduce:be,foldMap:bt,reduceRight:bn},Functor:bx,Monad:{URI:bb,map:v9,ap:v8,of:re,chain:v7},Pointed:{URI:bb,of:re},Traversable:{URI:bb,map:v9,reduce:be,foldMap:bt,reduceRight:bn,traverse:bo,sequence:bg},URI:bb,alt:bv,altW:by,ap:bu,apFirst:bT,apS:bR,apSecond:bw,bind:bM,bindTo:bI,chain:bs,chainFirst:bk,duplicate:bc,extend:bl,extract:re,flap:b_,flatten:bd,foldMap:bp,getEq:re,getShow:re,identity:{URI:bb,map:v9,ap:v8,of:re,chain:v7,reduce:be,foldMap:bt,reduceRight:bn,traverse:bo,sequence:bg,alt:br,extract:re,extend:bi,chainRec:ph},map:ba,of:re,reduce:bf,reduceRight:bh,sequence:bg,traverse:bm},Symbol.toStringTag,{value:"Module"})),bj=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var bA=function(t,n){return function(){return n(t())}},bN=function(t,n){return function(){return t()(n())}},bP=function(t,n){return function(){return n(t())()}},bL=function(t,n){return function(){for(var r=n(t)();"Left"===r._tag;)r=n(r.left)();return r.right}},bD=function(t){return function(n){return bA(n,t)}},bF=function(t){return function(n){return bN(n,t)}},bW=function(t){return function(n){return bP(n,t)}},bU=bW(re),bz={URI:"IO",map:bA},bB=rV(bz),bV={URI:"IO",of:rt},b$={URI:"IO",map:bA,ap:bN},bq=rA(b$),bK=rN(b$),bH={URI:"IO",map:bA,ap:bN,of:rt},bG={URI:"IO",map:bA,ap:bN,chain:bP},bZ={URI:"IO",map:bA,ap:bN,of:rt,chain:bP},bY=rY(bG),bJ=rt(rM),bQ=r$(bz),bX=rJ(bG),b0=rP(b$),b1=rt(rI),b2=function(t){return function(n){return function(){for(var r=[t(0,rk(n))()],i=1;i<n.length;i++)r.push(t(i,n[i])());return r}}},b3=function(t){var n=b2(t);return function(t){return rO(t)?n(t):b1}},b4=function(t){return b3(function(n,r){return t(r)})},b5=b4(re),b6=rL(b$),b9=rH(bH);let b8=Object.freeze(Object.defineProperty({__proto__:null,ApT:b1,Applicative:bH,Apply:b$,Chain:bG,ChainRec:{URI:"IO",map:bA,ap:bN,chain:bP,chainRec:bL},Do:bJ,FromIO:{URI:"IO",fromIO:re},Functor:bz,Monad:bZ,MonadIO:{URI:"IO",map:bA,ap:bN,of:rt,chain:bP,fromIO:re},Pointed:bV,URI:"IO",ap:bF,apFirst:bq,apS:b0,apSecond:bK,bind:bX,bindTo:bQ,chain:bW,chainFirst:bY,flap:bB,flatten:bU,fromIO:re,getMonoid:b9,getSemigroup:b6,io:{URI:"IO",map:bA,of:rt,ap:bN,chain:bP,fromIO:re,chainRec:bL},map:bD,of:rt,sequenceArray:b5,traverseArray:b4,traverseArrayWithIndex:b3,traverseReadonlyArrayWithIndex:b3,traverseReadonlyNonEmptyArrayWithIndex:b2},Symbol.toStringTag,{value:"Module"}));var b7=gU(bV),xe=gW(bV),xt=gz(bz),xn=gB(bz),xr=gX(bz),xi=g0(bZ),xo=g1(bZ),xa=function(t,n){return function(){return gv(t,n)}},xu=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return xa(function(){return t.apply(void 0,r)},n)}},xs=g6(bz),xl=g2(bZ),xc=g3(bZ),xd=function(t){return xc(xz(t))},xf=g4(bZ),xp=g5(bz),xh=function(t,n){return rd(t,x_(n))},xm=function(t,n){return rd(t,xw(n))},xg=function(t,n){return rd(t,xO(function(t){return rd(n,x_(t))}))},xy=function(t,n){return rd(t,xO(n))},xv=function(t,n,r){return rd(t,xS(n,r))},xb=function(t,n){return rd(t,xT(n))},xx=function(t,n){return rd(t,xC(n))},x_=gK(bz),xS=gY(bz),xT=gJ(bz),xw=gH(b$),xO=gG(bZ),xk=xO(re),xC=gZ(bZ),xI="IOEither";function xM(t){var n=rj(b$,mU(t));return{URI:xI,_E:void 0,map:xh,ap:function(t,r){return rd(t,n(r))},of:xe}}function xR(t){var n=gQ(bZ,t);return{URI:xI,_E:void 0,map:xh,alt:function(t,r){return rd(t,n(r))}}}var xE=function(t){var n=mD(t);return{URI:xI,_E:void 0,compact:h4(bz,n),separate:h5(bz,n,mV)}},xj={URI:xI,map:xh},xA=rV(xj),xN={URI:xI,map:xh,ap:xm},xP=rA(xN),xL=rN(xN),xD={URI:xI,map:xh,ap:xm,of:xe},xF={URI:xI,map:xh,ap:xm,chain:xy},xW=rY(xF),xU={URI:xI,fromIO:xt},xz=yx(xU),xB=y_(xU,xF),xV=yS(xU,xF),x$={URI:xI,fromEither:rt},xq=rX(x$),xK=r1(x$),xH=r2(x$,xF),xG=r4(x$,xF),xZ=r5(x$,xF),xY=r0(x$),xJ=r6(x$,xF),xQ=r3(x$),xX=function(t,n,r){return x0(t,n,r)},x0=function(t,n,r){return rd(t,xO(function(t){return rd(n(t),bW(function(n){return rd(r(t,n),xO(function(){return rt(n)}))}))}))},x1=xe(rM),x2=r$(xj),x3=rJ(xF),x4=rP(xN),x5=xe(rI),x6=function(t){return ra(b2(t),bD(gM(rf)))},x9=function(t){var n=x6(t);return function(t){return rO(t)?n(t):x5}},x8=function(t){return function(n){return function(){var r=t(0,rk(n))();if(rx(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o])();if(rx(a))return a;i.push(a.right)}return rT(i)}}},x7=function(t){var n=x8(t);return function(t){return rO(t)?n(t):x5}},_e=function(t){return x9(function(n,r){return t(r)})},_t=_e(re),_n=function(t){return x7(function(n,r){return t(r)})},_r=_n(re),_i=rL(xN),_o=rH(xD),_a=function(t){return rL(b$)(mL(t))};let _u=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:xI,map:xh,alt:xx},ApT:x5,Applicative:xD,ApplicativePar:xD,ApplicativeSeq:{URI:xI,map:xh,ap:xg,of:xe},ApplyPar:xN,Bifunctor:{URI:xI,bimap:xv,mapLeft:xb},Chain:xF,Do:x1,FromEither:x$,FromIO:xU,Functor:xj,Monad:{URI:xI,map:xh,ap:xm,of:xe,chain:xy},MonadIO:{URI:xI,map:xh,ap:xm,of:xe,chain:xy,fromIO:xt},MonadThrow:{URI:xI,map:xh,ap:xm,of:xe,chain:xy,throwError:b7},Pointed:{URI:xI,of:xe},URI:xI,alt:xC,altW:xC,ap:xw,apFirst:xP,apFirstW:xP,apS:x4,apSW:x4,apSecond:xL,apSecondW:xL,apW:xw,bimap:xS,bind:x3,bindTo:x2,bindW:x3,bracket:xX,bracketW:x0,chain:xO,chainEitherK:xG,chainEitherKW:xG,chainFirst:xW,chainFirstEitherK:xZ,chainFirstEitherKW:xZ,chainFirstIOK:xV,chainFirstW:xW,chainIOK:xB,chainOptionK:xH,chainW:xO,filterOrElse:xJ,filterOrElseW:xJ,flap:xA,flatten:xk,flattenW:xk,fold:xi,foldW:xi,fromEither:rt,fromEitherK:xQ,fromIO:xt,fromIOK:xz,fromOption:xq,fromOptionK:xK,fromPredicate:xY,getAltIOValidation:xR,getApplicativeIOValidation:xM,getApplyMonoid:_o,getApplySemigroup:_i,getCompactable:xE,getFilterable:function(t){var n=mF(t),r=xE(t),i=yi(bz,n),o=yo(bz,n),a=ya(bz,n),u=yu(bz,n);return{URI:xI,_E:void 0,map:xh,compact:r.compact,separate:r.separate,filter:function(t,n){return rd(t,i(n))},filterMap:function(t,n){return rd(t,o(n))},partition:function(t,n){return rd(t,a(n))},partitionMap:function(t,n){return rd(t,u(n))}}},getIOValidation:function(t){var n=xM(t),r=xR(t);return{URI:xI,_E:void 0,map:xh,ap:n.ap,of:xe,chain:xy,bimap:xv,mapLeft:xb,alt:r.alt,fromIO:xt,throwError:b7}},getOrElse:xo,getOrElseW:xo,getSemigroup:_a,ioEither:{URI:xI,bimap:xv,mapLeft:xb,map:xh,of:xe,ap:xm,chain:xy,alt:xx,fromIO:xt,throwError:b7},left:b7,leftIO:xn,map:x_,mapLeft:xT,match:xr,matchE:xi,matchEW:xi,matchW:xr,of:xe,orElse:xl,orElseFirst:xc,orElseFirstIOK:xd,orElseFirstW:xc,orElseW:xl,orLeft:xf,right:xe,rightIO:xt,sequenceArray:_t,sequenceSeqArray:_r,swap:xp,throwError:b7,toUnion:xs,traverseArray:_e,traverseArrayWithIndex:x9,traverseReadonlyArrayWithIndex:x9,traverseReadonlyArrayWithIndexSeq:x7,traverseReadonlyNonEmptyArrayWithIndex:x6,traverseReadonlyNonEmptyArrayWithIndexSeq:x8,traverseSeqArray:_n,traverseSeqArrayWithIndex:x7,tryCatch:xa,tryCatchK:xu},Symbol.toStringTag,{value:"Module"}));function _s(t){return ra(rb,t.of)}function _l(t){return rt(t.of(rv))}function _c(t){return function(n){return t.map(n,rb)}}function _d(t){return ra(hP,t.of)}function _f(t){var n=_d(t);return function(t){return ra(t,n)}}function _p(t){var n=_T(t),r=_f(t);return function(t){return n(r(t))}}function _h(t){return function(n){return ra(n,t.of)}}function _m(t){var n=_T(t),r=_h(t);return function(t){return n(r(t))}}function _g(t){return function(n){return function(r){return t.of(pE(n)(r))}}}function _y(t){return ra(pA,t.of)}function _v(t){return function(n,r){return function(i){return t.map(i,hO(n,r))}}}function _b(t){return function(n,r){return function(i){return t.chain(i,hO(n,r))}}}function _x(t){return function(n){return function(r){return t.chain(r,hO(n,t.of))}}}function __(t){return rB(t,pX)}function _S(t){return rj(t,p2)}function _T(t){var n=_l(t);return function(r){return function(i){return t.chain(i,hO(function(){return n()},r))}}}function _w(t){var n=_s(t);return function(r){return function(i){return t.chain(i,hO(r,n))}}}let _O=Object.freeze(Object.defineProperty({__proto__:null,alt:_w,ap:_S,chain:_T,chainNullableK:_p,chainOptionK:_m,fromEither:_y,fromF:_c,fromNullable:_d,fromNullableK:_f,fromOptionK:_h,fromPredicate:_g,getOptionM:function(t){var n=_S(t),r=__(t),i=_T(t),o=_w(t),a=_b(t),u=_x(t),s=_l(t);return{map:function(t,n){return rd(t,r(n))},ap:function(t,r){return rd(t,n(r))},of:_s(t),chain:function(t,n){return rd(t,i(n))},alt:function(t,n){return rd(t,o(n))},fold:function(t,n,r){return rd(t,a(n,r))},getOrElse:function(t,n){return rd(t,u(n))},fromM:_c(t),none:function(){return s()}}},getOrElse:_x,map:__,match:_v,matchE:_b,some:_s,zero:_l},Symbol.toStringTag,{value:"Module"}));var _k=_s(bV),_C=_g(bV),_I=_y(bV),_M=_c(bz),_R=bD(pA),_E=_v(bz),_j=_b(bG),_A=_x(bZ),_N=bD(hz),_P=bD(hU),_L=_d(bV),_D=_f(bV),_F=_p(bZ),_W=_h(bV),_U=_m(bZ),_z=__(bz),_B=_S(b$),_V=_T(bZ),_$=_V(re),_q=_w(bZ),_K=_l(bV),_H=_K(),_G=h4(bz,hs),_Z=h5(bz,hs,pX),_Y=yi(bz,hp),_J=yo(bz,hp),_Q=ya(bz,hp),_X=yu(bz,hp),_0=function(t,n){return rd(t,_z(n))},_1=function(t,n){return rd(t,_B(n))},_2=function(t,n){return rd(t,_V(n))},_3=function(t,n){return rd(t,_q(n))},_4=function(t,n){return rd(t,_Y(n))},_5=function(t,n){return rd(t,_J(n))},_6=function(t,n){return rd(t,_Q(n))},_9=function(t,n){return rd(t,_X(n))},_8="IOOption",_7={URI:_8,map:_0},Se=rV(_7),St={URI:_8,of:_k},Sn={URI:_8,map:_0,ap:_1},Sr=rA(Sn),Si=rN(Sn),So={URI:_8,map:_0,ap:_1,chain:_2},Sa=rY(So),Su={URI:_8,zero:_K},Ss=sS(Su,St),Sl={URI:_8,fromIO:_M},Sc=yx(Sl),Sd=y_(Sl,So),Sf=yS(Sl,So),Sp={URI:_8,fromEither:_I},Sh=r3(Sp),Sm=r4(Sp,So),Sg=r5(Sp,So),Sy=_k(rM),Sv=r$(_7),Sb=rJ(So),Sx=rP(Sn),S_=_k(rI),SS=function(t){return ra(b2(t),bD(hG(rf)))},ST=function(t){var n=SS(t);return function(t){return rO(t)?n(t):S_}};let Sw=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:_8,map:_0,alt:_3},Alternative:{URI:_8,map:_0,ap:_1,of:_k,alt:_3,zero:_K},ApT:S_,Applicative:{URI:_8,map:_0,ap:_1,of:_k},Apply:Sn,Chain:So,Compactable:{URI:_8,compact:_G,separate:_Z},Do:Sy,Filterable:{URI:_8,map:_0,compact:_G,separate:_Z,filter:_4,filterMap:_5,partition:_6,partitionMap:_9},FromEither:Sp,FromIO:Sl,Functor:_7,Monad:{URI:_8,map:_0,ap:_1,of:_k,chain:_2},MonadIO:{URI:_8,map:_0,ap:_1,of:_k,chain:_2,fromIO:_M},Pointed:St,Zero:Su,alt:_q,altW:_q,ap:_B,apFirst:Sr,apS:Sx,apSecond:Si,bind:Sb,bindTo:Sv,chain:_V,chainEitherK:Sm,chainFirst:Sa,chainFirstEitherK:Sg,chainFirstIOK:Sf,chainIOK:Sd,chainNullableK:_F,chainOptionK:_U,compact:_G,filter:_Y,filterMap:_J,flap:Se,flatten:_$,fold:_j,fromEither:_I,fromEitherK:Sh,fromIO:_M,fromIOEither:_R,fromIOK:Sc,fromNullable:_L,fromNullableK:_D,fromOption:rt,fromOptionK:_W,fromPredicate:_C,getOrElse:_A,getOrElseW:_A,guard:Ss,map:_z,match:_E,matchE:_j,matchEW:_j,matchW:_E,none:_H,of:_k,partition:_Q,partitionMap:_X,separate:_Z,some:_k,toNullable:_P,toUndefined:_N,traverseReadonlyArrayWithIndex:ST,traverseReadonlyNonEmptyArrayWithIndex:SS,zero:_K},Symbol.toStringTag,{value:"Module"}));var SO=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 Sk=Object.freeze(Object.defineProperty({__proto__:null,IORef:SO,newIORef:function(t){return function(){return new SO(t)}}},Symbol.toStringTag,{value:"Module"})),SC=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var SI=function(t){return gv(function(){return JSON.parse(t)},re)},SM=function(t){return gv(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},re)};let SR=Object.freeze(Object.defineProperty({__proto__:null,parse:SI,stringify:SM},Symbol.toStringTag,{value:"Module"})),SE=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Sj=function(t){return new Map(t)};function SA(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 SN=function(t){return t.size},SP=function(t){return 0===t.size};function SL(t){var n=SH(t);return function(r,i){if(void 0===i){var o=SL(t);return function(t){return o(r,t)}}return ry(n(r,i))}}function SD(t){return function(n,r){if(void 0===r){var i=SD(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 SF=function(t){return function(n){return Array.from(n.keys()).sort(t.compare)}},SW=function(t){return function(n){return Array.from(n.values()).sort(t.compare)}};function SU(t){var n=SF(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 Sz=function(t){return SU(t)(function(t,n){return[t,n]})},SB=function(t){var n=SK(t);return function(t,r){var i=n(t);return function(n){var o=i(n);if(rg(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}}},SV=function(t){var n=SK(t);return function(t){return function(r){var i=n(t,r);if(ry(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},S$=function(t){var n=Sq(t);return function(t,r){return n(t,function(){return r})}},Sq=function(t){var n=SK(t);return function(t,r){return function(i){var o=n(t,i);if(rg(o))return rv;var a=o.value,u=a[0],s=a[1],l=r(s);if(l===s)return rb(i);var c=new Map(i);return c.set(u,l),rb(c)}}};function SK(t){return function(n,r){if(void 0===r){var i=SK(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],l=u[1];if(t.equals(s,n))return rb([s,l])}return rv}}function SH(t){var n=SK(t);return function(r,i){if(void 0===i){var o=SH(t);return function(t){return o(r,t)}}return rd(n(r,i),pQ(function(t){return t[0],t[1]}))}}function SG(t,n){var r=SK(t);return function(i,o){if(void 0===o){var a=SG(t,n);return function(t){return a(t,i)}}for(var u,s=i.entries();!(u=s.next()).done;){var l=u.value,c=l[0],d=l[1],f=r(c,o);if(rg(f)||!t.equals(c,f.value[0])||!n.equals(d,f.value[1]))return!1}return!0}}var SZ=new Map;function SY(t,n){var r=SG(t,n);return r8(function(t,n){return r(t,n)&&r(n,t)})}var SJ=function(t,n){return new Map([[t,n]])},SQ=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},SX=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],l=t(s,u[1]);rx(l)?i.set(s,l.left):o.set(s,l.right)}return sa(i,o)}};function S0(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],l=u[1];t(s,l)?o.set(s,l):i.set(s,l)}return sa(i,o)}}var S1=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]);ry(s)&&i.set(u,s.value)}return i}};function S2(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 S3=function(t,n){return SQ(t,function(t,r){return n(r)})},S4=function(t,n){return S8(t,function(t,r){return n(r)})},S5=function(t,n){return S7(t,function(t,r){return n(r)})},S6=function(t,n){return Te(t,function(t,r){return n(r)})},S9=function(t,n){return Tt(t,function(t,r){return n(r)})},S8=function(t,n){return rd(t,S2(n))},S7=function(t,n){return rd(t,S1(n))},Te=function(t,n){return rd(t,S0(n))},Tt=function(t,n){return rd(t,SX(n))},Tn=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];ry(u)&&r.set(a,u.value)}return r},Tr=function(t){return function(n){return S4(n,t)}},Ti=function(t){return function(n){return S5(n,t)}},To=function(t){return function(n){return S3(n,t)}},Ta=function(t){return function(n){return SQ(n,t)}},Tu=function(t){return function(n){return S6(n,t)}},Ts=function(t){return function(n){return S9(n,t)}},Tl=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];rx(s)?r.set(u,s.left):i.set(u,s.right)}return sa(r,i)},Tc="ReadonlyMap",Td=function(t,n){var r=TM(t,n);return{concat:function(t,n){return r(n)(t)}}},Tf=function(t,n){return{concat:Td(t,n).concat,empty:SZ}},Tp=function(t,n){var r=TR(t,n);return{concat:function(t,n){return r(n)(t)}}},Th=function(t){return function(){var n=TE(t);return{concat:function(t,r){return n(r)(t)}}}},Tm={URI:Tc,map:S3},Tg=rV(Tm),Ty=function(){return{URI:Tc,_E:void 0,map:S3,mapWithIndex:SQ}},Tv={URI:Tc,compact:Tn,separate:Tl},Tb=function(t){var n=TT(t);return function(t,r){return n(t,function(t,n,i){return r(n,i)})}},Tx=function(t){var n=Tw(t);return function(t){var r=n(t);return function(t){return r(function(n,r){return t(r)})}}},T_=function(t){var n=TO(t);return function(t,r){return n(t,function(t,n,i){return r(n,i)})}},TS=function(t){var n=Tb(t),r=Tx(t),i=T_(t);return{URI:Tc,_E:void 0,reduce:function(t,r,i){return rd(t,n(r,i))},foldMap:function(t){var n=r(t);return function(t,r){return rd(t,n(r))}},reduceRight:function(t,n,r){return rd(t,i(n,r))}}},TT=function(t){var n=SF(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}}},Tw=function(t){var n=SF(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}}}},TO=function(t){var n=SF(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 l=a[s];o=r(l,i.get(l),o)}return o}}},Tk=function(t){var n=TS(t),r=TT(t),i=Tw(t),o=TO(t);return{URI:Tc,_E:void 0,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(t,n,i){return rd(t,r(n,i))},foldMapWithIndex:function(t){var n=i(t);return function(t,r){return rd(t,n(r))}},reduceRightWithIndex:function(t,n,r){return rd(t,o(n,r))}}},TC=function(t){var n=TI(t),r=TS(t);return{URI:Tc,_E:void 0,map:S3,reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,traverse:n.traverse,sequence:n.sequence}},TI=function(t){var n=Tk(t),r=SF(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,rf)}};return{URI:Tc,_E:void 0,map:S3,mapWithIndex:SQ,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverse:o,sequence:a,traverseWithIndex:i}},TM=function(t,n){var r=SH(t);return function(t){return function(i){if(SP(i))return t;if(SP(t))return i;for(var o,a=new Map,u=i.entries();!(o=u.next()).done;){var s=o.value,l=s[0],c=s[1],d=r(l)(t);ry(d)?a.set(l,n.concat(c,d.value)):a.set(l,c)}for(var f=t.entries();!(o=f.next()).done;){var p=o.value,l=p[0],c=p[1],d=r(l)(a);rg(d)&&a.set(l,c)}return a}}},TR=function(t,n){var r=SH(t);return function(t){return function(i){if(SP(i)||SP(t))return SZ;for(var o,a=new Map,u=i.entries();!(o=u.next()).done;){var s=o.value,l=s[0],c=s[1],d=r(l)(t);ry(d)&&a.set(l,n.concat(c,d.value))}return a}}},TE=function(t){var n=SL(t);return function(t){return function(r){if(SP(r))return t;if(SP(t))return r;for(var i,o=new Map,a=r.entries();!(i=a.next()).done;){var u=i.value,s=u[0],l=u[1];n(s)(t)||o.set(s,l)}for(var c=t.entries();!(i=c.next()).done;){var d=i.value,s=d[0],l=d[1];n(s)(r)||o.set(s,l)}return o}}};let Tj=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Tv,Filterable:{URI:Tc,map:S3,compact:Tn,separate:Tl,filter:S4,filterMap:S5,partition:S6,partitionMap:S9},Functor:Tm,URI:Tc,collect:SU,compact:Tn,deleteAt:SV,difference:TE,elem:SD,empty:SZ,filter:Tr,filterMap:Ti,filterMapWithIndex:S1,filterWithIndex:S2,flap:Tg,foldMap:Tx,foldMapWithIndex:Tw,fromFoldable:function(t,n,r){return function(i){var o=SK(t);return r.reduce(i,new Map,function(t,r){var i=r[0],a=r[1],u=o(i,t);return ry(u)?t.set(u.value[0],n.concat(u.value[1],a)):t.set(i,a),t})}},fromMap:Sj,getDifferenceMagma:Th,getEq:SY,getFilterableWithIndex:function(){return{URI:Tc,_E:void 0,map:S3,mapWithIndex:SQ,compact:Tn,separate:Tl,filter:S4,filterMap:S5,partition:S6,partitionMap:S9,partitionMapWithIndex:Tt,partitionWithIndex:Te,filterMapWithIndex:S7,filterWithIndex:S8}},getFoldable:TS,getFoldableWithIndex:Tk,getFunctorWithIndex:Ty,getIntersectionSemigroup:Tp,getMonoid:function(t,n){var r=SK(t);return{concat:function(t,i){if(SP(t))return i;if(SP(i))return t;for(var o,a=new Map(t),u=i.entries();!(o=u.next()).done;){var s=o.value,l=s[0],c=s[1],d=r(l,t);ry(d)?a.set(d.value[0],n.concat(d.value[1],c)):a.set(l,c)}return a},empty:SZ}},getShow:SA,getTraversable:TC,getTraversableWithIndex:TI,getUnionMonoid:Tf,getUnionSemigroup:Td,getWitherable:function(t){var n=TI(t);return{URI:Tc,_E:void 0,map:S3,compact:Tn,separate:Tl,filter:S4,filterMap:S5,partition:S6,partitionMap:S9,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:n.traverse,sequence:n.sequence,mapWithIndex:SQ,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverseWithIndex:n.traverseWithIndex,wilt:sv(n,Tv),wither:sb(n,Tv)}},insertAt:SB,intersection:TR,isEmpty:SP,isSubmap:SG,keys:SF,lookup:SH,lookupWithKey:SK,map:To,mapWithIndex:Ta,member:SL,modifyAt:Sq,partition:Tu,partitionMap:Ts,partitionMapWithIndex:SX,partitionWithIndex:S0,pop:function(t){var n=SH(t),r=SV(t);return function(t){var i=r(t);return function(r){return rd(n(t,r),pQ(function(t){return[t,i(r)]}))}}},readonlyMap:{URI:Tc,map:S3,compact:Tn,separate:Tl,filter:S4,filterMap:S5,partition:S6,partitionMap:S9},reduce:Tb,reduceRight:T_,reduceRightWithIndex:TO,reduceWithIndex:TT,separate:Tl,singleton:SJ,size:SN,toMap:function(t){return new Map(t)},toReadonlyArray:Sz,toUnfoldable:function(t,n){var r=Sz(t);return function(t){var i=r(t),o=i.length;return n.unfold(0,function(t){return t<o?rb([i[t],t+1]):rv})}},union:TM,updateAt:S$,upsertAt:SB,values:SW},Symbol.toStringTag,{value:"Module"}));var TA=globalThis&&globalThis.__assign||function(){return(TA=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)},TN=function(t){return function(n){return Array.from(n.keys()).sort(t.compare)}},TP=function(t){return function(n){return Array.from(n.values()).sort(t.compare)}};function TL(t){var n=TN(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 TD(t){return TL(t)(function(t,n){return[t,n]})}var TF=function(t){var n=TB(t);return function(t,r){var i=n(t);return function(n){var o=i(n);if(rg(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}}},TW=function(t){var n=TB(t);return function(t){return function(r){var i=n(t,r);if(ry(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},TU=function(t){var n=Tz(t);return function(t,r){return n(t,function(){return r})}},Tz=function(t){var n=TB(t);return function(t,r){return function(i){var o=n(t,i);if(rg(o))return rv;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),rb(a)}}};function TB(t){return function(n,r){if(void 0===r){var i=TB(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],l=u[1];if(t.equals(s,n))return rb([s,l])}return rv}}var TV=function(t,n){return new Map([[t,n]])},T$=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},Tq=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],l=t(s,u[1]);rx(l)?i.set(s,l.left):o.set(s,l.right)}return sa(i,o)}};function TK(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],l=u[1];t(s,l)?o.set(s,l):i.set(s,l)}return sa(i,o)}}var TH=function(t){return function(n){for(var r,i=new Map,o=n.entries();!(r=o.next()).done;){var a=r.value,u=a[0],s=t(u,a[1]);ry(s)&&i.set(u,s.value)}return i}};function TG(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 TZ=function(t,n){return T$(t,function(t,r){return n(r)})},TY=function(t,n){return T0(t,function(t,r){return n(r)})},TJ=function(t,n){return T1(t,function(t,r){return n(r)})},TQ=function(t,n){return T2(t,function(t,r){return n(r)})},TX=function(t,n){return T3(t,function(t,r){return n(r)})},T0=function(t,n){return rd(t,TG(n))},T1=function(t,n){return rd(t,TH(n))},T2=function(t,n){return rd(t,TK(n))},T3=function(t,n){return rd(t,Tq(n))},T4=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];ry(u)&&r.set(a,u.value)}return r},T5=function(t){return function(n){return TY(n,t)}},T6=function(t){return function(n){return TJ(n,t)}},T9=function(t){return function(n){return TZ(n,t)}},T8=function(t){return function(n){return T$(n,t)}},T7=function(t){return function(n){return TQ(n,t)}},we=function(t){return function(n){return TX(n,t)}},wt=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];rx(s)?r.set(u,s.left):i.set(u,s.right)}return sa(r,i)},wn=function(t,n){var r=wh(t,n);return{concat:function(t,n){return r(n)(t)}}},wr=function(t,n){return{concat:wn(t,n).concat,empty:new Map}},wi=function(t,n){var r=wm(t,n);return{concat:function(t,n){return r(n)(t)}}},wo=function(t){return function(){var n=wg(t);return{concat:function(t,r){return n(r)(t)}}}},wa=function(t){return TA(TA({},TS(t)),{URI:"Map"})},wu=function(t){return TA(TA({},Tk(t)),{URI:"Map"})},ws=function(t){var n=wu(t),r=TN(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:TZ,mapWithIndex:T$,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverse:o,sequence:a,traverseWithIndex:i}},wl={URI:"Map",map:TZ},wc=rV(wl),wd={URI:"Map",compact:T4,separate:wt},wf={URI:"Map",map:TZ,compact:T4,separate:wt,filter:TY,filterMap:TJ,partition:TQ,partitionMap:TX},wp=function(t){return new Map(t)},wh=function(t,n){var r=TM(t,n);return function(t){return function(n){return SP(n)?wp(t):SP(t)?wp(n):r(t)(n)}}},wm=function(t,n){var r=TR(t,n);return function(t){return function(n){return SP(n)||SP(t)?new Map:r(t)(n)}}},wg=function(t){var n=TE(t);return function(t){return function(r){return SP(r)?wp(t):SP(t)?wp(r):n(t)(r)}}},wy=new Map;let wv=Object.freeze(Object.defineProperty({__proto__:null,Compactable:wd,Filterable:wf,Functor:wl,URI:"Map",collect:TL,compact:T4,deleteAt:TW,difference:wg,elem:SD,empty:wy,filter:T5,filterMap:T6,filterMapWithIndex:TH,filterWithIndex:TG,flap:wc,foldMap:Tx,foldMapWithIndex:Tw,fromFoldable:function(t,n,r){return function(i){var o=TB(t);return r.reduce(i,new Map,function(t,r){var i=r[0],a=r[1],u=o(i,t);return ry(u)?t.set(u.value[0],n.concat(u.value[1],a)):t.set(i,a),t})}},getDifferenceMagma:wo,getEq:SY,getFilterableWithIndex:function(){return{URI:"Map",_E:void 0,map:TZ,mapWithIndex:T$,compact:T4,separate:wt,filter:TY,filterMap:TJ,partition:TQ,partitionMap:TX,partitionMapWithIndex:T3,partitionWithIndex:T2,filterMapWithIndex:T1,filterWithIndex:T0}},getFoldable:wa,getFoldableWithIndex:wu,getIntersectionSemigroup:wi,getMonoid:function(t,n){var r=TB(t);return{concat:function(t,i){if(SP(t))return i;if(SP(i))return t;for(var o,a=new Map(t),u=i.entries();!(o=u.next()).done;){var s=o.value,l=s[0],c=s[1],d=r(l,t);ry(d)?a.set(d.value[0],n.concat(d.value[1],c)):a.set(l,c)}return a},empty:new Map}},getShow:SA,getTraversableWithIndex:ws,getUnionMonoid:wr,getUnionSemigroup:wn,getWitherable:function(t){var n=ws(t);return{URI:"Map",_E:void 0,map:TZ,compact:T4,separate:wt,filter:TY,filterMap:TJ,partition:TQ,partitionMap:TX,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:n.traverse,sequence:n.sequence,mapWithIndex:T$,reduceWithIndex:n.reduceWithIndex,foldMapWithIndex:n.foldMapWithIndex,reduceRightWithIndex:n.reduceRightWithIndex,traverseWithIndex:n.traverseWithIndex,wilt:sv(n,wd),wither:sb(n,wd)}},insertAt:TF,intersection:wm,isEmpty:SP,isSubmap:SG,keys:TN,lookup:SH,lookupWithKey:TB,map:T9,mapWithIndex:T8,map_:wf,member:SL,modifyAt:Tz,partition:T7,partitionMap:we,partitionMapWithIndex:Tq,partitionWithIndex:TK,pop:function(t){var n=SH(t),r=TW(t);return function(t){var i=r(t);return function(r){return rd(n(t,r),pQ(function(t){return[t,i(r)]}))}}},reduce:Tb,reduceRight:T_,reduceRightWithIndex:TO,reduceWithIndex:TT,separate:wt,singleton:TV,size:SN,toArray:TD,toUnfoldable:function(t,n){var r=TD(t);return function(t){var i=r(t),o=i.length;return n.unfold(0,function(t){return t<o?rb([i[t],t+1]):rv})}},union:wh,updateAt:TU,upsertAt:TF,values:TP},Symbol.toStringTag,{value:"Module"})),wb=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),wx=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),w_=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),wS=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),wT=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var ww=function(t){return{concat:iF(t).concat,empty:t.top}},wO=function(t){return{concat:iW(t).concat,empty:t.bottom}},wk=function(t){return{concat:ij(t).concat,empty:t.empty}},wC=function(t){var n={};for(var r in t)rR.call(t,r)&&(n[r]=t[r].empty);return{concat:iz(t).concat,empty:n}},wI=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return{concat:iB.apply(iX,t).concat,empty:t.map(function(t){return t.empty})}},wM=function(t){return iL(t)(t.empty)},wR={concat:iK.concat,empty:void 0},wE={concat:iG.concat,empty:!0},wj={concat:iZ.concat,empty:!1},wA=function(){return wk(g7())},wN={concat:iY.concat,empty:""},wP={concat:iJ.concat,empty:0},wL={concat:iQ.concat,empty:1};let wD=Object.freeze(Object.defineProperty({__proto__:null,concatAll:wM,fold:wM,getDualMonoid:wk,getEndomorphismMonoid:wA,getFunctionMonoid:n6,getJoinMonoid:wO,getMeetMonoid:ww,getStructMonoid:wC,getTupleMonoid:wI,max:wO,min:ww,monoidAll:wE,monoidAny:wj,monoidProduct:wL,monoidString:wN,monoidSum:wP,monoidVoid:wR,reverse:wk,struct:wC,tuple:wI},Symbol.toStringTag,{value:"Module"})),wF=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var wW=function(t,n,r){return function(i){return -1===i?t():0===i?n():r()}},wU=function(t){return -1===t?1:1===t?-1:0},wz={equals:function(t,n){return t===n}},wB={concat:function(t,n){return 0!==t?t:n}},wV={concat:wB.concat,empty:0},w$=function(t){return t<=-1?-1:t>=1?1:0};let wq=Object.freeze(Object.defineProperty({__proto__:null,Eq:wz,Monoid:wV,Semigroup:wB,eqOrdering:wz,invert:wU,match:wW,matchW:wW,monoidOrdering:wV,reverse:wU,semigroupOrdering:wB,sign:w$},Symbol.toStringTag,{value:"Module"})),wK=Object.freeze(Object.defineProperty({__proto__:null,pipe:rd,pipeable:function(t){var n,r,i,o,a,u,s,l,c,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 _=function(n){return function(r){return t.ap(r,n)}},S=function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}};y.ap=_,y.apFirst=S,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 T=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})})}},O=function(n){return t.chain(n,re)};y.chain=T,y.chainFirst=w,y.flatten=O}if("function"==typeof t.bimap){var k=function(n,r){return function(i){return t.bimap(i,n,r)}},C=function(n){return function(r){return t.mapLeft(r,n)}};y.bimap=k,y.mapLeft=C}if("function"==typeof t.extend){var I=function(n){return function(r){return t.extend(r,n)}},M=function(n){return t.extend(n,re)};y.extend=I,y.duplicate=M}if("function"==typeof t.reduce){var R=function(n,r){return function(i){return t.reduce(i,n,r)}},E=function(n){var r=t.foldMap(n);return function(t){return function(n){return r(n,t)}}},j=function(n,r){return function(i){return t.reduceRight(i,n,r)}};y.reduce=R,y.foldMap=E,y.reduceRight=j}if("function"==typeof t.reduceWithIndex){var A=function(n,r){return function(i){return t.reduceWithIndex(i,n,r)}},N=function(n){var r=t.foldMapWithIndex(n);return function(t){return function(n){return r(n,t)}}},P=function(n,r){return function(i){return t.reduceRightWithIndex(i,n,r)}};y.reduceWithIndex=A,y.foldMapWithIndex=N,y.reduceRightWithIndex=P}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 D=function(n){return function(r){return t.filter(r,n)}},F=function(n){return function(r){return t.filterMap(r,n)}},W=function(n){return function(r){return t.partition(r,n)}},U=function(n){return function(r){return t.partitionMap(r,n)}};y.filter=D,y.filterMap=F,y.partition=W,y.partitionMap=U}if("function"==typeof t.filterWithIndex){var z=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=z,y.filterMapWithIndex=B,y.partitionWithIndex=V,y.partitionMapWithIndex=$}if("function"==typeof t.promap){var q=function(n,r){return function(i){return t.promap(i,n,r)}};y.promap=q}if("function"==typeof t.compose){var K=function(n){return function(r){return t.compose(r,n)}};y.compose=K}if("function"==typeof t.throwError){var H=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))}},Y=function(n,r){return function(i){return t.chain(i,function(i){return n(i)?t.of(i):t.throwError(r(i))})}};y.fromOption=H,y.fromEither=G,y.fromPredicate=Z,y.filterOrElse=Y}return y}},Symbol.toStringTag,{value:"Module"})),wH=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),wG=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var wZ=function(){return Math.random()};function wY(t,n){return rd(wZ,bD(function(r){return Math.floor((n-t+1)*r+t)}))}var wJ=rd(wZ,bD(function(t){return t<.5})),wQ=function(t){return rd(wY(0,t.length-1),bD(function(n){return t[n]}))};let wX=Object.freeze(Object.defineProperty({__proto__:null,random:wZ,randomBool:wJ,randomElem:wQ,randomInt:wY,randomRange:function(t,n){return rd(wZ,bD(function(r){return(n-t)*r+t}))}},Symbol.toStringTag,{value:"Module"}));var w0=gU(yG),w1=gW(yG),w2=gz(yK),w3=gB(yK),w4=gX(yK),w5=g0(y0),w6=g1(y0),w9=g6(yK),w8=g2(y0),w7=g3(y0),Oe=g4(y0),Ot=g5(yK),On=function(t,n){return rd(t,Os(n))},Or=function(t,n,r){return rd(t,Ol(n,r))},Oi=function(t,n){return rd(t,Oc(n))},Oo=function(t,n){return rd(t,Od(n))},Oa=function(t,n){return rd(t,Of(n))},Ou=function(t,n){return rd(t,Oh(n))},Os=gK(yK),Ol=gY(yK),Oc=gJ(yK),Od=gH(yZ),Of=gG(y0),Op=Of(re),Oh=gZ(y0),Om="ReaderEither",Og=function(t){var n=mD(t);return{URI:Om,_E:void 0,compact:h4(yK,n),separate:h5(yK,n,mV)}};function Oy(t){var n=rj(yZ,mU(t));return{URI:Om,_E:void 0,map:On,ap:function(t,r){return rd(t,n(r))},of:w1}}function Ov(t){var n=gQ(y0,t);return{URI:Om,_E:void 0,map:On,alt:function(t,r){return rd(t,n(r))}}}var Ob={URI:Om,map:On},Ox=rV(Ob),O_={URI:Om,map:On,ap:Oo},OS=rA(O_),OT=rN(O_),Ow={URI:Om,map:On,ap:Oo,of:w1},OO={URI:Om,map:On,ap:Oo,chain:Oa},Ok=rY(OO),OC={URI:Om,fromReader:w2},OI=vi(OC),OM=vo(OC),OR=va(OC),OE=vu(OC,OO),Oj=vs(OC,OO),OA={URI:Om,fromEither:rt},ON=rX(OA),OP=r1(OA),OL=r2(OA,OO),OD=r4(OA,OO),OF=r5(OA,OO),OW=r0(OA),OU=r6(OA,OO),Oz=r3(OA),OB=w1(rM),OV=r$(Ob),O$=rJ(OO),Oq=rP(O_),OK=w1(rI),OH=function(t){return ra(y9(t),yj(gM(rf)))},OG=function(t){var n=OH(t);return function(t){return rO(t)?n(t):OK}},OZ=function(t){return OG(function(n,r){return t(r)})},OY=OZ(re),OJ=rL(O_),OQ=rH(Ow),OX=function(t){return rL(yZ)(mL(t))};let O0=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Om,map:On,alt:Ou},ApT:OK,Applicative:Ow,Apply:O_,Bifunctor:{URI:Om,bimap:Or,mapLeft:Oi},Chain:OO,Do:OB,FromEither:OA,FromReader:OC,Functor:Ob,Monad:{URI:Om,map:On,ap:Oo,of:w1,chain:Oa},MonadThrow:{URI:Om,map:On,ap:Oo,of:w1,chain:Oa,throwError:w0},Pointed:{URI:Om,of:w1},URI:Om,alt:Oh,altW:Oh,ap:Od,apFirst:OS,apFirstW:OS,apS:Oq,apSW:Oq,apSecond:OT,apSecondW:OT,apW:Od,ask:OI,asks:OM,asksReaderEither:yk,asksReaderEitherW:yk,bimap:Ol,bind:O$,bindTo:OV,bindW:O$,chain:Of,chainEitherK:OD,chainEitherKW:OD,chainFirst:Ok,chainFirstEitherK:OF,chainFirstEitherKW:OF,chainFirstReaderK:Oj,chainFirstReaderKW:Oj,chainFirstW:Ok,chainOptionK:OL,chainReaderK:OE,chainReaderKW:OE,chainW:Of,filterOrElse:OU,filterOrElseW:OU,flap:Ox,flatten:Op,flattenW:Op,fold:w5,foldW:w5,fromEither:rt,fromEitherK:Oz,fromOption:ON,fromOptionK:OP,fromPredicate:OW,fromReader:w2,fromReaderK:OR,getAltReaderValidation:Ov,getApplicativeReaderValidation:Oy,getApplyMonoid:OQ,getApplySemigroup:OJ,getCompactable:Og,getFilterable:function(t){var n=mF(t),r=Og(t),i=yi(yK,n),o=yo(yK,n),a=ya(yK,n),u=yu(yK,n);return{URI:Om,_E:void 0,map:On,compact:r.compact,separate:r.separate,filter:function(t,n){return rd(t,i(n))},filterMap:function(t,n){return rd(t,o(n))},partition:function(t,n){return rd(t,a(n))},partitionMap:function(t,n){return rd(t,u(n))}}},getOrElse:w6,getOrElseW:w6,getReaderValidation:function(t){var n=Oy(t),r=Ov(t);return{URI:Om,_E:void 0,map:On,ap:n.ap,of:w1,chain:Oa,bimap:Or,mapLeft:Oi,alt:r.alt,throwError:w0}},getSemigroup:OX,left:w0,leftReader:w3,local:yO,map:Os,mapLeft:Oc,match:w4,matchE:w5,matchEW:w5,matchW:w4,of:w1,orElse:w8,orElseFirst:w7,orElseFirstW:w7,orElseW:w8,orLeft:Oe,readerEither:{URI:Om,bimap:Or,mapLeft:Oi,map:On,of:w1,ap:Oo,chain:Oa,alt:Ou,throwError:w0},right:w1,rightReader:w2,sequenceArray:OY,swap:Ot,throwError:w0,toUnion:w9,traverseArray:OZ,traverseArrayWithIndex:OG,traverseReadonlyArrayWithIndex:OG,traverseReadonlyNonEmptyArrayWithIndex:OH},Symbol.toStringTag,{value:"Module"}));function O1(t){return function(n){return function(){return t.of(n)}}}function O2(t){return function(n){return function(r){return function(i){return t.map(r(i),n)}}}}function O3(t){return function(n){return function(r){return function(i){return t.ap(r(i),n(i))}}}}function O4(t){return function(n){return function(r){return function(i){return t.chain(r(i),function(t){return n(t)(i)})}}}}function O5(t){return function(n){return ra(n,t.of)}}let O6=Object.freeze(Object.defineProperty({__proto__:null,ap:O3,chain:O4,fromNaturalTransformation:function(t){return function(n){return ra(n,t)}},fromReader:O5,getReaderM:function(t){var n=O3(t),r=O2(t),i=O4(t);return{map:function(t,n){return rd(t,r(n))},ap:function(t,r){return rd(t,n(r))},of:O1(t),chain:function(t,n){return rd(t,i(n))},ask:function(){return t.of},asks:function(n){return ra(n,t.of)},local:function(t,n){return function(r){return t(n(r))}},fromReader:O5(t),fromM:function(t){return function(){return t}}}},map:O2,of:O1},Symbol.toStringTag,{value:"Module"}));var O9=function(t){return function(){return Promise.resolve().then(t)}},O8=function(t,n){return rd(t,kn(n))},O7=function(t,n){return rd(t,kr(n))},ke=function(t,n){return rd(t,ko(function(t){return rd(n,kn(t))}))},kt=function(t,n){return rd(t,ko(n))},kn=function(t){return function(n){return function(){return Promise.resolve().then(n).then(t)}}},kr=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])})}}},ki=function(t){return function(){return Promise.resolve(t)}},ko=function(t){return function(n){return function(){return Promise.resolve().then(n).then(function(n){return t(n)()})}}},ka=ko(re),ku="Task",ks={URI:ku,map:O8},kl=rV(ks),kc={URI:ku,of:ki},kd={URI:ku,map:O8,ap:O7},kf=rA(kd),kp=rN(kd),kh={URI:ku,map:O8,ap:O7,of:ki},km={URI:ku,map:O8,ap:ke},kg={URI:ku,map:O8,ap:ke,of:ki},ky={URI:ku,map:O8,ap:O7,chain:kt},kv={URI:ku,map:O8,of:ki,ap:O7,chain:kt},kb=rY(ky),kx={URI:ku,fromIO:O9},k_=yx(kx),kS=y_(kx,ky),kT=yS(kx,ky),kw=function(){return new Promise(function(t){})},kO=ki(rM),kk=r$(ks),kC=rJ(ky),kI=rP(kd),kM=ki(rI),kR=function(t){return function(n){return function(){return Promise.all(n.map(function(n,r){return Promise.resolve().then(function(){return t(r,n)()})}))}}},kE=function(t){var n=kR(t);return function(t){return rO(t)?n(t):kM}},kj=function(t){return function(n){return function(){return rC(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,rk(n))).then(rw))}}},kA=function(t){var n=kj(t);return function(t){return rO(t)?n(t):kM}},kN=function(t){return kE(function(n,r){return t(r)})},kP=kN(re),kL=function(t){return kA(function(n,r){return t(r)})},kD=kL(re),kF=rL(km),kW=rH(kg);let kU=Object.freeze(Object.defineProperty({__proto__:null,ApT:kM,ApplicativePar:kh,ApplicativeSeq:kg,ApplyPar:kd,ApplySeq:km,Chain:ky,Do:kO,FromIO:kx,FromTask:{URI:ku,fromIO:O9,fromTask:re},Functor:ks,Monad:kv,MonadIO:{URI:ku,map:O8,of:ki,ap:O7,chain:kt,fromIO:O9},MonadTask:{URI:ku,map:O8,of:ki,ap:O7,chain:kt,fromIO:O9,fromTask:re},Pointed:kc,URI:ku,ap:kr,apFirst:kf,apS:kI,apSecond:kp,bind:kC,bindTo:kk,chain:ko,chainFirst:kb,chainFirstIOK:kT,chainIOK:kS,delay:function(t){return function(n){return function(){return new Promise(function(r){setTimeout(function(){Promise.resolve().then(n).then(r)},t)})}}},flap:kl,flatten:ka,fromIO:O9,fromIOK:k_,fromTask:re,getMonoid:kW,getRaceMonoid:function(){return{concat:function(t,n){return function(){return Promise.race([Promise.resolve().then(t),Promise.resolve().then(n)])}},empty:kw}},getSemigroup:kF,map:kn,never:kw,of:ki,sequenceArray:kP,sequenceSeqArray:kD,task:{URI:ku,map:O8,of:ki,ap:O7,chain:kt,fromIO:O9,fromTask:re},taskSeq:{URI:ku,map:O8,of:ki,ap:ke,chain:kt,fromIO:O9,fromTask:re},traverseArray:kN,traverseArrayWithIndex:kE,traverseReadonlyArrayWithIndex:kE,traverseReadonlyArrayWithIndexSeq:kA,traverseReadonlyNonEmptyArrayWithIndex:kR,traverseReadonlyNonEmptyArrayWithIndexSeq:kj,traverseSeqArray:kL,traverseSeqArrayWithIndex:kA},Symbol.toStringTag,{value:"Module"}));var kz=O5(kc),kB=ra(O9,rt),kV=function(t,n){return rd(t,kH(n))},k$=function(t,n){return rd(t,kG(n))},kq=function(t,n){return rd(t,kY(function(t){return rd(n,kH(t))}))},kK=function(t,n){return rd(t,kY(n))},kH=O2(ks),kG=O3(kd),kZ=O1(kc),kY=O4(kv),kJ=kY(re),kQ="ReaderTask",kX={URI:kQ,map:kV},k0=rV(kX),k1={URI:kQ,of:kZ},k2={URI:kQ,map:kV,ap:k$},k3=rA(k2),k4=rN(k2),k5={URI:kQ,map:kV,ap:kq},k6={URI:kQ,map:kV,ap:kq,of:kZ},k9={URI:kQ,map:kV,ap:k$,chain:kK},k8={URI:kQ,map:kV,of:kZ,ap:k$,chain:kK},k7=rY(k9),Ce={URI:kQ,fromIO:kB},Ct=yx(Ce),Cn=y_(Ce,k9),Cr=yS(Ce,k9),Ci={URI:kQ,fromReader:kz},Co=vi(Ci),Ca=vo(Ci),Cu=va(Ci),Cs=vu(Ci,k9),Cl=vs(Ci,k9),Cc={URI:kQ,fromIO:kB,fromTask:rt},Cd=vY(Cc),Cf=vJ(Cc,k9),Cp=vQ(Cc,k9),Ch=kZ(rM),Cm=r$(kX),Cg=rJ(k9),Cy=rP(k2),Cv=kZ(rI),Cb=function(t){return ra(y9(t),yj(kR(rf)))},Cx=function(t){var n=Cb(t);return function(t){return rO(t)?n(t):Cv}},C_=function(t){return ra(y9(t),yj(kj(rf)))},CS=function(t){var n=C_(t);return function(t){return rO(t)?n(t):Cv}},CT=function(t){return Cx(function(n,r){return t(r)})},Cw=CT(re),CO=function(t){return CS(function(n,r){return t(r)})},Ck=CO(re),CC=rL(k5),CI=rH(k6);function CM(t,n){return t(n)()}let CR=Object.freeze(Object.defineProperty({__proto__:null,ApT:Cv,ApplicativePar:{URI:kQ,map:kV,ap:k$,of:kZ},ApplicativeSeq:k6,ApplyPar:k2,ApplySeq:k5,Chain:k9,Do:Ch,FromIO:Ce,FromReader:Ci,FromTask:Cc,Functor:kX,Monad:k8,MonadIO:{URI:kQ,map:kV,of:kZ,ap:k$,chain:kK,fromIO:kB},MonadTask:{URI:kQ,map:kV,of:kZ,ap:k$,chain:kK,fromIO:kB,fromTask:rt},Pointed:k1,URI:kQ,ap:kG,apFirst:k3,apS:Cy,apSW:Cy,apSecond:k4,apW:kG,ask:Co,asks:Ca,asksReaderTask:yk,asksReaderTaskW:yk,bind:Cg,bindTo:Cm,bindW:Cg,chain:kY,chainFirst:k7,chainFirstIOK:Cr,chainFirstReaderK:Cl,chainFirstReaderKW:Cl,chainFirstTaskK:Cp,chainFirstW:k7,chainIOK:Cn,chainReaderK:Cs,chainReaderKW:Cs,chainTaskK:Cf,chainW:kY,flap:k0,flatten:kJ,flattenW:kJ,fromIO:kB,fromIOK:Ct,fromReader:kz,fromReaderK:Cu,fromTask:rt,fromTaskK:Cd,getMonoid:CI,getSemigroup:CC,local:yO,map:kH,of:kZ,readerTask:{URI:kQ,map:kV,of:kZ,ap:k$,chain:kK,fromIO:kB,fromTask:rt},readerTaskSeq:{URI:kQ,map:kV,of:kZ,ap:kq,chain:kK,fromIO:kB,fromTask:rt},run:CM,sequenceArray:Cw,sequenceSeqArray:Ck,traverseArray:CT,traverseArrayWithIndex:Cx,traverseReadonlyArrayWithIndex:Cx,traverseReadonlyArrayWithIndexSeq:CS,traverseReadonlyNonEmptyArrayWithIndex:Cb,traverseReadonlyNonEmptyArrayWithIndexSeq:C_,traverseSeqArray:CO,traverseSeqArrayWithIndex:CS},Symbol.toStringTag,{value:"Module"}));var CE=globalThis&&globalThis.__awaiter||function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{l(i.next(t))}catch(n){a(n)}}function s(t){try{l(i.throw(t))}catch(n){a(n)}}function l(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}l((i=i.apply(t,n||[])).next())})},Cj=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])}}},CA=gU(kc),CN=gW(kc),CP=gz(ks),CL=gB(ks),CD=ra(O9,CP),CF=ra(O9,CL),CW=function(t){return kn(gt(t))},CU=gX(ks),Cz=g0(kv),CB=g1(kv),CV=function(t,n){return function(){return CE(void 0,void 0,void 0,function(){var r;return Cj(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t().then(rT)];case 1:return[2,r.sent()];case 2:return[2,rS(n(r.sent()))];case 3:return[2]}})})}},C$=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return CV(function(){return t.apply(void 0,r)},n)}},Cq=g6(ks),CK=gV(kc),CH=g$(kc),CG=gq(kv),CZ=g2(kv),CY=g3(kv),CJ=function(t){return CY(IA(t))},CQ=function(t){return CY(ID(t))},CX=g4(kv),C0=g5(ks),C1=function(t){var n=CW(t);return function(t){return ra(t,n)}},C2=function(t){return function(n){return function(r){return rd(r,Ia(C1(t)(n)))}}},C3=function(t){return ra(t,O9)},C4=function(t){return Iu(C3(t))},C5=function(t,n){return rd(t,In(n))},C6=function(t,n){return rd(t,Io(n))},C9=function(t,n){return rd(t,Ia(function(t){return rd(n,In(t))}))},C8=function(t,n){return rd(t,Ia(n))},C7=function(t,n,r){return rd(t,Ir(n,r))},Ie=function(t,n){return rd(t,Ii(n))},It=function(t,n){return rd(t,Il(n))},In=gK(ks),Ir=gY(ks),Ii=gJ(ks),Io=gH(kd),Ia=gG(kv),Iu=Ia,Is=Iu(re),Il=gZ(kv),Ic="TaskEither";function Id(t,n){var r=rj(t,mU(n));return{URI:Ic,_E:void 0,map:C5,ap:function(t,n){return rd(t,r(n))},of:CN}}function If(t){var n=gQ(kv,t);return{URI:Ic,_E:void 0,map:C5,alt:function(t,r){return rd(t,n(r))}}}var Ip=function(t){var n=mD(t);return{URI:Ic,_E:void 0,compact:h4(ks,n),separate:h5(ks,n,mV)}},Ih={URI:Ic,map:C5},Im=rV(Ih),Ig={URI:Ic,map:C5,ap:C6},Iy=rA(Ig),Iv=rN(Ig),Ib={URI:Ic,map:C5,ap:C9},Ix={URI:Ic,map:C5,ap:C9,of:CN},I_={URI:Ic,map:C5,ap:C6,chain:C8},IS=rY(I_),IT={URI:Ic,fromEither:ki},Iw=rX(IT),IO=r1(IT),Ik=r2(IT,I_),IC=r4(IT,I_),II=r5(IT,I_),IM=r0(IT),IR=r6(IT,I_),IE=r3(IT),Ij={URI:Ic,fromIO:CD},IA=yx(Ij),IN=y_(Ij,I_),IP=yS(Ij,I_),IL={URI:Ic,fromIO:CD,fromTask:CP},ID=vY(IL),IF=vJ(IL,I_),IW=vQ(IL,I_),IU=function(t,n,r){return Iz(t,n,r)},Iz=function(t,n,r){return rd(t,Iu(function(t){return rd(n(t),ko(function(n){return rd(r(t,n),Iu(function(){return ki(n)}))}))}))},IB=CN(rM),IV=r$(Ih),I$=rJ(I_),Iq=rP(Ig),IK=CN(rI),IH=function(t){return ra(kR(t),kn(gM(rf)))},IG=function(t){var n=IH(t);return function(t){return rO(t)?n(t):IK}},IZ=function(t){return function(n){return function(){return rC(n).reduce(function(n,r,i){return n.then(function(o){return rx(o)?n:t(i+1,r)().then(function(t){return rx(t)?t:(o.right.push(t.right),o)})})},t(0,rk(n))().then(mB(rw)))}}},IY=function(t){var n=IZ(t);return function(t){return rO(t)?n(t):IK}},IJ=function(t){return IG(function(n,r){return t(r)})},IQ=IJ(re),IX=function(t){return IY(function(n,r){return t(r)})},I0=IX(re),I1=rL(Ib),I2=rH(Ix),I3=function(t){return rL(km)(mL(t))};let I4=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Ic,map:C5,alt:It},ApT:IK,ApplicativePar:{URI:Ic,map:C5,ap:C6,of:CN},ApplicativeSeq:Ix,ApplyPar:Ig,ApplySeq:Ib,Bifunctor:{URI:Ic,bimap:C7,mapLeft:Ie},Chain:I_,Do:IB,FromEither:IT,FromIO:Ij,FromTask:IL,Functor:Ih,Monad:{URI:Ic,map:C5,ap:C6,chain:C8,of:CN},MonadIO:{URI:Ic,map:C5,ap:C6,chain:C8,of:CN,fromIO:CD},MonadTask:{URI:Ic,map:C5,ap:C6,chain:C8,of:CN,fromIO:CD,fromTask:CP},MonadThrow:{URI:Ic,map:C5,ap:C6,chain:C8,of:CN,throwError:CA},Pointed:{URI:Ic,of:CN},URI:Ic,alt:Il,altW:Il,ap:Io,apFirst:Iy,apFirstW:Iy,apS:Iq,apSW:Iq,apSecond:Iv,apSecondW:Iv,apW:Io,bimap:Ir,bind:I$,bindTo:IV,bindW:I$,bracket:IU,bracketW:Iz,chain:Ia,chainEitherK:IC,chainEitherKW:IC,chainFirst:IS,chainFirstEitherK:II,chainFirstEitherKW:II,chainFirstIOK:IP,chainFirstTaskK:IW,chainFirstW:IS,chainIOEitherK:C4,chainIOEitherKW:C4,chainIOK:IN,chainNullableK:CG,chainOptionK:Ik,chainTaskK:IF,chainTaskOptionK:C2,chainTaskOptionKW:C2,chainW:Iu,filterOrElse:IR,filterOrElseW:IR,flap:Im,flatten:Is,flattenW:Is,fold:Cz,foldW:Cz,fromEither:ki,fromEitherK:IE,fromIO:CD,fromIOEither:O9,fromIOEitherK:C3,fromIOK:IA,fromNullable:CK,fromNullableK:CH,fromOption:Iw,fromOptionK:IO,fromPredicate:IM,fromTask:CP,fromTaskK:ID,fromTaskOption:CW,fromTaskOptionK:C1,getAltTaskValidation:If,getApplicativeTaskValidation:Id,getApplyMonoid:I2,getApplySemigroup:I1,getCompactable:Ip,getFilterable:function(t){var n=mF(t),r=Ip(t),i=yi(ks,n),o=yo(ks,n),a=ya(ks,n),u=yu(ks,n);return{URI:Ic,_E:void 0,map:C5,compact:r.compact,separate:r.separate,filter:function(t,n){return rd(t,i(n))},filterMap:function(t,n){return rd(t,o(n))},partition:function(t,n){return rd(t,a(n))},partitionMap:function(t,n){return rd(t,u(n))}}},getOrElse:CB,getOrElseW:CB,getSemigroup:I3,getTaskValidation:function(t){var n=Id(kh,t),r=If(t);return{URI:Ic,_E:void 0,map:C5,ap:n.ap,of:CN,chain:C8,bimap:C7,mapLeft:Ie,alt:r.alt,fromIO:CD,fromTask:CP,throwError:CA}},left:CA,leftIO:CF,leftTask:CL,map:In,mapLeft:Ii,match:CU,matchE:Cz,matchEW:Cz,matchW:CU,of:CN,orElse:CZ,orElseFirst:CY,orElseFirstIOK:CJ,orElseFirstTaskK:CQ,orElseFirstW:CY,orElseW:CZ,orLeft:CX,right:CN,rightIO:CD,rightTask:CP,sequenceArray:IQ,sequenceSeqArray:I0,swap:C0,taskEither:{URI:Ic,bimap:C7,mapLeft:Ie,map:C5,of:CN,ap:C6,chain:C8,alt:It,fromIO:CD,fromTask:CP,throwError:CA},taskEitherSeq:{URI:Ic,bimap:C7,mapLeft:Ie,map:C5,of:CN,ap:C9,chain:C8,alt:It,fromIO:CD,fromTask:CP,throwError:CA},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(rS(t)):r(rT(n))};t.apply(null,n.concat(i))})}}},throwError:CA,toUnion:Cq,traverseArray:IJ,traverseArrayWithIndex:IG,traverseReadonlyArrayWithIndex:IG,traverseReadonlyArrayWithIndexSeq:IY,traverseReadonlyNonEmptyArrayWithIndex:IH,traverseReadonlyNonEmptyArrayWithIndexSeq:IZ,traverseSeqArray:IX,traverseSeqArrayWithIndex:IY,tryCatch:CV,tryCatchK:C$},Symbol.toStringTag,{value:"Module"}));var I5=gU(k1),I6=gW(k1),I9=ra(CP,rt),I8=ra(CL,rt),I7=function(t){return ra(t,CN)},Me=function(t){return ra(t,CA)},Mt=gz(kX),Mn=gB(kX),Mr=ra(CD,rt),Mi=ra(CF,rt),Mo=ra(O9,rt),Ma=function(t){return ra(t,ki)},Mu=gX(kX),Ms=g0(k9),Ml=g1(k8),Mc=g6(kX),Md=gV(k1),Mf=g$(k1),Mp=gq(k8),Mh=g2(k8),Mm=g3(k8),Mg=g4(k8),My=g5(kX),Mv=function(t){return ra(t,Mo)},Mb=function(t){return MF(Mv(t))},Mx=function(t){return ra(t,rt)},M_=function(t){return MF(Mx(t))},MS=function(t){return M1(Mx(t))},MT=function(t){return ra(t,Ma)},Mw=function(t){return MF(MT(t))},MO=function(t){return M1(MT(t))},Mk=function(t,n){return rd(t,MA(n))},MC=function(t,n){return rd(t,ML(n))},MI=function(t,n){return rd(t,MD(function(t){return rd(n,MA(t))}))},MM=function(t,n){return rd(t,MD(n))},MR=function(t,n){return rd(t,MU(n))},ME=function(t,n,r){return rd(t,MN(n,r))},Mj=function(t,n){return rd(t,MP(n))},MA=gK(kX),MN=gY(kX),MP=gJ(kX),ML=gH(k2),MD=gG(k8),MF=MD,MW=MF(re),MU=gZ(k8),Mz="ReaderTaskEither",MB=function(t){var n=mD(t);return{URI:Mz,_E:void 0,compact:h4(kX,n),separate:h5(kX,n,mV)}};function MV(t,n){var r=rj(yZ,Id(t,n));return{URI:Mz,_E:void 0,map:Mk,ap:function(t,n){return rd(t,r(n))},of:I6}}function M$(t){var n=gQ(k8,t);return{URI:Mz,_E:void 0,map:Mk,alt:function(t,r){return rd(t,n(r))}}}var Mq={URI:Mz,map:Mk},MK=rV(Mq),MH={URI:Mz,of:I6},MG={URI:Mz,map:Mk,ap:MC},MZ=rA(MG),MY=rN(MG),MJ={URI:Mz,map:Mk,ap:MI},MQ={URI:Mz,map:Mk,ap:MI,of:I6},MX={URI:Mz,map:Mk,ap:MC,chain:MM},M0=rY(MX),M1=M0,M2={URI:Mz,fromReader:I7},M3=vi(M2),M4=vo(M2),M5=va(M2),M6=vu(M2,MX),M9=vs(M2,MX),M8=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Mt(t.apply(void 0,n))}},M7=function(t){return MF(M8(t))},Re=function(t){return M1(M8(t))},Rt={URI:Mz,fromEither:kZ},Rn=rX(Rt),Rr=r1(Rt),Ri=r2(Rt,MX),Ro=r4(Rt,MX),Ra=r5(Rt,MX),Ru=r0(Rt),Rs=r6(Rt,MX),Rl=r3(Rt),Rc={URI:Mz,fromIO:Mr},Rd=yx(Rc),Rf=y_(Rc,MX),Rp=yS(Rc,MX),Rh={URI:Mz,fromIO:Mr,fromTask:I9},Rm=vY(Rh),Rg=vJ(Rh,MX),Ry=vQ(Rh,MX);function Rv(t,n,r){return Rb(t,n,r)}function Rb(t,n,r){return function(i){return Iz(t(i),function(t){return n(t)(i)},function(t,n){return r(t,n)(i)})}}var Rx=I6(rM),R_=r$(Mq),RS=rJ(MX),RT=rP(MG),Rw=I6(rI),RO=function(t){return ra(y9(t),yj(IH(rf)))},Rk=function(t){var n=RO(t);return function(t){return rO(t)?n(t):Rw}},RC=function(t){return ra(y9(t),yj(IZ(rf)))},RI=function(t){var n=RC(t);return function(t){return rO(t)?n(t):Rw}},RM=function(t){return Rk(function(n,r){return t(r)})},RR=RM(re),RE=function(t){return RI(function(n,r){return t(r)})},Rj=RE(re),RA=rL(MJ),RN=rH(MQ),RP=function(t){return rL(k5)(mL(t))};function RL(t,n){return t(n)()}let RD=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Mz,map:Mk,alt:MR},ApT:Rw,ApplicativePar:{URI:Mz,map:Mk,ap:MC,of:I6},ApplicativeSeq:MQ,ApplyPar:MG,ApplySeq:MJ,Bifunctor:{URI:Mz,bimap:ME,mapLeft:Mj},Chain:MX,Do:Rx,FromEither:Rt,FromIO:Rc,FromReader:M2,FromTask:Rh,Functor:Mq,Monad:{URI:Mz,map:Mk,ap:MC,chain:MM,of:I6},MonadIO:{URI:Mz,map:Mk,ap:MC,chain:MM,of:I6,fromIO:Mr},MonadTask:{URI:Mz,map:Mk,ap:MC,chain:MM,of:I6,fromIO:Mr,fromTask:I9},MonadThrow:{URI:Mz,map:Mk,ap:MC,chain:MM,of:I6,throwError:I5},Pointed:MH,URI:Mz,alt:MU,altW:MU,ap:ML,apFirst:MZ,apFirstW:MZ,apS:RT,apSW:RT,apSecond:MY,apSecondW:MY,apW:ML,ask:M3,asks:M4,asksReaderTaskEither:yk,asksReaderTaskEitherW:yk,bimap:MN,bind:RS,bindTo:R_,bindW:RS,bracket:Rv,bracketW:Rb,chain:MD,chainEitherK:Ro,chainEitherKW:Ro,chainFirst:M0,chainFirstEitherK:Ra,chainFirstEitherKW:Ra,chainFirstIOK:Rp,chainFirstReaderEitherK:MO,chainFirstReaderEitherKW:MO,chainFirstReaderK:M9,chainFirstReaderKW:M9,chainFirstReaderTaskK:Re,chainFirstReaderTaskKW:Re,chainFirstTaskEitherK:MS,chainFirstTaskEitherKW:MS,chainFirstTaskK:Ry,chainFirstW:M1,chainIOEitherK:Mb,chainIOEitherKW:Mb,chainIOK:Rf,chainNullableK:Mp,chainOptionK:Ri,chainReaderEitherK:Mw,chainReaderEitherKW:Mw,chainReaderK:M6,chainReaderKW:M6,chainReaderTaskK:M7,chainReaderTaskKW:M7,chainTaskEitherK:M_,chainTaskEitherKW:M_,chainTaskK:Rg,chainW:MF,filterOrElse:Rs,filterOrElseW:Rs,flap:MK,flatten:MW,flattenW:MW,fold:Ms,foldW:Ms,fromEither:kZ,fromEitherK:Rl,fromIO:Mr,fromIOEither:Mo,fromIOEitherK:Mv,fromIOK:Rd,fromNullable:Md,fromNullableK:Mf,fromOption:Rn,fromOptionK:Rr,fromPredicate:Ru,fromReader:I7,fromReaderEither:Ma,fromReaderEitherK:MT,fromReaderK:M5,fromReaderTaskK:M8,fromTask:I9,fromTaskEither:rt,fromTaskEitherK:Mx,fromTaskK:Rm,getAltReaderTaskValidation:M$,getApplicativeReaderTaskValidation:MV,getApplyMonoid:RN,getApplySemigroup:RA,getCompactable:MB,getFilterable:function(t){var n=mF(t),r=MB(t),i=yi(kX,n),o=yo(kX,n),a=ya(kX,n),u=yu(kX,n);return{URI:Mz,_E:void 0,map:Mk,compact:r.compact,separate:r.separate,filter:function(t,n){return rd(t,i(n))},filterMap:function(t,n){return rd(t,o(n))},partition:function(t,n){return rd(t,a(n))},partitionMap:function(t,n){return rd(t,u(n))}}},getOrElse:Ml,getOrElseW:Ml,getReaderTaskValidation:function(t){var n=MV(kh,t),r=M$(t);return{URI:Mz,_E:void 0,map:Mk,of:I6,chain:MM,bimap:ME,mapLeft:Mj,ap:n.ap,alt:r.alt,fromIO:Mr,fromTask:I9,throwError:I5}},getSemigroup:RP,left:I5,leftIO:Mi,leftReader:Me,leftReaderTask:Mn,leftTask:I8,local:yO,map:MA,mapLeft:MP,match:Mu,matchE:Ms,matchEW:Ms,matchW:Mu,of:I6,orElse:Mh,orElseFirst:Mm,orElseFirstW:Mm,orElseW:Mh,orLeft:Mg,readerTaskEither:{URI:Mz,map:Mk,of:I6,ap:MC,chain:MM,alt:MR,bimap:ME,mapLeft:Mj,fromIO:Mr,fromTask:I9,throwError:I5},readerTaskEitherSeq:{URI:Mz,map:Mk,of:I6,ap:MI,chain:MM,alt:MR,bimap:ME,mapLeft:Mj,fromIO:Mr,fromTask:I9,throwError:I5},right:I6,rightIO:Mr,rightReader:I7,rightReaderTask:Mt,rightTask:I9,run:RL,sequenceArray:RR,sequenceSeqArray:Rj,swap:My,throwError:I5,toUnion:Mc,traverseArray:RM,traverseArrayWithIndex:Rk,traverseReadonlyArrayWithIndex:Rk,traverseReadonlyArrayWithIndexSeq:RI,traverseReadonlyNonEmptyArrayWithIndex:RO,traverseReadonlyNonEmptyArrayWithIndexSeq:RC,traverseSeqArray:RE,traverseSeqArrayWithIndex:RI},Symbol.toStringTag,{value:"Module"}));var RF={equals:function(t,n){return t===n}},RW={concat:function(t,n){return t+n}},RU={concat:RW.concat,empty:""},Rz={equals:RF.equals,compare:function(t,n){return t<n?-1:t>n?1:0}},RB=function(t){return"string"==typeof t},RV=function(t){return t.toUpperCase()},R$=function(t){return t.toLowerCase()},Rq=function(t,n){return function(r){return r.replace(t,n)}},RK=function(t){return t.trim()},RH=function(t){return t.trimLeft()},RG=function(t){return t.trimRight()},RZ=function(t,n){return function(r){return r.slice(t,n)}},RY=function(t){return 0===t.length},RJ=function(t){return t.length},RQ=function(t){return function(n){var r=n.split(t);return rO(r)?r:[n]}},RX=function(t,n){return function(r){return r.includes(t,n)}},R0=function(t,n){return function(r){return r.startsWith(t,n)}},R1=function(t,n){return function(r){return r.endsWith(t,n)}};let R2=Object.freeze(Object.defineProperty({__proto__:null,Eq:RF,Monoid:RU,Ord:Rz,Semigroup:RW,Show:{show:function(t){return JSON.stringify(t)}},empty:"",endsWith:R1,includes:RX,isEmpty:RY,isString:RB,replace:Rq,size:RJ,slice:RZ,split:RQ,startsWith:R0,toLowerCase:R$,toUpperCase:RV,trim:RK,trimLeft:RH,trimRight:RG},Symbol.toStringTag,{value:"Module"}));var R3=function(t){return Object.assign({},t)},R4=function(t){return Object.assign({},t)},R5=function(t){return Object.keys(t).length},R6=function(t){for(var n in t)if(rR.call(t,n))return!1;return!0},R9=function(t){return function(n){return Object.keys(n).sort(t.compare)}},R8=R9(Rz);function R7(t){if("function"==typeof t)return R7(Rz)(t);var n=R9(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 Ee=R7(Rz)(function(t,n){return[t,n]}),Et=function(t,n){return function(r){if(rR.call(r,t)&&r[t]===n)return r;var i=Object.assign({},r);return i[t]=n,i}},En=function(t,n){return rR.call(n,t)};function Er(t){return function(n){if(!rR.call(n,t))return n;var r=Object.assign({},n);return delete r[t],r}}var Ei=function(t,n){return function(r){if(!En(t,r))return rv;if(r[t]===n)return rb(r);var i=Object.assign({},r);return i[t]=n,rb(i)}},Eo=function(t,n){return function(r){if(!En(t,r))return rv;var i=n(r[t]);if(i===r[t])return rb(r);var o=Object.assign({},r);return o[t]=i,rb(o)}};function Ea(t){return function(n,r){if(void 0===r){var i=Ea(t);return function(t){return i(t,n)}}for(var o in n)if(!rR.call(r,o)||!t.equals(n[o],r[o]))return!1;return!0}}function Eu(t,n){return void 0===n?function(n){return Eu(t,n)}:rR.call(n,t)?rb(n[t]):rv}var Es={};function El(t){return function(n){var r={};for(var i in n)rR.call(n,i)&&(r[i]=t(i,n[i]));return r}}function Ec(t){return El(function(n,r){return t(r)})}function Ed(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(2===t.length)return Ed(Rz).apply(void 0,t);var r=R9(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 l=a[s];o=n(l,o,i[l])}return o}}}function Ef(t){if("compare"in t){var n=R9(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 l=a[s];o=t.concat(o,r(l,i[l]))}return o}}}}return Ef(Rz)(t)}function Ep(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(2===t.length)return Ep(Rz).apply(void 0,t);var r=R9(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 l=a[s];o=n(l,i[l],o)}return o}}}var Eh=function(t,n){var r;return(r={})[t]=n,r};function Em(t){var n=EJ(Rz)(t);return function(t){return function(r){return n(r,t)}}}function Eg(t){var n=EZ(Rz)(t);return function(t){return function(r){return n(r,t)}}}function Ey(t){return EY(Rz)(t)}var Ev=function(t){var n=Eg(t);return function(r){return function(i){return t.map(rd(i,n(r)),E5)}}},Eb=function(t){var n=Eg(t);return function(r){return function(i){return t.map(rd(i,n(r)),E6)}}};function Ex(t){return function(n){var r={},i={};for(var o in n)if(rR.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 sa(r,i)}}function E_(t){return function(n){var r={},i={};for(var o in n)if(rR.call(n,o)){var a=n[o];t(o,a)?i[o]=a:r[o]=a}return sa(r,i)}}function ES(t){return function(n){var r={};for(var i in n)if(rR.call(n,i)){var o=t(i,n[i]);ry(o)&&(r[i]=o.value)}return r}}function ET(t){return function(n){var r={},i=!1;for(var o in n)if(rR.call(n,o)){var a=n[o];t(o,a)?r[o]=a:i=!0}return i?r:n}}function Ew(t,n){var r=EO(t,n);return function(t){return r(t,re)}}function EO(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]=rR.call(n,a)?t.concat(n[a],u):u,n})}}var Ek=function(t){for(var n={},r=0;r<t.length;r++){var i=t[r];n[i[0]]=i[1]}return n};function EC(t){return function(n){for(var r in n)if(!t(n[r]))return!1;return!0}}function EI(t){return function(n){for(var r in n)if(t(n[r]))return!0;return!1}}function EM(t){return function(n,r){if(void 0===r){var i=EM(t);return function(t){return i(n,t)}}for(var o in r)if(t.equals(r[o],n))return!0;return!1}}var ER=function(t){return function(n){return function(r){if(R6(r))return n;if(R6(n))return r;var i={};for(var o in r)En(o,n)?i[o]=t.concat(r[o],n[o]):i[o]=r[o];for(var o in n)En(o,i)||(i[o]=n[o]);return i}}},EE=function(t){return function(n){return function(r){if(R6(r)||R6(n))return Es;var i={};for(var o in r)En(o,n)&&(i[o]=t.concat(r[o],n[o]));return i}}},Ej=function(t){return function(n){if(R6(n))return t;if(R6(t))return n;var r={};for(var i in n)En(i,t)||(r[i]=n[i]);for(var i in t)En(i,n)||(r[i]=t[i]);return r}},EA=function(t,n){return rd(t,Ec(n))},EN=function(t,n){return rd(t,El(n))},EP=function(t){var n=E2(t);return function(t,r,i){return rd(t,n(r,i))}},EL=function(t){return function(n){var r=E3(t)(n);return function(t,n){return rd(t,r(n))}}},ED=function(t){var n=E4(t);return function(t,r,i){return rd(t,n(r,i))}},EF=function(t,n){return rd(t,EQ(n))},EW=function(t,n){return rd(t,EX(n))},EU=function(t,n){return rd(t,E0(n))},Ez=function(t,n){return rd(t,E1(n))},EB=function(t){var n=Ed(t);return function(t,r,i){return rd(t,n(r,i))}},EV=function(t){var n=Ef(t);return function(t){var r=n(t);return function(t,n){return rd(t,r(n))}}},E$=function(t){var n=Ep(t);return function(t,r,i){return rd(t,n(r,i))}},Eq=function(t,n){return rd(t,Ex(n))},EK=function(t,n){return rd(t,E_(n))},EH=function(t,n){return rd(t,ES(n))},EG=function(t,n){return rd(t,ET(n))},EZ=function(t){var n=EJ(t);return function(t){var r=n(t);return function(t,n){return r(t,ra(rf,n))}}},EY=function(t){var n=EZ(t);return function(t){var r=n(t);return function(t){return r(t,re)}}},EJ=function(t){return function(n){var r=R9(t);return function(t,i){var o=r(t);if(0===o.length)return n.of(Es);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}}},EQ=function(t){return ET(function(n,r){return t(r)})},EX=function(t){return ES(function(n,r){return t(r)})},E0=function(t){return E_(function(n,r){return t(r)})},E1=function(t){return Ex(function(n,r){return t(r)})};function E2(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(1===t.length){var r=Ed(t[0]);return function(t,n){return r(t,function(t,r,i){return n(r,i)})}}return E2(Rz).apply(void 0,t)}function E3(t){if("compare"in t){var n=Ef(t);return function(t){var r=n(t);return function(t){return r(function(n,r){return t(r)})}}}return E3(Rz)(t)}function E4(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(1===t.length){var r=Ep(t[0]);return function(t,n){return r(t,function(t,r,i){return n(r,i)})}}return E4(Rz).apply(void 0,t)}var E5=function(t){var n={};for(var r in t)if(rR.call(t,r)){var i=t[r];ry(i)&&(n[r]=i.value)}return n},E6=function(t){var n={},r={};for(var i in t)if(rR.call(t,i)){var o=t[i];rx(o)?n[i]=o.left:r[i]=o.right}return sa(n,r)},E9="ReadonlyRecord";function E8(t){return"compare"in t?function(n){return{show:function(r){var i=R7(t)(function(t,r){return"".concat(JSON.stringify(t),": ").concat(n.show(r))})(r).join(", ");return""===i?"{}":"{ ".concat(i," }")}}}:E8(Rz)(t)}function E7(t){var n=Ea(t);return r8(function(t,r){return n(t)(r)&&n(r)(t)})}function je(t){return{concat:function(n,r){if(R6(n))return r;if(R6(r))return n;var i=Object.assign({},n);for(var o in r)rR.call(r,o)&&(i[o]=rR.call(n,o)?t.concat(n[o],r[o]):r[o]);return i},empty:Es}}var jt={URI:E9,map:EA},jn=rV(jt),jr=function(t){return{URI:E9,reduce:EP(t),foldMap:EL(t),reduceRight:ED(t)}},ji=function(t){return{URI:E9,reduce:EP(t),foldMap:EL(t),reduceRight:ED(t),reduceWithIndex:EB(t),foldMapWithIndex:EV(t),reduceRightWithIndex:E$(t)}},jo={URI:E9,compact:E5,separate:E6},ja=function(t){return{URI:E9,map:EA,reduce:EP(t),foldMap:EL(t),reduceRight:ED(t),traverse:EZ(t),sequence:EY(t)}},ju=function(t){return{URI:E9,map:EA,mapWithIndex:EN,reduce:EP(t),foldMap:EL(t),reduceRight:ED(t),reduceWithIndex:EB(t),foldMapWithIndex:EV(t),reduceRightWithIndex:E$(t),traverse:EZ(t),sequence:EY(t),traverseWithIndex:EJ(t)}},js=function(t){var n=ja(t);return{URI:E9,map:EA,reduce:EP(t),foldMap:EL(t),reduceRight:ED(t),traverse:n.traverse,sequence:n.sequence,compact:E5,separate:E6,filter:EF,filterMap:EW,partition:EU,partitionMap:Ez,wither:sb(n,jo),wilt:sv(n,jo)}},jl=function(t){var n=ER(t);return{concat:function(t,r){return n(r)(t)}}},jc=function(t){return{concat:jl(t).concat,empty:Es}},jd=function(t){var n=EE(t);return{concat:function(t,r){return n(r)(t)}}},jf=function(){return{concat:function(t,n){return Ej(n)(t)}}},jp={URI:E9,reduce:EP(Rz),foldMap:EL(Rz),reduceRight:ED(Rz)},jh={URI:E9,reduce:EP(Rz),foldMap:EL(Rz),reduceRight:ED(Rz),reduceWithIndex:EB(Rz),foldMapWithIndex:EV(Rz),reduceRightWithIndex:E$(Rz)},jm={URI:E9,map:EA,reduce:EP(Rz),foldMap:EL(Rz),reduceRight:ED(Rz),traverse:EZ(Rz),sequence:Ey},jg={URI:E9,map:EA,mapWithIndex:EN,reduce:EP(Rz),foldMap:EL(Rz),reduceRight:ED(Rz),reduceWithIndex:EB(Rz),foldMapWithIndex:EV(Rz),reduceRightWithIndex:E$(Rz),traverse:EZ(Rz),sequence:Ey,traverseWithIndex:EJ(Rz)},jy=sb(jm,jo),jv=sv(jm,jo),jb={URI:E9,map:EA,reduce:EP(Rz),foldMap:EL(Rz),reduceRight:ED(Rz),traverse:EZ(Rz),sequence:Ey,compact:E5,separate:E6,filter:EF,filterMap:EW,partition:EU,partitionMap:Ez,wither:jy,wilt:jv};function jx(t,n){return rR.call(void 0===n?this:n,t)}var j_={URI:E9,map:EA,reduce:EP(Rz),foldMap:EL(Rz),reduceRight:ED(Rz),traverse:EZ(Rz),sequence:Ey,compact:E5,separate:E6,filter:EF,filterMap:EW,partition:EU,partitionMap:Ez,mapWithIndex:EN,reduceWithIndex:EB(Rz),foldMapWithIndex:EV(Rz),reduceRightWithIndex:E$(Rz),filterMapWithIndex:EH,filterWithIndex:EG,partitionMapWithIndex:Eq,partitionWithIndex:EK,traverseWithIndex:EJ(Rz),wither:jy,wilt:jv};let jS=Object.freeze(Object.defineProperty({__proto__:null,Compactable:jo,Filterable:{URI:E9,map:EA,compact:E5,separate:E6,filter:EF,filterMap:EW,partition:EU,partitionMap:Ez},FilterableWithIndex:{URI:E9,map:EA,mapWithIndex:EN,compact:E5,separate:E6,filter:EF,filterMap:EW,partition:EU,partitionMap:Ez,filterMapWithIndex:EH,filterWithIndex:EG,partitionMapWithIndex:Eq,partitionWithIndex:EK},Foldable:jp,FoldableWithIndex:jh,Functor:jt,FunctorWithIndex:{URI:E9,map:EA,mapWithIndex:EN},Traversable:jm,TraversableWithIndex:jg,URI:E9,Witherable:jb,_filter:EF,_filterMap:EW,_filterMapWithIndex:EH,_filterWithIndex:EG,_foldMap:EL,_foldMapWithIndex:EV,_map:EA,_mapWithIndex:EN,_partition:EU,_partitionMap:Ez,_partitionMapWithIndex:Eq,_partitionWithIndex:EK,_reduce:EP,_reduceRight:ED,_reduceRightWithIndex:E$,_reduceWithIndex:EB,_sequence:EY,_traverse:EZ,collect:R7,compact:E5,deleteAt:Er,difference:Ej,elem:EM,empty:Es,every:EC,filter:EQ,filterMap:EX,filterMapWithIndex:ES,filterWithIndex:ET,flap:jn,foldMap:E3,foldMapWithIndex:Ef,fromEntries:Ek,fromFoldable:Ew,fromFoldableMap:EO,fromRecord:R3,getDifferenceMagma:jf,getEq:E7,getFoldable:jr,getFoldableWithIndex:ji,getIntersectionSemigroup:jd,getMonoid:je,getShow:E8,getTraversable:ja,getTraversableWithIndex:ju,getUnionMonoid:jc,getUnionSemigroup:jl,getWitherable:js,has:En,hasOwnProperty:jx,insertAt:Et,intersection:EE,isEmpty:R6,isSubrecord:Ea,keys:R8,lookup:Eu,map:Ec,mapWithIndex:El,modifyAt:Eo,partition:E0,partitionMap:E1,partitionMapWithIndex:Ex,partitionWithIndex:E_,pop:function(t){var n=Er(t);return function(r){var i=Eu(t,r);return rg(i)?rv:rb([i.value,n(r)])}},readonlyRecord:j_,reduce:E2,reduceRight:E4,reduceRightWithIndex:Ep,reduceWithIndex:Ed,separate:E6,sequence:Ey,singleton:Eh,size:R5,some:EI,toEntries:Ee,toReadonlyArray:Ee,toRecord:R4,toUnfoldable:function(t){return function(n){var r=Ee(n),i=r.length;return t.unfold(0,function(t){return t<i?rb([r[t],t+1]):rv})}},traverse:Eg,traverseWithIndex:Em,union:ER,updateAt:Ei,upsertAt:Et,wilt:Eb,wither:Ev},Symbol.toStringTag,{value:"Module"}));var jT=function(t){return new Set(t)},jw=function(t){return new Set([t])},jO=function(t){return function(n){for(var r=n.length,i=new Set,o=j$(t),a=0;a<r;a++){var u=n[a];o(u,i)||i.add(u)}return i}};function jk(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 jC(t){var n=j$(t);return function(r,i){if(void 0===i){var o=jC(t);return function(t){return o(r,t)}}if(jW(r))return i;if(jW(i))return r;var a=new Set(r);return i.forEach(function(t){n(t,a)||a.add(t)}),a}}function jI(t){var n=j$(t);return function(r,i){if(void 0===i){var o=jI(t);return function(t){return o(t,r)}}if(jW(r)||jW(i))return jF;var a=new Set;return r.forEach(function(t){n(t,i)&&a.add(t)}),a}}function jM(t){var n=j$(t);return function(r,i){if(void 0===i){var o=jM(t);return function(t){return o(t,r)}}return jk(function(t){return!n(t,i)})(r)}}function jR(t){var n=jq(t);return function(t,r){return function(i){return n(i).reduce(r,t)}}}function jE(t,n){var r=jq(t);return function(t){return function(i){return r(i).reduce(function(r,i){return n.concat(r,t(i))},n.empty)}}}var jj=function(t){var n=jq(t);return function(t,r){return function(i){return n(i).reduceRight(function(t,n){return r(n,t)},t)}}};function jA(t){var n=j$(t);return function(t){return function(r){if(n(t)(r))return r;var i=new Set(r);return i.add(t),i}}}var jN=function(t){return function(n){return function(r){return jk(function(r){return!t.equals(n,r)})(r)}}},jP=function(t){var n=j$(t),r=jN(t),i=jA(t);return function(t){return function(o){return(n(t,o)?r:i)(t)(o)}}},jL=function(t){return jD(t)(re)};function jD(t){var n=j$(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 jF=new Set,jW=function(t){return 0===t.size},jU=function(t){return t.size},jz=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 jB(t){return pC(jz(pC(t)))}function jV(t){var n=j$(t);return function(r,i){if(void 0===i){var o=jV(t);return function(t){return o(t,r)}}return jB(function(t){return n(t,i)})(r)}}function j$(t){return function(n,r){if(void 0===r){var i=j$(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 jq=function(t){return function(n){var r=[];return n.forEach(function(t){return r.push(t)}),r.sort(t.compare)}};function jK(t){return{show:function(n){var r=[];return n.forEach(function(n){r.push(t.show(n))}),"new Set([".concat(r.sort().join(", "),"])")}}}function jH(t){var n=jV(t);return r8(function(t,r){return n(t,r)&&n(r,t)})}var jG=function(t){return{concat:jC(t)}},jZ=function(t){return{concat:jG(t).concat,empty:jF}},jY=function(t){return{concat:jI(t)}},jJ=function(t){return{concat:jM(t)}};let jQ=Object.freeze(Object.defineProperty({__proto__:null,URI:"ReadonlySet",chain:function(t){var n=j$(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:jL,difference:jM,elem:j$,empty:jF,every:jB,filter:jk,filterMap:jD,foldMap:jE,fromArray:jO,fromReadonlyArray:jO,fromSet:jT,getDifferenceMagma:jJ,getEq:jH,getIntersectionSemigroup:jY,getShow:jK,getUnionMonoid:jZ,getUnionSemigroup:jG,insert:jA,intersection:jI,isEmpty:jW,isSubset:jV,map:function(t){var n=j$(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 sa(a,o)}},partitionMap:function(t,n){return function(r){return function(i){for(var o,a=i.values(),u=new Set,s=new Set,l=j$(t),c=j$(n);!(o=a.next()).done;){var d=r(o.value);switch(d._tag){case"Left":l(d.left,u)||u.add(d.left);break;case"Right":c(d.right,s)||s.add(d.right)}}return sa(u,s)}}},reduce:jR,reduceRight:jj,remove:jN,separate:function(t,n){return function(r){var i=j$(t),o=j$(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)}}),sa(a,u)}},singleton:jw,size:jU,some:jz,toReadonlyArray:jq,toSet:function(t){return new Set(t)},toggle:jP,union:jC},Symbol.toStringTag,{value:"Module"}));function jX(t){return t[0]}function j0(t){return t[1]}var j1=function(t){var n;return[j0(t),t[0]]};function j2(t){return{URI:Am,_E:void 0,map:j6,ap:function(n,r){var i,o;return[(0,n[0])(r[0]),t.concat(j0(n),j0(r))]}}}var j3=function(t){return function(n){return[n,t.empty]}};function j4(t){var n=j2(t);return{URI:Am,_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(j0(n),u)]}}}var j5=function(t,n){return rd(t,Au(n))},j6=function(t,n){return rd(t,Ao(n))},j9=function(t,n,r){return rd(t,Ai(n,r))},j8=function(t,n){return rd(t,Aa(n))},j7=function(t,n){return rd(t,As(n))},Ae=function(t,n,r){return rd(t,Ac(n,r))},At=function(t){var n=Ad();return function(t,r){return rd(t,n(r))}},An=function(t,n,r){return rd(t,Af(n,r))},Ar=function(t){var n=Ap(t);return function(t,r){return rd(t,n(r))}},Ai=function(t,n){return function(r){var i;return[n(r[0]),t(j0(r))]}},Ao=function(t){return function(n){var r;return[t(n[0]),j0(n)]}},Aa=function(t){return function(n){var r;return[n[0],t(j0(n))]}},Au=function(t){return function(n){var r;return[n[0],j0(t)]}},As=function(t){return function(n){return[t(n),j0(n)]}},Al=As(re),Ac=function(t,n){return function(r){var i;return n(t,r[0])}},Ad=function(){return function(t){return function(n){var r;return t(n[0])}}},Af=function(t,n){return function(r){var i;return n(r[0],t)}},Ap=function(t){return function(n){return function(r){var i;return t.map(n(r[0]),function(t){return[t,j0(r)]})}}},Ah=function(t){return function(n){var r;return t.map(n[0],function(t){return[t,j0(n)]})}},Am="ReadonlyTuple",Ag={URI:Am,map:j6},Ay=rV(Ag);let Av=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:Am,bimap:j9,mapLeft:j8},Comonad:{URI:Am,map:j6,extend:j7,extract:jX},Foldable:{URI:Am,reduce:Ae,foldMap:At,reduceRight:An},Functor:Ag,Semigroupoid:{URI:Am,compose:j5},Traversable:{URI:Am,map:j6,reduce:Ae,foldMap:At,reduceRight:An,traverse:Ar,sequence:Ah},URI:Am,bimap:Ai,compose:Au,duplicate:Al,extend:As,extract:jX,flap:Ay,foldMap:Ad,fst:jX,getApplicative:function(t){var n=j2(t);return{URI:Am,_E:void 0,map:n.map,ap:n.ap,of:j3(t)}},getApply:j2,getChain:j4,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,j0(a)),s=(a=r(s.left))[0];return[s.right,t.concat(u,j0(a))]},r=j4(t);return{URI:Am,_E:void 0,map:r.map,ap:r.ap,chain:r.chain,chainRec:n}},getMonad:function(t){var n=j4(t);return{URI:Am,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,of:j3(t)}},map:Ao,mapFst:Ao,mapLeft:Aa,mapSnd:Aa,readonlyTuple:{URI:Am,compose:j5,map:j6,bimap:j9,mapLeft:j8,extract:jX,extend:j7,reduce:Ae,foldMap:At,reduceRight:An,traverse:Ar,sequence:Ah},reduce:Ac,reduceRight:Af,sequence:Ah,snd:j0,swap:j1,traverse:Ap},Symbol.toStringTag,{value:"Module"}));var Ab=globalThis&&globalThis.__assign||function(){return(Ab=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)},Ax=function(t){return function(n){return Object.keys(n).sort(t.compare)}},A_=Ax(Rz);function AS(t){if("function"==typeof t)return AS(Rz)(t);var n=Ax(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 AT=AS(Rz)(function(t,n){return[t,n]});function Aw(t){return function(n){if(!rR.call(n,t))return n;var r=Object.assign({},n);return delete r[t],r}}var AO=function(t,n){return Ak(t,function(){return n})},Ak=function(t,n){return function(r){if(!En(t,r))return rv;var i=Object.assign({},r);return i[t]=n(r[t]),rb(i)}};function AC(t){return Em(t)}function AI(t){return Eg(t)}function AM(t){return Ey(t)}var AR=function(t){var n,r=Eg(t);return function(n){return function(i){return t.map(rd(i,r(n)),Az)}}},AE=function(t){var n,r=Eg(t);return function(n){return function(i){return t.map(rd(i,r(n)),AB)}}};function Aj(t){return E_(t)}function AA(t){return ET(t)}function AN(t,n){return Ew(t,n)}var AP=function(t){var n,r;return(n=iq(),Ew(n,fF))(t)};function AL(t,n){return EO(t,n)}var AD=function(t){var n=ER(t);return function(t){return function(r){return R6(r)?Ab({},t):R6(t)?Ab({},r):n(t)(r)}}},AF=function(t){return function(n){return function(r){return R6(r)||R6(n)?{}:EE(t)(n)(r)}}},AW=function(t){return function(n){return R6(n)?Ab({},t):R6(t)?Ab({},n):Ej(t)(n)}},AU=function(t){return function(n){var r=Ax(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}}},Az=E5,AB=E6,AV="Record",A$={URI:AV,map:EA},Aq=rV(A$),AK=function(t){return{URI:AV,reduce:EP(t),foldMap:EL(t),reduceRight:ED(t)}},AH=function(t){return{URI:AV,reduce:EP(t),foldMap:EL(t),reduceRight:ED(t),reduceWithIndex:EB(t),foldMapWithIndex:EV(t),reduceRightWithIndex:E$(t)}},AG={URI:AV,compact:Az,separate:AB},AZ=function(t){return{URI:AV,map:EA,reduce:EP(t),foldMap:EL(t),reduceRight:ED(t),traverse:EZ(t),sequence:EY(t)}},AY=function(t){return{URI:AV,map:EA,mapWithIndex:EN,reduce:EP(t),foldMap:EL(t),reduceRight:ED(t),reduceWithIndex:EB(t),foldMapWithIndex:EV(t),reduceRightWithIndex:E$(t),traverse:EZ(t),sequence:EY(t),traverseWithIndex:AU(t)}},AJ=function(t){var n=AZ(t);return{URI:AV,map:EA,reduce:EP(t),foldMap:EL(t),reduceRight:ED(t),traverse:n.traverse,sequence:n.sequence,compact:Az,separate:AB,filter:EF,filterMap:EW,partition:EU,partitionMap:Ez,wither:sb(n,AG),wilt:sv(n,AG)}},AQ=function(t){var n=AD(t);return{concat:function(t,r){return n(r)(t)}}},AX=function(t){return{concat:AQ(t).concat,empty:{}}},A0=function(t){var n=AF(t);return{concat:function(t,r){return n(r)(t)}}},A1=function(){return{concat:function(t,n){return AW(n)(t)}}},A2={URI:AV,reduce:EP(Rz),foldMap:EL(Rz),reduceRight:ED(Rz)},A3={URI:AV,reduce:EP(Rz),foldMap:EL(Rz),reduceRight:ED(Rz),reduceWithIndex:EB(Rz),foldMapWithIndex:EV(Rz),reduceRightWithIndex:E$(Rz)},A4={URI:AV,map:EA,reduce:EP(Rz),foldMap:EL(Rz),reduceRight:ED(Rz),traverse:EZ(Rz),sequence:AM},A5={URI:AV,map:EA,mapWithIndex:EN,reduce:EP(Rz),foldMap:EL(Rz),reduceRight:ED(Rz),reduceWithIndex:EB(Rz),foldMapWithIndex:EV(Rz),reduceRightWithIndex:E$(Rz),traverse:EZ(Rz),sequence:AM,traverseWithIndex:AU(Rz)},A6=sb(A4,AG),A9=sv(A4,AG),A8={URI:AV,map:EA,reduce:EP(Rz),foldMap:EL(Rz),reduceRight:ED(Rz),traverse:EZ(Rz),sequence:AM,compact:Az,separate:AB,filter:EF,filterMap:EW,partition:EU,partitionMap:Ez,wither:A6,wilt:A9},A7={URI:AV,map:EA,reduce:EP(Rz),foldMap:EL(Rz),reduceRight:ED(Rz),traverse:EZ(Rz),sequence:AM,compact:Az,separate:AB,filter:EF,filterMap:EW,partition:EU,partitionMap:Ez,mapWithIndex:EN,reduceWithIndex:EB(Rz),foldMapWithIndex:EV(Rz),reduceRightWithIndex:E$(Rz),filterMapWithIndex:EH,filterWithIndex:EG,partitionMapWithIndex:Eq,partitionWithIndex:EK,traverseWithIndex:AU(Rz),wither:A6,wilt:A9};let Ne=Object.freeze(Object.defineProperty({__proto__:null,Compactable:AG,Filterable:{URI:AV,map:EA,compact:Az,separate:AB,filter:EF,filterMap:EW,partition:EU,partitionMap:Ez},FilterableWithIndex:{URI:AV,map:EA,mapWithIndex:EN,compact:Az,separate:AB,filter:EF,filterMap:EW,partition:EU,partitionMap:Ez,filterMapWithIndex:EH,filterWithIndex:EG,partitionMapWithIndex:Eq,partitionWithIndex:EK},Foldable:A2,FoldableWithIndex:A3,Functor:A$,FunctorWithIndex:{URI:AV,map:EA,mapWithIndex:EN},Traversable:A4,TraversableWithIndex:A5,URI:AV,Witherable:A8,collect:AS,compact:Az,deleteAt:Aw,difference:AW,elem:EM,empty:{},every:EC,filter:EQ,filterMap:EX,filterMapWithIndex:ES,filterWithIndex:AA,flap:Aq,foldMap:function(t){return"compare"in t?E3(t):E3(Rz)(t)},foldMapWithIndex:function(t){return"compare"in t?Ef(t):Ef(Rz)(t)},fromEntries:AP,fromFoldable:AN,fromFoldableMap:AL,getDifferenceMagma:A1,getEq:E7,getFoldable:AK,getFoldableWithIndex:AH,getIntersectionSemigroup:A0,getMonoid:je,getShow:function(t){return"compare"in t?E8(t):E8(Rz)(t)},getTraversable:AZ,getTraversableWithIndex:AY,getUnionMonoid:AX,getUnionSemigroup:AQ,getWitherable:AJ,has:En,hasOwnProperty:jx,insertAt:Et,intersection:AF,isEmpty:R6,isSubrecord:Ea,keys:A_,lookup:Eu,map:Ec,mapWithIndex:El,modifyAt:Ak,partition:E0,partitionMap:E1,partitionMapWithIndex:Ex,partitionWithIndex:Aj,pop:function(t){var n=Aw(t);return function(r){var i=Eu(t,r);return rg(i)?rv:rb([i.value,n(r)])}},record:A7,reduce:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?E2(t[0]):E2(Rz).apply(void 0,t)},reduceRight:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?E4(t[0]):E4(Rz).apply(void 0,t)},reduceRightWithIndex:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?Ep(t[0]):Ep(Rz).apply(void 0,t)},reduceWithIndex:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1===t.length?Ed(t[0]):Ed(Rz).apply(void 0,t)},separate:AB,sequence:AM,singleton:Eh,size:R5,some:EI,toArray:AT,toEntries:AT,toUnfoldable:function(t){return function(n){var r=AT(n),i=r.length;return t.unfold(0,function(t){return t<i?rb([r[t],t+1]):rv})}},traverse:AI,traverseWithIndex:AC,union:AD,updateAt:AO,upsertAt:Et,wilt:AE,wither:AR},Symbol.toStringTag,{value:"Module"}));var Nt=function(t){return function(n){return ry(t(n))}},Nn=function(t){return function(n){return r_(t(n))}},Nr=function(){return function(t){return!0}},Ni=function(t){return function(n){return!t(n)}},No=function(t){return function(n){return function(r){return n(r)||t(r)}}},Na=function(t){return function(n){return function(r){return n(r)&&t(r)}}},Nu=function(){return function(t){return!1}},Ns=function(t){return function(n){return function(r){return n(r)&&t(r)}}};let Nl=Object.freeze(Object.defineProperty({__proto__:null,and:Na,compose:Ns,fromEitherK:Nn,fromOptionK:Nt,id:Nr,not:Ni,or:No,zero:Nu},Symbol.toStringTag,{value:"Module"}));var Nc=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])})}}},Nd=function(t){return function(n){return t.sub(t.zero,n)}};let Nf=Object.freeze(Object.defineProperty({__proto__:null,getFunctionRing:n8,getTupleRing:Nc,negate:Nd,tuple:Nc},Symbol.toStringTag,{value:"Module"})),Np=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Nh=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:n9},Symbol.toStringTag,{value:"Module"}));function Nm(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 Ng(t){var n=NA(t);return function(r,i){if(void 0===i){var o=Ng(t);return function(t){return o(r,t)}}if(NE(r))return i;if(NE(i))return r;var a=new Set(r);return i.forEach(function(t){n(t,a)||a.add(t)}),a}}function Ny(t){var n=NA(t);return function(r,i){if(void 0===i){var o=Ny(t);return function(t){return o(t,r)}}if(NE(r)||NE(i))return new Set;var a=new Set;return r.forEach(function(t){n(t,i)&&a.add(t)}),a}}function Nv(t){var n=NA(t);return function(r,i){if(void 0===i){var o=Nv(t);return function(t){return o(t,r)}}return Nm(function(t){return!n(t,i)})(r)}}var Nb=function(t){return{concat:Ng(t)}},Nx=function(t){return{concat:Nb(t).concat,empty:new Set}},N_=function(t){return{concat:Ny(t)}},NS=function(t){return{concat:Nv(t)}},NT=function(t){return new Set([t])};function Nw(t){var n=NA(t);return function(t){return function(r){if(n(t)(r))return r;var i=new Set(r);return i.add(t),i}}}var NO=function(t){return function(n){return function(r){return Nm(function(r){return!t.equals(n,r)})(r)}}},Nk=function(t){var n=NA(t),r=NO(t),i=Nw(t);return function(t){return function(o){return(n(t,o)?r:i)(t)(o)}}},NC=function(t){return function(n){for(var r=n.length,i=new Set,o=NA(t),a=0;a<r;a++){var u=n[a];o(u,i)||i.add(u)}return i}},NI=function(t){return NM(t)(re)};function NM(t){var n=NA(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 NR=new Set,NE=function(t){return 0===t.size},Nj=function(t){return t.size},NA=j$,NN=function(t){return function(n){var r=[];return n.forEach(function(t){return r.push(t)}),r.sort(t.compare)}};let NP=Object.freeze(Object.defineProperty({__proto__:null,chain:function(t){var n=NA(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:NI,difference:Nv,elem:NA,empty:NR,every:jB,filter:Nm,filterMap:NM,foldMap:jE,fromArray:NC,getDifferenceMagma:NS,getEq:jH,getIntersectionSemigroup:N_,getShow:jK,getUnionMonoid:Nx,getUnionSemigroup:Nb,insert:Nw,intersection:Ny,isEmpty:NE,isSubset:jV,map:function(t){var n=NA(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 sa(a,o)}},partitionMap:function(t,n){return function(r){return function(i){for(var o,a=i.values(),u=new Set,s=new Set,l=NA(t),c=NA(n);!(o=a.next()).done;){var d=r(o.value);switch(d._tag){case"Left":l(d.left,u)||u.add(d.left);break;case"Right":c(d.right,s)||s.add(d.right)}}return sa(u,s)}}},reduce:jR,reduceRight:jj,remove:NO,separate:function(t,n){return function(r){var i=NA(t),o=NA(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)}}),sa(a,u)}},singleton:NT,size:Nj,some:jz,subset:jV,toArray:NN,toggle:Nk,union:Ng},Symbol.toStringTag,{value:"Module"}));var NL=function(t){return{show:function(n){var r="{";for(var i in t)rR.call(t,i)&&(r+=" ".concat(i,": ").concat(t[i].show(n[i]),","));return r.length>1&&(r=r.slice(0,-1)+" "),r+="}"}}},ND=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 NF=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:NL,getTupleShow:ND,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:NL,tuple:ND},Symbol.toStringTag,{value:"Module"}));function NW(t){return function(n){return function(r){return t.of([n,r])}}}function NU(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 Nz(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 NB(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 NV(t){return function(n){return function(r){return t.of(n(r))}}}function N$(t){return function(n){return function(r){return t.map(n,function(t){return[t,r]})}}}function Nq(t){return function(n){return function(r){return t.map(r(n),function(t){return t[0]})}}}function NK(t){return function(n){return function(r){return t.map(r(n),j0)}}}let NH=Object.freeze(Object.defineProperty({__proto__:null,ap:Nz,chain:NB,evaluate:Nq,execute:NK,fromF:N$,fromState:NV,getStateM:function(t){var n=Nz(t),r=NU(t),i=NB(t),o=Nq(t),a=NK(t);return{map:function(t,n){return rd(t,r(n))},ap:function(t,r){return rd(t,n(r))},of:NW(t),chain:function(t,n){return rd(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:NV(t),fromM:N$(t),evalState:function(t,n){return rd(t,o(n))},execState:function(t,n){return rd(t,a(n))}}},map:NU,of:NW},Symbol.toStringTag,{value:"Module"}));var NG=function(t){return function(){return I5(t)}},NZ=NW(MH);function NY(t){return N6(I9(t))}function NJ(t){return N6(I7(t))}function NQ(t){return N6(Mr(t))}var NX=function(t){return ra(t,I6)},N0=function(t){return function(n){return I5(t(n)[0])}},N1=gi(function(t){return NG(t)},NZ),N2=NV(MH),N3=function(t){return N6(rt(t))},N4=function(t){return N6(Mo(t))},N5=function(t){return N6(Ma(t))},N6=N$(Mq),N9=function(t){return function(n){return ra(n,yO(t))}},N8=function(t){return function(n){return function(r){return t(r)(n)(r)}}},N7=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return N4(t.apply(void 0,n))}},Pe=function(t){return function(n){return rd(n,Pg(N7(t)))}},Pt=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return N3(t.apply(void 0,n))}},Pn=function(t){return function(n){return rd(n,Pg(Pt(t)))}},Pr=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return N6(t.apply(void 0,n))}},Pi=function(t){return function(n){return rd(n,Pg(Pr(t)))}},Po=function(t,n){return rd(t,Pd(n))},Pa=function(t,n){return rd(t,Ph(n))},Pu=function(t,n){return rd(t,Pm(n))},Ps=function(t,n){return function(r){return rd(t(r),MU(function(){return n()(r)}))}},Pl=function(t,n,r){return function(i){return rd(t(i),MN(n,function(t){var n=t[0],i=t[1];return[r(n),i]}))}},Pc=function(t,n){return function(r){return rd(t(r),MP(n))}},Pd=NU(Mq),Pf=function(t,n){return function(r){return Pl(r,t,n)}},Pp=function(t){return function(n){return Pc(n,t)}},Ph=Nz(MX),Pm=NB(MX),Pg=Pm,Py=Pg(re),Pv=function(t){return function(n){return function(r){return rd(n(r),MU(function(){return t()(r)}))}}},Pb="StateReaderTaskEither",Px={URI:Pb,map:Po},P_=rV(Px),PS={URI:Pb,map:Po,ap:Pa},PT=rA(PS),Pw=rN(PS),PO={URI:Pb,map:Po,ap:Pa,chain:Pu},Pk={URI:Pb,fromState:N2},PC=vV(Pk),PI=v$(Pk),PM=vq(Pk),PR=vK(Pk),PE=vH(Pk),Pj=vG(Pk,PO),PA=rY(PO),PN={URI:Pb,fromReader:NJ},PP=vi(PN),PL=vo(PN),PD=va(PN),PF=vu(PN,PO),PW=vs(PN,PO),PU={URI:Pb,fromEither:N1},Pz=rX(PU),PB=r1(PU),PV=r2(PU,PO),P$=r4(PU,PO),Pq=r5(PU,PO),PK=r0(PU),PH=r6(PU,PO),PG=r3(PU),PZ={URI:Pb,fromIO:NQ},PY=yx(PZ),PJ=y_(PZ,PO),PQ=yS(PZ,PO),PX={URI:Pb,fromIO:NQ,fromTask:NY},P0=vY(PX),P1=vJ(PX,PO),P2=vQ(PX,PO),P3=Nq(Mq),P4=NK(Mq),P5=r$(Px),P6=rJ(PO),P9=rP(PS),P8=function(t){return function(n){return function(r){return function(i){return function(){return rC(n).reduce(function(n,r,o){return n.then(function(a){return rx(a)?n:t(o+1,r)(a.right[1])(i)().then(function(t){if(rx(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,rk(n))(r)(i)().then(mB(function(t){var n;return[[t[0]],t[1]]})))}}}}},P7=function(t){var n=P8(t);return function(t){return rO(t)?n(t):NZ(rI)}},Le=function(t){return P7(function(n,r){return t(r)})},Lt=Le(re),Ln=function(t,n){return rd(t(n),MA(function(t){return t[0]}))},Lr=function(t,n){return rd(t(n),MA(function(t){return t[0],t[1]}))};let Li=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:Pb,map:Po,alt:Ps},Applicative:{URI:Pb,map:Po,ap:Pa,of:NZ},Apply:PS,Bifunctor:{URI:Pb,bimap:Pl,mapLeft:Pc},Chain:PO,FromEither:PU,FromIO:PZ,FromReader:PN,FromState:Pk,FromTask:PX,Functor:Px,Monad:{URI:Pb,map:Po,ap:Pa,of:NZ,chain:Pu},MonadIO:{URI:Pb,map:Po,ap:Pa,of:NZ,chain:Pu,fromIO:NQ},MonadTask:{URI:Pb,map:Po,ap:Pa,of:NZ,chain:Pu,fromIO:NQ,fromTask:NY},MonadThrow:{URI:Pb,map:Po,ap:Pa,of:NZ,chain:Pu,throwError:NG},Pointed:{URI:Pb,of:NZ},URI:Pb,alt:Pv,altW:Pv,ap:Ph,apFirst:PT,apFirstW:PT,apS:P9,apSW:P9,apSecond:Pw,apSecondW:Pw,apW:Ph,ask:PP,asks:PL,asksStateReaderTaskEither:N8,asksStateReaderTaskEitherW:N8,bimap:Pf,bind:P6,bindTo:P5,bindW:P6,chain:Pm,chainEitherK:P$,chainEitherKW:P$,chainFirst:PA,chainFirstEitherK:Pq,chainFirstEitherKW:Pq,chainFirstIOK:PQ,chainFirstReaderK:PW,chainFirstReaderKW:PW,chainFirstTaskK:P2,chainFirstW:PA,chainIOEitherK:Pe,chainIOEitherKW:Pe,chainIOK:PJ,chainOptionK:PV,chainReaderK:PF,chainReaderKW:PF,chainReaderTaskEitherK:Pi,chainReaderTaskEitherKW:Pi,chainStateK:Pj,chainTaskEitherK:Pn,chainTaskEitherKW:Pn,chainTaskK:P1,chainW:Pg,evalState:Ln,evaluate:P3,execState:Lr,execute:P4,filterOrElse:PH,filterOrElseW:PH,flap:P_,flatten:Py,flattenW:Py,fromEither:N1,fromEitherK:PG,fromIO:NQ,fromIOEither:N4,fromIOEitherK:N7,fromIOK:PY,fromOption:Pz,fromOptionK:PB,fromPredicate:PK,fromReader:NJ,fromReaderEither:N5,fromReaderK:PD,fromReaderTaskEither:N6,fromReaderTaskEitherK:Pr,fromState:N2,fromStateK:PE,fromTask:NY,fromTaskEither:N3,fromTaskEitherK:Pt,fromTaskK:P0,get:PC,gets:PR,left:NG,leftIO:function(t){return N6(Mi(t))},leftReader:function(t){return N6(Me(t))},leftState:N0,leftTask:function(t){return N6(I8(t))},local:N9,map:Pd,mapLeft:Pp,modify:PM,of:NZ,put:PI,right:NZ,rightIO:NQ,rightReader:NJ,rightState:NX,rightTask:NY,run:function(t,n,r){return t(n)(r)()},sequenceArray:Lt,stateReaderTaskEither:{URI:Pb,map:Po,of:NZ,ap:Pa,chain:Pu,bimap:Pl,mapLeft:Pc,alt:Ps,fromIO:NQ,fromTask:NY,throwError:NG},stateReaderTaskEitherSeq:{URI:Pb,map:Po,of:NZ,ap:Pa,chain:Pu,bimap:Pl,mapLeft:Pc,alt:Ps,fromIO:NQ,fromTask:NY,throwError:NG},throwError:NG,traverseArray:Le,traverseArrayWithIndex:P7,traverseReadonlyArrayWithIndex:P7,traverseReadonlyNonEmptyArrayWithIndex:P8},Symbol.toStringTag,{value:"Module"}));var Lo=function(t,n){return rd(t,Lc(n))},La=function(t,n){return rd(t,Lu(n))},Lu=function(t){return function(n){return{peek:function(r){return t({peek:n.peek,pos:r})},pos:n.pos}}},Ls=function(t){return t.peek(t.pos)},Ll=Lu(re),Lc=function(t){return function(n){return{peek:function(r){return t(n.peek(r))},pos:n.pos}}},Ld="Store",Lf={URI:Ld,map:Lo},Lp=rV(Lf),Lh={URI:Ld,map:Lo,extend:La,extract:Ls};let Lm=Object.freeze(Object.defineProperty({__proto__:null,Comonad:Lh,Functor:Lf,URI:Ld,duplicate:Ll,experiment:function(t){return function(n){return function(r){return t.map(n(r.pos),function(t){return r.peek(t)})}}},extend:Lu,extract:Ls,flap:Lp,map:Lc,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:Lh},Symbol.toStringTag,{value:"Module"}));function Lg(t,n){return function(r,i){return n.compose(t.second(i),t.first(r))}}function Ly(t,n){var r=Lg(t,n);return function(i,o){return n.compose(r(i,o),t.promap(n.id(),re,function(t){return[t,t]}))}}let Lv=Object.freeze(Object.defineProperty({__proto__:null,fanOut:Ly,fanout:function(t){return Ly(t,t)},split:Lg,splitStrong:function(t){return Lg(t,t)}},Symbol.toStringTag,{value:"Module"}));var Lb=function(){return{concat:function(t,n){return Object.assign({},t,n)}}},Lx=function(t){return function(n){var r={};for(var i in n)rR.call(n,i)&&(r[i]=t[i](n[i]));return r}};let L_=Object.freeze(Object.defineProperty({__proto__:null,evolve:Lx,getAssignSemigroup:Lb},Symbol.toStringTag,{value:"Module"}));var LS=globalThis&&globalThis.__awaiter||function(t,n,r,i){return new(r||(r=Promise))(function(o,a){function u(t){try{l(i.next(t))}catch(n){a(n)}}function s(t){try{l(i.throw(t))}catch(n){a(n)}}function l(t){var n;t.done?o(t.value):((n=t.value)instanceof r?n:new r(function(t){t(n)})).then(u,s)}l((i=i.apply(t,n||[])).next())})},LT=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])}}},Lw=_s(kc),LO=_g(kc),Lk=_y(kc),LC=function(t){return LI(O9(t))},LI=_c(ks),LM=kn(pA),LR=_v(ks),LE=_b(ky),Lj=_x(kv),LA=_d(kc),LN=function(t){return function(){return LS(void 0,void 0,void 0,function(){return LT(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t().then(rb)];case 1:return[2,n.sent()];case 2:return n.sent(),[2,rv];case 3:return[2]}})})}},LP=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return LN(function(){return t.apply(void 0,n)})}},LL=_f(kc),LD=_p(kv),LF=_h(kc),LW=_m(kv),LU=__(ks),Lz=_S(kd),LB=_T(kv),LV=LB(re),L$=_w(kv),Lq=_l(kc),LK=Lq(),LH=h4(ks,hs),LG=h5(ks,hs,pX),LZ=yi(ks,hp),LY=yo(ks,hp),LJ=ya(ks,hp),LQ=yu(ks,hp),LX=function(t,n){return rd(t,LU(n))},L0=function(t,n){return rd(t,Lz(n))},L1=function(t,n){return rd(t,LB(n))},L2=function(t,n){return rd(t,L$(n))},L3=function(t,n){return rd(t,LZ(n))},L4=function(t,n){return rd(t,LY(n))},L5=function(t,n){return rd(t,LJ(n))},L6=function(t,n){return rd(t,LQ(n))},L9="TaskOption",L8={URI:L9,map:LX},L7=rV(L8),De={URI:L9,of:Lw},Dt={URI:L9,map:LX,ap:L0},Dn=rA(Dt),Dr=rN(Dt),Di=function(t,n){return rd(t,LB(function(t){return rd(n,LU(t))}))},Do={URI:L9,map:LX,ap:L0,chain:L1},Da=rY(Do),Du={URI:L9,zero:Lq},Ds=sS(Du,De),Dl={URI:L9,fromIO:LC},Dc=yx(Dl),Dd=y_(Dl,Do),Df=yS(Dl,Do),Dp={URI:L9,fromEither:Lk},Dh=r3(Dp),Dm=r4(Dp,Do),Dg=r5(Dp,Do),Dy={URI:L9,fromIO:LC,fromTask:LI},Dv=vY(Dy),Db=vJ(Dy,Do),Dx=vQ(Dy,Do),D_=Lw(rM),DS=r$(L8),DT=rJ(Do),Dw=rP(Dt),DO=Lw(rI),Dk=function(t){return ra(kR(t),kn(hG(rf)))},DC=function(t){var n=Dk(t);return function(t){return rO(t)?n(t):DO}},DI=function(t){return function(n){return function(){return rC(n).reduce(function(n,r,i){return n.then(function(o){return rg(o)?n:t(i+1,r)().then(function(t){return rg(t)?t:(o.value.push(t.value),o)})})},t(0,rk(n))().then(pQ(rw)))}}},DM=function(t){var n=DI(t);return function(t){return rO(t)?n(t):DO}},DR=function(t){return DC(function(n,r){return t(r)})},DE=DR(re),Dj=function(t){return DM(function(n,r){return t(r)})},DA=Dj(re);let DN=Object.freeze(Object.defineProperty({__proto__:null,Alt:{URI:L9,map:LX,alt:L2},Alternative:{URI:L9,map:LX,ap:L0,of:Lw,alt:L2,zero:Lq},ApT:DO,ApplicativePar:{URI:L9,map:LX,ap:L0,of:Lw},ApplicativeSeq:{URI:L9,map:LX,ap:Di,of:Lw},ApplyPar:Dt,ApplySeq:{URI:L9,map:LX,ap:Di},Chain:Do,Compactable:{URI:L9,compact:LH,separate:LG},Do:D_,Filterable:{URI:L9,map:LX,compact:LH,separate:LG,filter:L3,filterMap:L4,partition:L5,partitionMap:L6},FromEither:Dp,FromIO:Dl,FromTask:Dy,Functor:L8,Monad:{URI:L9,map:LX,ap:L0,of:Lw,chain:L1},MonadIO:{URI:L9,map:LX,ap:L0,of:Lw,chain:L1,fromIO:LC},MonadTask:{URI:L9,map:LX,ap:L0,of:Lw,chain:L1,fromIO:LC,fromTask:LI},Pointed:De,Zero:Du,alt:L$,altW:L$,ap:Lz,apFirst:Dn,apS:Dw,apSecond:Dr,bind:DT,bindTo:DS,chain:LB,chainEitherK:Dm,chainFirst:Da,chainFirstEitherK:Dg,chainFirstIOK:Df,chainFirstTaskK:Dx,chainIOK:Dd,chainNullableK:LD,chainOptionK:LW,chainTaskK:Db,compact:LH,filter:LZ,filterMap:LY,flap:L7,flatten:LV,fold:LE,foldW:LE,fromEither:Lk,fromEitherK:Dh,fromIO:LC,fromIOK:Dc,fromNullable:LA,fromNullableK:LL,fromOption:ki,fromOptionK:LF,fromPredicate:LO,fromTask:LI,fromTaskEither:LM,fromTaskK:Dv,getOrElse:Lj,getOrElseW:Lj,guard:Ds,map:LU,match:LR,matchE:LE,matchEW:LE,matchW:LR,none:LK,of:Lw,partition:LJ,partitionMap:LQ,separate:LG,sequenceArray:DE,sequenceSeqArray:DA,some:Lw,traverseArray:DR,traverseArrayWithIndex:DC,traverseReadonlyArrayWithIndex:DC,traverseReadonlyArrayWithIndexSeq:DM,traverseReadonlyNonEmptyArrayWithIndex:Dk,traverseReadonlyNonEmptyArrayWithIndexSeq:DI,traverseSeqArray:Dj,traverseSeqArrayWithIndex:DM,tryCatch:LN,tryCatchK:LP,zero:Lq},Symbol.toStringTag,{value:"Module"}));var DP=function(t){return"Left"===t._tag},DL=function(t){return"Right"===t._tag};function DD(t){return"Both"===t._tag}function DF(t){return{_tag:"Left",left:t}}function DW(t){return{_tag:"Right",right:t}}function DU(t,n){return{_tag:"Both",left:t,right:n}}var Dz=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)}}},DB=Dz(DW,DF,function(t,n){return DU(n,t)});function DV(t,n){return{concat:function(r,i){return DP(r)?DP(i)?DF(t.concat(r.left,i.left)):DL(i)?DU(r.left,i.right):DU(t.concat(r.left,i.left),i.right):DL(r)?DP(i)?DU(i.left,r.right):DL(i)?DW(n.concat(r.right,i.right)):DU(i.left,n.concat(r.right,i.right)):DP(i)?DU(t.concat(r.left,i.left),r.right):DL(i)?DU(r.left,n.concat(r.right,i.right)):DU(t.concat(r.left,i.left),n.concat(r.right,i.right))}}}var D$=function(t){return{URI:D8,_E:void 0,map:DH,ap:function(n,r){return DP(n)?DP(r)?DF(t.concat(n.left,r.left)):DL(r)?DF(n.left):DF(t.concat(n.left,r.left)):DL(n)?DP(r)?DF(r.left):DL(r)?DW(n.right(r.right)):DU(r.left,n.right(r.right)):DP(r)?DF(t.concat(n.left,r.left)):DL(r)?DU(n.left,n.right(r.right)):DU(t.concat(n.left,r.left),n.right(r.right))}}};function Dq(t){var n=D$(t),r=function(n,r){if(DP(n))return n;if(DL(n))return r(n.right);var i=r(n.right);return DP(i)?DF(t.concat(n.left,i.left)):DL(i)?DU(n.left,i.right):DU(t.concat(n.left,i.left),i.right)};return{URI:D8,_E:void 0,map:DH,ap:n.ap,chain:r}}var DK=function(t,n){return rg(t)?rg(n)?rv:rb(DW(n.value)):rg(n)?rb(DF(t.value)):rb(DU(t.value,n.value))},DH=function(t,n){return rd(t,D2(n))},DG=function(t,n,r){return rd(t,D0(n,r))},DZ=function(t,n){return rd(t,D1(n))},DY=function(t,n,r){return rd(t,D3(n,r))},DJ=function(t){var n=D4(t);return function(t,r){return rd(t,n(r))}},DQ=function(t,n,r){return rd(t,D5(n,r))},DX=function(t){var n=D6(t);return function(t,r){return rd(t,n(r))}},D0=function(t,n){return function(r){return DP(r)?DF(t(r.left)):DL(r)?DW(n(r.right)):DU(t(r.left),n(r.right))}},D1=function(t){return function(n){return DP(n)?DF(t(n.left)):DD(n)?DU(t(n.left),n.right):n}},D2=function(t){return function(n){return DP(n)?n:DL(n)?DW(t(n.right)):DU(n.left,t(n.right))}},D3=function(t,n){return function(r){return DP(r)?t:n(t,r.right)}},D4=function(t){return function(n){return function(r){return DP(r)?t.empty:n(r.right)}}},D5=function(t,n){return function(r){return DP(r)?t:n(r.right,t)}},D6=function(t){return function(n){return function(r){return DP(r)?t.of(r):DL(r)?t.map(n(r.right),DW):t.map(n(r.right),function(t){return DU(r.left,t)})}}},D9=function(t){return function(n){return DP(n)?t.of(n):DL(n)?t.map(n.right,DW):t.map(n.right,function(t){return DU(n.left,t)})}},D8="These",D7={URI:D8,map:DH},Fe=rV(D7),Ft={URI:D8,fromEither:re},Fn=rX(Ft),Fr=r1(Ft),Fi=function(t){return function(n){return function(r){return!DP(r)&&t.equals(n,r.right)}}},Fo=function(t){return function(n){return!DP(n)&&t(n.right)}},Fa=function(t,n){return function(r){return DP(r)?[r.left,n()]:DL(r)?[t(),r.right]:[r.left,r.right]}},Fu=function(t,n){return Fa(function(){return t},function(){return n})},Fs=DW(rI),Fl=function(t){return function(n){return function(r){var i=rv,o=n(0,rk(r));if(DP(o))return o;DD(o)&&(i=rb(o.left));for(var a=[o.right],u=1;u<r.length;u++){var s=n(u,r[u]);if(DP(s))return s;DD(s)&&(i=rg(i)?rb(s.left):rb(t.concat(i.value,s.left))),a.push(s.right)}return rg(i)?DW(a):DU(i.value,a)}}},Fc=function(t){return function(n){var r=Fl(t)(n);return function(t){return rO(t)?r(t):Fs}}};let Fd=Object.freeze(Object.defineProperty({__proto__:null,ApT:Fs,Bifunctor:{URI:D8,bimap:DG,mapLeft:DZ},Foldable:{URI:D8,reduce:DY,foldMap:DJ,reduceRight:DQ},FromEither:Ft,FromThese:{URI:D8,fromThese:re},Functor:D7,Pointed:{URI:D8,of:DW},Traversable:{URI:D8,map:DH,reduce:DY,foldMap:DJ,reduceRight:DQ,traverse:DX,sequence:D9},URI:D8,bimap:D0,both:DU,elem:Fi,exists:Fo,flap:Fe,fold:Dz,foldMap:D4,foldW:Dz,fromOption:Fn,fromOptionK:Fr,fromOptions:DK,getApplicative:function(t){var n=D$(t);return{URI:D8,_E:void 0,map:DH,ap:n.ap,of:DW}},getApply:D$,getChain:Dq,getEq:function(t,n){return r8(function(r,i){return DP(r)?DP(i)&&t.equals(r.left,i.left):DL(r)?DL(i)&&n.equals(r.right,i.right):DD(i)&&t.equals(r.left,i.left)&&n.equals(r.right,i.right)})},getLeft:function(t){return DP(t)?rb(t.left):DL(t)?rv:rb(t.left)},getLeftOnly:function(t){return DP(t)?rb(t.left):rv},getMonad:function(t){var n=Dq(t);return{URI:D8,_E:void 0,map:DH,of:DW,ap:n.ap,chain:n.chain,throwError:DF}},getRight:function(t){return DP(t)?rv:(DL(t),rb(t.right))},getRightOnly:function(t){return DL(t)?rb(t.right):rv},getSemigroup:DV,getShow:function(t,n){return{show:Dz(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:DD,isLeft:DP,isRight:DL,left:DF,leftOrBoth:function(t){return function(n){return rg(n)?DF(t):DU(t,n.value)}},map:D2,mapLeft:D1,match:Dz,matchW:Dz,of:DW,reduce:D3,reduceRight:D5,right:DW,rightOrBoth:function(t){return function(n){return rg(n)?DW(t):DU(n.value,t)}},sequence:D9,swap:DB,these:{URI:D8,map:DH,bimap:DG,mapLeft:DZ,reduce:DY,foldMap:DJ,reduceRight:DQ,traverse:DX,sequence:D9},toTuple:Fu,toTuple2:Fa,traverse:D6,traverseReadonlyArrayWithIndex:Fc,traverseReadonlyNonEmptyArrayWithIndex:Fl},Symbol.toStringTag,{value:"Module"}));function Ff(t){return ra(DW,t.of)}function Fp(t){return ra(DF,t.of)}function Fh(t){return ra(DU,t.of)}function Fm(t){return function(n){return t.map(n,DW)}}function Fg(t){return function(n){return t.map(n,DF)}}function Fy(t){return rB(t,D7)}function Fv(t,n){return rj(t,D$(n))}function Fb(t,n){var r=Fp(t);return function(i){return function(o){return t.chain(o,Dz(r,i,function(r,o){return t.map(i(o),Dz(function(t){return DF(n.concat(r,t))},function(t){return DU(r,t)},function(t,i){return DU(n.concat(r,t),i)}))}))}}}function Fx(t){return function(n,r){return function(i){return t.map(i,D0(n,r))}}}function F_(t){return function(n){return function(r){return t.map(r,D1(n))}}}function FS(t){return function(n,r,i){return function(o){return t.map(o,Dz(n,r,i))}}}function FT(t){return function(n,r,i){return function(o){return t.chain(o,Dz(n,r,i))}}}function Fw(t){return function(n){return t.map(n,DB)}}function FO(t){return function(n,r){return function(i){return t.map(i,Fa(n,r))}}}let Fk=Object.freeze(Object.defineProperty({__proto__:null,ap:Fv,bimap:Fx,both:Fh,chain:Fb,getTheseM:function(t){var n=Fy(t),r=Fx(t),i=F_(t),o=FT(t),a=FO(t),u=Ff(t),s=function(t,r){return rd(t,n(r))};return{map:s,bimap:function(t,n,i){return rd(t,r(n,i))},mapLeft:function(t,n){return rd(t,i(n))},fold:function(t,n,r,i){return rd(t,o(n,r,i))},swap:Fw(t),rightM:Fm(t),leftM:Fg(t),left:Fp(t),right:Ff(t),both:Fh(t),toTuple:function(t,n,r){return rd(t,a(function(){return n},function(){return r}))},getMonad:function(n){var r=Fv(t,n),i=Fb(t,n);return{_E:void 0,map:s,of:u,ap:function(t,n){return rd(t,r(n))},chain:function(t,n){return rd(t,i(n))}}}}},left:Fp,leftF:Fg,map:Fy,mapLeft:F_,match:FS,matchE:FT,right:Ff,rightF:Fm,swap:Fw,toTuple2:FO},Symbol.toStringTag,{value:"Module"}));var FC=Fp(kc),FI=Ff(kc),FM=Fh(kc),FR=Fm(ks),FE=Fg(ks),Fj=ra(O9,FR),FA=ra(O9,FE),FN=FS(ks),FP=FT(kv),FL=Fw(ks),FD=function(t,n){return rd(t,FU(n))},FF=function(t,n,r){return rd(t,Fz(n,r))},FW=function(t,n){return rd(t,FB(n))},FU=Fy(ks),Fz=Fx(ks),FB=F_(ks),FV="TaskThese",F$=function(t,n){var r=Fv(t,n);return{URI:FV,_E:void 0,map:FD,ap:function(t,n){return rd(t,r(n))}}};function Fq(t,n){var r=F$(t,n).ap;return{URI:FV,_E:void 0,map:FD,ap:r,of:FI}}function FK(t){var n=F$(kh,t),r=Fb(kv,t);return{URI:FV,_E:void 0,map:FD,ap:n.ap,chain:function(t,n){return rd(t,r(n))}}}var FH={URI:FV,map:FD},FG=rV(FH),FZ={URI:FV,fromEither:ki},FY=rX(FZ),FJ=r1(FZ),FQ=r0(FZ),FX={URI:FV,fromThese:ki},F0=v0(FX),F1={URI:FV,fromIO:Fj},F2=yx(F1),F3={URI:FV,fromIO:Fj,fromTask:FR},F4=vY(F3),F5=FO(ks),F6=FI(rI),F9=function(t){var n=Fl(t);return function(t){return ra(kR(t),kn(n(rf)))}},F8=function(t){return function(n){var r=F9(t)(n);return function(t){return rO(t)?r(t):F6}}},F7=function(t){return function(n){return function(r){return function(){return rC(r).reduce(function(r,i,o){return r.then(function(a){return DP(a)?r:n(o+1,i)().then(function(n){if(DP(n))return n;if(DD(n)){var r=a.right;return r.push(n.right),DD(a)?DU(t.concat(a.left,n.left),r):DU(n.left,r)}return a.right.push(n.right),a})})},n(0,rk(r))().then(D2(rw)))}}}},We=function(t){return function(n){var r=F7(t)(n);return function(t){return rO(t)?r(t):F6}}},Wt=function(t,n){return F5(function(){return t},function(){return n})},Wn=function(t,n){return rL(km)(DV(t,n))};let Wr=Object.freeze(Object.defineProperty({__proto__:null,ApT:F6,Bifunctor:{URI:FV,bimap:FF,mapLeft:FW},FromEither:FZ,FromIO:F1,FromTask:F3,FromThese:FX,Functor:FH,Pointed:{URI:FV,of:FI},URI:FV,bifunctorTaskThese:{URI:FV,bimap:FF,mapLeft:FW},bimap:Fz,both:FM,flap:FG,fold:FP,foldW:FP,fromEither:ki,fromIO:Fj,fromIOEither:O9,fromIOK:F2,fromOption:FY,fromOptionK:FJ,fromPredicate:FQ,fromTask:FR,fromTaskK:F4,fromThese:ki,fromTheseK:F0,functorTaskThese:{URI:FV,map:FD},getApplicative:Fq,getApply:F$,getChain:FK,getMonad:function(t){var n=Fq(kh,t),r=FK(t);return{URI:FV,_E:void 0,map:FD,ap:n.ap,of:FI,chain:r.chain,fromIO:Fj,fromTask:FR}},getSemigroup:Wn,left:FC,leftIO:FA,leftTask:FE,map:FU,mapLeft:FB,match:FN,matchE:FP,matchEW:FP,matchW:FN,of:FI,right:FI,rightIO:Fj,rightTask:FR,swap:FL,taskThese:{URI:FV,map:FD,bimap:FF,mapLeft:FW},toTuple:Wt,toTuple2:F5,traverseReadonlyArrayWithIndex:F8,traverseReadonlyArrayWithIndexSeq:We,traverseReadonlyNonEmptyArrayWithIndex:F9,traverseReadonlyNonEmptyArrayWithIndexSeq:F7},Symbol.toStringTag,{value:"Module"}));var Wi=function(t,n){return rd(t,Wo(n))},Wo=function(t){return function(n){return function(r){return t(n(r))}}},Wa="Traced",Wu={URI:Wa,map:Wi},Ws=rV(Wu);let Wl=Object.freeze(Object.defineProperty({__proto__:null,Functor:Wu,URI:Wa,censor:function(t){return function(n){return function(r){return n(t(r))}}},flap:Ws,getComonad:function(t){return{URI:Wa,_E:void 0,map:Wi,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:Wo,traced:Wu,tracks:function(t,n){return function(r){return r(n(r(t.empty)))}}},Symbol.toStringTag,{value:"Module"}));function Wc(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 Wd(t,n){return function(r){var i=t.sequence(r),o=n.sequence(r);return function(n){return i(t.map(n,o))}}}let Wf=Object.freeze(Object.defineProperty({__proto__:null,getTraversableComposition:function(t,n){var r=rq(t,n).map,i=yh(t,n),o=Wc(t,n),a=Wd(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 rd(t,n(r))}},sequence:function(t){var n=a(t);return function(t){return rd(t,n)}}}},sequence:Wd,traverse:Wc},Symbol.toStringTag,{value:"Module"})),Wp=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function Wh(t,n){return void 0===n&&(n=[]),{value:t,forest:n}}var Wm=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+=Wm(t+(o>1&&!u?"│ ":" "),r.forest)}return i};function Wg(t){return Wm(`
|
|
2
|
+
`,t)}function Wy(t,n){var r,i=n(t);return{value:i[0],forest:Wv(i[1],n)}}function Wv(t,n){return t.map(function(t){return Wy(t,n)})}function Wb(t){var n=Wx(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 Wx(t){var n=fh(t);return function(r,i){return rd(r,n(function(n){return Wb(t)(n,i)}))}}var W_=function(t,n){return rd(t,WN(n))},WS=function(t,n){return rd(t,WR(function(t){return rd(n,WN(t))}))},WT=function(t,n){return rd(t,WR(n))},Ww=function(t,n,r){return rd(t,WP(n,r))},WO=function(t){var n=WL(t);return function(t,r){return rd(t,n(r))}},Wk=function(t,n,r){return rd(t,WD(n,r))},WC=function(t,n){return rd(t,WE(n))},WI=function(t){var n=WW(t);return function(t,r){return rd(t,n(r))}},WM=function(t){return function(n){return WS(n,t)}},WR=function(t){return function(n){var r=t(n.value),i=r.value,o=r.forest,a=fS().concat;return{value:i,forest:a(o,n.forest.map(WR(t)))}}},WE=function(t){return function(n){return{value:t(n),forest:n.forest.map(WE(t))}}},Wj=WE(re),WA=WR(re),WN=function(t){return function(n){return{value:t(n.value),forest:n.forest.map(WN(t))}}},WP=function(t,n){return function(r){for(var i=n(t,r.value),o=r.forest.length,a=0;a<o;a++)i=rd(r.forest[a],WP(i,n));return i}},WL=function(t){return function(n){return WP(t.empty,function(r,i){return t.concat(r,n(i))})}},WD=function(t,n){return function(r){for(var i=t,o=r.forest.length,a=o-1;a>=0;a--)i=rd(r.forest[a],WD(i,n));return n(r.value,i)}},WF=function(t){return t.value},WW=function(t){var n=fh(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}}}),rd(o.forest,n(r(i))))}};return r},WU=function(t){return WW(t)(re)},Wz=function(t){return Wh(t)},WB="Tree",WV={URI:WB,map:W_},W$=rV(WV),Wq={URI:WB,map:W_,ap:WS},WK=rA(Wq),WH=rN(Wq),WG={URI:WB,map:W_,ap:WS,chain:WT},WZ=rY(WG),WY=Wz(rM),WJ=r$(WV),WQ=rJ(WG),WX=rP(Wq),W0=function(t){return function(n){return t(n.value)||n.forest.some(W0(t))}};let W1=Object.freeze(Object.defineProperty({__proto__:null,Applicative:{URI:WB,map:W_,ap:WS,of:Wz},Apply:Wq,Chain:WG,Comonad:{URI:WB,map:W_,extend:WC,extract:WF},Do:WY,Foldable:{URI:WB,reduce:Ww,foldMap:WO,reduceRight:Wk},Functor:WV,Monad:{URI:WB,map:W_,ap:WS,of:Wz,chain:WT},Pointed:{URI:WB,of:Wz},Traversable:{URI:WB,map:W_,reduce:Ww,foldMap:WO,reduceRight:Wk,traverse:WI,sequence:WU},URI:WB,ap:WM,apFirst:WK,apS:WX,apSecond:WH,bind:WQ,bindTo:WJ,chain:WR,chainFirst:WZ,drawForest:Wg,drawTree:function(t){return t.value+Wg(t.forest)},duplicate:Wj,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:W0,extend:WE,extract:WF,flap:W$,flatten:WA,fold:function(t){var n=function(r){return t(r.value,r.forest.map(n))};return n},foldMap:WL,getEq:function(t){var n,r=r8(function(r,i){return t.equals(r.value,i.value)&&n.equals(r.forest,i.forest)});return n=cl(r),r},getShow:function(t){var n=function(r){return cG(r.forest)?"make(".concat(t.show(r.value),")"):"make(".concat(t.show(r.value),", [").concat(r.forest.map(n).join(", "),"])")};return{show:n}},make:Wh,map:WN,of:Wz,reduce:WP,reduceRight:WD,sequence:WU,traverse:WW,tree:{URI:WB,map:W_,of:Wz,ap:WS,chain:WT,reduce:Ww,foldMap:WO,reduceRight:Wk,traverse:WI,sequence:WU,extract:WF,extend:WC},unfoldForest:Wv,unfoldForestM:Wx,unfoldTree:Wy,unfoldTreeM:Wb},Symbol.toStringTag,{value:"Module"}));var W2=function(t){var n;return[j0(t),(n=t,n[0])]};function W3(t){return{URI:Ug,_E:void 0,map:W9,ap:function(n,r){var i,o;return[(i=n,i[0])((o=r,o[0])),t.concat(j0(n),j0(r))]}}}var W4=function(t){return function(n){return[n,t.empty]}};function W5(t){var n=W3(t);return{URI:Ug,_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(j0(n),u)]}}}var W6=function(t,n){return rd(t,Us(n))},W9=function(t,n){return rd(t,Ua(n))},W8=function(t,n,r){return rd(t,Uo(n,r))},W7=function(t,n){return rd(t,Uu(n))},Ue=function(t,n){return rd(t,Ul(n))},Ut=function(t,n,r){return rd(t,Uf(n,r))},Un=function(t){var n=Ud();return function(t,r){return rd(t,n(r))}},Ur=function(t,n,r){return rd(t,Up(n,r))};function Ui(t){var n=Uh(t);return function(t,r){return rd(t,n(r))}}var Uo=function(t,n){return function(r){var i;return[n((i=r,i[0])),t(j0(r))]}},Ua=function(t){return function(n){var r;return[t((r=n,r[0])),j0(n)]}},Uu=function(t){return function(n){var r;return[(r=n,r[0]),t(j0(n))]}},Us=function(t){return function(n){var r;return[(r=n,r[0]),j0(t)]}},Ul=function(t){return function(n){return[t(n),j0(n)]}},Uc=Ul(re),Ud=Ad,Uf=Ac,Up=Af,Uh=function(t){return function(n){return function(r){var i;return t.map(n((i=r,i[0])),function(t){return[t,j0(r)]})}}},Um=function(t){return function(n){var r;return t.map((r=n,r[0]),function(t){return[t,j0(n)]})}},Ug="Tuple",Uy={URI:Ug,map:W9},Uv=rV(Uy);let Ub=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:{URI:Ug,bimap:W8,mapLeft:W7},Comonad:{URI:Ug,map:W9,extend:Ue,extract:jX},Foldable:{URI:Ug,reduce:Ut,foldMap:Un,reduceRight:Ur},Functor:Uy,Semigroupoid:{URI:Ug,compose:W6},Traversable:{URI:Ug,map:W9,reduce:Ut,foldMap:Un,reduceRight:Ur,traverse:Ui,sequence:Um},URI:Ug,bimap:Uo,compose:Us,duplicate:Uc,extend:Ul,extract:jX,flap:Uv,foldMap:Ud,fst:jX,getApplicative:function(t){var n=W3(t);return{URI:Ug,_E:void 0,map:n.map,ap:n.ap,of:W4(t)}},getApply:W3,getChain:W5,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,j0(a)),s=(o=a=r(s.left))[0]}return[s.right,t.concat(u,j0(a))]},r=W5(t);return{URI:Ug,_E:void 0,map:r.map,ap:r.ap,chain:r.chain,chainRec:n}},getMonad:function(t){var n=W5(t);return{URI:Ug,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,of:W4(t)}},map:Ua,mapFst:Ua,mapLeft:Uu,mapSnd:Uu,reduce:Uf,reduceRight:Up,sequence:Um,snd:j0,swap:W2,traverse:Uh,tuple:{URI:Ug,compose:W6,map:W9,bimap:W8,mapLeft:W7,extract:jX,extend:Ue,reduce:Ut,foldMap:Un,reduceRight:Ur,traverse:Ui,sequence:Um}},Symbol.toStringTag,{value:"Module"})),Ux=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),U_=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:function(t,n){var r=rG(n,mU(t));return{map:r.map,ap:r.ap,of:r.of,chain:function(t,r){return n.chain(t,function(t){return rx(t)?n.of(rS(t.left)):r(t.right)})},alt:function(r,i){return n.chain(r,function(r){return r_(r)?n.of(r):n.map(i(),function(n){return rx(n)?rS(t.concat(r.left,n.left)):n})})}}}},Symbol.toStringTag,{value:"Module"}));var US=iU(void 0),UT={concat:US.concat,empty:void 0};let Uw=Object.freeze(Object.defineProperty({__proto__:null,Monoid:UT,Semigroup:US},Symbol.toStringTag,{value:"Module"}));var UO=function(t){return function(){return[void 0,t]}},Uk=function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,i],i]}},UC=function(t){return function(){var n,r=t(),i=r[0],o=i[0];return[o,(0,i[1])(r[1])]}},UI=function(t){return function(n){return function(){var r=n(),i=r[0],o=r[1];return[[i,t(o)],o]}}},UM=function(t){return function(n){return function(){var r,i=n();return[i[0],t(i[1])]}}},UR=function(t,n){return rd(t,UE(n))},UE=function(t){return function(n){return function(){var r=n(),i=r[0],o=r[1];return[t(i),o]}}},Uj="Writer",UA=function(t){return{URI:Uj,_E:void 0,of:function(n){return function(){return[n,t.empty]}}}},UN=function(t){return{URI:Uj,_E:void 0,map:UR,ap:function(n,r){return function(){var i=n(),o=i[0],a=i[1],u=r(),s=u[0],l=u[1];return[o(s),t.concat(a,l)]}}}},UP=function(t){var n=UN(t),r=UA(t);return{URI:Uj,_E:void 0,map:UR,ap:n.ap,of:r.of}};function UL(t){var n=UN(t);return{URI:Uj,_E:void 0,map:UR,ap:n.ap,chain:function(n,r){return function(){var i=n(),o=i[0],a=i[1],u=r(o)(),s=u[0],l=u[1];return[s,t.concat(a,l)]}}}}var UD={URI:Uj,map:UR},UF=rV(UD),UW=function(t){return t()[0]},UU=function(t){return t()[1]},Uz=function(t){return t()[0]},UB=function(t){return t()[1]};let UV=Object.freeze(Object.defineProperty({__proto__:null,Functor:UD,URI:Uj,censor:UM,evalWriter:Uz,evaluate:UW,execWriter:UB,execute:UU,flap:UF,getApplicative:UP,getApply:UN,getChain:UL,getMonad:function(t){var n=UP(t),r=UL(t);return{URI:Uj,_E:void 0,map:UR,ap:n.ap,of:n.of,chain:r.chain}},getPointed:UA,listen:Uk,listens:UI,map:UE,pass:UC,tell:UO,writer:UD},Symbol.toStringTag,{value:"Module"})),U$=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"})),Uq=Object.freeze(Object.defineProperty({__proto__:null,alt:n2,alternative:n3,applicative:rZ,apply:rz,array:f0,bifunctor:f1,boolean:pe,booleanAlgebra:pn,bounded:pa,boundedDistributiveLattice:pl,boundedJoinSemilattice:pc,boundedLattice:pd,boundedMeetSemilattice:pf,category:pp,chain:rQ,chainRec:pm,choice:pv,comonad:pb,compactable:h6,console:mt,const:mm,contravariant:mg,date:mx,distributiveLattice:ps,either:gF,eitherT:g9,endomorphism:ye,eq:il,extend:yt,field:yr,filterable:ys,filterableWithIndex:yl,foldable:ym,foldableWithIndex:yb,fromEither:r9,fromIO:yT,fromReader:vl,fromState:vZ,fromTask:vX,fromThese:v1,function:rh,functor:rK,functorWithIndex:v3,group:v4,heytingAlgebra:v5,hkt:v6,identity:bE,invariant:bj,io:b8,ioEither:_u,ioOption:Sw,ioRef:Sk,joinSemilattice:SC,json:SR,lattice:SE,magma:iD,map:wv,meetSemilattice:wb,monad:wx,monadIO:w_,monadTask:wS,monadThrow:wT,monoid:wD,naturalTransformation:wF,nonEmptyArray:u4,number:so,option:h3,optionT:_O,ord:iE,ordering:wq,pipeable:wK,pointed:wH,predicate:pR,profunctor:wG,random:wX,reader:vr,readerEither:O0,readerT:O6,readerTask:CR,readerTaskEither:RD,readonlyArray:cH,readonlyMap:Tj,readonlyNonEmptyArray:ak,readonlyRecord:jS,readonlySet:jQ,readonlyTuple:Av,record:Ne,refinement:Nl,ring:Nf,semigroup:iX,semigroupoid:Np,semiring:Nh,separated:sy,set:NP,show:NF,state:vB,stateReaderTaskEither:Li,stateT:NH,store:Lm,string:R2,strong:Lv,struct:L_,task:kU,taskEither:I4,taskOption:DN,taskThese:Wr,these:Fd,theseT:Fk,traced:Wl,traversable:Wf,traversableWithIndex:Wp,tree:W1,tuple:Ub,unfoldable:Ux,validationT:U_,void:Uw,witherable:s_,writer:UV,writerT:U$,zero:sT},Symbol.toStringTag,{value:"Module"})),UK=C(Uq);var UH={},UG={},UZ={},UY={};!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 l(t){return function(){return t}}function c(t,n,r,i,o,a,u,s,l){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 l(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=l,t.constTrue=l(!0),t.constFalse=l(!1),t.constNull=l(null),t.constUndefined=l(void 0),t.constVoid=t.constUndefined,t.flip=function(t){return function(n,r){return t(r,n)}},t.flow=c,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,l){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 l(s(u(a(o(i(r(n(t))))))));default:for(var c=arguments[0],d=1;d<arguments.length;d++)c=arguments[d](c);return c}},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 c(t,n)},empty:s}};t.getEndomorphismMonoid=m}(UY);var UJ={},UQ=k&&k.__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(UJ,"__esModule",{value:!0}),UJ.fromReadonlyNonEmptyArray=UJ.has=UJ.emptyRecord=UJ.emptyReadonlyArray=UJ.tail=UJ.head=UJ.isNonEmpty=UJ.singleton=UJ.right=UJ.left=UJ.isRight=UJ.isLeft=UJ.some=UJ.none=UJ.isSome=UJ.isNone=void 0;var UX=function(t){return"None"===t._tag};UJ.isNone=UX;var U0=function(t){return"Some"===t._tag};UJ.isSome=U0,UJ.none={_tag:"None"};var U1=function(t){return{_tag:"Some",value:t}};UJ.some=U1;var U2=function(t){return"Left"===t._tag};UJ.isLeft=U2;var U3=function(t){return"Right"===t._tag};UJ.isRight=U3;var U4=function(t){return{_tag:"Left",left:t}};UJ.left=U4;var U5=function(t){return{_tag:"Right",right:t}};UJ.right=U5;var U6=function(t){return[t]};UJ.singleton=U6;var U9=function(t){return t.length>0};UJ.isNonEmpty=U9;var U8=function(t){return t[0]};UJ.head=U8;var U7=function(t){return t.slice(1)};UJ.tail=U7,UJ.emptyReadonlyArray=[],UJ.emptyRecord={},UJ.has=Object.prototype.hasOwnProperty;var ze=function(t){return UQ([t[0]],t.slice(1),!0)};UJ.fromReadonlyNonEmptyArray=ze;var zt=k&&k.__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]}),zn=k&&k.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),zr=k&&k.__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)&&zt(n,t,r);return zn(n,t),n};Object.defineProperty(UZ,"__esModule",{value:!0}),UZ.sequenceS=UZ.sequenceT=UZ.getApplySemigroup=UZ.apS=UZ.apSecond=UZ.apFirst=UZ.ap=void 0;var zi=zr(UJ);function zo(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):zo(t,n-1,o)}}UZ.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)}}},UZ.apFirst=function(t){return function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}}},UZ.apSecond=function(t){return function(n){return function(r){return t.ap(t.map(r,function(){return function(t){return t}}),n)}}},UZ.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)}}},UZ.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 za={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 zu(t){return zi.has.call(za,t)||(za[t]=zo(UY.tuple,t-1,[])),za[t]}function zs(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 zo(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,[])}}UZ.sequenceT=function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=n.length,o=zu(i),a=t.map(n[0],o),u=1;u<i;u++)a=t.ap(a,n[u]);return a}},UZ.sequenceS=function(t){return function(n){for(var r=Object.keys(n),i=r.length,o=zs(r),a=t.map(n[r[0]],o),u=1;u<i;u++)a=t.ap(a,n[r[u]]);return a}};var zl={};function zc(t,n){return function(r){return function(i){return t.map(i,function(t){return n.map(t,r)})}}}Object.defineProperty(zl,"__esModule",{value:!0}),zl.getFunctorComposition=zl.bindTo=zl.flap=zl.map=void 0,zl.map=zc,zl.flap=function(t){return function(n){return function(r){return t.map(r,function(t){return t(n)})}}},zl.bindTo=function(t){return function(n){return function(r){return t.map(r,function(t){var r;return(r={})[n]=t,r})}}},zl.getFunctorComposition=function(t,n){var r=zc(t,n);return{map:function(t,n){return(0,UY.pipe)(t,r(n))}}},Object.defineProperty(UG,"__esModule",{value:!0}),UG.getApplicativeComposition=UG.getApplicativeMonoid=void 0,UG.getApplicativeMonoid=function(t){var n=(0,UZ.getApplySemigroup)(t);return function(r){return{concat:n(r).concat,empty:t.of(r.empty)}}},UG.getApplicativeComposition=function(t,n){var r=(0,zl.getFunctorComposition)(t,n).map,i=(0,UZ.ap)(t,n);return{map:r,of:function(r){return t.of(n.of(r))},ap:function(t,n){return(0,UY.pipe)(t,i(n))}}};var zd={};Object.defineProperty(zd,"__esModule",{value:!0}),zd.bind=zd.chainFirst=void 0,zd.chainFirst=function(t){return function(n){return function(r){return t.chain(r,function(r){return t.map(n(r),function(){return r})})}}},zd.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 zf={};Object.defineProperty(zf,"__esModule",{value:!0}),zf.tailRec=void 0;var zp=function(t,n){for(var r=n(t);"Left"===r._tag;)r=n(r.left);return r.right};zf.tailRec=zp;var zh={},zm=k&&k.__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]}),zg=k&&k.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),zy=k&&k.__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)&&zm(n,t,r);return zg(n,t),n};Object.defineProperty(zh,"__esModule",{value:!0}),zh.filterOrElse=zh.chainFirstEitherK=zh.chainEitherK=zh.fromEitherK=zh.chainOptionK=zh.fromOptionK=zh.fromPredicate=zh.fromOption=void 0;var zv=zy(UJ);function zb(t){return function(n){return function(r){return t.fromEither(zv.isNone(r)?zv.left(n()):zv.right(r.value))}}}function zx(t){var n=zb(t);return function(t){var r=n(t);return function(t){return(0,UY.flow)(t,r)}}}function z_(t){return function(n){return(0,UY.flow)(n,t.fromEither)}}zh.fromOption=zb,zh.fromPredicate=function(t){return function(n,r){return function(i){return t.fromEither(n(i)?zv.right(i):zv.left(r(i)))}}},zh.fromOptionK=zx,zh.chainOptionK=function(t,n){var r=zx(t);return function(t){var i=r(t);return function(t){return function(r){return n.chain(r,i(t))}}}},zh.fromEitherK=z_,zh.chainEitherK=function(t,n){var r=z_(t);return function(t){return function(i){return n.chain(i,r(t))}}},zh.chainFirstEitherK=function(t,n){return(0,UY.flow)(z_(t),(0,zd.chainFirst)(n))},zh.filterOrElse=function(t,n){return function(r,i){return function(o){return n.chain(o,function(n){return t.fromEither(r(n)?zv.right(n):zv.left(i(n)))})}}};var zS,zT,zw,zO,zk,zC,zI,zM,zR,zE,zj={};Object.defineProperty(zS=zj,"__esModule",{value:!0}),zS.right=zS.left=zS.flap=zS.Functor=zS.Bifunctor=zS.URI=zS.bimap=zS.mapLeft=zS.map=zS.separated=void 0,zT=function(t,n){return{left:t,right:n}},zS.separated=zT,zw=function(t,n){return(0,UY.pipe)(t,(0,zS.map)(n))},zO=function(t,n){return(0,UY.pipe)(t,(0,zS.mapLeft)(n))},zk=function(t,n,r){return(0,UY.pipe)(t,(0,zS.bimap)(n,r))},zC=function(t){return function(n){return(0,zS.separated)((0,zS.left)(n),t((0,zS.right)(n)))}},zS.map=zC,zI=function(t){return function(n){return(0,zS.separated)(t((0,zS.left)(n)),(0,zS.right)(n))}},zS.mapLeft=zI,zM=function(t,n){return function(r){return(0,zS.separated)(t((0,zS.left)(r)),n((0,zS.right)(r)))}},zS.bimap=zM,zS.URI="Separated",zS.Bifunctor={URI:zS.URI,mapLeft:zO,bimap:zk},zS.Functor={URI:zS.URI,map:zw},zS.flap=(0,zl.flap)(zS.Functor),zR=function(t){return t.left},zS.left=zR,zE=function(t){return t.right},zS.right=zE;var zA={},zN=k&&k.__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]}),zP=k&&k.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),zL=k&&k.__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)&&zN(n,t,r);return zP(n,t),n};Object.defineProperty(zA,"__esModule",{value:!0}),zA.filterE=zA.witherDefault=zA.wiltDefault=void 0;var zD=zL(UJ);zA.wiltDefault=function(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.separate)}}},zA.witherDefault=function(t,n){return function(r){var i=t.traverse(r);return function(t,o){return r.map(i(t,o),n.compact)}}},zA.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?zD.some(r):zD.none})})}}}},BC=UH,BI=k&&k.__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]}),BM=k&&k.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),BR=k&&k.__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)&&BI(n,t,r);return BM(n,t),n},Object.defineProperty(BC,"__esModule",{value:!0}),BC.fold=BC.match=BC.foldW=BC.matchW=BC.isRight=BC.isLeft=BC.fromOption=BC.fromPredicate=BC.FromEither=BC.MonadThrow=BC.throwError=BC.ChainRec=BC.Extend=BC.extend=BC.Alt=BC.alt=BC.altW=BC.Bifunctor=BC.mapLeft=BC.bimap=BC.Traversable=BC.sequence=BC.traverse=BC.Foldable=BC.reduceRight=BC.foldMap=BC.reduce=BC.Monad=BC.Chain=BC.chain=BC.chainW=BC.Applicative=BC.Apply=BC.ap=BC.apW=BC.Pointed=BC.of=BC.Functor=BC.map=BC.getAltValidation=BC.getApplicativeValidation=BC.getWitherable=BC.getFilterable=BC.getCompactable=BC.getSemigroup=BC.getEq=BC.getShow=BC.URI=BC.right=BC.left=void 0,BC.getValidation=BC.getValidationMonoid=BC.getValidationSemigroup=BC.getApplyMonoid=BC.getApplySemigroup=BC.either=BC.stringifyJSON=BC.parseJSON=BC.sequenceArray=BC.traverseArray=BC.traverseArrayWithIndex=BC.traverseReadonlyArrayWithIndex=BC.traverseReadonlyNonEmptyArrayWithIndex=BC.ApT=BC.apSW=BC.apS=BC.bindW=BC.bind=BC.bindTo=BC.Do=BC.exists=BC.elem=BC.toError=BC.toUnion=BC.chainNullableK=BC.fromNullableK=BC.tryCatchK=BC.tryCatch=BC.fromNullable=BC.orElse=BC.orElseW=BC.swap=BC.filterOrElseW=BC.filterOrElse=BC.chainOptionK=BC.fromOptionK=BC.duplicate=BC.flatten=BC.flattenW=BC.chainFirstW=BC.chainFirst=BC.apSecondW=BC.apSecond=BC.apFirstW=BC.apFirst=BC.flap=BC.getOrElse=BC.getOrElseW=void 0,BE=BR(UJ),BC.left=BE.left,BC.right=BE.right,Bj=function(t,n){return(0,UY.pipe)(t,(0,BC.map)(n))},BA=function(t,n){return(0,UY.pipe)(t,(0,BC.ap)(n))},BN=function(t,n){return(0,UY.pipe)(t,(0,BC.chain)(n))},BP=function(t,n,r){return(0,UY.pipe)(t,(0,BC.reduce)(n,r))},BL=function(t){return function(n,r){var i=(0,BC.foldMap)(t);return(0,UY.pipe)(n,i(r))}},BD=function(t,n,r){return(0,UY.pipe)(t,(0,BC.reduceRight)(n,r))},BF=function(t){var n=(0,BC.traverse)(t);return function(t,r){return(0,UY.pipe)(t,n(r))}},BW=function(t,n,r){return(0,UY.pipe)(t,(0,BC.bimap)(n,r))},BU=function(t,n){return(0,UY.pipe)(t,(0,BC.mapLeft)(n))},Bz=function(t,n){return(0,UY.pipe)(t,(0,BC.alt)(n))},BB=function(t,n){return(0,UY.pipe)(t,(0,BC.extend)(n))},BV=function(t,n){return(0,zf.tailRec)(n(t),function(t){return(0,BC.isLeft)(t)?(0,BC.right)((0,BC.left)(t.left)):(0,BC.isLeft)(t.right)?(0,BC.left)(n(t.right.left)):(0,BC.right)((0,BC.right)(t.right.right))})},BC.URI="Either",B$=function(t,n){return{show:function(r){return(0,BC.isLeft)(r)?"left(".concat(t.show(r.left),")"):"right(".concat(n.show(r.right),")")}}},BC.getShow=B$,Bq=function(t,n){return{equals:function(r,i){return r===i||((0,BC.isLeft)(r)?(0,BC.isLeft)(i)&&t.equals(r.left,i.left):(0,BC.isRight)(i)&&n.equals(r.right,i.right))}}},BC.getEq=Bq,BK=function(t){return{concat:function(n,r){return(0,BC.isLeft)(r)?n:(0,BC.isLeft)(n)?r:(0,BC.right)(t.concat(n.right,r.right))}}},BC.getSemigroup=BK,BH=function(t){var n=(0,BC.left)(t.empty);return{URI:BC.URI,_E:void 0,compact:function(t){return(0,BC.isLeft)(t)?t:"None"===t.right._tag?n:(0,BC.right)(t.right.value)},separate:function(t){return(0,BC.isLeft)(t)?(0,zj.separated)(t,t):(0,BC.isLeft)(t.right)?(0,zj.separated)((0,BC.right)(t.right.left),n):(0,zj.separated)(n,(0,BC.right)(t.right.right))}}},BC.getCompactable=BH,BG=function(t){var n=(0,BC.left)(t.empty),r=(0,BC.getCompactable)(t),i=r.compact,o=r.separate,a=function(t,r){return(0,BC.isLeft)(t)||r(t.right)?t:n},u=function(t,r){return(0,BC.isLeft)(t)?(0,zj.separated)(t,t):r(t.right)?(0,zj.separated)(n,(0,BC.right)(t.right)):(0,zj.separated)((0,BC.right)(t.right),n)};return{URI:BC.URI,_E:void 0,map:Bj,compact:i,separate:o,filter:a,filterMap:function(t,r){if((0,BC.isLeft)(t))return t;var i=r(t.right);return"None"===i._tag?n:(0,BC.right)(i.value)},partition:u,partitionMap:function(t,r){if((0,BC.isLeft)(t))return(0,zj.separated)(t,t);var i=r(t.right);return(0,BC.isLeft)(i)?(0,zj.separated)((0,BC.right)(i.left),n):(0,zj.separated)(n,(0,BC.right)(i.right))}}},BC.getFilterable=BG,BZ=function(t){var n=(0,BC.getFilterable)(t),r=(0,BC.getCompactable)(t);return{URI:BC.URI,_E:void 0,map:Bj,compact:n.compact,separate:n.separate,filter:n.filter,filterMap:n.filterMap,partition:n.partition,partitionMap:n.partitionMap,traverse:BF,sequence:BC.sequence,reduce:BP,foldMap:BL,reduceRight:BD,wither:(0,zA.witherDefault)(BC.Traversable,r),wilt:(0,zA.wiltDefault)(BC.Traversable,r)}},BC.getWitherable=BZ,BY=function(t){return{URI:BC.URI,_E:void 0,map:Bj,ap:function(n,r){return(0,BC.isLeft)(n)?(0,BC.isLeft)(r)?(0,BC.left)(t.concat(n.left,r.left)):n:(0,BC.isLeft)(r)?r:(0,BC.right)(n.right(r.right))},of:BC.of}},BC.getApplicativeValidation=BY,BJ=function(t){return{URI:BC.URI,_E:void 0,map:Bj,alt:function(n,r){if((0,BC.isRight)(n))return n;var i=r();return(0,BC.isLeft)(i)?(0,BC.left)(t.concat(n.left,i.left)):i}}},BC.getAltValidation=BJ,BQ=function(t){return function(n){return(0,BC.isLeft)(n)?n:(0,BC.right)(t(n.right))}},BC.map=BQ,BC.Functor={URI:BC.URI,map:Bj},BC.of=BC.right,BC.Pointed={URI:BC.URI,of:BC.of},BX=function(t){return function(n){return(0,BC.isLeft)(n)?n:(0,BC.isLeft)(t)?t:(0,BC.right)(n.right(t.right))}},BC.apW=BX,BC.ap=BC.apW,BC.Apply={URI:BC.URI,map:Bj,ap:BA},BC.Applicative={URI:BC.URI,map:Bj,ap:BA,of:BC.of},B0=function(t){return function(n){return(0,BC.isLeft)(n)?n:t(n.right)}},BC.chainW=B0,BC.chain=BC.chainW,BC.Chain={URI:BC.URI,map:Bj,ap:BA,chain:BN},BC.Monad={URI:BC.URI,map:Bj,ap:BA,of:BC.of,chain:BN},B1=function(t,n){return function(r){return(0,BC.isLeft)(r)?t:n(t,r.right)}},BC.reduce=B1,B2=function(t){return function(n){return function(r){return(0,BC.isLeft)(r)?t.empty:n(r.right)}}},BC.foldMap=B2,B3=function(t,n){return function(r){return(0,BC.isLeft)(r)?t:n(r.right,t)}},BC.reduceRight=B3,BC.Foldable={URI:BC.URI,reduce:BP,foldMap:BL,reduceRight:BD},B4=function(t){return function(n){return function(r){return(0,BC.isLeft)(r)?t.of((0,BC.left)(r.left)):t.map(n(r.right),BC.right)}}},BC.traverse=B4,B5=function(t){return function(n){return(0,BC.isLeft)(n)?t.of((0,BC.left)(n.left)):t.map(n.right,BC.right)}},BC.sequence=B5,BC.Traversable={URI:BC.URI,map:Bj,reduce:BP,foldMap:BL,reduceRight:BD,traverse:BF,sequence:BC.sequence},B6=function(t,n){return function(r){return(0,BC.isLeft)(r)?(0,BC.left)(t(r.left)):(0,BC.right)(n(r.right))}},BC.bimap=B6,B9=function(t){return function(n){return(0,BC.isLeft)(n)?(0,BC.left)(t(n.left)):n}},BC.mapLeft=B9,BC.Bifunctor={URI:BC.URI,bimap:BW,mapLeft:BU},B8=function(t){return function(n){return(0,BC.isLeft)(n)?t():n}},BC.altW=B8,BC.alt=BC.altW,BC.Alt={URI:BC.URI,map:Bj,alt:Bz},B7=function(t){return function(n){return(0,BC.isLeft)(n)?n:(0,BC.right)(t(n))}},BC.extend=B7,BC.Extend={URI:BC.URI,map:Bj,extend:BB},BC.ChainRec={URI:BC.URI,map:Bj,ap:BA,chain:BN,chainRec:BV},BC.throwError=BC.left,BC.MonadThrow={URI:BC.URI,map:Bj,ap:BA,of:BC.of,chain:BN,throwError:BC.throwError},BC.FromEither={URI:BC.URI,fromEither:UY.identity},BC.fromPredicate=(0,zh.fromPredicate)(BC.FromEither),BC.fromOption=(0,zh.fromOption)(BC.FromEither),BC.isLeft=BE.isLeft,BC.isRight=BE.isRight,Ve=function(t,n){return function(r){return(0,BC.isLeft)(r)?t(r.left):n(r.right)}},BC.matchW=Ve,BC.foldW=BC.matchW,BC.match=BC.matchW,BC.fold=BC.match,Vt=function(t){return function(n){return(0,BC.isLeft)(n)?t(n.left):n.right}},BC.getOrElseW=Vt,BC.getOrElse=BC.getOrElseW,BC.flap=(0,zl.flap)(BC.Functor),BC.apFirst=(0,UZ.apFirst)(BC.Apply),BC.apFirstW=BC.apFirst,BC.apSecond=(0,UZ.apSecond)(BC.Apply),BC.apSecondW=BC.apSecond,BC.chainFirst=(0,zd.chainFirst)(BC.Chain),BC.chainFirstW=BC.chainFirst,BC.flattenW=(0,BC.chainW)(UY.identity),BC.flatten=BC.flattenW,BC.duplicate=(0,BC.extend)(UY.identity),BC.fromOptionK=(0,zh.fromOptionK)(BC.FromEither),BC.chainOptionK=(0,zh.chainOptionK)(BC.FromEither,BC.Chain),BC.filterOrElse=(0,zh.filterOrElse)(BC.FromEither,BC.Chain),BC.filterOrElseW=BC.filterOrElse,Vn=function(t){return(0,BC.isLeft)(t)?(0,BC.right)(t.left):(0,BC.left)(t.right)},BC.swap=Vn,Vr=function(t){return function(n){return(0,BC.isLeft)(n)?t(n.left):n}},BC.orElseW=Vr,BC.orElse=BC.orElseW,Vi=function(t){return function(n){return null==n?(0,BC.left)(t):(0,BC.right)(n)}},BC.fromNullable=Vi,Vo=function(t,n){try{return(0,BC.right)(t())}catch(r){return(0,BC.left)(n(r))}},BC.tryCatch=Vo,Va=function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(0,BC.tryCatch)(function(){return t.apply(void 0,r)},n)}},BC.tryCatchK=Va,Vu=function(t){var n=(0,BC.fromNullable)(t);return function(t){return(0,UY.flow)(t,n)}},BC.fromNullableK=Vu,Vs=function(t){var n=(0,BC.fromNullableK)(t);return function(t){return(0,BC.chain)(n(t))}},BC.chainNullableK=Vs,BC.toUnion=(0,BC.foldW)(UY.identity,UY.identity),BC.toError=function(t){return t instanceof Error?t:Error(String(t))},BC.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,BC.isLeft)(i)&&n.equals(r,i.right)}},Vl=function(t){return function(n){return!(0,BC.isLeft)(n)&&t(n.right)}},BC.exists=Vl,BC.Do=(0,BC.of)(BE.emptyRecord),BC.bindTo=(0,zl.bindTo)(BC.Functor),BC.bind=(0,zd.bind)(BC.Chain),BC.bindW=BC.bind,BC.apS=(0,UZ.apS)(BC.Apply),BC.apSW=BC.apS,BC.ApT=(0,BC.of)(BE.emptyReadonlyArray),Vc=function(t){return function(n){var r=t(0,BE.head(n));if((0,BC.isLeft)(r))return r;for(var i=[r.right],o=1;o<n.length;o++){var a=t(o,n[o]);if((0,BC.isLeft)(a))return a;i.push(a.right)}return(0,BC.right)(i)}},BC.traverseReadonlyNonEmptyArrayWithIndex=Vc,Vd=function(t){var n=(0,BC.traverseReadonlyNonEmptyArrayWithIndex)(t);return function(t){return BE.isNonEmpty(t)?n(t):BC.ApT}},BC.traverseReadonlyArrayWithIndex=Vd,BC.traverseArrayWithIndex=BC.traverseReadonlyArrayWithIndex,Vf=function(t){return(0,BC.traverseReadonlyArrayWithIndex)(function(n,r){return t(r)})},BC.traverseArray=Vf,BC.sequenceArray=(0,BC.traverseArray)(UY.identity),BC.parseJSON=function(t,n){return(0,BC.tryCatch)(function(){return JSON.parse(t)},n)},Vp=function(t,n){return(0,BC.tryCatch)(function(){var n=JSON.stringify(t);if("string"!=typeof n)throw Error("Converting unsupported structure to JSON");return n},n)},BC.stringifyJSON=Vp,BC.either={URI:BC.URI,map:Bj,of:BC.of,ap:BA,chain:BN,reduce:BP,foldMap:BL,reduceRight:BD,traverse:BF,sequence:BC.sequence,bimap:BW,mapLeft:BU,alt:Bz,extend:BB,chainRec:BV,throwError:BC.throwError},BC.getApplySemigroup=(0,UZ.getApplySemigroup)(BC.Apply),BC.getApplyMonoid=(0,UG.getApplicativeMonoid)(BC.Applicative),Vh=function(t,n){return(0,UZ.getApplySemigroup)((0,BC.getApplicativeValidation)(t))(n)},BC.getValidationSemigroup=Vh,Vm=function(t,n){return(0,UG.getApplicativeMonoid)((0,BC.getApplicativeValidation)(t))(n)},BC.getValidationMonoid=Vm,BC.getValidation=function(t){var n=(0,BC.getApplicativeValidation)(t).ap,r=(0,BC.getAltValidation)(t).alt;return{URI:BC.URI,_E:void 0,map:Bj,of:BC.of,chain:BN,bimap:BW,mapLeft:BU,reduce:BP,foldMap:BL,reduceRight:BD,extend:BB,traverse:BF,sequence:BC.sequence,chainRec:BV,throwError:BC.throwError,ap:n,alt:r}};var zF=globalThis&&globalThis.__extends||(Vg=function(t,n){return(Vg=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}Vg(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}),zW=globalThis&&globalThis.__assign||function(){return(zW=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)},zU=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))},zz=function(t,n,r){return rS([{value:t,context:n,message:r}])},zB=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 gn(o)?o:n.validate(o.right,r)},this.encode===zV&&n.encode===zV?zV: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}(),zV=function(t){return t};function z$(t){return t.displayName||t.name||"<function".concat(t.length,">")}function zq(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 zK(t,n){for(var r=n.length,i=0;i<r;i++)t.push(n[i])}var zH=Object.prototype.hasOwnProperty;function zG(t){return Object.keys(t).map(function(n){return"".concat(n,": ").concat(t[n].name)}).join(", ")}function zZ(t){for(var n=0;n<t.length;n++)if(t[n].encode!==zV)return!1;return!0}function zY(t){return"{ ".concat(zG(t)," }")}function zJ(t){return"Partial<".concat(t,">")}function zQ(t){if(z6(t)){var n,r,i=t.value;if(Bd.is(i))return(n={})[i]=null,n}else{if(r=t,"KeyofType"===r._tag)return t.keys;if(z8(t)){var o=t.types.map(function(t){return zQ(t)});return o.some(Bo.is)?void 0:Object.assign.apply(Object,zU([{}],o,!1))}}}function zX(t){return"("+t.map(function(t){return t.name}).join(" | ")+")"}function z0(t,n){for(var r=!0,i=!0,o=!B_.is(t),a=0;a<n.length;a++){var u=n[a];u!==t&&(r=!1),B_.is(u)&&(i=!1)}if(r)return t;if(i)return n[n.length-1];for(var s={},l=0;l<n.length;l++){var u=n[l];for(var c in u)(!zH.call(s,c)||o||u[c]!==t[c])&&(s[c]=u[c])}return s}function z1(t,n){for(var r=Object.getOwnPropertyNames(t),i=!1,o={},a=0;a<r.length;a++){var u=r[a];zH.call(n,u)?o[u]=t[u]:i=!0}return i?o:t}function z2(t){return t.length>0}var z3={};function z4(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 z5(t){return"AnyType"===t._tag}function z6(t){return"LiteralType"===t._tag}function z9(t){return"InterfaceType"===t._tag}function z8(t){return"UnionType"===t._tag}var z7=[];function Be(t){if(-1!==z7.indexOf(t))return z3;if(z9(t)||"StrictType"===(n=t)._tag){var n,r,i,o,a,u=z3;for(var s in t.props){var l=t.props[s];z6(l)&&(u===z3&&(u={}),u[s]=[l.value])}return u}if("ExactType"===t._tag||"RefinementType"===t._tag)return Be(t.type);if("IntersectionType"===t._tag)return t.types.reduce(function(t,n){return function(t,n){if(t===z3)return n;if(n===z3)return t;var r=Object.assign({},t);for(var i in n)if(zH.call(t,i)){var o=z4(t[i],n[i]);if(z2(o))r[i]=o;else{r=z3;break}}else r[i]=n[i];return r}(t,Be(n))},z3);if(z8(t))return t.types.slice(1).reduce(function(t,n){return function(t,n){if(t===z3||n===z3)return z3;var r=z3;for(var i in t)zH.call(n,i)&&0===z4(t[i],n[i]).length&&(r===z3&&(r={}),r[i]=t[i].concat(n[i]));return r}(t,Be(n))},Be(t.types[0]));if("RecursiveType"===t._tag){z7.push(t);var c=Be(t.type);return z7.pop(),c}return z3}function Bt(t){var n=Be(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=Be(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 Bn=function(t){function n(){var n=t.call(this,"null",function(t){return null===t},function(t,r){return n.is(t)?rT(t):zz(t,r)},zV)||this;return n._tag="NullType",n}return zF(n,t),n}(zB),Br=new Bn,Bi=function(t){function n(){var n=t.call(this,"undefined",function(t){return void 0===t},function(t,r){return n.is(t)?rT(t):zz(t,r)},zV)||this;return n._tag="UndefinedType",n}return zF(n,t),n}(zB),Bo=new Bi,Ba=function(t){function n(){var n=t.call(this,"void",Bo.is,Bo.validate,zV)||this;return n._tag="VoidType",n}return zF(n,t),n}(zB),Bu=new Ba,Bs=function(t){function n(){var n=t.call(this,"unknown",function(t){return!0},rT,zV)||this;return n._tag="UnknownType",n}return zF(n,t),n}(zB),Bl=new Bs,Bc=function(t){function n(){var n=t.call(this,"string",function(t){return"string"==typeof t},function(t,r){return n.is(t)?rT(t):zz(t,r)},zV)||this;return n._tag="StringType",n}return zF(n,t),n}(zB),Bd=new Bc,Bf=function(t){function n(){var n=t.call(this,"number",function(t){return"number"==typeof t},function(t,r){return n.is(t)?rT(t):zz(t,r)},zV)||this;return n._tag="NumberType",n}return zF(n,t),n}(zB),Bp=new Bf,Bh=function(t){function n(){var n=t.call(this,"bigint",function(t){return"bigint"==typeof t},function(t,r){return n.is(t)?rT(t):zz(t,r)},zV)||this;return n._tag="BigIntType",n}return zF(n,t),n}(zB),Bm=new Bh,Bg=function(t){function n(){var n=t.call(this,"boolean",function(t){return"boolean"==typeof t},function(t,r){return n.is(t)?rT(t):zz(t,r)},zV)||this;return n._tag="BooleanType",n}return zF(n,t),n}(zB),By=new Bg,Bv=function(t){function n(){var n=t.call(this,"UnknownArray",Array.isArray,function(t,r){return n.is(t)?rT(t):zz(t,r)},zV)||this;return n._tag="AnyArrayType",n}return zF(n,t),n}(zB),Bb=new Bv,Bx=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)?rT(t):zz(t,r)},zV)||this;return n._tag="AnyDictionaryType",n}return zF(n,t),n}(zB),B_=new Bx,BS=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 zF(n,t),n}(zB);function BT(t,n){void 0===n&&(n=JSON.stringify(t));var r=function(n){return n===t};return new BS(n,r,function(n,i){return r(n)?rT(t):zz(n,i)},zV,t)}var Bw=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 zF(n,t),n}(zB),BO=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 zF(n,t),n}(zB);function Bk(t,n,r){return VJ(t,n,r)}var BC,BI,BM,BR,BE,Bj,BA,BN,BP,BL,BD,BF,BW,BU,Bz,BB,BV,B$,Bq,BK,BH,BG,BZ,BY,BJ,BQ,BX,B0,B1,B2,B3,B4,B5,B6,B9,B8,B7,Ve,Vt,Vn,Vr,Vi,Vo,Va,Vu,Vs,Vl,Vc,Vd,Vf,Vp,Vh,Vm,Vg,Vy,Vv,Vb=VJ(Bp,Vv=function(t){return Number.isInteger(t)},"Int"),Vx=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 zF(n,t),n}(zB);function V_(t,n){var r,i=function(){return r||((r=n(o)).name=t),r},o=new Vx(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(Vx.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});var VS=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 zF(n,t),n}(zB);function VT(t,n){return void 0===n&&(n="Array<".concat(t.name,">")),new VS(n,function(n){return Bb.is(n)&&n.every(t.is)},function(n,r){var i=Bb.validate(n,r);if(gn(i))return i;for(var o=i.right,a=o.length,u=o,s=[],l=0;l<a;l++){var c=o[l],d=t.validate(c,zq(r,String(l),t,c));if(gn(d))zK(s,d.left);else{var f=d.right;f!==c&&(u===o&&(u=o.slice()),u[l]=f)}}return s.length>0?rS(s):rT(u)},t.encode===zV?zV:function(n){return n.map(t.encode)},t)}var Vw=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 zF(n,t),n}(zB);function VO(t,n){void 0===n&&(n=zY(t));var r=Object.keys(t),i=r.map(function(n){return t[n]}),o=r.length;return new Vw(n,function(t){if(B_.is(t)){for(var n=0;n<o;n++){var a=r[n],u=t[a];if(void 0===u&&!zH.call(t,a)||!i[n].is(u))return!1}return!0}return!1},function(t,n){var a=B_.validate(t,n);if(gn(a))return a;for(var u=a.right,s=u,l=[],c=0;c<o;c++){var d=r[c],f=s[d],p=i[c],h=p.validate(f,zq(n,d,p,f));if(gn(h))zK(l,h.left);else{var m=h.right;m===f&&(void 0!==m||zH.call(s,d))||(s===u&&(s=zW({},u)),s[d]=m)}}return l.length>0?rS(l):rT(s)},zZ(i)?zV:function(t){for(var n=zW({},t),a=0;a<o;a++){var u=r[a],s=i[a].encode;s!==zV&&(n[u]=s(t[u]))}return n},t)}var Vk=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 zF(n,t),n}(zB),VC=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 zF(n,t),n}(zB);function VI(t,n,r){var i,o,a,u,s,l,c,d,f=zQ(t);return f?(i=Object.keys(f),void 0===(u=r)&&(u="{ [K in ".concat(t.name,"]: ").concat(n.name," }")),s=i.length,new VC(u,function(t){return B_.is(t)&&i.every(function(r){return n.is(t[r])})},function(t,r){var o=B_.validate(t,r);if(gn(o))return o;for(var a=o.right,u={},l=[],c=!1,d=0;d<s;d++){var f=i[d],p=a[f],h=n.validate(p,zq(r,f,n,p));if(gn(h))zK(l,h.left);else{var m=h.right;c=c||m!==p,u[f]=m}}return l.length>0?rS(l):rT(c||Object.keys(a).length!==s?u:a)},n.encode===zV?zV:function(t){for(var r={},o=0;o<s;o++){var a=i[o];r[a]=n.encode(t[a])}return r},t,n)):(l=t,void 0===(d=r)&&(d="{ [K in ".concat(l.name,"]: ").concat(n.name," }")),new VC(d,function(t){return B_.is(t)?Object.keys(t).every(function(r){return l.is(r)&&n.is(t[r])}):z5(n)&&Array.isArray(t)},function(t,r){if(B_.is(t)){for(var i={},o=[],a=Object.keys(t),u=a.length,s=!1,c=0;c<u;c++){var d=a[c],f=t[d],p=l.validate(d,zq(r,d,l,d));if(gn(p))zK(o,p.left);else{var h=p.right;s=s||h!==d,d=h;var m=n.validate(f,zq(r,d,n,f));if(gn(m))zK(o,m.left);else{var g=m.right;s=s||g!==f,i[d]=g}}}return o.length>0?rS(o):rT(s?i:t)}return z5(n)&&Array.isArray(t)?rT(t):zz(t,r)},l.encode===zV&&n.encode===zV?zV:function(t){for(var r={},i=Object.keys(t),o=i.length,a=0;a<o;a++){var u=i[a];r[String(l.encode(u))]=n.encode(t[u])}return r},l,n))}var 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="UnionType",u}return zF(n,t),n}(zB);function VR(t,n){void 0===n&&(n=zX(t));var r=Bt(t);if(void 0===r||!(t.length>0))return new VM(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,zq(r,String(o),a,n));if(!gn(u))return rT(u.right);zK(i,u.left)}return rS(i)},zZ(t)?zV: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 Vz(n,function(n){if(B_.is(n)){var r=u(n[i]);return void 0!==r&&t[r].is(n)}return!1},function(n,r){var o=B_.validate(n,r);if(gn(o))return o;var a=o.right,s=u(a[i]);if(void 0===s)return zz(n,r);var l=t[s];return l.validate(a,zq(r,String(s),l,a))},zZ(t)?zV: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 VE=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 zF(n,t),n}(zB),Vj=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 zF(n,t),n}(zB),VA=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 zF(n,t),n}(zB),VN=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 zF(n,t),n}(zB);function VP(t,n){void 0===n&&(n="ReadonlyArray<".concat(t.name,">"));var r=VT(t);return new VN(n,r.is,r.validate,r.encode,t)}var VL=function(t,n){return VF(VO(t),n)},VD=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 zF(n,t),n}(zB);function VF(t,n){void 0===n&&(n=z9(i=t)?"{| ".concat(zG(i.props)," |}"):(r=i,"PartialType"===r._tag)?zJ("{| ".concat(zG(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 VD(n,t.is,function(n,r){var i=B_.validate(n,r);if(gn(i))return i;var a=t.validate(n,r);return gn(a)?a:rT(z1(a.right,o))},function(n){return t.encode(z1(n,o))},t)}var VW=function(t){function n(){var n=t.call(this,"Function",function(t){return"function"==typeof t},function(t,r){return n.is(t)?rT(t):zz(t,r)},zV)||this;return n._tag="FunctionType",n}return zF(n,t),n}(zB),VU=new VW,Vz=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 zF(n,t),n}(VM),VB=function(t,n,r){void 0===r&&(r=zX(n));var i=VR(n,r);return i instanceof Vz?i:(console.warn("[io-ts] Cannot build a tagged union for ".concat(r,", returning a de-optimized union")),new Vz(r,i.is,i.validate,i.encode,n,t))},VV=function(t,n){return{value:t,context:n}},V$=function(t){return[{key:"",type:t}]},Vq=function(t){function n(){var n=t.call(this,"never",function(t){return!1},function(t,n){return zz(t,n)},function(){throw Error("cannot encode never")})||this;return n._tag="NeverType",n}return zF(n,t),n}(zB),VK=new Vq,VH=function(t){function n(){var n=t.call(this,"any",function(t){return!0},rT,zV)||this;return n._tag="AnyType",n}return zF(n,t),n}(zB),VG=new VH,VZ=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)?rT(t):zz(t,r)},zV)||this;return n._tag="ObjectType",n}return zF(n,t),n}(zB),VY=new VZ;function VJ(t,n,r){return void 0===r&&(r="(".concat(t.name," | ").concat(z$(n),")")),new BO(r,function(r){return t.is(r)&&n(r)},function(r,i){var o=t.validate(r,i);if(gn(o))return o;var a=o.right;return n(a)?rT(a):zz(a,i)},t.encode,t,n)}var VQ=VJ(Bp,Number.isInteger,"Integer"),VX=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 zF(n,t),n}(zB);function V0(t){return t}let V1=Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:Bv,AnyDictionaryType:Bx,AnyType:VH,Array:Bb,ArrayType:VS,BigIntType:Bh,BooleanType:Bg,Dictionary:B_,DictionaryType:VC,ExactType:VD,Function:VU,FunctionType:VW,Int:Vb,Integer:VQ,InterfaceType:Vw,IntersectionType:VE,KeyofType:Bw,LiteralType:BS,NeverType:Vq,NullType:Bn,NumberType:Bf,ObjectType:VZ,PartialType:Vk,ReadonlyArrayType:VN,ReadonlyType:VA,RecursiveType:Vx,RefinementType:BO,StrictType:VX,StringType:Bc,TaggedUnionType:Vz,TupleType:Vj,Type:zB,UndefinedType:Bi,UnionType:VM,UnknownArray:Bb,UnknownRecord:B_,UnknownType:Bs,VoidType:Ba,alias:function(t){return function(){return t}},any:VG,appendContext:zq,array:VT,bigint:Bm,boolean:By,brand:Bk,clean:V0,dictionary:VI,emptyTags:z3,exact:VF,failure:zz,failures:rS,getContextEntry:function(t,n){return{key:t,type:n}},getDefaultContext:V$,getDomainKeys:zQ,getFunctionName:z$,getIndex:Bt,getTags:Be,getValidationError:VV,identity:zV,interface:VO,intersection:function(t,n){void 0===n&&(n="(".concat(t.map(function(t){return t.name}).join(" & "),")"));var r=t.length;return new VE(n,function(n){return t.every(function(t){return t.is(n)})},0===t.length?rT:function(n,i){for(var o=[],a=[],u=0;u<r;u++){var s=t[u],l=s.validate(n,zq(i,String(u),s,n));gn(l)?zK(a,l.left):o.push(l.right)}return a.length>0?rS(a):rT(z0(n,o))},0===t.length?zV:function(n){return z0(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 Bd.is(n)&&zH.call(t,n)};return new Bw(n,r,function(t,n){return r(t)?rT(t):zz(t,n)},zV,t)},literal:BT,mergeAll:z0,never:VK,null:Br,nullType:Br,number:Bp,object:VY,partial:function(t,n){void 0===n&&(n=zJ(zY(t)));var r=Object.keys(t),i=r.map(function(n){return t[n]}),o=r.length;return new Vk(n,function(n){if(B_.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=B_.validate(n,i);if(gn(a))return a;for(var u=a.right,s=u,l=[],c=0;c<o;c++){var d=r[c],f=s[d],p=t[d],h=p.validate(f,zq(i,d,p,f));if(gn(h))void 0!==f&&zK(l,h.left);else{var m=h.right;m!==f&&(s===u&&(s=zW({},u)),s[d]=m)}}return l.length>0?rS(l):rT(s)},zZ(i)?zV:function(t){for(var n=zW({},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 VA(n,t.is,t.validate,t.encode,t)},readonlyArray:VP,record:VI,recursion:V_,refinement:VJ,strict:VL,string:Bd,success:rT,taggedUnion:VB,tuple:function(t,n){void 0===n&&(n="[".concat(t.map(function(t){return t.name}).join(", "),"]"));var r=t.length;return new Vj(n,function(n){return Bb.is(n)&&n.length===r&&t.every(function(t,r){return t.is(n[r])})},function(n,i){var o=Bb.validate(n,i);if(gn(o))return o;for(var a=o.right,u=a.length>r?a.slice(0,r):a,s=[],l=0;l<r;l++){var c=a[l],d=t[l],f=d.validate(c,zq(i,String(l),d,c));if(gn(f))zK(s,f.left);else{var p=f.right;p!==c&&(u===a&&(u=a.slice()),u[l]=p)}}return s.length>0?rS(s):rT(u)},zZ(t)?zV:function(n){return t.map(function(t,r){return t.encode(n[r])})},t)},type:VO,undefined:Bo,union:VR,unknown:Bl,void:Bu,voidType:Bu},Symbol.toStringTag,{value:"Module"})),V2=C(V1);var V3={};Object.defineProperty(V3,"__esModule",{value:!0}),V3.ContentPath=void 0,V3.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 V4={},V5={};Object.defineProperty(V5,"__esModule",{value:!0}),V5.getAssetOrThrow=void 0;let V6=t=>n=>{let r=t[n];if(!r)throw Error(`Missing asset with id '${n}'!`);return r};V5.getAssetOrThrow=V6;var V9={};Object.defineProperty(V9,"__esModule",{value:!0}),V9.getEmbedOrThrow=void 0;let V8=t=>n=>{let r=t[n];if(!r)throw Error(`Missing embed with url '${n}'`);return r};V9.getEmbedOrThrow=V8;var V7={},$e={};let $t=C(rh);function $n(t,n,r){return void 0===r&&(r=t.name),new zB(r,t.is,t.validate,function(r){return n(t.encode(r))})}let $r=Object.freeze(Object.defineProperty({__proto__:null,mapOutput:$n},Symbol.toStringTag,{value:"Module"}));var $i,$o,$a,$u=VJ(Bd,$o=function(t){return t.length>0},"NonEmptyString");function $s(t,n){void 0===n&&(n="NonEmptyArray<"+t.name+">");var r=VT(t);return new zB(n,function(t){return r.is(t)&&aI(t)},function(t,n){return rd(r.validate(t,n),mY(function(r){var i=aW(r);return hw(i)?zz(t,n):rT(i.value)}))},function(t){return r.encode(t)})}function $l(t,n,r){void 0===r&&(r="Set<"+t.name+">");var i=VT(t),o=NN(n),a=NC(n);return new zB(r,function(n){return n instanceof Set&&jB(t.is)(n)},function(t,n){return rd(i.validate(t,n),mY(function(r){var i=a(r);return i.size!==r.length?zz(t,n):rT(i)}))},function(t){return i.encode(o(t))})}function $c(t,n){return new zB(t,n,function(t,r){return n(t)?rT(t):zz(t,r)},zV)}var $d=$c("Date",function(t){return t instanceof Date}),$f=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))},$p=function(t,n){return{get:t,reverseGet:n}},$h=function(t){return $v(t.get,ra(t.reverseGet,rt))},$m=function(t){return $M(ra(t.get,rb),t.reverseGet)},$g=function(t){return $N(ra(t.get,rb),ra(t.reverseGet,rt))},$y=function(t){return $U(function(n){return function(r){return function(i){return n.map(r(t.get(i)),function(n){return t.reverseGet(n)})}}})},$v=function(t,n){return{get:t,set:n}},$b=function(t){return $N(ra(t.get,rb),t.set)},$x=function(t){return $U(function(n){return function(r){return function(i){return n.map(r(t.get(i)),function(n){return t.set(n)(i)})}}})},$_=function(t){return function(n){return $v(function(r){return t.get(n.get(r))},function(r){return function(i){return n.set(t.set(r)(n.get(i)))(i)}})}},$S=function(t){return function(n){return $M(ra(n.getOption,p4(t.getOption)),ra(t.reverseGet,n.reverseGet))}},$T=function(t){return function(n){return $F($R(t))($b(n))}},$w=function(){return $v(re,rt)},$O=function(t){return function(n){return $v(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)}})}},$k=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(n){return $v(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}})}},$C=function(t){return function(n){return $v(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)}})}},$I=function(t){return function(n){var r;return rd(n,$_(({at:r=function(t){return $v(function(n){return Eu(t,n)},hO(function(){return Er(t)},function(n){return Et(t,n)}))}}).at(t)))}},$M=function(t,n){return{getOption:t,reverseGet:n}},$R=function(t){return $N(t.getOption,function(n){return $j(n)(t)})},$E=function(t){return $U(function(n){return function(r){return function(i){return rd(t.getOption(i),hO(function(){return n.of(i)},function(o){return n.map(r(o),function(n){return $j(n)(t)(i)})}))}}})},$j=function(t){var n;return n=function(){return t},function(t){var r,i,o=(r=t,function(t){return rd(r.getOption(t),pQ(function(i){var o=n(i);return o===i?t:r.reverseGet(o)}))});return function(t){return rd(o(t),hk(function(){return t}))}}},$A=function(t){return $M(pE(t),re)},$N=function(t,n){return{getOption:t,set:n}},$P=function(t){return $U(function(n){return function(r){return function(i){return rd(t.getOption(i),hO(function(){return n.of(i)},function(o){return n.map(r(o),function(n){return t.set(n)(i)})}))}}})},$L=function(t){return function(n){return function(r){return rd(n.getOption(r),pQ(function(i){var o=t(i);return o===i?r:n.set(o)(r)}))}}},$D=function(t){return function(n){var r=$L(t)(n);return function(t){return rd(r(t),hk(function(){return t}))}}},$F=function(t){return function(n){return $N(ra(n.getOption,p4(t.getOption)),function(r){return $D(t.set(r))(n)})}},$W=function(t,n,r){if(r[t]===n)return r;var i=$f([r[0]],r.slice(1),!0);return i[t]=n,i},$U=function(t){return{modifyF:t}};function $z(t){return function(n){return $U(function(r){return function(i){return n.modifyF(r)(t.modifyF(r)(i))}})}}var $B={URI:"Identity",map:function(t,n){return n(t)},of:re,ap:function(t,n){return t(n)}},$V=function(t){return{index:t}},$$=ra($h,$_),$q=function(t){return ra($b,$F(t))},$K=function(t){return ra($x,$z(t))},$H=function(t){return function(n){return function(r){var i=n.get(r),o=t(i);return i===o?r:n.set(o)(r)}}},$G=function(t){return $T($M(hP,re))(t)},$Z=function(t){var n;return ra($b,function(n){return rd(n,$F($V(function(t){return $N(function(n){return sD(t,n)},function(n){return function(r){return rd(sD(t,r),hO(function(){return r},function(){return cP(t,n,r)}))}})}).index(t)))})},$Y=function(t){var n;return ra($b,function(n){return rd(n,$F($V(function(t){return $N(function(n){return sD(t,n)},function(n){return function(r){return rd(sD(t,r),hO(function(){return r},function(){return $W(t,n,r)}))}})}).index(t)))})},$J=function(t){var n;return ra($b,function(n){return rd(n,$F($V(function(t){return $N(function(n){return Eu(t,n)},function(n){return function(r){return r[t]===n||hw(Eu(t,r))?r:Et(t,n)(r)}})}).index(t)))})},$Q=$T($M(re,rb)),$X=$T($M(pA,rT)),$0=$T($M(function(t){return gn(t)?rb(t.left):rv},rS)),$1=function(t,n){return function(r){return $2(r,t,n)}},$2=function(t,n,r){return $v(ra(t.get,n),ra(r,t.set))},$3="monocle-ts/Lens",$4={URI:$3,compose:function(t,n){return $_(t)(n)}},$5={URI:$3,compose:$4.compose,id:$w};let $6=Object.freeze(Object.defineProperty({__proto__:null,Category:$5,Invariant:{URI:$3,imap:$2},Semigroupoid:$4,URI:$3,asOptional:$b,asTraversal:$x,atKey:$I,component:$C,compose:$_,composeIso:$$,composeLens:$_,composeOptional:$q,composePrism:$T,composeTraversal:$K,filter:function(t){return $T($A(t))},findFirst:function(t){var n;return $q($N(sG(t),function(n){return function(r){return rd(sH(t)(r),hO(function(){return r},function(t){return cP(t,n,r)}))}}))},findFirstNonEmpty:function(t){var n;return $q($N(sG(t),function(n){return function(r){return rd(sH(t)(r),hO(function(){return r},function(t){return $W(t,n,r)}))}}))},fromNullable:$G,id:$w,imap:$1,index:$Z,indexNonEmpty:$Y,key:$J,left:$0,lens:$v,modify:$H,modifyF:function(t){return function(n){return function(r){return function(i){return rd(r.get(i),n,function(n){return t.map(n,function(t){return r.set(t)(i)})})}}}},prop:$O,props:$k,right:$X,some:$Q,traverse:function(t){var n,r;return ra($x,$z($U(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 $9=function(t){return function(n){return n.modifyF($B)(t)}},$8=function(t){return new qi(t.get,t.reverseGet)},$7=function(t){return new qo(t.get,t.set)},qe=function(t){return new qa(t.getOption,t.reverseGet)},qt=function(t){return new qs(t.getOption,t.set)},qn=function(t){return new ql(t.modifyF)},qr=function(t,n,r){var i;return r===t[n]?t:Object.assign({},t,((i={})[n]=r,i))},qi=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 $8($p(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 $7($h(this))},t.prototype.asPrism=function(){return qe($m(this))},t.prototype.asOptional=function(){return qt($g(this))},t.prototype.asTraversal=function(){return qn($y(this))},t.prototype.asFold=function(){var t=this;return new qd(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.asGetter=function(){var t=this;return new qc(function(n){return t.get(n)})},t.prototype.asSetter=function(){var t=this;return new qf(function(n){return t.modify(n)})},t.prototype.compose=function(t){var n,r;return $8((r=this,$p(ra(r.get,t.get),ra(t.reverseGet,r.reverseGet))))},t.prototype.composeIso=function(t){return this.compose(t)},t.prototype.composeLens=function(t){return $7(rd(this,$h,$_(t)))},t.prototype.composePrism=function(t){return qe(rd(this,$m,$S(t)))},t.prototype.composeOptional=function(t){return qt(rd(this,$g,$F(t)))},t.prototype.composeTraversal=function(t){return qn(rd(this,$y,$z(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}(),qo=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 $7(rd($w(),$O(t)))}},t.fromProps=function(){return function(t){return $7(rd($w(),$k.apply($6,t)))}},t.fromNullableProp=function(){return function(n,r){return new t(function(t){var i=hP(t[n]);return hw(i)?r:i.value},function(t){return function(r){return qr(r,n,t)}})}},t.prototype.modify=function(t){return $H(t)(this)},t.prototype.asOptional=function(){return qt($b(this))},t.prototype.asTraversal=function(){return qn($x(this))},t.prototype.asSetter=function(){var t=this;return new qf(function(n){return t.modify(n)})},t.prototype.asGetter=function(){var t=this;return new qc(function(n){return t.get(n)})},t.prototype.asFold=function(){var t=this;return new qd(function(){return function(n){return function(r){return n(t.get(r))}}})},t.prototype.compose=function(t){return $7($_(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 qt(rd(this,$b,$F(t)))},t.prototype.composeTraversal=function(t){return qn(rd(this,$x,$z(t)))},t.prototype.composeSetter=function(t){return this.asSetter().compose(t)},t.prototype.composeIso=function(t){return $7(rd(this,$_(rd(t,$h))))},t.prototype.composePrism=function(t){return qt($T(t)(this))},t}(),qa=function(){function t(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return t.fromPredicate=function(t){return qe($A(t))},t.some=function(){return qu},t.prototype.modify=function(t){var n=this;return function(r){var i=n.modifyOption(t)(r);return hw(i)?r:i.value}},t.prototype.modifyOption=function(t){var n=this;return function(r){return hQ.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 qt($R(this))},t.prototype.asTraversal=function(){return qn($E(this))},t.prototype.asSetter=function(){var t=this;return new qf(function(n){return t.modify(n)})},t.prototype.asFold=function(){var t=this;return new qd(function(n){return function(r){return function(i){var o=t.getOption(i);return hw(o)?n.empty:r(o.value)}}})},t.prototype.compose=function(t){return qe($S(t)(this))},t.prototype.composePrism=function(t){return this.compose(t)},t.prototype.composeOptional=function(t){return qt(rd(this,$R,$F(t)))},t.prototype.composeTraversal=function(t){return qn(rd(this,$E,$z(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 qe(rd(this,$S(rd(t,$m))))},t.prototype.composeLens=function(t){var n;return qt((n=t,function(t){return $F($b(n))($R(t))})(this))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),qu=new qa(re,rb),qs=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 hP(t[n])},function(t){return function(r){return null==r[n]?r:qr(r,n,t)}})}},t.fromOptionProp=function(){var t=qo.fromProp();return function(n){return t(n).composePrism(qu)}},t.prototype.modify=function(t){return $D(t)(this)},t.prototype.modifyOption=function(t){return $L(t)(this)},t.prototype.asTraversal=function(){return qn($P(this))},t.prototype.asFold=function(){var t=this;return new qd(function(n){return function(r){return function(i){var o=t.getOption(i);return hw(o)?n.empty:r(o.value)}}})},t.prototype.asSetter=function(){var t=this;return new qf(function(n){return t.modify(n)})},t.prototype.compose=function(t){return qt($F(t)(this))},t.prototype.composeOptional=function(t){return this.compose(t)},t.prototype.composeTraversal=function(t){return qn(rd(this,$P,$z(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 qt(rd(this,$F(rd(t,$b))))},t.prototype.composePrism=function(t){return qt(rd(this,$F(rd(t,$R))))},t.prototype.composeIso=function(t){return qt(rd(this,$F(rd(t,$g))))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),ql=function(){function t(t){this.modifyF=t,this._tag="Traversal"}return t.prototype.modify=function(t){return $9(t)(this)},t.prototype.set=function(t){var n;return $9(function(){return t})(this)},t.prototype.filter=function(t){var n;return qn($z($E($A(t)))(this))},t.prototype.asFold=function(){var t=this;return new qd(function(n){return function(r){return t.modifyF(mr(n))(function(t){return re(r(t))})}})},t.prototype.asSetter=function(){var t=this;return new qf(function(n){return t.modify(n)})},t.prototype.compose=function(t){return qn($z(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 qn(rd(this,$z(rd(t,$x))))},t.prototype.composePrism=function(t){return qn(rd(this,$z(rd(t,$E))))},t.prototype.composeIso=function(t){return qn(rd(this,$z(rd(t,$y))))},t.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},t}(),qc=function(){function t(t){this.get=t,this._tag="Getter"}return t.prototype.asFold=function(){var t=this;return new qd(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}(),qd=function(){function t(t){this.foldMap=t,this._tag="Fold",this.getAll=t(fS())(a1),this.exist=t(wj),this.all=t(wE),this.foldMapFirst=t(h1())}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(pE(t))},t.prototype.headOption=function(t){return this.find(function(){return!0})(t)},t}(),qf=function(){function t(t){this.modify=t,this._tag="Setter"}return t.prototype.set=function(t){return this.modify(rt(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}(),qp=new qi(re,re),qh=VL({_tag:BT("None")}),qm=BT("Some");function qg(t,n){return void 0===n&&(n="Option<"+t.name+">"),VR([qh,VL({_tag:qm,value:t},"Some<"+t.name+">")],n)}var qy=new zB("DateFromISOString",function(t){return t instanceof Date},function(t,n){return rd(Bd.validate(t,n),mY(function(r){var i=new Date(r);return isNaN(i.getTime())?zz(t,n):rT(i)}))},function(t){return t.toISOString()});function qv(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n}var qb=new zB("DateFromNumber",function(t){return t instanceof Date},function(t,n){return rd(Bp.validate(t,n),mY(function(r){var i=new Date(r);return isNaN(i.getTime())?zz(t,n):rT(i)}))},function(t){return t.getTime()});function qx(t,n,r){void 0===r&&(r=t.name);var i=qv(t);return i.validate=n,i.decode=function(t){return n(t,V$(i))},i.name=r,i}var q_,qS,qT,qw=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,qO=VJ(Bd,qS=function(t){return qw.test(t)},"UUID"),qk=new zB("BooleanFromString",By.is,function(t,n){return rd(Bd.validate(t,n),mY(function(r){return"true"===r?rT(!0):"false"===r?rT(!1):zz(t,n)}))},String);function qC(t){switch(t._tag){case"InterfaceType":return t.props;case"ExactType":return qC(t.type)}}var qI=qo.fromProp(),qM=$c("RegExp",function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}),qR=new zB("DateFromUnixTime",function(t){return t instanceof Date},function(t,n){return rd(Vb.validate(t,n),mY(function(r){var i=new Date(1e3*r);return isNaN(i.getTime())?zz(t,n):rT(i)}))},function(t){return Math.floor(t.getTime()/1e3)}),qE=new zB("NumberFromString",Bp.is,function(t,n){return rd(Bd.validate(t,n),mY(function(r){var i=+r;return isNaN(i)||""===r.trim()?zz(t,n):rT(i)}))},String),qj=new zB("IntFromString",Vb.is,function(t,n){return rd(qE.validate(t,n),mY(function(r){return Vb.is(r)?rT(r):zz(t,n)}))},qE.encode),qA=V_("JsonArray",function(){return VP(qP)}),qN=V_("JsonRecord",function(){return VI(Bd,qP)}),qP=VR([By,Bp,Bd,Br,qA,qN],"Json"),qL=new zB("JsonFromString",qP.is,function(t,n){try{return rT(JSON.parse(t))}catch{return zz(t,n)}},function(t){return JSON.stringify(t)}),qD=BT("Left"),qF=BT("Right"),qW=new zB("BigIntFromString",function(t){return"bigint"==typeof t},function(t,n){return rd(Bd.validate(t,n),mY(function(r){if(!$u.is(r.trim()))return zz(t,n);try{return rT(BigInt(r))}catch{return zz(t,n)}}))},String),qU=new zB("BooleanFromNumber",By.is,function(t,n){return rd(Bp.validate(t,n),mB(function(t){return 0!==t}))},Number);let qz=Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:qW,BooleanFromNumber:qU,BooleanFromString:qk,DateFromISOString:qy,DateFromNumber:qb,DateFromUnixTime:qR,IntFromString:qj,Json:qP,JsonArray:qA,JsonFromString:qL,JsonRecord:qN,NonEmptyString:$u,NumberFromString:qE,UUID:qO,clone:qv,date:$d,either:function(t,n,r){return void 0===r&&(r="Either<"+t.name+", "+n.name+">"),VR([VL({_tag:qD,left:t},"Left<"+t.name+">"),VL({_tag:qF,right:n},"Right<"+t.name+">")],r)},fromNewtype:function(t,n){return void 0===n&&(n="fromNewtype("+t.name+")"),new zB(n,function(n){return t.is(n)},function(n,r){return rd(t.validate(n,r),mB(qp.wrap))},function(n){return t.encode(qp.unwrap(n))})},fromNullable:function(t,n,r){return void 0===r&&(r="fromNullable("+t.name+")"),qx(t,function(r,i){return null==r?rT(n):t.validate(r,i)},r)},fromRefinement:$c,getLenses:function(t){var n={};for(var r in qC(t))n[r]=qI(r);return n},mapOutput:$n,nonEmptyArray:$s,option:qg,optionFromNullable:function(t,n){return void 0===n&&(n="Option<"+t.name+">"),new zB(n,qg(t).is,function(n,r){return null==n?rT(rv):rd(t.validate(n,r),mB(rb))},function(n){return hU(rd(n,pQ(t.encode)))})},readonlyNonEmptyArray:function(t,n){return void 0===n&&(n="ReadonlyNonEmptyArray<"+t.name+">"),$s(t,n)},readonlySetFromArray:function(t,n,r){return void 0===r&&(r="ReadonlySet<"+t.name+">"),$l(t,n,r)},regexp:qM,setFromArray:$l,withEncode:function(t,n,r){return void 0===r&&(r=t.name),new zB(r,t.is,t.validate,n)},withFallback:function(t,n,r){return void 0===r&&(r="withFallback("+t.name+")"),qx(t,function(r,i){return gg(function(){return rT(n)})(t.validate(r,i))},r)},withMessage:function(t,n){return qx(t,function(r,i){return m5(function(){return[{value:r,context:i,message:n(r,i),actual:r}]})(t.validate(r,i))})},withValidate:qx},Symbol.toStringTag,{value:"Module"})),qB=C(qz),qV=C($r);Object.defineProperty($e,"__esModule",{value:!0}),$e.withCustomError=$e.addType=$e.isEmpty=$e.objectToMap=$e.grouped=$e.formatDate=$e.formatDateTime=$e.filterDouble=$e.refineType=$e.nullable=void 0;let q$=nX,qq=(0,q$.__importStar)(V2);$e.nullable=function(t){return qq.union([t,qq.null,qq.undefined])},$e.refineType=function(t,n,r){return new qq.Type(n,t.is,(n,i)=>(0,$t.pipe)(t.validate(n,i),UK.either.chain(t=>r(t)?qq.success(t):qq.failure(n,i))),t.encode)},$e.filterDouble=function(t){if(""===t)return null;let n=Number(t);return Number.isNaN(n)?null:n},$e.formatDateTime=function(t){return t.toISOString().replace(/\.\d{3}Z$/,"+0000")},$e.formatDate=function(t){return t.toISOString().replace(/T.*/,"")},$e.grouped=function(t,n){return t.reduce((t,r,i)=>(i%n==0?t.push([r]):t[Math.floor(i/n)].push(r),t),[])},$e.objectToMap=function(t){return new Map(Object.entries(t))},$e.isEmpty=function(t){for(let n in t)return!1;return!0},$e.addType=function(t,n){return(0,qV.mapOutput)(t,t=>({...t,__TYPE__:n}))},$e.withCustomError=function(t,n){return(0,qB.withValidate)(t,(r,i)=>UK.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(V7,"__esModule",{value:!0}),V7.WidgetKey=void 0;let qK=nX,qH=(0,qK.__importStar)(V2),qG=RegExp("^[^<>]+$");V7.WidgetKey=(0,$e.refineType)(qH.string,"WidgetKey",t=>0===t.length||qG.test(t)),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nX;(0,n.__exportStar)(V5,t),(0,n.__exportStar)(V9,t),(0,n.__exportStar)(V7,t)}(V4);var qZ={},qY={},qJ={},qQ={},qX={};Object.defineProperty(qX,"__esModule",{value:!0}),qX.clone=void 0,qX.clone=function(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n};var q0=k&&k.__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]}),q1=k&&k.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),q2=k&&k.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&q0(n,t,r);return q1(n,t),n};Object.defineProperty(qQ,"__esModule",{value:!0}),qQ.withValidate=void 0;var q3=q2(V2);qQ.withValidate=function(t,n,r){void 0===r&&(r=t.name);var i=qX.clone(t);return i.validate=n,i.decode=function(t){return n(t,q3.getDefaultContext(i))},i.name=r,i};var q4=k&&k.__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]}),q5=k&&k.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),q6=k&&k.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&q4(n,t,r);return q5(n,t),n};Object.defineProperty(qJ,"__esModule",{value:!0}),qJ.withFallback=void 0;var q9=q6(V2);qJ.withFallback=function(t,n,r){return void 0===r&&(r="withFallback("+t.name+")"),qQ.withValidate(t,function(r,i){return UH.orElse(function(){return q9.success(n)})(t.validate(r,i))},r)};var q8={},q7={};Object.defineProperty(q7,"__esModule",{value:!0}),q7.EmptyArray=q7.EmptyObject=q7.Boolean=q7.NumberOrNull=q7.Number=q7.StringOrNull=q7.String=void 0;let Ke=nX,Kt=(0,Ke.__importStar)(V2);q7.String=(0,$e.withCustomError)(Kt.string,()=>"The value must be a string"),q7.StringOrNull=(0,$e.withCustomError)(Kt.union([Kt.string,Kt.null]),()=>"The value must be a string or null"),q7.Number=(0,$e.withCustomError)(Kt.number,()=>"The value must be a number"),q7.NumberOrNull=(0,$e.withCustomError)(Kt.union([Kt.number,Kt.null]),()=>"The value must be a number or null"),q7.Boolean=(0,$e.withCustomError)(Kt.boolean,()=>"The value must be a boolean"),q7.EmptyObject=Kt.UnknownRecord.pipe(new Kt.Type("emptyObject",t=>Kt.UnknownRecord.is(t),(t,n)=>Object.keys(t).length>0?Kt.failure(t,n,"The object is not empty."):Kt.success({}),Kt.identity)),q7.EmptyArray=new Kt.Type("emptyArray",t=>Kt.UnknownArray.is(t)&&0===t.length,(t,n)=>(0,UY.pipe)(Kt.UnknownArray.decode(t),UK.either.chain(r=>r.length>0?Kt.failure(t,n,"The array is not empty."):Kt.success([]))),()=>[]);var Kn={};let Kr=C(gF);var Ki={};Object.defineProperty(Ki,"__esModule",{value:!0});let Ko=nX,Ka=(0,Ko.__importStar)(V2);Ki.default=new Ka.Type("dateFromStringOrNumber",t=>t instanceof Date,(t,n)=>(0,$t.pipe)(Ka.union([Ka.number,Ka.string]).validate(t,n),(0,Kr.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?Ka.failure(t,n):Ka.success(i)})),t=>t);var Ku={};Object.defineProperty(Ku,"__esModule",{value:!0});let Ks=nX,Kl=(0,Ks.__importStar)(V2);Ku.default=new Kl.Type("dateFromTsMs",t=>t instanceof Date,(t,n)=>(0,$t.pipe)(Kl.number.validate(t,n),(0,Kr.chain)(r=>{let i=new Date(r);return isNaN(i.getTime())?Kl.failure(t,n):Kl.success(i)})),t=>t.getTime());var Kc={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyArrayOrElse=t.EmptyObjectOrElse=t.NullOrElse=t.DefaultOrElse=void 0;let n=nX,r=(0,n.__importStar)(V2),i=t=>n=>new r.Type(`DefaultOrElse<${t.name}, ${n.name}>`,t=>null===t||n.is(t),(i,o)=>(0,UH.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)(q7.EmptyObject)(n);t.EmptyObjectOrElse=a;let u=n=>(0,t.DefaultOrElse)(q7.EmptyArray)(n);t.EmptyArrayOrElse=u}(Kc);var Kd={};Object.defineProperty(Kd,"__esModule",{value:!0});let Kf=nX,Kp=(0,Kf.__importStar)(V2);Kd.default=new Kp.Type("IntFromNumber",Kp.Int.is,(t,n)=>(0,$t.pipe)(Kp.number.validate(t,n),(0,Kr.chain)(t=>Kp.Int.is(t)?Kp.success(t):Kp.success(Math.round(t)))),Kp.Int.encode);var Kh={};Object.defineProperty(Kh,"__esModule",{value:!0});let Km=nX,Kg=(0,Km.__importStar)(V2),Ky=/^([0-9]+)px$/;Kh.default=new Kg.Type("IntFromPixels",Kg.Int.is,(t,n)=>(0,$t.pipe)(Kg.string.validate(t,n),(0,Kr.chain)(r=>{try{let i=r.match(Ky);if(!i)return Kg.failure(t,n);let o=parseInt(i[1]);return Kg.success(o)}catch{return Kg.failure(t,n)}})),String);var Kv={};Object.defineProperty(Kv,"__esModule",{value:!0});let Kb=nX,Kx=(0,Kb.__importStar)(V2);Kv.default=(0,$e.withCustomError)((0,$e.refineType)(Kx.string,"nonEmptyString",t=>t.trim().length>0),()=>"The value must be a non-empty string");var K_={},KS={};Object.defineProperty(KS,"__esModule",{value:!0});let KT=nX,Kw=(0,KT.__importStar)(V2);KS.default=(0,$e.nullable)(Kw.string),Object.defineProperty(K_,"__esModule",{value:!0});let KO=nX,Kk=(0,KO.__importDefault)(KS);K_.default=new V2.Type("nonEmptyStringOrNull",t=>"string"==typeof t||null===t,(t,n)=>(0,$t.pipe)(Kk.default.validate(t,n),(0,Kr.chain)(t=>"string"==typeof t&&t.length>0?(0,V2.success)(t):(0,V2.success)(null))),t=>t);var KC={};Object.defineProperty(KC,"__esModule",{value:!0});let KI=nX,KM=(0,KI.__importStar)(V2);KC.default=(0,$e.nullable)(KM.number);var KR={};Object.defineProperty(KR,"__esModule",{value:!0});let KE=nX,Kj=(0,KE.__importStar)(V2);KR.default=(t,n,r)=>q7.Number.pipe(new Kj.Type("numberInRange",t=>q7.Number.is(t),(i,o)=>i>n||i<t?Kj.failure(i,o,`${r} must be a number between ${t} and ${n}`):Kj.success(i),Kj.identity));var KA={};Object.defineProperty(KA,"__esModule",{value:!0});let KN=nX,KP=(0,KN.__importStar)(V2);KA.default=new KP.Type("StringFromInt",KP.string.is,(t,n)=>(0,$t.pipe)(KP.boolean.validate(t,n),(0,Kr.chain)(t=>KP.success(t.toString()))),t=>t);var KL={};Object.defineProperty(KL,"__esModule",{value:!0});let KD=nX,KF=(0,KD.__importStar)(V2);function KW(){return H7||(H7=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=nX;(0,n.__exportStar)(q7,t);var r=function(){if(H8)return Kn;H8=1,Object.defineProperty(Kn,"__esModule",{value:!0});let t=nX,n=(0,t.__importStar)(V2),r=KW();return Kn.default=new n.Type("dateFromString",t=>t instanceof Date,(t,i)=>(0,$t.pipe)(r.String.validate(t,i),(0,Kr.chain)(r=>{let o=new Date(r);return isNaN(o.getTime())?n.failure(t,i):n.success(o)})),t=>t.toISOString()),Kn}();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)(Ki).default}}),Object.defineProperty(t,"DateFromTsMs",{enumerable:!0,get:function(){return(0,n.__importDefault)(Ku).default}}),(0,n.__exportStar)(Kc,t),t.Function=(0,n.__importStar)($e),Object.defineProperty(t,"IntFromNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(Kd).default}}),Object.defineProperty(t,"IntFromPixels",{enumerable:!0,get:function(){return(0,n.__importDefault)(Kh).default}}),Object.defineProperty(t,"NonEmptyString",{enumerable:!0,get:function(){return(0,n.__importDefault)(Kv).default}}),Object.defineProperty(t,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(K_).default}}),Object.defineProperty(t,"NumberOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(KC).default}}),Object.defineProperty(t,"NumberRange",{enumerable:!0,get:function(){return(0,n.__importDefault)(KR).default}}),Object.defineProperty(t,"StringFromBoolean",{enumerable:!0,get:function(){return(0,n.__importDefault)(KA).default}}),Object.defineProperty(t,"StringFromNumber",{enumerable:!0,get:function(){return(0,n.__importDefault)(KL).default}}),Object.defineProperty(t,"StringOrNull",{enumerable:!0,get:function(){return(0,n.__importDefault)(KS).default}})}(q8)),q8}KL.default=new KF.Type("StringFromInt",KF.string.is,(t,n)=>(0,$t.pipe)(KF.number.validate(t,n),(0,Kr.chain)(t=>KF.success(t.toString()))),t=>t);var KU={},Kz={},KB={},KV={},K$={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanField=t.BooleanConfig=t.BooleanFieldType=void 0;let n=(0,nX.__importStar)(V2),r=KW();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})]))}(K$);var Kq={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Color=t.ColorConfig=t.ColorFieldType=void 0;let n=(0,nX.__importStar)(V2),r=KW();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})]))}(Kq);var KK={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Date=t.DateConfig=t.DateFieldType=void 0;let n=(0,nX.__importStar)(V2),r=KW();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})]))}(KK);var KH={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Embed=t.EmbedConfig=t.EmbedFieldType=void 0;let n=(0,nX.__importStar)(V2),r=KW();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})]))}(KH);var KG={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPoint=t.GeoPointConfig=t.GeoPointFieldType=void 0;let n=(0,nX.__importStar)(V2),r=KW();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})]))}(KG);var KZ={},KY={},KJ={},KQ={},KX={};Object.defineProperty(KX,"__esModule",{value:!0}),KX.pipe=KX.pipeable=void 0,KX.pipeable=function(t){var n,r,i,o,a,u,s,l,c,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 _=function(n){return function(r){return t.ap(r,n)}},S=function(n){return function(r){return t.ap(t.map(r,function(t){return function(){return t}}),n)}};y.ap=_,y.apFirst=S,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 T=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})})}},O=function(n){return t.chain(n,UY.identity)};y.chain=T,y.chainFirst=w,y.flatten=O}if("function"==typeof t.bimap){var k=function(n,r){return function(i){return t.bimap(i,n,r)}},C=function(n){return function(r){return t.mapLeft(r,n)}};y.bimap=k,y.mapLeft=C}if("function"==typeof t.extend){var I=function(n){return function(r){return t.extend(r,n)}},M=function(n){return t.extend(n,UY.identity)};y.extend=I,y.duplicate=M}if("function"==typeof t.reduce){var R=function(n,r){return function(i){return t.reduce(i,n,r)}},E=function(n){var r=t.foldMap(n);return function(t){return function(n){return r(n,t)}}},j=function(n,r){return function(i){return t.reduceRight(i,n,r)}};y.reduce=R,y.foldMap=E,y.reduceRight=j}if("function"==typeof t.reduceWithIndex){var A=function(n,r){return function(i){return t.reduceWithIndex(i,n,r)}},N=function(n){var r=t.foldMapWithIndex(n);return function(t){return function(n){return r(n,t)}}},P=function(n,r){return function(i){return t.reduceRightWithIndex(i,n,r)}};y.reduceWithIndex=A,y.foldMapWithIndex=N,y.reduceRightWithIndex=P}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 D=function(n){return function(r){return t.filter(r,n)}},F=function(n){return function(r){return t.filterMap(r,n)}},W=function(n){return function(r){return t.partition(r,n)}},U=function(n){return function(r){return t.partitionMap(r,n)}};y.filter=D,y.filterMap=F,y.partition=W,y.partitionMap=U}if("function"==typeof t.filterWithIndex){var z=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=z,y.filterMapWithIndex=B,y.partitionWithIndex=V,y.partitionMapWithIndex=$}if("function"==typeof t.promap){var q=function(n,r){return function(i){return t.promap(i,n,r)}};y.promap=q}if("function"==typeof t.compose){var K=function(n){return function(r){return t.compose(r,n)}};y.compose=K}if("function"==typeof t.throwError){var H=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))}},Y=function(n,r){return function(i){return t.chain(i,function(i){return n(i)?t.of(i):t.throwError(r(i))})}};y.fromOption=H,y.fromEither=G,y.fromPredicate=Z,y.filterOrElse=Y}return y},KX.pipe=UY.pipe;var K0=k&&k.__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]}),K1=k&&k.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),K2=k&&k.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&K0(n,t,r);return K1(n,t),n};Object.defineProperty(KQ,"__esModule",{value:!0}),KQ.NumberFromString=void 0;var K3=K2(V2);KQ.NumberFromString=new K3.Type("NumberFromString",K3.number.is,function(t,n){return KX.pipe(K3.string.validate(t,n),UH.chain(function(r){var i=+r;return isNaN(i)||""===r.trim()?K3.failure(t,n):K3.success(i)}))},String);var K4=k&&k.__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]}),K5=k&&k.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),K6=k&&k.__importStar||function(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&K4(n,t,r);return K5(n,t),n};Object.defineProperty(KJ,"__esModule",{value:!0}),KJ.IntFromString=void 0;var K9=K6(V2);KJ.IntFromString=new K9.Type("IntFromString",K9.Int.is,function(t,n){return KX.pipe(KQ.NumberFromString.validate(t,n),UH.chain(function(r){return K9.Int.is(r)?K9.success(r):K9.failure(t,n)}))},KQ.NumberFromString.encode),Object.defineProperty(KY,"__esModule",{value:!0});let K8=nX,K7=(0,K8.__importStar)(V2),He=KW(),Ht=new K7.Type("SideConstraints",t=>!t||"number"==typeof t,(t,n)=>UH.either.chain(K7.union([K7.literal("auto"),K7.literal(""),K7.Int,KJ.IntFromString,He.IntFromNumber,He.IntFromPixels,K7.null]).validate(t,n),t=>"auto"===t||""===t?K7.success(null):K7.success(t)),t=>t),Hn=K7.partial({width:Ht,height:Ht});KY.default=Hn,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Image=t.ImageConfig=t.Thumbnail=t.ImageFieldType=void 0;let n=nX,r=(0,n.__importStar)(V2),i=KW(),o=(0,n.__importDefault)(KY);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})]))}(KZ);var Hr={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationField=t.IntegrationFieldConfig=t.IntegrationFieldType=void 0;let n=(0,nX.__importStar)(V2),r=KW();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})]))}(Hr);var Hi={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Link=t.LinkConfig=t.LinkFieldType=void 0;let n=nX,r=(0,n.__importStar)(V2),i=KW(),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)=>UH.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,qJ.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})]))}(Hi);var Ho={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Number=t.NumberConfig=t.NumberFieldType=void 0;let n=(0,nX.__importStar)(V2),r=KW();t.NumberFieldType="Number",t.NumberConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,min:n.union([n.number,KQ.NumberFromString]),max:n.union([n.number,KQ.NumberFromString]),step:n.union([n.number,KQ.NumberFromString])})),t.Number=n.exact(n.intersection([n.type({type:n.literal(t.NumberFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.NumberConfig})]))}(Ho);var Ha={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Range=t.RangeConfig=t.RangeFieldType=void 0;let n=(0,nX.__importStar)(V2),r=KW();t.RangeFieldType="Range",t.RangeConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,min:n.union([n.number,KQ.NumberFromString]),max:n.union([n.number,KQ.NumberFromString]),step:n.union([n.number,KQ.NumberFromString])})),t.Range=n.exact(n.intersection([n.type({type:n.literal(t.RangeFieldType)}),n.partial({fieldset:r.StringOrNull,config:t.RangeConfig})]))}(Ha);var Hu={};!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=nX,r=(0,n.__importStar)(V2),i=KW(),o=(0,n.__importDefault)(KY);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,UY.pipe)(r.union([r.string,r.null]).decode(n),UK.either.map(n=>{if(!n)return t.DEFAULT_OPTION;let r=n.split(",").map(t=>t.trim()).filter(n=>(0,UH.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)}},l=t=>{if(t instanceof Array&&t.reduce((t,n)=>t&&"string"==typeof n,!0))return r.success(t)},c=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,UY.pipe)(r.union([i,o,r.string,r.null]).decode(t),UK.either.chain(i=>u(i)||l(i)||s(i)||c(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})]))}(Hu);var Hs={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Select=t.SelectConfig=t.SelectFieldType=void 0;let n=(0,nX.__importStar)(V2),r=KW();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})]))}(Hs);var Hl={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Separator=t.SeparatorConfig=t.SeparatorFieldType=void 0;let n=(0,nX.__importStar)(V2),r=KW();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})]))}(Hl);var Hc={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Text=t.TextConfig=t.TextFieldType=void 0;let n=(0,nX.__importStar)(V2),r=KW();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})]))}(Hc);var Hd={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Timestamp=t.TimestampConfig=t.TimestampFieldType=void 0;let n=(0,nX.__importStar)(V2),r=KW();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})]))}(Hd),Object.defineProperty(KV,"__esModule",{value:!0}),KV.NestableWidget=void 0;let Hf=nX,Hp=(0,Hf.__importStar)(V2);KV.NestableWidget=Hp.union([Kq.Color,K$.BooleanField,KH.Embed,KG.GeoPoint,KK.Date,Ho.Number,Ha.Range,Hu.RichText,Hs.Select,Hl.Separator,Hc.Text,Hd.Timestamp,Hi.Link,KZ.Image,Hr.IntegrationField]),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Group=t.GroupConfig=t.GroupFieldType=void 0;let n=(0,nX.__importStar)(V2),r=KW();t.GroupFieldType="Group",t.GroupConfig=n.exact(n.partial({label:r.StringOrNull,repeat:n.boolean,fields:n.record(V4.WidgetKey,KV.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})]))}(KB);var Hh={};!function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nX;(0,n.__exportStar)(K$,t),(0,n.__exportStar)(Kq,t),(0,n.__exportStar)(KK,t),(0,n.__exportStar)(KH,t),(0,n.__exportStar)(KG,t),(0,n.__exportStar)(KZ,t),(0,n.__exportStar)(Hr,t),(0,n.__exportStar)(Hi,t),(0,n.__exportStar)(KV,t),(0,n.__exportStar)(Ho,t),(0,n.__exportStar)(Ha,t),(0,n.__exportStar)(Hu,t),(0,n.__exportStar)(Hs,t),(0,n.__exportStar)(Hl,t),(0,n.__exportStar)(Hc,t),(0,n.__exportStar)(Hd,t)}(Hh);var Hm={},Hg={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isCompositeSlice=t.CompositeSlice=t.CompositeSliceConfig=t.CompositeSliceType=void 0;let n=(0,nX.__importStar)(V2),r=KW();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(V4.WidgetKey,KV.NestableWidget),repeat:n.record(V4.WidgetKey,KV.NestableWidget),config:t.CompositeSliceConfig})])),t.isCompositeSlice=function(t){return"Slice"===t.type}}(Hg);var Hy={};Object.defineProperty(Hy,"__esModule",{value:!0}),Hy.isLegacySlice=Hy.LegacySlice=void 0;let Hv=nX,Hb=(0,Hv.__importStar)(V2);Hy.LegacySlice=Hb.union([KV.NestableWidget,KB.Group]),Hy.isLegacySlice=function(t){return"Slice"!==t.type&&"SharedSlice"!==t.type};var Hx={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.isDynamicSharedSlice=t.isStaticSharedSlice=t.SharedSlice=t.SharedSliceType=t.Variation=void 0;let n=(0,nX.__importStar)(V2);t.Variation=n.exact(n.intersection([n.type({id:n.string,name:n.string,description:n.string,imageUrl:(0,qJ.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(V4.WidgetKey,KV.NestableWidget),items:n.record(V4.WidgetKey,KV.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}}(Hx);var H_={};Object.defineProperty(H_,"__esModule",{value:!0}),H_.SharedSliceRef=void 0;let HS=nX,HT=(0,HS.__importStar)(V2);H_.SharedSliceRef=HT.exact(HT.type({type:HT.literal(Hx.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,nX.__importStar)(V2),r=KW();function i(i){return n.exact(n.partial({label:r.StringOrNull,labels:t.SlicesLabels,choices:n.record(V4.WidgetKey,n.union([Hy.LegacySlice,Hg.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(Hx.SharedSlice),t.DynamicSlicesConfig=i(H_.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}}(Hm);var Hw={};!function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UID=t.UIDConfig=t.UIDFieldType=void 0;let n=(0,nX.__importStar)(V2),r=KW();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})]))}(Hw),Object.defineProperty(Kz,"__esModule",{value:!0}),Kz.Widgets=Kz.FieldType=Kz.DynamicWidget=Kz.StaticWidget=Kz.widgetReader=void 0;let HO=nX,Hk=(0,HO.__importStar)(V2);function HC(t){return Hk.union([Hw.UID,KV.NestableWidget,KB.Group,t])}Kz.widgetReader=HC,Kz.StaticWidget=HC(Hm.StaticSlices),Kz.DynamicWidget=HC(Hm.DynamicSlices),Kz.FieldType=Hk.keyof({[Hh.ColorFieldType]:null,[Hh.BooleanFieldType]:null,[Hh.NumberFieldType]:null,[Hh.EmbedFieldType]:null,[Hh.GeoPointFieldType]:null,[Hh.DateFieldType]:null,[Hh.RangeFieldType]:null,[Hh.RichTextFieldType]:null,[Hh.SelectFieldType]:null,[Hh.SeparatorFieldType]:null,[Hh.TextFieldType]:null,[Hh.TimestampFieldType]:null,[Hh.LinkFieldType]:null,[Hh.ImageFieldType]:null,[Hh.IntegrationFieldType]:null,[Hw.UIDFieldType]:null,[KB.GroupFieldType]:null,[Hm.SlicesFieldType]:null,[Hm.LegacySlicesFieldType]:null}),Kz.Widgets={toStatic(t,n){switch(t.type){case"Choice":case"Slices":return Hm.Slices.toStatic(t,n);default:return t}}},Object.defineProperty(KU,"__esModule",{value:!0}),KU.Sections=KU.DynamicSection=KU.StaticSection=KU.sectionReader=void 0;let HI=nX,HM=(0,HI.__importStar)(V2);function HR(t){return HM.record(V4.WidgetKey,t)}KU.sectionReader=HR,KU.StaticSection=HR(Kz.StaticWidget),KU.DynamicSection=HR(Kz.DynamicWidget),KU.Sections={toStatic:(t,n)=>Object.entries(t).reduce((t,[r,i])=>({...t,[r]:Kz.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=nX,r=(0,n.__importStar)(V2),i=KW();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,qJ.withFallback)(r.boolean,!0),json:r.record(r.string,n),status:(0,qJ.withFallback)(r.boolean,!0)}),r.partial({hash:r.string,format:(0,qJ.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(KU.StaticSection),t.CustomType=a(KU.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]:KU.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,UH.left)(new o(r)):(0,UH.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},{})}}(qY);var HE,Hj,HA={},HN={};Object.defineProperty(HE=HN,"__esModule",{value:!0}),HE.DiffOperation=void 0,(Hj=HE.DiffOperation||(HE.DiffOperation={})).Added="added",Hj.Removed="removed",Hj.Updated="updated";var HP={},HL={},HD={};Object.defineProperty(HD,"__esModule",{value:!0}),HD.HexaColor=void 0;let HF=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;HD.HexaColor={is:t=>HF.test(t)};var HW={};Object.defineProperty(HW,"__esModule",{value:!0}),HW.toRecord=void 0,HW.toRecord=function(t,n){return t.reduce((t,r)=>{let i=n(r);return{...t,[i]:r}},{})};var HU={};Object.defineProperty(HU,"__esModule",{value:!0}),HU.mapValues=HU.isObject=HU.withOptionals=HU.isNotEmpty=HU.zipObjects=void 0;let Hz=nX,HB=(0,Hz.__importStar)(V2);HU.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}}},{})},HU.isNotEmpty=function(t){return Boolean(Object.keys(t).length)},HU.withOptionals=function(t,n){return{...t,...n.reduce((t,[n,r])=>r?{...t,[n]:r}:t,{})}};let HV=HB.record(HB.string,HB.unknown);HU.isObject=function(t){return(0,UH.isRight)(HV.decode(t))},HU.mapValues=function(t,n){return Object.entries(t).reduce((t,[r,i])=>({...t,[r]:n(i,r)}),{})},Object.defineProperty(HL,"__esModule",{value:!0}),HL.Objects=HL.Arrays=HL.HexaColorCode=void 0;let H$=nX;HL.HexaColorCode=(0,H$.__importStar)(HD),HL.Arrays=(0,H$.__importStar)(HW),HL.Objects=(0,H$.__importStar)(HU);var Hq={};function HK(t,n){let r=HL.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:HN.DiffOperation.Removed}:!(null!=r&&r.left)&&null!=r&&r.right?{op:HN.DiffOperation.Added,value:r.right}:{op:HN.DiffOperation.Updated,value:r.right}})();return i?{...t,[n]:i}:t},{});return HL.Objects.isNotEmpty(i)?i:void 0}Object.defineProperty(Hq,"__esModule",{value:!0}),Hq.VariationComparator=void 0,Hq.VariationComparator={compare(t,n){if(t&&!n)return{op:HN.DiffOperation.Removed};if(!t&&n)return{op:HN.DiffOperation.Added,value:n};let r=function(t,n){let r=HL.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=HK(null==t?void 0:t.primary,null==n?void 0:n.primary),o=HK(null==t?void 0:t.items,null==n?void 0:n.items),a={...r,...i?{primary:i}:{},...o?{items:o}:{}};if(HL.Objects.isNotEmpty(a))return{op:HN.DiffOperation.Updated,value:a}}},Object.defineProperty(HP,"__esModule",{value:!0}),HP.SliceComparator=void 0,HP.SliceComparator={compare(t,n){if(!t&&n)return{op:HN.DiffOperation.Added,value:n};if(t&&!n)return{op:HN.DiffOperation.Removed};let r=function(t,n){let r=HL.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=HL.Objects.zipObjects(t&&HL.Arrays.toRecord(t.variations,t=>t.id),n&&HL.Arrays.toRecord(n.variations,t=>t.id)),o=Object.entries(i).reduce((t,[n,r])=>{if(!r)return t;let i=Hq.VariationComparator.compare(r.left,r.right);return i?{...t,[n]:i}:t},{}),a={...r,...HL.Objects.isNotEmpty(o)?{variations:o}:{}};if(HL.Objects.isNotEmpty(a))return{op:HN.DiffOperation.Updated,value:a}}},function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nX;(0,n.__exportStar)(HN,t),(0,n.__exportStar)(HP,t),(0,n.__exportStar)(Hq,t)}(HA);var HH,HG,HZ={},HY={};HH=HY,HG=k&&k.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Object.defineProperty(HH,"__esModule",{value:!0}),HH.ImageConstraint=void 0,Object.defineProperty(HH,"ImageConstraint",{enumerable:!0,get:function(){return HG(KY).default}});var HJ={},HQ={};Object.defineProperty(HQ,"__esModule",{value:!0});var HX={};Object.defineProperty(HX,"__esModule",{value:!0}),HX.SlicesTypes=void 0;let H0=nX,H1=(0,H0.__importStar)(V2);HX.SlicesTypes=H1.keyof({[Hg.CompositeSliceType]:null,[Hx.SharedSliceType]:null}),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nX;(0,n.__exportStar)(Hg,t),(0,n.__exportStar)(Hy,t),(0,n.__exportStar)(Hx,t),(0,n.__exportStar)(H_,t),(0,n.__exportStar)(HQ,t),(0,n.__exportStar)(Hm,t),(0,n.__exportStar)(HX,t)}(HJ),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nX;(0,n.__exportStar)(KB,t),(0,n.__exportStar)(Hh,t),(0,n.__exportStar)(HY,t),(0,n.__exportStar)(HJ,t),(0,n.__exportStar)(Hw,t),(0,n.__exportStar)(Kz,t)}(HZ),function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nX;(0,n.__exportStar)(qY,t),(0,n.__exportStar)(HA,t),(0,n.__exportStar)(KU,t),(0,n.__exportStar)(HZ,t)}(qZ);var H2,H3,H4,H5,H6,H9,H8,H7,Ge,Gt={},Gn={},Gr={};function Gi(){if(Ge)return Gr;Ge=1,Object.defineProperty(Gr,"__esModule",{value:!0}),Gr.hasContentType=Gr.hasFieldContentType=void 0;let t=Zz();function n(t){return"object"==typeof t&&null!==t&&"__TYPE__"in t}return Gr.hasFieldContentType=function(r){return n(r)&&r.__TYPE__===t.FieldContentType&&(null==r?void 0:r.type)!==void 0&&"string"==typeof r.type&&(0,UH.isRight)(t.FieldType.decode(r.type))},Gr.hasContentType=n,Gr}function Go(){return Gd||(Gd=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyContent=t.EmptyLegacy=t.isEmptyContent=t.EmptyContentType=void 0;let n=nX,r=(0,n.__importStar)(V2),i=Gi();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,UY.pipe)(a.decode(r),UK.either.map(()=>({type:n,__TYPE__:t.EmptyContentType}))),()=>null);t.EmptyLegacy=u,t.EmptyContent=r.strict({type:r.string,__TYPE__:r.literal(t.EmptyContentType)})}(Gn)),Gn}var Ga={},Gu={};Object.defineProperty(Gu,"__esModule",{value:!0}),Gu.defaultCtx=Gu.getFieldCtx=Gu.LegacyContentCtx=Gu.FieldOrSliceType=void 0;let Gs=nX,Gl=(0,Gs.__importStar)(V2);Gu.FieldOrSliceType=Gl.union([HZ.FieldType,HZ.SlicesTypes]);class Gc{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)}}Gu.LegacyContentCtx=Gc,Gu.getFieldCtx=function(t,n,r){return new Gc(t,[...n.fieldPath,n.fieldKey,...r||[]],n.allTypes)},Gu.defaultCtx=function(t,n=new Map){return new Gc(t,[],n)};var Gd,Gf,Gp={},Gh={};function Gm(){return Gf||(Gf=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanContentDefaultValue=t.BooleanContent=t.BooleanLegacy=t.isBooleanContent=t.BooleanContentType=void 0;let n=nX,r=(0,n.__importStar)(V2),i=Gi();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,UY.pipe)(r.boolean.decode(n),UK.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}(Gh)),Gh}var Gg,Gy={};function Gv(){return Gg||(Gg=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmbedContent=t.EmbedLegacy=t.EmbedContentLegacy=t.isEmbedContent=t.EmbedContentType=void 0;let n=nX,r=(0,n.__importStar)(V2),i=KW(),o=Gi();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,UY.pipe)(t.EmbedContentLegacy.decode(n),UK.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})])}(Gy)),Gy}var Gb={},Gx={},G_={};Object.defineProperty(G_,"__esModule",{value:!0});let GS=nX,GT=(0,GS.__importStar)(V2);G_.default=new GT.Type("TrimmedString",GT.string.is,(t,n)=>(0,$t.pipe)(GT.string.validate(t,n),(0,Kr.chain)(t=>GT.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 Gw={};function GO(){return Gk||(Gk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContent=t.ColorLegacy=t.isColorContent=void 0;let n=nX,r=(0,n.__importStar)(V2),i=(0,n.__importDefault)(G_),o=Gi(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===Gw.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Color"===t.type;t.isColorContent=a;let u=n=>new r.Type("ColorLegacy",t.isColorContent,n=>(0,UY.pipe)(i.default.decode(n),UK.either.map(n=>t.ColorContent.encode({value:n,type:HZ.ColorFieldType,__TYPE__:Gw.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:HZ.ColorFieldType}}));t.ColorLegacy=u,t.ColorContent=r.strict({type:r.literal(HZ.ColorFieldType),value:i.default,__TYPE__:r.literal(Gw.FieldContentType)})}(Gx)),Gx}Object.defineProperty(Gw,"__esModule",{value:!0}),Gw.FieldContentType=void 0,Gw.FieldContentType="FieldContent";var Gk,GC,GI={};function GM(){return GC||(GC=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DateContent=t.DateLegacy=t.isDateContent=void 0;let n=nX,r=(0,n.__importStar)(V2),i=(0,n.__importDefault)(G_),o=Gi(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===Gw.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Date"===t.type;t.isDateContent=a;let u=n=>new r.Type("DateLegacy",t.isDateContent,n=>(0,UY.pipe)(i.default.decode(n),UK.either.map(n=>t.DateContent.encode({value:n,type:HZ.DateFieldType,__TYPE__:Gw.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:HZ.DateFieldType}}));t.DateLegacy=u,t.DateContent=r.strict({type:r.literal(HZ.DateFieldType),value:i.default,__TYPE__:r.literal(Gw.FieldContentType)})}(GI)),GI}var GR,GE={};function Gj(){return GR||(GR=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NumberContent=t.NumberLegacy=t.isNumberContent=void 0;let n=nX,r=(0,n.__importStar)(V2),i=(0,n.__importDefault)(G_),o=Gi(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===Gw.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Number"===t.type;t.isNumberContent=a;let u=n=>new r.Type("NumberLegacy",t.isNumberContent,n=>(0,UY.pipe)(i.default.decode(n),UK.either.map(n=>t.NumberContent.encode({value:n,type:HZ.NumberFieldType,__TYPE__:Gw.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:HZ.NumberFieldType}}));t.NumberLegacy=u,t.NumberContent=r.strict({type:r.literal(HZ.NumberFieldType),value:i.default,__TYPE__:r.literal(Gw.FieldContentType)})}(GE)),GE}var GA,GN={};function GP(){return GA||(GA=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RangeContent=t.RangeLegacy=t.isRangeContent=void 0;let n=nX,r=(0,n.__importStar)(V2),i=(0,n.__importDefault)(G_),o=Gi(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===Gw.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Range"===t.type;t.isRangeContent=a;let u=n=>new r.Type("RangeLegacy",t.isRangeContent,n=>(0,UY.pipe)(i.default.decode(n),UK.either.map(n=>t.RangeContent.encode({value:n,type:HZ.RangeFieldType,__TYPE__:Gw.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:HZ.RangeFieldType}}));t.RangeLegacy=u,t.RangeContent=r.strict({type:r.literal(HZ.RangeFieldType),value:i.default,__TYPE__:r.literal(Gw.FieldContentType)})}(GN)),GN}var GL,GD={};function GF(){return GL||(GL=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectContentDefaultValue=t.SelectContent=t.SelectLegacy=t.isSelectContent=void 0;let n=nX,r=(0,n.__importStar)(V2),i=(0,n.__importDefault)(G_),o=Gi(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===Gw.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Select"===t.type;t.isSelectContent=a;let u=n=>new r.Type("SelectLegacy",t.isSelectContent,n=>(0,UY.pipe)(i.default.decode(n),UK.either.map(n=>t.SelectContent.encode({value:n,type:HZ.SelectFieldType,__TYPE__:Gw.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:HZ.SelectFieldType}}));t.SelectLegacy=u,t.SelectContent=r.strict({type:r.literal(HZ.SelectFieldType),value:i.default,__TYPE__:r.literal(Gw.FieldContentType)});let s=t=>{var n;return!(null===(n=t.config)||void 0===n)&&n.default_value?{__TYPE__:Gw.FieldContentType,type:HZ.SelectFieldType,value:t.config.default_value||""}:void 0};t.SelectContentDefaultValue=s}(GD)),GD}var GW,GU={};function Gz(){return GW||(GW=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TextContent=t.TextLegacy=t.isTextContent=void 0;let n=nX,r=(0,n.__importStar)(V2),i=(0,n.__importDefault)(G_),o=Gi(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===Gw.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Text"===t.type;t.isTextContent=a;let u=n=>new r.Type("TextLegacy",t.isTextContent,n=>(0,UY.pipe)(i.default.decode(n),UK.either.map(n=>t.TextContent.encode({value:n,type:HZ.TextFieldType,__TYPE__:Gw.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:HZ.TextFieldType}}));t.TextLegacy=u,t.TextContent=r.strict({type:r.literal(HZ.TextFieldType),value:i.default,__TYPE__:r.literal(Gw.FieldContentType)})}(GU)),GU}var GB,GV={};function G$(){return GB||(GB=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TimestampContent=t.TimestampLegacy=t.isTimestampContent=void 0;let n=nX,r=(0,n.__importStar)(V2),i=(0,n.__importDefault)(G_),o=Gi(),a=t=>(0,o.hasContentType)(t)&&t.__TYPE__===Gw.FieldContentType&&(0,o.hasFieldContentType)(t)&&"Timestamp"===t.type;t.isTimestampContent=a;let u=n=>new r.Type("TimestampLegacy",t.isTimestampContent,n=>(0,UY.pipe)(i.default.decode(n),UK.either.map(n=>t.TimestampContent.encode({value:n,type:HZ.TimestampFieldType,__TYPE__:Gw.FieldContentType}))),t=>({content:t.value,types:{[n.keyOfType]:HZ.TimestampFieldType}}));t.TimestampLegacy=u,t.TimestampContent=r.strict({type:r.literal(HZ.TimestampFieldType),value:i.default,__TYPE__:r.literal(Gw.FieldContentType)})}(GV)),GV}function Gq(){return GK||(GK=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FieldContent=t.FieldType=void 0;let n=nX,r=(0,n.__importStar)(V2),i=GO(),o=GM(),a=Gj(),u=GP(),s=GF(),l=Gz(),c=G$();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,l.TextContent,c.TimestampContent]),(0,n.__exportStar)(GO(),t),(0,n.__exportStar)(Gw,t),(0,n.__exportStar)(GM(),t),(0,n.__exportStar)(Gj(),t),(0,n.__exportStar)(GP(),t),(0,n.__exportStar)(GF(),t),(0,n.__exportStar)(Gz(),t),(0,n.__exportStar)(G$(),t)}(Gb)),Gb}var GK,GH,GG={};function GZ(){return GH||(GH=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPointContent=t.GeoPointLegacy=t.isGeoPointContent=t.GeoPointContentType=void 0;let n=nX,r=(0,n.__importStar)(V2),i=Gi();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,$t.pipe)(a.decode(n),UK.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)})])}(GG)),GG}var GY,GJ={};function GQ(){return GY||(GY=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageContent=t.ImageLegacy=t.ImageContentView=t.isImageContent=t.ImageContentType=void 0;let n=nX,r=(0,n.__importStar)(V2),i=KW(),o=Gi();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)})]),l=n=>new r.Type("ImageLegacy",t.isImageContent,n=>(0,UY.pipe)(s.decode(n),UK.either.map(n=>t.ImageContent.encode({...n,__TYPE__:t.ImageContentType}))),t=>({content:(0,HU.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=l,t.ImageContent=r.intersection([s,r.strict({__TYPE__:r.literal(t.ImageContentType)})])}(GJ)),GJ}var GX,G0={};function G1(){return GX||(GX=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationFieldContent=t.IntegrationFieldLegacy=t.isIntegrationFieldContent=t.IntegrationFieldContentType=void 0;let n=nX,r=(0,n.__importStar)(V2),i=Gi();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,UY.pipe)(r.string.decode(n),UK.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})}(G0)),G0}var G2,G3={};function G4(){return G2||(G2=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=nX,r=(0,n.__importStar)(V2),i=KW(),o=Gi();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,UY.pipe)(a.decode(n),UK.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,qB.withFallback)(r.string,"0")}),r.partial({date:(0,$e.nullable)(r.string)})])),l=new r.Type("FileLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.FileLinkType,n=>(0,UY.pipe)(s.decode(n),UK.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,qB.withFallback)(r.string,"0")})]))]),t.DocumentLinkType="DocumentLink";let c=r.strict({id:i.NonEmptyString}),d=new r.Type("DocumentLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.DocumentLinkType,n=>(0,UY.pipe)(c.decode(n),UK.either.map(n=>t.DocumentLinkContent.encode({...n,__TYPE__:t.DocumentLinkType}))),t=>c.encode(t));t.DocumentLinkContent=r.intersection([r.strict({__TYPE__:r.literal(t.DocumentLinkType)}),c]),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,$e.nullable)(r.partial({title:r.string}))})])),p=new r.Type("ExternalLink",n=>(0,o.hasContentType)(n)&&n.__TYPE__===t.ExternalLinkType,n=>(0,UY.pipe)(f.decode(n),UK.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,l,d,p]);let m=n=>new r.Type("LinkLegacy",t.isLinkContent,n=>(0,UY.pipe)(t.LinkLegacy.decode(n),UK.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})}(G3)),G3}var G5,G6={},G9={},G8={};function G7(){return G5||(G5=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=nX,r=(0,n.__importStar)(V2),i=KW(),o=Gv(),a=GQ(),u=G4(),s=t=>r.strict({data:t,start:r.number,end:r.number,type:r.literal(Hh.RichTextNodeType.hyperlink)}),l=r.strict({data:(0,qB.withFallback)(r.string,""),start:r.number,end:r.number,type:r.literal("label")}),c=r.strict({start:r.number,end:r.number,type:r.keyof({[Hh.RichTextNodeType.strong]:null,[Hh.RichTextNodeType.em]:null,"list-item":null})});t.Span=r.union([s(u.Link),l,c]),t.SpanLegacy=r.union([s(u.LinkLegacy),l,c]);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,UH.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(Hh.RichTextNodeType.image),data:r.intersection([a.ImageContentView,r.partial({linkTo:(0,$e.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===Hh.RichTextNodeType.image};let h=r.exact(r.intersection([r.type({type:r.literal(Hh.RichTextNodeType.embed),data:r.unknown}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})])),m=new r.Type("EmbedBlockLegacy",t=>"embed"===t.type,n=>(0,UY.pipe)(h.decode(n),UK.either.chain(t=>UK.either.map(n=>[t,n])(o.EmbedContentLegacy.decode(t.data))),UK.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(Hh.RichTextNodeType.embed),data:o.EmbedContent}),r.partial({label:i.StringOrNull,direction:i.StringOrNull})])),t.checkEmbedBlock=function(t){return t.type===Hh.RichTextNodeType.embed};let g=n=>r.exact(r.intersection([r.type({type:(0,$e.refineType)(Hh.RichTextNodeTypeCodec,`string which isn't ${Hh.RichTextNodeType.image} ${Hh.RichTextNodeType.embed}`,t=>t!==Hh.RichTextNodeType.image&&t!==Hh.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])}(G8)),G8}function Ze(){return Zt||(Zt=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RichTextLegacy=t.RichTextContent=t.isRichTextContent=t.RichTextContentType=void 0;let n=nX,r=(0,n.__importStar)(V2),i=Gi(),o=G7();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)(G7(),t);let s=n=>new r.Type("RichTextLegacy",t.isRichTextContent,n=>(0,UY.pipe)(u.decode(n),UK.either.map(n=>({value:n,__TYPE__:t.RichTextContentType}))),t=>({content:u.encode(t.value),types:{[n.keyOfType]:"StructuredText"}}));t.RichTextLegacy=s}(G9)),G9}var Zt,Zn,Zr={};function Zi(){return Zn||(Zn=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SeparatorContent=t.SeparatorLegacy=t.isSeparatorContent=t.SeparatorContentType=void 0;let n=(0,nX.__importStar)(V2),r=Gi();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)})}(Zr)),Zr}function Zo(){return Zu||(Zu=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nX;(0,n.__exportStar)(Gm(),t),(0,n.__exportStar)(Gv(),t),(0,n.__exportStar)(Gq(),t),(0,n.__exportStar)(GZ(),t),(0,n.__exportStar)(GQ(),t),(0,n.__exportStar)(G1(),t),(0,n.__exportStar)(G4(),t),(0,n.__exportStar)(function(){if(Za)return G6;Za=1,Object.defineProperty(G6,"__esModule",{value:!0}),G6.NestableLegacy=G6.isNestableContent=G6.NestableContentDefaultValue=G6.NestableContent=void 0;let t=nX,n=(0,t.__importStar)(V2),r=Go(),i=Gm(),o=Gv(),a=Gq(),u=GZ(),s=GQ(),l=G1(),c=G4(),d=Ze(),f=Zi();G6.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,l.IntegrationFieldContent,c.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}};G6.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,l.isIntegrationFieldContent)(t)||(0,c.isLinkContent)(t)||(0,f.isSeparatorContent)(t)||(0,r.isEmptyContent)(t);G6.isNestableContent=h;let m=t=>({decode(n){if(!t.fieldType)return;let p=(0,r.EmptyLegacy)(t.fieldType).decode(n);if((0,UH.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,l.IntegrationFieldLegacy)(t);case"Link":return(0,c.LinkContentLegacy)(t);case"Separator":return(0,f.SeparatorLegacy)(t);default:return}})();if(h)return h.decode(n)},encode(n){switch(n.__TYPE__){case Gw.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 l.IntegrationFieldContentType:return(0,l.IntegrationFieldLegacy)(t).encode(n);case c.LinkContentType:return(0,c.LinkContentLegacy)(t).encode(n);case f.SeparatorContentType:return(0,f.SeparatorLegacy)(t).encode(n);default:return}}});return G6.NestableLegacy=m,G6}(),t),(0,n.__exportStar)(Ze(),t),(0,n.__exportStar)(Zi(),t)}(Gp)),Gp}var Za,Zu,Zs,Zl={};function Zc(){if(Zs)return Zl;Zs=1,Object.defineProperty(Zl,"__esModule",{value:!0}),Zl.repeatableContentWithDefaultNestableContentValues=Zl.withDefaultNestableContentValues=void 0;let t=Zo();return Zl.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)},Zl.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))},Zl}function Zd(){return Zf||(Zf=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=nX,r=(0,n.__importStar)(V2),i=Gi(),o=Zo(),a=Zc();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,UY.pipe)(u.decode(r),UK.either.map(r=>({value:Object.entries(r).reduce((t,[r,i])=>{let a=(0,Gu.getFieldCtx)(r,n),u=(0,o.NestableLegacy)(a).decode(i);return!u||(0,UH.isLeft)(u)?t:[...t,[r,u.right]]},[]),__TYPE__:t.GroupItemContentType}))),t=>t.value.reduce((t,[r,i])=>{let a=(0,Gu.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 l=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,UY.pipe)(i.decode(n),UK.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=l,t.GroupContentType="GroupContentType";let c=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],l=i({path:u.concat([{key:r,type:"Widget"}]),key:r,apiId:r,model:s,content:a});return l&&(0,o.isNestableContent)(l)?t.concat([[r,l]]):t},[]);return{__TYPE__:r.__TYPE__,value:s}})}t.isGroupContent=c,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}(Ga)),Ga}var Zf,Zp,Zh={},Zm={},Zg={},Zy={};function Zv(){if(Zp)return Zy;Zp=1,Object.defineProperty(Zy,"__esModule",{value:!0}),Zy.RepeatableWidgets=Zy.RepeatableWidgetsLegacy=void 0;let t=(0,nX.__importStar)(V2),n=Zd(),r=Zo(),i=r=>t.array((0,n.GroupItemLegacy)(r));Zy.RepeatableWidgetsLegacy=i;let o=t.tuple([t.string,r.NestableContent]),a=t.strict({__TYPE__:t.literal(n.GroupItemContentType),value:t.array(o)});return Zy.RepeatableWidgets=t.array(a),Zy}function Zb(){return Zx||(Zx=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=nX,r=(0,n.__importStar)(V2),i=Gi(),o=Zd(),a=Zo(),u=Zc(),s=Zv();t.CompositeSliceContentType="CompositeSliceContent";let l=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.CompositeSliceContentType;t.isCompositeSliceContent=l;let c=r.exact(r.partial({repeat:r.array(r.unknown),"non-repeat":r.UnknownRecord})),d=n=>new r.Type("CompositeSliceLegacy",t.isCompositeSliceContent,r=>(0,UY.pipe)(c.decode(r),UK.either.map(r=>{let i=(()=>{let t=(0,Gu.getFieldCtx)("repeat",n),i=(0,s.RepeatableWidgetsLegacy)(t).decode(r.repeat);if(!(!i||(0,UH.isLeft)(i)))return i.right})()||[];return{nonRepeat:Object.entries(r["non-repeat"]||{}).reduce((t,[r,i])=>{let o=(0,Gu.getFieldCtx)(r,n,["non-repeat"]);if(!o)return t;let u=(0,a.NestableLegacy)(o).decode(i);return!u||(0,UH.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,Gu.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,Gu.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,l)=>{let c=Object.entries(u.widget.nonRepeat).reduce((o,[u,l])=>{var c,d,f;let p=(null==i?void 0:i.type)==="SharedSlice"?null===(d=null===(c=null==i?void 0:i.fields)||void 0===c?void 0:c.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:l});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 l({key:n,apiId:r,path:t,model:i,content:{...u,widget:{__TYPE__:"CompositeSliceContent",repeat:d,nonRepeat:c}}})}},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)},[])}),[])}}}}(Zg)),Zg}var Zx,Z_,ZS={};function ZT(){return Z_||(Z_=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=nX,r=(0,n.__importStar)(V2),i=Gi(),o=Zd(),a=Zo(),u=Zc(),s=Zv();t.SharedSliceContentType="SharedSliceContent";let l=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.SharedSliceContentType;t.isSharedSliceContent=l;let c=r.exact(r.type({variation:r.string,items:(0,qB.withFallback)(r.array(r.unknown),[]),primary:(0,qB.withFallback)(r.UnknownRecord,{})})),d=n=>new r.Type("SharedSliceLegacy",t.isSharedSliceContent,r=>(0,UY.pipe)(c.decode(r),UK.either.map(r=>{let i=(()=>{let t=(0,Gu.getFieldCtx)("items",n,["variations",r.variation]),i=(0,s.RepeatableWidgetsLegacy)(t).decode(r.items);if(!(!i||(0,UH.isLeft)(i)))return i.right})()||[],o=Object.entries(r.primary).reduce((t,[i,o])=>{let u=(0,Gu.getFieldCtx)(i,n,["variations",r.variation,"primary"]),s=(0,a.NestableLegacy)(u).decode(o);return!s||(0,UH.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,Gu.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,Gu.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:{},l=(0,u.withDefaultNestableContentValues)(a,n.primary),c=(0,u.repeatableContentWithDefaultNestableContentValues)(s,n.items);return{...n,primary:l,items:c}},t.traverseSharedSliceContent=function({path:t,sliceKey:n,sliceName:r,model:i,content:u}){return(s,l)=>{let c=Object.entries(u.widget.primary).reduce((o,[u,l])=>{var c,d;let f=null===(d=null===(c=null==i?void 0:i.fields)||void 0===c?void 0:c.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:l});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 l({key:n,apiId:r,path:t,model:i,content:{...u,widget:{__TYPE__:"SharedSliceContent",variation:u.widget.variation,primary:c,items:d}}})}}}(ZS)),ZS}var Zw,ZO={};function Zk(){if(Zw)return ZO;Zw=1,Object.defineProperty(ZO,"__esModule",{value:!0}),ZO.migrateSimpleSlice=ZO.traverseSimpleSliceContent=ZO.SimpleSliceLegacy=ZO.isSimpleSliceContent=ZO.SimpleSliceContent=void 0;let t=(0,nX.__importStar)(V2),n=Zd(),r=Zo();ZO.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);let i=t=>(0,r.isNestableContent)(t)||(0,n.isGroupContent)(t);ZO.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 ZO.SimpleSliceLegacy=o,ZO.traverseSimpleSliceContent=function({path:t,sliceKey:r,sliceName:i,model:o,content:a}){return(u,s)=>{var l;if((0,n.isGroupContent)(a.widget)){let c=(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 c&&s({key:a.key,apiId:a.name,path:t,model:o,content:{...a,widget:c}})}let d=u({key:a.key,apiId:a.name,path:t,model:(null==o?void 0:o.type)==="SharedSlice"?null===(l=o.fields.primary)||void 0===l?void 0:l[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}})}},ZO.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:[]}}},ZO}function ZC(){return ZI||(ZI=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SliceContent=t.SliceLegacy=void 0;let n=nX,r=(0,n.__importStar)(V2),i=Zb(),o=ZT(),a=Zk(),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)(Zb(),t),(0,n.__exportStar)(ZT(),t),(0,n.__exportStar)(Zk(),t)}(Zm)),Zm}var ZI,ZM,ZR={};function ZE(){if(ZM)return ZR;ZM=1,Object.defineProperty(ZR,"__esModule",{value:!0}),ZR.migrateSliceItem=ZR.SlicesItemLegacy=ZR.sliceItemContentWithDefaultValues=ZR.isSimpleSliceItemContent=ZR.isCompositeSliceItemContent=ZR.isSharedSliceItemContent=ZR.SliceItemContent=void 0;let t=nX,n=(0,t.__importStar)(V2),r=Zd(),i=Zo(),o=Zc(),a=ZC(),u=Zb(),s=ZT(),l=Zk();function c(t){return(0,u.isCompositeSliceContent)(t.widget)}function d(t){return(0,r.isGroupContent)(t.widget)||(0,i.isNestableContent)(t.widget)}ZR.SliceItemContent=n.type({key:n.string,name:n.string,maybeLabel:n.union([n.string,n.undefined]),widget:a.SliceContent}),ZR.isSharedSliceItemContent=function(t){return(0,s.isSharedSliceContent)(t.widget)},ZR.isCompositeSliceItemContent=c,ZR.isSimpleSliceItemContent=d,ZR.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 l=(0,o.repeatableContentWithDefaultNestableContentValues)(t.config.fields,n.value);return{...n,value:l}}return n};let f=n.exact(n.intersection([n.type({key:n.string,value:n.unknown}),n.partial({label:(0,$e.nullable)(n.string)})])),p=t=>new n.Type("SlicesItemLegacy",t=>((0,s.isSharedSliceContent)(t.widget),(0,u.isCompositeSliceContent)(t.widget),(0,l.isSimpleSliceContent)(t.widget)),(r,i)=>(0,UY.pipe)(f.decode(r),UK.either.chain(o=>{var u;let s=o.key.indexOf("$"),l=o.key.substring(0,s>0?s:void 0),c=(0,Gu.getFieldCtx)(l,t),d=(0,a.SliceLegacy)(c).decode(o.value);return!d||(0,UH.isLeft)(d)?n.failure(r,i):n.success({key:o.key,name:l,maybeLabel:null!==(u=o.label)&&void 0!==u?u:void 0,widget:d.right})})),n=>{let r=(0,Gu.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)||{}}});ZR.SlicesItemLegacy=p;let h=({model:t,content:n})=>c(n)&&(null==t?void 0:t.type)==="SharedSlice"?(0,u.migrateCompositeSlice)(t,n):d(n)&&(null==t?void 0:t.type)==="SharedSlice"?(0,l.migrateSimpleSlice)(t,n):n;return ZR.migrateSliceItem=h,ZR}var Zj,ZA={};function ZN(){return ZP||(ZP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nX;(0,n.__exportStar)(ZC(),t),(0,n.__exportStar)(ZE(),t),(0,n.__exportStar)((Zj||(Zj=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=nX,r=(0,n.__importStar)(V2),i=Gi(),o=Zb(),a=ZT(),u=Zk(),s=ZE();t.SlicesContentType="SliceContentType";let l=n=>(0,i.hasContentType)(n)&&n.__TYPE__===t.SlicesContentType;t.isSlicesContent=l;let c=n=>{let i=r.array((0,s.SlicesItemLegacy)(n));return new r.Type("SlicesLegacy",t.isSlicesContent,n=>(0,UY.pipe)(i.decode(n),UK.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=c,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:l=({content:t})=>t,transformSlice:c=({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,qZ.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=V3.ContentPath.append(V3.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,qZ.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,qZ.isCompositeSlice)(a))return{type:"Slice","non-repeat":a["non-repeat"]||{},repeat:a.repeat||{}};if((0,qZ.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})(l,c):(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})(l,c):(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})(l,c):void 0;return f?n.concat(f):n},[]);return l({path:t,key:n,apiId:n,model:r,content:{__TYPE__:i.__TYPE__,value:d}})}}}(ZA)),ZA),t)}(Zh)),Zh}var ZP,ZL,ZD={};function ZF(){return ZL||(ZL=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UIDContent=t.UIDLegacy=t.isUIDContent=t.UIDContentType=void 0;let n=nX,r=(0,n.__importStar)(V2),i=Gi();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,UY.pipe)(r.string.decode(n),UK.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})}(ZD)),ZD}var ZW,ZU={};function Zz(){return i||(i=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nX;(0,n.__exportStar)(Go(),t),(0,n.__exportStar)(Zd(),t),(0,n.__exportStar)(Zo(),t),(0,n.__exportStar)(ZN(),t),(0,n.__exportStar)(ZF(),t),(0,n.__exportStar)(function(){if(ZW)return ZU;ZW=1,Object.defineProperty(ZU,"__esModule",{value:!0}),ZU.WidgetLegacy=ZU.isWidgetContent=ZU.WidgetContent=void 0;let t=(0,nX.__importStar)(V2),n=Zd(),r=Zo(),i=ZN(),o=ZF();ZU.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);ZU.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 ZU.WidgetLegacy=u,ZU}(),t)}(Gt)),Gt}Object.defineProperty(n0,"__esModule",{value:!0}),n0.migrateDocument=n0.collectWidgets=n0.traverseDocument=n0.fillDocumentWithDefaultValues=n0.DocumentLegacy=n0.Document=void 0;let ZB=nX,ZV=(0,ZB.__importStar)(V2),Z$=Zz();n0.Document=ZV.record(V4.WidgetKey,Z$.WidgetContent);let Zq=ZV.record(V4.WidgetKey,ZV.unknown),ZK=t=>new ZV.Type("Document",t=>!!t&&"object"==typeof t,n=>(0,UY.pipe)(Zq.decode(n),UK.either.map(n=>Object.entries(n).reduce((n,[r,i])=>{let o=(0,Gu.defaultCtx)(r,t),a=(0,Z$.WidgetLegacy)(o).decode(i);return!a||(0,UH.isLeft)(a)?n:{...n,[r]:a.right}},{}))),n=>Object.entries(n).reduce((n,[r,i])=>{let o=(0,Gu.defaultCtx)(r,t),a=(0,Z$.WidgetLegacy)(o).encode(i);return a?{content:{...n.content,[r]:a.content},types:{...n.types,...a.types}}:n},{content:{},types:{}}));function ZH(t){let n=Object.entries(t),{types:r,widgets:i}=n.reduce((t,[n,r])=>{if(n.endsWith("_TYPE")){let i=Gu.FieldOrSliceType.decode(r);if((0,UH.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 ZG(t){return{customTypeId:null==t?void 0:t.id,fields:Object.fromEntries((0,qZ.flattenSections)(t))}}function ZZ({document:t,customType:n}){let r=n&&qZ.StaticCustomType.is(n)?ZG(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],l=V3.ContentPath.make([{key:null==r?void 0:r.customTypeId,type:"CustomType"},{key:a,type:"Widget"}]),c=(()=>{switch(u.__TYPE__){case"SliceContentType":return(0,Z$.traverseSlices)({path:l,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,Z$.traverseGroupContent)({path:l,key:a,apiId:a,model:(null==s?void 0:s.type)==="Group"?s:void 0,content:u})(n);default:return n({path:l,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,...c?{[a]:c}:{}}},{})}}function ZY(t,n){let r=qZ.StaticCustomType.is(n)?ZG(n):n;return Object.values((0,qZ.collectSharedSlices)(r)).some(t=>Boolean(t.legacyPaths))?ZZ({document:t,customType:n})({transformSlice:Z$.migrateSliceItem}):t}n0.DocumentLegacy={_codec:ZK,extractMetadata:ZH,parse:function(t,n){let r=(0,UY.pipe)(ZV.record(V4.WidgetKey,ZV.unknown).decode(t),UK.either.chain(t=>{let{types:n,widgets:r}=ZH(t);return ZK(n).decode(r)}));return(0,UH.isLeft)(r)?void 0:ZY(r.right,n)},encode:function(t){let n=ZK().encode(t);return{...n.content,...n.types}}},n0.fillDocumentWithDefaultValues=function(t,n){let{fields:r}=t&&qZ.StaticCustomType.is(t)?ZG(t):t;return Object.entries(r).reduce((t,[r,i])=>{let o=n[r],a=(()=>{switch(i.type){case"Group":return(0,Z$.isGroupContent)(o)?(0,Z$.groupContentWithDefaultValues)(i,o):o;case"Choice":case"Slices":return(0,Z$.isSlicesContent)(o)?(0,Z$.slicesContentWithDefaultValues)(i,o):o;default:return void 0===o&&qZ.NestableWidget.is(i)?(0,Z$.NestableContentDefaultValue)(i):o}})();return a?{...t,[r]:a}:t},n)},n0.traverseDocument=ZZ,n0.collectWidgets=function(t,n){let r={};return ZZ({document:t})({transformWidget({content:t,path:i}){let o=V3.ContentPath.serialize(i);return n(t,i)&&(r[o]=t),t}}),r},n0.migrateDocument=ZY,function(t){Object.defineProperty(t,"__esModule",{value:!0});let n=nX;(0,n.__exportStar)(n0,t),(0,n.__exportStar)(Zz(),t),(0,n.__exportStar)(Gu,t)}(nQ);let ZJ=(0,o.createContext)({update(){}});function ZQ(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 ZX(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 Z0(t){var n;let{content:r,field:i,id:o,readOnly:a,onContentChange:s}=t,l=(null==r?void 0:r.value)??(null==(n=i.config)?void 0:n.default_value)??!1;return M.jsxs(u.gN,{children:[M.jsx(u.fw,{name:"toggleOff"}),M.jsx(u.Qy,{htmlFor:o,children:ZQ(i)}),M.jsxs(u.JO,{children:[M.jsx(u.xu,{padding:4,alignItems:"center",children:M.jsx(u.xv,{children:ZX(i,l)})}),M.jsx(u.rs,{id:o,sx:{alignSelf:"center",marginLeft:"auto",marginRight:12},checked:l,onCheckedChange(t){var n;a||s((n=t,{__TYPE__:"BooleanContent",value:n}))}})]})]})}function Z1(t){let{id:n,field:r,content:i,onContentChange:o}=t;return M.jsxs(u.gN,{children:[M.jsx(u.fw,{name:"colorLens"}),M.jsx(u.Qy,{id:n,children:ZQ(r)}),M.jsx(u.JO,{children:M.jsx(u.xu,{padding:{left:4},alignItems:"center",children:M.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:ZX(r)})})})]})}function Z2(t){let{id:n,readOnly:r,field:i,content:o,onContentChange:a}=t,s=null!=o&&o.value?(0,l._O)(o.value):void 0;return M.jsxs(u.gN,{children:[M.jsx(u.fw,{name:"dateRange"}),M.jsx(u.Qy,{id:n,children:ZQ(i)}),M.jsx(u.JO,{children:M.jsx(u.xu,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:M.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 Z3(t){return M.jsx(u.oi,{...t,padding:Z4})}let Z4={input:{inline:4},adornment:{inline:12}};function Z5(t){this.content=t}Z5.prototype={constructor:Z5,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 Z5(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 Z5(r)},addToStart:function(t,n){return new Z5([t,n].concat(this.remove(t).content))},addToEnd:function(t,n){var r=this.remove(t).content.slice();return r.push(t,n),new Z5(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 Z5(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=Z5.from(t)).size?new Z5(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=Z5.from(t)).size?new Z5(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var n=this;t=Z5.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}},Z5.from=function(t){if(t instanceof Z5)return t;var n=[];if(t)for(var r in t)n.push(r,t[r]);return new Z5(n)};class Z6{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],l=u+s.nodeSize;if(l>t&&!1!==r(s,i+u,o||null,a)&&s.content.size){let c=u+1;s.nodesBetween(Math.max(0,t-c),Math.min(s.content.size,n-c),r,i+c)}u=l}}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 Z6(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 Z6(r,i)}cutByIndex(t,n){return t==n?Z6.empty:0==t&&n==this.content.length?this:new Z6(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 Z6(i,o)}addToStart(t){return new Z6([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Z6(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 l=t(a.content,u.content,i+1);if(null!=l)return l}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),l=r.child(--u),c=s.nodeSize;if(s==l){i-=c,o-=c;continue}if(!s.sameMarkup(l))return{a:i,b:o};if(s.isText&&s.text!=l.text){let d=0,f=Math.min(s.text.length,l.text.length);for(;d<f&&s.text[s.text.length-d-1]==l.text[l.text.length-d-1];)d++,i--,o--;return{a:i,b:o}}if(s.content.size||l.content.size){let p=t(s.content,l.content,i-1,o-1);if(p)return p}i-=c,o-=c}}(this,t,n,r)}findIndex(t,n=-1){if(0==t)return Z8(0,t);if(t==this.size)return Z8(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?Z8(r+1,o):Z8(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 Z6.empty;if(!Array.isArray(n))throw RangeError("Invalid input for Fragment.fromJSON");return new Z6(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Z6.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 Z6(n||t,r)}static from(t){if(!t)return Z6.empty;if(t instanceof Z6)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new Z6([t],t.nodeSize);throw RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Z6.empty=new Z6([],0);let Z9={index:0,offset:0};function Z8(t,n){return Z9.index=t,Z9.offset=n,Z9}function Z7(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(!Z7(t[i],n[i]))return!1}else{for(let o in t)if(!(o in n)||!Z7(t[o],n[o]))return!1;for(let a in n)if(!(a in t))return!1}return!0}let Ye=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&&Z7(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}};Ye.none=[];class Yt extends Error{}class Yn{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 l=t(s.content,r-u-1,i);return l&&n.replaceChild(a,s.copy(l))}(this.content,t+this.openStart,n);return r&&new Yn(r,this.openStart,this.openEnd)}removeBetween(t,n){return new Yn(function t(n,r,i){let{index:o,offset:a}=n.findIndex(r),u=n.maybeChild(o),{index:s,offset:l}=n.findIndex(i);if(a==r||u.isText){if(l!=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 Yn.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 Yn(Z6.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 Yn(t,r,i)}}function Yr(t,n){if(!n.type.compatibleContent(t.type))throw new Yt("Cannot join "+n.type.name+" onto "+t.type.name)}function Yi(t,n,r){let i=t.node(r);return Yr(i,n.node(r)),i}function Yo(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 Ya(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&&(Yo(t.nodeAfter,i),a++));for(let s=a;s<u;s++)Yo(o.child(s),i);n&&n.depth==r&&n.textOffset&&Yo(n.nodeBefore,i)}function Yu(t,n){return t.type.checkContent(n),t.copy(n)}function Ys(t,n,r){let i=[];return Ya(null,t,r,i),t.depth>r&&Yo(Yu(Yi(t,n,r+1),Ys(t,n,r+1)),i),Ya(n,null,r,i),new Z6(i)}Yn.empty=new Yn(Z6.empty,0,0);class Yl{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 Ye.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 Yp(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),l=o-s;if(r.push(a,u,i+s),!l||(a=a.child(u)).isText)break;o=l-1,i+=s+1}return new Yl(n,r,o)}static resolveCached(t,n){for(let r=0;r<Yc.length;r++){let i=Yc[r];if(i.pos==n&&i.doc==t)return i}let o=Yc[Yd]=Yl.resolve(t,n);return Yd=(Yd+1)%Yf,o}}let Yc=[],Yd=0,Yf=12;class Yp{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 Yh=Object.create(null),Ym=class t{constructor(t,n,r,i=Ye.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||Z6.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&&Z7(this.attrs,n||t.defaultAttrs||Yh)&&Ye.sameSet(this.marks,r||Ye.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 Yn.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 Yn(s,i.depth-a,o.depth-a)}replace(t,n,r){return function(t,n,r){if(r.openStart>t.depth)throw new Yt("Inserted content deeper than insertion position");if(t.depth-r.openStart!=n.depth-r.openEnd)throw new Yt("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 Yu(u,Ys(n,r,o));if(i.openStart||i.openEnd||n.depth!=o||r.depth!=o){let{start:l,end:c}=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(Z6.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}(i,n);return Yu(u,function t(n,r,i,o,a){let u=n.depth>a&&Yi(n,r,a+1),s=o.depth>a&&Yi(i,o,a+1),l=[];return Ya(null,n,a,l),u&&s&&r.index(a)==i.index(a)?(Yr(u,s),Yo(Yu(u,t(n,r,i,o,a+1)),l)):(u&&Yo(Yu(u,Ys(n,r,a+1)),l),Ya(r,i,a,l),s&&Yo(Yu(s,Ys(i,o,a+1)),l)),Ya(o,null,a,l),new Z6(l)}(n,l,c,r,o))}{let d=n.parent,f=d.content;return Yu(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 Yl.resolveCached(this,t)}resolveNoCache(t){return Yl.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()+")"),Yy(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=Z6.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=Ye.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!Ye.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=Z6.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}};Ym.prototype.text=void 0;class Yg extends Ym{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):Yy(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 Yg(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Yg(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 Yy(t,n){for(let r=t.length-1;r>=0;r--)n=t[r].type.name+"("+n+")";return n}class Yv{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){var r;let i=new Yb(t,n);if(null==i.next)return Yv.empty;let o=Yx(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 l=r();return i(n,l),o(a(t.expr,l),l),[i(l)]}else if("plus"==t.type){let c=r();return o(a(t.expr,n),c),o(a(t.expr,c),c),[i(c)]}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]);YC(r,n).forEach(n=>{o||i.push([t,o=[]]),-1==o.indexOf(n)&&o.push(n)})})});let o=a[n.join(",")]=new Yv(n.indexOf(r.length-1)>-1);for(let u=0;u<i.length;u++){let s=i[u][1].sort(Yk);o.next.push({type:i[u][0],next:a[s.join(",")]||t(s)})}return o}(YC(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:l,next:c}=o.next[s];u.push(l.name),a&&!(l.isText||l.hasRequiredAttrs())&&(a=!1),-1==i.indexOf(c)&&i.push(c)}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 Z6.from(u.map(t=>t.createAndFill()));for(let l=0;l<a.next.length;l++){let{type:c,next:d}=a.next[l];if(!(c.isText||c.hasRequiredAttrs())&&-1==i.indexOf(d)){i.push(d);let f=o(d,u.concat(c));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:l,next:c}=o.next[s];l.isLeaf||l.hasRequiredAttrs()||l.name in n||i.type&&!c.validEnd||(r.push({match:l.contentMatch,type:l,via:i}),n[l.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
|
+
`)}}Yv.empty=new Yv(!0);class Yb{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 Yx(t){let n=[];do n.push(Y_(t));while(t.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}function Y_(t){let n=[];do n.push(YS(t));while(t.next&&")"!=t.next&&"|"!=t.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}function YS(t){let n=YO(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=Yw(t,n);else break;return n}function YT(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let n=Number(t.next);return t.pos++,n}function Yw(t,n){let r=YT(t),i=r;return t.eat(",")&&(i="}"!=t.next?YT(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:i,expr:n}}function YO(t){if(t.eat("(")){let n=Yx(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 Yk(t,n){return n-t}function YC(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(Yk)}function YI(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 YM(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 YR(t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Yj(t[r]);return n}let YE=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=YR(r.attrs),this.defaultAttrs=YI(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==Yv.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:YM(this.attrs,t)}create(t=null,n,r){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new Ym(this,this.computeAttrs(t),Z6.from(n),Ye.setFrom(r))}createChecked(t=null,n,r){return n=Z6.from(n),this.checkContent(n),new Ym(this,this.computeAttrs(t),n,Ye.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),(n=Z6.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(Z6.empty,!0);return a?new Ym(this,t,n.append(a),Ye.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:Ye.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 Yj{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class YA{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=YR(i.attrs),this.excluded=null;let o=YI(this.attrs);this.instance=o?new Ye(this,o):null}create(t=null){return!t&&this.instance?this.instance:new Ye(this,YM(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,o)=>r[t]=new YA(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 YN{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let r in t)n[r]=t[r];n.nodes=Z5.from(t.nodes),n.marks=Z5.from(t.marks||{}),this.nodes=YE.compile(this.spec.nodes,this),this.marks=YA.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]=Yv.parse(u,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.markSet="_"==s?null:s?YP(this,s.split(" ")):""!=s&&a.inlineContent?null:[]}for(let l in this.marks){let c=this.marks[l],d=c.spec.excludes;c.excluded=null==d?[c]:""==d?[]:YP(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 YE){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 Yg(r,r.defaultAttrs,t,Ye.setFrom(n))}mark(t,n){return"string"==typeof t&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return Ym.fromJSON(this,t)}markFromJSON(t){return Ye.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw RangeError("Unknown node type: "+t);return n}}function YP(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 l=t.marks[s];("_"==o||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&r.push(u=l)}if(!u)throw SyntaxError("Unknown mark type: '"+n[i]+"'")}return r}class YL{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 YB(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new YB(this,n,!0);return r.addAll(t,n.from,n.to),Yn.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(YV(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=Y$(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=Y$(t)),t.node||t.ignore||t.mark||(t.node=a)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new YL(t,YL.schemaRules(t)))}}let YD={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},YF={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},YW={ol:!0,ul:!0};function YU(t,n,r){return null!=n?(n?1:0)|("full"===n?2:0):t&&"pre"==t.whitespace?3:-5&r}class Yz{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=Ye.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(Z6.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=Z6.from(this.content);return!t&&this.match&&(i=i.append(this.match.fillBefore(Z6.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):Yq(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&&!YD.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class YB{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=YU(null,n.preserveWhitespace,0)|(r?4:0);o=i?new Yz(i.type,i.attrs,Ye.none,Ye.none,!0,n.topMatch||i.type.contentMatch,a):r?new Yz(null,null,Ye.none,Ye.none,!0,null,a):new Yz(t.schema.topNodeType,null,Ye.none,Ye.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 l=0;l<i.length;l++)this.removePendingMark(i[l],a);for(let c=0;c<o.length;c++)this.addPendingMark(o[c])}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;YW.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&&YW.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:YF.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(YD.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=Ye.none,r=Ye.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=YU(t,i,o.options);4&o.options&&0==o.content.length&&(a|=4),this.nodes.push(new Yz(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 l=u>0||0==u&&i?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!l||l.name!=s&&-1==l.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 YV(t,n){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,n)}function Y$(t){let n={};for(let r in t)n[r]=t[r];return n}function Yq(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 YK{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=YG(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++],l=this.serializeMark(s,t.isInline,n);l&&(o.push([s,i]),i.appendChild(l.dom),i=l.contentDOM||l.dom)}}i.appendChild(this.serializeNodeInner(t,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=YK.renderSpec(YG(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&&YK.renderSpec(YG(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],l=1;if(s&&"object"==typeof s&&null==s.nodeType&&!Array.isArray(s)){for(let c in l=2,s)if(null!=s[c]){let d=c.indexOf(" ");d>0?u.setAttributeNS(c.slice(0,d),c.slice(d+1),s[c]):u.setAttribute(c,s[c])}}for(let f=l;f<n.length;f++){let p=n[f];if(0===p){if(f<n.length-1||f>l)throw RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}{let{dom:h,contentDOM:m}=YK.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 YK(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=YH(t.nodes);return n.text||(n.text=t=>t.text),n}static marksFromSchema(t){return YH(t.marks)}}function YH(t){let n={};for(let r in t){let i=t[r].spec.toDOM;i&&(n[r]=i)}return n}function YG(t){return t.document||window.document}function YZ(t,n){return t+65536*n}function YY(t){return 65535&t}class YJ{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 YQ{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&YQ.empty)return YQ.empty}recover(t){var n;let r=0,i=YY(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 l=this.ranges[u+o],c=this.ranges[u+a],d=s+l;if(t<=d){let f=l?t==s?-1:t==d?1:n:n,p=s+i+(f<0?0:c);if(r)return p;let h=t==(n<0?s:d)?null:YZ(u/3,t-s),m=t==s?2:t==d?1:4;return(n<0?t!=s:t!=d)&&(m|=8),new YJ(p,m,h)}i+=c-l}return r?t+i:new YJ(t+i,0,null)}touches(t,n){let r=0,i=YY(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 l=this.ranges[u+o];if(t<=s+l&&u==3*i)return!0;r+=this.ranges[u+a]-l}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),l=this.ranges[i+n],c=this.ranges[i+r];t(u,u+l,s,s+c),o+=c-l}}invert(){return new YQ(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?YQ.empty:new YQ(t<0?[0,-t,0]:[0,0,t])}}YQ.empty=new YQ([]);class YX{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 YX(this.maps,this.mirror,t,n)}copy(){return new YX(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 YX;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 YJ(t,i,null)}}let Y0=Object.create(null);class Y1{getMap(){return YQ.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw RangeError("Invalid input for Step.fromJSON");let r=Y0[n.stepType];if(!r)throw RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Y0)throw RangeError("Duplicate use of step JSON ID "+t);return Y0[t]=n,n.prototype.jsonID=t,n}}class Y2{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Y2(t,null)}static fail(t){return new Y2(null,t)}static fromReplace(t,n,r,i){try{return Y2.ok(t.replace(n,r,i))}catch(o){if(o instanceof Yt)return Y2.fail(o.message);throw o}}}function Y3(t,n,r){let i=[];for(let o=0;o<t.childCount;o++){let a=t.child(o);a.content.size&&(a=a.copy(Y3(a.content,n,a))),a.isInline&&(a=n(a,r,o)),i.push(a)}return Z6.fromArray(i)}class Y4 extends Y1{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 Yn(Y3(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 Y2.fromReplace(t,this.from,this.to,o)}invert(){return new Y5(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 Y4(n.pos,r.pos,this.mark)}merge(t){return t instanceof Y4&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Y4(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 Y4(n.from,n.to,t.markFromJSON(n.mark))}}Y1.jsonID("addMark",Y4);class Y5 extends Y1{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 Yn(Y3(n.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),n.openStart,n.openEnd);return Y2.fromReplace(t,this.from,this.to,r)}invert(){return new Y4(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 Y5(n.pos,r.pos,this.mark)}merge(t){return t instanceof Y5&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Y5(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 Y5(n.from,n.to,t.markFromJSON(n.mark))}}Y1.jsonID("removeMark",Y5);class Y6 extends Y1{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Y2.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Y2.fromReplace(t,this.pos,this.pos+1,new Yn(Z6.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 Y6(this.pos,n.marks[i]);return new Y6(this.pos,this.mark)}}return new Y9(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Y6(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 Y6(n.pos,t.markFromJSON(n.mark))}}Y1.jsonID("addNodeMark",Y6);class Y9 extends Y1{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Y2.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Y2.fromReplace(t,this.pos,this.pos+1,new Yn(Z6.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return n&&this.mark.isInSet(n.marks)?new Y6(this.pos,this.mark):this}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Y9(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 Y9(n.pos,t.markFromJSON(n.mark))}}Y1.jsonID("removeNodeMark",Y9);class Y8 extends Y1{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&Je(t,this.from,this.to)?Y2.fail("Structure replace would overwrite content"):Y2.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new YQ([this.from,this.to-this.from,this.slice.size])}invert(t){return new Y8(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 Y8(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Y8)||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?Yn.empty:new Yn(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Y8(t.from,this.to,n,this.structure)}}{let r=this.slice.size+t.slice.size==0?Yn.empty:new Yn(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Y8(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 Y8(n.from,n.to,Yn.fromJSON(t,n.slice),!!n.structure)}}Y1.jsonID("replace",Y8);class Y7 extends Y1{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&&(Je(t,this.from,this.gapFrom)||Je(t,this.gapTo,this.to)))return Y2.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Y2.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Y2.fromReplace(t,this.from,this.to,r):Y2.fail("Content does not fit in gap")}getMap(){return new YQ([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 Y7(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 Y7(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 Y7(n.from,n.to,n.gapFrom,n.gapTo,Yn.fromJSON(t,n.slice),n.insert,!!n.structure)}}function Je(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 Jt(t,n,r){return(0==n||t.canReplace(n,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function Jn(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||!Jt(i,o,a))break}return null}function Jr(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 l=i;s&&l<o;l++)s=s.matchType(r.child(l).type);return s&&s.validEnd?u:null}(i,n);return a?o.map(Ji).concat({type:n,attrs:r}).concat(a.map(Ji)):null}function Ji(t){return{type:t,attrs:null}}function Jo(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,l=r-2;s>a;s--,l--){let c=o.node(s),d=o.index(s);if(c.type.spec.isolating)return!1;let f=c.content.cutByIndex(d,c.childCount),p=i&&i[l+1];p&&(f=f.replaceChild(0,p.type.create(p.attrs)));let h=i&&i[l]||c;if(!c.canReplace(d+1,c.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 Ja(t,n){let r=t.resolve(n),i=r.index();return Ju(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(i,i+1)}function Ju(t,n){return!!(t&&n&&!t.isLeaf&&t.canAppend(n))}function Js(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&&Ju(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 Jl(t,n,r=n,i=Yn.empty){if(n==r&&!i.size)return null;let o=t.resolve(n),a=t.resolve(r);return Jc(o,a,i)?new Y8(n,r,i):new Jd(o,a,i).fit()}function Jc(t,n,r){return!r.openStart&&!r.openEnd&&t.start()==n.start()&&t.parent.canReplace(t.index(),n.index(),r.content)}Y1.jsonID("replaceAround",Y7);class Jd{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=Z6.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=Z6.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 l=new Yn(a,u,s);return n>-1?new Y7(i.pos,n,this.$to.pos,this.$to.end(),l,r):l.size||i.pos!=this.$to.pos?new Y8(i.pos,o.pos,l):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,l=null,c=(u?(l=Jh(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&&(c?p.matchType(c.type)||(m=p.fillBefore(Z6.from(c),!1)):l&&f.compatibleContent(l.type)))return{sliceDepth:u,frontierDepth:d,parent:l,inject:m};if(2==a&&c&&(h=p.findWrapping(c.type)))return{sliceDepth:u,frontierDepth:d,parent:l,wrap:h};if(l&&p.matchType(l.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=Jh(t,n);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new Yn(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=Jh(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new Yn(Jf(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Yn(Jf(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,l=u.openStart-t,c=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(;c<s.childCount;){let g=s.child(c),y=f.matchType(g.type);if(!y)break;(++c>1||0==l||g.content.size)&&(f=y,d.push(Jm(g.mark(p.allowedMarks(g.marks)),1==c?l:0,c==s.childCount?m:-1)))}let v=c==s.childCount;v||(m=-1),this.placed=Jp(this.placed,n,Z6.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 _=x.lastChild;this.frontier.push({type:_.type,match:_.contentMatchAt(_.childCount)}),x=_.content}this.unplaced=v?0==t?Yn.empty:new Yn(Jf(u.content,t-1,1),t-1,m<0?u.openEnd:t-1):new Yn(Jf(u.content,t,c),u.openStart,u.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!Jg(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=Jg(t,n,i,r,o);if(a){for(let u=n-1;u>=0;u--){let{match:s,type:l}=this.frontier[u],c=Jg(t,u,l,s,!0);if(!c||c.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=Jp(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=Jp(this.placed,this.depth,Z6.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(Z6.empty,!0);t.childCount&&(this.placed=Jp(this.placed,this.frontier.length,t))}}function Jf(t,n,r){return 0==n?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(Jf(t.firstChild.content,n-1,r)))}function Jp(t,n,r){return 0==n?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(Jp(t.lastChild.content,n-1,r)))}function Jh(t,n){for(let r=0;r<n;r++)t=t.firstChild.content;return t}function Jm(t,n,r){if(n<=0)return t;let i=t.content;return n>1&&(i=i.replaceChild(0,Jm(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(Z6.empty,!0)))),t.copy(i)}function Jg(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 Jy(t){return t.spec.defining||t.spec.definingForContent}function Jv(t,n,r,i,o){if(n<r){let a=t.firstChild;t=t.replaceChild(0,a.copy(Jv(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(Z6.empty,!0))}return t}function Jb(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 Jx extends Y1{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 Y2.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 Y2.fromReplace(t,this.pos,this.pos+1,new Yn(Z6.from(o),0,n.isLeaf?0:1))}getMap(){return YQ.empty}invert(t){return new Jx(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 Jx(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 Jx(n.pos,n.attr,n.value)}}Y1.jsonID("attr",Jx);let J_=class extends Error{};(J_=function t(n){let r=Error.call(this,n);return r.__proto__=t.prototype,r}).prototype=Object.create(Error.prototype),J_.prototype.constructor=J_,J_.prototype.name="TransformError";class JS{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new YX}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new J_(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=Yn.empty){let i=Jl(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new Yn(Z6.from(r),0,0))}delete(t,n){return this.replace(t,n,Yn.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(Jc(o,a,i))return t.step(new Y8(n,r,i));let u=Jb(o,t.doc.resolve(r));0==u[u.length-1]&&u.pop();let s=-(o.depth+1);u.unshift(s);for(let l=o.depth,c=o.pos-1;l>0;l--,c--){let d=o.node(l).type.spec;if(d.defining||d.definingAsContext||d.isolating)break;u.indexOf(l)>-1?s=l:o.before(l)==c&&u.splice(1,0,-l)}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=Jy(b);if(x&&o.node(f).type!=b)h=v;else if(x||!b.isTextblock)break}for(let _=i.openStart;_>=0;_--){let S=(_+h+1)%(i.openStart+1),T=p[S];if(T)for(let w=0;w<u.length;w++){let O=u[(w+f)%u.length],k=!0;O<0&&(k=!1,O=-O);let C=o.node(O-1),I=o.index(O-1);if(C.canReplaceWith(I,I,T.type,T.marks))return t.replace(o.before(O),k?a.after(O):r,new Yn(Jv(i.content,0,i.openStart,S),S,i.openEnd))}}let M=t.steps.length;for(let R=u.length-1;R>=0&&(t.replace(n,r,i),!(t.steps.length>M));R--){let E=u[R];E<0||(n=o.before(E),r=a.after(E))}}(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 Yn(Z6.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=Jb(i,o);for(let u=0;u<a.length;u++){let s=a[u],l=u==a.length-1;if(l&&0==s||i.node(s).type.contentMatch.validEnd)return t.delete(i.start(s),o.end(s));if(s>0&&(l||i.node(s-1).canReplace(i.index(s-1),o.indexAfter(s-1))))return t.delete(i.before(s),o.after(s))}for(let c=1;c<=i.depth&&c<=o.depth;c++)if(n-i.start(c)==i.depth-c&&r>i.end(c)&&o.end(c)-r!=o.depth-c)return t.delete(i.before(c),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),l=u,c=s,d=Z6.empty,f=0;for(let p=a,h=!1;p>r;p--)h||i.index(p)>0?(h=!0,d=Z6.from(i.node(p).copy(d)),f++):l--;let m=Z6.empty,g=0;for(let y=a,v=!1;y>r;y--)v||o.after(y+1)<o.end(y)?(v=!0,m=Z6.from(o.node(y).copy(m)),g++):c++;t.step(new Y7(l,c,u,s,new Yn(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 Y8(n-r,n+r,Yn.empty,!0);t.step(i)}(this,t,n),this}wrap(t,n){return function(t,n,r){let i=Z6.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=Z6.from(r[o].type.create(r[o].attrs,i))}let u=n.start,s=n.end;t.step(new Y7(u,s,u,s,new Yn(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,l;let c,d;if(n.isTextblock&&!n.hasMarkup(i,o)&&(u=t.doc,s=t.mapping.slice(a).map(r),l=i,c=u.resolve(s),d=c.index(),c.parent.canReplaceWith(d,d+1,l))){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 Y7(p,h,p+1,h-1,new Yn(Z6.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 Y7(n,n+a.nodeSize,n+1,n+a.nodeSize-1,new Yn(Z6.from(u),0,0),1,!0))}(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new Jx(t,n,r)),this}addNodeMark(t,n){return this.step(new Y6(t,n)),this}removeNodeMark(t,n){if(!(n instanceof Ye)){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 Y9(t,n)),this}split(t,n=1,r){return function(t,n,r=1,i){let o=t.doc.resolve(n),a=Z6.empty,u=Z6.empty;for(let s=o.depth,l=o.depth-r,c=r-1;s>l;s--,c--){a=Z6.from(o.node(s).copy(a));let d=i&&i[c];u=Z6.from(d?d.type.create(d.attrs,u):o.node(s).copy(u))}t.step(new Y8(n,n,new Yn(a.append(u),r,r),!0))}(this,t,n,r),this}addMark(t,n,r){var i,o,a,u;let s,l,c,d;return i=this,s=[],l=[],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)||(c&&c.to==f&&c.mark.eq(u[m])?c.to=p:s.push(c=new Y5(f,p,u[m])));d&&d.to==f?d.to=p:l.push(d=new Y4(f,p,r))}}),s.forEach(t=>i.step(t)),l.forEach(t=>i.step(t)),this}removeMark(t,n,r){var i,o,a,u;let s,l;return i=this,s=[],l=0,i.doc.nodesBetween(t,n,(i,o)=>{if(!i.isInline)return;l++;let a=null;if(r instanceof YA){let u=i.marks,c;for(;c=r.isInSet(u);)(a||(a=[])).push(c),u=c.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==l-1&&p.eq(s[m].style)&&(h=g)}h?(h.to=d,h.step=l):s.push({style:p,from:Math.max(o,t),to:d,step:l})}}}),s.forEach(t=>i.step(new Y5(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 l=o.child(s),c=u+l.nodeSize,d=i.matchType(l.type);if(d){i=d;for(let f=0;f<l.marks.length;f++)r.allowsMarkType(l.marks[f].type)||t.step(new Y5(u,c,l.marks[f]))}else a.push(new Y8(u,c,Yn.empty));u=c}if(!i.validEnd){let p=i.fillBefore(Z6.empty,!0);t.replace(u,u,new Yn(p,0,0))}for(let h=a.length-1;h>=0;h--)t.step(a[h])}(this,t,n,r),this}}let JT=Object.create(null);class Jw{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new JO(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=Yn.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:l,$to:c}=u[s],d=t.mapping.slice(a);t.replaceRange(d.map(l.pos),d.map(c.pos),s?Yn.empty:n),0==s&&JP(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),l=s.map(a.pos),c=s.map(u.pos);o?t.deleteRange(l,c):(t.replaceRangeWith(l,c,n),JP(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new JI(t):JN(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?JN(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):JN(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 Jj(t.node(0))}static atStart(t){return JN(t,t,0,0,1)||new Jj(t)}static atEnd(t){return JN(t,t,t.content.size,t.childCount,-1)||new Jj(t)}static fromJSON(t,n){if(!n||!n.type)throw RangeError("Invalid input for Selection.fromJSON");let r=JT[n.type];if(!r)throw RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in JT)throw RangeError("Duplicate use of selection JSON ID "+t);return JT[t]=n,n.prototype.jsonID=t,n}getBookmark(){return JI.between(this.$anchor,this.$head).getBookmark()}}Jw.prototype.visible=!0;class JO{constructor(t,n){this.$from=t,this.$to=n}}let Jk=!1;function JC(t){Jk||t.parent.inlineContent||(Jk=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class JI extends Jw{constructor(t,n=t){JC(t),JC(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 Jw.near(r);let i=t.resolve(n.map(this.anchor));return new JI(i.parent.inlineContent?i:r,r)}replace(t,n=Yn.empty){if(super.replace(t,n),n==Yn.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof JI&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new JM(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 JI(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=Jw.findFrom(n,r,!0)||Jw.findFrom(n,-r,!0);if(!o)return Jw.near(n,r);n=o.$head}return t.parent.inlineContent||(0==i?t=n:(t=(Jw.findFrom(t,-r,!0)||Jw.findFrom(t,r,!0)).$anchor).pos<n.pos!=i<0&&(t=n)),new JI(t,n)}}Jw.jsonID("text",JI);class JM{constructor(t,n){this.anchor=t,this.head=n}map(t){return new JM(t.map(this.anchor),t.map(this.head))}resolve(t){return JI.between(t.resolve(this.anchor),t.resolve(this.head))}}class JR extends Jw{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?Jw.near(o):new JR(o)}content(){return new Yn(Z6.from(this.node),0,0)}eq(t){return t instanceof JR&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new JE(this.anchor)}static fromJSON(t,n){if("number"!=typeof n.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new JR(t.resolve(n.anchor))}static create(t,n){return new JR(t.resolve(n))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}JR.prototype.visible=!1,Jw.jsonID("node",JR);class JE{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new JM(r,r):new JE(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&JR.isSelectable(r)?new JR(n):Jw.near(n)}}class Jj extends Jw{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=Yn.empty){if(n==Yn.empty){t.delete(0,t.doc.content.size);let r=Jw.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Jj(t)}map(t){return new Jj(t)}eq(t){return t instanceof Jj}getBookmark(){return JA}}Jw.jsonID("all",Jj);let JA={map(){return this},resolve:t=>new Jj(t)};function JN(t,n,r,i,o,a=!1){if(n.inlineContent)return JI.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&&JR.isSelectable(s))return JR.create(t,r-(o<0?s.nodeSize:0))}else{let l=JN(t,s,r+o,o<0?s.childCount:0,o,a);if(l)return l}r+=s.nodeSize*o}return null}function JP(t,n,r){let i=t.steps.length-1;if(i<n)return;let o=t.steps[i];if(!(o instanceof Y8||o instanceof Y7))return;let a;t.mapping.maps[i].forEach((t,n,r,i)=>{null==a&&(a=i)}),t.setSelection(Jw.near(t.doc.resolve(a),r))}class JL extends JS{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 Ye.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)||Ye.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(Jw.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 JD(t,n){return n&&t?t.bind(n):t}class JF{constructor(t,n,r){this.name=t,this.init=JD(n.init,r),this.apply=JD(n.apply,r)}}let JW=[new JF("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new JF("selection",{init:(t,n)=>t.selection||Jw.atStart(n.doc),apply:t=>t.selection}),new JF("storedMarks",{init:t=>t.storedMarks||null,apply:(t,n,r,i)=>i.selection.$cursor?t.storedMarks:null}),new JF("scrollToSelection",{init:()=>0,apply:(t,n)=>t.scrolledIntoView?n+1:n})];class JU{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=JW.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 JF(t.key,t.spec.state,t))})}}class Jz{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,l=i?i[a].state:this,c=s<n.length&&u.spec.appendTransaction.call(u,s?n.slice(s):n,l,r);if(c&&r.filterTransaction(c,a)){if(c.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(c),r=r.applyInner(c),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 Jz(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 JL(this)}static create(t){let n=new JU(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new Jz(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 JU(this.schema,t.plugins),r=n.fields,i=new Jz(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 JU(t.schema,t.plugins),o=new Jz(i);return i.fields.forEach(i=>{if("doc"==i.name)o.doc=Ym.fromJSON(t.schema,n.doc);else if("selection"==i.name)o.selection=Jw.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 JB{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:J$("plugin")}getState(t){return t[this.key]}}let JV=Object.create(null);function J$(t){return t in JV?t+"$"+ ++JV[t]:(JV[t]=0,t+"$")}class Jq{constructor(t="key"){this.key=J$(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}let JK=function(t){for(var n=0;;n++)if(!(t=t.previousSibling))return n},JH=function(t){let n=t.assignedSlot||t.parentNode;return n&&11==n.nodeType?n.host:n},JG=null,JZ=function(t,n,r){let i=JG||(JG=document.createRange());return i.setEnd(t,r??t.nodeValue.length),i.setStart(t,n||0),i},JY=function(t,n,r,i){return r&&(JQ(t,n,r,i,-1)||JQ(t,n,r,i,1))},JJ=/^(img|br|input|textarea|hr)$/i;function JQ(t,n,r,i,o){for(;;){if(t==r&&n==i)return!0;if(n==(o<0?0:JX(t))){let a=t.parentNode;if(!a||1!=a.nodeType||J0(t)||JJ.test(t.nodeName)||"false"==t.contentEditable)return!1;n=JK(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?JX(t):0}}}function JX(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function J0(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 J1=function(t){return t.focusNode&&JY(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function J2(t,n){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=n,r}function J3(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 J4="u">typeof navigator?navigator:null,J5="u">typeof document?document:null,J6=J4&&J4.userAgent||"",J9=/Edge\/(\d+)/.exec(J6),J8=/MSIE \d/.exec(J6),J7=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(J6),Qe=!!(J8||J7||J9),Qt=J8?document.documentMode:J7?+J7[1]:J9?+J9[1]:0,Qn=!Qe&&/gecko\/(\d+)/i.test(J6);Qn&&(/Firefox\/(\d+)/.exec(J6)||[0,0])[1];let Qr=!Qe&&/Chrome\/(\d+)/.exec(J6),Qi=!!Qr,Qo=Qr?+Qr[1]:0,Qa=!Qe&&!!J4&&/Apple Computer/.test(J4.vendor),Qu=Qa&&(/Mobile\/\w+/.test(J6)||!!J4&&J4.maxTouchPoints>2),Qs=Qu||!!J4&&/Mac/.test(J4.platform),Ql=!!J4&&/Win/.test(J4.platform),Qc=/Android \d/.test(J6),Qd=!!J5&&"webkitFontSmoothing"in J5.documentElement.style,Qf=Qd?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Qp(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Qh(t,n){return"number"==typeof t?t:t[n]}function Qm(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 Qg(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=JH(u)){if(1!=u.nodeType)continue;let s=u,l=s==a.body,c=l?Qp(a):Qm(s),d=0,f=0;if(n.top<c.top+Qh(i,"top")?f=-(c.top-n.top+Qh(o,"top")):n.bottom>c.bottom-Qh(i,"bottom")&&(f=n.bottom-c.bottom+Qh(o,"bottom")),n.left<c.left+Qh(i,"left")?d=-(c.left-n.left+Qh(o,"left")):n.right>c.right-Qh(i,"right")&&(d=n.right-c.right+Qh(o,"right")),d||f){if(l)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(l)break}}function Qy(t){let n=[],r=t.ownerDocument;for(let i=t;i&&(n.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),t!=r);i=JH(i));return n}function Qv(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 Qb=null;function Qx(t,n){return t.left>=n.left-1&&t.left<=n.right+1&&t.top>=n.top-1&&t.top<=n.bottom+1}function Q_(t){return t.top<t.bottom||t.left<t.right}function QS(t,n){let r=t.getClientRects();if(r.length){let i=r[n<0?0:r.length-1];if(Q_(i))return i}return Array.prototype.find.call(r,Q_)||t.getBoundingClientRect()}let QT=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Qw(t,n,r){let{node:i,offset:o,atom:a}=t.docView.domFromPos(n,r<0?-1:1),u=Qd||Qn;if(3==i.nodeType){if(u&&(QT.test(i.nodeValue)||(r<0?!o:o==i.nodeValue.length))){let s=QS(JZ(i,o,o),r);if(Qn&&o&&/\s/.test(i.nodeValue[o-1])&&o<i.nodeValue.length){let l=QS(JZ(i,o-1,o-1),-1);if(l.top==s.top){let c=QS(JZ(i,o,o+1),-1);if(c.top!=s.top)return QO(c,c.left<l.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++,QO(QS(JZ(i,d,f),p),p<0)}}if(!t.state.doc.resolve(n-(a||0)).parent.inlineContent){if(null==a&&o&&(r<0||o==JX(i))){let h=i.childNodes[o-1];if(1==h.nodeType)return Qk(h.getBoundingClientRect(),!1)}if(null==a&&o<JX(i)){let m=i.childNodes[o];if(1==m.nodeType)return Qk(m.getBoundingClientRect(),!0)}return Qk(i.getBoundingClientRect(),r>=0)}if(null==a&&o&&(r<0||o==JX(i))){let g=i.childNodes[o-1],y=3==g.nodeType?JZ(g,JX(g)-(u?0:1)):1!=g.nodeType||"BR"==g.nodeName&&g.nextSibling?null:g;if(y)return QO(QS(y,1),!1)}if(null==a&&o<JX(i)){let v=i.childNodes[o];for(;v.pmViewDesc&&v.pmViewDesc.ignoreForCoords;)v=v.nextSibling;let b=v?3==v.nodeType?JZ(v,0,u?0:1):1==v.nodeType?v:null:null;if(b)return QO(QS(b,-1),!0)}return QO(QS(3==i.nodeType?JZ(i):i,-r),r>=0)}function QO(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 Qk(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 QC(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 QI=/[\u0590-\u08ac]/,QM=null,QR=null,QE=!1;class Qj{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>JK(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 l=t;;l=l.parentNode){if(l==this.dom){s=!1;break}if(l.previousSibling)break}if(null==s&&n==t.childNodes.length)for(let c=t;;c=c.parentNode){if(c==this.dom){s=!0;break}if(c.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 QW){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 QA&&s.side>=0;r--);if(n<=0){let l,c=!0;for(;!(!(l=r?this.children[r-1]:null)||l.dom.parentNode==this.contentDOM);r--,c=!1);return l&&n&&c&&!l.border&&!l.domAtom?l.domFromPos(l.size,n):{node:this.contentDOM,offset:l?JK(l.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?JK(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],l=a+s.size;if(-1==i&&t<=l){let c=a+s.border;if(t>=c&&n<=l-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(t,n,c);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=JK(f.dom)+1;break}t-=f.size}-1==i&&(i=0)}if(i>-1&&(l>n||u==this.children.length-1)){n=l;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=JK(h.dom);break}n+=h.size}-1==o&&(o=this.contentDOM.childNodes.length);break}a=l}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 l=this.children[u],c=s+l.size;if(o>s&&a<c)return l.setSelection(t-s-l.border,n-s-l.border,r,i);s=c}let d=this.domFromPos(t,t?-1:1),f=n==t?d:this.domFromPos(n,n?-1:1),p=r.getSelection(),h=!1;if((Qn||Qa)&&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:JK(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(Qn&&p.focusNode&&p.focusNode!=f.node&&1==p.focusNode.nodeType){let _=p.focusNode.childNodes[p.focusOffset];_&&"false"==_.contentEditable&&(i=!0)}if(!(i||h&&Qa)&&JY(d.node,d.offset,p.anchorNode,p.anchorOffset)&&JY(f.node,f.offset,p.focusNode,p.focusOffset))return;let S=!1;if((p.extend||t==n)&&!h){p.collapse(d.node,d.offset);try{t!=n&&p.extend(f.node,f.offset),S=!0}catch{}}if(!S){if(t>n){let T=d;d=f,f=T}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 QA extends Qj{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 QN extends Qj{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 QP extends Qj{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=YK.renderSpec(document,n.type.spec.toDOM(n,r))),new QP(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=QP.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;n<a&&(o=QJ(o,n,a,r)),t>0&&(o=QJ(o,0,t,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}}class QL extends Qj{constructor(t,n,r,i,o,a,u,s,l){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,l=u&&u(n,o,()=>s?s.parent?s.parent.posBeforeChild(s):void 0:a,r,i),c=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(c){if(3!=c.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(n.text)}else c||({dom:c,contentDOM:d}=YK.renderSpec(document,n.type.spec.toDOM(n)));d||n.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let f=c;return c=QK(c,r,n),l?s=new QU(t,n,r,i,c,d||null,f,l,o,a+1):n.isText?new QF(t,n,r,i,c,f,o):new QL(t,n,r,i,c,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=()=>Z6.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)&&QH(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 QZ(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 l=0,c=[],d=null;for(let f=0;;){if(l<o.length&&o[l].to==a){let p=o[l++],h;for(;l<o.length&&o[l].to==a;)(h||(h=[p])).push(o[l++]);if(h){h.sort(QY);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<c.length;v++)c[v].to<=a&&c.splice(v--,1);for(;l<o.length&&o[l].from<=a&&o[l].to>a;)c.push(o[l++]);let b=a+g.nodeSize;if(g.isText){let x=b;l<o.length&&o[l].from<x&&(x=o[l].from);for(let _=0;_<c.length;_++)c[_].to<x&&(x=c[_].to);x<b&&(d=g.cut(x-a),g=g.cut(0,x-a),b=x,y=-1)}let S=g.isInline&&!g.isLeaf?c.filter(t=>!t.inline):c.slice();i(g,S,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?Ye.none:this.node.child(o).marks,r,t),s.placeWidget(n,t,i)},(n,a,l,c)=>{s.syncToMarks(n.marks,r,t);let d;s.findNodeMatch(n,a,l,c)||u&&t.state.selection.from>i&&t.state.selection.to<i+n.nodeSize&&(d=s.findIndexWithChild(o.node))>-1&&s.updateNodeAt(n,a,l,d,t)||s.updateNextNode(n,a,l,t,c,i)||s.addNode(n,a,l,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],l=s.dom;if(l.parentNode==n){for(;l!=o;)o=QG(o),a=!0;o=o.nextSibling}else a=!0,n.insertBefore(l,o);if(s instanceof QP){let c=o?o.previousSibling:n.lastChild;t(s.contentDOM,s.children,i),o=c?c.nextSibling:n.firstChild}}for(;o;)o=QG(o),a=!0;a&&i.trackWrites==n&&(i.trackWrites=null)}(this.contentDOM,this.children,t),Qu&&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 JI)||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=JX(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 l=t.child(o++);if(a+=l.nodeSize,!l.isText)break;s+=l.text}if(a>=r){let c=a<i?s.lastIndexOf(n,i-a-1):-1;if(c>=0&&c+n.length+a>=r)return a+c;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 QN(this,o,n,i);t.input.compositionNodes.push(a),this.children=QJ(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(QH(t,this.outerDeco))return;let n=1!=this.nodeDOM.nodeType,r=this.dom;this.dom=Q$(this.dom,this.nodeDOM,QV(this.outerDeco,this.node,n),QV(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 QD(t,n,r,i,o){QK(i,n,t);let a=new QL(void 0,t,n,r,i,i,i,o,0);return a.contentDOM&&a.updateChildren(o,0),a}class QF extends QL{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 QF(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 QW extends Qj{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 QU extends QL{constructor(t,n,r,i,o,a,u,s,l,c){super(t,n,r,i,o,a,u,l,c),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 Qz=function(t){t&&(this.nodeName=t)};Qz.prototype=Object.create(null);let QB=[new Qz];function QV(t,n,r){if(0==t.length)return QB;let i=r?QB[0]:new Qz,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 Qz(u.nodeName)),u){let l=u[s];null!=l&&(r&&1==o.length&&o.push(i=new Qz(n.isInline?"span":"div")),"class"==s?i.class=(i.class?i.class+" ":"")+l:"style"==s?i.style=(i.style?i.style+";":"")+l:"nodeName"!=s&&(i[s]=l))}}return o}function Q$(t,n,r,i){if(r==QB&&i==QB)return n;let o=n;for(let a=0;a<i.length;a++){let u=i[a],s=r[a];if(a){let l;s&&s.nodeName==u.nodeName&&o!=t&&(l=o.parentNode)&&l.nodeName.toLowerCase()==u.nodeName||((l=document.createElement(u.nodeName)).pmIsDeco=!0,l.appendChild(o),s=QB[0]),o=l}Qq(o,s||QB[0],u)}return o}function Qq(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 l=0;l<u.length;l++)-1==a.indexOf(u[l])&&t.classList.add(u[l]);0==t.classList.length&&t.removeAttribute("class")}if(n.style!=r.style){if(n.style){let c=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,d;for(;d=c.exec(n.style);)t.style.removeProperty(d[1])}r.style&&(t.style.cssText+=r.style)}}function QK(t,n,r){return Q$(t,t,QB,QV(n,r,1!=t.nodeType))}function QH(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 QG(t){let n=t.nextSibling;return t.parentNode.removeChild(t),n}class QZ{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 l=r.children[i-1];if(l instanceof QP)r=l,i=l.children.length;else{s=l,i--;break}}else{if(r==n)break e;i=r.parent.children.indexOf(r),r=r.parent}let c=s.node;if(c){if(c!=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 l=this.top.children[s];if(l.matchesMark(t[o])&&!this.isLocked(l.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 c=QP.create(this.top,t[o],n,r);this.top.children.splice(this.index,0,c),this.top=c,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 l=this.top.children[u];if(l.matchesNode(t,n,r)&&!this.preMatch.matched.has(l)){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 QL){let l=this.preMatch.matched.get(s);if(null!=l&&l!=o)return!1;let c=s.dom,d,f=this.isLocked(c)&&!(t.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==t.text&&3!=s.dirty&&QH(n,s.outerDeco));if(!f&&s.update(t,n,r,i))return this.destroyBetween(this.index,u),s.dom!=c&&(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=QL.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=QL.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 QA(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 QP;)t=(n=t).children[n.children.length-1];(!t||!(t instanceof QF)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((Qa||Qi)&&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 QW(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 QY(t,n){return t.type.side-n.type.side}function QJ(t,n,r,i,o){let a=[];for(let u=0,s=0;u<t.length;u++){let l=t[u],c=s+=l.size;s>=r||c<=n?a.push(l):(s<n&&a.push(l.slice(0,n-s,i)),o&&(a.push(o),o=void 0),c>r&&a.push(l.slice(r-s,l.size,i)))}return a}function QQ(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),l,c;if(J1(r)){for(l=s;o&&!o.node;)o=o.parent;let d=o.node;if(o&&d.isAtom&&JR.isSelectable(d)&&o.parent&&!(d.isInline&&function(t,n,r){for(let i=0==n,o=n==JX(t);i||o;){if(t==r)return!0;let a=JK(t);if(!(t=t.parentNode))return!1;i=i&&0==a,o=o&&a==JX(t)}}(r.focusNode,r.focusOffset,o.dom))){let f=o.posBefore;c=new JR(u==f?s:i.resolve(f))}}else{let p=t.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(p<0)return null;l=i.resolve(p)}if(!c){let h="pointer"==n||t.state.selection.head<s.pos&&!a?1:-1;c=Q9(t,l,s,h)}return c}function QX(t){return t.editable?t.hasFocus():Q7(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Q0(t,n=!1){let r=t.state.selection;if(Q5(t,r),QX(t)){var i,o;if(!n&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Qi){let a=t.domSelectionRange(),u=t.domObserver.currentSelection;if(a.anchorNode&&u.anchorNode&&JY(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,l,c,d;i=t,s=i.domSelection(),l=document.createRange(),c=i.cursorWrapper.dom,d="IMG"==c.nodeName,d?l.setEnd(c.parentNode,JK(c)+1):l.setEnd(c,0),l.collapse(!1),s.removeAllRanges(),s.addRange(l),!d&&!i.state.selection.visible&&Qe&&Qt<=11&&(c.disabled=!0,c.disabled=!1)}else{let{anchor:f,head:p}=r,h,m,g,y,v,b;!Q1||r instanceof JI||(r.$from.parent.inlineContent||(h=Q2(t,r.from)),r.empty||r.$from.parent.inlineContent||(m=Q2(t,r.to))),t.docView.setSelection(f,p,t.root,n),Q1&&(h&&Q4(h),m&&Q4(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(()=>{(!QX(o)||o.state.selection.visible)&&o.dom.classList.remove("ProseMirror-hideselection")},20))})))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}let Q1=Qa||Qi&&Qo<63;function Q2(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(Qa&&o&&"false"==o.contentEditable)return Q3(o);if((!o||"false"==o.contentEditable)&&(!a||"false"==a.contentEditable)){if(o)return Q3(o);if(a)return Q3(a)}}function Q3(t){return t.contentEditable="true",Qa&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Q4(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Q5(t,n){if(n instanceof JR){let r=t.docView.descAt(n.from);r!=t.lastSelectedViewDesc&&(Q6(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else Q6(t)}function Q6(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Q9(t,n,r,i){return t.someProp("createSelectionBetween",i=>i(t,n,r))||JI.between(n,r,i)}function Q8(t){return(!t.editable||!!t.hasFocus())&&Q7(t)}function Q7(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 Xe(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&&Jw.findFrom(a,n)}function Xt(t,n){return t.dispatch(t.state.tr.setSelection(n).scrollIntoView()),!0}function Xn(t,n,r){let i=t.state.selection;if(i instanceof JI){if(!i.empty||r.indexOf("s")>-1)return!1;if(t.endOfTextblock(n>0?"forward":"backward")){let o=Xe(t.state,n);return!!o&&o instanceof JR&&Xt(t,o)}if(!(Qs&&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 l=n<0?a.pos-u.nodeSize:a.pos;return!!(u.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM)&&(JR.isSelectable(u)?Xt(t,new JR(n<0?t.state.doc.resolve(a.pos-u.nodeSize):a)):!!Qd&&Xt(t,new JI(t.state.doc.resolve(n<0?l:l+u.nodeSize))))}}else{if(i instanceof JR&&i.node.isInline)return Xt(t,new JI(n>0?i.$to:i.$from));{let c=Xe(t.state,n);return!!c&&Xt(t,c)}}}function Xr(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Xi(t){let n=t.pmViewDesc;return n&&0==n.size&&(t.nextSibling||"BR"!=t.nodeName)}function Xo(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(Qn&&1==r.nodeType&&i<Xr(r)&&Xi(r.childNodes[i])&&(u=!0);;)if(i>0){if(1!=r.nodeType)break;{let s=r.childNodes[i-1];if(Xi(s))o=r,a=--i;else if(3==s.nodeType)i=(r=s).nodeValue.length;else break}}else{if(Xu(r))break;{let l=r.previousSibling;for(;l&&Xi(l);)o=r.parentNode,a=JK(l),l=l.previousSibling;if(l)i=Xr(r=l);else{if((r=r.parentNode)==t.dom)break;i=0}}}u?Xs(t,r,i):o&&Xs(t,o,a)}(t):Xa(t)}function Xa(t){let n=t.domSelectionRange(),r=n.focusNode,i=n.focusOffset;if(!r)return;let o=Xr(r),a,u;for(;;)if(i<o){if(1!=r.nodeType)break;if(Xi(r.childNodes[i]))a=r,u=++i;else break}else{if(Xu(r))break;{let s=r.nextSibling;for(;s&&Xi(s);)a=s.parentNode,u=JK(s)+1,s=s.nextSibling;if(s)i=0,o=Xr(r=s);else{if((r=r.parentNode)==t.dom)break;i=o=0}}}a&&Xs(t,a,u)}function Xu(t){let n=t.pmViewDesc;return n&&n.node&&n.node.isBlock}function Xs(t,n,r){let i=t.domSelection();if(J1(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&&Q0(t)},50)}function Xl(t,n){let r=t.state.doc.resolve(n);if(!(Qi||Ql)&&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 Xc(t,n,r){let i=t.state.selection;if(i instanceof JI&&!i.empty||r.indexOf("s")>-1||Qs&&r.indexOf("m")>-1)return!1;let{$from:o,$to:a}=i;if(!o.parent.inlineContent||t.endOfTextblock(n<0?"up":"down")){let u=Xe(t.state,n);if(u&&u instanceof JR)return Xt(t,u)}if(!o.parent.inlineContent){let s=n<0?o:a,l=i instanceof Jj?Jw.near(s,n):Jw.findFrom(s,n);return!!l&&Xt(t,l)}return!1}function Xd(t,n){if(!(t.state.selection instanceof JI))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 Xf(t,n,r){t.domObserver.stop(),n.contentEditable=r,t.domObserver.start()}function Xp(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")||YK.fromSchema(t.state.schema),l=XT(),c=l.createElement("div");c.appendChild(s.serializeFragment(i,{document:l}));let d=c.firstChild,f,p=0;for(;d&&1==d.nodeType&&(f=X_[d.nodeName.toLowerCase()]);){for(let h=f.length-1;h>=0;h--){let m=l.createElement(f[h]);for(;c.firstChild;)m.appendChild(c.firstChild);c.appendChild(m),p++}d=c.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",`${o} ${a}${p?` -${p}`:""} ${JSON.stringify(r)}`),{dom:c,text:t.someProp("clipboardTextSerializer",r=>r(n,t))||n.content.textBetween(0,n.content.size,`
|
|
10
|
+
|
|
11
|
+
`)}}function Xh(t,n,r,i,o){let a=o.parent.type.spec.code,u,s;if(!r&&!n)return null;let l=n&&(i||a||!r);if(l){if(t.someProp("transformPastedText",r=>{n=r(n,a||i,t)}),a)return n?new Yn(Z6.from(t.state.schema.text(n.replace(/\r\n?/g,`
|
|
12
|
+
`))),0,0):Yn.empty;let c=t.someProp("clipboardTextParser",r=>r(n,o,i,t));if(c)s=c;else{let d=o.marks(),{schema:f}=t.state,p=YK.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=XT().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t),o;if((o=i&&X_[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),Qd&&function(t){let n=t.querySelectorAll(Qi?"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")||YL.fromSchema(t.state.schema)).parseSlice(u,{preserveWhitespace:!!(l||m),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||Xm.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 l=r.nodes[i[s]];if(!l||l.hasRequiredAttrs())break;o=Z6.from(l.create(i[s+1],o)),a++,u++}return new Yn(o,a,u)}(Xx(s,+m[1],+m[2]),m[4]);else if((s=Yn.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&&Xy(n,o,t,a[a.length-1],0))a[a.length-1]=r;else{a.length&&(a[a.length-1]=Xv(a[a.length-1],o.length));let u=Xg(t,n);a.push(u),i=i.matchType(u.type),o=n}}),a)return Z6.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 _=s.content.lastChild;b<s.openEnd&&!_.type.spec.isolating;b++,_=_.lastChild);s=Xx(s,v,b)}return t.someProp("transformPasted",n=>{s=n(s,t)}),s}let Xm=/^(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 Xg(t,n,r=0){for(let i=n.length-1;i>=r;i--)t=n[i].create(null,Z6.from(t));return t}function Xy(t,n,r,i,o){if(o<t.length&&o<n.length&&t[o]==n[o]){let a=Xy(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(Z6.from(Xg(r,t,o+1))))}}function Xv(t,n){if(0==n)return t;let r=t.content.replaceChild(t.childCount-1,Xv(t.lastChild,n-1)),i=t.contentMatchAt(t.childCount).fillBefore(Z6.empty,!0);return t.copy(r.append(i))}function Xb(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=Xb(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(Z6.empty,!0))),t.replaceChild(n<0?0:t.childCount-1,u.copy(s))}function Xx(t,n,r){return n<t.openStart&&(t=new Yn(Xb(t.content,-1,n,t.openStart,0,t.openEnd),n,t.openEnd)),r<t.openEnd&&(t=new Yn(Xb(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}let X_={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},XS=null;function XT(){return XS||(XS=document.implementation.createHTMLDocument("title"))}let Xw={},XO={},Xk={touchstart:!0,touchmove:!0};class XC{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 XI(t,n){t.input.lastSelectionOrigin=n,t.input.lastSelectionTime=Date.now()}function XM(t){t.someProp("handleDOMEvents",n=>{for(let r in n)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=n=>XR(t,n))})}function XR(t,n){return t.someProp("handleDOMEvents",r=>{let i=r[n.type];return!!i&&(i(t,n)||n.defaultPrevented)})}function XE(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 Xj(t){return{left:t.clientX,top:t.clientY}}function XA(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 XN(t,n,r){t.focused||t.focus();let i=t.state.tr.setSelection(n);"pointer"==r&&i.setMeta("pointer",!0),t.dispatch(i)}function XP(t,n,r,i){return XA(t,"handleDoubleClickOn",n,r,i)||t.someProp("handleDoubleClick",r=>r(t,n,i))}function XL(t,n,r,i){return XA(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&&(XN(t,JI.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)XN(t,JI.create(i,s+1,s+1+u.content.size),"pointer");else{if(!JR.isSelectable(u))continue;XN(t,JR.create(i,s),"pointer")}return!0}}(t,r,i)}XO.keydown=(t,n)=>{if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!XW(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Qc&&Qi&&13==n.keyCode))){if(229!=n.keyCode&&t.domObserver.forceFlush(),!Qu||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||Qs&&72==o&&"c"==a)return Xd(t,-1)||Xo(t,-1);if(46==o&&!n.shiftKey||Qs&&68==o&&"c"==a)return Xd(t,1)||Xo(t,1);if(13==o||27==o)return!0;if(37==o||Qs&&66==o&&"c"==a){let u=37==o?"ltr"==Xl(t,t.state.selection.from)?-1:1:-1;return Xn(t,u,a)||Xo(t,u)}if(39==o||Qs&&70==o&&"c"==a){let s=39==o?"ltr"==Xl(t,t.state.selection.from)?1:-1:1;return Xn(t,s,a)||Xo(t,s)}return 38==o||Qs&&80==o&&"c"==a?Xc(t,-1,a)||Xo(t,-1):40==o||Qs&&78==o&&"c"==a?function(t){if(!Qa||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;Xf(t,i,"true"),setTimeout(()=>Xf(t,i,"false"),20)}return!1}(t)||Xc(t,1,a)||Xa(t):a==(Qs?"m":"c")&&(66==o||73==o||89==o||90==o)}(t,n)?n.preventDefault():XI(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,J2(13,"Enter"))),t.input.lastIOSEnter=0)},200)}}},XO.keyup=(t,n)=>{16==n.keyCode&&(t.input.shiftKey=!1)},XO.keypress=(t,n)=>{if(XW(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Qs&&n.metaKey)return;if(t.someProp("handleKeyPress",r=>r(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof JI)||!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 XD=Qs?"metaKey":"ctrlKey";Xw.mousedown=(t,n)=>{var r,i,o;t.input.shiftKey=n.shiftKey;let a=XV(t),u=Date.now(),s="singleClick",l,c;u-t.input.lastClick.time<500&&(l=(o=t.input.lastClick).x-n.clientX,l*l+(c=o.y-n.clientY)*c<100)&&!n[XD]&&("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(Xj(n));d&&("singleClick"==s?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new XF(t,d,n,!!a)):("doubleClick"==s?XP:XL)(t,d.pos,d.inside,n)?n.preventDefault():XI(t,"pointer"))};class XF{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[XD],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,l=s?t.docView.nearestDesc(s,!0):null;this.target=l?l.dom:null;let{selection:c}=t.state;(0==r.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||c instanceof JR&&c.from<=a&&c.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Qn&&!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)),XI(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(()=>Q0(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(Xj(t))),this.updateAllowDefault(t),this.allowDefault||!u?XI(this.view,"pointer"):(n=this.view,r=u.pos,i=u.inside,a=this.selectNode,XA(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 JR&&(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(JR.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&&(XN(t,JR.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&&JR.isSelectable(i))&&(XN(t,new JR(r),"pointer"),!0)}(n,i)))?t.preventDefault():0==t.button&&(this.flushed||Qa&&this.mightDrag&&!this.mightDrag.node.isAtom||Qi&&!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)))?(XN(this.view,Jw.near(this.view.state.doc.resolve(u.pos)),"pointer"),t.preventDefault()):XI(this.view,"pointer")}move(t){this.updateAllowDefault(t),XI(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 XW(t,n){return!!t.composing||!!(Qa&&500>Math.abs(n.timeStamp-t.input.compositionEndedAt))&&(t.input.compositionEndedAt=-2e8,!0)}Xw.touchstart=t=>{t.input.lastTouch=Date.now(),XV(t),XI(t,"pointer")},Xw.touchmove=t=>{t.input.lastTouch=Date.now(),XI(t,"pointer")},Xw.contextmenu=t=>{var n;return XV(t)};let XU=Qc?5e3:-1;function Xz(t,n){clearTimeout(t.input.composingTimeout),n>-1&&(t.input.composingTimeout=setTimeout(()=>XV(t),n))}function XB(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 XV(t,n=!1){if(!(Qc&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),XB(t),n||t.docView&&t.docView.dirty){let r=QQ(t);return r&&!r.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(r)):t.updateState(t.state),!0}return!1}}XO.compositionstart=XO.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(),XV(t,!0),t.markCursor=null;else if(XV(t),Qn&&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}Xz(t,XU)},XO.compositionend=(t,n)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=n.timeStamp,t.input.compositionID++,Xz(t,20))};let X$=Qe&&Qt<15||Qu&&Qf<604;function Xq(t,n,r,i,o){var a;let u=Xh(t,n,r,i,t.state.selection.$from);if(t.someProp("handlePaste",n=>n(t,o,u||Yn.empty)))return!0;if(!u)return!1;let s=0==u.openStart&&0==u.openEnd&&1==u.content.childCount?u.content.firstChild:null,l=s?t.state.tr.replaceSelectionWith(s,i):t.state.tr.replaceSelection(u);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Xw.copy=XO.cut=(t,n)=>{let r=t.state.selection,i="cut"==n.type;if(r.empty)return;let o=X$?null:n.clipboardData,{dom:a,text:u}=Xp(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"))},XO.paste=(t,n)=>{if(t.composing&&!Qc)return;let r=X$?null:n.clipboardData,i=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&Xq(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?Xq(t,i.value,null,o,n):Xq(t,i.textContent,i.innerHTML,o,n)},50)}(t,n)};class XK{constructor(t,n){this.slice=t,this.move=n}}let XH=Qs?"altKey":"ctrlKey";for(let XG in Xw.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(Xj(r));if(!(a&&a.pos>=o.from&&a.pos<=(o instanceof JR?o.to-1:o.to))){if(i&&i.mightDrag)t.dispatch(t.state.tr.setSelection(JR.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(JR.create(t.state.doc,u.posBefore)))}}let s=t.state.selection.content(),{dom:l,text:c}=Xp(t,s);r.dataTransfer.clearData(),r.dataTransfer.setData(X$?"Text":"text/html",l.innerHTML),r.dataTransfer.effectAllowed="copyMove",X$||r.dataTransfer.setData("text/plain",c),t.dragging=new XK(s,!r[XH])},Xw.dragend=t=>{let n=t.dragging;window.setTimeout(()=>{t.dragging==n&&(t.dragging=null)},50)},XO.dragover=XO.dragenter=(t,n)=>n.preventDefault(),XO.drop=(t,n)=>{let r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Xj(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=Xh(t,n.dataTransfer.getData(X$?"Text":"text/plain"),X$?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[XH]);if(t.someProp("handleDrop",r=>r(t,n,a||Yn.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 l=s==i.depth?0:i.pos<=(i.start(s+1)+i.end(s+1))/2?-1:1,c=i.index(s)+(l>0?1:0),d=i.node(s),f=!1;if(1==u)f=d.canReplace(c,c,o);else{let p=d.contentMatchAt(c).findWrapping(o.firstChild.type);f=p&&d.canReplaceWith(c,c,p[0])}if(f)return 0==l?i.pos:l<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 l=t.state.tr;u&&l.deleteSelection();let c=l.mapping.map(s),d=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,f=l.doc;if(d?l.replaceRangeWith(c,c,a.content.firstChild):l.replaceRange(c,c,a),l.doc.eq(f))return;let p=l.doc.resolve(c);if(d&&JR.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))l.setSelection(new JR(p));else{let h=l.mapping.map(s);l.mapping.maps[l.mapping.maps.length-1].forEach((t,n,r,i)=>h=i),l.setSelection(Q9(t,p,l.doc.resolve(h)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))},Xw.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())&&Q0(t)},20))},Xw.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)},Xw.beforeinput=(t,n)=>{if(Qi&&Qc&&"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,J2(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)}},XO)Xw[XG]=XO[XG];function XZ(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 XY{constructor(t,n){this.toDOM=t,this.spec=n||X1,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 XX(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof XY&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&XZ(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class XJ{constructor(t,n){this.attrs=t,this.spec=n||X1}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 XX(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof XJ&&XZ(this.attrs,t.attrs)&&XZ(this.spec,t.spec)}static is(t){return t.type instanceof XJ}destroy(){}}let XQ=class t{constructor(t,n){this.attrs=t,this.spec=n||X1}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 XX(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&&XZ(this.attrs,n.attrs)&&XZ(this.spec,n.spec)}destroy(){}};class XX{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new XX(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 XX(t,t,new XY(n,r))}static inline(t,n,r,i){return new XX(t,n,new XJ(r,i))}static node(t,n,r,i){return new XX(t,n,new XQ(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof XJ}}let X0=[],X1={};class X2{constructor(t,n){this.local=t.length?t:X0,this.children=n.length?n:X0}static create(t,n){return n.length?X8(n,t,0,X1):X3}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 l=this.children[s]+1;this.children[s+2].findInner(t-l,n-l,r,i+l,o)}}map(t,n,r){return this==X3||0==t.maps.length?this:this.mapInner(t,n,0,0,r||X1)}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 l=0,c=a;l<r.maps.length;l++){let d=0;r.maps[l].forEach((t,n,r,i)=>{let a=i-r-(n-t);for(let u=0;u<s.length;u+=3){let l=s[u+1];if(l<0||t>l+c-d)continue;let f=s[u]+c-d;n>=f?s[u+1]=t<=f?-2:-1:r>=o&&a&&(s[u]+=a,s[u+1]+=a)}d+=a}),c=r.maps[l].map(c,-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!=X3?(s[p]=m,s[p+1]=g,s[p+2]=x):(s[p+1]=-2,f=!0)}else f=!0}if(f){let _=function(t,n,r,i,o,a,u){function s(t,n){for(let a=0;a<t.local.length;a++){let l=t.local[a].map(i,o,n);l?r.push(l):u.onRemove&&u.onRemove(t.local[a].spec)}for(let c=0;c<t.children.length;c+=3)s(t.children[c+2],t.children[c]+n+1)}for(let l=0;l<t.length;l+=3)-1==t[l+1]&&s(t[l+2],n[l]+a+1);return r}(s,t,n,r,o,a,u),S=X8(_,i,0,u);n=S.local;for(let T=0;T<s.length;T+=3)s[T+1]<0&&(s.splice(T,3),T-=3);for(let w=0,O=0;w<S.children.length;w+=3){let k=S.children[w];for(;O<s.length&&s[O]<k;)O+=3;s.splice(O,0,S.children[w],S.children[w+1],S.children[w+2])}}return new X2(n.sort(X7),s)}(this.children,a||[],t,n,r,i,o):a?new X2(a.sort(X7),X0):X3}add(t,n){return n.length?this==X3?X2.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=X6(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,X8(s,t,u+1,X1)),o+=3}});let a=X5(o?X9(n):n,-r);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||a.splice(u--,1);return new X2(a.length?this.local.concat(a).sort(X7):this.local,i||this.children)}remove(t){return 0==t.length||this==X3?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 l=0,c;l<t.length;l++)(c=t[l])&&c.from>u&&c.to<s&&(t[l]=null,(a||(a=[])).push(c));if(!a)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(a,u+1);d!=X3?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 X2(i,r):X3}forChild(t,n){if(this==X3)return this;if(n.isLeaf)return X2.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 l=this.local[s];if(l.from<u&&l.to>a&&l.type instanceof XJ){let c=Math.max(a,l.from)-a,d=Math.min(u,l.to)-a;c<d&&(i||(i=[])).push(l.copy(c,d))}}if(i){let f=new X2(i.sort(X7),X0);return r?new X4([f,r]):f}return r||X3}eq(t){if(this==t)return!0;if(!(t instanceof X2)||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 eee(this.localsInner(t))}localsInner(t){if(this==X3)return X0;if(t.inlineContent||!this.local.some(XJ.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof XJ||n.push(this.local[r]);return n}}X2.empty=new X2([],[]),X2.removeOverlap=eee;let X3=X2.empty;class X4{constructor(t){this.members=t}map(t,n){let r=this.members.map(r=>r.map(t,n,X1));return X4.from(r)}forChild(t,n){if(n.isLeaf)return X2.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=X3&&(o instanceof X4?r=r.concat(o.members):r.push(o))}return X4.from(r)}eq(t){if(!(t instanceof X4)||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?eee(r?n:n.sort(X7)):X0}static from(t){switch(t.length){case 0:return X3;case 1:return t[0];default:return new X4(t.every(t=>t instanceof X2)?t:t.reduce((t,n)=>t.concat(n instanceof X2?n:n.members),[]))}}}function X5(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 XX(o.from+n,o.to+n,o.type))}return r}function X6(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 X9(t){let n=[];for(let r=0;r<t.length;r++)null!=t[r]&&n.push(t[r]);return n}function X8(t,n,r,i){let o=[],a=!1;n.forEach((n,u)=>{let s=X6(t,n,u+r);if(s){a=!0;let l=X8(s,n,r+u+1,i);l!=X3&&o.push(u,u+n.nodeSize,l)}});let u=X5(a?X9(t):t,-r).sort(X7);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 X2(u,o):X3}function X7(t,n){return t.from-n.from||t.to-n.to}function eee(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),eet(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),eet(n,o,i.copy(a.from,i.to)));break}}return n}function eet(t,n,r){for(;n<t.length&&X7(r,t[n])>0;)n++;t.splice(n,0,r)}function een(t){let n=[];return t.someProp("decorations",r=>{let i=r(t.state);i&&i!=X3&&n.push(i)}),t.cursorWrapper&&n.push(X2.create(t.state.doc,[t.cursorWrapper.deco])),X4.from(n)}let eer={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},eei=Qe&&Qt<=11;class eeo{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 eea{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new eeo,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]);Qe&&Qt<=11&&t.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),eei&&(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,eer)),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(Q8(this.view)){if(this.suppressingSelectionUpdates)return Q0(this.view);if(Qe&&Qt<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&JY(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=JH(i))n.add(i);for(let o=t.anchorNode;o;o=JH(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)&&Q8(n)&&!this.ignoreSelectionChange(i),a=-1,u=-1,s=!1,l=[];if(n.editable)for(let c=0;c<r.length;c++){let d=this.registerMutation(r[c],l);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(Qn&&l.length>1){let f=l.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&&J1(i)&&(m=QQ(n))&&m.eq(Jw.near(n.state.doc.resolve(0),1))?(n.input.lastFocus=0,Q0(n),this.currentSelection.set(i),n.scrollToSelection()):(a>-1||o)&&(a>-1&&(n.docView.markDirty(a,u),t=n,eeu.has(t)||(eeu.set(t,null),-1===["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace))||(t.requiresGeckoHackNode=Qn,ees||(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."),ees=!0))),this.handleDOMChange(a,u,s,l),n.docView&&n.docView.dirty?n.updateState(n.state):this.currentSelection.eq(i)||Q0(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(Qe&&Qt<=11&&t.addedNodes.length)for(let u=0;u<t.addedNodes.length;u++){let{previousSibling:s,nextSibling:l}=t.addedNodes[u];(!s||0>Array.prototype.indexOf.call(t.addedNodes,s))&&(o=s),(!l||0>Array.prototype.indexOf.call(t.addedNodes,l))&&(a=l)}let c=o&&o.parentNode==t.target?JK(o)+1:0,d=r.localPosFromDOM(t.target,c,-1),f=a&&a.parentNode==t.target?JK(a):t.target.childNodes.length,p=r.localPosFromDOM(t.target,f,1);return{from:d,to:p}}}}let eeu=new WeakMap,ees=!1;function eel(t){let n=t.pmViewDesc;if(n)return n.parseRule();if("BR"==t.nodeName&&t.parentNode){if(Qa&&/^(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||Qa&&/^(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 eec=/^(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 eed(t,n,r){return Math.max(r.anchor,r.head)>n.content.size?null:Q9(t,n.resolve(r.anchor),n.resolve(r.head))}function eef(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 eep{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 XC,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(eev),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=eeg(this),eem(this),this.nodeViews=eey(this),this.docView=QD(this.state.doc,eeh(this),een(this),this.dom,this),this.domObserver=new eea(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=QQ(t,a);if(u&&!t.state.selection.eq(u)){if(Qi&&Qc&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",n=>n(t,J2(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 l=t.state.doc.resolve(n),c=l.sharedDepth(r);n=l.before(c+1),r=t.state.doc.resolve(r).after(c+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),l=t.domSelectionRange(),c,d=l.anchorNode;if(d&&t.dom.contains(1==d.nodeType?d:d.parentNode)&&(c=[{node:d,offset:l.anchorOffset}],J1(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Qi&&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")||YL.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:c,ruleFromNode:eel,context:y});if(c&&null!=c[0].pos){let x=c[0].pos,_=c[1]&&c[1].pos;null==_&&(_=x),v={anchor:x+u,head:_+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 l=Math.max(0,a-Math.min(u,s));i-=u+l-a}if(u<a&&t.size<n.size){let c=i<=a&&i>=u?a-i:0;a-=c,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((Qu&&t.input.lastIOSEnter>Date.now()-225||Qc)&&o.some(t=>1==t.nodeType&&!eec.test(t.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",n=>n(t,J2(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y){if(i&&d instanceof JI&&!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=eed(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(Qi&&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 JI&&(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)),Qe&&Qt<=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 _=f.doc.resolveNoCache(y.start-f.from),S=f.doc.resolveNoCache(y.endB-f.from),T=p.resolve(y.start),w=_.sameParent(S)&&_.parent.inlineContent&&T.end()>=y.endA,O;if((Qu&&t.input.lastIOSEnter>Date.now()-225&&(!w||o.some(t=>"DIV"==t.nodeName||"P"==t.nodeName))||!w&&_.pos<f.doc.content.size&&!_.sameParent(S)&&(O=Jw.findFrom(f.doc.resolve(_.pos+1),1,!0))&&O.head==S.pos)&&t.someProp("handleKeyDown",n=>n(t,J2(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||eef(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(eef(a,!0,!0));return!(!u.parent.isTextblock||u.pos>r||eef(u,!0,!1)<r)&&i.parent.content.cut(i.parentOffset).eq(u.parent.content)}(p,y.start,y.endA,_,S)&&t.someProp("handleKeyDown",n=>n(t,J2(8,"Backspace")))){Qc&&Qi&&t.domObserver.suppressSelectionUpdates();return}Qi&&Qc&&y.endB==y.start&&(t.input.lastAndroidDelete=Date.now()),Qc&&!w&&_.start()!=S.start()&&0==S.parentOffset&&_.depth==S.depth&&f.sel&&f.sel.anchor==f.sel.head&&f.sel.head==y.endA&&(y.endB-=2,S=f.doc.resolveNoCache(y.endB-f.from),setTimeout(()=>{t.someProp("handleKeyDown",function(n){return n(t,J2(13,"Enter"))})},20));let k=y.start,C=y.endA,I,M,R;if(w){if(_.pos==S.pos)Qe&&Qt<=11&&0==_.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Q0(t),20)),I=t.state.tr.delete(k,C),M=p.resolve(y.start).marksAcross(p.resolve(y.endA));else if(y.endA==y.endB&&(R=function(t,n){let r=t.firstChild.marks,i=n.firstChild.marks,o=r,a=i,u,s,l;for(let c=0;c<i.length;c++)o=i[c].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",l=t=>t.mark(s.addToSet(t.marks));else{if(0!=o.length||1!=a.length)return null;s=a[0],u="remove",l=t=>t.mark(s.removeFromSet(t.marks))}let f=[];for(let p=0;p<n.childCount;p++)f.push(l(n.child(p)));if(Z6.from(f).eq(t))return{mark:s,type:u}}(_.parent.content.cut(_.parentOffset,S.parentOffset),T.parent.content.cut(T.parentOffset,y.endA-T.start()))))I=t.state.tr,"add"==R.type?I.addMark(k,C,R.mark):I.removeMark(k,C,R.mark);else if(_.parent.child(_.index()).isText&&_.index()==S.index()-(S.textOffset?0:1)){let E=_.parent.textBetween(_.parentOffset,S.parentOffset);if(t.someProp("handleTextInput",n=>n(t,k,C,E)))return;I=t.state.tr.insertText(E,k,C)}}if(I||(I=t.state.tr.replace(k,C,f.doc.slice(y.start-f.from,y.endB-f.from))),f.sel){let j=eed(t,I.doc,f.sel);j&&!(Qi&&Qc&&t.composing&&j.empty&&(y.start!=y.endB||t.input.lastAndroidDelete<Date.now()-100)&&(j.head==k||j.head==I.mapping.map(C)-1)||Qe&&j.empty&&j.head==k)&&I.setSelection(j)}M&&I.ensureMarks(M),t.composing&&I.setMeta("composition",t.input.compositionID),t.dispatch(I.scrollIntoView())})(this,t,n,r,i)),this.domObserver.start(),function(t){for(let n in Xw){let r=Xw[n];t.dom.addEventListener(n,t.input.eventHandlers[n]=n=>{!XE(t,n)||XR(t,n)||!t.editable&&n.type in XO||r(t,n)},Xk[n]?{passive:!0}:void 0)}Qa&&t.dom.addEventListener("input",()=>null),XM(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&&XM(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(eev),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&&(XB(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=eey(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)&&XM(this),this.editable=eeg(this),eem(this);let s=een(this),l=eeh(this),c=r.plugins==t.plugins||r.doc.eq(t.doc)?t.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",d=i||!this.docView.matchesNode(t.doc,l,s);(d||!t.selection.eq(r.selection))&&(o=!0);let f="preserve"==c&&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 l=s.getBoundingClientRect();if(l.top>=r-20){i=s,o=l.top;break}}return{refDOM:i,refTop:o,stack:Qy(t.dom)}}(this);if(o){var p,h,m;this.domObserver.stop();let g,y=d&&(Qe||Qi)&&!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=Qi?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(t.doc,l,s,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=QD(t.doc,l,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(),JY(b.node,b.offset,x.anchorNode,x.anchorOffset)))?Q0(this,y):(Q5(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():f&&function({refDOM:t,refTop:n,stack:r}){let i=t?t.getBoundingClientRect().top:0;Qv(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 JR){let n=this.docView.domAfterPos(this.state.selection.from);1==n.nodeType&&Qg(this,n.getBoundingClientRect(),t)}else Qg(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 l=u[s].props[t];if(null!=l&&(i=n?n(l):l))return i}}hasFocus(){if(Qe){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(Qb)return t.focus(Qb);let n=Qy(t);t.focus(null==Qb?{get preventScroll(){return Qb={preventScroll:!0},!0}}:void 0),Qb||(Qb=!1,Qv(n,0))}(this.dom),Q0(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=J3(o,n.left,n.top);s&&({node:a,offset:u}=s);let l=(t.root.elementFromPoint?t.root:o).elementFromPoint(n.left,n.top),c;if(!l||!t.dom.contains(1!=l.nodeType?l.parentNode:l)){let d=t.dom.getBoundingClientRect();if(!Qx(n,d)||!(l=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 l=s.getClientRects();for(let c=0;c<l.length;c++){let d=l[c];if(Qx(r,d))return t(s,r,d)}}if((u=(u+1)%o)==a)break}return n}(t.dom,n,d)))return null}if(Qa)for(let f=l;a&&f;f=JH(f))f.draggable&&(a=void 0);let p;if(l=(p=(r=l).parentNode)&&/^li$/i.test(p.nodeName)&&n.left<r.getBoundingClientRect().left?p:r,a){if(Qn&&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?c=t.state.doc.content.size:(0==u||1!=a.nodeType||"BR"!=a.childNodes[u-1].nodeName)&&(c=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 l=s.dom.getBoundingClientRect();if(s.node.isBlock&&s.parent&&!u&&(u=!0,l.left>i.left||l.top>i.top?o=s.posBefore:(l.right<i.left||l.bottom<i.top)&&(o=s.posAfter)),!s.contentDOM&&o<0)return(s.node.isBlock?i.top<(l.top+l.bottom)/2:i.left<(l.left+l.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==c&&(c=function(t,n,r){let{node:i,offset:o}=function t(n,r){let i,o=2e8,a,u=0,s=r.top,l=r.top,c,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=JZ(f).getClientRects()}for(let m=0;m<h.length;m++){let g=h[m];if(g.top<=s&&g.bottom>=l){s=Math.max(g.bottom,s),l=Math.min(g.top,l);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&&!c&&g.left<=r.left&&g.right>=r.left&&(c=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&&c&&(i=c,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=QS(i,1);if(a.top!=a.bottom&&Qx(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,l,n));let g=t.docView.nearestDesc(l,!0);return{pos:c,inside:g?g.posAtStart-g.border:-1}}(this,t)}coordsAtPos(t,n=1){return Qw(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 l,c;return QM==(i=n||this.state)&&QR==t?QE:(QM=i,QR=t,QE="up"==t||"down"==t?(a=this,l=i.selection,c="up"==t?l.$from:l.$to,QC(a,i,()=>{let{node:n}=a.docView.domFromPos(c.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=Qw(a,c.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=JZ(o,0,o.nodeValue.length).getClientRects()}for(let s=0;s<u.length;s++){let l=u[s];if(l.bottom>l.top+1&&("up"==t?i.top-l.top>(l.bottom-i.top)*2:l.bottom-i.bottom>(i.bottom-l.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 QI.test(i.parent.textContent)&&u.modify?QC(t,n,()=>{let{focusNode:n,focusOffset:o,anchorNode:a,anchorOffset:s}=t.domSelectionRange(),l=u.caretBidiLevel;u.modify("move",r,"character");let c=i.depth?t.docView.domAfterPos(i.before()):t.dom,{focusNode:d,focusOffset:f}=t.domSelectionRange(),p=d&&!c.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!=l&&(u.caretBidiLevel=l),p}):"left"==r||"backward"==r?!o:a}(this,i,t))}pasteHTML(t,n){return Xq(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Xq(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,[],een(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;XR(this,t)||!Xw[t.type]||!this.editable&&t.type in XO||Xw[t.type](this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return Qa&&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 JY(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 eeh(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"),[XX.node(0,t.state.doc.content.size,n)]}function eem(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:XX.widget(t.state.selection.head,n,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function eeg(t){return!t.someProp("editable",n=>!1===n(t.state))}function eey(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 eev(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 eeb={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:"'"},eex={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ee_="u">typeof navigator&&/Mac/.test(navigator.platform),eeS="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),eeT=0;eeT<10;eeT++)eeb[48+eeT]=eeb[96+eeT]=String(eeT);for(var eeT=1;eeT<=24;eeT++)eeb[eeT+111]="F"+eeT;for(var eeT=65;eeT<=90;eeT++)eeb[eeT]=String.fromCharCode(eeT+32),eex[eeT]=String.fromCharCode(eeT);for(var eew in eeb)eex.hasOwnProperty(eew)||(eex[eew]=eeb[eew]);let eeO="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function eek(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 l=n[s];if(/^(cmd|meta|m)$/i.test(l))u=!0;else if(/^a(lt)?$/i.test(l))i=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))a=!0;else if(/^mod$/i.test(l))eeO?u=!0:o=!0;else throw Error("Unrecognized modifier name: "+l)}return i&&(r="Alt-"+r),o&&(r="Ctrl-"+r),u&&(r="Meta-"+r),a&&(r="Shift-"+r),r}function eeC(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 eeI=(t,n)=>!t.selection.empty&&(n&&n(t.tr.deleteSelection().scrollIntoView()),!0),eeM=(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=eej(i);if(!o){let a=i.blockRange(),u=a&&Jn(a);return null!=u&&(n&&n(t.tr.lift(a,u).scrollIntoView()),!0)}let s=o.nodeBefore;if(!s.type.spec.isolating&&eeq(t,o,n))return!0;if(0==i.parent.content.size&&(eeR(s,"end")||JR.isSelectable(s))){let l=Jl(t.doc,i.before(),i.after(),Yn.empty);if(l&&l.slice.size<l.to-l.from){if(n){let c=t.tr.step(l);c.setSelection(eeR(s,"end")?Jw.findFrom(c.doc.resolve(c.mapping.map(o.pos,-1)),-1):JR.create(c.doc,o.pos-s.nodeSize)),n(c.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 eeR(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 eeE=(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=eej(i)}let u=a&&a.nodeBefore;return!!(u&&JR.isSelectable(u))&&(n&&n(t.tr.setSelection(JR.create(t.doc,a.pos-u.nodeSize)).scrollIntoView()),!0)};function eej(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 eeA=(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=eeP(i);if(!o)return!1;let a=o.nodeAfter;if(eeq(t,o,n))return!0;if(0==i.parent.content.size&&(eeR(a,"start")||JR.isSelectable(a))){let u=Jl(t.doc,i.before(),i.after(),Yn.empty);if(u&&u.slice.size<u.to-u.from){if(n){let s=t.tr.step(u);s.setSelection(eeR(a,"start")?Jw.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):JR.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)},eeN=(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=eeP(i)}let u=a&&a.nodeAfter;return!!(u&&JR.isSelectable(u))&&(n&&n(t.tr.setSelection(JR.create(t.doc,a.pos)).scrollIntoView()),!0)};function eeP(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 eeL=(t,n)=>{let r=t.selection,i=r instanceof JR,o;if(i){if(r.node.isTextblock||!Ja(t.doc,r.from))return!1;o=r.from}else if(null==(o=Js(t.doc,r.from,-1)))return!1;if(n){let a=t.tr.join(o);i&&a.setSelection(JR.create(a.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),n(a.scrollIntoView())}return!0},eeD=(t,n)=>{let r=t.selection,i;if(r instanceof JR){if(r.node.isTextblock||!Ja(t.doc,r.to))return!1;i=r.to}else if(null==(i=Js(t.doc,r.to,1)))return!1;return n&&n(t.tr.join(i).scrollIntoView()),!0},eeF=(t,n)=>{let{$from:r,$to:i}=t.selection,o=r.blockRange(i),a=o&&Jn(o);return null!=a&&(n&&n(t.tr.lift(o,a).scrollIntoView()),!0)},eeW=(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 eeU(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 eez=(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=eeU(o.contentMatchAt(a));if(!u||!o.canReplaceWith(a,a,u))return!1;if(n){let s=r.after(),l=t.tr.replaceWith(s,s,u.createAndFill());l.setSelection(Jw.near(l.doc.resolve(s),1)),n(l.scrollIntoView())}return!0},eeB=(t,n)=>{let r=t.selection,{$from:i,$to:o}=r;if(r instanceof Jj||i.parent.inlineContent||o.parent.inlineContent)return!1;let a=eeU(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(JI.create(s.doc,u+1)),n(s.scrollIntoView())}return!0},eeV=(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(Jo(t.doc,i))return n&&n(t.tr.split(i).scrollIntoView()),!0}let o=r.blockRange(),a=o&&Jn(o);return null!=a&&(n&&n(t.tr.lift(o,a).scrollIntoView()),!0)},ee$=(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(JR.create(t.doc,o))),!0)};function eeq(t,n,r){var i,o,a;let u=n.nodeBefore,s=n.nodeAfter,l,c;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||Ja(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&&(l=(c=u.contentMatchAt(u.childCount)).findWrapping(s.type))&&c.matchType(l[0]||s.type).validEnd){if(r){let m=n.pos+s.nodeSize,g=Z6.empty;for(let y=l.length-1;y>=0;y--)g=Z6.from(l[y].create(null,g));g=Z6.from(u.copy(g));let v=t.tr.step(new Y7(n.pos-1,m,n.pos,m,new Yn(g,1,0),l.length,!0)),b=m+2*l.length;Ja(v.doc,b)&&v.join(b),r(v.scrollIntoView())}return!0}let x=Jw.findFrom(n,1),_=x&&x.$from.blockRange(x.$to),S=_&&Jn(_);if(null!=S&&S>=n.depth)return r&&r(t.tr.lift(_,S).scrollIntoView()),!0;if(h&&eeR(s,"start",!0)&&eeR(u,"end")){let T=u,w=[];for(;w.push(T),!T.isTextblock;)T=T.lastChild;let O=s,k=1;for(;!O.isTextblock;O=O.firstChild)k++;if(T.canReplace(T.childCount,T.childCount,O.content)){if(r){let C=Z6.empty;for(let I=w.length-1;I>=0;I--)C=Z6.from(w[I].copy(C));let M=t.tr.step(new Y7(n.pos-w.length,n.pos+s.nodeSize,n.pos+k,n.pos+s.nodeSize-k,new Yn(C,w.length,0),0,!0));r(M.scrollIntoView())}return!0}}return!1}function eeK(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(JI.create(n.doc,t<0?o.start(a):o.end(a)))),!0)}}let eeH=eeK(-1),eeG=eeK(1);function eeZ(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 l=r.tr;for(let c=0;c<r.selection.ranges.length;c++){let{$from:{pos:d},$to:{pos:f}}=r.selection.ranges[c];l.setBlockType(d,f,t,n)}i(l.scrollIntoView())}return!0}}function eeY(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 eeJ{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,l=t||o.tr,c=()=>(s||!n||l.getMeta("preventDispatch")||this.hasCustomState||a.dispatch(l),u.every(t=>!0===t)),d={...Object.fromEntries(Object.entries(r).map(([t,r])=>[t,(...t)=>{let i=this.buildProps(l,n),o=r(...t)(i);return u.push(o),d}])),run:c};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:eeY({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 eeQ{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 eeX(t,n,r){return void 0===t.config[n]&&t.parent?eeX(t.parent,n,r):"function"==typeof t.config[n]?t.config[n].bind({...r,parent:t.parent?eeX(t.parent,n,r):null}):t.config[n]}function ee0(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 ee1(t){let n=[],{nodeExtensions:r,markExtensions:i}=ee0(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=eeX(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=eeX(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 ee2(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 ee3(...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 ee4(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)=>ee3(t,n),{})}function ee5(t){return"function"==typeof t}function ee6(t,n,...r){return ee5(t)?n?t.bind(n)(...r):t(...r):t}function ee9(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 ee8(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 ee7(t,n){var r;let i=ee1(t),{nodeExtensions:o,markExtensions:a}=ee0(t),u=null===(r=o.find(t=>eeX(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=eeX(n,"extendNodeSchema",a);return{...t,...i?i(r):{}}},{}),s=ee8({...u,content:ee6(eeX(r,"content",a)),marks:ee6(eeX(r,"marks",a)),group:ee6(eeX(r,"group",a)),inline:ee6(eeX(r,"inline",a)),atom:ee6(eeX(r,"atom",a)),selectable:ee6(eeX(r,"selectable",a)),draggable:ee6(eeX(r,"draggable",a)),code:ee6(eeX(r,"code",a)),defining:ee6(eeX(r,"defining",a)),isolating:ee6(eeX(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}]}))}),l=ee6(eeX(r,"parseHTML",a));l&&(s.parseDOM=l.map(t=>ee9(t,o)));let c=eeX(r,"renderHTML",a);c&&(s.toDOM=t=>c({node:t,HTMLAttributes:ee4(t,o)}));let d=eeX(r,"renderText",a);return d&&(s.toText=d),[r.name,s]})),l=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=eeX(n,"extendMarkSchema",a);return{...t,...i?i(r):{}}},{}),s=ee8({...u,inclusive:ee6(eeX(r,"inclusive",a)),excludes:ee6(eeX(r,"excludes",a)),group:ee6(eeX(r,"group",a)),spanning:ee6(eeX(r,"spanning",a)),code:ee6(eeX(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}]}))}),l=ee6(eeX(r,"parseHTML",a));l&&(s.parseDOM=l.map(t=>ee9(t,o)));let c=eeX(r,"renderHTML",a);return c&&(s.toDOM=t=>c({mark:t,HTMLAttributes:ee4(t,o)})),[r.name,s]}));return new YN({topNode:u,nodes:s,marks:l})}function ete(t,n){return n.nodes[t]||n.marks[t]||null}function ett(t,n){return Array.isArray(n)?n.some(n=>("string"==typeof n?n:n.name)===t.name):n}let etn=(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 l=(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+=l.slice(0,Math.max(0,i-n))}),r};function etr(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class eti{constructor(t){this.find=t.find,this.handler=t.handler}}let eto=(t,n)=>{if(etr(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 eta(t){var n;let{editor:r,from:i,to:o,text:a,rules:u,plugin:s}=t,{view:l}=r;if(l.composing)return!1;let c=l.state.doc.resolve(i);if(c.parent.type.spec.code||!(null===(n=c.nodeBefore||c.nodeAfter)||void 0===n)&&n.marks.find(t=>t.type.spec.code))return!1;let d=!1,f=etn(c)+a;return u.forEach(t=>{if(d)return;let n=eto(f,t.find);if(!n)return;let u=l.state.tr,c=eeY({state:l.state,transaction:u}),p={from:i-(n[0].length-a.length),to:o},{commands:h,chain:m,can:g}=new eeJ({editor:r,state:c});null!==t.handler({state:c,range:p,match:n,commands:h,chain:m,can:g})&&u.steps.length&&(u.setMeta(s,{transform:u,from:i,to:o,text:a}),l.dispatch(u),d=!0)}),d}class etu{constructor(t){this.find=t.find,this.handler=t.handler}}let ets=(t,n)=>{if(etr(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 etl{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=etl.resolve(t),this.schema=ee7(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:ete(t.name,this.schema)};"mark"===t.type&&(!(null!==(n=ee6(eeX(t,"keepOnSplit",r)))&&void 0!==n)||n)&&this.splittableMarks.push(t.name);let i=eeX(t,"onBeforeCreate",r);i&&this.editor.on("beforeCreate",i);let o=eeX(t,"onCreate",r);o&&this.editor.on("create",o);let a=eeX(t,"onUpdate",r);a&&this.editor.on("update",a);let u=eeX(t,"onSelectionUpdate",r);u&&this.editor.on("selectionUpdate",u);let s=eeX(t,"onTransaction",r);s&&this.editor.on("transaction",s);let l=eeX(t,"onFocus",r);l&&this.editor.on("focus",l);let c=eeX(t,"onBlur",r);c&&this.editor.on("blur",c);let d=eeX(t,"onDestroy",r);d&&this.editor.on("destroy",d)})}static resolve(t){let n=etl.sort(etl.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=eeX(t,"addExtensions",n);return r?[t,...this.flatten(r())]:t}).flat(10)}static sort(t){return t.sort((t,n)=>{let r=eeX(t,"priority")||100,i=eeX(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:ete(n.name,this.schema)},i=eeX(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){let{editor:t}=this,n=etl.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:ete(n.name,this.schema)},s=[],l=eeX(n,"addKeyboardShortcuts",u),c={};if("mark"===n.type&&n.config.exitable&&(c.ArrowRight=()=>enV.handleExit({editor:t,mark:n})),l){let d=Object.fromEntries(Object.entries(l()).map(([n,r])=>[n,()=>r({editor:t})]));c={...c,...d}}let f,p=(o=c,new JB({props:{handleKeyDown:(a=o,f=function(t){let n=Object.create(null);for(let r in t)n[eek(r)]=t[r];return n}(a),function(t,n){var r,i;let o=("Esc"==(i=!(ee_&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||eeS&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?eex:eeb)[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[eeC(o,n)];if(u&&u(t.state,t.dispatch,t))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let s=f[eeC(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=eeb[n.keyCode])&&a!=o){let l=f[eeC(a,n)];if(l&&l(t.state,t.dispatch,t))return!0}}return!1})}}));s.push(p);let h=eeX(n,"addInputRules",u);ett(n,t.options.enableInputRules)&&h&&r.push(...h());let m=eeX(n,"addPasteRules",u);ett(n,t.options.enablePasteRules)&&m&&i.push(...m());let g=eeX(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 JB({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)=>eta({editor:n,from:o,to:a,text:u,rules:r,plugin:i}),handleDOMEvents:{compositionend:t=>(setTimeout(()=>{let{$cursor:o}=t.state.selection;o&&eta({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&&eta({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 JB({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 l=r[0],c="paste"===l.getMeta("uiEvent")&&!o,d="drop"===l.getMeta("uiEvent")&&!a;if(!c&&!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=eeY({state:u,transaction:h});if(!(!function(t){let{editor:n,state:r,from:i,to:o,rule:a}=t,{commands:u,chain:s,can:l}=new eeJ({editor:n,state:r}),c=[];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,"");ets(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:l});c.push(f)})}),c.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 ee1(this.extensions)}get nodeViews(){let{editor:t}=this,{nodeExtensions:n}=ee0(this.extensions);return Object.fromEntries(n.filter(t=>!!eeX(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:ee2(n.name,this.schema)},o=eeX(n,"addNodeView",i);if(!o)return[];let a=(i,a,u,s)=>{let l=ee4(i,r);return o()({editor:t,node:i,getPos:u,decorations:s,HTMLAttributes:l,extension:n})};return[n.name,a]}))}}function etc(t){var n;return"Object"===Object.prototype.toString.call(t).slice(8,-1)&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function etd(t,n){let r={...t};return etc(t)&&etc(n)&&Object.keys(n).forEach(i=>{etc(n[i])&&i in t?r[i]=etd(t[i],n[i]):Object.assign(r,{[i]:n[i]})}),r}class etf{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=ee6(eeX(this,"addOptions",{name:this.name}))),this.storage=ee6(eeX(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new etf(t)}configure(t={}){let n=this.extend();return n.options=etd(this.options,t),n.storage=ee6(eeX(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){let n=new etf(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=ee6(eeX(n,"addOptions",{name:n.name})),n.storage=ee6(eeX(n,"addStorage",{name:n.name,options:n.options})),n}}function etp(t,n,r){let{from:i,to:o}=n,{blockSeparator:a=`
|
|
15
|
+
|
|
16
|
+
`,textSerializers:u={}}=r||{},s="",l=!0;return t.nodesBetween(i,o,(t,r,c,d)=>{var f;let p=null==u?void 0:u[t.type.name];p?(t.isBlock&&!l&&(s+=a,l=!0),c&&(s+=p({node:t,pos:r,parent:c,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),l=!1):t.isBlock&&!l&&(s+=a,l=!0)}),s}function eth(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}let etm=etf.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new JB({key:new Jq("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)),l=eth(r);return etp(i,{from:u,to:s},{textSerializers:l})}}})]}}),etg=()=>({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),ety=(t=!1)=>({commands:n})=>n.setContent("",t),etv=()=>({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 l=Jn(s);if(t.type.isTextblock){let{defaultType:c}=a.parent.contentMatchAt(a.index());n.setNodeMarkup(s.start,c)}(l||0===l)&&n.lift(s,l)})}),!0},etb=t=>n=>t(n),etx=()=>({state:t,dispatch:n})=>eeB(t,n),et_=()=>({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},etS=t=>({tr:n,state:r,dispatch:i})=>{let o=ee2(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),l=a.after(u);n.delete(s,l).scrollIntoView()}return!0}return!1},etT=t=>({tr:n,dispatch:r})=>{let{from:i,to:o}=t;return r&&n.delete(i,o),!0},etw=()=>({state:t,dispatch:n})=>eeI(t,n),etO=()=>({commands:t})=>t.keyboardShortcut("Enter"),etk=()=>({state:t,dispatch:n})=>eez(t,n);function etC(t,n,r={strict:!0}){let i=Object.keys(n);return!i.length||i.every(i=>r.strict?n[i]===t[i]:etr(n[i])?n[i].test(t[i]):n[i]===t[i])}function etI(t,n,r={}){return t.find(t=>t.type===n&&etC(t.attrs,r))}function etM(t,n,r={}){return!!etI(t,n,r)}function etR(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=etI([...i.node.marks],n,r);if(!o)return;let a=i.index,u=t.start()+i.offset,s=a+1,l=u+i.node.nodeSize;for(etI([...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&&etM([...t.parent.child(s).marks],n,r);)l+=t.parent.child(s).nodeSize,s+=1;return{from:u,to:l}}function etE(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 etj=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let a=etE(t,i.schema),{doc:u,selection:s}=r,{$from:l,from:c,to:d}=s;if(o){let f=etR(l,a,n);if(f&&f.from<=c&&f.to>=d){let p=JI.create(u,f.from,f.to);r.setSelection(p)}}return!0},etA=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 etN(t){return t instanceof JI}function etP(t=0,n=0,r=0){return Math.min(Math.max(t,n),r)}function etL(t,n=null){if(!n)return null;let r=Jw.atStart(t),i=Jw.atEnd(t);if("start"===n||!0===n)return r;if("end"===n)return i;let o=r.from,a=i.to;return"all"===n?JI.create(t,etP(0,o,a),etP(t.content.size,o,a)):JI.create(t,etP(n,o,a),etP(n,o,a))}function etD(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}let etF=(t=null,n={})=>({editor:r,view:i,tr:o,dispatch:a})=>{n={scrollIntoView:!0,...n};let u=()=>{etD()&&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&&!etN(r.state.selection))return u(),!0;let s=etL(o.doc,t)||r.state.selection,l=r.state.selection.eq(s);return a&&(l||o.setSelection(s),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),u()),!0},etW=(t,n)=>r=>t.every((t,i)=>n(t,{...r,index:i})),etU=(t,n)=>({tr:r,commands:i})=>i.insertContentAt({from:r.selection.from,to:r.selection.to},t,n);function etz(t){let n=`<body>${t}</body>`;return new window.DOMParser().parseFromString(n,"text/html").body}function etB(t,n,r){if(r={slice:!0,parseOptions:{},...r},"object"==typeof t&&null!==t)try{return Array.isArray(t)&&t.length>0?Z6.fromArray(t.map(t=>n.nodeFromJSON(t))):n.nodeFromJSON(t)}catch(i){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),etB("",n,r)}if("string"==typeof t){let o=YL.fromSchema(n);return r.slice?o.parseSlice(etz(t),r.parseOptions).content:o.parse(etz(t),r.parseOptions)}return etB("",n,r)}let etV=t=>t.toString().startsWith("<"),et$=(t,n,r)=>({tr:i,dispatch:o,editor:a})=>{if(o){r={parseOptions:{},updateSelection:!0,...r};let u=etB(n,a.schema,{parseOptions:{preserveWhitespace:"full",...r.parseOptions}});if("<>"===u.toString())return!0;let{from:s,to:l}="number"==typeof t?{from:t,to:t}:t,c=!0,d=!0;if((etV(u)?u:[u]).forEach(t=>{t.check(),c=!!c&&t.isText&&0===t.marks.length,d=!!d&&t.isBlock}),s===l&&d){let{parent:f}=i.doc.resolve(s);!f.isTextblock||f.type.spec.code||f.childCount||(s-=1,l+=1)}c?Array.isArray(n)?i.insertText(n.map(t=>t.text||"").join(""),s,l):"object"==typeof n&&n&&n.text?i.insertText(n.text,s,l):i.insertText(n,s,l):i.replaceWith(s,l,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 Y8||o instanceof Y7))return;let a=t.mapping.maps[i],u=0;a.forEach((t,n,r,i)=>{0===u&&(u=i)}),t.setSelection(Jw.near(t.doc.resolve(u),-1))}(i,i.steps.length-1,-1)}return!0},etq=()=>({state:t,dispatch:n})=>eeL(t,n),etK=()=>({state:t,dispatch:n})=>eeD(t,n),etH=()=>({state:t,dispatch:n})=>eeM(t,n),etG=()=>({state:t,dispatch:n})=>eeA(t,n);function etZ(){return"u">typeof navigator&&/Mac/.test(navigator.platform)}let etY=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 l=n[s];if(/^(cmd|meta|m)$/i.test(l))u=!0;else if(/^a(lt)?$/i.test(l))i=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))a=!0;else if(/^mod$/i.test(l))etD()||etZ()?u=!0:o=!0;else throw Error(`Unrecognized modifier name: ${l}`)}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}),l=n.captureTransaction(()=>{r.someProp("handleKeyDown",t=>t(r,s))});return null==l||l.steps.forEach(t=>{let n=t.map(i.mapping);n&&o&&i.maybeStep(n)}),!0};function etJ(t,n,r={}){let{from:i,to:o,empty:a}=t.selection,u=n?ee2(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 l=s.filter(t=>!u||u.name===t.node.type.name).filter(t=>etC(t.node.attrs,r,{strict:!1}));return a?!!l.length:l.reduce((t,n)=>t+n.to-n.from,0)>=o-i}let etQ=(t,n={})=>({state:r,dispatch:i})=>{let o=ee2(t,r.schema);return!!etJ(r,o,n)&&eeF(r,i)},etX=()=>({state:t,dispatch:n})=>eeV(t,n),et0=t=>({state:n,dispatch:r})=>{var i;let o=ee2(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 Y7(a-1,u,a,u,new Yn(Z6.from(r.create(null,i.parent.copy())),1,0),1,!0)),i=new Yp(o.doc.resolve(i.$from.pos),o.doc.resolve(u),i.depth));let s=Jn(i);if(null==s)return!1;o.lift(i,s);let l=o.mapping.map(a,-1)-1;return Ja(o.doc,l)&&o.join(l),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 l=i.doc.resolve(r.start),c=l.nodeAfter;if(i.mapping.map(r.end)!=r.start+l.nodeAfter.nodeSize)return!1;let d=0==r.startIndex,f=r.endIndex==o.childCount,p=l.node(-1),h=l.index(-1);if(!p.canReplace(h+(d?0:1),h+1,c.content.append(f?Z6.empty:Z6.from(o))))return!1;let m=l.pos,g=m+c.nodeSize;return i.step(new Y7(m-(d?1:0),g+(f?1:0),m+1,g-1,new Yn((d?Z6.empty:Z6.from(o.copy(Z6.empty))).append(f?Z6.empty:Z6.from(o.copy(Z6.empty))),d?0:1,f?0:1),d?0:1)),n(i.scrollIntoView()),!0}(t,n,a)))}(n,r)},et1=()=>({state:t,dispatch:n})=>eeW(t,n);function et2(t,n){return n.nodes[t]?"node":n.marks[t]?"mark":null}function et3(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 et4=(t,n)=>({tr:r,state:i,dispatch:o})=>{let a=null,u=null,s=et2("string"==typeof t?t:t.name,i.schema);return!!s&&("node"===s&&(a=ee2(t,i.schema)),"mark"===s&&(u=etE(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,et3(t.attrs,n)),u&&t.marks.length&&t.marks.forEach(o=>{u===o.type&&r.addMark(i,i+t.nodeSize,u.create(et3(o.attrs,n)))})})}),!0)},et5=()=>({tr:t,dispatch:n})=>(n&&t.scrollIntoView(),!0),et6=()=>({tr:t,commands:n})=>n.setTextSelection({from:0,to:t.doc.content.size}),et9=()=>({state:t,dispatch:n})=>eeE(t,n),et8=()=>({state:t,dispatch:n})=>eeN(t,n),et7=()=>({state:t,dispatch:n})=>ee$(t,n),ene=()=>({state:t,dispatch:n})=>eeG(t,n),ent=()=>({state:t,dispatch:n})=>eeH(t,n);function enn(t,n,r={}){return etB(t,n,{slice:!1,parseOptions:r})}let enr=(t,n=!1,r={})=>({tr:i,editor:o,dispatch:a})=>{let{doc:u}=i,s=enn(t,o.schema,r);return a&&i.replaceWith(0,u.content.size,s).setMeta("preventUpdate",!n),!0};function eni(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 eno(t,n){let r=etE(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 ena(t,n,r){let i=[];return t===n?r.resolve(t).marks().forEach(n=>{let o=r.resolve(t-1),a=etR(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 enu(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 ens(t,n,r={}){let{empty:i,ranges:o}=t.selection,a=n?etE(n,t.schema):null;if(i)return!!(t.storedMarks||t.selection.$from.marks()).filter(t=>!a||a.name===t.type.name).find(t=>etC(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 l=s.filter(t=>!a||a.name===t.mark.type.name).filter(t=>etC(t.mark.attrs,r,{strict:!1})).reduce((t,n)=>t+n.to-n.from,0),c=s.filter(t=>!a||t.mark.type!==a&&t.mark.type.excludes(a)).reduce((t,n)=>t+n.to-n.from,0);return(l>0?l+c:l)>=u}function enl(t,n){let{nodeExtensions:r}=ee0(n),i=r.find(n=>n.name===t);if(!i)return!1;let o={name:i.name,options:i.options,storage:i.storage},a=ee6(eeX(i,"group",o));return"string"==typeof a&&a.split(" ").includes("list")}let enc=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let{selection:a}=r,{empty:u,ranges:s}=a,l=etE(t,i.schema);if(o){if(u){let c=eno(i,l);r.addStoredMark(l.create({...c,...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===l)?t.marks.forEach(t=>{l===t.type&&r.addMark(u,s,l.create({...t.attrs,...n}))}):r.addMark(u,s,l.create(n))})})}return function(t,n,r){var i;let{selection:o}=n,a=null;if(etN(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,l)},end=(t,n)=>({tr:r})=>(r.setMeta(t,n),!0),enf=(t,n={})=>({state:r,dispatch:i,chain:o})=>{let a=ee2(t,r.schema);return a.isTextblock?o().command(({commands:t})=>!!eeZ(a,n)(r)||t.clearNodes()).command(({state:t})=>eeZ(a,n)(t,i)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},enp=t=>({tr:n,dispatch:r})=>{if(r){let{doc:i}=n,o=etP(t,0,i.content.size),a=JR.create(i,o);n.setSelection(a)}return!0},enh=t=>({tr:n,dispatch:r})=>{if(r){let{doc:i}=n,{from:o,to:a}="number"==typeof t?{from:t,to:t}:t,u=JI.atStart(i).from,s=JI.atEnd(i).to,l=etP(o,u,s),c=etP(a,u,s),d=JI.create(i,l,c);n.setSelection(d)}return!0},enm=t=>({state:n,dispatch:r})=>{var i;let o=ee2(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,l=s.child(u-1);if(l.type!=o)return!1;if(n){let c=l.lastChild&&l.lastChild.type==s.type,d=Z6.from(c?o.create():null),f=new Yn(Z6.from(o.create(null,Z6.from(s.type.create(null,d)))),c?3:1,0),p=a.start,h=a.end;n(t.tr.step(new Y7(p-(c?3:1),h,p,h,f,1,!0)).scrollIntoView())}return!0}(n,r)};function eng(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 eny=({keepMarks:t=!0}={})=>({tr:n,state:r,dispatch:i,editor:o})=>{let{selection:a,doc:u}=n,{$from:s,$to:l}=a,c=o.extensionManager.attributes,d=enu(c,s.node().type.name,s.node().attrs);if(a instanceof JR&&a.node.isBlock)return!!(s.parentOffset&&Jo(u,s.pos))&&(i&&(t&&eng(r,o.extensionManager.splittableMarks),n.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;if(i){let f=l.parentOffset===l.parent.content.size;a instanceof JI&&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=Jo(n.doc,n.mapping.map(s.pos),1,h);if(!h&&!m&&Jo(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&&eng(r,o.extensionManager.splittableMarks),n.scrollIntoView()}return!0},env=t=>({tr:n,state:r,dispatch:i,editor:o})=>{var a;let u=ee2(t,r.schema),{$from:s,$to:l}=r.selection,c=r.selection.node;if(c&&c.isBlock||s.depth<2||!s.sameParent(l))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=Z6.empty,h=s.index(-1)?1:s.index(-2)?2:3;for(let m=s.depth-h;m>=s.depth-3;m-=1)p=Z6.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=enu(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(Z6.from(u.createAndFill(null,v)||void 0));let b=s.before(s.depth-(h-1));n.replace(b,s.after(-g),new Yn(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(JI.near(n.doc.resolve(x))),n.scrollIntoView()}return!0}let _=l.pos===s.end()?d.contentMatchAt(0).defaultType:null,S=enu(f,d.type.name,d.attrs),T=enu(f,s.node().type.name,s.node().attrs);if(n.delete(s.pos,l.pos),!Jo(n.doc,s.pos,2))return!1;if(i){let{selection:w,storedMarks:O}=r,{splittableMarks:k}=o.extensionManager,C=O||w.$to.parentOffset&&w.$from.marks();if(n.split(s.pos,2,_?[{type:u,attrs:S},{type:_,attrs:T}]:[{type:u,attrs:S}]).scrollIntoView(),!C||!i)return!0;let I=C.filter(t=>k.includes(t.type.name));n.ensureMarks(I)}return!0},enb=(t,n)=>{let r=eni(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)&&Ja(t.doc,r.pos)&&t.join(r.pos),!0},enx=(t,n)=>{let r=eni(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)&&Ja(t.doc,i)&&t.join(i),!0},en_=(t,n,r,i={})=>({editor:o,tr:a,state:u,dispatch:s,chain:l,commands:c,can:d})=>{let{extensions:f,splittableMarks:p}=o.extensionManager,h=ee2(t,u.schema),m=ee2(n,u.schema),{selection:g,storedMarks:y}=u,{$from:v,$to:b}=g,x=v.blockRange(b),_=y||g.$to.parentOffset&&g.$from.marks();if(!x)return!1;let S=eni(t=>enl(t.type.name,f))(g);if(x.depth>=1&&S&&x.depth-S.depth<=1){if(S.node.type===h)return c.liftListItem(m);if(enl(S.node.type.name,f)&&h.validContent(S.node.content)&&s)return l().command(()=>(a.setNodeMarkup(S.pos,h),!0)).command(()=>enb(a,h)).command(()=>enx(a,h)).run()}return r&&_&&s?l().command(()=>{let t=d().wrapInList(h,i),n=_.filter(t=>p.includes(t.type.name));return a.ensureMarks(n),!!t||c.clearNodes()}).wrapInList(h,i).command(()=>enb(a,h)).command(()=>enx(a,h)).run():l().command(()=>!!d().wrapInList(h,i)||c.clearNodes()).wrapInList(h,i).command(()=>enb(a,h)).command(()=>enx(a,h)).run()},enS=(t,n={},r={})=>({state:i,commands:o})=>{let{extendEmptyMarkRange:a=!1}=r,u=etE(t,i.schema);return ens(i,u,n)?o.unsetMark(u,{extendEmptyMarkRange:a}):o.setMark(u,n)},enT=(t,n,r={})=>({state:i,commands:o})=>{let a=ee2(t,i.schema),u=ee2(n,i.schema);return etJ(i,a,r)?o.setNode(u):o.setNode(a,r)},enw=(t,n={})=>({state:r,commands:i})=>{let o=ee2(t,r.schema);return etJ(r,o,n)?i.lift(o):i.wrapIn(o,n)},enO=()=>({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 l=s.steps.length-1;l>=0;l-=1)u.step(s.steps[l].invert(s.docs[l]));if(a.text){let c=u.doc.resolve(a.from).marks();u.replaceWith(a.from,a.to,t.schema.text(a.text,c))}else u.delete(a.from,a.to)}return!0}}return!1},enk=()=>({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},enC=(t,n={})=>({tr:r,state:i,dispatch:o})=>{var a;let{extendEmptyMarkRange:u=!1}=n,{selection:s}=r,l=etE(t,i.schema),{$from:c,empty:d,ranges:f}=s;if(!o)return!0;if(d&&u){let{from:p,to:h}=s,m=null===(a=c.marks().find(t=>t.type===l))||void 0===a?void 0:a.attrs,g=etR(c,l,m);g&&(p=g.from,h=g.to),r.removeMark(p,h,l)}else f.forEach(t=>{r.removeMark(t.$from.pos,t.$to.pos,l)});return r.removeStoredMark(l),!0},enI=(t,n={})=>({tr:r,state:i,dispatch:o})=>{let a=null,u=null,s=et2("string"==typeof t?t:t.name,i.schema);return!!s&&("node"===s&&(a=ee2(t,i.schema)),"mark"===s&&(u=etE(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 l=Math.min(i+t.nodeSize,s);r.addMark(Math.max(i,o),l,u.create({...a.attrs,...n}))}})})}),!0)},enM=(t,n={})=>({state:r,dispatch:i})=>{let o=ee2(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&&Jr(u,t,n);return!!s&&(i&&i(r.tr.wrap(u,s).scrollIntoView()),!0)}})(o,n)(r,i)},enR=(t,n={})=>({state:r,dispatch:i})=>{let o=ee2(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,l=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 c=r.doc.resolve(u.start-2);l=new Yp(c,c,u.depth),u.endIndex<u.parent.childCount&&(u=new Yp(o,r.doc.resolve(a.end(u.depth)),u.depth)),s=!0}let d=Jr(l,t,n,u);return!!d&&(i&&i((function(t,n,r,i,o){let a=Z6.empty;for(let u=r.length-1;u>=0;u--)a=Z6.from(r[u].type.create(r[u].attrs,a));t.step(new Y7(n.start-(i?2:0),n.end,n.start,n.end,new Yn(a,0,0),r.length,!0));let s=0;for(let l=0;l<r.length;l++)r[l].type==o&&(s=l+1);let c=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&&Jo(t.doc,d,c)&&(t.split(d,c),d+=2*c),d+=f.child(p).nodeSize;return t})(r.tr,u,d,s,t).scrollIntoView()),!0)}})(o,n)(r,i)};var enE=Object.freeze({__proto__:null,blur:etg,clearContent:ety,clearNodes:etv,command:etb,createParagraphNear:etx,deleteCurrentNode:et_,deleteNode:etS,deleteRange:etT,deleteSelection:etw,enter:etO,exitCode:etk,extendMarkRange:etj,first:etA,focus:etF,forEach:etW,insertContent:etU,insertContentAt:et$,joinUp:etq,joinDown:etK,joinBackward:etH,joinForward:etG,keyboardShortcut:etY,lift:etQ,liftEmptyBlock:etX,liftListItem:et0,newlineInCode:et1,resetAttributes:et4,scrollIntoView:et5,selectAll:et6,selectNodeBackward:et9,selectNodeForward:et8,selectParentNode:et7,selectTextblockEnd:ene,selectTextblockStart:ent,setContent:enr,setMark:enc,setMeta:end,setNode:enf,setNodeSelection:enp,setTextSelection:enh,sinkListItem:enm,splitBlock:eny,splitListItem:env,toggleList:en_,toggleMark:enS,toggleNode:enT,toggleWrap:enw,undoInputRule:enO,unsetAllMarks:enk,unsetMark:enC,updateAttributes:enI,wrapIn:enM,wrapInList:enR});let enj=etf.create({name:"commands",addCommands:()=>({...enE})}),enA=etf.create({name:"editable",addProseMirrorPlugins(){return[new JB({key:new Jq("editable"),props:{editable:()=>this.editor.options.editable}})]}}),enN=etf.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new JB({key:new Jq("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}}}})]}}),enP=etf.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,l=Jw.atStart(i).from===u;return!!o&&!!l&&!!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 etD()||etZ()?o:i},addProseMirrorPlugins(){return[new JB({key:new Jq("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=Jw.atStart(n.doc).from,s=Jw.atEnd(n.doc).to;if(i||!(o===u&&a===s)||0!==r.doc.textBetween(0,r.doc.content.size," "," ").length)return;let l=r.tr,c=eeY({state:r,transaction:l}),{commands:d}=new eeJ({editor:this.editor,state:c});if(d.clearNodes(),l.steps.length)return l}})]}}),enL=etf.create({name:"tabindex",addProseMirrorPlugins(){return[new JB({key:new Jq("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var enD=Object.freeze({__proto__:null,ClipboardTextSerializer:etm,Commands:enj,Editable:enA,FocusEvents:enN,Keymap:enP,Tabindex:enL});let enF=`.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
|
+
}`,enW=class extends eeQ{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}(enF,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=ee5(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(enD):[],...this.options.extensions].filter(t=>["extension","node","mark"].includes(null==t?void 0:t.type));this.extensionManager=new etl(t,this)}createCommandManager(){this.commandManager=new eeJ({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let t=enn(this.options.content,this.schema,this.options.parseOptions),n=etL(t,this.options.autofocus);this.view=new eep(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Jz.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=et2("string"==typeof n?n:n.name,t.schema);return"node"===r?function(t,n){let r=ee2(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?eno(t,n):{}}(this.state,t)}isActive(t,n){return function(t,n,r={}){if(!n)return etJ(t,null,r)||ens(t,null,r);let i=et2(n,t.schema);return"node"===i?etJ(t,n,r):"mark"===i&&ens(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=YK.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 etp(t,r,n)}(this.state.doc,{blockSeparator:n,textSerializers:{...eth(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 enU(t){return new eti({find:t.find,handler({state:n,range:r,match:i}){let o=ee6(t.getAttributes,void 0,i);if(!1===o||null===o)return null;let{tr:a}=n,u=i[i.length-1],s=i[0],l=r.to;if(u){let c=s.search(/\S/),d=r.from+s.indexOf(u),f=d+u.length;if(ena(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+c,d),l=r.from+c+u.length,a.addMark(r.from+c,l,t.type.create(o||{})),a.removeStoredMark(t.type)}}})}function enz(t){return new eti({find:t.find,handler({state:n,range:r,match:i}){let o=n.doc.resolve(r.from),a=ee6(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 enB(t){return new eti({find:t.find,handler({state:n,range:r,match:i,chain:o}){let a=ee6(t.getAttributes,void 0,i)||{},u=n.tr.delete(r.from,r.to),s=u.doc.resolve(r.from).blockRange(),l=s&&Jr(s,t.type,a);if(!l)return null;if(u.wrap(s,l),t.keepMarks&&t.editor){let{selection:c,storedMarks:d}=n,{splittableMarks:f}=t.editor.extensionManager,p=d||c.$to.parentOffset&&c.$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&&Ja(u.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(i,g))&&u.join(r.from-1)}})}let enV=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=ee6(eeX(this,"addOptions",{name:this.name}))),this.storage=ee6(eeX(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(n={}){return new t(n)}configure(t={}){let n=this.extend();return n.options=etd(this.options,t),n.storage=ee6(eeX(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=ee6(eeX(r,"addOptions",{name:r.name})),r.storage=ee6(eeX(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 en${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=ee6(eeX(this,"addOptions",{name:this.name}))),this.storage=ee6(eeX(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new en$(t)}configure(t={}){let n=this.extend();return n.options=etd(this.options,t),n.storage=ee6(eeX(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){let n=new en$(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=ee6(eeX(n,"addOptions",{name:n.name})),n.storage=ee6(eeX(n,"addStorage",{name:n.name,options:n.options})),n}}class enq{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:l}=this.editor,c=t.target,d=3===c.nodeType?null===(n=c.parentElement)||void 0===n?void 0:n.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||!(null===(r=this.contentDOM)||void 0===r)&&r.contains(c)||!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=JR.create(l.state.doc,this.getPos()),b=l.state.tr.setSelection(v);l.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,l=JR.isSelectable(this.node),c="copy"===t.type,d="paste"===t.type,f="cut"===t.type,p="mousedown"===t.type;if(!s&&l&&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||c||d||f||p&&l)}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&&etD()&&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 enK(t){return new etu({find:t.find,handler({state:n,range:r,match:i}){let o=ee6(t.getAttributes,void 0,i);if(!1===o||null===o)return null;let{tr:a}=n,u=i[i.length-1],s=i[0],l=r.to;if(u){let c=s.search(/\S/),d=r.from+s.indexOf(u),f=d+u.length;if(ena(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+c,d),l=r.from+c+u.length,a.addMark(r.from+c,l,t.type.create(o||{})),a.removeStoredMark(t.type)}}})}var enH="bottom",enG="right",enZ="left",enY="auto",enJ=["top",enH,enG,enZ],enQ="start",enX="viewport",en0="popper",en1=enJ.reduce(function(t,n){return t.concat([n+"-"+enQ,n+"-end"])},[]),en2=[].concat(enJ,[enY]).reduce(function(t,n){return t.concat([n,n+"-"+enQ,n+"-end"])},[]),en3=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function en4(t){return t?(t.nodeName||"").toLowerCase():null}function en5(t){if(null==t)return window;if("[object Window]"!==t.toString()){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function en6(t){var n=en5(t).Element;return t instanceof n||t instanceof Element}function en9(t){var n=en5(t).HTMLElement;return t instanceof n||t instanceof HTMLElement}function en8(t){if(typeof ShadowRoot>"u")return!1;var n=en5(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}let en7={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];en9(o)&&en4(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},{});en9(i)&&en4(i)&&(Object.assign(i.style,a),Object.keys(o).forEach(function(t){i.removeAttribute(t)}))})}},requires:["computeStyles"]};function ere(t){return t.split("-")[0]}var ert=Math.max,ern=Math.min,err=Math.round;function eri(){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 ero(){return!/^((?!chrome|android).)*safari/i.test(eri())}function era(t,n,r){void 0===n&&(n=!1),void 0===r&&(r=!1);var i=t.getBoundingClientRect(),o=1,a=1;n&&en9(t)&&(o=t.offsetWidth>0&&err(i.width)/t.offsetWidth||1,a=t.offsetHeight>0&&err(i.height)/t.offsetHeight||1);var u=(en6(t)?en5(t):window).visualViewport,s=!ero()&&r,l=(i.left+(s&&u?u.offsetLeft:0))/o,c=(i.top+(s&&u?u.offsetTop:0))/a,d=i.width/o,f=i.height/a;return{width:d,height:f,top:c,right:l+d,bottom:c+f,left:l,x:l,y:c}}function eru(t){var n=era(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 ers(t,n){var r=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(r&&en8(r)){var i=n;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function erl(t){return en5(t).getComputedStyle(t)}function erc(t){return["table","td","th"].indexOf(en4(t))>=0}function erd(t){return((en6(t)?t.ownerDocument:t.document)||window.document).documentElement}function erf(t){return"html"===en4(t)?t:t.assignedSlot||t.parentNode||(en8(t)?t.host:null)||erd(t)}function erp(t){return en9(t)&&"fixed"!==erl(t).position?t.offsetParent:null}function erh(t){for(var n=en5(t),r=erp(t);r&&erc(r)&&"static"===erl(r).position;)r=erp(r);return r&&("html"===en4(r)||"body"===en4(r)&&"static"===erl(r).position)?n:r||function(t){var n=/firefox/i.test(eri());if(/Trident/i.test(eri())&&en9(t)&&"fixed"===erl(t).position)return null;var r=erf(t);for(en8(r)&&(r=r.host);en9(r)&&0>["html","body"].indexOf(en4(r));){var i=erl(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 erm(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function erg(t,n,r){return ert(t,ern(n,r))}function ery(){return{top:0,right:0,bottom:0,left:0}}function erv(t){return Object.assign({},ery(),t)}function erb(t,n){return n.reduce(function(n,r){return n[r]=t,n},{})}function erx(t){return t.split("-")[1]}var er_={top:"auto",right:"auto",bottom:"auto",left:"auto"};function erS(t){var n,r,i=t.popper,o=t.popperRect,a=t.placement,u=t.variation,s=t.offsets,l=t.position,c=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"),_=enZ,S="top",T=window;if(d){var w=erh(i),O="clientHeight",k="clientWidth";w===en5(i)&&(w=erd(i),"static"!==erl(w).position&&"absolute"===l&&(O="scrollHeight",k="scrollWidth")),("top"===a||(a===enZ||a===enG)&&"end"===u)&&(S=enH,y-=(p&&w===T&&T.visualViewport?T.visualViewport.height:w[O])-o.height,y*=c?1:-1),(a===enZ||("top"===a||a===enH)&&"end"===u)&&(_=enG,m-=(p&&w===T&&T.visualViewport?T.visualViewport.width:w[k])-o.width,m*=c?1:-1)}var C,I,M,R,E,j=Object.assign({position:l},d&&er_),A=!0===f?(C={x:m,y:y},I=en5(i),M=C.x,R=C.y,{x:err(M*(E=I.devicePixelRatio||1))/E||0,y:err(R*E)/E||0}):{x:m,y:y};return(m=A.x,y=A.y,c)?Object.assign({},j,((n={})[S]=x?"0":"",n[_]=b?"0":"",n.transform=1>=(T.devicePixelRatio||1)?"translate("+m+"px, "+y+"px)":"translate3d("+m+"px, "+y+"px, 0)",n)):Object.assign({},j,((r={})[S]=x?y+"px":"",r[_]=b?m+"px":"",r.transform="",r))}var erT={passive:!0},erw={left:"right",right:"left",bottom:"top",top:"bottom"};function erO(t){return t.replace(/left|right|bottom|top/g,function(t){return erw[t]})}var erk={start:"end",end:"start"};function erC(t){return t.replace(/start|end/g,function(t){return erk[t]})}function erI(t){var n,r=en5(t);return{scrollLeft:r.pageXOffset,scrollTop:r.pageYOffset}}function erM(t){return era(erd(t)).left+erI(t).scrollLeft}function erR(t){var n=erl(t),r=n.overflow,i=n.overflowX,o=n.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+i)}function erE(t,n){void 0===n&&(n=[]);var r,i=function t(n){return["html","body","#document"].indexOf(en4(n))>=0?n.ownerDocument.body:en9(n)&&erR(n)?n:t(erf(n))}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=en5(i),u=o?[a].concat(a.visualViewport||[],erR(i)?i:[]):i,s=n.concat(u);return o?s:s.concat(erE(erf(u)))}function erj(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function erA(t,n,r){var i,o,a,u,s,l,c,d,f,p,h,m;return n===enX?erj(function(t,n){var r=en5(t),i=erd(t),o=r.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,l=0;if(o){a=o.width,u=o.height;var c=ero();(c||!c&&"fixed"===n)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:u,x:s+erM(t),y:l}}(t,r)):en6(n)?((a=era(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):erj((u=erd(t),l=erd(u),c=erI(u),d=null==(s=u.ownerDocument)?void 0:s.body,f=ert(l.scrollWidth,l.clientWidth,d?d.scrollWidth:0,d?d.clientWidth:0),p=ert(l.scrollHeight,l.clientHeight,d?d.scrollHeight:0,d?d.clientHeight:0),h=-c.scrollLeft+erM(u),m=-c.scrollTop,"rtl"===erl(d||l).direction&&(h+=ert(l.clientWidth,d?d.clientWidth:0)-f),{width:f,height:p,x:h,y:m}))}function erN(t){var n,r=t.reference,i=t.element,o=t.placement,a=o?ere(o):null,u=o?erx(o):null,s=r.x+r.width/2-i.width/2,l=r.y+r.height/2-i.height/2;switch(a){case"top":n={x:s,y:r.y-i.height};break;case enH:n={x:s,y:r.y+r.height};break;case enG:n={x:r.x+r.width,y:l};break;case enZ:n={x:r.x-i.width,y:l};break;default:n={x:r.x,y:r.y}}var c=a?erm(a):null;if(null!=c){var d="y"===c?"height":"width";switch(u){case enQ:n[c]=n[c]-(r[d]/2-i[d]/2);break;case"end":n[c]=n[c]+(r[d]/2-i[d]/2)}}return n}function erP(t,n){void 0===n&&(n={});var r,i,o,a,u,s,l,c,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,_=void 0===x?en0:x,S=p.altBoundary,T=p.padding,w=void 0===T?0:T,O=erv("number"!=typeof w?w:erb(w,enJ)),k=t.rects.popper,C=t.elements[void 0!==S&&S?_===en0?"reference":en0:_],I=(r=en6(C)?C:C.contextElement||erd(t.elements.popper),d=(c=[].concat("clippingParents"===(i=void 0===v?"clippingParents":v)?(s=erE(erf(r)),l=["absolute","fixed"].indexOf(erl(r).position)>=0&&en9(r)?erh(r):r,en6(l)?s.filter(function(t){return en6(t)&&ers(t,l)&&"body"!==en4(t)}):[]):[].concat(i),[void 0===b?enX:b]))[0],(f=c.reduce(function(t,n){var i=erA(r,n,y);return t.top=ert(i.top,t.top),t.right=ern(i.right,t.right),t.bottom=ern(i.bottom,t.bottom),t.left=ert(i.left,t.left),t},erA(r,d,y))).width=f.right-f.left,f.height=f.bottom-f.top,f.x=f.left,f.y=f.top,f),M=era(t.elements.reference),R=erN({reference:M,element:k,strategy:"absolute",placement:m}),E=erj(Object.assign({},k,R)),j=_===en0?E:M,A={top:I.top-j.top+O.top,bottom:j.bottom-I.bottom+O.bottom,left:I.left-j.left+O.left,right:j.right-I.right+O.right},N=t.modifiersData.offset;if(_===en0&&N){var P=N[m];Object.keys(A).forEach(function(t){var n=[enG,enH].indexOf(t)>=0?1:-1,r=["top",enH].indexOf(t)>=0?"y":"x";A[t]+=P[r]*n})}return A}function erL(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 erD(t){return["top",enG,enH,enZ].some(function(n){return t[n]>=0})}var erF={placement:"bottom",modifiers:[],strategy:"absolute"};function erW(){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 erU,erz,erB,erV,er$,erq,erK=(erU={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,l=en5(n.elements.popper),c=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&c.forEach(function(t){t.addEventListener("scroll",r.update,erT)}),s&&l.addEventListener("resize",r.update,erT),function(){a&&c.forEach(function(t){t.removeEventListener("scroll",r.update,erT)}),s&&l.removeEventListener("resize",r.update,erT)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var n=t.state,r=t.name;n.modifiersData[r]=erN({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:ere(n.placement),variation:erx(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,erS(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,erS(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:{}},en7,{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=en2.reduce(function(t,r){var i,o,u,s,l,c,d,f;return t[r]=(o=n.rects,l=[enZ,"top"].indexOf(s=ere(r))>=0?-1:1,d=(c="function"==typeof a?a(Object.assign({},o,{placement:r})):a)[0],f=c[1],d=d||0,f=(f||0)*l,[enZ,enG].indexOf(s)>=0?{x:f,y:d}:{x:d,y:f}),t},{}),s=u[n.placement],l=s.x,c=s.y;null!=n.modifiersData.popperOffsets&&(n.modifiersData.popperOffsets.x+=l,n.modifiersData.popperOffsets.y+=c),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,l=r.fallbackPlacements,c=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=ere(y),b=l||(v!==y&&m?function(t){if(ere(t)===enY)return[];var n=erO(t);return[erC(t),n,erC(n)]}(y):[erO(y)]),x=[y].concat(b).reduce(function(t,r){var i,o,a,u,s,l,p,h,y,v,b,x,_,S;return t.concat(ere(r)===enY?(o={placement:r,boundary:d,rootBoundary:f,padding:c,flipVariations:m,allowedAutoPlacements:g},u=(a=o).placement,s=a.boundary,l=a.rootBoundary,p=a.padding,h=a.flipVariations,v=void 0===(y=a.allowedAutoPlacements)?en2:y,0===(_=(x=(b=erx(u))?h?en1:en1.filter(function(t){return erx(t)===b}):enJ).filter(function(t){return v.indexOf(t)>=0})).length&&(_=x),Object.keys(S=_.reduce(function(t,r){return t[r]=erP(n,{placement:r,boundary:s,rootBoundary:l,padding:p})[ere(r)],t},{})).sort(function(t,n){return S[t]-S[n]})):r)},[]),_=n.rects.reference,S=n.rects.popper,T=new Map,w=!0,O=x[0],k=0;k<x.length;k++){var C=x[k],I=ere(C),M=erx(C)===enQ,R=["top",enH].indexOf(I)>=0,E=R?"width":"height",j=erP(n,{placement:C,boundary:d,rootBoundary:f,altBoundary:p,padding:c}),A=R?M?enG:enZ:M?enH:"top";_[E]>S[E]&&(A=erO(A));var N=erO(A),P=[];if(a&&P.push(j[I]<=0),s&&P.push(j[A]<=0,j[N]<=0),P.every(function(t){return t})){O=C,w=!1;break}T.set(C,P)}if(w)for(var L=m?3:1,D=function(t){var n=x.find(function(n){var r=T.get(n);if(r)return r.slice(0,t).every(function(t){return t})});if(n)return O=n,"break"},F=L;F>0&&"break"!==D(F);F--);n.placement!==O&&(n.modifiersData[i]._skip=!0,n.placement=O,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,l=i.rootBoundary,c=i.altBoundary,d=i.padding,f=i.tether,p=void 0===f||f,h=i.tetherOffset,m=void 0===h?0:h,g=erP(r,{boundary:s,rootBoundary:l,padding:d,altBoundary:c}),y=ere(r.placement),v=erx(r.placement),b=!v,x=erm(y),_="x"===x?"y":"x",S=r.modifiersData.popperOffsets,T=r.rects.reference,w=r.rects.popper,O="function"==typeof m?m(Object.assign({},r.rects,{placement:r.placement})):m,k="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),C=r.modifiersData.offset?r.modifiersData.offset[r.placement]:null,I={x:0,y:0};if(S){if(void 0===a||a){var M,R="y"===x?"top":enZ,E="y"===x?enH:enG,j="y"===x?"height":"width",A=S[x],N=A+g[R],P=A-g[E],L=p?-w[j]/2:0,D=v===enQ?T[j]:w[j],F=v===enQ?-w[j]:-T[j],W=r.elements.arrow,U=p&&W?eru(W):{width:0,height:0},z=r.modifiersData["arrow#persistent"]?r.modifiersData["arrow#persistent"].padding:ery(),B=z[R],V=z[E],$=erg(0,T[j],U[j]),q=b?T[j]/2-L-$-B-k.mainAxis:D-$-B-k.mainAxis,K=b?-T[j]/2+L+$+V+k.mainAxis:F+$+V+k.mainAxis,H=r.elements.arrow&&erh(r.elements.arrow),G=H?"y"===x?H.clientTop||0:H.clientLeft||0:0,Z=null!=(M=null==C?void 0:C[x])?M:0,Y=erg(p?ern(N,A+q-Z-G):N,A,p?ert(P,A+K-Z):P);S[x]=Y,I[x]=Y-A}if(void 0!==u&&u){var J,Q,X,ee,et,en=S[_],er="y"===_?"height":"width",ei=en+g["x"===x?"top":enZ],eo=en-g["x"===x?enH:enG],ea=-1!==["top",enZ].indexOf(y),eu=null!=(et=null==C?void 0:C[_])?et:0,es=ea?ei:en-T[er]-w[er]-eu+k.altAxis,el=ea?en+T[er]+w[er]-eu-k.altAxis:eo,ec=p&&ea?(ee=erg(es,en,el))>el?el:ee:erg(p?es:ei,en,p?el:eo);S[_]=ec,I[_]=ec-en}r.modifiersData[o]=I}},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=ere(r.placement),l=erm(s),c=[enZ,enG].indexOf(s)>=0?"height":"width";if(!(!a||!u)){var d,f,p=erv("number"!=typeof(d="function"==typeof(d=o.padding)?d(Object.assign({},r.rects,{placement:r.placement})):d)?d:erb(d,enJ)),h=eru(a),m=r.rects.reference[c]+r.rects.reference[l]-u[l]-r.rects.popper[c],g=u[l]-r.rects.reference[l],y=erh(a),v=y?"y"===l?y.clientHeight||0:y.clientWidth||0:0,b=p["y"===l?"top":enZ],x=v-h[c]-p["y"===l?enH:enG],_=v/2-h[c]/2+(m/2-g/2),S=erg(b,_,x);r.modifiersData[i]=((n={})[l]=S,n.centerOffset=S-_,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)))&&ers(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=erP(n,{elementContext:"reference"}),s=erP(n,{altBoundary:!0}),l=erL(u,i),c=erL(s,o,a),d=erD(l),f=erD(c);n.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:f},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}}]},erV=void 0===(erB=(erz=erU).defaultModifiers)?[]:erB,erq=void 0===(er$=erz.defaultOptions)?erF:er$,function(t,n,r){void 0===r&&(r=erq);var i,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},erF,erq),modifiersData:{},elements:{reference:t,popper:n},attributes:{},styles:{}},u=[],s=!1,l={state:a,setOptions:function(r){var i,o,s,d,f,p,h,m,g="function"==typeof r?r(a.options):r;c(),a.options=Object.assign({},erq,a.options,g),a.scrollParents={reference:en6(t)?erE(t):t.contextElement?erE(t.contextElement):[],popper:erE(n)};var y=(s=Object.keys(o=(i=[].concat(erV,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)}),en3.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:l,options:void 0===r?{}:r}),s=function(){};u.push(o||s)}}),l.update()},forceUpdate:function(){if(!s){var t,n,r,i,o,u,c,d,f,p,h,m,g,y,v,b=a.elements,x=b.reference,_=b.popper;if(erW(x,_)){a.rects={reference:(t=x,n=erh(_),r="fixed"===a.options.strategy,d=en9(n),f=en9(n)&&(u=err((o=(i=n).getBoundingClientRect()).width)/i.offsetWidth||1,c=err(o.height)/i.offsetHeight||1,1!==u||1!==c),p=erd(n),h=era(t,f,r),m={scrollLeft:0,scrollTop:0},g={x:0,y:0},(d||!d&&!r)&&(("body"!==en4(n)||erR(p))&&(m=(y=n)!==en5(y)&&en9(y)?{scrollLeft:(v=y).scrollLeft,scrollTop:v.scrollTop}:erI(y)),en9(n)?(g=era(n,!0),g.x+=n.clientLeft,g.y+=n.clientTop):p&&(g.x=erM(p))),{x:h.left+m.scrollLeft-g.x,y:h.top+m.scrollTop-g.y,width:h.width,height:h.height}),popper:eru(_)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(t){return a.modifiersData[t.name]=Object.assign({},t.data)});for(var S=0;S<a.orderedModifiers.length;S++){if(!0===a.reset){a.reset=!1,S=-1;continue}var T=a.orderedModifiers[S],w=T.fn,O=T.options,k=void 0===O?{}:O,C=T.name;"function"==typeof w&&(a=w({state:a,options:k,name:C,instance:l})||a)}}}},update:function(){return o||(o=new Promise(function(t){Promise.resolve().then(function(){o=void 0,t(new Promise(function(t){l.forceUpdate(),t(a)}))})})),o},destroy:function(){c(),s=!0}};if(!erW(t,n))return l;function c(){u.forEach(function(t){return t()}),u=[]}return l.setOptions(r).then(function(t){!s&&r.onFirstUpdate&&r.onFirstUpdate(t)}),l}),erH="tippy-content",erG="tippy-arrow",erZ="tippy-svg-arrow",erY={passive:!0,capture:!0},erJ=function(){return document.body};function erQ(t,n,r){return Array.isArray(t)?t[n]??(Array.isArray(r)?r[n]:r):t}function erX(t,n){var r=({}).toString.call(t);return 0===r.indexOf("[object")&&r.indexOf(n+"]")>-1}function er0(t,n){return"function"==typeof t?t.apply(void 0,n):t}function er1(t,n){var r;return 0===n?t:function(i){clearTimeout(r),r=setTimeout(function(){t(i)},n)}}function er2(t){return[].concat(t)}function er3(t,n){-1===t.indexOf(n)&&t.push(n)}function er4(t){return[].slice.call(t)}function er5(t){return Object.keys(t).reduce(function(n,r){return void 0!==t[r]&&(n[r]=t[r]),n},{})}function er6(){return document.createElement("div")}function er9(t){return["Element","Fragment"].some(function(n){return erX(t,n)})}function er8(t,n){t.forEach(function(t){t&&(t.style.transitionDuration=n+"ms")})}function er7(t,n){t.forEach(function(t){t&&t.setAttribute("data-state",n)})}function eie(t,n,r){var i=n+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){t[i](n,r)})}function eit(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 ein={isTouch:!1},eir=0;function eii(){ein.isTouch||(ein.isTouch=!0,window.performance&&document.addEventListener("mousemove",eio))}function eio(){var t=performance.now();t-eir<20&&(ein.isTouch=!1,document.removeEventListener("mousemove",eio)),eir=t}function eia(){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 eiu=!!("u">typeof window&&"u">typeof document)&&!!window.msCrypto,eis=Object.assign({appendTo:erJ,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}),eil=Object.keys(eis),eic=function(t){Object.keys(t).forEach(function(n){eis[n]=t[n]})};function eid(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=eis[o])?i:a),n},{});return Object.assign({},t,n)}function eif(t,n){var r,i,o=Object.assign({},n,{content:er0(n.content,[t])},n.ignoreAttributes?{}:((i=n.plugins)?Object.keys(eid(Object.assign({},eis,{plugins:i}))):eil).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({},eis.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 eip=function(){return"innerHTML"};function eih(t,n){t[eip()]=n}function eim(t){var n=er6();return!0===t?n.className=erG:(n.className=erZ,er9(t)?n.appendChild(t):eih(n,t)),n}function eig(t,n){er9(n.content)?(eih(t,""),t.appendChild(n.content)):"function"!=typeof n.content&&(n.allowHTML?eih(t,n.content):t.textContent=n.content)}function eiy(t){var n=t.firstElementChild,r=er4(n.children);return{box:n,content:r.find(function(t){return t.classList.contains(erH)}),arrow:r.find(function(t){return t.classList.contains(erG)||t.classList.contains(erZ)}),backdrop:r.find(function(t){return t.classList.contains("tippy-backdrop")})}}function eiv(t){var n=er6(),r=er6();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var i=er6();function o(r,i){var o=eiy(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)&&eig(u,t.props),i.arrow?s?r.arrow!==i.arrow&&(a.removeChild(s),a.appendChild(eim(i.arrow))):a.appendChild(eim(i.arrow)):s&&a.removeChild(s)}return i.className=erH,i.setAttribute("data-state","hidden"),eig(i,t.props),n.appendChild(r),r.appendChild(i),o(t.props,t.props),{popper:n,onUpdate:o}}eiv.$$tippy=!0;var eib=1,eix=[],ei_=[];function eiS(t,n){void 0===n&&(n={});var r,i,o=eis.plugins.concat(n.plugins||[]);document.addEventListener("touchstart",eii,erY),window.addEventListener("blur",eia);var a,u=Object.assign({},n,{plugins:o}),s=(er9(t)?[t]:erX(t,"NodeList")?er4(t):Array.isArray(t)?t:er4(document.querySelectorAll(t))).reduce(function(t,n){var r=n&&function(t,n){var r,i,o,a,u,s,l,c,d=eif(t,Object.assign({},eis,eid(er5(n)))),f=!1,p=!1,h=!1,m=!1,g=[],y=er1(G,d.interactiveDebounce),v=eib++,b=(r=d.plugins).filter(function(t,n){return r.indexOf(t)===n}),x={id:v,reference:t,popper:er6(),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){N("onBeforeUpdate",[x,n]),K();var r=x.props,i=eif(t,Object.assign({},r,er5(n),{ignoreAttributes:!0}));x.props=i,q(),r.interactiveDebounce!==i.interactiveDebounce&&(D(),y=er1(G,i.interactiveDebounce)),r.triggerTarget&&!i.triggerTarget?er2(r.triggerTarget).forEach(function(t){t.removeAttribute("aria-expanded")}):i.triggerTarget&&t.removeAttribute("aria-expanded"),L(),A(),T&&T(r,i),x.popperInstance&&(Q(),ee().forEach(function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)})),N("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=ein.isTouch&&!x.props.touch,o=erQ(x.props.duration,0,eis.duration);if(!(t||n||r||i)&&!M().hasAttribute("disabled")&&(N("onShow",[x],!1),!1!==x.props.onShow(x))){if(x.state.isVisible=!0,I()&&(S.style.visibility="visible"),A(),z(),x.state.isMounted||(S.style.transition="none"),I()){var a,u,s,c,d=E();er8([d.box,d.content],0)}l=function(){var t;if(!(!x.state.isVisible||m)){if(m=!0,S.offsetHeight,S.style.transition=x.props.moveTransition,I()&&x.props.animation){var n,r,i=E(),a=i.box,u=i.content;er8([a,u],o),er7([a,u],"visible")}P(),L(),er3(ei_,x),null==(t=x.popperInstance)||t.forceUpdate(),N("onMount",[x]),x.props.animation&&I()&&V(o,r=function(){x.state.isShown=!0,N("onShown",[x])})}},u=x.props.appendTo,s=M(),(a=x.props.interactive&&u===erJ||"parent"===u?s.parentNode:er0(u,[s])).contains(S)||a.appendChild(S),x.state.isMounted=!0,Q()}},hide:function(){var t=!x.state.isVisible,n=x.state.isDestroyed,r=!x.state.isEnabled,i=erQ(x.props.duration,1,eis.duration);if(!(t||n||r)&&(N("onHide",[x],!1),!1!==x.props.onHide(x))){if(x.state.isVisible=!1,x.state.isShown=!1,m=!1,f=!1,I()&&(S.style.visibility="hidden"),D(),B(),A(!0),I()){var o,a,u=E(),s=u.box,l=u.content;x.props.animation&&(er8([s,l],i),er7([s,l],"hidden"))}P(),L(),x.props.animation?I()&&(a=x.unmount,V(i,function(){!x.state.isVisible&&S.parentNode&&S.parentNode.contains(S)&&a()})):x.unmount()}},hideWithInteractivity:function(t){R().addEventListener("mousemove",y),er3(eix,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()}),S.parentNode&&S.parentNode.removeChild(S),ei_=ei_.filter(function(t){return t!==x}),x.state.isMounted=!1,N("onHidden",[x]))},destroy:function(){x.state.isDestroyed||(x.clearDelayTimeouts(),x.unmount(),K(),delete t._tippy,x.state.isDestroyed=!0,N("onDestroy",[x]))}};if(!d.render)return x;var _=d.render(x),S=_.popper,T=_.onUpdate;S.setAttribute("data-tippy-root",""),S.id="tippy-"+x.id,x.popper=S,t._tippy=x,S._tippy=x;var w=b.map(function(t){return t.fn(x)}),O=t.hasAttribute("aria-expanded");return q(),L(),A(),N("onCreate",[x]),d.showOnCreate&&et(),S.addEventListener("mouseenter",function(){x.props.interactive&&x.state.isVisible&&x.clearDelayTimeouts()}),S.addEventListener("mouseleave",function(){x.props.interactive&&x.props.trigger.indexOf("mouseenter")>=0&&R().addEventListener("mousemove",y)}),x;function k(){var t=x.props.touch;return Array.isArray(t)?t:[t,0]}function C(){return"hold"===k()[0]}function I(){var t;return!!(null!=(t=x.props.render)&&t.$$tippy)}function M(){return c||t}function R(){var t,n,r,i=M().parentNode;return i&&null!=(r=er2(i)[0])&&null!=(n=r.ownerDocument)&&n.body?r.ownerDocument:document}function E(){return eiy(S)}function j(t){return x.state.isMounted&&!x.state.isVisible||ein.isTouch||u&&"focus"===u.type?0:erQ(x.props.delay,t?0:1,eis.delay)}function A(t){void 0===t&&(t=!1),S.style.pointerEvents=x.props.interactive&&!t?"":"none",S.style.zIndex=""+x.props.zIndex}function N(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 P(){var n=x.props.aria;if(n.content){var r="aria-"+n.content,i=S.id;er2(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(){!(O||!x.props.aria.expanded)&&er2(x.props.triggerTarget||t).forEach(function(t){x.props.interactive?t.setAttribute("aria-expanded",x.state.isVisible&&t===M()?"true":"false"):t.removeAttribute("aria-expanded")})}function D(){R().removeEventListener("mousemove",y),eix=eix.filter(function(t){return t!==y})}function F(n){if(!(ein.isTouch&&(h||"mousedown"===n.type))){var r=n.composedPath&&n.composedPath()[0]||n.target;if(!(x.props.interactive&&eit(S,r))){if(er2(x.props.triggerTarget||t).some(function(t){return eit(t,r)})){if(ein.isTouch||x.state.isVisible&&x.props.trigger.indexOf("click")>=0)return}else N("onClickOutside",[x,n]);!0===x.props.hideOnClick&&(x.clearDelayTimeouts(),x.hide(),p=!0,setTimeout(function(){p=!1}),x.state.isMounted||B())}}}function W(){h=!0}function U(){h=!1}function z(){var t=R();t.addEventListener("mousedown",F,!0),t.addEventListener("touchend",F,erY),t.addEventListener("touchstart",U,erY),t.addEventListener("touchmove",W,erY)}function B(){var t=R();t.removeEventListener("mousedown",F,!0),t.removeEventListener("touchend",F,erY),t.removeEventListener("touchstart",U,erY),t.removeEventListener("touchmove",W,erY)}function V(t,n){var r=E().box;function i(t){t.target===r&&(eie(r,"remove",i),n())}if(0===t)return n();eie(r,"remove",s),eie(r,"add",i),s=i}function $(n,r,i){void 0===i&&(i=!1),er2(x.props.triggerTarget||t).forEach(function(t){t.addEventListener(n,r,i),g.push({node:t,eventType:n,handler:r,options:i})})}function q(){var t;C()&&($("touchstart",H,{passive:!0}),$("touchend",Z,{passive:!0})),(t=x.props.trigger).split(/\s+/).filter(Boolean).forEach(function(t){if("manual"!==t)switch($(t,H),t){case"mouseenter":$("mouseleave",Z);break;case"focus":$(eiu?"focusout":"blur",Y);break;case"focusin":$("focusout",Y)}})}function K(){g.forEach(function(t){var n=t.node,r=t.eventType,i=t.handler,o=t.options;n.removeEventListener(r,i,o)}),g=[]}function H(t){var n,r=!1;if(!(!x.state.isEnabled||J(t)||p)){var i,o=(null==(n=u)?void 0:n.type)==="focus";u=t,c=t.currentTarget,L(),!x.state.isVisible&&erX(t,"MouseEvent")&&eix.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=M().contains(a)||S.contains(a);!("mousemove"===t.type&&u)&&(n=ee().concat(S).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],l=a.modifiersData.offset;if(!l)return!0;var c="bottom"===s?l.top.y:0,d="top"===s?l.bottom.y:0,f="right"===s?l.left.x:0,p="left"===s?l.right.x:0,h=r.top-o+c>u,m=o-r.bottom-d>u,g=r.left-i+f>u,y=i-r.right-p>u;return h||m||g||y})&&(D(),en(t)))}function Z(t){if(!(J(t)||x.props.trigger.indexOf("click")>=0&&f)){if(x.props.interactive){x.hideWithInteractivity(t);return}en(t)}}function Y(t){0>x.props.trigger.indexOf("focusin")&&t.target!==M()||x.props.interactive&&t.relatedTarget&&S.contains(t.relatedTarget)||en(t)}function J(t){return!!ein.isTouch&&C()!==t.type.indexOf("touch")>=0}function Q(){X();var n=x.props,r=n.popperOptions,i=n.placement,o=n.offset,a=n.getReferenceClientRect,u=n.moveTransition,s=I()?eiy(S).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||M()}: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(I()){var r=E().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={}}}}];I()&&s&&d.push({name:"arrow",options:{element:s,padding:3}}),d.push.apply(d,(null==r?void 0:r.modifiers)||[]),x.popperInstance=erK(c,S,Object.assign({},r,{placement:i,onFirstUpdate:l,modifiers:d}))}function X(){x.popperInstance&&(x.popperInstance.destroy(),x.popperInstance=null)}function ee(){return er4(S.querySelectorAll("[data-tippy-root]"))}function et(t){x.clearDelayTimeouts(),t&&N("onTrigger",[x,t]),z();var n=j(!0),r=k(),o=r[0],a=r[1];ein.isTouch&&"hold"===o&&a&&(n=a),n?i=setTimeout(function(){x.show()},n):x.show()}function en(t){if(x.clearDelayTimeouts(),N("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=j(!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 er9(t)?s[0]:s}eiS.defaultProps=eis,eiS.setDefaultProps=eic,eiS.currentInput=ein,Object.assign({},en7,{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)}}),eiS.setDefaultProps({render:eiv});class eiT{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&&etN(n.selection),l=this.element.contains(document.activeElement);return!(!(t.hasFocus()||l)||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:l}=t,{selection:c}=s;if(l||!n&&!r)return;this.createTooltip();let{ranges:d}=c,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 JR){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=etP(n,0,i),a=etP(r,0,i),u=t.coordsAtPos(o),s=t.coordsAtPos(a,-1),l=Math.min(u.top,s.top),c=Math.max(u.bottom,s.bottom),d=Math.min(u.left,s.left),f=Math.max(u.right,s.right),p={top:l,bottom:c,left:d,right:f,width:f-d,height:c-l,x:d,y:l};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=eiS(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 eiw=t=>new JB({key:"string"==typeof t.pluginKey?new Jq(t.pluginKey):t.pluginKey,view:n=>new eiT({view:n,...t})});etf.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[eiw({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});let eiO=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=eiw({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 eik extends enW{constructor(){super(...arguments),this.contentComponent=null}}let eiC=({renderers:t})=>o.createElement(o.Fragment,null,Object.entries(t).map(([t,n])=>x.createPortal(n.reactElement,n.element,t)));class eiI 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,x.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(eiC,{renderers:this.state.renderers}))}}let eiM=o.memo(eiI),eiR=(0,o.createContext)({onDragStart:void 0}),eiE=()=>(0,o.useContext)(eiR),eij=o.forwardRef((t,n)=>{let{onDragStart:r}=eiE(),i=t.as||"div";return o.createElement(i,{...t,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})});class eiA{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 eiN extends enq{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(eiR.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 eiA(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 eiP(t,n){return r=>r.editor.contentComponent?new eiN(t,r,n):{}}function eiL(t){return setTimeout(()=>{t()})}function eiD(t){let{debouncedUrl:n,content:r,onContentChange:i,selected:a}=t,l=(0,o.useRef)(null),[c,d]=(0,o.useState)(!1);return(0,s.pQ)(n,()=>{var t;c&&(d(!1),null==(t=l.current)||t.reset())}),(0,y.ju)(n)?n===(null==r?void 0:r.embed_url)?M.jsx(eiW,{content:r,selected:a}):M.jsx(u.SV,{ref:l,renderError:eiF,onError:function(){d(!0),i(void 0)},children:M.jsx(o.Suspense,{fallback:r&&M.jsx(eiW,{content:r,selected:a}),children:M.jsx(eiU,{url:n,selected:a,onContentChange:i})})}):null}function eiF(){return M.jsx(u.yO,{title:"There is no embed data available."})}function eiW(t){let{content:n,selected:r}=t;return M.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 eiU(t){let{url:n,onContentChange:r,selected:i}=t,a=function(t){let{url:n,onContentChange:r}=t,{embedsUrl:i}=tR(),a=(0,m.QT)(eiz,[n,i]),u=(0,s.R9)(r);return(0,o.useEffect)(()=>{let t=eiL(()=>u(a));return()=>{clearTimeout(t)}},[a,u]),a}({url:n,onContentChange:r});return M.jsx(eiW,{content:a,selected:i})}function eiz(t,n){var r;let i=new URL(n);return i.search=new URLSearchParams({url:t}).toString(),(0,p.WY)(i.toString(),{okType:(r=t,tI.object({type:tI.string(),version:tI.string().or(tI.number()).nullish(),title:tI.string().nullish(),author_name:tI.string().nullish(),author_url:tI.string().nullish(),provider_name:tI.string().nullish(),provider_url:tI.string().nullish(),cache_age:tI.string().or(tI.number()).nullish(),thumbnail_url:tI.string().nullish(),thumbnail_width:tI.number().nullish(),thumbnail_height:tI.number().nullish(),html:tI.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 eiB(t){let{id:n,readOnly:r,field:i,content:a,onContentChange:l}=t,c=(0,s.$P)({initialState:(null==a?void 0:a.embed_url)??"",startTransition:o.startTransition});function d(t){c.set(t),(0,y.ju)(t)||l(void 0)}return M.jsxs(u.gN,{footer:(0,y.ju)(c.value)&&M.jsx(u.mS,{children:M.jsx(eiD,{debouncedUrl:c.debouncedValue,content:a,onContentChange:l})}),children:[M.jsx(u.fw,{name:"cloud"}),M.jsx(u.Qy,{htmlFor:n,children:ZQ(i)}),M.jsx(u.JO,{children:M.jsx(Z3,{id:n,readOnly:r,placeholder:ZX(i),value:c.value,onValueChange:d,variant:(0,y.ju)(c.value)?"link":"normal",endAdornment:M.jsx(u.zx,{startIcon:"close",color:"grey",size:"small",disabled:!c,onClick:()=>d("")})})})]})}function eiV(t){return!(t.lat>85||t.lat<-85||t.lng>180||t.lng<-180)}function ei$(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(eiV(o))return o}function eiq(t){return t?`${t.lat}, ${t.lng}`:""}function eiK(t){let n=t.match(/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/);if(!n)return ei$(t);let r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return ei$(t);let o={lat:r,lng:i};return eiV(o)?o:ei$(t)}function eiH(t){let{field:n,id:r,readOnly:i,...a}=t,{onValueChange:s,displayedValue:l,onBlur:c,clearValue:d,isValidCoordinates:f}=function(t){let{content:n,onContentChange:r}=t,i=eiq(null==n?void 0:n.position),[a,u]=(0,o.useState)(i),s=Boolean(eiK(a));return{displayedValue:a,isValidCoordinates:s,onValueChange:u,onBlur:function(){let t=eiK(a);if(!t)return u(""),r(void 0);let{lat:n,lng:i}=t;u(eiq({lat:n,lng:i})),r({__TYPE__:"GeoPointContent",position:{lat:n,lng:i}})},clearValue:function(){u(""),r(void 0)}}}(a);return M.jsxs(u.gN,{children:[M.jsx(u.fw,{name:"place"}),M.jsx(u.Qy,{htmlFor:r,children:ZQ(n)}),M.jsx(u.JO,{children:M.jsx(Z3,{id:r,onValueChange:s,placeholder:"...",readOnly:i,value:l,onBlur:c,variant:f?"link":"normal",endAdornment:M.jsx(u.zx,{startIcon:"close",color:"grey",size:"small",disabled:!l,onClick:d})})})]})}let eiG=to({id:e1(),width:e2(),height:e2(),urls:to({full:e1(),small:e1().transform(function(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()})}),alt_description:e1().optional(),description:e1().nullable()}),eiZ=to({results:ti(eiG)}).transform(t=>t.results);function eiY(t,n){let r=new URLSearchParams({page:"1",per_page:"28",query:n});return(0,p.WY)(`${t}/search/photos?${r.toString()}`,{okType:eiZ})}function eiJ(t){let{onSelectedChange:n}=t,[r,i]=(0,o.useTransition)(),a=(0,s.$P)({initialState:"",ms:300,startTransition:i});return M.jsxs(u.xu,{flexDirection:"column",gap:16,width:"100%",position:"relative",children:[M.jsx(u.CR,{value:a.value,placeholder:"Search on Unsplash.com",onValueChange:a.set}),M.jsx(u.SV,{renderError:()=>M.jsx(t0,{}),children:M.jsx(o.Suspense,{fallback:M.jsx(ei0,{}),children:M.jsx(eiQ,{term:a.debouncedValue,loading:r,onSelectedChange:n})})})]})}function eiQ(t){let{term:n,onSelectedChange:r,loading:i}=t,{media:a,toggleSelected:s,selectedImageId:l}=function(t){var n,r,i;let{term:a,onSelectedChange:u}=t,s=tR(),l=(r=s.unsplashUrl,(0,m.QT)(eiY,[r,a||"citrus fruit"])),c=null==(n=null==l?void 0:l[0])?void 0:n.id,[d,f]=(0,o.useState)();return(0,o.useEffect)(()=>{null==u||u([]),f(void 0)},[c,u]),{media:l,toggleSelected:function(t){if(t.id===d)return f(void 0),null==u?void 0:u([]);f(t.id),null==u||u([{...t,url:t.urls.full,alt:t.alt_description}])},selectedImageId:d}}({term:n,onSelectedChange:r});return M.jsxs(M.Fragment,{children:[M.jsx(eiX,{children:null==a?void 0:a.map(t=>{let n=new URL(t.urls.full).searchParams.get("fm")??"jpg";return M.jsx(u.PB,{url:t.urls.small,filename:t.description??"Unsplash Image",selected:l===t.id,onCardClick:()=>s(t),extension:n,width:t.width,height:t.height,loading:i},t.id)})}),0===a.length&&M.jsx(j,{})]})}function eiX(t){let{children:n}=t;return M.jsx(u.xr,{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 250px), 1fr))",gap:16,paddingBottom:16,position:"relative",width:"100%"},children:n})}function ei0(){return M.jsx(eiX,{children:(0,d.N)(24,M.jsx(ne,{}))})}function ei1(t){let{open:n,onOpenChange:r,onMediaSelected:i,assetType:a}=t,[l,c]=(0,o.useState)("media"),[d,f]=(0,o.useState)([]);function p(t){t||f([]),r(t)}let{containerRef:h}=(0,u.VY)();return M.jsxs(u.Vq,{open:n,onOpenChange:p,size:{width:1216,height:868},onPointerDownOutside(t){h&&(0,s.DX)(h,t.target)&&t.preventDefault()},children:[M.jsx(u.fK,{icon:"image",title:"Media library"}),M.jsxs(u.Zp,{value:l,onValueChange:function(t){if("media"!==t&&"unsplash"!==t)throw Error(`Invalid option ${t}.`);c(t)},padding:"small",width:"auto",children:[M.jsx(u.T9,{value:"media",icon:"photo"}),M.jsx(u.T9,{value:"unsplash",icon:"unsplash"})]}),M.jsx(u.cZ,{children:M.jsxs(u.xu,{overflow:"hidden",backgroundColor:"grey3",padding:{top:16,right:16,left:16},minHeight:"100%",children:["media"===l&&M.jsx(ng,{assetType:a,onSelectedChange:f}),"unsplash"===l&&M.jsx(eiJ,{onSelectedChange:f})]})}),M.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 ei2(t){let{onMediaSelected:n,readOnly:r,isUpdating:i}=t,[a,s]=(0,o.useState)(!1);return M.jsxs(u.aY,{children:[M.jsx(u.Zb,{color:"grey3",variant:"outlined",radius:4,children:M.jsx(u.aY,{children:M.jsx(u.xu,{padding:{block:48},flexDirection:"column",children:M.jsxs(u.R$,{children:[M.jsx(u.av,{name:"cloudUpload"}),M.jsx(u._T,{children:i?"Preparing your image...":"You haven't selected an image"}),!r&&M.jsx(u.Qj,{children:M.jsx(u.zx,{disabled:i,onClick:()=>s(!0),children:"Select image"})})]})})})}),M.jsx(ei1,{open:a,onOpenChange:s,onMediaSelected:n,assetType:"image"})]})}function ei3(t){let{id:n,readOnly:r,altText:i,onValueChange:o,selected:a}=t;return M.jsxs(u.gN,{labelPosition:"side",selected:a,children:[M.jsx(u.Qy,{htmlFor:n,children:"Alt text"}),M.jsx(u.JO,{children:M.jsx(u.oi,{id:n,placeholder:"Short description for the visually impaired",readOnly:r,padding:{input:{inline:16}},value:i,onValueChange:o})})]})}m.Fs.registerFetcherConfig(eiY,{cacheCapacity:5,revalidationStrategy:{type:"never"}});let ei4="__MAIN_THUMBNAIL__";function ei5(t,n,r){let i=t.name===ei4?void 0:t.name,o;return[i,(o=n?(0,c.$)(r)?[r.width,r.height]:(0,c.$)(t.width)||(0,c.$)(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 ei6(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 ei9(t){return null!=t&&t.url?ei6(t.url):void 0}let ei8=({contentView:t,constraints:n,croppedImage:r})=>{let[i,o]=function(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]}(t.origin,n),a=function(t,n,r,i,o){let a=new URL(t);if(o){let{x:u,y:s,width:l,height:c}=n;a.searchParams.set("rect",[u,s,l,c].join(",")),a.searchParams.set("w",r.toString()),a.searchParams.set("h",i.toString())}return a.toString()}(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}}}},ei7=({field:t,content:n,thumbnail:r,croppedImage:i})=>{var o,a,u,s;if(r===ei4){let l=ei8({contentView:n,constraints:null==(o=null==t?void 0:t.config)?void 0:o.constraint,croppedImage:i});return l.url===n.url?n:{...n,...l}}let c=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(!c||!d)return n;let f=ei8({contentView:d,constraints:c,croppedImage:i});return f.url===d.url?n:{...n,thumbnails:{...n.thumbnails,[r]:f}}},eoe=({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)}},eot=({contentView:t,constraints:n})=>{let r=eoe({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}},eon={x:0,y:0,width:0,height:0,zoom:1},eor=({selectedImage:{thumbnail:t,contentView:n}})=>t.width&&t.height?t.width/t.height:n?n.origin.width/n.origin.height:1,eoi=({trigger:t,initialImages:n,initialOption:r,onClose:i})=>{var a;let[s,l]=(0,o.useState)({}),[c,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]??eon;l({...s,[n]:{...r,zoom:t}})},x=t=>{if(!v)return;let n=v.thumbnail.name,r=s[n]??eon;l({...s,[n]:{...r,...t}})},_=t=>{if(!v)return;let n=v.thumbnail.name,r=c[n];d({...c,[n]:{...r,crop:t}})},S=t=>{if(!v)return;let n=v.thumbnail.name,r=c[n]??{};d({...c,[n]:{...r,aspectRatio:t}})},T=s[(null==v?void 0:v.thumbnail.name)??""],w=f?T??((null==v?void 0:v.contentView)&&eot({contentView:v.contentView,constraints:v.thumbnail})):void 0,O=c[(null==v?void 0:v.thumbnail.name)??""];return M.jsxs(u.Vq,{trigger:t,onAnimationEnd:()=>m(!0),open:f,onOpenChange(t){t?(y(r),l({}),d({})):(m(!1),i({option:g,croppedImages:s})),p(t)},children:[M.jsx(u.fK,{icon:"photo",title:"Image editor"}),M.jsx(u.Zp,{value:String(g),onValueChange:t=>y(Number(t)),children:n.map((t,n)=>M.jsx(u.T9,{value:String(n),icon:"photo",title:t.labels[0]??"Main",subtitle:t.labels[1]??""},t.thumbnail.name))}),v&&M.jsx(u.cZ,{children:h&&M.jsx(u.tP,{image:(null==(a=v.contentView)?void 0:a.origin.url)??"",crop:(null==O?void 0:O.crop)??{x:0,y:0},onCropChange:_,zoom:(null==T?void 0:T.zoom)??1,onZoomChange:b,aspectRatio:eor({selectedImage:v,cropper:O}),onAspectRatioChange:S,initialCroppedArea:w,onCropAreaChange:x},v.thumbnail.name)})]})};function eoo(t){var n,r;let{content:i,selected:a,fieldLabel:s,readOnly:l,imageLabel:c,onMediaSelected:d,initialImages:f,initialOption:p=0,onCropperDialogClose:h,onClear:m,children:g}=t,[y,v]=(0,o.useState)(!1),b=(null==(r=null==(n=null==i?void 0:i.url)?void 0:n.split("?")[0])?void 0:r.slice(-4))===".svg",x=null!=i&&i.url&&!l?"visible":"hidden";return M.jsxs(u.Zb,{color:a?"indigo2":"grey2",variant:a?"selected":"dashed",radius:4,children:[M.jsxs(u.Ol,{children:[M.jsxs(u.wP,{children:[s,0!==c.length&&M.jsx(u.xv,{color:"grey11",noSelect:!0,children:` • ${c.join(" • ")}`})]}),M.jsxs(u.Pf,{sx:{visibility:x},children:[M.jsx(eoi,{trigger:M.jsx(u.zx,{startIcon:"crop",disabled:b,children:"Crop & Resize"}),initialImages:f,initialOption:p,onClose:h}),M.jsx(u.zx,{startIcon:"imageSearch",onClick:()=>v(!0),children:"Replace"}),M.jsx(u.zx,{onClick:m,startIcon:"delete",children:"Clear"})]})]}),g,M.jsx(ei1,{open:y,onOpenChange:v,onMediaSelected:d,assetType:"image"})]})}function eoa(t,n){let{width:r,height:i,rect:o}=function(t,n){let[r,i]=function(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]}(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:function(t,n,r,i,o){let a=new URL(t);if(o){let{x:u,y:s,width:l,height:c}=n;a.searchParams.set("rect",[u,s,l,c].join(",")),a.searchParams.set("w",r.toString()),a.searchParams.set("h",i.toString())}return a.toString()}(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 eou(t){let{content:n,field:r,id:i,onContentChange:u,readOnly:s}=t,l=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,l]=(0,o.useState)(0),[c,d]=(0,o.useTransition)(),f=(n=u,(0,o.useMemo)(()=>{var t,r,i;return[{...null==(r=n.config)?void 0:r.constraint,name:ei4}].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(l(t),!r)return;let o=Object.entries(n).reduce((t,[n,r])=>ei7({field:u,content:t,thumbnail:n,croppedImage:r}),r);o!==r&&d(()=>i(o))},onPageChange:function(t){d(()=>l(t))},onMediaSelected:function(t){if(!p)return;let n=function(t,n,r,i){var o,u,s,l,c,d;if(!r){let f=null==(o=n.config)?void 0:o.thumbnails,p=f&&Object.fromEntries(f.map(t=>[t.name,eoa(i,t)]));return{__TYPE__:"ImageContent",...eoa(i,null==(u=n.config)?void 0:u.constraint),thumbnails:p}}if("__MAIN_THUMBNAIL__"===t){let h=eoa(i,null==(s=n.config)?void 0:s.constraint);return h.url===r.url?r:{...r,...h}}let m=null==(c=null==(l=n.config)?void 0:l.thumbnails)?void 0:c.find(n=>n.name===t);if(!m)return r;let g=null==(d=r.thumbnails)?void 0:d[t],y=eoa(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:c,page:s,thumbnail:p,allThumbnails:f,allContentViews:h,contentView:m,onClear:function(){null==l||l(0),i(void 0)}}}({field:r,content:n,onContentChange:u}),_=ZQ(r),S=y.map((t,r)=>{let i=null==v?void 0:v[r];return{thumbnail:t,contentView:i,labels:ei5(t,n,i)}}),T=g&&l?ei5(g,n,b).filter(c.$):[];return M.jsx(eoo,{content:n,fieldLabel:_,imageLabel:T,initialOption:m,initialImages:S,readOnly:s,onMediaSelected:p,onCropperDialogClose:d,onClear:x,children:M.jsx(o.Suspense,{fallback:M.jsx("div",{style:{height:466}}),children:g&&n&&l&&v?M.jsx(eos,{allContentViews:v,content:n,contentView:b,id:i,onContentChange:u,onPageChange:f,page:m,readOnly:s,thumbnailName:g.name,isUpdating:h}):M.jsx(ei2,{onMediaSelected:p,readOnly:s,isUpdating:h})})})}function eos(t){let{allContentViews:n,content:r,contentView:i,id:o,onContentChange:a,onPageChange:s,page:l,readOnly:c,thumbnailName:d,isUpdating:f}=t;return M.jsxs(u.aY,{children:[M.jsx(u.lr,{getItemSource:ei9,items:n,onPageChange:s,page:l,style:{height:400},children:t=>(null==t?void 0:t.url)&&M.jsx(u.d$,{src:ei6(t.url),alt:t.alt??void 0,isUpdating:f},`${d}_${t.url}`)}),M.jsx(ei3,{id:o,readOnly:c||!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===ei4?{...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 M.jsxs(u.gN,{children:[M.jsx(u.fw,{name:"notes"}),M.jsx(u.Qy,{htmlFor:i,children:ZQ(r)}),M.jsx(u.JO,{children:M.jsx(u.Kx,{id:i,placeholder:ZX(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 eoc(t,n,r,i){return(0,h.W7)(t,r,i,30,n)}function eod(){let t=tR();t.searchDocuments||tj("searchDocuments");let{coreApiUrl:n,env:r}=t,i=`${n}/repository`,o=(0,m.QT)(h.Ag,[i,r]);return new Set(o.languages.map(t=>({id:t.id,label:t.name})))}function eof(){let t=tR();t.searchDocuments||tj("searchDocuments");let{coreApiUrl:n,env:r}=t,i=`${n}/repository`,o=(0,m.QT)(h.Mi,[i,r]);return new Set(o.results.map(t=>({id:t,label:t})))}function eop(){let t=tR();t.searchDocuments||tj("searchDocuments");let{customTypesApiUrl:n,env:r,repository:i}=t,o=(0,m.QT)(h.JY,[n,i,r]);return new Set(o)}function eoh(t){return t?(0,b.UI)(t,t=>({id:t,label:t})):new Set}function eom(t){let{filteredLocales:n,setFilteredLocales:r,filteredTags:i,setFilteredTags:a,filteredCustomTypes:s,setFilteredCustomTypes:l,fixedTags:c,fixedCustomTypes:d}=t;return M.jsxs(M.Fragment,{children:[M.jsx(u.SV,{children:M.jsx(o.Suspense,{fallback:M.jsx(eog,{selectedValues:n,onSelectedValuesChange:r,label:"Locale",icon:"public",fetchFilters:eod,multiple:!1}),children:M.jsx(eov,{selectedValues:n,onSelectedValuesChange:r})})}),M.jsx(eog,{selectedValues:i,fixedSelectedValues:eoh(c),onSelectedValuesChange:a,label:"Tags",icon:"label",fetchFilters:eof}),M.jsx(eog,{selectedValues:s,fixedSelectedValues:eoh(d),onSelectedValuesChange:l,label:"Type",icon:"description",fetchFilters:eop})]})}function eog(t){let[n,r]=(0,o.useState)(!1),i=(0,o.useContext)(m.Nk);return M.jsx(u.SV,{renderError:()=>M.jsx(u.R0,{mode:"error",onErrorRetry:null==i?void 0:i.reset,open:n,setOpen:r,values:new Set,...t}),children:M.jsx(o.Suspense,{fallback:M.jsx(u.R0,{mode:"loading",open:n,setOpen:r,values:new Set,...t}),children:M.jsx(eoy,{open:n,setOpen:r,...t})})})}function eoy(t){let{open:n,setOpen:r,onSelectedValuesChange:i,fixedSelectedValues:o,selectedValues:a,label:s,icon:l,fetchFilters:c,multiple:d}=t,f=c();return M.jsx(u.R0,{open:n,setOpen:r,label:s,icon:l,selectedValues:a,values:new Set(f),fixedSelectedValues:o,onSelectedValuesChange:i,multiple:d})}function eov(t){let{selectedValues:n,onSelectedValuesChange:r}=t,[i,a]=(0,o.useState)((0,b.Ps)(n)),u=(0,b.sE)(eod(),t=>{var r;return t.id===(null==(r=(0,b.Ps)(n))?void 0:r.id)});return(null==u?void 0:u.label)!==(null==i?void 0:i.label)&&a(u),M.jsx(eog,{selectedValues:new Set(i?[i]:[]),onSelectedValuesChange:function(t){r(t),a((0,b.Ps)(t))},label:"Locale",icon:"public",fetchFilters:eod,multiple:!1})}function eob(t){let{onSelectDocument:n,fixedCustomTypes:r,fixedTags:i,...a}=t,l=tR(),{searchTerm:c,filteredTags:d,setFilteredTags:f,filteredCustomTypes:p,setFilteredCustomTypes:h,filteredLocales:m,setFilteredLocales:g,typesFilter:y,tagsFilter:v}=function(t,n){let r=tR(),i=(0,s.$P)({initialState:""}),[a,u]=(0,o.useState)(new Set),[l,c]=(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,b.G0)(l,eoh(t)),h=(0,b.G0)(a,eoh(n));return{searchTerm:i,filteredTags:a,setFilteredTags:u,filteredCustomTypes:l,setFilteredCustomTypes:c,filteredLocales:d,setFilteredLocales:f,typesFilter:p,tagsFilter:h}}(r,i),[x,_]=(0,o.useTransition)(),S=(0,s.$P)({initialState:x,ms:100}),{searchDocuments:T}=tR();return M.jsx(u.Vq,{size:{height:727,width:656},hasClose:!1,...a,children:M.jsx(u.cZ,{children:M.jsxs(u.xu,{flexDirection:"column",height:"100%",children:[M.jsxs(u.xu,{padding:{top:16,inline:16},flexDirection:"column",gap:12,children:[M.jsx(u.yt,{value:c.value,onValueChange:c.set,placeholder:"Search a page",icon:"search"}),T&&M.jsx(eom,{filteredTags:d,setFilteredTags:f,filteredCustomTypes:p,setFilteredCustomTypes:h,filteredLocales:m,setFilteredLocales:g,fixedTags:i,fixedCustomTypes:r}),M.jsx(u.xv,{variant:"smallBold",color:"grey11",children:"Link to a document"})]}),l.searchDocuments?M.jsx(u.SV,{renderError:eo_,children:M.jsx(o.Suspense,{children:M.jsx(eoS,{searchTerm:c.debouncedValue,tagsFilter:v,typesFilter:y,localesFilter:m,startTransition:_,onSelectDocument:n})})}):M.jsx(eoT,{message:"Slice Machine does not yet support mock data for linked documents in the simulator."}),M.jsx(eox,{debouncedIsLoading:S.debouncedValue})]})})})}function eox(t){return M.jsx(u.FN,{anchor:M.jsx(u.xu,{position:"relative",width:"100%",justifyContent:"center",bottom:72}),loadingIndicator:!0,open:t.debouncedIsLoading,title:"Loading more results ...",seconds:1})}function eo_(){return M.jsx(u.xu,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:M.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:l}=t,{documents:c,onHasReachedBottom:d}=function(t){var n,r;let{searchTerm:i,tagsFilter:a,typesFilter:u,localesFilter:s}=t,l=tR();l.searchDocuments||tj("searchDocuments");let{coreApiUrl:c,env:d,status:p}=l,[g,y]=(0,o.useState)(""),[v,x]=(0,o.useState)([]),[_,S]=(0,o.useState)(""),T=new URLSearchParams((0,h.fW)([{name:"tags",values:[...(0,b.UI)(a,t=>t.id)]},{name:"customTypes",values:[...(0,b.UI)(u,t=>t.id)]},{name:"language",values:[...(0,b.UI)(s,t=>t.id)]},{name:"status",values:h.Vu[p]},{name:"term",values:[i]}])).toString(),w=(0,m.QT)(eoc,[c,T===_?g:"",d,T]);return T!==_?(S(T),y(""),x(w.results)):w.results.length>0&&(null==(n=(0,f.Z$)(v))?void 0:n.id)!==(null==(r=(0,f.Z$)(w.results))?void 0:r.id)&&x(t=>t.concat(w.results)),{documents:v,onHasReachedBottom:function(){w.cursor&&y(w.cursor)},response:w}}({searchTerm:n,tagsFilter:r,localesFilter:a,typesFilter:i}),p=tR();return M.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:M.jsxs(u.xu,{flexDirection:"column",gap:12,height:"100%",children:[0===c.length&&M.jsx(eoT,{}),c.map(t=>{let n=t.versions[0];if(!n)return null;let i=(0,v.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,f.DY)(n,t=>-i.indexOf(t))}({tags:n.tags,tagsFilter:r});return M.jsx(u.z4,{documentType:n.custom_type_label,documentURL:i,description:n.preview_summary,tags:o,title:t.title,previewImageUrl:n.preview_image,onSelect:()=>l(t.id),statusColor:O[n.status].color},`${t.id}-${n.status}`)})]})})}function eoT(t){let{message:n="We can't find any versions matching this request"}=t;return M.jsx(u.xu,{justifyContent:"center",flexDirection:"column",height:"100%",children:M.jsxs(u.R$,{children:[M.jsx(u.av,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),M.jsx(u._T,{size:"big",children:"Oops!"}),M.jsx(u.nf,{width:360,children:n})]})})}function eow(t){let{hasLink:n,onUnlink:r,selectEnabled:i,selectedType:o,onValueChange:a,openInNewTab:s=!0,setOpenInNewTab:l}=t;return M.jsxs(M.Fragment,{children:[l&&"web"===o&&M.jsx(u.zx,{startIcon:s?"checkBox":"checkBoxOutlinedBlank",color:"grey",size:"small",onClick:()=>l(!s),children:"Open in new tab"}),M.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:[M.jsx(u.Ql,{value:"web",icon:"public",children:"Link to web page"}),M.jsx(u.Ql,{value:"document",icon:"description",children:"Link to Prismic page"}),M.jsx(u.Ql,{value:"media",icon:"image",children:"Link to media"})]}),M.jsx(u.zx,{startIcon:"close",color:"grey",size:"small",disabled:!n,onClick:r})]})}m.Fs.registerFetcherConfig(eoc,{cacheCapacity:500,revalidationStrategy:{type:"never"}});let eoO={DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media"},eok={document:"DocumentLink",web:"ExternalLink",media:"FileLink"},eoC=to({id:e1(),title:e1()});function eoI(t,n,r){return(0,p.WY)(`${t}/documents/${r}`,{credentials:(0,p.xb)(n),okType:eoC})}function eoM(t){var n,r,i,o,a,u;let{media:s}=t,l="kind"in s;return l&&"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())??""}}:l?{__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 eoR(t){var n,r;let{content:i,field:a,id:l,onContentChange:c,readOnly:d}=t,[f,p]=(0,o.useState)(!1),[h,m]=(0,o.useState)(!1),[g,v]=(0,o.useState)(!1),[b,x]=(0,o.useState)(!1),{contentType:_,fieldValue:S,errorBoundaryRef:T,onDocumentSelected:w,onError:O,onMediaSelected:k,...C}=function(t){var n;let{field:r,content:i,onContentChange:a}=t,u=i?"DocumentLink"===i.value.__TYPE__?i.value.id:"ExternalLink"===i.value.__TYPE__?i.value.url:i.value.name:"",[l,c]=(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__:eok[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=l?eoO[l]:void 0;function y(t){if(!t)return a(void 0);switch(l){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:l,selectType:g,fieldValue:u,onValueChange:y,onTypeChange:function(t){c(eok[t]),y("")},placeholder:ZX(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(eoM({media:t}))}}}({content:i,field:a,onContentChange:c}),I="ExternalLink"===_&&(0,y.ju)(S),R={id:l,contentType:_,onBlur:()=>p(!1),onFocus(){p(!0),"DocumentLink"===_&&v(!0),"FileLink"===_&&x(!0),"ImageLink"===_&&x(!0)},readOnly:d||!_,textType:I||"ImageLink"===_||"FileLink"===_?"link":"normal",value:S,...C},{searchDocuments:E}=tR();return M.jsxs(M.Fragment,{children:[M.jsxs(u.J2,{onMouseOverChange:m,open:f||h,align:"start",sideOffset:-3,openDelay:100,closeDelay:200,focusOnEnter:!1,anchor:M.jsxs(u.gN,{onMouseOverChange:p,children:[M.jsx(u.fw,{name:"link"}),M.jsx(u.Qy,{htmlFor:l,children:ZQ(a)}),M.jsx(u.JO,{children:"DocumentLink"===_&&""!==S&&E?M.jsx(eoA,{errorBoundaryRef:T,onError:O,fallback:M.jsx(eoE,{...R,value:"..."}),renderError(){var t;return t=R,M.jsx(eoE,{...t,textType:"link"})},children:M.jsx(eoj,{...R,documentId:S,openDocumentListModal:()=>v(!0)})}):M.jsx(eoE,{...R})})]}),children:[I&&M.jsx(u.oZ,{url:I,title:(0,y.S$)(I)??"",subTitle:I.toString()}),(null==i?void 0:i.value.__TYPE__)==="ImageLink"&&M.jsx(u.Qi,{url:i.value.url,title:i.value.name,subTitle:`${i.value.width} x ${i.value.height} pixels`})]}),M.jsx(ei1,{open:b,onOpenChange:x,onMediaSelected:k,assetType:"all"}),M.jsx(eob,{open:g,onOpenChange:v,onSelectDocument(t){v(!1),w(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:l,contentType:c,isTypeSelectEnabled:d,selectType:f,onTypeChange:p,isTargetNewTab:h,updateWebLinkTarget:m}=t,g="DocumentLink"===c||"ImageLink"===c||"FileLink"===c;return M.jsx(Z3,{id:n,onValueChange:r,placeholder:i,readOnly:o||g,value:a,variant:u,onFocus:s,onBlur:l,cursor:g?"pointer":"text",endAdornment:M.jsx(eow,{hasLink:Boolean(a),onUnlink:()=>r(""),selectEnabled:d,selectedType:f,onValueChange:p,openInNewTab:h,setOpenInNewTab:m})})}function eoj(t){let{id:n,documentId:r,openDocumentListModal:i,onValueChange:o,isTypeSelectEnabled:a,selectType:u,onTypeChange:s}=t,l=function(t){let n=tR();n.searchDocuments||tj("searchDocuments");let{coreApiUrl:r,env:i}=n;return(0,m.QT)(eoI,[r,i,t]).title}(r);return M.jsx(Z3,{id:n,readOnly:!0,value:l,variant:"link",onFocus:i,cursor:"pointer",endAdornment:M.jsx(eow,{hasLink:!0,onUnlink:()=>o(""),selectEnabled:a,selectedType:u,onValueChange:s})})}function eoA(t){let{errorBoundaryRef:n,onError:r,children:i,fallback:a,renderError:s}=t;return M.jsx(u.SV,{ref:n,onError:r,renderError:s,children:M.jsx(o.Suspense,{fallback:a,children:i})})}let eoN=({content:t,field:n,id:r,onContentChange:i,readOnly:o})=>{var a,s;let l=Number(null==t?void 0:t.value),c=Number.isFinite(l)?l:void 0;return M.jsxs(u.gN,{children:[M.jsx(u.fw,{name:"pin"}),M.jsx(u.Qy,{htmlFor:r,children:ZQ(n)}),M.jsx(u.JO,{children:M.jsx(u.Y2,{id:r,value:c,min:null==(a=n.config)?void 0:a.min,max:null==(s=n.config)?void 0:s.max,padding:Z4,placeholder:ZX(n),readOnly:o,onValueChange(t){var n;return i((n=t,void 0===n?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(n)}))}})})]})};var eoP=function(){};eoP.prototype.append=function(t){return t.length?(t=eoP.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},eoP.prototype.prepend=function(t){return t.length?eoP.from(t).append(this):this},eoP.prototype.appendInner=function(t){return new eoD(this,t)},eoP.prototype.slice=function(t,n){return void 0===t&&(t=0),void 0===n&&(n=this.length),t>=n?eoP.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))},eoP.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},eoP.prototype.forEach=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)},eoP.prototype.map=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=this.length);var i=[];return this.forEach(function(n,r){return i.push(t(n,r))},n,r),i},eoP.from=function(t){return t instanceof eoP?t:t&&t.length?new eoL(t):eoP.empty};var eoL=function(t){function n(n){t.call(this),this.values=n}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var r={length:{configurable:!0},depth:{configurable:!0}};return n.prototype.flatten=function(){return this.values},n.prototype.sliceInner=function(t,r){return 0==t&&r==this.length?this:new n(this.values.slice(t,r))},n.prototype.getInner=function(t){return this.values[t]},n.prototype.forEachInner=function(t,n,r,i){for(var o=n;o<r;o++)if(!1===t(this.values[o],i+o))return!1},n.prototype.forEachInvertedInner=function(t,n,r,i){for(var o=n-1;o>=r;o--)if(!1===t(this.values[o],i+o))return!1},n.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new n(this.values.concat(t.flatten()))},n.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new n(t.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(n.prototype,r),n}(eoP);eoP.empty=new eoL([]);var eoD=function(t){function n(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},n.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},n.prototype.forEachInner=function(t,n,r,i){var o=this.left.length;if(n<o&&!1===this.left.forEachInner(t,n,Math.min(r,o),i)||r>o&&!1===this.right.forEachInner(t,Math.max(n-o,0),Math.min(this.length,r)-o,i+o))return!1},n.prototype.forEachInvertedInner=function(t,n,r,i){var o=this.left.length;if(n>o&&!1===this.right.forEachInvertedInner(t,n-o,Math.max(r,o)-o,i+o)||r<o&&!1===this.left.forEachInvertedInner(t,Math.min(n,o),r,i))return!1},n.prototype.sliceInner=function(t,n){if(0==t&&n==this.length)return this;var r=this.left.length;return n<=r?this.left.slice(t,n):t>=r?this.right.slice(t-r,n-r):this.left.slice(t,r).append(this.right.slice(0,n-r))},n.prototype.leafAppend=function(t){var r=this.right.leafAppend(t);if(r)return new n(this.left,r)},n.prototype.leafPrepend=function(t){var r=this.left.leafPrepend(t);if(r)return new n(r,this.right)},n.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new n(this.left,new n(this.right,t)):new n(this,t)},n}(eoP);class eoF{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,l=[],c=[];return this.items.forEach((t,n)=>{if(!t.step){i||(o=(i=this.remapping(r,n+1)).maps.length),o--,c.push(t);return}if(i){c.push(new eoW(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],l.push(new eoW(f,void 0,void 0,l.length+c.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 eoF(this.items.slice(0,r).append(c.reverse().concat(l)),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,l=this.items,c=!i&&l.length?l.get(l.length-1):null;for(let d=0;d<t.steps.length;d++){let f=t.steps[d].invert(t.docs[d]),p=new eoW(t.mapping.maps[d],f,n),h;(h=c&&c.merge(p))&&(p=h,d?u.pop():l=l.slice(0,l.length-1)),u.push(p),n&&(s++,n=void 0),i||(c=p)}let m=s-r.depth,g;return m>eoz&&(o=l,a=m,l=(o.forEach((t,n)=>{if(t.selection&&0==a--)return g=n,!1}),o.slice(g)),s-=m),new eoF(l.append(u),s)}remapping(t,n){let r=new YX;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 eoF(this.items.append(t.map(t=>new eoW(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 l=o.maps[i];if(n.step){let c=t.steps[i].invert(t.docs[i]),d=n.selection&&n.selection.map(o.slice(s+1,i));d&&u++,r.push(new eoW(l,c,d))}else r.push(new eoW(l))},i);let l=[];for(let c=n;c<a;c++)l.push(new eoW(o.maps[c]));let d=this.items.slice(0,i).append(l).append(r),f=new eoF(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)),l=s&&s.getMap();if(r--,l&&n.appendMap(l,r),s){let c=a.selection&&a.selection.map(n.slice(r));c&&o++;let d=new eoW(l.invert(),s,c),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 eoF(eoP.from(i.reverse()),o)}}eoF.empty=new eoF(eoP.empty,0);class eoW{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 eoW(n.getMap().invert(),n,this.selection)}}}class eoU{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}let eoz=20;function eoB(t){let n=[];return t.forEach((t,r,i,o)=>n.push(i,o)),n}function eoV(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 eo$(t,n,r,i){let o=eoH(n),a=eoG.get(n).spec.config,u=(i?t.undone:t.done).popEvent(n,o);if(!u)return;let s=u.selection.resolve(u.transform.doc),l=(i?t.done:t.undone).addTransform(u.transform,n.selection.getBookmark(),a,o),c=new eoU(i?l:u.remaining,i?u.remaining:l,null,0,-1);r(u.transform.setSelection(s).setMeta(eoG,{redo:i,historyState:c}).scrollIntoView())}let eoq=!1,eoK=null;function eoH(t){let n=t.plugins;if(eoK!=n){eoq=!1,eoK=n;for(let r=0;r<n.length;r++)if(n[r].spec.historyPreserveItems){eoq=!0;break}}return eoq}let eoG=new Jq("history"),eoZ=new Jq("closeHistory"),eoY=(t,n)=>{let r=eoG.getState(t);return!!r&&0!=r.done.eventCount&&(n&&eo$(r,t,n,!1),!0)},eoJ=(t,n)=>{let r=eoG.getState(t);return!!r&&0!=r.undone.eventCount&&(n&&eo$(r,t,n,!0),!0)},eoQ=etf.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:n})=>eoY(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 JB({key:eoG,state:{init:()=>new eoU(eoF.empty,eoF.empty,null,0,-1),apply:(n,r,i)=>(function(t,n,r,i){let o=r.getMeta(eoG),a;if(o)return o.historyState;r.getMeta(eoZ)&&(t=new eoU(t.done,t.undone,null,0,-1));let u=r.getMeta("appendedTransaction");if(0==r.steps.length)return t;if(u&&u.getMeta(eoG))return u.getMeta(eoG).redo?new eoU(t.done.addTransform(r,void 0,i,eoH(n)),t.undone,eoB(r.mapping.maps[r.steps.length-1]),t.prevTime,t.prevComposition):new eoU(t.done,t.undone.addTransform(r,void 0,i,eoH(n)),null,t.prevTime,t.prevComposition);if(!1===r.getMeta("addToHistory")||u&&!1===u.getMeta("addToHistory"))return(a=r.getMeta("rebased"))?new eoU(t.done.rebased(r,a),t.undone.rebased(r,a),eoV(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new eoU(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),eoV(t.prevRanges,r.mapping),t.prevTime,t.prevComposition);{let s=r.getMeta("composition"),l=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)),c=u?eoV(t.prevRanges,r.mapping):eoB(r.mapping.maps[r.steps.length-1]);return new eoU(t.done.addTransform(r,l?n.selection.getBookmark():void 0,i,eoH(n)),eoF.empty,c,r.time,s??t.prevComposition)}})(r,i,n,t)},config:t,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i="historyUndo"==r?eoY:"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()}}}),eoX=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,eo0=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,eo1=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,eo2=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,eo3=enV.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",ee3(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[enU({find:eoX,type:this.type}),enU({find:eo1,type:this.type})]},addPasteRules(){return[enK({find:eo0,type:this.type}),enK({find:eo2,type:this.type})]}});var eo4,eo5,eo6=((eo4=eo6||{}).Document="document",eo4.Mark="mark",eo4.Node="node",eo4),eo9=((eo5=eo9||{}).Text="text",eo5.Embed="embed",eo5.Image="image",eo5);class eo8{constructor(t,n,r,i,o,a=!1){w(this,"extType","node"),w(this,"nodeType","text"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a}}function eo7(t){return t instanceof eo8}class eae extends eo8{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class eat extends eo8{constructor(t,n,r,i){super(t,n,r,i)}}function ean(t){return t instanceof eat}let ear=en$.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",ee3(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()}}}),eai={isHardBreak:t=>t.type.name===ear.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 eao(){return{extensions:ele(),defaultTextConverter:void 0}}let eaa=eo3.extend({name:"bold"}),eau=new class{constructor(t,n,r){w(this,"extType",eo6.Mark),w(this,"richTextNodeTypes",qZ.RichTextNodeType.strong),this.name=t,this.component=n,this.converter=r}}(eaa.name,eaa,{fromPrismic:t=>function(){var n;return null==(n=t.marks[eaa.name])?void 0:n.create()},toPrismic(){}}),eas=en$.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",ee3(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=enV.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",ee3(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:n})=>{let r=eno(t,this.type);return!!Object.entries(r).some(([,t])=>!!t)||n.unsetMark(this.name)}}}}),eac=/^\s*([-+*])\s$/,ead=en$.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",ee3(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(eas.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=enB({find:eac,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=enB({find:eac,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(eal.name),editor:this.editor})),[t]}}),eaf=en$.create({name:"doc",topNode:!0,content:"block+"}),eap=en$.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",ee3(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)}}}),eah=eap.extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),eam={component:eah,converter:{fromPrismic:t=>function(n){var r;let i=esf.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[eah.name])?void 0:r.create({},i)},toPrismic:(t,n)=>eai.children.reduce(t,(t,r)=>{let i=esf.converter.toPrismic(r),o=i instanceof Array?i.map(t=>({...t,type:n})):i?[{...i,type:n}]:[];return[...t,...o]},[])},placeholder:"List"},eag="document",eay=t=>eaf.extend({name:eag,content:t?"block+":"block"}),eav=t=>({fromPrismic(n,r){function i(t,n){return!n&&r&&nQ.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 eo9.Embed:return nQ.EmbedBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;case eo9.Text:return nQ.TextBlock.is(r)?n.converter.fromPrismic(i)(r):void 0;case eo9.Image:return nQ.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),l=(0,f.Z$)(r),c=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===es_.name||i.type.name===es8.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:l});return c.updatedNode?[...c.merged?s:r,c.updatedNode]:r},[]);return null==(o=n.nodes[eag])?void 0:o.create({},a)}},toPrismic:n=>({__TYPE__:"StructuredTextContent",value:[...eai.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},[])]})}),eab=new class{constructor(t,n,r){w(this,"extType","document"),this.name=t,this.component=n,this.converter=r}}(eag,eay,eav),eax=ear.extend({name:"hard_break"}),ea_=`
|
|
94
|
+
`,eaS={fromPrismic:t=>function(n){var r;if(n===ea_)return null==(r=t.nodes[eax.name])?void 0:r.create({})},toPrismic(t){if(t.type.name===eax.name)return ea_}},eaT={isEmptyLine:t=>0===t.length,isFirst:t=>0===t},eaw={name:eax.name,component:eax,converter:eaS,splitTextToNodes:function(t,n){return function(r){let i=eaS.fromPrismic(t)(ea_);if(!i)return[r(n)];let o=n.split(ea_);return 1===o.length?n.length?[r(n)]:[i]:o.reduce((t,n,o)=>eaT.isFirst(o)?eaT.isEmptyLine(n)?t:[...t,r(n)]:eaT.isEmptyLine(n)?[...t,i]:[...t,i,r(n)],[])}}},eaO=etf.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new JB({key:new Jq("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 l=XX.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(l)}return this.options.includeChildren}),X2.create(t,o)}}})]}}),eak=t=>eaO.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:l}=n,c=!eai.children.exists(i.state.doc,t=>t===a),d=i.isEditable,f=i.isFocused&&o,p=a.type.name!==esf.name,h=f||p||c,m=l.length>1,g=function(){if(c)return eam.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 eaC(t){return t.split("-")[1]}function eaI(t){return"y"===t?"height":"width"}function eaM(t){return t.split("-")[0]}function eaR(t){return["top","bottom"].includes(eaM(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=eaR(n),l=eaI(s),c=i[l]/2-o[l]/2,d=eaM(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(eaC(n)){case"start":p[s]-=c*(r&&f?-1:1);break;case"end":p[s]+=c*(r&&f?-1:1)}return p}let eaj=async(t,n,r)=>{let{placement:i="bottom",strategy:o="absolute",middleware:a=[],platform:u}=r,s=a.filter(Boolean),l=await (null==u.isRTL?void 0:u.isRTL(n)),c=await u.getElementRects({reference:t,floating:n,strategy:o}),{x:d,y:f}=eaE(c,i,l),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:_,reset:S}=await v({x:d,y:f,initialPlacement:i,placement:p,strategy:o,middlewareData:h,rects:c,platform:u,elements:{reference:t,floating:n}});if(d=b??d,f=x??f,h={...h,[y]:{...h[y],..._}},S&&m<=50){m++,"object"==typeof S&&(S.placement&&(p=S.placement),S.rects&&(c=!0===S.rects?await u.getElementRects({reference:t,floating:n,strategy:o}):S.rects),{x:d,y:f}=eaE(c,p,l)),g=-1;continue}}return{x:d,y:f,placement:p,strategy:o,middlewareData:h}};function eaA(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function eaN(t,n){var r,i,o;void 0===n&&(n={});let{x:a,y:u,platform:s,rects:l,elements:c,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=c[m?"floating"===h?"reference":"floating":h],b=eaA(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(c.floating)),boundary:f,rootBoundary:p,strategy:d})),x="floating"===h?{...l.floating,x:a,y:u}:l.reference,_=await (null==s.getOffsetParent?void 0:s.getOffsetParent(c.floating)),S=await (null==s.isElement?void 0:s.isElement(_))&&await (null==s.getScale?void 0:s.getScale(_))||{x:1,y:1},T=eaA(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:_,strategy:d}):x);return{top:(b.top-T.top+y.top)/S.y,bottom:(T.bottom-b.bottom+y.bottom)/S.y,left:(b.left-T.left+y.left)/S.x,right:(T.right-b.right+y.right)/S.x}}let eaP=Math.min,eaL=Math.max;function eaD(t,n,r){return eaL(t,eaP(n,r))}let eaF={left:"right",right:"left",bottom:"top",top:"bottom"};function eaW(t){return t.replace(/left|right|bottom|top/g,t=>eaF[t])}let eaU={start:"end",end:"start"};function eaz(t){return t.replace(/start|end/g,t=>eaU[t])}async function eaB(t,n){let{placement:r,platform:i,elements:o}=t,a=await (null==i.isRTL?void 0:i.isRTL(o.floating)),u=eaM(r),s=eaC(r),l="x"===eaR(r),c=["left","top"].includes(u)?-1:1,d=a&&l?-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),l?{x:h*d,y:p*c}:{x:p*c,y:h*d}}function eaV(t){return"x"===t?"y":"x"}function ea$(t){var n;return(null==(n=t.ownerDocument)?void 0:n.defaultView)||window}function eaq(t){return ea$(t).getComputedStyle(t)}let eaK=Math.min,eaH=Math.max,eaG=Math.round;function eaZ(t){let n=eaq(t),r=parseFloat(n.width),i=parseFloat(n.height),o=t.offsetWidth,a=t.offsetHeight,u=eaG(r)!==o||eaG(i)!==a;return u&&(r=o,i=a),{width:r,height:i,fallback:u}}function eaY(t){return ea1(t)?(t.nodeName||"").toLowerCase():""}let eaJ;function eaQ(){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 eaX(t){return t instanceof ea$(t).HTMLElement}function ea0(t){return t instanceof ea$(t).Element}function ea1(t){return t instanceof ea$(t).Node}function ea2(t){if(typeof ShadowRoot>"u")return!1;let n=ea$(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}function ea3(t){let{overflow:n,overflowX:r,overflowY:i,display:o}=eaq(t);return/auto|scroll|overlay|hidden|clip/.test(n+i+r)&&!["inline","contents"].includes(o)}function ea4(t){return["table","td","th"].includes(eaY(t))}function ea5(t){let n=/firefox/i.test(eaQ()),r=eaq(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 ea6(){return/^((?!chrome|android).)*safari/i.test(eaQ())}function ea9(t){return["html","body","#document"].includes(eaY(t))}function ea8(t){return ea0(t)?t:t.contextElement}let ea7={x:1,y:1};function eue(t){let n=ea8(t);if(!eaX(n))return ea7;let r=n.getBoundingClientRect(),{width:i,height:o,fallback:a}=eaZ(n),u=(a?eaG(r.width):r.width)/i,s=(a?eaG(r.height):r.height)/o;return u&&Number.isFinite(u)||(u=1),s&&Number.isFinite(s)||(s=1),{x:u,y:s}}function eut(t,n,r,i){var o,a;void 0===n&&(n=!1),void 0===r&&(r=!1);let u=t.getBoundingClientRect(),s=ea8(t),l=ea7;n&&(i?ea0(i)&&(l=eue(i)):l=eue(t));let c=s?ea$(s):window,d=ea6()&&r,f=(u.left+(d&&(null==(o=c.visualViewport)?void 0:o.offsetLeft)||0))/l.x,p=(u.top+(d&&(null==(a=c.visualViewport)?void 0:a.offsetTop)||0))/l.y,h=u.width/l.x,m=u.height/l.y;if(s){let g=ea$(s),y=i&&ea0(i)?ea$(i):i,v=g.frameElement;for(;v&&i&&y!==g;){let b=eue(v),x=v.getBoundingClientRect(),_=getComputedStyle(v);x.x+=(v.clientLeft+parseFloat(_.paddingLeft))*b.x,x.y+=(v.clientTop+parseFloat(_.paddingTop))*b.y,f*=b.x,p*=b.y,h*=b.x,m*=b.y,f+=x.x,p+=x.y,v=ea$(v).frameElement}}return{width:h,height:m,top:p,right:f+h,bottom:p+m,left:f,x:f,y:p}}function eun(t){return((ea1(t)?t.ownerDocument:t.document)||window.document).documentElement}function eur(t){return ea0(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function eui(t){return eut(eun(t)).left+eur(t).scrollLeft}function euo(t){if("html"===eaY(t))return t;let n=t.assignedSlot||t.parentNode||ea2(t)&&t.host||eun(t);return ea2(n)?n.host:n}function eua(t,n){var r;void 0===n&&(n=[]);let i=function t(n){let r=euo(n);return ea9(r)?r.ownerDocument.body:eaX(r)&&ea3(r)?r:t(r)}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=ea$(i);return o?n.concat(a,a.visualViewport||[],ea3(i)?i:[]):n.concat(i,eua(i))}function euu(t,n,r){let i;if("viewport"===n)i=function(t,n){let r=ea$(t),i=eun(t),o=r.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,l=0;if(o){a=o.width,u=o.height;let c=ea6();(!c||c&&"fixed"===n)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:u,x:s,y:l}}(t,r);else if("document"===n)i=function(t){let n=eun(t),r=eur(t),i=t.ownerDocument.body,o=eaH(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),a=eaH(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight),u=-r.scrollLeft+eui(t),s=-r.scrollTop;return"rtl"===eaq(i).direction&&(u+=eaH(n.clientWidth,i.clientWidth)-o),{width:o,height:a,x:u,y:s}}(eun(t));else if(ea0(n))i=function(t,n){let r=eut(t,!0,"fixed"===n),i=r.top+t.clientTop,o=r.left+t.clientLeft,a=eaX(t)?eue(t):{x:1,y:1},u=t.clientWidth*a.x,s=t.clientHeight*a.y,l=o*a.x,c=i*a.y;return{width:u,height:s,x:l,y:c}}(n,r);else{let o={...n};if(ea6()){var a,u;let s=ea$(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 eaA(i)}function eus(t,n){return eaX(t)&&"fixed"!==eaq(t).position?n?n(t):t.offsetParent:null}function eul(t,n){let r=ea$(t),i=eus(t,n);for(;i&&ea4(i)&&"static"===eaq(i).position;)i=eus(i,n);return i&&("html"===eaY(i)||"body"===eaY(i)&&"static"===eaq(i).position&&!ea5(i))?r:i||function(t){let n=euo(t);for(;eaX(n)&&!ea9(n);){if(ea5(n))return n;n=euo(n)}return null}(t)||r}let euc={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=eua(t).filter(t=>ea0(t)&&"body"!==eaY(t)),o=null,a="fixed"===eaq(t).position,u=a?euo(t):t;for(;ea0(u)&&!ea9(u);){let s=eaq(u),l=ea5(u);"fixed"===s.position?o=null:(a?l||o:!(!l&&"static"===s.position&&o&&["absolute","fixed"].includes(o.position)))?o=s:i=i.filter(t=>t!==u),u=euo(u)}return n.set(t,i),i}(n,this._c):[].concat(r),i],u=a[0],s=a.reduce((t,r)=>{let i=euu(n,r,o);return t.top=eaH(i.top,t.top),t.right=eaK(i.right,t.right),t.bottom=eaK(i.bottom,t.bottom),t.left=eaH(i.left,t.left),t},euu(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=eaX(r),a=eun(r);if(r===a)return n;let u={scrollLeft:0,scrollTop:0},s={x:1,y:1},l={x:0,y:0};if((o||!o&&"fixed"!==i)&&(("body"!==eaY(r)||ea3(a))&&(u=eur(r)),eaX(r))){let c=eut(r);s=eue(r),l.x=c.x+r.clientLeft,l.y=c.y+r.clientTop}return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-u.scrollLeft*s.x+l.x,y:n.y*s.y-u.scrollTop*s.y+l.y}},isElement:ea0,getDimensions:function(t){return eaX(t)?eaZ(t):t.getBoundingClientRect()},getOffsetParent:eul,getDocumentElement:eun,getScale:eue,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=eaX(n),o=eun(n),a=eut(t,!0,"fixed"===r,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(i||!i&&"fixed"!==r){if(("body"!==eaY(n)||ea3(o))&&(u=eur(n)),eaX(n)){let l=eut(n,!0);s.x=l.x+n.clientLeft,s.y=l.y+n.clientTop}else o&&(s.x=eui(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"===eaq(t).direction};function eud(t,n,r,i){void 0===i&&(i={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:u=!0,animationFrame:s=!1}=i,l=o&&!s,c=l||a?[...ea0(t)?eua(t):t.contextElement?eua(t.contextElement):[],...eua(n)]:[];c.forEach(t=>{l&&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}),ea0(t)&&!s&&d.observe(t),ea0(t)||!t.contextElement||s||d.observe(t.contextElement),d.observe(n)}let p,h=s?eut(t):null;return s&&function n(){let i=eut(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;c.forEach(t=>{l&&t.removeEventListener("scroll",r),a&&t.removeEventListener("resize",r)}),null==(t=d)||t.disconnect(),d=null,s&&cancelAnimationFrame(p)}}let euf=(t,n,r)=>{let i=new Map,o={platform:euc,...r},a={...o.platform,_c:i};return eaj(t,n,{...o,platform:a})};var eup="u">typeof document?o.useLayoutEffect:o.useEffect;function euh(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(!euh(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)&&!euh(t[a],n[a]))return!1}return!0}return t!=t&&n!=n}function eum(t){let n=o.useRef(t);return eup(()=>{n.current=t}),n}var eug="u">typeof document?o.useLayoutEffect:o.useEffect;let euy=!1,euv=0,eub=()=>"floating-ui-"+euv++,eux=(H2||(H2=r.t(o,2)))["useId".toString()],eu_=eux??function(){let[t,n]=o.useState(()=>euy?eub():void 0);return eug(()=>{null==t&&n(eub())},[]),o.useEffect(()=>{euy||(euy=!0)},[]),t},euS=o.createContext(null),euT=o.createContext(null),euw=()=>{var t,n;return null!=(t=null==(n=o.useContext(euS))?void 0:n.id)?t:null},euO=()=>o.useContext(euT);function euk(t){var n;return null!=(n=null==t?void 0:t.ownerDocument)?n:document}function euC(t){var n;return null!=(n=euk(t).defaultView)?n:window}function euI(t){return!!t&&t instanceof euC(t).Element}let euM=(H2||(H2=r.t(o,2)))["useInsertionEffect".toString()];function euR(t){let n=o.useRef(()=>{});return euM?euM(()=>{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 euj(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 euA(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 euN(t){t.preventDefault(),t.stopPropagation()}function euP(t){let n=(0,o.useRef)();return eug(()=>{n.current=t},[t]),n.current}let euL=function(t,n){let{open:r}=t,{enabled:i=!0,role:o="dialog"}=void 0===n?{}:n,a=eu_(),u=eu_(),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 euD(t,n){return null!=n&&("composedPath"in t?t.composedPath().includes(n):null!=t.target&&n.contains(t.target))}let euF=function(t,n){let{open:r,onOpenChange:i,refs:a,events:u,nodeId:s}=t,{enabled:l=!0,escapeKey:c=!0,outsidePointerDown:d=!0,referencePointerDown:f=!1,ancestorScroll:p=!1,bubbles:h=!0}=void 0===n?{}:n,m=euO(),g=null!=euw(),y=o.useRef(!1);return o.useEffect(()=>{if(!r||!l)return;function t(t){"Escape"!==t.key||!h&&m&&euj(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 l="composedPath"in t?t.composedPath()[0]:t.target;if(euI(l)&&a.floating.current){let c=null!=(r=a.floating.current.ownerDocument.defaultView)?r:window,d=l.scrollWidth>l.clientWidth,f=l.scrollHeight>l.clientHeight,p=f&&t.offsetX>l.clientWidth;if(f&&"rtl"===c.getComputedStyle(l).direction&&(p=t.offsetX<=l.offsetWidth-l.clientWidth),p||d&&t.offsetY>l.clientHeight)return}let v=m&&euj(m.nodesRef.current,s).some(n=>{var r;return euD(t,null==(r=n.context)?void 0:r.refs.floating.current)});euD(t,a.floating.current)||euD(t,a.domReference.current)||v||!h&&m&&euj(m.nodesRef.current,s).length>0||(u.emit("dismiss",!!g&&{preventScroll:!0}),i(!1))}function o(){i(!1)}let f=euk(a.floating.current);c&&f.addEventListener("keydown",t),d&&f.addEventListener("pointerdown",n);let v=(p?[...euI(a.reference.current)?eua(a.reference.current):[],...euI(a.floating.current)?eua(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})),()=>{c&&f.removeEventListener("keydown",t),d&&f.removeEventListener("pointerdown",n),v.forEach(t=>t.removeEventListener("scroll",o))}},[c,d,u,m,s,r,i,p,l,h,a,g]),l?{reference:{onPointerDown(){f&&(u.emit("dismiss"),i(!1))}},floating:{onPointerDownCapture(){y.current=!0}}}:{}},euW="ArrowUp",euU="ArrowDown",euz="ArrowLeft",euB="ArrowRight";function euV(t,n,r){return Math.floor(t/n)!==r}function eu$(t,n){return n<0||n>=t.current.length}function euq(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 l,c;s+=i?-a:a}while(s>=0&&s<=u.length-1&&(o?o.includes(s):null==u[s]||null!=(l=u[s])&&l.hasAttribute("disabled")||(null==(c=u[s])?void 0:c.getAttribute("aria-disabled"))==="true"));return s}function euK(t,n,r){switch(t){case"vertical":return n;case"horizontal":return r;default:return n||r}}function euH(t,n){return euK(n,t===euW||t===euU,t===euz||t===euB)}function euG(t,n,r){return euK(n,t===euU,r?t===euz:t===euB)||"Enter"===t||" "==t||""===t}function euZ(t,n){return euq(t,{disabledIndices:n})}function euY(t,n){return euq(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:l=()=>{},enabled:c=!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:_="vertical",cols:S=1}=void 0===n?{listRef:{current:[]},activeIndex:null,onNavigate(){}}:n,T=euw(),w=euO(),O=euP(r),k=euR(l),C=euR(euP(l)),I=o.useRef(y),M=o.useRef(d??-1),R=o.useRef(null),E=function(t){let n=(0,o.useRef)(t);return eug(()=>{n.current=t}),n}(x),j=o.useRef(!1),A=o.useRef(-1),[N,P]=o.useState(),L=o.useCallback((t,n)=>{A.current=requestAnimationFrame(()=>{var r,i;g?P(null==(r=t.current[n.current])?void 0:r.id):null==(i=t.current[n.current])||i.focus({preventScroll:!0})})},[g]);function D(t){var n,o,s,l;if(j.current=!0,h&&(n=t.key,euK(_,m?n===euB:n===euz,n===euW))){euN(t),i(!1),(l=a.domReference.current)&&l instanceof euC(l).HTMLElement&&a.domReference.current.focus();return}let c=M.current,d=euZ(u,x),y=euY(u,x);if("Home"===t.key&&(M.current=d,k(M.current)),"End"===t.key&&(M.current=y,k(M.current)),S>1){let v=M.current;if(t.key===euW){if(euN(t),-1===v)M.current=y;else if(M.current=euq(u,{startingIndex:v,amount:S,decrement:!0,disabledIndices:x}),p&&(v-S<d||M.current<0)){let b=v%S,T=y%S,w=y-(T-b);T===b?M.current=y:M.current=T>b?w:w-S}eu$(u,M.current)&&(M.current=v),k(M.current)}if(t.key===euU&&(euN(t),-1===v?M.current=d:(M.current=euq(u,{startingIndex:v,amount:S,disabledIndices:x}),p&&v+S>y&&(M.current=euq(u,{startingIndex:v%S-S,amount:S,disabledIndices:x}))),eu$(u,M.current)&&(M.current=v),k(M.current)),"both"===_){let O=Math.floor(v/S);t.key===euB&&(euN(t),v%S!=S-1?(M.current=euq(u,{startingIndex:v,disabledIndices:x}),p&&euV(M.current,S,O)&&(M.current=euq(u,{startingIndex:v-v%S-1,disabledIndices:x}))):p&&(M.current=euq(u,{startingIndex:v-v%S-1,disabledIndices:x})),euV(M.current,S,O)&&(M.current=v)),t.key===euz&&(euN(t),v%S!=0?(M.current=euq(u,{startingIndex:v,disabledIndices:x,decrement:!0}),p&&euV(M.current,S,O)&&(M.current=euq(u,{startingIndex:v+(S-v%S),decrement:!0,disabledIndices:x}))):p&&(M.current=euq(u,{startingIndex:v+(S-v%S),decrement:!0,disabledIndices:x})),euV(M.current,S,O)&&(M.current=v)),eu$(u,M.current)&&(p&&Math.floor(y/S)===O?M.current=t.key===euz?y:euq(u,{startingIndex:v-v%S-1,disabledIndices:x}):M.current=v),k(M.current);return}}if(euH(t.key,_)){if(euN(t),r&&!g&&euA(t.currentTarget.ownerDocument)===t.currentTarget){M.current=euG(t.key,_,m)?d:y,k(M.current);return}euG(t.key,_,m)?p?M.current=c>=y?f&&c!==u.current.length?-1:d:euq(u,{startingIndex:c,disabledIndices:x}):M.current=Math.min(y,euq(u,{startingIndex:c,disabledIndices:x})):p?M.current=c<=d?f&&-1!==c?u.current.length:y:euq(u,{startingIndex:c,decrement:!0,disabledIndices:x}):M.current=Math.max(d,euq(u,{startingIndex:c,decrement:!0,disabledIndices:x})),eu$(u,M.current)?k(null):k(M.current)}}return eug(()=>{c&&(!O&&r&&I.current&&null!=d&&k(d),O&&!r&&(cancelAnimationFrame(A.current),M.current=-1,C(null)))},[r,O,d,u,L,c,k,C]),eug(()=>{c&&r&&(null==s?null==d&&(O&&(M.current=-1,L(u,M)),!O&&I.current&&(null!=R.current||!0===I.current&&null==R.current)&&(M.current=null==R.current||euG(R.current,_,m)||h?euZ(u,E.current):euY(u,E.current),k(M.current),L(u,M))):eu$(u,s)||(M.current=s,L(u,M)))},[r,O,s,d,h,u,k,L,c,f,_,m,g,E]),eug(()=>{if(c&&!r&&O){var t,n;let i=null==w||null==(t=w.nodesRef.current.find(t=>t.id===T))||null==(n=t.context)?void 0:n.refs.floating.current;i&&!i.contains(euA(euk(i)))&&i.focus({preventScroll:!0})}},[c,r,O,w,T]),eug(()=>{R.current=null}),c?{reference:{...g&&r&&null!=s&&{"aria-activedescendant":N},onKeyDown(t){if(j.current=!0,g&&r)return D(t);if((0===t.key.indexOf("Arrow")||"Enter"===t.key||" "===t.key||""===t.key)&&(R.current=t.key),h){var n,o,a;n=t.key,euK(_,m?n===euz:n===euB,n===euU)&&(euN(t),r?(M.current=euZ(u,x),k(M.current)):i(!0));return}euH(t.key,_)&&(null!=d&&(M.current=d),euN(t),!r&&b?i(!0):D(t),r&&k(M.current))}},floating:{"aria-orientation":"both"===_?void 0:_,...g&&null!=s&&{"aria-activedescendant":N},onKeyDown:D,onPointerMove(){j.current=!1}},item:{onFocus(t){let{currentTarget:n}=t,r=u.current.indexOf(n);-1!==r&&k(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&&k(r)}},onPointerLeave(){if(!j.current&&(M.current=-1,L(u,M),k(null),!g)){var t;null==(t=a.floating.current)||t.focus({preventScroll:!0})}}}}}:{}},euQ=new Jq("suggestion"),euX=en$.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",ee3(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),eu0={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"},eu1=()=>(++eu1.i).toString();eu1.i=0;let eu2=t=>{let n=eu5(t),r=[];for(let i=0;i<n.length;i++)r.push(eu6(n[i]));return{key:eu1(),children:r}},eu3=(t,n=[])=>({key:eu1(),type:t.type,text:"text"in t?t.text:void 0,node:t,children:n}),eu4=t=>eu3({type:eu0.span,text:t,spans:[]}),eu5=t=>{let n=t.slice(0);for(let r=0;r<n.length;r++){let i=n[r];if(i.type===eu0.listItem||i.type===eu0.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===eu0.listItem?n[r]={type:eu0.list,items:o}:n[r]={type:eu0.oList,items:o}}}return n},eu6=t=>{if("text"in t)return eu3(t,eu9(t.spans,t));if("items"in t){let n=[];for(let r=0;r<t.items.length;r++)n.push(eu6(t.items[r]));return eu3(t,n)}return eu3(t)},eu9=(t,n,r)=>{if(!t.length)return[eu4(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,l=u.start-s,c=u.end-s,d=n.text.slice(l,c),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&&l>0&&o.push(eu4(n.text.slice(0,l)));let m={...u,text:d};o.push(eu3(m,eu9(f,{...n,text:d},u))),c<n.text.length&&o.push(eu4(n.text.slice(c,i[a+1]?i[a+1].start-s:void 0)))}return o},eu8=(t,n)=>eu7(eu2(t).children,n),eu7=(t,n)=>{let r=[];for(let i=0;i<t.length;i++){let o=t[i],a=n(o.type,o.node,o.text,eu7(o.children,n),o.key);null!=a&&r.push(a)}return r};eu0.listItem,eu0.oListItem,eu0.list,eu0.oList;let ese=en$.create({name:"text",group:"inline"});function est(t){return t.sort((t,n)=>t.start-n.start)}let esn={fromPrismic:t=>n=>{switch(n.type){case"hyperlink":return esX.converter.fromPrismic(t)(n);case"em":return esJ.converter.fromPrismic(t)(n);case"strong":return eau.converter.fromPrismic(t)(n);default:return}},toPrismic(t,n,r){let i=es7.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}}},esr=ese.extend({name:"text"}),esi={name:esr.name,component:esr,converter:{fromPrismic:t=>function(n,r,i=!1){let o={type:n,text:r.content.text,spans:r.content.spans||[]};return eu8([o],function(t,n=!1){return(r,i,o,a)=>{if("span"===r&&o&&o.length)return n?[t.text(o)]:eaw.splitTextToNodes(t,o)(n=>t.text(n));{let u=esn.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=eai.children.reduce(t,(t,n)=>{let r=n.type.name===eaw.name?eaw.converter.toPrismic(n):n.textContent,i=r?t.text+r:t.text,o=t.text.length,a=i.length,u=n.marks.length?eai.marks.map(n,t=>esn.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:[...function(t){var n;let r=t.reduce((t,n)=>{let r=(t[n.type]||[]).concat(n);return{...t,[n.type]:r}},{}),i=Object.entries(r).map(([t,n])=>est(n).reduce((t,n)=>{if(!t.length)return[n];let r=t.length-1,i=t[r];return i?i.end<n.start?[...t,n]:i.end>=n.end?t:[...t.slice(0,r),{...i,end:n.end}]:t},[])).flat();return est(i)}(i.spans)].sort((t,n)=>t.type.localeCompare(n.type))},...r}}}};var eso,esa=((eso=esa||{}).LeftToRight="ltr",eso.RightToLeft="rtl",eso);let esu=qZ.RichTextNodeType.rtl,ess=etf.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()}}}),esl={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)}}},esc=euX.extend({name:"paragraph",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",ee3(this.options.HTMLAttributes,t),0]}}),esd=new eo8([qZ.RichTextNodeType.paragraph],esc.name,esc,{fromPrismic:t=>function(n){var r;let i=esi.converter.fromPrismic(t)(esc.name,n);return null==(r=t.nodes[esc.name])?void 0:r.create(esl.fromPrismic(n),i)},toPrismic:t=>esi.converter.toPrismic(t,qZ.RichTextNodeType.paragraph,esl.toPrismic(t))},"Type '/' for commands"),esf=esd,esp=["ArrowDown","ArrowUp","End","Home"],esh=["Enter"],esm=["Escape",...esp,...esh],esg=etf.create({name:"slash-commands",addOptions:()=>({nodeTypes:[]}),addProseMirrorPlugins(){let t=ela(elt,this.options.nodeTypes);return t.length>1?[function({pluginKey:t=euQ,editor:n,char:r="@",allowSpaces:i=!1,allowedPrefixes:o=[" "],startOfLine:a=!1,decorationTag:u="span",decorationClass:s="suggestion",command:l=()=>null,items:c=()=>[],render:d=()=>({}),allow:f=()=>!0}){let p,h=null==d?void 0:d(),m=new JB({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,_=v||y,S=x&&!y,T=b||y;if(!_&&!S&&!T)return;let w=T&&!_?m:g,O=t.dom.querySelector(`[data-decoration-id="${w.decorationId}"]`);p={editor:n,range:w.range,query:w.query,text:w.text,items:[],command(t){l({editor:n,range:w.range,props:t})},decorationNode:O,clientRect:O?()=>{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},_&&(null===(a=null==h?void 0:h.onBeforeStart)||void 0===a||a.call(h,p)),S&&(null===(u=null==h?void 0:h.onBeforeUpdate)||void 0===u||u.call(h,p)),(S||_)&&(p.items=await c({editor:n,query:w.query})),T&&(null===(s=null==h?void 0:h.onExit)||void 0===s||s.call(h,p)),S&&(null===(d=null==h?void 0:h.onUpdate)||void 0===d||d.call(h,p)),_&&(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,l){let{isEditable:c}=n,{composing:d}=n.view,{selection:p}=t,{empty:h,from:m}=p,g={...u};if(g.composing=d,c&&(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,l=i.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),c=RegExp(`\\s${l}$`),d=u?"^":"",f=o?RegExp(`${d}${l}.*?(?=\\s${l}|$)`,"gm"):RegExp(`${d}(?:^)?${l}[^\\s${l}]*`,"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&&c.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:l,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?X2.create(t.doc,[XX.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===esf.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 eiA(esy,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate(n){null==t||t.updateProps(n)},onKeyDown({event:n}){var r;return Boolean(esm.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()}}}})]:[]}}),esy=(0,o.forwardRef)(function(t,n){var r,i,a,l,c;let{command:d,decorationNode:f,editor:p,items:h}=t,[m,g]=(0,o.useState)(!0),y=parseFloat(u.TV.space[0]),{context:v,floating:b,reference:_,x:S,y:T}=function(t){let{open:n=!1,onOpenChange:r,whileElementsMounted:i,placement:a,middleware:u,strategy:s,nodeId:l}=void 0===t?{}:t,[c,d]=o.useState(null),f=euO(),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,[l,c]=o.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[d,f]=o.useState(i);euh(d,i)||f(i);let p=o.useRef(null),h=o.useRef(null),m=o.useRef(l),g=eum(u),y=eum(a),[v,b]=o.useState(null),[_,S]=o.useState(null),T=o.useCallback(t=>{p.current!==t&&(p.current=t,b(t))},[]),w=o.useCallback(t=>{h.current!==t&&(h.current=t,S(t))},[]),O=o.useCallback(()=>{if(!p.current||!h.current)return;let t={placement:n,strategy:r,middleware:d};y.current&&(t.platform=y.current),euf(p.current,h.current,t).then(t=>{let n={...t,isPositioned:!0};k.current&&!euh(m.current,n)&&(m.current=n,x.flushSync(()=>{c(n)}))})},[d,n,r,y]);eup(()=>{!1===s&&m.current.isPositioned&&(m.current.isPositioned=!1,c(t=>({...t,isPositioned:!1})))},[s]);let k=o.useRef(!1);eup(()=>(k.current=!0,()=>{k.current=!1}),[]),eup(()=>{if(v&&_){if(g.current)return g.current(v,_,O);O()}},[v,_,O,g]);let C=o.useMemo(()=>({reference:p,floating:h,setReference:T,setFloating:w}),[T,w]),I=o.useMemo(()=>({reference:v,floating:_}),[v,_]);return o.useMemo(()=>({...l,update:O,refs:C,elements:I,reference:T,floating:w}),[l,O,C,I,T,w])}({placement:a,middleware:u,strategy:s,whileElementsMounted:i}),y=euR(r),v=o.useMemo(()=>({...g.refs,domReference:p}),[g.refs]),b=o.useMemo(()=>({...g,refs:v,dataRef:h,nodeId:l,events:m,open:n,onOpenChange:y,_:{domReference:c}}),[g,l,m,n,y,v,c]);eug(()=>{let t=null==f?void 0:f.nodesRef.current.find(t=>t.id===l);t&&(t.context=b)});let{reference:_}=g,S=o.useCallback(t=>{(euI(t)||null===t)&&(b.refs.domReference.current=t,d(t)),_(t)},[_,b.refs]);return o.useMemo(()=>({...g,context:b,refs:v,reference:S}),[g,v,b,S])}({middleware:[(void 0===(r=y)&&(r=0),{name:"offset",options:r,async fn(t){let{x:n,y:i}=t,o=await eaB(t,r);return{x:n+o.x,y:i+o.y,data:o}}}),(void 0===i&&(i={}),{name:"flip",options:i,async fn(t){var n,r,o,a;let{placement:u,middlewareData:s,rects:l,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}=i,x=eaM(u),_=eaM(c)===c,S=await (null==d.isRTL?void 0:d.isRTL(f.floating)),T=m||(_||!v?[eaW(c)]:function(t){let n=eaW(t);return[eaz(t),n,eaz(n)]}(c));m||"none"===y||T.push(...function(t,n,r,i){let o=eaC(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[]}}(eaM(t),"start"===r,i);return o&&(a=a.map(t=>t+"-"+o),n&&(a=a.concat(a.map(eaz)))),a}(c,v,y,S));let w=await eaN(t,b),O=[],k=(null==(n=s.flip)?void 0:n.overflows)||[];if(p&&O.push(w[x]),h){let{main:C,cross:I}=function(t,n,r){void 0===r&&(r=!1);let i=eaC(t),o=eaR(t),a=eaI(o),u="x"===o?i===(r?"end":"start")?"right":"left":"start"===i?"bottom":"top";return n.reference[a]>n.floating[a]&&(u=eaW(u)),{main:u,cross:eaW(u)}}(u,l,S);O.push(w[C],w[I])}if(k=[...k,{placement:u,overflows:O}],!O.every(t=>t<=0)){let M=((null==(r=s.flip)?void 0:r.index)||0)+1,R=[c,...T][M];if(R)return{data:{index:M,overflows:k},reset:{placement:R}};let E=null==(o=k.filter(t=>t.overflows[0]<=0).sort((t,n)=>t.overflows[1]-n.overflows[1])[0])?void 0:o.placement;if(!E)switch(g){case"bestFit":{let j=null==(a=k.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:a[0];j&&(E=j);break}case"initialPlacement":E=c}if(u!==E)return{reset:{placement:E}}}return{}}}),(l={limiter:(void 0===a&&(a={}),{options:a,fn(t){let{x:n,y:r,placement:i,rects:o,middlewareData:u}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=a,d={x:n,y:r},f=eaR(i),p=eaV(f),h=d[f],m=d[p],g="function"==typeof s?s(t):s,y="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){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 _,S;let T="y"===f?"width":"height",w=["top","left"].includes(eaM(i)),O=o.reference[p]-o.floating[T]+(w&&(null==(_=u.offset)?void 0:_[p])||0)+(w?0:y.crossAxis),k=o.reference[p]+o.reference[T]+(w?0:(null==(S=u.offset)?void 0:S[p])||0)-(w?y.crossAxis:0);m<O?m=O:m>k&&(m=k)}return{[f]:h,[p]:m}}})},{name:"shift",options:l,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}=l,c={x:n,y:r},d=await eaN(t,s),f=eaR(eaM(i)),p=eaV(f),h=c[f],m=c[p];if(o){let g=h+d["y"===f?"top":"left"],y=h-d["y"===f?"bottom":"right"];h=eaD(g,h,y)}if(a){let v=m+d["y"===p?"top":"left"],b=m-d["y"===p?"bottom":"right"];m=eaD(v,m,b)}let x=u.fn({...t,[f]:h,[p]:m});return{...x,data:{x:x.x-n,y:x.y-r}}}})],onOpenChange:g,open:m,placement:"top-start",strategy:"fixed",whileElementsMounted:eud});(0,o.useLayoutEffect)(()=>{_(f)},[_,f]),(0,o.useEffect)(()=>{let t,n=()=>{t=window.setTimeout(()=>{g(!0)})},r=()=>{g(!1)};return p.on("focus",n).on("blur",r),()=>{p.off("focus",n).off("blur",r),clearTimeout(t)}},[p]);let[w,O]=(0,o.useState)(0),k=(0,o.useRef)([]);(0,s.pQ)(h,()=>{O(0),k.current=[]});let{getFloatingProps:C,getItemProps:I,getReferenceProps:R}=(c=[euF(v,{outsidePointerDown:!1}),euJ(v,{activeIndex:w,listRef:k,onNavigate(t){O(n=>t??n)},openOnArrowKeyDown:!1,virtual:!0}),euL(v,{role:"menu"})],{getReferenceProps:t=>euE(t,c,"reference"),getFloatingProps:t=>euE(t,c,"floating"),getItemProps:t=>euE(t,c,"item")}),E=R().onKeyDown;return(0,o.useImperativeHandle)(n,()=>({handleKeyDown(t){if(!m)return!1;if(esp.includes(t.key)&&E(t),esh.includes(t.key)){let n=h[w];void 0!==n&&d(n)}return!0}}),[w,d,h,E,m]),m?M.jsx(u.xu,{...C(),minWidth:256,backgroundColor:"grey1",border:!0,borderStyle:"solid",borderRadius:6,flexDirection:"column",ref:b,top:parseFloat(u.TV.space[0]),left:parseFloat(u.TV.space[0]),position:"fixed",transform:null!==S&&null!==T?`translate3d(${Math.round(S)}px, ${Math.round(T)}px, 0)`:"translate3d(0, -200%, 0)",children:M.jsxs("div",{style:{boxShadow:"0px 2px 10px 0px hsla(0, 0%, 0%, 0.1)"},children:[h.map((t,n)=>{let r=I({onClick(){d(t)},onPointerDown(t){t.preventDefault()}});return(0,o.createElement)(esv,{...r,key:t.nodeType,ref(t){k.current[n]=t},active:n===w,isFirstItem:0===n,isLastItem:n===h.length-1,shortcut:`/${t.shortText??""}`},t.text)}),0===h.length&&M.jsx(esv,{...I({onPointerDown(t){t.preventDefault()}}),disabled:!0,ref(t){k.current[0]=t},children:"No results"})]})}):null}),esv=(0,o.forwardRef)(function(t,n){let{children:r,disabled:i=!1,shortcut:o,active:a=!1,isFirstItem:s=!1,isLastItem:l=!1,...c}=t,d=function(t){let{isFirstItem:n,isLastItem:r}=t;return n?{topRight:6,topLeft:6}:r?{bottomRight:6,bottomLeft:6}:void 0}({isFirstItem:s,isLastItem:l});return M.jsx("div",{...c,role:"button",style:{all:"unset",cursor:i?"default":"pointer"},ref:n,children:M.jsxs(u.xu,{alignItems:"center",height:32,flexDirection:"row",gap:8,padding:8,backgroundColor:a?"grey4":"inherit",justifyContent:"space-between",borderRadius:d,opacity:i?"50%":"100%",children:[M.jsx(u.xv,{color:"grey12",component:"span",children:r}),o&&M.jsx(u.xv,{color:"inherit",component:"span",variant:"small",children:o})]})})}),esb=ead.extend({name:"bulletList",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",ee3(this.options.HTMLAttributes,t),0]}}).configure({itemTypeName:"listItem"}),esx=new eat([qZ.RichTextNodeType.list],esb.name,esb,{fromPrismic:t=>function(n){var r;let i=eam.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[esb.name])?void 0:r.create(esl.fromPrismic(n),i)},toPrismic:t=>eai.children.map(t,t=>eam.converter.toPrismic(t,qZ.RichTextNodeType.list).filter(c.$)).flat()}),es_=esx,esS=/^```([a-z]+)?[\s\n]$/,esT=/^~~~([a-z]+)?[\s\n]$/,esw=en$.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",ee3(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[enz({find:esS,type:this.type,getAttributes:t=>({language:t[1]})}),enz({find:esT,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new JB({key:new Jq("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(JI.near(u.doc.resolve(Math.max(0,u.selection.from-2)))),u.insertText(r.replace(/\r\n?/g,`
|
|
97
|
+
`)),u.setMeta("paste",!0),t.dispatch(u),!0}}})]}}),esO=esw.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",ee3(this.options.HTMLAttributes),["code",t,0]]}}).configure({exitOnTripleEnter:!1}),esk=new eo8([qZ.RichTextNodeType.preformatted],esO.name,esO,{fromPrismic:t=>function(n){var r;let i=esi.converter.fromPrismic(t)(esO.name,n,!0);return null==(r=t.nodes[esO.name])?void 0:r.create(esl.fromPrismic(n),i)},toPrismic:t=>esi.converter.toPrismic(t,qZ.RichTextNodeType.preformatted,esl.toPrismic(t))},"",!0);function esC(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 esI(t){let n=(0,o.useRef)(null),r=(0,o.useRef)(null),{onKeyDown:i,url:a,urlChanged:l,onContentChange:c,debouncedUrl:d,content:f}=function(t,n,r){let{node:i}=t,a=i.attrs.content,u=(0,s.R9)(t.updateAttributes),l=(0,s.$P)({initialState:(null==a?void 0:a.embed_url)??"",startTransition:o.startTransition});function c(t){u({content:t})}let{onKeyDown:d}=function(t,n,r,i){let{editor:a,getPos:u,node:s}=t,[l,c]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{l&&t.editor.isFocused&&eiL(()=>{var t;return null==(t=r.current)?void 0:t.focus()})},[r,l,t.editor.isFocused]),{containerRef:i,inputRef:r,onKeyDown:function(t){let r=u(),i=u()+s.nodeSize;"Enter"===t.code&&(c(!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&&(c(!1),a.chain().focus(r-1).run()),"ArrowDown"===t.code&&(c(!1),a.chain().focus(i+1).run())}}}(t,l.value,n,r);return{inputRef:n,containerRef:r,onKeyDown:d,url:l.value,urlChanged:function(t){l.set(t),(0,y.ju)(t)||c(void 0)},onContentChange:c,debouncedUrl:l.debouncedValue,content:t.node.attrs.content}}(t,n,r),{selected:p}=esC(t);return M.jsx(eij,{className:"custom-embed",children:M.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:M.jsxs(u.xu,{flexDirection:"column",children:[M.jsxs(u.xu,{flexGrow:1,alignItems:"center",children:[M.jsx(u.I5,{size:"small",name:"cloud",color:"grey11"}),M.jsx(u.xu,{flexGrow:1,flexDirection:"column",ref:r,children:M.jsx(u.oi,{id:"id",ref:n,value:a,variant:(0,y.ju)(a)?"link":"normal",placeholder:"Paste your link here",onValueChange:l,onKeyDown:i})})]}),(0,y.ju)(a)&&M.jsx(eiD,{selected:p,debouncedUrl:d,onContentChange:c,content:f})]})})})}let esM=en$.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:()=>eiP(esI)}),esR=new class{constructor(t,n,r,i){w(this,"extType","node"),w(this,"nodeType","embed"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}([qZ.RichTextNodeType.embed],esM.name,esM,{fromPrismic:t=>function(n){var r;return null==(r=t.nodes[esM.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}}}),esE=en$.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]}`,ee3(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=>enz({find:RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),esj="heading";function esA(t){switch(t){case 1:return qZ.RichTextNodeType.heading1;case 2:return qZ.RichTextNodeType.heading2;case 3:return qZ.RichTextNodeType.heading3;case 4:return qZ.RichTextNodeType.heading4;case 5:return qZ.RichTextNodeType.heading5;case 6:return qZ.RichTextNodeType.heading6}}function esN(t){return{fullName:esA(t),level:t}}let esP=[1,2,3,4,5,6];function esL(t,n=esP){let r=RegExp(`^heading([${n.join(",")}]){1}$`),i=t.match(r);if(!i||!i[1])return;let o=parseInt(i[1]);return{fullName:esA(o),level:o}}function esD(t,n){let r=t.level;if(n.includes(r))return{fullName:esA(r),level:r}}let esF=t=>{let n=t[0]??1;return{fromPrismic:r=>function(i){var o;let a=esi.converter.fromPrismic(r)(esj,i),u=esL(i.type,t)||esN(n);return null==(o=r.nodes[esj])?void 0:o.create({level:u.level,...esl.fromPrismic(i)},a)},toPrismic(r){let{fullName:i}=esD(r.attrs,t)||esN(n);return esi.converter.toPrismic(r,i,esl.toPrismic(r))}}},esW={name:esj,build(t){var n,r;let i=t?t.size?Array.from(t.values()).reduce((t,n)=>{let r=esL(n);return r?[...t,r.level]:t},[]).sort((t,n)=>t-n):[]:esP;if(!i)return;let o=i.map(t=>esA(t));return new eae(o,esE.extend({name:"heading"}).configure({levels:i}),i,esF(i),t=>{let n=esD(t,i);return n&&`Heading ${n.level}`})}};function esU(t){let{node:n}=t,r=n.attrs.content,{selected:i}=esC(t),a={width:null==r?void 0:r.width,height:null==r?void 0:r.height,name:ei4},{onMediaSelected:s,onCropperDialogClose:l,isUpdating:c,updateContent:d,onClear:f}=function(t){let{content:n,thumbnail:r,imageViewProps:{getPos:i,updateAttributes:a,editor:u,node:s}}=t,[l,c]=(0,o.useTransition)();function d(t){c(()=>a({content:t}))}return{onMediaSelected:function(t){let r=eoa(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=ei7({content:n,thumbnail:r.name,croppedImage:i});o!==n&&d(o)},isUpdating:l,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:ei5(a,r,r)};return M.jsx(eij,{className:"custom-image",children:M.jsx("div",{contentEditable:"false",suppressContentEditableWarning:!0,children:M.jsx(eoo,{content:r,selected:i,fieldLabel:"Feature image",imageLabel:h,initialImages:[g],readOnly:!1,onMediaSelected:s,onCropperDialogClose:l,onClear:f,children:M.jsx(o.Suspense,{fallback:esz,children:null!=r&&r.url?M.jsxs(u.aY,{children:[M.jsx(u.hM,{children:M.jsx(u.xu,{flexDirection:"column",alignItems:"center",position:"relative",height:400,children:M.jsx(u.xu,{justifyContent:"center",flexGrow:1,maxHeight:"100%",maxWidth:"100%",children:M.jsx(u.kg,{src:ei6(r.url),alt:m,sizing:"contain"})})})}),M.jsx(ei3,{onValueChange(t){d({...r,alt:t})},altText:m,readOnly:!r,selected:i})]}):M.jsx(ei2,{isUpdating:c,readOnly:!1,onMediaSelected:s})})})})})}let esz=M.jsx("div",{style:{height:468}}),esB=en$.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",ee3(t)],addNodeView:()=>eiP(esU)}),esV=new class{constructor(t,n,r,i){w(this,"extType","node"),w(this,"nodeType","image"),this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}([qZ.RichTextNodeType.image],esB.name,esB,{fromPrismic:t=>function(n){var r;return null==(r=t.nodes[esB.name])?void 0:r.create({content:n.data})},toPrismic(t){if(void 0!==t.attrs.content)return{type:"image",data:{...t.attrs.content}}}}),es$=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,esq=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,esK=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,esH=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,esG=enV.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",ee3(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[enU({find:es$,type:this.type}),enU({find:esK,type:this.type})]},addPasteRules(){return[enK({find:esq,type:this.type}),enK({find:esH,type:this.type})]}}),esZ=esG.extend({name:"em"}),esY=new class{constructor(t,n,r){w(this,"extType",eo6.Mark),w(this,"richTextNodeTypes",qZ.RichTextNodeType.em),this.name=t,this.component=n,this.converter=r}}(esZ.name,esZ,{fromPrismic:t=>function(){var n;return null==(n=t.marks[esZ.name])?void 0:n.create()},toPrismic(){}}),esJ=esY,esQ=enV.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",ee3(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=es0(eoM({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()}}}),esX=new class{constructor(t,n,r){w(this,"extType",eo6.Mark),w(this,"richTextNodeTypes",qZ.RichTextNodeType.hyperlink),this.name=t,this.component=n,this.converter=r}}(esQ.name,esQ,{fromPrismic:t=>function(n){var r,i,o,a;let u=n.data;if("DocumentLink"===u.__TYPE__){let s={type:esQ.name,id:u.id};return null==(r=t.marks[esQ.name])?void 0:r.create(s)}if("ImageLink"===u.__TYPE__){let l={type:esQ.name,media:es0(u)};return null==(i=t.marks[esQ.name])?void 0:i.create(l)}if("FileLink"===u.__TYPE__){let c={type:esQ.name,media:es0(u)};return null==(o=t.marks[esQ.name])?void 0:o.create(c)}if("ExternalLink"===u.__TYPE__){let d={type:esQ.name,url:u.url,href:u.url,target:u.target};return null==(a=t.marks[esQ.name])?void 0:a.create(d)}},toPrismic:t=>t.attrs.media?es1(t.attrs.media):t.attrs.id?{__TYPE__:"DocumentLink",id:t.attrs.id}:{__TYPE__:"ExternalLink",url:t.attrs.href,target:t.attrs.target}});function es0(t){return JSON.stringify(t)}function es1(t){return JSON.parse(t)}let es2=en$.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",ee3(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)}}}),es3=enV.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",ee3(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:n})=>{let r=eno(t,this.type);return!!Object.entries(r).some(([,t])=>!!t)||n.unsetMark(this.name)}}}}),es4=/^(\d+)\.\s$/,es5=en$.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",ee3(this.options.HTMLAttributes,r),0]:["ol",ee3(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(es2.name,this.editor.getAttributes(es3.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=enB({find:es4,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=enB({find:es4,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(es3.name)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[t]}}),es6=es5.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",ee3(this.options.HTMLAttributes,r),0]:["ol",ee3(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"}),es9=new eat([qZ.RichTextNodeType.orderedList],es6.name,es6,{fromPrismic:t=>function(n){var r;let i=eam.converter.fromPrismic(t)(n);if(i)return null==(r=t.nodes[es6.name])?void 0:r.create(esl.fromPrismic(n),i)},toPrismic:t=>eai.children.map(t,t=>eam.converter.toPrismic(t,qZ.RichTextNodeType.orderedList).filter(c.$)).flat()}),es8=es9,es7=[eau,esJ,esX];function ele(t){return[esf,es_,es8,esW.build(t),esk,esR,esV,...es7].filter(c.$)}let elt=[{nodeType:qZ.RichTextNodeType.paragraph,icon:"textFields",isActive:t=>t.isActive(esf.name)&&!t.isActive(es_.name)&&!t.isActive(es8.name),runCommands:eli((t,n)=>t.clearNodes().setDirection(elo(n))),shortText:"par",text:"Paragraph"},{nodeType:qZ.RichTextNodeType.heading1,icon:"looks1",isActive:t=>t.isActive(esW.name,{level:1}),runCommands:eli((t,n)=>t.setHeading({level:1}).setDirection(elo(n))),shortText:"h1",text:"Heading 1"},{nodeType:qZ.RichTextNodeType.heading2,icon:"looks2",isActive:t=>t.isActive(esW.name,{level:2}),runCommands:eli((t,n)=>t.setHeading({level:2}).setDirection(elo(n))),shortText:"h2",text:"Heading 2"},{nodeType:qZ.RichTextNodeType.heading3,icon:"looks3",isActive:t=>t.isActive(esW.name,{level:3}),runCommands:eli((t,n)=>t.setHeading({level:3}).setDirection(elo(n))),shortText:"h3",text:"Heading 3"},{nodeType:qZ.RichTextNodeType.heading4,icon:"looks4",isActive:t=>t.isActive(esW.name,{level:4}),runCommands:eli((t,n)=>t.setHeading({level:4}).setDirection(elo(n))),shortText:"h4",text:"Heading 4"},{nodeType:qZ.RichTextNodeType.heading5,icon:"looks5",isActive:t=>t.isActive(esW.name,{level:5}),runCommands:eli((t,n)=>t.setHeading({level:5}).setDirection(elo(n))),shortText:"h5",text:"Heading 5"},{nodeType:qZ.RichTextNodeType.heading6,icon:"looks6",isActive:t=>t.isActive(esW.name,{level:6}),runCommands:eli((t,n)=>t.setHeading({level:6}).setDirection(elo(n))),shortText:"h6",text:"Heading 6"},{nodeType:qZ.RichTextNodeType.list,icon:"formatListBulleted",isActive:t=>t.isActive(es_.name),runCommands:eli((t,n)=>t.toggleBulletList().setDirection(elo(n))),shortText:"bull",text:"Bulleted list"},{nodeType:qZ.RichTextNodeType.orderedList,icon:"formatListNumbered",isActive:t=>t.isActive(es8.name),runCommands:eli((t,n)=>t.toggleOrderedList().setDirection(elo(n))),shortText:"num",text:"Numbered list"},{nodeType:qZ.RichTextNodeType.preformatted,icon:"dataObject",isActive:t=>t.isActive(esk.name),runCommands:eli((t,n)=>t.setCodeBlock().setDirection(elo(n))),shortText:"code",text:"Code"},{nodeType:qZ.RichTextNodeType.embed,icon:"cloud",isActive:t=>t.isActive(esR.name),runCommands:eli(t=>t.setEmbed()),shortText:"emb",text:"Embed"},{nodeType:qZ.RichTextNodeType.image,icon:"image",isActive:t=>t.isActive(esV.name),runCommands:eli(t=>t.setImage()),shortText:"img",text:"Image"}],eln=[{nodeType:qZ.RichTextNodeType.strong,icon:"formatBold",isActive:t=>t.isActive(eau.name),runCommands:eli(t=>t.toggleBold())},{nodeType:qZ.RichTextNodeType.em,icon:"formatItalic",isActive:t=>t.isActive(esJ.name),runCommands:eli(t=>t.toggleItalic())}],elr=[{nodeType:qZ.RichTextNodeType.rtl,icon:"formatTextDirectionRToL",isActive:t=>t.isActive({dir:esa.RightToLeft}),runCommands:eli((t,n)=>t.toggleDirection(elo(n)))}];function eli(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 elo(t){let n=t.state.selection.$from.parent.attrs;return esl.parseNodeAttrsDirection(n)}function ela(t,n){return t.filter(t=>n.includes(t.nodeType))}function elu(t){let{items:n,editor:r}=t;return 0===n.length?null:M.jsxs(M.Fragment,{children:[M.jsx(u.Jf,{}),n.map(t=>M.jsx(u.r8,{disabled:!t.runCommands(r,{can:!0}),onPressedChange(){t.runCommands(r)},pressed:t.isActive(r),startIcon:t.icon},t.nodeType))]})}function els(t){let{disabled:n,showWebLinkModal:r,showDocumentsLinkModal:i,showMediaLinkModal:o}=function(t){let{editor:n,setModal:r}=t;return{disabled:!eli(t=>t.setWebLink({href:""}))(n,{can:!0}),showWebLinkModal:function(){r("webLink")},showDocumentsLinkModal:function(){r("documentLink")},showMediaLinkModal:function(){r("mediaLink")}}}(t);return M.jsxs(M.Fragment,{children:[M.jsx(u.Jf,{}),M.jsxs(u.yM,{density:"compact",children:[M.jsx(u.hA,{disabled:n,startIcon:"link",onClick:r},qZ.RichTextNodeType.hyperlink),M.jsxs(u.h_,{children:[M.jsx(u.$F,{children:M.jsx(u.hA,{startIcon:"arrowDropDown"})}),M.jsxs(u.AW,{align:"end",asPortal:!1,children:[M.jsx(u.Xi,{startIcon:M.jsx(u.I5,{name:"public"}),onSelect:r,children:"Link to web page"}),M.jsx(u.Xi,{startIcon:M.jsx(u.I5,{name:"description"}),onSelect:i,children:"Link to document"}),M.jsx(u.Xi,{startIcon:M.jsx(u.I5,{name:"image"}),onSelect:o,children:"Link to media"})]})]})]})]})}function ell(t){let{docId:n,onEdit:r,onUnlink:i}=t,o=function(t){let n=tR();n.searchDocuments||tj("searchDocuments");let{coreApiUrl:r,env:i}=n;return(0,m.QT)(h.EK,[r,i,t])}(n),a=tR();if(!o)return null;let s=o.versions[0],l=(0,v.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}),c=(null==s?void 0:s.preview_summary)??"",d=(null==s?void 0:s.custom_type_label)??"";return M.jsx(u.oZ,{url:l,title:o.title,subTitle:d,description:c,onEdit:r,onUnlink:i,largeIconName:"description"})}function elc(t){let{editor:n}=t,{searchDocuments:r}=tR(),i=n.getAttributes(qZ.RichTextNodeType.hyperlink);if(i.id&&r){let o=i.id;return M.jsx(eld,{docId:o,...t})}if(i.href){let a=i.href;return M.jsx(elf,{url:a,...t})}if(i.media){let u=es1(i.media);return M.jsx(elp,{media:u,...t})}return null}function eld(t){let{editor:n,onEditDocumentLink:r,docId:i}=t;return M.jsx(u.SV,{renderError:()=>M.jsx(u.oZ,{url:"",title:"Failed to Load Linked Document Data",subTitle:"",error:!0,onEdit:r,onUnlink:()=>elh(n)}),children:M.jsx(o.Suspense,{fallback:M.jsx(u.oZ,{url:"",title:"",subTitle:"",loading:!0,onEdit:r,onUnlink:()=>elh(n)}),children:M.jsx(ell,{docId:i,onEdit:r,onUnlink:()=>elh(n)})})})}function elf(t){let{url:n,editor:r,onEditWebLink:i}=t,o=(0,y.ju)(n);return o?M.jsx(u.oZ,{url:n,title:(0,y.S$)(o),subTitle:n,onEdit:i,onUnlink:()=>elh(r)}):M.jsx(u.oZ,{url:n,title:"",subTitle:n,onEdit:i,onUnlink:()=>elh(r)})}function elp(t){let{media:n,editor:r,onEditMediaLink:i}=t;return"ImageLink"===n.__TYPE__?M.jsx(u.Qi,{url:n.url,title:n.name,subTitle:`${n.width} x ${n.height} pixels`,onEdit:i,onUnlink:()=>elh(r)}):"FileLink"===n.__TYPE__?M.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:()=>elh(r),largeIconName:"insertDriveFile"}):null}function elh(t){eli(t=>t.unsetLink())(t)}function elm(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){eli(n=>n.extendMarkRange(qZ.RichTextNodeType.hyperlink).setDocumentLink({id:t}))(n),r(!1)},onOpenChange:i}}(t);return M.jsx(eob,{open:n,onOpenChange:r,onSelectDocument:i})}function elg(t){let{open:n}=t,{onOpenChange:r,onMediaSelected:i}=function(t){let{editor:n,setOpen:r}=t;return{onMediaSelected:function(t){eli(n=>n.extendMarkRange(qZ.RichTextNodeType.hyperlink).setMediaLink({media:t}))(n),r(!1)},onOpenChange:r}}(t);return M.jsx(ei1,{open:n,onOpenChange:r,onMediaSelected:i,assetType:"all"})}function ely(t){let{open:n}=t,{url:r,setUrl:i,onOpenChange:a,onKeyDown:s,openInNewTab:l,setOpenInNewTab:c,onSetUrl:d,selectionUrl:f,selectionUrlTitle:p}=function(t){var n;let{editor:r,setOpen:i}=t,[a,u]=(0,o.useState)(""),[s,l]=(0,o.useState)(!1),c=function(t){let n=t.getAttributes(qZ.RichTextNodeType.hyperlink);return n.href?n.href:void 0}(r),d=(n=r,"_blank"===n.getAttributes(qZ.RichTextNodeType.hyperlink).target);(0,o.useEffect)(()=>{u(c??"")},[c]),(0,o.useEffect)(()=>{l(d??!1)},[d]);let f=c?(0,y.ju)(c):void 0,p=f?(0,y.S$)(f):"";function h(t){let n=s?"_blank":"_self";eli(r=>r.extendMarkRange(qZ.RichTextNodeType.hyperlink).setWebLink({href:t,target:n}))(r),i(!1)}return{url:a,setUrl:u,onSetUrl:h,selectionUrl:c,selectionUrlTitle:p,openInNewTab:s,selectionOpenInNewTab:d,setOpenInNewTab:l,onKeyDown:function(t){"Enter"===t.key&&h(a)},onOpenChange:function(t){u(""),l(!1),i(t)}}}(t);return M.jsx(u.Vq,{open:n,onOpenChange:a,hasClose:!1,size:"small",children:M.jsx(u.cZ,{children:M.jsxs(u.xu,{flexDirection:"column",children:[M.jsxs(u.xu,{flexDirection:"column",height:"100%",padding:16,gap:4,children:[M.jsx(u.yt,{value:r,onValueChange:i,placeholder:"Paste URL",icon:"public",onKeyDown:s}),f&&M.jsxs(u.xu,{flexDirection:"column",padding:{top:8},gap:4,children:[M.jsx(u.xv,{variant:"smallBold",color:"grey11",children:"Linked to"}),M.jsxs(u.xu,{backgroundColor:"grey4",borderRadius:6,padding:8,alignItems:"center",gap:8,children:[M.jsx(u.pI,{largeIconName:"public",smallIconName:"link"}),M.jsxs(u.xu,{flexDirection:"column",children:[M.jsx(u.xv,{variant:"bold",color:"grey12",children:p}),M.jsx(u.xv,{color:"grey11",variant:"small",children:"Web page"})]})]})]})]}),r&&M.jsxs(u.xu,{flexDirection:"column",padding:{block:8},border:{top:!0},children:[M.jsx(u.UN,{onSelect:()=>c(!l),icon:l?"checkBox":"checkBoxOutlinedBlank",textContent:"Open in new tab"}),M.jsx(u.UN,{onSelect:()=>d(r),icon:"link",textContent:"Link to URL"})]})]})})})}function elv(t){let{items:n,editor:r}=t;return 0===n.length?null:M.jsxs(M.Fragment,{children:[M.jsx(u.Jf,{}),M.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=>M.jsx(u.nG,{disabled:!t.runCommands(r,{can:!0}),startIcon:t.icon,value:t.nodeType},t.nodeType))},"mark")]})}function elb(t){var n;let{items:r,editor:i}=t;return 0===r.length?null:M.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=>M.jsx(u.KG,{value:t.nodeType,children:t.text},t.nodeType))})}let elx={duration:100,hideOnClick:!0,offset:[-48,8],placement:"top-start",zIndex:30};function el_(t){let{editor:n,nodeTypes:r}=t,[i,a]=(0,o.useState)(),u=r.includes(qZ.RichTextNodeType.hyperlink),s=!i,{shouldShowBubbleMenu:l,shouldShowLinkPopover:c}=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(qZ.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 M.jsxs(M.Fragment,{children:[M.jsx(eiO,{editor:n,tippyOptions:elx,shouldShow:l,children:s&&M.jsx(elS,{...t,setModal:a})}),M.jsx(eiO,{editor:n,tippyOptions:elx,shouldShow:c,children:s&&M.jsx(elc,{editor:n,onEditWebLink:()=>a("webLink"),onEditDocumentLink:()=>a("documentLink"),onEditMediaLink:()=>a("mediaLink")})}),u&&M.jsxs(M.Fragment,{children:[M.jsx(ely,{open:"webLink"===i,setOpen:function(t){a(t?"webLink":void 0)},editor:n}),M.jsx(elm,{open:"documentLink"===i,setOpen:function(t){a(t?"documentLink":void 0)},editor:n}),M.jsx(elg,{open:"mediaLink"===i,setOpen:function(t){a(t?"mediaLink":void 0)},editor:n})]})]})}function elS(t){let{editor:n,nodeTypes:r}=t,i=r.includes("hyperlink"),o=ela(elt,r),a=ela(eln,r),s=ela(elr,r),l=o.length+a.length+s.length+Number(i);return 0===l?null:M.jsxs(u.o8,{children:[M.jsx(elb,{items:o,editor:n}),M.jsx(elv,{items:a,editor:n}),i&&M.jsx(els,{...t}),M.jsx(elu,{items:s,editor:n}),l>1&&M.jsxs(M.Fragment,{children:[M.jsx(u.Jf,{}),M.jsx(u.hA,{onClick(){n.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:"formatClear"},"clear")]})]})}function elT(t){var n;let{content:r,field:i,id:a,readOnly:l}=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 eao();let r=function(t){let n=(t.single||t.multi||"").split(/\s*,\s*/).map(t=>{let n=qZ.RichTextNodeTypeCodec.decode(t);return"Right"===n._tag?n.right:void 0}).filter(c.$);return new Set(n)}(t);if(!(null!=r&&r.size))return eao();let i=(n=r,ele(n).filter(t=>(0,b.G)(n,n=>t.richTextNodeTypes.includes(n)))),o=function(t){let n=new Set(t);return(0,b.G)(n,ean)&&n.add(esf),(0,b.G)(n,eo7)||n.add(esf),[...n]}(i);return{extensions:o,defaultTextConverter:function(t){let n=t.find(eo7)??esf;return function(t){return r=>n.converter.fromPrismic(t)({...r,type:n.richTextNodeTypes[0]??"heading1"})}}(o)}}(t.config),i=n.filter(elw),o=n.flatMap(t=>t.richTextNodeTypes),a=n.map(t=>t.component),u=n.filter(elO).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===eo9.Text&&(t[n.name]=n.placeholder),t),{})),unfocusedPlaceholder:null==(r=t.config)?void 0:r.placeholder,nodeExtensions:n},s=a.includes(qZ.RichTextNodeType.orderedList)||a.includes(qZ.RichTextNodeType.list);return[eab.component((null==(i=t.config)?void 0:i.single)===void 0),esi.component,eaw.component,eak(u),s?eam.component:void 0,esg.configure({nodeTypes:a})].filter(c.$)}(t,i),ess.configure({supportedExtensionNames:u}),eoQ],l=s.map(t=>t.name),d=function(t,n){let r=etl.resolve(t);return ee7(r,void 0)}(s);return{allComponents:s,extensionNames:l,defaultTextConverter:r,nodeExtensions:i,names:o,schema:d}},[i])}(i),f=r&&eab.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),l=(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 eik(t);return a(r),r.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{n&&l()})})}),()=>{n=!1}},n),(0,o.useEffect)(()=>()=>{null==i||i.destroy()},[i]),i}({content:null==f?void 0:f.toJSON(),editable:!l,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=eab.converter(d.nodeExtensions).toPrismic(t.state.doc);p(n)}},[d,l]);return M.jsxs(u.gN,{children:[M.jsx(u.Qy,{htmlFor:a,children:ZQ(i)}),M.jsxs(u.JO,{children:[M.jsx(eiM,{editor:h??null,style:{flex:1}}),(null==h?void 0:h.isEditable)&&M.jsx(el_,{editor:h,nodeTypes:d.names.concat(esu)})]})]})}function elw(t){return t.extType===eo6.Node}function elO(t){return!(t.extType!==eo6.Node||t.nodeType!==eo9.Text||t.lockedFormat)}function elk(t){var n,r,i,o,a;let{content:s,field:l,id:c,onContentChange:d,readOnly:f}=t,p=ZX(l),h=(i=l,(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 M.jsxs(u.gN,{children:[M.jsx(u.fw,{name:"arrowDropDownCircle"}),M.jsx(u.Qy,{htmlFor:c,children:ZQ(l)}),M.jsx(u.JO,{children:M.jsx(u.Ph,{id:c,size:"large",color:"grey",value:m,renderTrigger:()=>M.jsx(u.JF,{id:c,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=l.config)?void 0:n.options)?void 0:r.map(t=>M.jsx(u.Ql,{value:t,children:t},t))})})]})}function elC(t){let{id:n,readOnly:r,field:i,content:o,onContentChange:a}=t,s=null!=o&&o.value?(0,l._O)(o.value):void 0;return M.jsxs(u.gN,{children:[M.jsx(u.fw,{name:"event"}),M.jsx(u.Qy,{id:n,children:ZQ(i)}),M.jsx(u.JO,{children:M.jsx(u.xu,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:M.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 elI(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?M.jsx(Z0,{...t,field:a,content:nQ.isBooleanContent(i)?i:void 0}):"Date"===a.type?M.jsx(Z2,{...t,field:a,content:nQ.isDateContent(i)?i:void 0}):"Timestamp"===a.type?M.jsx(elC,{...t,field:a,content:nQ.isTimestampContent(i)?i:void 0}):"Image"===a.type?M.jsx(eou,{...t,field:a,content:nQ.isImageContent(i)?i:void 0}):"Link"===a.type?M.jsx(eoR,{...t,field:a,content:nQ.isLinkContent(i)?i:void 0}):"Number"===a.type?M.jsx(eoN,{...t,field:a,content:nQ.isNumberContent(i)?i:void 0}):"StructuredText"===a.type?M.jsx(elT,{...t,field:a,content:nQ.isRichTextContent(i)?i:void 0}):"Select"===a.type?M.jsx(elk,{...t,field:a,content:nQ.isSelectContent(i)?i:void 0}):"Text"===a.type?M.jsx(eol,{...t,field:a,content:nQ.isTextContent(i)?i:void 0}):"Embed"===a.type?M.jsx(eiB,{...t,field:a,content:nQ.isEmbedContent(i)?i:void 0}):"Color"===a.type?M.jsx(Z1,{...t,field:a,content:nQ.isColorContent(i)?i:void 0}):"GeoPoint"===a.type?M.jsx(eiH,{...t,field:a,content:nQ.isGeoPointContent(i)?i:void 0}):null},[i,n,a,u,r])}function elM(t){let{content:n,id:r,nonRepeatableZone:i,onContentChange:u,readOnly:s}=t,l=(0,o.useMemo)(()=>Object.entries(i),[i]);return M.jsx(M.Fragment,{children:l.map(([t,i])=>{let o=n[t];return M.jsx(elI,{id:`${r}.${t}`,readOnly:s,nestableWidget:i,content:nQ.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 elR(t){let{id:n,title:r,content:i,onContentChange:a,readOnly:s,repeatable:l=!0,repeatableZone:c}=t,d=(0,o.useMemo)(()=>Object.entries(c),[c]),p=i??[elE];!l&&p.length>1&&(p=p.slice(0,1));let h=(0,o.useRef)(new Map);function m(t){return h.current.get(t)??"!bugged!"}function g(t){let{index:n,offset:r}=t;a((0,f.pB)(p,n,n+r))}function y(t){let{index:n}=t;a((0,f.$E)(p,n))}return!function(t,n){let r=new Set(n);n.forEach(n=>{t.has(n)||t.set(n,(0,_.d)())}),(0,o.useLayoutEffect)(()=>{for(let[n]of t)r.has(n)||t.delete(n)})}(h.current,p),0===Object.keys(c).length?null:M.jsx(u.ZA,{title:`Repeatable zone${r?` • ${r}`:""}`,addItemButtonTitle:"Add item in group",items:p,maxItems:l?void 0:1,getItemKey:m,onAddItem:function(){a(p.concat(elj()))},children(t,r){let i=new Map(t.value),o=m(t);return M.jsx(u.MN,{index:r,title:"Item",onMove:g,onDelete:y,children:d.map(([u,l])=>{let c=i.get(u),d=nQ.isNestableContent(c)?c:void 0;return M.jsx(elI,{id:`${n}[${o}].${u}`,content:d,nestableWidget:l,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 elj(o)}let a=Array.from(new Map(t.value).set(r,i));return elj(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)}(p,[n,o]);(function(t,n,r){let i=t.get(n);void 0!==i&&t.set(r,i)})(h.current,t,o),a(u)})(t,r,u,n),readOnly:s},u)})})}})}let elE={__TYPE__:"GroupItemContent",value:[]};function elj(t=[]){return{__TYPE__:"GroupItemContent",value:t}}function elA(t){var n,r,i,a;let{config:s,content:l,sliceKey:c,readOnly:d=!1,sharedSlice:f,onContentChange:p,...h}=t,m=(n=f,r=l.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)(ZJ),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:c}),_=()=>{c&&x.update("sliceFieldSet",c)};return void 0===m?null:M.jsx(tM.Provider,{value:s,children:M.jsxs(u.C3,{id:b,selected:v,onFocus:_,children:[M.jsx(u.ax,{children:(i=f,a=m,[i.name,a.name].join(" • "))}),M.jsxs(u.En,{heightEstimate:400,box:{gap:u.jM},children:[M.jsx(elM,{...y,nonRepeatableZone:m.primary??{},content:l.primary,onContentChange(t){p({...l,primary:t})}}),M.jsx(elR,{...y,repeatableZone:m.items??{},content:l.items,onContentChange(t){p({...l,items:t})}})]})]})})}(0,o.createContext)({editedUID:!1,onEditUID(){}})}}]);
|