@prismicio/editor-fields 0.4.0 → 0.4.1
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/dist/fields/ImageField/MediaPicker/MediaLibrary.d.ts +1 -0
- package/dist/fields/ImageField/MediaPicker/MediaPicker.d.ts +8 -0
- package/dist/fields/ImageField/MediaPicker/UnsplashLibrary.d.ts +6 -0
- package/dist/fields/ImageField/MediaPicker/index.d.ts +1 -8
- package/dist/fields/RichTextField/coreExtensions/ListItem.d.ts +4 -4
- package/dist/fields/UIDField/UIDField.d.ts +10 -0
- package/dist/fields/UIDField/index.d.ts +1 -0
- package/dist/fields/UIDField/uidUtils.d.ts +1 -0
- package/dist/fields/utils.d.ts +4 -3
- package/dist/index.es.js +11902 -11815
- package/dist/index.umd.js +29 -29
- package/package.json +5 -5
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Sn,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("react"),require("@prismicio/editor-ui"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@prismicio/editor-ui","react-dom"],U):(Sn=typeof globalThis<"u"?globalThis:Sn||self,U(Sn.EditorFields={},Sn.React,Sn.EditorUi,Sn.ReactDOM))})(this,function(Sn,U,
|
|
1
|
+
(function(Sn,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("react"),require("@prismicio/editor-ui"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@prismicio/editor-ui","react-dom"],U):(Sn=typeof globalThis<"u"?globalThis:Sn||self,U(Sn.EditorFields={},Sn.React,Sn.EditorUi,Sn.ReactDOM))})(this,function(Sn,U,E,u_){"use strict";var Dxe=Object.defineProperty;var qxe=(Sn,U,E)=>U in Sn?Dxe(Sn,U,{enumerable:!0,configurable:!0,writable:!0,value:E}):Sn[U]=E;var Bf=(Sn,U,E)=>(qxe(Sn,typeof U!="symbol"?U+"":U,E),E);function UR(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const $e=UR(U),L6=UR(u_);var he=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ic(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){if(this instanceof r){var i=[null];i.push.apply(i,arguments);var o=Function.bind.apply(t,i);return new o}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var I={},D6={get exports(){return I},set exports(e){I=e}},zf={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -14,30 +14,30 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var zR;function U6(){return zR||(zR=1,process.env.NODE_ENV!=="production"&&function(){var e=U,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),u=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),h=Symbol.iterator,v="@@iterator";function m(w){if(w===null||typeof w!="object")return null;var B=h&&w[h]||w[v];return typeof B=="function"?B:null}var _=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(w){{for(var B=arguments.length,ne=new Array(B>1?B-1:0),Ie=1;Ie<B;Ie++)ne[Ie-1]=arguments[Ie];S("error",w,ne)}}function S(w,B,ne){{var Ie=_.ReactDebugCurrentFrame,Xe=Ie.getStackAddendum();Xe!==""&&(B+="%s",ne=ne.concat([Xe]));var
|
|
18
|
-
`+Ne+w}}var He=!1,it;{var Ft=typeof WeakMap=="function"?WeakMap:Map;it=new Ft}function qt(w,B){if(!w||He)return"";{var ne=it.get(w);if(ne!==void 0)return ne}var Ie;He=!0;var Xe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var
|
|
17
|
+
*/var zR;function U6(){return zR||(zR=1,process.env.NODE_ENV!=="production"&&function(){var e=U,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),u=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),h=Symbol.iterator,v="@@iterator";function m(w){if(w===null||typeof w!="object")return null;var B=h&&w[h]||w[v];return typeof B=="function"?B:null}var _=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(w){{for(var B=arguments.length,ne=new Array(B>1?B-1:0),Ie=1;Ie<B;Ie++)ne[Ie-1]=arguments[Ie];S("error",w,ne)}}function S(w,B,ne){{var Ie=_.ReactDebugCurrentFrame,Xe=Ie.getStackAddendum();Xe!==""&&(B+="%s",ne=ne.concat([Xe]));var ut=ne.map(function(Ge){return String(Ge)});ut.unshift("Warning: "+B),Function.prototype.apply.call(console[w],console,ut)}}var b=!1,$=!1,T=!1,M=!1,R=!1,q;q=Symbol.for("react.module.reference");function Y(w){return!!(typeof w=="string"||typeof w=="function"||w===r||w===o||R||w===i||w===c||w===l||M||w===p||b||$||T||typeof w=="object"&&w!==null&&(w.$$typeof===d||w.$$typeof===f||w.$$typeof===a||w.$$typeof===u||w.$$typeof===s||w.$$typeof===q||w.getModuleId!==void 0))}function N(w,B,ne){var Ie=w.displayName;if(Ie)return Ie;var Xe=B.displayName||B.name||"";return Xe!==""?ne+"("+Xe+")":ne}function Z(w){return w.displayName||"Context"}function ie(w){if(w==null)return null;if(typeof w.tag=="number"&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof w=="function")return w.displayName||w.name||null;if(typeof w=="string")return w;switch(w){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case l:return"SuspenseList"}if(typeof w=="object")switch(w.$$typeof){case u:var B=w;return Z(B)+".Consumer";case a:var ne=w;return Z(ne._context)+".Provider";case s:return N(w,w.render,"ForwardRef");case f:var Ie=w.displayName||null;return Ie!==null?Ie:ie(w.type)||"Memo";case d:{var Xe=w,ut=Xe._payload,Ge=Xe._init;try{return ie(Ge(ut))}catch{return null}}}return null}var J=Object.assign,ye=0,we,x,k,C,O,F,j;function X(){}X.__reactDisabledLog=!0;function te(){{if(ye===0){we=console.log,x=console.info,k=console.warn,C=console.error,O=console.group,F=console.groupCollapsed,j=console.groupEnd;var w={configurable:!0,enumerable:!0,value:X,writable:!0};Object.defineProperties(console,{info:w,log:w,warn:w,error:w,group:w,groupCollapsed:w,groupEnd:w})}ye++}}function xe(){{if(ye--,ye===0){var w={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:J({},w,{value:we}),info:J({},w,{value:x}),warn:J({},w,{value:k}),error:J({},w,{value:C}),group:J({},w,{value:O}),groupCollapsed:J({},w,{value:F}),groupEnd:J({},w,{value:j})})}ye<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ce=_.ReactCurrentDispatcher,Ne;function ze(w,B,ne){{if(Ne===void 0)try{throw Error()}catch(Xe){var Ie=Xe.stack.trim().match(/\n( *(at )?)/);Ne=Ie&&Ie[1]||""}return`
|
|
18
|
+
`+Ne+w}}var He=!1,it;{var Ft=typeof WeakMap=="function"?WeakMap:Map;it=new Ft}function qt(w,B){if(!w||He)return"";{var ne=it.get(w);if(ne!==void 0)return ne}var Ie;He=!0;var Xe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ut;ut=ce.current,ce.current=null,te();try{if(B){var Ge=function(){throw Error()};if(Object.defineProperty(Ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ge,[])}catch(Ra){Ie=Ra}Reflect.construct(w,[],Ge)}else{try{Ge.call()}catch(Ra){Ie=Ra}w.call(Ge.prototype)}}else{try{throw Error()}catch(Ra){Ie=Ra}w()}}catch(Ra){if(Ra&&Ie&&typeof Ra.stack=="string"){for(var je=Ra.stack.split(`
|
|
19
19
|
`),Gn=Ie.stack.split(`
|
|
20
|
-
`),Pt=
|
|
21
|
-
`+
|
|
20
|
+
`),Pt=je.length-1,Ut=Gn.length-1;Pt>=1&&Ut>=0&&je[Pt]!==Gn[Ut];)Ut--;for(;Pt>=1&&Ut>=0;Pt--,Ut--)if(je[Pt]!==Gn[Ut]){if(Pt!==1||Ut!==1)do if(Pt--,Ut--,Ut<0||je[Pt]!==Gn[Ut]){var ni=`
|
|
21
|
+
`+je[Pt].replace(" at new "," at ");return w.displayName&&ni.includes("<anonymous>")&&(ni=ni.replace("<anonymous>",w.displayName)),typeof w=="function"&&it.set(w,ni),ni}while(Pt>=1&&Ut>=0);break}}}finally{He=!1,ce.current=ut,xe(),Error.prepareStackTrace=Xe}var Uf=w?w.displayName||w.name:"",P6=Uf?ze(Uf):"";return typeof w=="function"&&it.set(w,P6),P6}function Ht(w,B,ne){return qt(w,!1)}function xn(w){var B=w.prototype;return!!(B&&B.isReactComponent)}function Nr(w,B,ne){if(w==null)return"";if(typeof w=="function")return qt(w,xn(w));if(typeof w=="string")return ze(w);switch(w){case c:return ze("Suspense");case l:return ze("SuspenseList")}if(typeof w=="object")switch(w.$$typeof){case s:return Ht(w.render);case f:return Nr(w.type,B,ne);case d:{var Ie=w,Xe=Ie._payload,ut=Ie._init;try{return Nr(ut(Xe),B,ne)}catch{}}}return""}var fr=Object.prototype.hasOwnProperty,Q={},re=_.ReactDebugCurrentFrame;function ke(w){if(w){var B=w._owner,ne=Nr(w.type,w._source,B?B.type:null);re.setExtraStackFrame(ne)}else re.setExtraStackFrame(null)}function Ot(w,B,ne,Ie,Xe){{var ut=Function.call.bind(fr);for(var Ge in w)if(ut(w,Ge)){var je=void 0;try{if(typeof w[Ge]!="function"){var Gn=Error((Ie||"React class")+": "+ne+" type `"+Ge+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof w[Ge]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Gn.name="Invariant Violation",Gn}je=w[Ge](B,Ge,Ie,ne,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Pt){je=Pt}je&&!(je instanceof Error)&&(ke(Xe),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Ie||"React class",ne,Ge,typeof je),ke(null)),je instanceof Error&&!(je.message in Q)&&(Q[je.message]=!0,ke(Xe),g("Failed %s type: %s",ne,je.message),ke(null))}}}var ei=Array.isArray;function qi(w){return ei(w)}function Ui(w){{var B=typeof Symbol=="function"&&Symbol.toStringTag,ne=B&&w[Symbol.toStringTag]||w.constructor.name||"Object";return ne}}function Oa(w){try{return wa(w),!1}catch{return!0}}function wa(w){return""+w}function Ca(w){if(Oa(w))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ui(w)),wa(w)}var ti=_.ReactCurrentOwner,Pu={key:!0,ref:!0,__self:!0,__source:!0},Wf,P,A;A={};function L(w){if(fr.call(w,"ref")){var B=Object.getOwnPropertyDescriptor(w,"ref").get;if(B&&B.isReactWarning)return!1}return w.ref!==void 0}function Pe(w){if(fr.call(w,"key")){var B=Object.getOwnPropertyDescriptor(w,"key").get;if(B&&B.isReactWarning)return!1}return w.key!==void 0}function W(w,B){if(typeof w.ref=="string"&&ti.current&&B&&ti.current.stateNode!==B){var ne=ie(ti.current.type);A[ne]||(g('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',ie(ti.current.type),w.ref),A[ne]=!0)}}function ae(w,B){{var ne=function(){Wf||(Wf=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",B))};ne.isReactWarning=!0,Object.defineProperty(w,"key",{get:ne,configurable:!0})}}function ge(w,B){{var ne=function(){P||(P=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",B))};ne.isReactWarning=!0,Object.defineProperty(w,"ref",{get:ne,configurable:!0})}}var ve=function(w,B,ne,Ie,Xe,ut,Ge){var je={$$typeof:t,type:w,key:B,ref:ne,props:Ge,_owner:ut};return je._store={},Object.defineProperty(je._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(je,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Ie}),Object.defineProperty(je,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Xe}),Object.freeze&&(Object.freeze(je.props),Object.freeze(je)),je};function Ce(w,B,ne,Ie,Xe){{var ut,Ge={},je=null,Gn=null;ne!==void 0&&(Ca(ne),je=""+ne),Pe(B)&&(Ca(B.key),je=""+B.key),L(B)&&(Gn=B.ref,W(B,Xe));for(ut in B)fr.call(B,ut)&&!Pu.hasOwnProperty(ut)&&(Ge[ut]=B[ut]);if(w&&w.defaultProps){var Pt=w.defaultProps;for(ut in Pt)Ge[ut]===void 0&&(Ge[ut]=Pt[ut])}if(je||Gn){var Ut=typeof w=="function"?w.displayName||w.name||"Unknown":w;je&&ae(Ge,Ut),Gn&&ge(Ge,Ut)}return ve(w,je,Gn,Xe,Ie,ti.current,Ge)}}var ct=_.ReactCurrentOwner,Hn=_.ReactDebugCurrentFrame;function Fr(w){if(w){var B=w._owner,ne=Nr(w.type,w._source,B?B.type:null);Hn.setExtraStackFrame(ne)}else Hn.setExtraStackFrame(null)}var jf;jf=!1;function Bi(w){return typeof w=="object"&&w!==null&&w.$$typeof===t}function Lf(){{if(ct.current){var w=ie(ct.current.type);if(w)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+w+"`."}return""}}function Df(w){{if(w!==void 0){var B=w.fileName.replace(/^.*[\\\/]/,""),ne=w.lineNumber;return`
|
|
24
24
|
|
|
25
|
-
Check your code at `+B+":"+ne+"."}return""}}var Ea={};function
|
|
25
|
+
Check your code at `+B+":"+ne+"."}return""}}var Ea={};function jR(w){{var B=Lf();if(!B){var ne=typeof w=="string"?w:w.displayName||w.name;ne&&(B=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+ne+">.")}return B}}function qf(w,B){{if(!w._store||w._store.validated||w.key!=null)return;w._store.validated=!0;var ne=LR(B);if(Ea[ne])return;Ea[ne]=!0;var Ie="";w&&w._owner&&w._owner!==ct.current&&(Ie=" It was passed a child from "+ie(w._owner.type)+"."),Nr(w),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ne,Ie),Nr(null)}}function Tc(w,B){{if(typeof w!="object")return;if(qi(w))for(var ne=0;ne<w.length;ne++){var Ie=w[ne];Bi(Ie)&&qf(Ie,B)}else if(Bi(w))w._store&&(w._store.validated=!0);else if(w){var Xe=m(w);if(typeof Xe=="function"&&Xe!==w.entries)for(var at=Xe.call(w),Ge;!(Ge=at.next()).done;)Bi(Ge.value)&&qf(Ge.value,B)}}}function Exe(w){{var B=w.type;if(B==null||typeof B=="string")return;var ne;if(typeof B=="function")ne=B.propTypes;else if(typeof B=="object"&&(B.$$typeof===s||B.$$typeof===f))ne=B.propTypes;else return;if(ne){var Ie=ie(B);Ot(ne,w.props,"prop",Ie,w)}else if(B.PropTypes!==void 0&&!Lf){Lf=!0;var Xe=ie(B);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Xe||"Unknown")}typeof B.getDefaultProps=="function"&&!B.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Rxe(w){{for(var B=Object.keys(w.props),ne=0;ne<B.length;ne++){var Ie=B[ne];if(Ie!=="children"&&Ie!=="key"){Nr(w),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ie),Nr(null);break}}w.ref!==null&&(Nr(w),g("Invalid attribute `ref` supplied to `React.Fragment`."),Nr(null))}}function F6(w,B,ne,Ie,Xe,at){{var Ge=Y(w);if(!Ge){var Le="";(w===void 0||typeof w=="object"&&w!==null&&Object.keys(w).length===0)&&(Le+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Gn=Df(Xe);Gn?Le+=Gn:Le+=jf();var Pt;w===null?Pt="null":qi(w)?Pt="array":w!==void 0&&w.$$typeof===t?(Pt="<"+(ie(w.type)||"Unknown")+" />",Le=" Did you accidentally export a JSX literal instead of a component?"):Pt=typeof w,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Pt,Le)}var Ut=Ce(w,B,ne,Xe,at);if(Ut==null)return Ut;if(Ge){var ni=B.children;if(ni!==void 0)if(Ie)if(qi(ni)){for(var Uf=0;Uf<ni.length;Uf++)Tc(ni[Uf],w);Object.freeze&&Object.freeze(ni)}else g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Tc(ni,w)}return w===r?Rxe(Ut):Exe(Ut),Ut}}function Mxe(w,B,ne){return F6(w,B,ne,!0)}function xxe(w,B,ne){return F6(w,B,ne,!1)}var kxe=xxe,Axe=Mxe;Kf.Fragment=r,Kf.jsx=kxe,Kf.jsxs=Axe}()),Kf}(function(e){process.env.NODE_ENV==="production"?e.exports=q6():e.exports=U6()})(D6);var KR=function(e){return function(){return{meet:function(t,n){return function(r){return e.meet(t(r),n(r))}},join:function(t,n){return function(r){return e.join(t(r),n(r))}},zero:function(){return e.zero},one:function(){return e.one},implies:function(t,n){return function(r){return e.implies(t(r),n(r))}},not:function(t){return function(n){return e.not(t(n))}}}}},s_=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},VR=function(e){var t=s_(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}},c_=function(e){return{add:function(t,n){return function(r){return e.add(t(r),n(r))}},zero:function(){return e.zero},mul:function(t,n){return function(r){return e.mul(t(r),n(r))}},one:function(){return e.one}}},HR=function(e){var t=c_(e);return{add:t.add,mul:t.mul,one:t.one,zero:t.zero,sub:function(n,r){return function(i){return e.sub(n(i),r(i))}}}},B6=function(e){return function(t){return t(e)}};function D(e){return e}var Oc=D;function Yn(e){return function(){return e}}var l_=Yn(!0),GR=Yn(!1),YR=Yn(null),f_=Yn(void 0),z6=f_;function K6(e){return function(t,n){return e(n,t)}}function V(e,t,n,r,i,o,a,u,s){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return u(a(o(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return s(u(a(o(i(r(n(t(e.apply(this,arguments)))))))))}}}function JR(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e}function V6(e){return e+1}function H6(e){return e-1}function ZR(e){throw new Error("Called `absurd` function which should be uncallable")}function G6(e){return function(t){return e.apply(void 0,t)}}function Y6(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(t)}}function y(e,t,n,r,i,o,a,u,s){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return o(i(r(n(t(e)))));case 7:return a(o(i(r(n(t(e))))));case 8:return u(a(o(i(r(n(t(e)))))));case 9:return s(u(a(o(i(r(n(t(e))))))));default:{for(var c=arguments[0],l=1;l<arguments.length;l++)c=arguments[l](c);return c}}}var J6=ZR,Jn=function(e,t){return t};function Z6(e){return function(t){return!e(t)}}var X6=function(){return{concat:function(e,t){return V(e,t)},empty:D}};const XR=Object.freeze(Object.defineProperty({__proto__:null,SK:Jn,absurd:ZR,apply:B6,constFalse:GR,constNull:YR,constTrue:l_,constUndefined:f_,constVoid:z6,constant:Yn,decrement:H6,flip:K6,flow:V,getBooleanAlgebra:KR,getEndomorphismMonoid:X6,getMonoid:VR,getRing:HR,getSemigroup:s_,getSemiring:c_,hole:J6,identity:D,increment:V6,not:Z6,pipe:y,tuple:JR,tupled:G6,unsafeCoerce:Oc,untupled:Y6},Symbol.toStringTag,{value:"Module"}));var Fr=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},QR=function(e){return Fr(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},eM=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Fr(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},Q6=function(e,t){return y(e,tM(t))},tM=function(e){return function(t){return Fr(function(n,r){return t.equals(e(n),e(r))})}},nM="Eq",wc={equals:function(e,t){return e===t}},eG={equals:function(){return!0}},rM=function(){return{concat:function(e,t){return Fr(function(n,r){return e.equals(n,r)&&t.equals(n,r)})}}},tG=function(){return{concat:rM().concat,empty:eG}},iM={URI:nM,contramap:Q6},nG=eM,rG=QR,iG=wc.equals,oG=iM,aG=wc,uG=wc,sG=wc,cG={equals:function(e,t){return e.valueOf()===t.valueOf()}};const lG=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:iM,URI:nM,contramap:tM,eq:oG,eqBoolean:aG,eqDate:cG,eqNumber:sG,eqStrict:wc,eqString:uG,fromEquals:Fr,getMonoid:tG,getSemigroup:rM,getStructEq:rG,getTupleEq:nG,strictEqual:iG,struct:QR,tuple:eM},Symbol.toStringTag,{value:"Module"}));function Cc(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function Ke(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}function wt(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}function Ec(e,t){var n=Cc(e,t);return{map:function(r,i){return y(r,n(i))}}}const fG=Object.freeze(Object.defineProperty({__proto__:null,bindTo:wt,flap:Ke,getFunctorComposition:Ec,map:Cc},Symbol.toStringTag,{value:"Module"}));var dG=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Wt=function(e){return e._tag==="None"},bt=function(e){return e._tag==="Some"},be={_tag:"None"},pe=function(e){return{_tag:"Some",value:e}},Gt=function(e){return e._tag==="Left"},d_=function(e){return e._tag==="Right"},So=function(e){return{_tag:"Left",left:e}},Ma=function(e){return{_tag:"Right",right:e}},Vf=function(e){return[e]},gt=function(e){return e.length>0},dr=function(e){return e[0]},Rc=function(e){return e.slice(1)},rn=[],Yt={},lt=Object.prototype.hasOwnProperty,im=function(e){return dG([e[0]],e.slice(1),!0)},Me=function(e,t){return{left:e,right:t}},pG=function(e,t){return y(e,p_(t))},hG=function(e,t){return y(e,oM(t))},mG=function(e,t,n){return y(e,aM(t,n))},p_=function(e){return function(t){return Me(Hf(t),e(Gf(t)))}},oM=function(e){return function(t){return Me(e(Hf(t)),Gf(t))}},aM=function(e,t){return function(n){return Me(e(Hf(n)),t(Gf(n)))}},h_="Separated",vG={URI:h_,mapLeft:hG,bimap:mG},uM={URI:h_,map:pG},gG=Ke(uM),Hf=function(e){return e.left},Gf=function(e){return e.right};const yG=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:vG,Functor:uM,URI:h_,bimap:aM,flap:gG,left:Hf,map:p_,mapLeft:oM,right:Gf,separated:Me},Symbol.toStringTag,{value:"Module"}));function $o(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}function Ct(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}function Et(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}function Rt(e){return function(t,n){return function(r){return e.ap(e.map(r,function(i){return function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))}}),n)}}}function Jt(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}function m_(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,t===0?e.apply(null,i):m_(e,t-1,i)}}var v_={1:function(e){return[e]},2:function(e){return function(t){return[e,t]}},3:function(e){return function(t){return function(n){return[e,t,n]}}},4:function(e){return function(t){return function(n){return function(r){return[e,t,n,r]}}}},5:function(e){return function(t){return function(n){return function(r){return function(i){return[e,t,n,r,i]}}}}}};function bG(e){return lt.call(v_,e)||(v_[e]=m_(JR,e-1,[])),v_[e]}function _G(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=bG(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}function SG(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return u={},u[e[0]]=n,u[e[1]]=r,u[e[2]]=i,u[e[3]]=o,u[e[4]]=a,u}}}}};default:return m_(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}function $G(e){return function(t){for(var n=Object.keys(t),r=n.length,i=SG(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}const TG=Object.freeze(Object.defineProperty({__proto__:null,ap:$o,apFirst:Ct,apS:Rt,apSecond:Et,getApplySemigroup:Jt,sequenceS:$G,sequenceT:_G},Symbol.toStringTag,{value:"Module"}));function ft(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}function Mt(e){return function(t,n){return function(r){return e.chain(r,function(i){return e.map(n(i),function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))})})}}}const IG=Object.freeze(Object.defineProperty({__proto__:null,bind:Mt,chainFirst:ft},Symbol.toStringTag,{value:"Module"}));var sM=function(e){return function(t,n){return t===n||e(t,n)===0}},Pu=function(e){return{equals:sM(e),compare:function(t,n){return t===n?0:e(t,n)}}},cM=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Pu(function(n,r){for(var i=0;i<e.length-1;i++){var o=e[i].compare(n[i],r[i]);if(o!==0)return o}return e[i].compare(n[i],r[i])})},g_=function(e){return Pu(function(t,n){return e.compare(n,t)})},OG=function(e,t){return y(e,om(t))},om=function(e){return function(t){return Pu(function(n,r){return t.compare(e(n),e(r))})}},lM="Ord",fM=function(){return{concat:function(e,t){return Pu(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},y_=function(){return{concat:fM().concat,empty:Pu(function(){return 0})}},dM={URI:lM,contramap:OG},wG={equals:l_,compare:Yn(0)},CG=function(e){return function(t){return function(n){return n===t||e.compare(n,t)===0}}},pM=function(e){return function(t,n){return e.compare(t,n)===-1}},hM=function(e){return function(t,n){return e.compare(t,n)===1}},EG=function(e){return function(t,n){return e.compare(t,n)!==1}},RG=function(e){return function(t,n){return e.compare(t,n)!==-1}},am=function(e){return function(t,n){return t===n||e.compare(t,n)<1?t:n}},um=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}},mM=function(e){var t=am(e),n=um(e);return function(r,i){return function(o){return n(t(o,i),r)}}},MG=function(e){var t=pM(e),n=hM(e);return function(r,i){return function(o){return!(t(o,r)||n(o,i))}}},xG=cM,kG=g_,AG=dM;function NG(e,t){return e<t?-1:e>t?1:0}var b_={equals:wc.equals,compare:NG},FG=b_,PG=b_,sm=b_,WG=y(sm,om(function(e){return e.valueOf()}));const LG=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:dM,URI:lM,between:MG,clamp:mM,contramap:om,equals:CG,equalsDefault:sM,fromCompare:Pu,geq:RG,getDualOrd:kG,getMonoid:y_,getSemigroup:fM,getTupleOrd:xG,gt:hM,leq:EG,lt:pM,max:um,min:am,ord:AG,ordBoolean:FG,ordDate:WG,ordNumber:sm,ordString:PG,reverse:g_,trivial:wG,tuple:cM},Symbol.toStringTag,{value:"Module"}));var vM=function(e){return{concat:function(t,n){return e.concat(n,t)}}},jG=function(e){return function(t){return{concat:function(n,r){return e(n)?t.concat(n,r):r}}}},DG=function(e){return function(t){return{concat:function(n,r){return e(r)?t.concat(n,r):n}}}},qG=function(e){return function(t){return{concat:function(n,r){return t.concat(e(n),e(r))}}}},gM=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}};const UG=Object.freeze(Object.defineProperty({__proto__:null,concatAll:gM,endo:qG,filterFirst:jG,filterSecond:DG,reverse:vM},Symbol.toStringTag,{value:"Module"}));var cm=function(e){return{concat:am(e)}},lm=function(e){return{concat:um(e)}},__=function(e){return{concat:function(){return e}}},S_=vM,$_=function(e){return{concat:function(t,n){var r={};for(var i in e)lt.call(e,i)&&(r[i]=e[i].concat(t[i],n[i]));return r}}},T_=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:function(n,r){return e.map(function(i,o){return i.concat(n[o],r[o])})}}},yM=function(e){return function(t){return{concat:function(n,r){return t.concat(n,t.concat(e,r))}}}},I_=function(){return{concat:D}},fm=function(){return{concat:function(e,t){return t}}},O_=gM,bM=__(void 0),BG=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},zG=fm,KG=I_,VG=T_,HG=$_,GG=S_,YG=lm,JG=cm,ZG=yM;function XG(e){var t=O_(e);return function(n,r){return r===void 0?t(n):t(n)(r)}}var _M={concat:function(e,t){return e&&t}},SM={concat:function(e,t){return e||t}},QG=s_,$M={concat:function(e,t){return e+t}},TM={concat:function(e,t){return e+t}},IM={concat:function(e,t){return e*t}};const OM=Object.freeze(Object.defineProperty({__proto__:null,concatAll:O_,constant:__,first:I_,fold:XG,getDualSemigroup:GG,getFirstSemigroup:KG,getFunctionSemigroup:QG,getIntercalateSemigroup:ZG,getJoinSemigroup:YG,getLastSemigroup:zG,getMeetSemigroup:JG,getObjectSemigroup:BG,getStructSemigroup:HG,getTupleSemigroup:VG,intercalate:yM,last:fm,max:lm,min:cm,reverse:S_,semigroupAll:_M,semigroupAny:SM,semigroupProduct:IM,semigroupString:$M,semigroupSum:TM,semigroupVoid:bM,struct:$_,tuple:T_},Symbol.toStringTag,{value:"Module"}));var Yf=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Jf=rn,zi=gt,dm=function(e,t){return e<0||e>=t.length},w_=function(e){return function(t){return Yf([e],t,!0)}},Mc=w_,C_=function(e){return function(t){return Yf(Yf([],t,!0),[e],!1)}},pm=C_,hm=function(e,t,n){if(zi(n)){var r=im(n);return r.splice(e,0,t),r}return[t]},E_=function(e,t,n){if(n[e]===t)return n;var r=im(n);return r[e]=t,r},R_=function(e){return function(t){if(t.length===1)return t;for(var n=[An(t)],r=ii(t),i=function(s){n.every(function(c){return!e.equals(c,s)})&&n.push(s)},o=0,a=r;o<a.length;o++){var u=a[o];i(u)}return n}},wM=function(e){if(zi(e)){var t=y_();return k_(e.reduce(t.concat,t.empty))}return D},M_=function(e){var t=R_(e);return function(n){return function(r){return t(y(r,Xf(n)))}}},x_=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(dm(Math.abs(r),t)||r===0)return t;if(r<0){var i=gm(-r)(t),o=i[0],a=i[1];return y(a,Xf(o))}else return x_(r-n)(t)}},Zf=function(e){return zi(e)?pe(e):be},mm=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},e9=function(e){return mm(function(){return e})},CM=function(e,t){return e<=t?mm(function(n){return e+n})(t-e+1):[e]},EM=function(e){return[An(e),ii(e)]},RM=function(e){return[xc(e),ka(e)]},t9=function(e){return Zf(e.slice())};function MM(e){return function(t){return t.concat(e)}}function Xf(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var n9=function(e){return e.length===1?e:Yf([ka(e)],e.slice(0,-1).reverse(),!0)};function xM(e){return function(t){var n=t.length;if(n===0)return Jf;for(var r=[],i=t[0],o=[i],a=1;a<n;a++){var u=t[a];e.equals(u,i)?o.push(u):(r.push(o),i=u,o=[i])}return r.push(o),r}}var r9=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);lt.call(n,a)?n[a].push(o):n[a]=[o]}return n}},k_=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},i9=function(e,t){return kM(e,function(){return t})},kM=function(e,t){return function(n){return dm(e,n)?be:pe(E_(e,t(n[e]),n))}},AM=function(e,t,n){for(var r=[n(e[0],t[0])],i=Math.min(e.length,t.length),o=1;o<i;o++)r[o]=n(e[o],t[o]);return r};function NM(e,t){return t===void 0?function(n){return NM(n,e)}:AM(e,t,function(n,r){return[n,r]})}var o9=function(e){for(var t=[e[0][0]],n=[e[0][1]],r=1;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},vm=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},A_=function(e){return function(t){var n=ii(t);return zi(n)?y(n,vm(e),Mc(An(t))):t}},FM=function(e){return function(t){for(var n=im(e(0,An(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},N_=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;zi(a);){var u=e(a),s=u[0],c=u[1];o.push(s),a=c}return o}},gm=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[t,Jf]:[y(t.slice(1,n),Mc(An(t))),t.slice(n)]}},PM=function(e){return N_(gm(e))},ri=function(e,t){return y(e,U_(t))},F_=function(e,t){return y(e,B_(t))},Qf=function(e,t){return y(e,UM(t))},P_=function(e,t){return y(e,ym(t))},WM=function(e,t){return y(e,q_(t))},ed=function(e,t,n){return y(e,z_(t,n))},td=function(e){var t=K_(e);return function(n,r){return y(n,t(r))}},nd=function(e,t,n){return y(e,V_(t,n))},W_=function(e){var t=BM(e);return function(n,r){return y(n,t(r))}},LM=function(e,t){return y(e,qM(t))},L_=function(e,t,n){return y(e,bm(t,n))},j_=function(e){var t=H_(e);return function(n,r){return y(n,t(r))}},D_=function(e,t,n){return y(e,_m(t,n))},jM=function(e){var t=$m(e);return function(n,r){return y(n,t(r))}},xa=Vf,DM=function(e){return function(t){return y(t,MM(e()))}},qM=DM,UM=function(e){return ym(function(t){return y(e,U_(t))})},ym=function(e){return FM(function(t,n){return e(n)})},q_=function(e){return function(t){for(var n=ii(t),r=[e(t)];zi(n);)r.push(e(n)),n=ii(n);return r}},a9=q_(D),u9=ym(D),U_=function(e){return B_(function(t,n){return e(n)})},B_=function(e){return function(t){for(var n=[e(0,An(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},z_=function(e,t){return bm(e,function(n,r,i){return t(r,i)})},K_=function(e){return function(t){return function(n){return n.slice(1).reduce(function(r,i){return e.concat(r,t(i))},t(n[0]))}}},V_=function(e,t){return _m(e,function(n,r,i){return t(r,i)})},bm=function(e,t){return function(n){return n.reduce(function(r,i,o){return t(o,r,i)},e)}},H_=function(e){return function(t){return function(n){return n.slice(1).reduce(function(r,i,o){return e.concat(r,t(o+1,i))},t(0,n[0]))}}},_m=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},BM=function(e){var t=$m(e);return function(n){return t(function(r,i){return n(i)})}},Sm=function(e){return $m(e)(Jn)},$m=function(e){return function(t){return function(n){for(var r=e.map(t(0,An(n)),xa),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return y(o,pm(a))}}),t(i,n[i]));return r}}},Tm=dr,kn="ReadonlyNonEmptyArray",zM=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},s9=function(){return{concat:Xf}},KM=function(e){return Fr(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},c9=function(e){var t=M_(e);return{concat:function(n,r){return t(r)(n)}}},G_={URI:kn,map:ri},l9=Ke(G_),f9={URI:kn,of:xa},d9={URI:kn,map:ri,mapWithIndex:F_},Im={URI:kn,map:ri,ap:Qf},p9=Ct(Im),h9=Et(Im),m9={URI:kn,map:ri,ap:Qf,of:xa},Y_={URI:kn,map:ri,ap:Qf,chain:P_},v9=ft(Y_),g9={URI:kn,map:ri,ap:Qf,of:xa,chain:P_},y9={URI:kn,reduce:ed,foldMap:td,reduceRight:nd},b9={URI:kn,reduce:ed,foldMap:td,reduceRight:nd,reduceWithIndex:L_,foldMapWithIndex:j_,reduceRightWithIndex:D_},_9={URI:kn,map:ri,reduce:ed,foldMap:td,reduceRight:nd,traverse:W_,sequence:Sm},S9={URI:kn,map:ri,mapWithIndex:F_,reduce:ed,foldMap:td,reduceRight:nd,traverse:W_,sequence:Sm,reduceWithIndex:L_,foldMapWithIndex:j_,reduceRightWithIndex:D_,traverseWithIndex:jM},$9={URI:kn,map:ri,alt:LM},T9={URI:kn,map:ri,extend:WM,extract:Tm},I9=xa(Yt),O9=wt(G_),w9=Mt(Y_),C9=Rt(Im),An=Tm,ii=Rc,ka=function(e){return e[e.length-1]},xc=function(e){return e.slice(0,-1)},VM=function(e){var t=cm(e);return function(n){return n.reduce(t.concat)}},HM=function(e){var t=lm(e);return function(n){return n.reduce(t.concat)}},Om=function(e){return function(t){return t.reduce(e.concat)}},E9=function(e){return function(t){return e(An(t),ii(t))}},R9=function(e){return function(t){return e(xc(t),ka(t))}},GM=function(e){return function(t){return Yf([e(An(t))],ii(t),!0)}},M9=function(e){return GM(function(){return e})},YM=function(e){return function(t){return y(xc(t),pm(e(ka(t))))}},x9=function(e){return YM(function(){return e})},J_=function(e){var t=Om(e);return function(n){return V(A_(n),t)}};function k9(e){var t=k_(e),n=xM(e);return function(r){return zi(r)?n(t(r)):Jf}}function A9(e){return JM(function(t,n){return e(n)})}var JM=function(e){return function(t){return Zf(t.filter(function(n,r){return e(r,n)}))}},N9=EM,F9=RM;function ZM(e,t){return t===void 0?Mc(e):y(t,Mc(e))}var XM=function(e,t){return y(e,Xf([t]))},P9=function(e,t){return function(n){return e<0||e>n.length?be:pe(hm(e,t,n))}},W9=vm,L9=Om,j9={URI:kn,of:xa,map:ri,mapWithIndex:F_,ap:Qf,chain:P_,extend:WM,extract:Tm,reduce:ed,foldMap:td,reduceRight:nd,traverse:W_,sequence:Sm,reduceWithIndex:L_,foldMapWithIndex:j_,reduceRightWithIndex:D_,traverseWithIndex:jM,alt:LM};const D9=Object.freeze(Object.defineProperty({__proto__:null,Alt:$9,Applicative:m9,Apply:Im,Chain:Y_,Comonad:T9,Do:I9,Foldable:y9,FoldableWithIndex:b9,Functor:G_,FunctorWithIndex:d9,Monad:g9,Pointed:f9,Traversable:_9,TraversableWithIndex:S9,URI:kn,alt:qM,altW:DM,ap:UM,apFirst:p9,apS:C9,apSecond:h9,append:pm,appendW:C_,bind:w9,bindTo:O9,chain:ym,chainFirst:v9,chainWithIndex:FM,chop:N_,chunksOf:PM,concat:Xf,concatAll:Om,concatW:MM,cons:ZM,duplicate:a9,empty:Jf,extend:q_,extract:Tm,filter:A9,filterWithIndex:JM,flap:l9,flatten:u9,fold:L9,foldMap:K_,foldMapWithIndex:H_,fromArray:t9,fromReadonlyArray:Zf,getEq:KM,getSemigroup:s9,getShow:zM,getUnionSemigroup:c9,group:xM,groupBy:r9,groupSort:k9,head:An,init:xc,insertAt:P9,intercalate:J_,intersperse:A_,isNonEmpty:zi,isOutOfBound:dm,last:ka,makeBy:mm,map:U_,mapWithIndex:B_,matchLeft:E9,matchRight:R9,max:HM,min:VM,modifyAt:kM,modifyHead:GM,modifyLast:YM,of:xa,prepend:Mc,prependAll:vm,prependToAll:W9,prependW:w_,range:CM,readonlyNonEmptyArray:j9,reduce:z_,reduceRight:V_,reduceRightWithIndex:_m,reduceWithIndex:bm,replicate:e9,reverse:n9,rotate:x_,sequence:Sm,snoc:XM,sort:k_,sortBy:wM,splitAt:gm,tail:ii,traverse:BM,traverseWithIndex:$m,unappend:RM,uncons:N9,union:M_,uniq:R_,unprepend:EM,unsafeInsertAt:hm,unsafeUpdateAt:E_,unsnoc:F9,unzip:o9,updateAt:i9,updateHead:M9,updateLast:x9,zip:NM,zipWith:AM},Symbol.toStringTag,{value:"Module"}));var QM={equals:function(e,t){return e===t}},ex={concat:function(e,t){return e+t}},tx="",q9={concat:ex.concat,empty:tx},K={equals:QM.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},U9={show:function(e){return JSON.stringify(e)}},B9=function(e){return typeof e=="string"},z9=function(e){return e.toUpperCase()},K9=function(e){return e.toLowerCase()},V9=function(e,t){return function(n){return n.replace(e,t)}},H9=function(e){return e.trim()},G9=function(e){return e.trimLeft()},Y9=function(e){return e.trimRight()},J9=function(e,t){return function(n){return n.slice(e,t)}},Z9=function(e){return e.length===0},X9=function(e){return e.length},Q9=function(e){return function(t){var n=t.split(e);return zi(n)?n:[t]}},eY=function(e,t){return function(n){return n.includes(e,t)}},tY=function(e,t){return function(n){return n.startsWith(e,t)}},nY=function(e,t){return function(n){return n.endsWith(e,t)}};const rY=Object.freeze(Object.defineProperty({__proto__:null,Eq:QM,Monoid:q9,Ord:K,Semigroup:ex,Show:U9,empty:tx,endsWith:nY,includes:eY,isEmpty:Z9,isString:B9,replace:V9,size:X9,slice:J9,split:Q9,startsWith:tY,toLowerCase:K9,toUpperCase:z9,trim:H9,trimLeft:G9,trimRight:Y9},Symbol.toStringTag,{value:"Module"}));function oi(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}function ai(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}function Z_(e){return function(t){var n=e.wither(t);return function(r){return function(i){return n(i,function(o){return t.map(r(o),function(a){return a?pe(o):be})})}}}}const iY=Object.freeze(Object.defineProperty({__proto__:null,filterE:Z_,wiltDefault:oi,witherDefault:ai},Symbol.toStringTag,{value:"Module"}));var oY=function(e){return Object.assign({},e)},aY=function(e){return Object.assign({},e)},nx=function(e){return Object.keys(e).length},ui=function(e){for(var t in e)if(lt.call(e,t))return!1;return!0},kc=function(e){return function(t){return Object.keys(t).sort(e.compare)}},uY=kc(K);function wm(e){if(typeof e=="function")return wm(K)(e);var t=kc(e);return function(n){return function(r){for(var i=[],o=0,a=t(r);o<a.length;o++){var u=a[o];i.push(n(u,r[u]))}return i}}}var Cm=wm(K)(function(e,t){return[e,t]});function sY(e){return function(t){var n=Cm(t),r=n.length;return e.unfold(0,function(i){return i<r?pe([n[i],i+1]):be})}}var X_=function(e,t){return function(n){if(lt.call(n,e)&&n[e]===t)return n;var r=Object.assign({},n);return r[e]=t,r}},To=function(e,t){return lt.call(t,e)};function Em(e){return function(t){if(!lt.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var cY=function(e,t){return function(n){if(!To(e,n))return be;if(n[e]===t)return pe(n);var r=Object.assign({},n);return r[e]=t,pe(r)}},lY=function(e,t){return function(n){if(!To(e,n))return be;var r=t(n[e]);if(r===n[e])return pe(n);var i=Object.assign({},n);return i[e]=r,pe(i)}};function fY(e){var t=Em(e);return function(n){var r=Wu(e,n);return Wt(r)?be:pe([r.value,t(n)])}}function Rm(e){return function(t,n){if(n===void 0){var r=Rm(e);return function(o){return r(o,t)}}for(var i in t)if(!lt.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function Wu(e,t){return t===void 0?function(n){return Wu(e,n)}:lt.call(t,e)?pe(t[e]):be}var rd={};function Mm(e){return function(t){var n={};for(var r in t)lt.call(t,r)&&(n[r]=e(r,t[r]));return n}}function Q_(e){return Mm(function(t,n){return e(n)})}function Ac(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return Ac(K).apply(void 0,e);var n=kc(e[0]);return function(r,i){return function(o){for(var a=r,u=n(o),s=u.length,c=0;c<s;c++){var l=u[c];a=i(l,a,o[l])}return a}}}function Nc(e){if("compare"in e){var t=kc(e);return function(n){return function(r){return function(i){for(var o=n.empty,a=t(i),u=a.length,s=0;s<u;s++){var c=a[s];o=n.concat(o,r(c,i[c]))}return o}}}}return Nc(K)(e)}function Fc(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return Fc(K).apply(void 0,e);var n=kc(e[0]);return function(r,i){return function(o){for(var a=r,u=n(o),s=u.length,c=s-1;c>=0;c--){var l=u[c];a=i(l,o[l],a)}return a}}}var rx=function(e,t){var n;return n={},n[e]=t,n};function ix(e){var t=od(K)(e);return function(n){return function(r){return t(r,n)}}}function xm(e){var t=Ki(K)(e);return function(n){return function(r){return t(r,n)}}}function Pc(e){return id(K)(e)}var dY=function(e){var t=xm(e);return function(n){return function(r){return e.map(y(r,t(n)),Io)}}},pY=function(e){var t=xm(e);return function(n){return function(r){return e.map(y(r,t(n)),Oo)}}};function km(e){return function(t){var n={},r={};for(var i in t)if(lt.call(t,i)){var o=e(i,t[i]);switch(o._tag){case"Left":n[i]=o.left;break;case"Right":r[i]=o.right;break}}return Me(n,r)}}function Am(e){return function(t){var n={},r={};for(var i in t)if(lt.call(t,i)){var o=t[i];e(i,o)?r[i]=o:n[i]=o}return Me(n,r)}}function Nm(e){return function(t){var n={};for(var r in t)if(lt.call(t,r)){var i=e(r,t[r]);bt(i)&&(n[r]=i.value)}return n}}function Fm(e){return function(t){var n={},r=!1;for(var i in t)if(lt.call(t,i)){var o=t[i];e(i,o)?n[i]=o:r=!0}return r?n:t}}function ox(e,t){var n=eS(e,t);return function(r){return n(r,D)}}function eS(e,t){return function(n,r){return t.reduce(n,{},function(i,o){var a=r(o),u=a[0],s=a[1];return i[u]=lt.call(i,u)?e.concat(i[u],s):s,i})}}var hY=Cm,mY=function(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];t[i[0]]=i[1]}return t};function ax(e){return function(t){for(var n in t)if(!e(t[n]))return!1;return!0}}function ux(e){return function(t){for(var n in t)if(e(t[n]))return!0;return!1}}function tS(e){return function(t,n){if(n===void 0){var r=tS(e);return function(o){return r(t,o)}}for(var i in n)if(e.equals(n[i],t))return!0;return!1}}var nS=function(e){return function(t){return function(n){if(ui(n))return t;if(ui(t))return n;var r={};for(var i in n)To(i,t)?r[i]=e.concat(n[i],t[i]):r[i]=n[i];for(var i in t)To(i,r)||(r[i]=t[i]);return r}}},rS=function(e){return function(t){return function(n){if(ui(n)||ui(t))return rd;var r={};for(var i in n)To(i,t)&&(r[i]=e.concat(n[i],t[i]));return r}}},iS=function(e){return function(t){if(ui(t))return e;if(ui(e))return t;var n={};for(var r in t)To(r,e)||(n[r]=t[r]);for(var r in e)To(r,t)||(n[r]=e[r]);return n}},pr=function(e,t){return y(e,Q_(t))},Lu=function(e,t){return y(e,Mm(t))},hr=function(e){var t=ad(e);return function(n,r,i){return y(n,t(r,i))}},mr=function(e){return function(t){var n=ud(e)(t);return function(r,i){return y(r,n(i))}}},vr=function(e){var t=sd(e);return function(n,r,i){return y(n,t(r,i))}},ju=function(e,t){return y(e,oS(t))},Du=function(e,t){return y(e,aS(t))},qu=function(e,t){return y(e,Dm(t))},Uu=function(e,t){return y(e,uS(t))},Bu=function(e){var t=Ac(e);return function(n,r,i){return y(n,t(r,i))}},zu=function(e){var t=Nc(e);return function(n){var r=t(n);return function(i,o){return y(i,r(o))}}},Ku=function(e){var t=Fc(e);return function(n,r,i){return y(n,t(r,i))}},Pm=function(e,t){return y(e,km(t))},Wm=function(e,t){return y(e,Am(t))},Lm=function(e,t){return y(e,Nm(t))},jm=function(e,t){return y(e,Fm(t))},Ki=function(e){var t=od(e);return function(n){var r=t(n);return function(i,o){return r(i,V(Jn,o))}}},id=function(e){var t=Ki(e);return function(n){var r=t(n);return function(i){return r(i,D)}}},od=function(e){return function(t){var n=kc(e);return function(r,i){var o=n(r);if(o.length===0)return t.of(rd);for(var a=t.of({}),u=function(f){a=t.ap(t.map(a,function(d){return function(p){var h;return Object.assign({},d,(h={},h[f]=p,h))}}),i(f,r[f]))},s=0,c=o;s<c.length;s++){var l=c[s];u(l)}return a}}},oS=function(e){return Fm(function(t,n){return e(n)})},aS=function(e){return Nm(function(t,n){return e(n)})},Dm=function(e){return Am(function(t,n){return e(n)})},uS=function(e){return km(function(t,n){return e(n)})};function ad(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=Ac(e[0]);return function(r,i){return n(r,function(o,a,u){return i(a,u)})}}return ad(K).apply(void 0,e)}function ud(e){if("compare"in e){var t=Nc(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}}return ud(K)(e)}function sd(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=Fc(e[0]);return function(r,i){return n(r,function(o,a,u){return i(a,u)})}}return sd(K).apply(void 0,e)}var Io=function(e){var t={};for(var n in e)if(lt.call(e,n)){var r=e[n];bt(r)&&(t[n]=r.value)}return t},Oo=function(e){var t={},n={};for(var r in e)if(lt.call(e,r)){var i=e[r];Gt(i)?t[r]=i.left:n[r]=i.right}return Me(t,n)},on="ReadonlyRecord";function qm(e){return"compare"in e?function(t){return{show:function(n){var r=wm(e)(function(i,o){return"".concat(JSON.stringify(i),": ").concat(t.show(o))})(n).join(", ");return r===""?"{}":"{ ".concat(r," }")}}}:qm(K)(e)}function sx(e){var t=Rm(e);return Fr(function(n,r){return t(n)(r)&&t(r)(n)})}function cx(e){return{concat:function(t,n){if(ui(t))return n;if(ui(n))return t;var r=Object.assign({},t);for(var i in n)lt.call(n,i)&&(r[i]=lt.call(t,i)?e.concat(t[i],n[i]):n[i]);return r},empty:rd}}var lx={URI:on,map:pr},vY=Ke(lx),gY={URI:on,map:pr,mapWithIndex:Lu},yY=function(e){return{URI:on,reduce:hr(e),foldMap:mr(e),reduceRight:vr(e)}},bY=function(e){return{URI:on,reduce:hr(e),foldMap:mr(e),reduceRight:vr(e),reduceWithIndex:Bu(e),foldMapWithIndex:zu(e),reduceRightWithIndex:Ku(e)}},cd={URI:on,compact:Io,separate:Oo},_Y={URI:on,map:pr,compact:Io,separate:Oo,filter:ju,filterMap:Du,partition:qu,partitionMap:Uu},SY={URI:on,map:pr,mapWithIndex:Lu,compact:Io,separate:Oo,filter:ju,filterMap:Du,partition:qu,partitionMap:Uu,filterMapWithIndex:Lm,filterWithIndex:jm,partitionMapWithIndex:Pm,partitionWithIndex:Wm},fx=function(e){return{URI:on,map:pr,reduce:hr(e),foldMap:mr(e),reduceRight:vr(e),traverse:Ki(e),sequence:id(e)}},$Y=function(e){return{URI:on,map:pr,mapWithIndex:Lu,reduce:hr(e),foldMap:mr(e),reduceRight:vr(e),reduceWithIndex:Bu(e),foldMapWithIndex:zu(e),reduceRightWithIndex:Ku(e),traverse:Ki(e),sequence:id(e),traverseWithIndex:od(e)}},TY=function(e){var t=fx(e);return{URI:on,map:pr,reduce:hr(e),foldMap:mr(e),reduceRight:vr(e),traverse:t.traverse,sequence:t.sequence,compact:Io,separate:Oo,filter:ju,filterMap:Du,partition:qu,partitionMap:Uu,wither:ai(t,cd),wilt:oi(t,cd)}},dx=function(e){var t=nS(e);return{concat:function(n,r){return t(r)(n)}}},IY=function(e){return{concat:dx(e).concat,empty:rd}},OY=function(e){var t=rS(e);return{concat:function(n,r){return t(r)(n)}}},wY=function(){return{concat:function(e,t){return iS(t)(e)}}},CY={URI:on,reduce:hr(K),foldMap:mr(K),reduceRight:vr(K)},EY={URI:on,reduce:hr(K),foldMap:mr(K),reduceRight:vr(K),reduceWithIndex:Bu(K),foldMapWithIndex:zu(K),reduceRightWithIndex:Ku(K)},sS={URI:on,map:pr,reduce:hr(K),foldMap:mr(K),reduceRight:vr(K),traverse:Ki(K),sequence:Pc},RY={URI:on,map:pr,mapWithIndex:Lu,reduce:hr(K),foldMap:mr(K),reduceRight:vr(K),reduceWithIndex:Bu(K),foldMapWithIndex:zu(K),reduceRightWithIndex:Ku(K),traverse:Ki(K),sequence:Pc,traverseWithIndex:od(K)},px=ai(sS,cd),hx=oi(sS,cd),MY={URI:on,map:pr,reduce:hr(K),foldMap:mr(K),reduceRight:vr(K),traverse:Ki(K),sequence:Pc,compact:Io,separate:Oo,filter:ju,filterMap:Du,partition:qu,partitionMap:Uu,wither:px,wilt:hx},cS=X_;function mx(e,t){return lt.call(t===void 0?this:t,e)}var xY={URI:on,map:pr,reduce:hr(K),foldMap:mr(K),reduceRight:vr(K),traverse:Ki(K),sequence:Pc,compact:Io,separate:Oo,filter:ju,filterMap:Du,partition:qu,partitionMap:Uu,mapWithIndex:Lu,reduceWithIndex:Bu(K),foldMapWithIndex:zu(K),reduceRightWithIndex:Ku(K),filterMapWithIndex:Lm,filterWithIndex:jm,partitionMapWithIndex:Pm,partitionWithIndex:Wm,traverseWithIndex:od(K),wither:px,wilt:hx};const kY=Object.freeze(Object.defineProperty({__proto__:null,Compactable:cd,Filterable:_Y,FilterableWithIndex:SY,Foldable:CY,FoldableWithIndex:EY,Functor:lx,FunctorWithIndex:gY,Traversable:sS,TraversableWithIndex:RY,URI:on,Witherable:MY,_filter:ju,_filterMap:Du,_filterMapWithIndex:Lm,_filterWithIndex:jm,_foldMap:mr,_foldMapWithIndex:zu,_map:pr,_mapWithIndex:Lu,_partition:qu,_partitionMap:Uu,_partitionMapWithIndex:Pm,_partitionWithIndex:Wm,_reduce:hr,_reduceRight:vr,_reduceRightWithIndex:Ku,_reduceWithIndex:Bu,_sequence:id,_traverse:Ki,collect:wm,compact:Io,deleteAt:Em,difference:iS,elem:tS,empty:rd,every:ax,filter:oS,filterMap:aS,filterMapWithIndex:Nm,filterWithIndex:Fm,flap:vY,foldMap:ud,foldMapWithIndex:Nc,fromEntries:mY,fromFoldable:ox,fromFoldableMap:eS,fromRecord:oY,getDifferenceMagma:wY,getEq:sx,getFoldable:yY,getFoldableWithIndex:bY,getIntersectionSemigroup:OY,getMonoid:cx,getShow:qm,getTraversable:fx,getTraversableWithIndex:$Y,getUnionMonoid:IY,getUnionSemigroup:dx,getWitherable:TY,has:To,hasOwnProperty:mx,insertAt:cS,intersection:rS,isEmpty:ui,isSubrecord:Rm,keys:uY,lookup:Wu,map:Q_,mapWithIndex:Mm,modifyAt:lY,partition:Dm,partitionMap:uS,partitionMapWithIndex:km,partitionWithIndex:Am,pop:fY,readonlyRecord:xY,reduce:ad,reduceRight:sd,reduceRightWithIndex:Fc,reduceWithIndex:Ac,separate:Oo,sequence:Pc,singleton:rx,size:nx,some:ux,toEntries:hY,toReadonlyArray:Cm,toRecord:aY,toUnfoldable:sY,traverse:xm,traverseWithIndex:ix,union:nS,updateAt:cY,upsertAt:X_,wilt:pY,wither:dY},Symbol.toStringTag,{value:"Module"})),lS=U.createContext(void 0);function fS(){const e=U.useContext(lS);if(!e)throw new Error("Missing EditorConfigContext.Provider");return e}var ut={},H={},AY={get exports(){return H},set exports(e){H=e}};(function(e){var t,n,r,i,o,a,u,s,c,l,f,d,p,h,v,m,_,g,S,b,$,T,R,E,q,Y,N,Z,ie;(function(J){var ye=typeof he=="object"?he:typeof self=="object"?self:typeof this=="object"?this:{};J(we(ye,we(e.exports)));function we(x,k){return x!==ye&&(typeof Object.create=="function"?Object.defineProperty(x,"__esModule",{value:!0}):x.__esModule=!0),function(C,O){return x[C]=k?k(C,O):O}}})(function(J){var ye=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,k){x.__proto__=k}||function(x,k){for(var C in k)Object.prototype.hasOwnProperty.call(k,C)&&(x[C]=k[C])};t=function(x,k){if(typeof k!="function"&&k!==null)throw new TypeError("Class extends value "+String(k)+" is not a constructor or null");ye(x,k);function C(){this.constructor=x}x.prototype=k===null?Object.create(k):(C.prototype=k.prototype,new C)},n=Object.assign||function(x){for(var k,C=1,O=arguments.length;C<O;C++){k=arguments[C];for(var F in k)Object.prototype.hasOwnProperty.call(k,F)&&(x[F]=k[F])}return x},r=function(x,k){var C={};for(var O in x)Object.prototype.hasOwnProperty.call(x,O)&&k.indexOf(O)<0&&(C[O]=x[O]);if(x!=null&&typeof Object.getOwnPropertySymbols=="function")for(var F=0,O=Object.getOwnPropertySymbols(x);F<O.length;F++)k.indexOf(O[F])<0&&Object.prototype.propertyIsEnumerable.call(x,O[F])&&(C[O[F]]=x[O[F]]);return C},i=function(x,k,C,O){var F=arguments.length,L=F<3?k:O===null?O=Object.getOwnPropertyDescriptor(k,C):O,X;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(x,k,C,O);else for(var te=x.length-1;te>=0;te--)(X=x[te])&&(L=(F<3?X(L):F>3?X(k,C,L):X(k,C))||L);return F>3&&L&&Object.defineProperty(k,C,L),L},o=function(x,k){return function(C,O){k(C,O,x)}},a=function(x,k,C,O,F,L){function X(xn){if(xn!==void 0&&typeof xn!="function")throw new TypeError("Function expected");return xn}for(var te=O.kind,xe=te==="getter"?"get":te==="setter"?"set":"value",ce=!k&&x?O.static?x:x.prototype:null,Ne=k||(ce?Object.getOwnPropertyDescriptor(ce,O.name):{}),ze,He=!1,it=C.length-1;it>=0;it--){var Ft={};for(var qt in O)Ft[qt]=qt==="access"?{}:O[qt];for(var qt in O.access)Ft.access[qt]=O.access[qt];Ft.addInitializer=function(xn){if(He)throw new TypeError("Cannot add initializers after decoration has completed");L.push(X(xn||null))};var Ht=(0,C[it])(te==="accessor"?{get:Ne.get,set:Ne.set}:Ne[xe],Ft);if(te==="accessor"){if(Ht===void 0)continue;if(Ht===null||typeof Ht!="object")throw new TypeError("Object expected");(ze=X(Ht.get))&&(Ne.get=ze),(ze=X(Ht.set))&&(Ne.set=ze),(ze=X(Ht.init))&&F.push(ze)}else(ze=X(Ht))&&(te==="field"?F.push(ze):Ne[xe]=ze)}ce&&Object.defineProperty(ce,O.name,Ne),He=!0},u=function(x,k,C){for(var O=arguments.length>2,F=0;F<k.length;F++)C=O?k[F].call(x,C):k[F].call(x);return O?C:void 0},s=function(x){return typeof x=="symbol"?x:"".concat(x)},c=function(x,k,C){return typeof k=="symbol"&&(k=k.description?"[".concat(k.description,"]"):""),Object.defineProperty(x,"name",{configurable:!0,value:C?"".concat(C," ",k):k})},l=function(x,k){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(x,k)},f=function(x,k,C,O){function F(L){return L instanceof C?L:new C(function(X){X(L)})}return new(C||(C=Promise))(function(L,X){function te(Ne){try{ce(O.next(Ne))}catch(ze){X(ze)}}function xe(Ne){try{ce(O.throw(Ne))}catch(ze){X(ze)}}function ce(Ne){Ne.done?L(Ne.value):F(Ne.value).then(te,xe)}ce((O=O.apply(x,k||[])).next())})},d=function(x,k){var C={label:0,sent:function(){if(L[0]&1)throw L[1];return L[1]},trys:[],ops:[]},O,F,L,X;return X={next:te(0),throw:te(1),return:te(2)},typeof Symbol=="function"&&(X[Symbol.iterator]=function(){return this}),X;function te(ce){return function(Ne){return xe([ce,Ne])}}function xe(ce){if(O)throw new TypeError("Generator is already executing.");for(;X&&(X=0,ce[0]&&(C=0)),C;)try{if(O=1,F&&(L=ce[0]&2?F.return:ce[0]?F.throw||((L=F.return)&&L.call(F),0):F.next)&&!(L=L.call(F,ce[1])).done)return L;switch(F=0,L&&(ce=[ce[0]&2,L.value]),ce[0]){case 0:case 1:L=ce;break;case 4:return C.label++,{value:ce[1],done:!1};case 5:C.label++,F=ce[1],ce=[0];continue;case 7:ce=C.ops.pop(),C.trys.pop();continue;default:if(L=C.trys,!(L=L.length>0&&L[L.length-1])&&(ce[0]===6||ce[0]===2)){C=0;continue}if(ce[0]===3&&(!L||ce[1]>L[0]&&ce[1]<L[3])){C.label=ce[1];break}if(ce[0]===6&&C.label<L[1]){C.label=L[1],L=ce;break}if(L&&C.label<L[2]){C.label=L[2],C.ops.push(ce);break}L[2]&&C.ops.pop(),C.trys.pop();continue}ce=k.call(x,C)}catch(Ne){ce=[6,Ne],F=0}finally{O=L=0}if(ce[0]&5)throw ce[1];return{value:ce[0]?ce[1]:void 0,done:!0}}},p=function(x,k){for(var C in x)C!=="default"&&!Object.prototype.hasOwnProperty.call(k,C)&&ie(k,x,C)},ie=Object.create?function(x,k,C,O){O===void 0&&(O=C);var F=Object.getOwnPropertyDescriptor(k,C);(!F||("get"in F?!k.__esModule:F.writable||F.configurable))&&(F={enumerable:!0,get:function(){return k[C]}}),Object.defineProperty(x,O,F)}:function(x,k,C,O){O===void 0&&(O=C),x[O]=k[C]},h=function(x){var k=typeof Symbol=="function"&&Symbol.iterator,C=k&&x[k],O=0;if(C)return C.call(x);if(x&&typeof x.length=="number")return{next:function(){return x&&O>=x.length&&(x=void 0),{value:x&&x[O++],done:!x}}};throw new TypeError(k?"Object is not iterable.":"Symbol.iterator is not defined.")},v=function(x,k){var C=typeof Symbol=="function"&&x[Symbol.iterator];if(!C)return x;var O=C.call(x),F,L=[],X;try{for(;(k===void 0||k-- >0)&&!(F=O.next()).done;)L.push(F.value)}catch(te){X={error:te}}finally{try{F&&!F.done&&(C=O.return)&&C.call(O)}finally{if(X)throw X.error}}return L},m=function(){for(var x=[],k=0;k<arguments.length;k++)x=x.concat(v(arguments[k]));return x},_=function(){for(var x=0,k=0,C=arguments.length;k<C;k++)x+=arguments[k].length;for(var O=Array(x),F=0,k=0;k<C;k++)for(var L=arguments[k],X=0,te=L.length;X<te;X++,F++)O[F]=L[X];return O},g=function(x,k,C){if(C||arguments.length===2)for(var O=0,F=k.length,L;O<F;O++)(L||!(O in k))&&(L||(L=Array.prototype.slice.call(k,0,O)),L[O]=k[O]);return x.concat(L||Array.prototype.slice.call(k))},S=function(x){return this instanceof S?(this.v=x,this):new S(x)},b=function(x,k,C){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var O=C.apply(x,k||[]),F,L=[];return F={},X("next"),X("throw"),X("return"),F[Symbol.asyncIterator]=function(){return this},F;function X(He){O[He]&&(F[He]=function(it){return new Promise(function(Ft,qt){L.push([He,it,Ft,qt])>1||te(He,it)})})}function te(He,it){try{xe(O[He](it))}catch(Ft){ze(L[0][3],Ft)}}function xe(He){He.value instanceof S?Promise.resolve(He.value.v).then(ce,Ne):ze(L[0][2],He)}function ce(He){te("next",He)}function Ne(He){te("throw",He)}function ze(He,it){He(it),L.shift(),L.length&&te(L[0][0],L[0][1])}},$=function(x){var k,C;return k={},O("next"),O("throw",function(F){throw F}),O("return"),k[Symbol.iterator]=function(){return this},k;function O(F,L){k[F]=x[F]?function(X){return(C=!C)?{value:S(x[F](X)),done:!1}:L?L(X):X}:L}},T=function(x){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var k=x[Symbol.asyncIterator],C;return k?k.call(x):(x=typeof h=="function"?h(x):x[Symbol.iterator](),C={},O("next"),O("throw"),O("return"),C[Symbol.asyncIterator]=function(){return this},C);function O(L){C[L]=x[L]&&function(X){return new Promise(function(te,xe){X=x[L](X),F(te,xe,X.done,X.value)})}}function F(L,X,te,xe){Promise.resolve(xe).then(function(ce){L({value:ce,done:te})},X)}},R=function(x,k){return Object.defineProperty?Object.defineProperty(x,"raw",{value:k}):x.raw=k,x};var we=Object.create?function(x,k){Object.defineProperty(x,"default",{enumerable:!0,value:k})}:function(x,k){x.default=k};E=function(x){if(x&&x.__esModule)return x;var k={};if(x!=null)for(var C in x)C!=="default"&&Object.prototype.hasOwnProperty.call(x,C)&&ie(k,x,C);return we(k,x),k},q=function(x){return x&&x.__esModule?x:{default:x}},Y=function(x,k,C,O){if(C==="a"&&!O)throw new TypeError("Private accessor was defined without a getter");if(typeof k=="function"?x!==k||!O:!k.has(x))throw new TypeError("Cannot read private member from an object whose class did not declare it");return C==="m"?O:C==="a"?O.call(x):O?O.value:k.get(x)},N=function(x,k,C,O,F){if(O==="m")throw new TypeError("Private method is not writable");if(O==="a"&&!F)throw new TypeError("Private accessor was defined without a setter");if(typeof k=="function"?x!==k||!F:!k.has(x))throw new TypeError("Cannot write private member to an object whose class did not declare it");return O==="a"?F.call(x,C):F?F.value=C:k.set(x,C),C},Z=function(x,k){if(k===null||typeof k!="object"&&typeof k!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof x=="function"?k===x:x.has(k)},J("__extends",t),J("__assign",n),J("__rest",r),J("__decorate",i),J("__param",o),J("__esDecorate",a),J("__runInitializers",u),J("__propKey",s),J("__setFunctionName",c),J("__metadata",l),J("__awaiter",f),J("__generator",d),J("__exportStar",p),J("__createBinding",ie),J("__values",h),J("__read",v),J("__spread",m),J("__spreadArrays",_),J("__spreadArray",g),J("__await",S),J("__asyncGenerator",b),J("__asyncDelegator",$),J("__asyncValues",T),J("__makeTemplateObject",R),J("__importStar",E),J("__importDefault",q),J("__classPrivateFieldGet",Y),J("__classPrivateFieldSet",N),J("__classPrivateFieldIn",Z)})})(AY);var Vu={};function vx(e){return function(t){return function(n){return n.reduce(function(r,i){return e.alt(r,function(){return i})},t)}}}const NY=Object.freeze(Object.defineProperty({__proto__:null,altAll:vx},Symbol.toStringTag,{value:"Module"}));function FY(e){return vx(e)(e.zero())}const PY=Object.freeze(Object.defineProperty({__proto__:null,altAll:FY},Symbol.toStringTag,{value:"Module"}));function Pr(e){var t=Jt(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function gx(e,t){var n=Ec(e,t).map,r=$o(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return y(i,r(o))}}}const WY=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeComposition:gx,getApplicativeMonoid:Pr},Symbol.toStringTag,{value:"Module"}));function Vi(e){return function(t){return function(n){return e.fromEither(Wt(n)?So(t()):Ma(n.value))}}}function Aa(e){return function(t,n){return function(r){return e.fromEither(t(r)?Ma(r):So(n(r)))}}}function Hi(e){var t=Vi(e);return function(n){var r=t(n);return function(i){return V(i,r)}}}function Hu(e,t){var n=Hi(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}function gr(e){return function(t){return V(t,e.fromEither)}}function wo(e,t){var n=gr(e);return function(r){return function(i){return t.chain(i,n(r))}}}function Co(e,t){return V(gr(e),ft(t))}function Gu(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Ma(o):So(r(o)))})}}}const LY=Object.freeze(Object.defineProperty({__proto__:null,chainEitherK:wo,chainFirstEitherK:Co,chainOptionK:Hu,filterOrElse:Gu,fromEitherK:gr,fromOption:Vi,fromOptionK:Hi,fromPredicate:Aa},Symbol.toStringTag,{value:"Module"}));var ld=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Eo=function(e){return e.length>0},Um=function(e,t){return e<0||e>=t.length},dS=function(e){return function(t){return ld([e],t,!0)}},Wc=dS,pS=function(e){return function(t){return ld(ld([],t,!0),[e],!1)}},fd=pS,hS=function(e,t,n){if(Eo(n)){var r=dd(n);return r.splice(e,0,t),r}return[t]},mS=function(e,t,n){var r=dd(n);return r[e]=t,r},vS=function(e){return function(t){if(t.length===1)return Lc(t);for(var n=[Wr(t)],r=ci(t),i=function(s){n.every(function(c){return!e.equals(c,s)})&&n.push(s)},o=0,a=r;o<a.length;o++){var u=a[o];i(u)}return n}},yx=function(e){if(Eo(e)){var t=y_();return _S(e.reduce(t.concat,t.empty))}return Lc},gS=function(e){var t=vS(e);return function(n){return function(r){return t(y(r,zm(n)))}}},yS=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(Um(Math.abs(r),t)||r===0)return Lc(t);if(r<0){var i=Vm(-r)(t),o=i[0],a=i[1];return y(a,zm(o))}else return yS(r-n)(t)}},dd=im,bS=function(e){return Eo(e)?pe(e):be},Bm=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},jY=function(e){return Bm(function(){return e})},bx=function(e,t){return e<=t?Bm(function(n){return e+n})(t-e+1):[e]},_x=function(e){return[Wr(e),ci(e)]},Sx=function(e){return[Dc(e),jc(e)]};function $x(e){return function(t){return t.concat(e)}}function zm(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var DY=function(e){return ld([jc(e)],e.slice(0,-1).reverse(),!0)};function Tx(e){return function(t){var n=t.length;if(n===0)return[];for(var r=[],i=t[0],o=[i],a=1;a<n;a++){var u=t[a];e.equals(u,i)?o.push(u):(r.push(o),i=u,o=[i])}return r.push(o),r}}var qY=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);lt.call(n,a)?n[a].push(o):n[a]=[o]}return n}},_S=function(e){return function(t){return t.slice().sort(e.compare)}},UY=function(e,t){return function(n){return e<0||e>n.length?be:pe(hS(e,t,n))}},BY=function(e,t){return Ix(e,function(){return t})},Ix=function(e,t){return function(n){return Um(e,n)?be:pe(mS(e,t(n[e]),n))}},Lc=dd,Na=function(e){return[e]},Ox=function(e,t,n){for(var r=[n(e[0],t[0])],i=Math.min(e.length,t.length),o=1;o<i;o++)r[o]=n(e[o],t[o]);return r};function wx(e,t){return t===void 0?function(n){return wx(n,e)}:Ox(e,t,function(n,r){return[n,r]})}var zY=function(e){for(var t=[e[0][0]],n=[e[0][1]],r=1;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},Km=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},Cx=function(e){return function(t){var n=ci(t);return Eo(n)?y(n,Km(e),Wc(Wr(t))):Lc(t)}},Ex=H_,Rx=K_,Mx=function(e){return function(t){for(var n=dd(e(0,Wr(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},SS=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;Eo(a);){var u=e(a),s=u[0],c=u[1];o.push(s),a=c}return o}},Vm=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[Lc(t),[]]:[y(t.slice(1,n),Wc(Wr(t))),t.slice(n)]}},xx=function(e){return SS(Vm(e))},si=function(e,t){return y(e,RS(t))},$S=function(e,t){return y(e,MS(t))},pd=function(e,t){return y(e,Wx(t))},TS=function(e,t){return y(e,Hm(t))},kx=function(e,t){return y(e,ES(t))},hd=function(e,t,n){return y(e,Lx(t,n))},md=function(e){var t=Rx(e);return function(n,r){return y(n,t(r))}},vd=function(e,t,n){return y(e,Dx(t,n))},IS=function(e){var t=Ux(e);return function(n,r){return y(n,t(r))}},Ax=function(e,t){return y(e,Px(t))},OS=function(e,t,n){return y(e,jx(t,n))},wS=function(e){var t=Ex(e);return function(n,r){return y(n,t(r))}},CS=function(e,t,n){return y(e,qx(t,n))},Nx=function(e){var t=Ym(e);return function(n,r){return y(n,t(r))}},Fx=function(e){return function(t){return y(t,$x(e()))}},Px=Fx,Wx=function(e){return Hm(function(t){return y(e,RS(t))})},Hm=function(e){return Mx(function(t,n){return e(n)})},ES=function(e){return function(t){for(var n=ci(t),r=[e(t)];Eo(n);)r.push(e(n)),n=ci(n);return r}},KY=ES(D),VY=Hm(D),RS=function(e){return MS(function(t,n){return e(n)})},MS=function(e){return function(t){for(var n=[e(0,Wr(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},Lx=z_,jx=bm,Dx=V_,qx=_m,Ux=function(e){var t=Ym(e);return function(n){return t(function(r,i){return n(i)})}},Gm=function(e){return Ym(e)(function(t,n){return n})},Ym=function(e){return function(t){return function(n){for(var r=e.map(t(0,Wr(n)),Na),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return y(o,fd(a))}}),t(i,n[i]));return r}}},xS=An,Nn="NonEmptyArray",HY=zM,GY=function(){return{concat:zm}},YY=KM,JY=function(e){var t=gS(e);return{concat:function(n,r){return t(r)(n)}}},kS={URI:Nn,map:si},ZY=Ke(kS),XY={URI:Nn,of:Na},QY={URI:Nn,map:si,mapWithIndex:$S},Jm={URI:Nn,map:si,ap:pd},eJ=Ct(Jm),tJ=Et(Jm),nJ={URI:Nn,map:si,ap:pd,of:Na},AS={URI:Nn,map:si,ap:pd,chain:TS},rJ=ft(AS),iJ={URI:Nn,map:si,ap:pd,of:Na,chain:TS},oJ={URI:Nn,reduce:hd,foldMap:md,reduceRight:vd},aJ={URI:Nn,reduce:hd,foldMap:md,reduceRight:vd,reduceWithIndex:OS,foldMapWithIndex:wS,reduceRightWithIndex:CS},uJ={URI:Nn,map:si,reduce:hd,foldMap:md,reduceRight:vd,traverse:IS,sequence:Gm},sJ={URI:Nn,map:si,mapWithIndex:$S,reduce:hd,foldMap:md,reduceRight:vd,traverse:IS,sequence:Gm,reduceWithIndex:OS,foldMapWithIndex:wS,reduceRightWithIndex:CS,traverseWithIndex:Nx},cJ={URI:Nn,map:si,alt:Ax},lJ={URI:Nn,map:si,extend:kx,extract:xS},fJ=Na(Yt),dJ=wt(kS),pJ=Mt(AS),hJ=Rt(Jm),Wr=An,ci=function(e){return e.slice(1)},jc=ka,Dc=function(e){return e.slice(0,-1)},mJ=VM,vJ=HM,gJ=function(e){return function(t){return t.reduce(e.concat)}},yJ=function(e){return function(t){return e(Wr(t),ci(t))}},bJ=function(e){return function(t){return e(Dc(t),jc(t))}},Bx=function(e){return function(t){return ld([e(Wr(t))],ci(t),!0)}},_J=function(e){return Bx(function(){return e})},zx=function(e){return function(t){return y(Dc(t),fd(e(jc(t))))}},SJ=function(e){return zx(function(){return e})},$J=J_;function TJ(e){var t=_S(e),n=Tx(e);return function(r){return Eo(r)?n(t(r)):[]}}function IJ(e){return Kx(function(t,n){return e(n)})}var Kx=function(e){return function(t){return bS(t.filter(function(n,r){return e(r,n)}))}},OJ=_x,wJ=Sx;function Vx(e,t){return t===void 0?Wc(e):y(t,Wc(e))}var Hx=function(e,t){return y(e,fd(t))},CJ=Km,EJ=Om,RJ={URI:Nn,of:Na,map:si,mapWithIndex:$S,ap:pd,chain:TS,extend:kx,extract:xS,reduce:hd,foldMap:md,reduceRight:vd,traverse:IS,sequence:Gm,reduceWithIndex:OS,foldMapWithIndex:wS,reduceRightWithIndex:CS,traverseWithIndex:Nx,alt:Ax};const MJ=Object.freeze(Object.defineProperty({__proto__:null,Alt:cJ,Applicative:nJ,Apply:Jm,Chain:AS,Comonad:lJ,Do:fJ,Foldable:oJ,FoldableWithIndex:aJ,Functor:kS,FunctorWithIndex:QY,Monad:iJ,Pointed:XY,Traversable:uJ,TraversableWithIndex:sJ,URI:Nn,alt:Px,altW:Fx,ap:Wx,apFirst:eJ,apS:hJ,apSecond:tJ,append:fd,appendW:pS,bind:pJ,bindTo:dJ,chain:Hm,chainFirst:rJ,chainWithIndex:Mx,chop:SS,chunksOf:xx,concat:zm,concatAll:gJ,concatW:$x,cons:Vx,copy:Lc,duplicate:KY,extend:ES,extract:xS,filter:IJ,filterWithIndex:Kx,flap:ZY,flatten:VY,fold:EJ,foldMap:Rx,foldMapWithIndex:Ex,fromArray:bS,fromReadonlyNonEmptyArray:dd,getEq:YY,getSemigroup:GY,getShow:HY,getUnionSemigroup:JY,group:Tx,groupBy:qY,groupSort:TJ,head:Wr,init:Dc,insertAt:UY,intercalate:$J,intersperse:Cx,isNonEmpty:Eo,isOutOfBound:Um,last:jc,makeBy:Bm,map:RS,mapWithIndex:MS,matchLeft:yJ,matchRight:bJ,max:vJ,min:mJ,modifyAt:Ix,modifyHead:Bx,modifyLast:zx,nonEmptyArray:RJ,of:Na,prepend:Wc,prependAll:Km,prependToAll:CJ,prependW:dS,range:bx,reduce:Lx,reduceRight:Dx,reduceRightWithIndex:qx,reduceWithIndex:jx,replicate:jY,reverse:DY,rotate:yS,sequence:Gm,snoc:Hx,sort:_S,sortBy:yx,splitAt:Vm,tail:ci,traverse:Ux,traverseWithIndex:Ym,unappend:Sx,uncons:OJ,union:gS,uniq:vS,unprepend:_x,unsafeInsertAt:hS,unsafeUpdateAt:mS,unsnoc:wJ,unzip:zY,updateAt:BY,updateHead:_J,updateLast:SJ,zip:wx,zipWith:Ox},Symbol.toStringTag,{value:"Module"}));var xJ=function(e){return typeof e=="number"},NS={equals:function(e,t){return e===t}},Zm={equals:NS.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},kJ={equals:NS.equals,compare:Zm.compare,top:1/0,bottom:-1/0},AJ={show:function(e){return JSON.stringify(e)}},Gx={concat:function(e,t){return e-t}},FS={concat:function(e,t){return e+t}},PS={concat:function(e,t){return e*t}},NJ={concat:FS.concat,empty:0},FJ={concat:PS.concat,empty:1},PJ={add:FS.concat,zero:0,mul:PS.concat,one:1,sub:Gx.concat,degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const WJ=Object.freeze(Object.defineProperty({__proto__:null,Bounded:kJ,Eq:NS,Field:PJ,MagmaSub:Gx,MonoidProduct:FJ,MonoidSum:NJ,Ord:Zm,SemigroupProduct:PS,SemigroupSum:FS,Show:AJ,isNumber:xJ},Symbol.toStringTag,{value:"Module"}));function qc(e,t){return function(n){return n?t.of(void 0):e.zero()}}const LJ=Object.freeze(Object.defineProperty({__proto__:null,guard:qc},Symbol.toStringTag,{value:"Module"}));var jJ=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Gi=function(e){return e.length===0},xt=zi,DJ=Mc,qJ=w_,Xm=pm,UJ=C_,Yx=function(e,t){return e<=0?$t:mm(t)(e)},BJ=function(e,t){return Yx(e,function(){return t})};function zJ(e){return function(t){return e(t)?[t]:$t}}var Jx=function(e){return Wt(e)?$t:[e.value]},Zx=function(e){return Gt(e)?$t:[e.right]},Xx=function(e,t){return function(n){return xt(n)?t(n):e()}},Qx=Xx,ek=function(e,t){return function(n){return xt(n)?t(An(n),ii(n)):e()}},tk=ek,KJ=tk,nk=function(e,t){return function(n){return xt(n)?t(xc(n),ka(n)):e()}},rk=nk,VJ=rk,ik=function(e){return function(t){if(Gi(t))return $t;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},HJ=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[0]=e;for(var o=0;o<r;o++)i[o+1]=t(i[o],n[o]);return i}},GJ=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[r]=e;for(var o=r-1;o>=0;o--)i[o]=t(n[o],i[o+1]);return i}},YJ=function(e){return e.length},Uc=dm;function Yu(e,t){return t===void 0?function(n){return Yu(e,n)}:Uc(e,t)?be:pe(t[e])}var ok=function(e){return xt(e)?pe(An(e)):be},WS=function(e){return xt(e)?pe(ka(e)):be},JJ=function(e){return xt(e)?pe(ii(e)):be},ZJ=function(e){return xt(e)?pe(xc(e)):be},XJ=function(e){return function(t){return Uc(e,t)?t:e===0?$t:t.slice(0,e)}},QJ=function(e){return function(t){return Uc(e,t)?t:e===0?$t:t.slice(-e)}};function e7(e){return function(t){for(var n=[],r=0,i=t;r<i.length;r++){var o=i[r];if(!e(o))break;n.push(o)}var a=n.length;return a===t.length?t:a===0?$t:n}}var ak=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function t7(e){return function(t){var n=LS(ak(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var n7=function(e){return function(t){return e<=0||Gi(t)?t:e>=t.length?$t:t.slice(e,t.length)}},r7=function(e){return function(t){return e<=0||Gi(t)?t:e>=t.length?$t:t.slice(0,t.length-e)}};function i7(e){return function(t){var n=ak(t,e);return n===0?t:n===t.length?$t:t.slice(n)}}var Qm=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return pe(n);return be}};function ev(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return pe(t[n]);return be}}var uk=function(e){return function(t){for(var n=0;n<t.length;n++){var r=e(t[n]);if(bt(r))return r}return be}};function sk(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return pe(t[n]);return be}}var ck=function(e){return function(t){for(var n=t.length-1;n>=0;n--){var r=e(t[n]);if(bt(r))return r}return be}},lk=function(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return pe(n);return be}},o7=function(e,t){return function(n){return e<0||e>n.length?be:pe(hm(e,t,n))}},a7=function(e,t){return fk(e,function(){return t})},u7=function(e){return function(t){return Uc(e,t)?be:pe(jk(e,t))}},fk=function(e,t){return function(n){return Uc(e,n)?be:pe(dv(e,t(n[e]),n))}},s7=function(e){return e.length<=1?e:e.slice().reverse()},c7=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},l7=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},f7=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}},dk=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r};function pk(e,t){return t===void 0?function(n){return pk(n,e)}:dk(e,t,function(n,r){return[n,r]})}var d7=function(e){for(var t=[],n=[],r=0;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},hk=function(e){var t=vm(e);return function(n){return xt(n)?t(n):n}},p7=function(e){var t=A_(e);return function(n){return xt(n)?t(n):n}},h7=function(e){var t=x_(e);return function(n){return xt(n)?t(n):n}};function gd(e){return function(t,n){if(n===void 0){var r=gd(e);return function(a){return r(t,a)}}for(var i=function(a){return e.equals(a,t)},o=0;o<n.length;o++)if(i(n[o]))return!0;return!1}}var m7=function(e){var t=R_(e);return function(n){return xt(n)?t(n):n}},v7=function(e){var t=wM(e);return function(n){return xt(n)?t(n):n}},g7=function(e){var t=N_(e);return function(n){return xt(n)?t(n):$t}},LS=function(e){return function(t){return e>=1&&xt(t)?gm(e)(t):Gi(t)?[t,$t]:[$t,t]}},y7=function(e){var t=PM(e);return function(n){return xt(n)?t(n):$t}},b7=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Jx(e.apply(void 0,t))}};function _7(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return xt(o)?y(An(o),bd(function(a){return r(y(i,Xm(a)),ii(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:$t};return r($t,e)}var mk=function(e){return function(t){return Gi(t)?e:Gi(e)?t:t.concat(e)}},S7=mk;function jS(e){var t=M_(e);return function(n,r){if(r===void 0){var i=jS(e);return function(o){return i(o,n)}}return xt(n)&&xt(r)?t(r)(n):xt(n)?n:r}}function DS(e){var t=gd(e);return function(n,r){if(r===void 0){var i=DS(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function qS(e){var t=gd(e);return function(n,r){if(r===void 0){var i=qS(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var an=function(e,t){return y(e,uv(t))},tv=function(e,t){return y(e,Ok(t))},Fa=function(e,t){return y(e,Ik(t))},yd=function(e,t){return y(e,bd(t))},nv=function(e,t){return y(e,li(t))},rv=function(e,t){return y(e,JS(t))},iv=function(e,t){return y(e,wk(t))},ov=function(e,t){return y(e,Ck(t))},vk=function(e,t){return y(e,ZS(t))},gk=function(e,t){return y(e,XS(t))},US=function(e,t){return y(e,Tk(t))},Ju=function(e,t,n){return y(e,cv(t,n))},Bc=function(e){var t=e$(e);return function(n,r){return y(n,t(r))}},zc=function(e,t,n){return y(e,t$(t,n))},BS=function(e,t,n){return y(e,_d(t,n))},zS=function(e){var t=sv(e);return function(n,r){return y(n,t(r))}},KS=function(e,t,n){return y(e,lv(t,n))},yk=function(e,t){return y(e,YS(t))},bk=function(e,t){return y(e,Ek(t))},_k=function(e,t){return y(e,QS(t))},av=function(e){var t=Rk(e);return function(n,r){return y(n,t(r))}},Sk=function(e){var t=n$(e);return function(n,r){return y(n,t(r))}},VS=function(e,t){return y(e,s$(t))},HS=function(e,t){return y(e,c$(t))},Zu=xa,Kc=function(){return $t},$k=function(e){return function(t){return t.concat(e())}},Tk=$k,Ik=function(e){return bd(function(t){return y(e,uv(t))})},bd=function(e){return function(t){return y(t,ik(function(n,r){return e(r)}))}},GS=bd(D),uv=function(e){return function(t){return t.map(function(n){return e(n)})}},Ok=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},Vc=function(e){for(var t=[],n=[],r=0,i=e;r<i.length;r++){var o=i[r];o._tag==="Left"?t.push(o.left):n.push(o.right)}return Me(t,n)},li=function(e){return function(t){return t.filter(e)}},YS=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);bt(i)&&n.push(i.value)}return n}},JS=function(e){return YS(function(t,n){return e(n)})},Hc=JS(D),wk=function(e){return ZS(function(t,n){return e(n)})},ZS=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return Me(n,r)}},Ck=function(e){return XS(function(t,n){return e(n)})},XS=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);o._tag==="Left"?n.push(o.left):r.push(o.right)}return Me(n,r)}},Ek=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},QS=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},$7=QS(D),sv=function(e){return function(t){return function(n){return n.reduce(function(r,i,o){return e.concat(r,t(o,i))},e.empty)}}},cv=function(e,t){return _d(e,function(n,r,i){return t(r,i)})},e$=function(e){var t=sv(e);return function(n){return t(function(r,i){return n(i)})}},_d=function(e,t){return function(n){for(var r=n.length,i=e,o=0;o<r;o++)i=t(o,i,n[o]);return i}},t$=function(e,t){return lv(e,function(n,r,i){return t(r,i)})},lv=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},Rk=function(e){var t=n$(e);return function(n){return t(function(r,i){return n(i)})}},Sd=function(e){return function(t){return Ju(t,e.of(Kc()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return y(i,Xm(o))}}),r)})}},n$=function(e){return function(t){return _d(e.of(Kc()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return y(o,Xm(a))}}),t(n,i))})}},T7=function(e){var t=l$(e);return function(n){return function(r){return t(r,n)}}},I7=function(e){var t=f$(e);return function(n){return function(r){return t(r,n)}}},r$=function(e,t){for(var n=[],r=e;;){var i=t(r);if(bt(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},dt="ReadonlyArray",Mk=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},xk=function(){return{concat:function(e,t){return Gi(e)?t:Gi(t)?e:e.concat(t)}}},O7=function(){return{concat:xk().concat,empty:$t}},kk=function(e){return Fr(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},Ak=function(e){return Pu(function(t,n){for(var r=t.length,i=n.length,o=Math.min(r,i),a=0;a<o;a++){var u=e.compare(t[a],n[a]);if(u!==0)return u}return Zm.compare(r,i)})},Nk=function(e){var t=jS(e);return{concat:function(n,r){return t(r)(n)}}},w7=function(e){return{concat:Nk(e).concat,empty:$t}},C7=function(e){var t=DS(e);return{concat:function(n,r){return t(r)(n)}}},E7=function(e){var t=qS(e);return{concat:function(n,r){return t(r)(n)}}},i$={URI:dt,map:an},R7=Ke(i$),Fk={URI:dt,of:Zu},M7={URI:dt,map:an,mapWithIndex:tv},fv={URI:dt,map:an,ap:Fa},x7=Ct(fv),k7=Et(fv),A7={URI:dt,map:an,ap:Fa,of:Zu},o$={URI:dt,map:an,ap:Fa,chain:yd},N7={URI:dt,map:an,ap:Fa,of:Zu,chain:yd},F7=ft(o$),P7={URI:dt,unfold:r$},W7={URI:dt,map:an,alt:US},Pk={URI:dt,zero:Kc},L7=qc(Pk,Fk),j7={URI:dt,map:an,ap:Fa,of:Zu,alt:US,zero:Kc},D7={URI:dt,map:an,extend:_k},a$={URI:dt,compact:Hc,separate:Vc},q7={URI:dt,map:an,compact:Hc,separate:Vc,filter:nv,filterMap:rv,partition:iv,partitionMap:ov},U7={URI:dt,map:an,mapWithIndex:tv,compact:Hc,separate:Vc,filter:nv,filterMap:rv,partition:iv,partitionMap:ov,partitionMapWithIndex:gk,partitionWithIndex:vk,filterMapWithIndex:yk,filterWithIndex:bk},B7={URI:dt,reduce:Ju,foldMap:Bc,reduceRight:zc},z7={URI:dt,reduce:Ju,foldMap:Bc,reduceRight:zc,reduceWithIndex:BS,foldMapWithIndex:zS,reduceRightWithIndex:KS},u$={URI:dt,map:an,reduce:Ju,foldMap:Bc,reduceRight:zc,traverse:av,sequence:Sd},K7={URI:dt,map:an,mapWithIndex:tv,reduce:Ju,foldMap:Bc,reduceRight:zc,reduceWithIndex:BS,foldMapWithIndex:zS,reduceRightWithIndex:KS,traverse:av,sequence:Sd,traverseWithIndex:Sk},s$=function(e){return function(t){for(var n=jJ([],e(t),!0),r=[];n.length>0;){var i=n.shift();Gt(i)?n.unshift.apply(n,e(i.left)):r.push(i.right)}return r}},V7={URI:dt,map:an,ap:Fa,chain:yd,chainRec:VS},c$=function(e){return function(t){var n=e(t),r=[],i=[];function o(c){Gt(c)?e(c.left).forEach(function(l){return r.push(l)}):i.push(c.right)}for(var a=0,u=n;a<u.length;a++){var s=u[a];o(s)}for(;r.length>0;)o(r.shift());return i}},H7={URI:dt,map:an,ap:Fa,chain:yd,chainRec:HS},l$=ai(u$,a$),f$=oi(u$,a$),Wk={URI:dt,map:an,compact:Hc,separate:Vc,filter:nv,filterMap:rv,partition:iv,partitionMap:ov,reduce:Ju,foldMap:Bc,reduceRight:zc,traverse:av,sequence:Sd,wither:l$,wilt:f$},G7=Z_(Wk),Lk={URI:dt,fromEither:Zx},Y7=gr(Lk),J7=hm,dv=function(e,t,n){return xt(n)?E_(e,t,n):n},jk=function(e,t){var n=t.slice();return n.splice(e,1),n},Z7=function(e){return e.slice()},X7=function(e){return Gi(e)?$t:e.slice()},$t=Jf;function Dk(e){return function(t){return t.every(e)}}var qk=function(e){return function(t){return t.some(e)}},Q7=qk,Uk=function(e){var t=J_(e);return function(n){return Qx(function(){return e.empty},t(n))}},eZ=Zu(Yt),tZ=wt(i$),nZ=Mt(o$),rZ=Rt(fv),iZ=CM,oZ=ZM,aZ=XM,uZ=hk,sZ={URI:dt,compact:Hc,separate:Vc,map:an,ap:Fa,of:Zu,chain:yd,filter:nv,filterMap:rv,partition:iv,partitionMap:ov,mapWithIndex:tv,partitionMapWithIndex:gk,partitionWithIndex:vk,filterMapWithIndex:yk,filterWithIndex:bk,alt:US,zero:Kc,unfold:r$,reduce:Ju,foldMap:Bc,reduceRight:zc,traverse:av,sequence:Sd,reduceWithIndex:BS,foldMapWithIndex:zS,reduceRightWithIndex:KS,traverseWithIndex:Sk,extend:_k,wither:l$,wilt:f$};const cZ=Object.freeze(Object.defineProperty({__proto__:null,Alt:W7,Alternative:j7,Applicative:A7,Apply:fv,Chain:o$,ChainRecBreadthFirst:H7,ChainRecDepthFirst:V7,Compactable:a$,Do:eZ,Extend:D7,Filterable:q7,FilterableWithIndex:U7,Foldable:B7,FoldableWithIndex:z7,FromEither:Lk,Functor:i$,FunctorWithIndex:M7,Monad:N7,Pointed:Fk,Traversable:u$,TraversableWithIndex:K7,URI:dt,Unfoldable:P7,Witherable:Wk,Zero:Pk,_chainRecBreadthFirst:HS,_chainRecDepthFirst:VS,alt:Tk,altW:$k,ap:Ik,apFirst:x7,apS:rZ,apSecond:k7,append:Xm,appendW:UJ,bind:nZ,bindTo:tZ,chain:bd,chainFirst:F7,chainRecBreadthFirst:c$,chainRecDepthFirst:s$,chainWithIndex:ik,chop:g7,chunksOf:y7,compact:Hc,comprehension:_7,concat:S7,concatW:mk,cons:oZ,deleteAt:u7,difference:qS,dropLeft:n7,dropLeftWhile:i7,dropRight:r7,duplicate:$7,elem:gd,empty:$t,every:Dk,exists:Q7,extend:QS,filter:li,filterE:G7,filterMap:JS,filterMapWithIndex:YS,filterWithIndex:Ek,findFirst:ev,findFirstMap:uk,findIndex:Qm,findLast:sk,findLastIndex:lk,findLastMap:ck,flap:R7,flatten:GS,foldLeft:KJ,foldMap:e$,foldMapWithIndex:sv,foldRight:VJ,fromArray:X7,fromEither:Zx,fromEitherK:Y7,fromOption:Jx,fromOptionK:b7,fromPredicate:zJ,getDifferenceMagma:E7,getEq:kk,getIntersectionSemigroup:C7,getMonoid:O7,getOrd:Ak,getSemigroup:xk,getShow:Mk,getUnionMonoid:w7,getUnionSemigroup:Nk,guard:L7,head:ok,init:ZJ,insertAt:o7,intercalate:Uk,intersection:DS,intersperse:p7,isEmpty:Gi,isNonEmpty:xt,isOutOfBound:Uc,last:WS,lefts:l7,lookup:Yu,makeBy:Yx,map:uv,mapWithIndex:Ok,match:Qx,matchLeft:tk,matchLeftW:ek,matchRight:rk,matchRightW:nk,matchW:Xx,modifyAt:fk,of:Zu,partition:wk,partitionMap:Ck,partitionMapWithIndex:XS,partitionWithIndex:ZS,prepend:DJ,prependAll:hk,prependToAll:uZ,prependW:qJ,range:iZ,readonlyArray:sZ,reduce:cv,reduceRight:t$,reduceRightWithIndex:lv,reduceWithIndex:_d,replicate:BJ,reverse:s7,rights:c7,rotate:h7,scanLeft:HJ,scanRight:GJ,separate:Vc,sequence:Sd,size:YJ,snoc:aZ,some:qk,sort:f7,sortBy:v7,spanLeft:t7,splitAt:LS,tail:JJ,takeLeft:XJ,takeLeftWhile:e7,takeRight:QJ,toArray:Z7,traverse:Rk,traverseWithIndex:n$,unfold:r$,union:jS,uniq:m7,unsafeDeleteAt:jk,unsafeInsertAt:J7,unsafeUpdateAt:dv,unzip:d7,updateAt:a7,wilt:I7,wither:T7,zero:Kc,zip:pk,zipWith:dk},Symbol.toStringTag,{value:"Module"}));var Pa=function(e){return e.length===0},Lt=Eo,lZ=Wc,fZ=dS,pv=fd,dZ=pS,Bk=function(e,t){return e<=0?[]:Bm(t)(e)},pZ=function(e,t){return Bk(e,function(){return t})};function hZ(e){return function(t){return e(t)?[t]:[]}}var zk=function(e){return Wt(e)?[]:[e.value]},Kk=function(e){return Gt(e)?[]:[e.right]},Vk=function(e,t){return function(n){return Lt(n)?t(n):e()}},mZ=Vk,Hk=function(e,t){return function(n){return Lt(n)?t(Wr(n),ci(n)):e()}},Gk=Hk,vZ=Gk,Yk=function(e,t){return function(n){return Lt(n)?t(Dc(n),jc(n)):e()}},Jk=Yk,gZ=Jk,Zk=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},yZ=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[0]=e;for(var o=0;o<r;o++)i[o+1]=t(i[o],n[o]);return i}},bZ=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[r]=e;for(var o=r-1;o>=0;o--)i[o]=t(n[o],i[o+1]);return i}},_Z=function(e){return e.length},$d=Um,SZ=Yu,$Z=ok,TZ=WS,IZ=function(e){return Lt(e)?pe(ci(e)):be},OZ=function(e){return Lt(e)?pe(Dc(e)):be},wZ=function(e){return function(t){return $d(e,t)?$n(t):t.slice(0,e)}},CZ=function(e){return function(t){return $d(e,t)?$n(t):e===0?[]:t.slice(-e)}};function EZ(e){return function(t){for(var n=[],r=0,i=t;r<i.length;r++){var o=i[r];if(!e(o))break;n.push(o)}return n}}var Xk=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function RZ(e){return function(t){var n=rA(Xk(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var MZ=function(e){return function(t){return e<=0||Pa(t)?$n(t):e>=t.length?[]:t.slice(e,t.length)}},xZ=function(e){return function(t){return e<=0||Pa(t)?$n(t):e>=t.length?[]:t.slice(0,t.length-e)}};function kZ(e){return function(t){return t.slice(Xk(t,e))}}var AZ=Qm;function NZ(e){return ev(e)}var FZ=uk;function PZ(e){return sk(e)}var WZ=ck,LZ=lk,$n=function(e){return e.slice()},jZ=function(e,t){return function(n){return e<0||e>n.length?be:pe(kA(e,t,n))}},DZ=function(e,t){return Qk(e,function(){return t})},qZ=function(e){return function(t){return $d(e,t)?be:pe(NA(e,t))}},Qk=function(e,t){return function(n){return $d(e,n)?be:pe(AA(e,t(n[e]),n))}},UZ=function(e){return Pa(e)?[]:e.slice().reverse()},BZ=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},zZ=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},KZ=function(e){return function(t){return t.length<=1?$n(t):t.slice().sort(e.compare)}},eA=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r};function tA(e,t){return t===void 0?function(n){return tA(n,e)}:eA(e,t,function(n,r){return[n,r]})}var VZ=function(e){for(var t=[],n=[],r=0;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},nA=function(e){var t=Km(e);return function(n){return Lt(n)?t(n):[]}},HZ=function(e){var t=Cx(e);return function(n){return Lt(n)?t(n):$n(n)}},GZ=function(e){var t=yS(e);return function(n){return Lt(n)?t(n):$n(n)}},d$=gd,YZ=function(e){var t=vS(e);return function(n){return Lt(n)?t(n):$n(n)}},JZ=function(e){var t=yx(e);return function(n){return Lt(n)?t(n):$n(n)}},ZZ=function(e){var t=SS(e);return function(n){return Lt(n)?t(n):[]}},rA=function(e){return function(t){return e>=1&&Lt(t)?Vm(e)(t):Pa(t)?[$n(t),[]]:[[],$n(t)]}},XZ=function(e){var t=xx(e);return function(n){return Lt(n)?t(n):[]}},QZ=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return zk(e.apply(void 0,t))}};function e8(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return Lt(o)?y(Wr(o),Id(function(a){return r(y(i,pv(a)),ci(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:[]};return r([],e)}var iA=function(e){return function(t){return Pa(t)?$n(e):Pa(e)?$n(t):t.concat(e)}},t8=iA;function p$(e){var t=gS(e);return function(n,r){if(r===void 0){var i=p$(e);return function(o){return i(o,n)}}return Lt(n)&&Lt(r)?t(r)(n):Lt(n)?$n(n):$n(r)}}function h$(e){var t=d$(e);return function(n,r){if(r===void 0){var i=h$(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function m$(e){var t=d$(e);return function(n,r){if(r===void 0){var i=m$(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var un=function(e,t){return y(e,_$(t))},hv=function(e,t){return y(e,dA(t))},Wa=function(e,t){return y(e,fA(t))},Td=function(e,t){return y(e,Id(t))},mv=function(e,t){return y(e,pA(t))},vv=function(e,t){return y(e,T$(t))},gv=function(e,t){return y(e,hA(t))},yv=function(e,t){return y(e,mA(t))},oA=function(e,t){return y(e,I$(t))},aA=function(e,t){return y(e,O$(t))},v$=function(e,t){return y(e,gA(t))},Xu=function(e,t,n){return y(e,SA(t,n))},Gc=function(e){var t=bA(e);return function(n,r){return y(n,t(r))}},Yc=function(e,t,n){return y(e,$A(t,n))},g$=function(e,t,n){return y(e,C$(t,n))},y$=function(e){var t=_A(e);return function(n,r){return y(n,t(r))}},b$=function(e,t,n){return y(e,TA(t,n))},uA=function(e,t){return y(e,$$(t))},sA=function(e,t){return y(e,yA(t))},cA=function(e,t){return y(e,w$(t))},bv=function(e){var t=_v(e);return function(n,r){return y(n,t(r))}},lA=function(e){var t=E$(e);return function(n,r){return y(n,t(r))}},n8=VS,r8=HS,La=Na,Jc=function(){return[]},_$=function(e){return function(t){return t.map(function(n){return e(n)})}},fA=function(e){return Id(function(t){return y(e,_$(t))})},Id=function(e){return function(t){return y(t,Zk(function(n,r){return e(r)}))}},S$=Id(D),dA=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},$$=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);bt(i)&&n.push(i.value)}return n}},T$=function(e){return $$(function(t,n){return e(n)})},Zc=T$(D),Xc=function(e){for(var t=[],n=[],r=0,i=e;r<i.length;r++){var o=i[r];o._tag==="Left"?t.push(o.left):n.push(o.right)}return Me(t,n)},pA=function(e){return function(t){return t.filter(e)}},hA=function(e){return I$(function(t,n){return e(n)})},I$=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return Me(n,r)}},mA=function(e){return O$(function(t,n){return e(n)})},O$=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);o._tag==="Left"?n.push(o.left):r.push(o.right)}return Me(n,r)}},vA=function(e){return function(t){return t.concat(e())}},gA=vA,yA=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},w$=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},i8=w$(D),bA=e$,_A=sv,SA=cv,C$=_d,$A=t$,TA=lv,_v=function(e){var t=E$(e);return function(n){return t(function(r,i){return n(i)})}},Od=function(e){return function(t){return Xu(t,e.of(Jc()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return y(i,pv(o))}}),r)})}},E$=function(e){return function(t){return C$(e.of(Jc()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return y(o,pv(a))}}),t(n,i))})}},o8=function(e){var t=F$(e);return function(n){return function(r){return t(r,n)}}},a8=function(e){var t=P$(e);return function(n){return function(r){return t(r,n)}}},R$=function(e,t){for(var n=[],r=e;;){var i=t(r);if(bt(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},pt="Array",u8=Mk,IA=function(){return{concat:function(e,t){return e.concat(t)}}},M$=function(){return{concat:IA().concat,empty:[]}},OA=kk,s8=Ak,wA=function(e){var t=p$(e);return{concat:function(n,r){return t(r)(n)}}},c8=function(e){return{concat:wA(e).concat,empty:[]}},l8=function(e){var t=h$(e);return{concat:function(n,r){return t(r)(n)}}},f8=function(e){var t=m$(e);return{concat:function(n,r){return t(r)(n)}}},x$={URI:pt,map:un},d8=Ke(x$),CA={URI:pt,of:La},p8={URI:pt,map:un,mapWithIndex:hv},Sv={URI:pt,map:un,ap:Wa},h8=Ct(Sv),m8=Et(Sv),v8={URI:pt,map:un,ap:Wa,of:La},k$={URI:pt,map:un,ap:Wa,chain:Td},g8=ft(k$),y8={URI:pt,map:un,ap:Wa,of:La,chain:Td},b8={URI:pt,unfold:R$},_8={URI:pt,map:un,alt:v$},EA={URI:pt,zero:Jc},S8=qc(EA,CA),$8={URI:pt,map:un,ap:Wa,of:La,alt:v$,zero:Jc},T8={URI:pt,map:un,extend:cA},A$={URI:pt,compact:Zc,separate:Xc},I8={URI:pt,map:un,compact:Zc,separate:Xc,filter:mv,filterMap:vv,partition:gv,partitionMap:yv},O8={URI:pt,map:un,mapWithIndex:hv,compact:Zc,separate:Xc,filter:mv,filterMap:vv,partition:gv,partitionMap:yv,partitionMapWithIndex:aA,partitionWithIndex:oA,filterMapWithIndex:uA,filterWithIndex:sA},RA={URI:pt,reduce:Xu,foldMap:Gc,reduceRight:Yc},w8={URI:pt,reduce:Xu,foldMap:Gc,reduceRight:Yc,reduceWithIndex:g$,foldMapWithIndex:y$,reduceRightWithIndex:b$},N$={URI:pt,map:un,reduce:Xu,foldMap:Gc,reduceRight:Yc,traverse:bv,sequence:Od},C8={URI:pt,map:un,mapWithIndex:hv,reduce:Xu,foldMap:Gc,reduceRight:Yc,reduceWithIndex:g$,foldMapWithIndex:y$,reduceRightWithIndex:b$,traverse:bv,sequence:Od,traverseWithIndex:lA},F$=ai(N$,A$),P$=oi(N$,A$),MA={URI:pt,map:un,compact:Zc,separate:Xc,filter:mv,filterMap:vv,partition:gv,partitionMap:yv,reduce:Xu,foldMap:Gc,reduceRight:Yc,traverse:bv,sequence:Od,wither:F$,wilt:P$},E8=s$,R8={URI:pt,map:un,ap:Wa,chain:Td,chainRec:n8},M8=c$,x8={URI:pt,map:un,ap:Wa,chain:Td,chainRec:r8},k8=Z_(MA),xA={URI:pt,fromEither:Kk},A8=gr(xA),kA=hS,AA=function(e,t,n){return Lt(n)?mS(e,t,n):[]},NA=function(e,t){var n=t.slice();return n.splice(e,1),n},N8=Dk,FA=function(e){return function(t){return t.some(e)}},F8=FA,P8=Uk,W8=La(Yt),L8=wt(x$),j8=Mt(k$),D8=Rt(Sv),q8=bx,U8=[],B8=Vx,z8=Hx,K8=nA,V8={URI:pt,compact:Zc,separate:Xc,map:un,ap:Wa,of:La,chain:Td,filter:mv,filterMap:vv,partition:gv,partitionMap:yv,mapWithIndex:hv,partitionMapWithIndex:aA,partitionWithIndex:oA,filterMapWithIndex:uA,filterWithIndex:sA,alt:v$,zero:Jc,unfold:R$,reduce:Xu,foldMap:Gc,reduceRight:Yc,traverse:bv,sequence:Od,reduceWithIndex:g$,foldMapWithIndex:y$,reduceRightWithIndex:b$,traverseWithIndex:lA,extend:cA,wither:F$,wilt:P$};const H8=Object.freeze(Object.defineProperty({__proto__:null,Alt:_8,Alternative:$8,Applicative:v8,Apply:Sv,Chain:k$,ChainRecBreadthFirst:x8,ChainRecDepthFirst:R8,Compactable:A$,Do:W8,Extend:T8,Filterable:I8,FilterableWithIndex:O8,Foldable:RA,FoldableWithIndex:w8,FromEither:xA,Functor:x$,FunctorWithIndex:p8,Monad:y8,Pointed:CA,Traversable:N$,TraversableWithIndex:C8,URI:pt,Unfoldable:b8,Witherable:MA,Zero:EA,alt:gA,altW:vA,ap:fA,apFirst:h8,apS:D8,apSecond:m8,append:pv,appendW:dZ,array:V8,bind:j8,bindTo:L8,chain:Id,chainFirst:g8,chainRecBreadthFirst:M8,chainRecDepthFirst:E8,chainWithIndex:Zk,chop:ZZ,chunksOf:XZ,compact:Zc,comprehension:e8,concat:t8,concatW:iA,cons:B8,copy:$n,deleteAt:qZ,difference:m$,dropLeft:MZ,dropLeftWhile:kZ,dropRight:xZ,duplicate:i8,elem:d$,empty:U8,every:N8,exists:F8,extend:w$,filter:pA,filterE:k8,filterMap:T$,filterMapWithIndex:$$,filterWithIndex:yA,findFirst:NZ,findFirstMap:FZ,findIndex:AZ,findLast:PZ,findLastIndex:LZ,findLastMap:WZ,flap:d8,flatten:S$,foldLeft:vZ,foldMap:bA,foldMapWithIndex:_A,foldRight:gZ,fromEither:Kk,fromEitherK:A8,fromOption:zk,fromOptionK:QZ,fromPredicate:hZ,getDifferenceMagma:f8,getEq:OA,getIntersectionSemigroup:l8,getMonoid:M$,getOrd:s8,getSemigroup:IA,getShow:u8,getUnionMonoid:c8,getUnionSemigroup:wA,guard:S8,head:$Z,init:OZ,insertAt:jZ,intercalate:P8,intersection:h$,intersperse:HZ,isEmpty:Pa,isNonEmpty:Lt,isOutOfBound:$d,last:TZ,lefts:zZ,lookup:SZ,makeBy:Bk,map:_$,mapWithIndex:dA,match:mZ,matchLeft:Gk,matchLeftW:Hk,matchRight:Jk,matchRightW:Yk,matchW:Vk,modifyAt:Qk,of:La,partition:hA,partitionMap:mA,partitionMapWithIndex:O$,partitionWithIndex:I$,prepend:lZ,prependAll:nA,prependToAll:K8,prependW:fZ,range:q8,reduce:SA,reduceRight:$A,reduceRightWithIndex:TA,reduceWithIndex:C$,replicate:pZ,reverse:UZ,rights:BZ,rotate:GZ,scanLeft:yZ,scanRight:bZ,separate:Xc,sequence:Od,size:_Z,snoc:z8,some:FA,sort:KZ,sortBy:JZ,spanLeft:RZ,splitAt:rA,tail:IZ,takeLeft:wZ,takeLeftWhile:EZ,takeRight:CZ,traverse:_v,traverseWithIndex:E$,unfold:R$,union:p$,uniq:YZ,unsafeDeleteAt:NA,unsafeInsertAt:kA,unsafeUpdateAt:AA,unzip:VZ,updateAt:DZ,wilt:a8,wither:o8,zero:Jc,zip:tA,zipWith:eA},Symbol.toStringTag,{value:"Module"})),G8=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Y8=function(e){return typeof e=="boolean"},PA=function(e,t){return function(n){return n?t():e()}},WA=PA,LA=WA,J8=LA,jA={equals:function(e,t){return e===t}},Z8={meet:function(e,t){return e&&t},join:function(e,t){return e||t},zero:!1,one:!0,implies:function(e,t){return!e||t},not:function(e){return!e}},DA={concat:function(e,t){return e&&t}},qA={concat:function(e,t){return e||t}},X8={concat:DA.concat,empty:!0},Q8={concat:qA.concat,empty:!1},eX={equals:jA.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},tX={show:function(e){return JSON.stringify(e)}};const nX=Object.freeze(Object.defineProperty({__proto__:null,BooleanAlgebra:Z8,Eq:jA,MonoidAll:X8,MonoidAny:Q8,Ord:eX,SemigroupAll:DA,SemigroupAny:qA,Show:tX,fold:J8,foldW:WA,isBoolean:Y8,match:LA,matchW:PA},Symbol.toStringTag,{value:"Module"}));var UA=function(e){return{meet:function(t,n){return e.join(t,n)},join:function(t,n){return e.meet(t,n)},zero:e.one,one:e.zero,implies:function(t,n){return e.join(e.not(t),n)},not:e.not}},rX={meet:function(){},join:function(){},zero:void 0,one:void 0,implies:function(){},not:function(){}},iX=UA,oX={meet:function(e,t){return e&&t},join:function(e,t){return e||t},zero:!1,one:!0,implies:function(e,t){return!e||t},not:function(e){return!e}},aX=KR;const uX=Object.freeze(Object.defineProperty({__proto__:null,booleanAlgebraBoolean:oX,booleanAlgebraVoid:rX,getDualBooleanAlgebra:iX,getFunctionBooleanAlgebra:aX,reverse:UA},Symbol.toStringTag,{value:"Module"}));var sX=function(e){return mM(e)(e.bottom,e.top)},cX=function(e){var t=g_(e);return{equals:t.equals,compare:t.compare,top:e.bottom,bottom:e.top}},lX={equals:sm.equals,compare:sm.compare,top:1/0,bottom:-1/0};const fX=Object.freeze(Object.defineProperty({__proto__:null,boundedNumber:lX,clamp:sX,reverse:cX},Symbol.toStringTag,{value:"Module"}));function BA(e){return{meet:am(e),join:um(e)}}const dX=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:BA},Symbol.toStringTag,{value:"Module"}));function pX(e){var t=BA(e);return function(n,r){return{join:t.join,meet:t.meet,zero:n,one:r}}}const hX=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:pX},Symbol.toStringTag,{value:"Module"})),mX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),vX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),gX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),yX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var W$=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};const bX=Object.freeze(Object.defineProperty({__proto__:null,tailRec:W$},Symbol.toStringTag,{value:"Module"}));function L$(e,t){return function(n,r){return t.compose(e.right(r),e.left(n))}}function zA(e,t){var n=L$(e,t);return function(r,i){return t.compose(e.promap(t.id(),function(o){return o._tag==="Left"?o.left:o.right},D),n(r,i))}}function _X(e){return L$(e,e)}function SX(e){return zA(e,e)}const $X=Object.freeze(Object.defineProperty({__proto__:null,fanIn:zA,fanin:SX,split:L$,splitChoice:_X},Symbol.toStringTag,{value:"Module"})),TX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var IX=function(e,t){return y(e,KA(t))},KA=function(e){return function(t){return V(e,t)}},VA="Predicate",HA=function(){return{concat:function(e,t){return y(e,YA(t))}}},OX=function(){return{concat:HA().concat,empty:GR}},GA=function(){return{concat:function(e,t){return y(e,JA(t))}}},wX=function(){return{concat:GA().concat,empty:l_}},CX={URI:VA,contramap:IX},wd=function(e){return function(t){return!e(t)}},YA=function(e){return function(t){return function(n){return t(n)||e(n)}}},JA=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const EX=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:CX,URI:VA,and:JA,contramap:KA,getMonoidAll:wX,getMonoidAny:OX,getSemigroupAll:GA,getSemigroupAny:HA,not:wd,or:YA},Symbol.toStringTag,{value:"Module"}));var ot=be,_t=pe;function $v(e){return function(t){return e(t)?_t(t):ot}}var Tv=function(e){return e._tag==="Right"?ot:_t(e.left)},Cd=function(e){return e._tag==="Left"?ot:_t(e.right)},yr=function(e,t){return y(e,Yi(t))},Qu=function(e,t){return y(e,eN(t))},Iv=function(e,t){return y(e,Rd(t))},Ov=function(e,t,n){return y(e,nN(t,n))},wv=function(e){var t=rN(e);return function(n,r){return y(n,t(r))}},Cv=function(e,t,n){return y(e,iN(t,n))},j$=function(e){var t=dN(e);return function(n,r){return y(n,t(r))}},D$=function(e,t){return y(e,aN(t))},Ed=function(e,t){return y(e,sN(t))},q$=function(e,t){return y(e,cN(t))},ZA=function(e,t){return y(e,K$(t))},U$=function(e,t){return y(e,lN(t))},B$=function(e,t){return y(e,fN(t))},Bt="Option",RX=function(e){return{show:function(t){return je(t)?"none":"some(".concat(e.show(t.value),")")}}},XA=function(e){return{equals:function(t,n){return t===n||(je(t)?je(n):je(n)?!1:e.equals(t.value,n.value))}}},MX=function(e){return{equals:XA(e).equals,compare:function(t,n){return t===n?0:xv(t)?xv(n)?e.compare(t.value,n.value):1:-1}}},z$=function(e){return{concat:function(t,n){return je(t)?n:je(n)?t:_t(e.concat(t.value,n.value))},empty:ot}},Yi=function(e){return function(t){return je(t)?ot:_t(e(t.value))}},Qc={URI:Bt,map:yr},Ro=_t,QA={URI:Bt,of:Ro},eN=function(e){return function(t){return je(t)||je(e)?ot:_t(t.value(e.value))}},el={URI:Bt,map:yr,ap:Qu},tN={URI:Bt,map:yr,ap:Qu,of:Ro},Rd=function(e){return function(t){return je(t)?ot:e(t.value)}},Md={URI:Bt,map:yr,ap:Qu,chain:Iv},xX={URI:Bt,map:yr,ap:Qu,of:Ro,chain:Iv},nN=function(e,t){return function(n){return je(n)?e:t(e,n.value)}},rN=function(e){return function(t){return function(n){return je(n)?e.empty:t(n.value)}}},iN=function(e,t){return function(n){return je(n)?e:t(n.value,e)}},kX={URI:Bt,reduce:Ov,foldMap:wv,reduceRight:Cv},oN=function(e){return function(t){return je(t)?e():t}},aN=oN,AX={URI:Bt,map:yr,alt:D$},Ev=function(){return ot},uN={URI:Bt,zero:Ev},NX=qc(uN,QA),FX={URI:Bt,map:yr,ap:Qu,of:Ro,alt:D$,zero:Ev},K$=function(e){return function(t){return je(t)?ot:_t(e(t))}},PX={URI:Bt,map:yr,extend:ZA},tl=Rd(D),WX=Me(ot,ot),nl=function(e){return je(e)?WX:Me(Tv(e.value),Cd(e.value))},es={URI:Bt,compact:tl,separate:nl},sN=function(e){return function(t){return je(t)?ot:e(t.value)?t:ot}},cN=function(e){return function(t){return je(t)?ot:e(t.value)}},lN=function(e){return function(t){return Me(Ed(t,wd(e)),Ed(t,e))}},fN=function(e){return V(Yi(e),nl)},Mo={URI:Bt,map:yr,compact:tl,separate:nl,filter:Ed,filterMap:q$,partition:U$,partitionMap:B$},dN=function(e){return function(t){return function(n){return je(n)?e.of(ot):e.map(t(n.value),_t)}}},Rv=function(e){return function(t){return je(t)?e.of(ot):e.map(t.value,_t)}},V$={URI:Bt,map:yr,reduce:Ov,foldMap:wv,reduceRight:Cv,traverse:j$,sequence:Rv},H$=ai(V$,es),G$=oi(V$,es),LX=function(e){var t=H$(e);return function(n){return function(r){return t(r,n)}}},jX=function(e){var t=G$(e);return function(n){return function(r){return t(r,n)}}},DX={URI:Bt,map:yr,reduce:Ov,foldMap:wv,reduceRight:Cv,traverse:j$,sequence:Rv,compact:tl,separate:nl,filter:Ed,filterMap:q$,partition:U$,partitionMap:B$,wither:H$,wilt:G$},Y$=function(){return ot},qX={URI:Bt,map:yr,ap:Qu,of:Ro,chain:Iv,throwError:Y$},rl=Cd,Mv={URI:Bt,fromEither:rl},xv=bt,je=function(e){return e._tag==="None"},J$=function(e,t){return function(n){return je(n)?e():t(n.value)}},UX=J$,xo=J$,ko=xo,Z$=function(e){return function(t){return je(t)?e():t.value}},X$=Z$,BX=Ke(Qc),zX=Ct(el),KX=Et(el),VX=tl,HX=ft(Md),GX=K$(D),YX=gr(Mv),JX=wo(Mv,Md),ZX=Co(Mv,Md),ts=function(e){return e==null?ot:_t(e)},pN=function(e){try{return _t(e())}catch{return ot}},XX=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return pN(function(){return e.apply(void 0,t)})}},QX=function(e){return V(e,ts)},hN=function(e){return function(t){return je(t)?ot:ts(e(t.value))}},Q$=xo(YR,D),mN=xo(f_,D);function vN(e){return function(t,n){if(n===void 0){var r=vN(e);return function(i){return r(t,i)}}return je(n)?!1:e.equals(t,n.value)}}var eQ=function(e){return function(t){return je(t)?!1:e(t.value)}},tQ=Ro(Yt),nQ=wt(Qc),rQ=Mt(Md),iQ=Rt(el),gN=Ro(rn),kv=function(e){return function(t){var n=e(0,dr(t));if(je(n))return ot;for(var r=[n.value],i=1;i<t.length;i++){var o=e(i,t[i]);if(je(o))return ot;r.push(o.value)}return _t(r)}},e0=function(e){var t=kv(e);return function(n){return gt(n)?t(n):gN}},oQ=e0,yN=function(e){return e0(function(t,n){return e(n)})},aQ=yN(D);function uQ(e){return function(t){return xv(e(t))}}var sQ=hN,bN={URI:Bt,map:yr,of:Ro,ap:Qu,chain:Iv,reduce:Ov,foldMap:wv,reduceRight:Cv,traverse:j$,sequence:Rv,zero:Ev,alt:D$,extend:ZA,compact:tl,separate:nl,filter:Ed,filterMap:q$,partition:U$,partitionMap:B$,wither:H$,wilt:G$,throwError:Y$},cQ=Jt(el),lQ=Pr(tN),_N=function(){return z$(I_())},fQ=function(){return z$(fm())};const dQ=Object.freeze(Object.defineProperty({__proto__:null,Alt:AX,Alternative:FX,ApT:gN,Applicative:tN,Apply:el,Chain:Md,Compactable:es,Do:tQ,Extend:PX,Filterable:Mo,Foldable:kX,FromEither:Mv,Functor:Qc,Monad:xX,MonadThrow:qX,Pointed:QA,Traversable:V$,URI:Bt,Witherable:DX,Zero:uN,alt:aN,altW:oN,ap:eN,apFirst:zX,apS:iQ,apSecond:KX,bind:rQ,bindTo:nQ,chain:Rd,chainEitherK:JX,chainFirst:HX,chainFirstEitherK:ZX,chainNullableK:hN,compact:tl,duplicate:GX,elem:vN,exists:eQ,extend:K$,filter:sN,filterMap:cN,flap:BX,flatten:VX,fold:ko,foldMap:rN,foldW:UX,fromEither:rl,fromEitherK:YX,fromNullable:ts,fromNullableK:QX,fromPredicate:$v,getApplyMonoid:lQ,getApplySemigroup:cQ,getEq:XA,getFirstMonoid:_N,getLastMonoid:fQ,getLeft:Tv,getMonoid:z$,getOrElse:X$,getOrElseW:Z$,getOrd:MX,getRefinement:uQ,getRight:Cd,getShow:RX,guard:NX,isNone:je,isSome:xv,map:Yi,mapNullable:sQ,match:xo,matchW:J$,none:ot,of:Ro,option:bN,partition:lN,partitionMap:fN,reduce:nN,reduceRight:iN,separate:nl,sequence:Rv,sequenceArray:aQ,some:_t,throwError:Y$,toNullable:Q$,toUndefined:mN,traverse:dN,traverseArray:yN,traverseArrayWithIndex:oQ,traverseReadonlyArrayWithIndex:e0,traverseReadonlyNonEmptyArrayWithIndex:kv,tryCatch:pN,tryCatchK:XX,wilt:jX,wither:LX,zero:Ev},Symbol.toStringTag,{value:"Module"}));function Ji(e,t){return function(n){return e.map(n,t.compact)}}function Ao(e,t,n){var r=Ji(e,t),i=Cc(e,n);return function(o){return Me(r(y(o,i(Tv))),r(y(o,i(Cd))))}}function pQ(e,t){var n=Ec(e,t).map;return{map:n,compact:Ji(e,t),separate:Ao(e,t,t)}}const hQ=Object.freeze(Object.defineProperty({__proto__:null,compact:Ji,getCompactableComposition:pQ,separate:Ao},Symbol.toStringTag,{value:"Module"}));var mQ=function(e){return function(){return console.log(e)}},vQ=function(e){return function(){return console.warn(e)}},gQ=function(e){return function(){return console.error(e)}},yQ=function(e){return function(){return console.info(e)}};const bQ=Object.freeze(Object.defineProperty({__proto__:null,error:gQ,info:yQ,log:mQ,warn:vQ},Symbol.toStringTag,{value:"Module"}));var il=Oc;function _Q(e){return{show:function(t){return"make(".concat(e.show(t),")")}}}var SQ=D,$Q=D,TQ=D,IQ=D,OQ=D,wQ=D,CQ=D,EQ=D,RQ=D;function SN(e){return{URI:ns,_E:void 0,map:t0,ap:function(t,n){return il(e.concat(t,n))}}}function $N(e){var t=SN(e);return{URI:ns,_E:void 0,map:t.map,ap:t.ap,of:function(){return il(e.empty)}}}var TN=function(e,t){return y(e,wN())},t0=function(e,t){return y(e,CN())},IN=function(e,t,n){return y(e,EN(t))},ON=function(e,t){return y(e,RN(t))},wN=function(){return Oc},CN=function(){return Oc},EN=function(e){return function(t){return il(e(t))}},RN=function(e){return function(t){return il(e(t))}},ns="Const",MN={URI:ns,map:t0},MQ=Ke(MN),xQ={URI:ns,contramap:TN},kQ={URI:ns,bimap:IN,mapLeft:ON},AQ={URI:ns,map:t0,contramap:TN,bimap:IN,mapLeft:ON};const NQ=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:kQ,Contravariant:xQ,Functor:MN,URI:ns,bimap:EN,const_:AQ,contramap:wN,flap:MQ,getApplicative:$N,getApply:SN,getBooleanAlgebra:RQ,getBounded:TQ,getEq:SQ,getHeytingAlgebra:EQ,getMonoid:OQ,getOrd:$Q,getRing:CQ,getSemigroup:IQ,getSemiring:wQ,getShow:_Q,make:il,map:CN,mapLeft:RN},Symbol.toStringTag,{value:"Module"})),FQ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var PQ={equals:function(e,t){return e.valueOf()===t.valueOf()}},WQ={equals:function(e,t){return e.getDate()===t.getDate()}},LQ={equals:function(e,t){return e.getMonth()===t.getMonth()}},jQ={equals:function(e,t){return e.getFullYear()===t.getFullYear()}},DQ=y(Zm,om(function(e){return e.valueOf()})),qQ=function(){return new Date},UQ=function(){return new Date().getTime()};const BQ=Object.freeze(Object.defineProperty({__proto__:null,Eq:PQ,Ord:DQ,create:qQ,eqDate:WQ,eqMonth:LQ,eqYear:jQ,now:UQ},Symbol.toStringTag,{value:"Module"}));var Tt=So,Ye=Ma,Tn=function(e,t){return y(e,as(t))},rs=function(e,t){return y(e,NN(t))},ol=function(e,t){return y(e,Lr(t))},xd=function(e,t,n){return y(e,PN(t,n))},kd=function(e){return function(t,n){var r=WN(e);return y(t,r(n))}},Ad=function(e,t,n){return y(e,LN(t,n))},Av=function(e){var t=jN(e);return function(n,r){return y(n,t(r))}},n0=function(e,t,n){return y(e,s0(t,n))},r0=function(e,t){return y(e,Wd(t))},xN=function(e,t){return y(e,qN(t))},i0=function(e,t){return y(e,c0(t))},o0=function(e,t){return W$(t(e),function(n){return le(n)?Ye(Tt(n.left)):le(n.right)?Tt(t(n.right.left)):Ye(Ye(n.right.right))})},It="Either",zQ=function(e,t){return{show:function(n){return le(n)?"left(".concat(e.show(n.left),")"):"right(".concat(t.show(n.right),")")}}},KQ=function(e,t){return{equals:function(n,r){return n===r||(le(n)?le(r)&&e.equals(n.left,r.left):l0(r)&&t.equals(n.right,r.right))}}},Nd=function(e){return{concat:function(t,n){return le(n)?t:le(t)?n:Ye(e.concat(t.right,n.right))}}},is=function(e){var t=Tt(e.empty);return{URI:It,_E:void 0,compact:function(n){return le(n)?n:n.right._tag==="None"?t:Ye(n.right.value)},separate:function(n){return le(n)?Me(n,n):le(n.right)?Me(Ye(n.right.left),t):Me(t,Ye(n.right.right))}}},al=function(e){var t=Tt(e.empty),n=is(e),r=n.compact,i=n.separate,o=function(u,s){return le(u)||s(u.right)?u:t},a=function(u,s){return le(u)?Me(u,u):s(u.right)?Me(t,Ye(u.right)):Me(Ye(u.right),t)};return{URI:It,_E:void 0,map:Tn,compact:r,separate:i,filter:o,filterMap:function(u,s){if(le(u))return u;var c=s(u.right);return c._tag==="None"?t:Ye(c.value)},partition:a,partitionMap:function(u,s){if(le(u))return Me(u,u);var c=s(u.right);return le(c)?Me(Ye(c.left),t):Me(t,Ye(c.right))}}},VQ=function(e){var t=al(e),n=is(e);return{URI:It,_E:void 0,map:Tn,compact:t.compact,separate:t.separate,filter:t.filter,filterMap:t.filterMap,partition:t.partition,partitionMap:t.partitionMap,traverse:Av,sequence:Pd,reduce:xd,foldMap:kd,reduceRight:Ad,wither:ai(u0,n),wilt:oi(u0,n)}},ja=function(e){return{URI:It,_E:void 0,map:Tn,ap:function(t,n){return le(t)?le(n)?Tt(e.concat(t.left,n.left)):t:le(n)?n:Ye(t.right(n.right))},of:Zi}},kN=function(e){return{URI:It,_E:void 0,map:Tn,alt:function(t,n){if(l0(t))return t;var r=n();return le(r)?Tt(e.concat(t.left,r.left)):r}}},as=function(e){return function(t){return le(t)?t:Ye(e(t.right))}},Da={URI:It,map:Tn},Zi=Ye,HQ={URI:It,of:Zi},AN=function(e){return function(t){return le(t)?t:le(e)?e:Ye(t.right(e.right))}},NN=AN,ul={URI:It,map:Tn,ap:rs},FN={URI:It,map:Tn,ap:rs,of:Zi},a0=function(e){return function(t){return le(t)?t:e(t.right)}},Lr=a0,Fd={URI:It,map:Tn,ap:rs,chain:ol},GQ={URI:It,map:Tn,ap:rs,of:Zi,chain:ol},PN=function(e,t){return function(n){return le(n)?e:t(e,n.right)}},WN=function(e){return function(t){return function(n){return le(n)?e.empty:t(n.right)}}},LN=function(e,t){return function(n){return le(n)?e:t(n.right,e)}},YQ={URI:It,reduce:xd,foldMap:kd,reduceRight:Ad},jN=function(e){return function(t){return function(n){return le(n)?e.of(Tt(n.left)):e.map(t(n.right),Ye)}}},Pd=function(e){return function(t){return le(t)?e.of(Tt(t.left)):e.map(t.right,Ye)}},u0={URI:It,map:Tn,reduce:xd,foldMap:kd,reduceRight:Ad,traverse:Av,sequence:Pd},s0=function(e,t){return function(n){return le(n)?Tt(e(n.left)):Ye(t(n.right))}},Wd=function(e){return function(t){return le(t)?Tt(e(t.left)):t}},JQ={URI:It,bimap:n0,mapLeft:r0},DN=function(e){return function(t){return le(t)?e():t}},qN=DN,ZQ={URI:It,map:Tn,alt:xN},c0=function(e){return function(t){return le(t)?t:Ye(e(t))}},XQ={URI:It,map:Tn,extend:i0},QQ={URI:It,map:Tn,ap:rs,chain:ol,chainRec:o0},Nv=Tt,eee={URI:It,map:Tn,ap:rs,of:Zi,chain:ol,throwError:Nv},sl={URI:It,fromEither:D},tee=Aa(sl),UN=Vi(sl),le=Gt,l0=d_,f0=function(e,t){return function(n){return le(n)?e(n.left):t(n.right)}},BN=f0,qa=f0,d0=qa,p0=function(e){return function(t){return le(t)?e(t.left):t.right}},nee=p0,ree=Ke(Da),zN=Ct(ul),iee=zN,KN=Et(ul),oee=KN,VN=ft(Fd),aee=VN,HN=a0(D),uee=HN,see=c0(D),cee=Hi(sl),lee=Hu(sl,Fd),GN=Gu(sl,Fd),fee=GN,YN=function(e){return le(e)?Ye(e.left):Tt(e.right)},JN=function(e){return function(t){return le(t)?e(t.left):t}},ZN=JN,h0=function(e){return function(t){return t==null?Tt(e):Ye(t)}},us=function(e,t){try{return Ye(e())}catch(n){return Tt(t(n))}},dee=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return us(function(){return e.apply(void 0,n)},t)}},XN=function(e){var t=h0(e);return function(n){return V(n,t)}},pee=function(e){var t=XN(e);return function(n){return Lr(t(n))}},QN=BN(D,D);function hee(e){return e instanceof Error?e:new Error(String(e))}function eF(e){return function(t,n){if(n===void 0){var r=eF(e);return function(i){return r(t,i)}}return le(n)?!1:e.equals(t,n.right)}}var mee=function(e){return function(t){return le(t)?!1:e(t.right)}},vee=Zi(Yt),gee=wt(Da),tF=Mt(Fd),yee=tF,nF=Rt(ul),bee=nF,rF=Zi(rn),Ld=function(e){return function(t){var n=e(0,dr(t));if(le(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i]);if(le(o))return o;r.push(o.right)}return Ye(r)}},m0=function(e){var t=Ld(e);return function(n){return gt(n)?t(n):rF}},_ee=m0,iF=function(e){return m0(function(t,n){return e(n)})},See=iF(D);function $ee(e,t){return us(function(){return JSON.parse(e)},t)}var Tee=function(e,t){return us(function(){var n=JSON.stringify(e);if(typeof n!="string")throw new Error("Converting unsupported structure to JSON");return n},t)},Iee={URI:It,map:Tn,of:Zi,ap:rs,chain:ol,reduce:xd,foldMap:kd,reduceRight:Ad,traverse:Av,sequence:Pd,bimap:n0,mapLeft:r0,alt:xN,extend:i0,chainRec:o0,throwError:Nv},Oee=Jt(ul),wee=Pr(FN),Cee=function(e,t){return Jt(ja(e))(t)},Eee=function(e,t){return Pr(ja(e))(t)};function Ree(e){var t=ja(e).ap,n=kN(e).alt;return{URI:It,_E:void 0,map:Tn,of:Zi,chain:ol,bimap:n0,mapLeft:r0,reduce:xd,foldMap:kd,reduceRight:Ad,extend:i0,traverse:Av,sequence:Pd,chainRec:o0,throwError:Nv,ap:t,alt:n}}const oF=Object.freeze(Object.defineProperty({__proto__:null,Alt:ZQ,ApT:rF,Applicative:FN,Apply:ul,Bifunctor:JQ,Chain:Fd,ChainRec:QQ,Do:vee,Extend:XQ,Foldable:YQ,FromEither:sl,Functor:Da,Monad:GQ,MonadThrow:eee,Pointed:HQ,Traversable:u0,URI:It,alt:qN,altW:DN,ap:NN,apFirst:zN,apFirstW:iee,apS:nF,apSW:bee,apSecond:KN,apSecondW:oee,apW:AN,bimap:s0,bind:tF,bindTo:gee,bindW:yee,chain:Lr,chainFirst:VN,chainFirstW:aee,chainNullableK:pee,chainOptionK:lee,chainW:a0,duplicate:see,either:Iee,elem:eF,exists:mee,extend:c0,filterOrElse:GN,filterOrElseW:fee,flap:ree,flatten:uee,flattenW:HN,fold:d0,foldMap:WN,foldW:BN,fromNullable:h0,fromNullableK:XN,fromOption:UN,fromOptionK:cee,fromPredicate:tee,getAltValidation:kN,getApplicativeValidation:ja,getApplyMonoid:wee,getApplySemigroup:Oee,getCompactable:is,getEq:KQ,getFilterable:al,getOrElse:nee,getOrElseW:p0,getSemigroup:Nd,getShow:zQ,getValidation:Ree,getValidationMonoid:Eee,getValidationSemigroup:Cee,getWitherable:VQ,isLeft:le,isRight:l0,left:Tt,map:as,mapLeft:Wd,match:qa,matchW:f0,of:Zi,orElse:ZN,orElseW:JN,parseJSON:$ee,reduce:PN,reduceRight:LN,right:Ye,sequence:Pd,sequenceArray:See,stringifyJSON:Tee,swap:YN,throwError:Nv,toError:hee,toUnion:QN,traverse:jN,traverseArray:iF,traverseArrayWithIndex:_ee,traverseReadonlyArrayWithIndex:m0,traverseReadonlyNonEmptyArrayWithIndex:Ld,tryCatch:us,tryCatchK:dee},Symbol.toStringTag,{value:"Module"}));function ss(e){return V(Ye,e.of)}function cl(e){return V(Tt,e.of)}function ll(e){return function(t){return e.map(t,Ye)}}function fl(e){return function(t){return e.map(t,Tt)}}function Fv(e){return function(t){return V(h0(t),e.of)}}function Pv(e){var t=Fv(e);return function(n){var r=t(n);return function(i){return V(i,r)}}}function v0(e){var t=cs(e),n=Pv(e);return function(r){var i=n(r);return function(o){return t(i(o))}}}function dl(e){return Cc(e,Da)}function pl(e){return $o(e,ul)}function cs(e){return function(t){return function(n){return e.chain(n,function(r){return le(r)?e.of(r):t(r.right)})}}}function hl(e){return function(t){return function(n){return e.chain(n,function(r){return le(r)?t():e.of(r)})}}}function ml(e){return function(t,n){return function(r){return e.map(r,s0(t,n))}}}function vl(e){return function(t){return function(n){return e.map(n,Wd(t))}}}function jd(e,t){return function(n){return function(r){return e.chain(r,qa(function(i){return e.map(n(),Wd(function(o){return t.concat(i,o)}))},ss(e)))}}}function Dd(e){return function(t,n){return function(r){return e.map(r,qa(t,n))}}}function gl(e){return function(t,n){return function(r){return e.chain(r,qa(t,n))}}}function yl(e){return function(t){return function(n){return e.chain(n,qa(t,e.of))}}}function ls(e){return function(t){return function(n){return e.chain(n,function(r){return le(r)?t(r.left):e.of(r)})}}}function qd(e){var t=ls(e);return function(n){return t(function(r){return e.map(n(r),function(i){return le(i)?i:Tt(r)})})}}function Ud(e){return function(t){return function(n){return e.chain(n,qa(function(r){return e.map(t(r),Tt)},function(r){return e.of(Ye(r))}))}}}function bl(e){return function(t){return e.map(t,YN)}}function Bd(e){return function(t){return e.map(t,QN)}}function Mee(e){var t=pl(e),n=dl(e),r=cs(e),i=hl(e),o=ml(e),a=vl(e),u=gl(e),s=yl(e),c=ls(e);return{map:function(l,f){return y(l,n(f))},ap:function(l,f){return y(l,t(f))},of:ss(e),chain:function(l,f){return y(l,r(f))},alt:function(l,f){return y(l,i(f))},bimap:function(l,f,d){return y(l,o(f,d))},mapLeft:function(l,f){return y(l,a(f))},fold:function(l,f,d){return y(l,u(f,d))},getOrElse:function(l,f){return y(l,s(f))},orElse:function(l,f){return y(l,c(f))},swap:bl(e),rightM:ll(e),leftM:fl(e),left:cl(e)}}const xee=Object.freeze(Object.defineProperty({__proto__:null,alt:hl,altValidation:jd,ap:pl,bimap:ml,chain:cs,chainNullableK:v0,fromNullable:Fv,fromNullableK:Pv,getEitherM:Mee,getOrElse:yl,left:cl,leftF:fl,map:dl,mapLeft:vl,match:Dd,matchE:gl,orElse:ls,orElseFirst:qd,orLeft:Ud,right:ss,rightF:ll,swap:bl,toUnion:Bd},Symbol.toStringTag,{value:"Module"}));var kee="Endomorphism",aF=function(){return{concat:function(e,t){return V(e,t)}}},uF=function(){return{concat:aF().concat,empty:D}};const Aee=Object.freeze(Object.defineProperty({__proto__:null,URI:kee,getMonoid:uF,getSemigroup:aF},Symbol.toStringTag,{value:"Module"})),Nee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function sF(e,t){var n=t.zero,r=function(i,o){return e.equals(o,n)?i:r(o,t.mod(i,o))};return r}function Fee(e,t){var n=t.zero,r=sF(e,t);return function(i,o){return e.equals(i,n)||e.equals(o,n)?n:t.div(t.mul(i,o),r(i,o))}}var Pee={add:function(e,t){return e+t},zero:0,mul:function(e,t){return e*t},one:1,sub:function(e,t){return e-t},degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const Wee=Object.freeze(Object.defineProperty({__proto__:null,fieldNumber:Pee,gcd:sF,lcm:Fee},Symbol.toStringTag,{value:"Module"}));function No(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filter(i,n)})}}}function Fo(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filterMap(i,n)})}}}function Ua(e,t){var n=No(e,t);return function(r){var i=n(wd(r)),o=n(r);return function(a){return Me(i(a),o(a))}}}function Ba(e,t){var n=Fo(e,t);return function(r){return function(i){return Me(y(i,n(function(o){return Tv(r(o))})),y(i,n(function(o){return Cd(r(o))})))}}}function Lee(e,t){var n=Ec(e,t).map,r=Ji(e,t),i=Ao(e,t,t),o=No(e,t),a=Fo(e,t),u=Ua(e,t),s=Ba(e,t);return{map:n,compact:r,separate:i,filter:function(c,l){return y(c,o(l))},filterMap:function(c,l){return y(c,a(l))},partition:function(c,l){return y(c,u(l))},partitionMap:function(c,l){return y(c,s(l))}}}const jee=Object.freeze(Object.defineProperty({__proto__:null,filter:No,filterMap:Fo,getFilterableComposition:Lee,partition:Ua,partitionMap:Ba},Symbol.toStringTag,{value:"Module"})),Dee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function cF(e,t){return function(n,r){return function(i){return e.reduce(i,n,function(o,a){return t.reduce(a,o,r)})}}}function lF(e,t){return function(n){var r=e.foldMap(n),i=t.foldMap(n);return function(o){return function(a){return r(a,function(u){return i(u,o)})}}}}function fF(e,t){return function(n,r){return function(i){return e.reduceRight(i,n,function(o,a){return t.reduceRight(o,a,r)})}}}function qee(e,t){return function(n,r){return function(i){return t.reduce(i,e.of(n),function(o,a){return e.chain(o,function(u){return r(u,a)})})}}}function Uee(e,t){return function(n,r){var i=function(o,a){var u=o.init,s=o.acc;return u?{init:!1,acc:a}:{init:!1,acc:e.concat(e.concat(s,n),a)}};return t.reduce(r,{init:!0,acc:e.empty},i).acc}}function dF(e){return function(t){return e.reduce(t,[],function(n,r){return n.push(r),n})}}function Bee(e,t){var n=function(i,o){return e.ap(e.map(i,Yn),o)},r=e.of(void 0);return function(i,o){return t.reduce(i,r,function(a,u){return n(a,o(u))})}}function zee(e,t){return function(n,r,i){return t.reduce(n,e.of(r),function(o,a){return e.chain(o,function(u){return i(u,a)})})}}var Kee=dF;function g0(e,t){var n=cF(e,t),r=lF(e,t),i=fF(e,t);return{reduce:function(o,a,u){return y(o,n(a,u))},foldMap:function(o){var a=r(o);return function(u,s){return y(u,a(s))}},reduceRight:function(o,a,u){return y(o,i(a,u))}}}const Vee=Object.freeze(Object.defineProperty({__proto__:null,foldM:zee,foldMap:lF,getFoldableComposition:g0,intercalate:Uee,reduce:cF,reduceM:qee,reduceRight:fF,toArray:Kee,toReadonlyArray:dF,traverse_:Bee},Symbol.toStringTag,{value:"Module"}));function pF(e,t){return function(n,r){return function(i){return e.reduceWithIndex(i,n,function(o,a,u){return t.reduceWithIndex(u,a,function(s,c,l){return r([o,s],c,l)})})}}}function hF(e,t){return function(n){var r=e.foldMapWithIndex(n),i=t.foldMapWithIndex(n);return function(o){return function(a){return r(a,function(u,s){return i(s,function(c,l){return o([u,c],l)})})}}}}function mF(e,t){return function(n,r){return function(i){return e.reduceRightWithIndex(i,n,function(o,a,u){return t.reduceRightWithIndex(a,u,function(s,c,l){return r([o,s],c,l)})})}}}function Hee(e,t){var n=g0(e,t),r=pF(e,t),i=hF(e,t),o=mF(e,t);return{reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(a,u,s){return y(a,r(u,s))},foldMapWithIndex:function(a){var u=i(a);return function(s,c){return y(s,u(c))}},reduceRightWithIndex:function(a,u,s){return y(a,o(u,s))}}}const Gee=Object.freeze(Object.defineProperty({__proto__:null,foldMapWithIndex:hF,getFoldableWithIndexComposition:Hee,reduceRightWithIndex:mF,reduceWithIndex:pF},Symbol.toStringTag,{value:"Module"}));function Xi(e){return function(t){return V(t,e.fromIO)}}function Po(e,t){return function(n){var r=V(n,e.fromIO);return function(i){return t.chain(i,r)}}}function Wo(e,t){var n=ft(t);return function(r){return n(V(r,e.fromIO))}}const Yee=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:Wo,chainIOK:Po,fromIOK:Xi},Symbol.toStringTag,{value:"Module"}));var vF=function(){return D},Jee=D,zd=function(e){return function(t){return function(n){return t(e(n))}}},Kd=function(e){return function(t){return e(t)(t)}},Zee=Kd,Lo=function(e,t){return y(e,fs(t))},Vd=function(e,t){return y(e,bF(t))},y0=function(e,t){return y(e,_F(t))},gF=function(e,t){return y(e,$F(t))},Wv=function(e,t,n){return y(e,TF(t,n))},fs=function(e){return function(t){return function(n){return e(t(n))}}},yF=function(e){return function(t){return function(n){return t(n)(e(n))}}},bF=yF,Qi=Yn,b0=function(e){return function(t){return function(n){return e(t(n))(n)}}},_F=b0,SF=b0(D),Xee=SF,$F=function(e){return function(t){return V(e,t)}},TF=function(e,t){return function(n){return function(r){return t(n(e(r)))}}},_0=function(){return D},S0=function(e){return function(t){var n=t[0],r=t[1];return[e(n),r]}},$0=function(e){return function(t){var n=t[0],r=t[1];return[n,e(r)]}},T0=function(e){return d0(function(t){return So(e(t))},Ye)},I0=function(e){return d0(Tt,function(t){return Ma(e(t))})},jr="Reader",sn={URI:jr,map:Lo},Qee=Ke(sn),O0={URI:jr,of:Qi},jo={URI:jr,map:Lo,ap:Vd},IF=Ct(jo),ete=IF,OF=Et(jo),tte=OF,wF={URI:jr,map:Lo,ap:Vd,of:Qi},w0={URI:jr,map:Lo,ap:Vd,chain:y0},Do={URI:jr,map:Lo,of:Qi,ap:Vd,chain:y0},CF=ft(w0),nte=CF,rte={URI:jr,map:Lo,promap:Wv},ite={URI:jr,compose:gF,id:_0},ote={URI:jr,map:Lo,promap:Wv,first:S0,second:$0},ate={URI:jr,map:Lo,promap:Wv,left:T0,right:I0},ute=wt(sn),EF=Mt(w0),ste=EF,cte=Qi(Yt),RF=Rt(jo),lte=RF,MF=Qi(rn),ds=function(e){return function(t){return function(n){for(var r=[e(0,dr(t))(n)],i=1;i<t.length;i++)r.push(e(i,t[i])(n));return r}}},C0=function(e){var t=ds(e);return function(n){return gt(n)?t(n):MF}},fte=C0,xF=function(e){return C0(function(t,n){return e(n)})},dte=xF(D),pte={URI:jr,map:Lo,of:Qi,ap:Vd,chain:y0,promap:Wv,compose:gF,id:_0,first:S0,second:$0,left:T0,right:I0},hte=Jt(jo),mte=Pr(wF);const vte=Object.freeze(Object.defineProperty({__proto__:null,ApT:MF,Applicative:wF,Apply:jo,Category:ite,Chain:w0,Choice:ate,Do:cte,Functor:sn,Monad:Do,Pointed:O0,Profunctor:rte,Strong:ote,URI:jr,ap:bF,apFirst:IF,apFirstW:ete,apS:RF,apSW:lte,apSecond:OF,apSecondW:tte,apW:yF,ask:vF,asks:Jee,asksReader:Zee,asksReaderW:Kd,bind:EF,bindTo:ute,bindW:ste,chain:_F,chainFirst:CF,chainFirstW:nte,chainW:b0,compose:$F,first:S0,flap:Qee,flatten:Xee,flattenW:SF,getMonoid:mte,getSemigroup:hte,id:_0,left:T0,local:zd,map:fs,of:Qi,promap:TF,reader:pte,right:I0,second:$0,sequenceArray:dte,traverseArray:xF,traverseArrayWithIndex:fte,traverseReadonlyArrayWithIndex:C0,traverseReadonlyNonEmptyArrayWithIndex:ds},Symbol.toStringTag,{value:"Module"}));function Hd(e){return function(){return e.fromReader(vF())}}function Gd(e){return e.fromReader}function ps(e){return function(t){return V(t,e.fromReader)}}function Yd(e,t){var n=ps(e);return function(r){return function(i){return t.chain(i,n(r))}}}function Jd(e,t){return V(ps(e),ft(t))}const gte=Object.freeze(Object.defineProperty({__proto__:null,ask:Hd,asks:Gd,chainFirstReaderK:Jd,chainReaderK:Yd,fromReaderK:ps},Symbol.toStringTag,{value:"Module"}));var kF=function(){return function(e){return[e,e]}},AF=function(e){return function(){return[void 0,e]}},NF=function(e){return function(t){return[void 0,e(t)]}},FF=function(e){return function(t){return[e(t),t]}},Zd=function(e,t){return y(e,WF(t))},Lv=function(e,t){return y(e,LF(t))},PF=function(e,t){return y(e,E0(t))},WF=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return[e(i),o]}}},LF=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1],a=e(o),u=a[0],s=a[1];return[i(u),s]}}},Xd=function(e){return function(t){return[e,t]}},E0=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return e(i)(o)}}},yte=E0(D),za="State",R0={URI:za,map:Zd},bte=Ke(R0),_te={URI:za,of:Xd},jv={URI:za,map:Zd,ap:Lv},Ste=Ct(jv),$te=Et(jv),Tte={URI:za,map:Zd,ap:Lv,of:Xd},M0={URI:za,map:Zd,ap:Lv,chain:PF},jF={URI:za,map:Zd,ap:Lv,of:Xd,chain:PF},Ite=ft(M0),Ote={URI:za,fromState:D},wte=function(e){return function(t){return t(e)[0]}},Cte=function(e){return function(t){return t(e)[1]}},Ete=wt(R0),Rte=Mt(M0),Mte=Rt(jv),DF=function(e){return function(t){return function(n){for(var r=e(0,dr(t))(n),i=r[0],o=r[1],a=[i],u=o,s=1;s<t.length;s++){var c=e(s,t[s])(u),l=c[0],f=c[1];a.push(l),u=f}return[a,u]}}},x0=function(e){var t=DF(e);return function(n){return gt(n)?t(n):Xd(rn)}},xte=x0,qF=function(e){return x0(function(t,n){return e(n)})},kte=qF(D),Ate=function(e,t){return e(t)[0]},Nte=function(e,t){return e(t)[1]},Fte=jF;const Pte=Object.freeze(Object.defineProperty({__proto__:null,Applicative:Tte,Apply:jv,Chain:M0,FromState:Ote,Functor:R0,Monad:jF,Pointed:_te,URI:za,ap:LF,apFirst:Ste,apS:Mte,apSecond:$te,bind:Rte,bindTo:Ete,chain:E0,chainFirst:Ite,evalState:Ate,evaluate:wte,execState:Nte,execute:Cte,flap:bte,flatten:yte,get:kF,gets:FF,map:WF,modify:NF,of:Xd,put:AF,sequenceArray:kte,state:Fte,traverseArray:qF,traverseArrayWithIndex:xte,traverseReadonlyArrayWithIndex:x0,traverseReadonlyNonEmptyArrayWithIndex:DF},Symbol.toStringTag,{value:"Module"}));function UF(e){return function(){return e.fromState(kF())}}function BF(e){return function(t){return e.fromState(AF(t))}}function zF(e){return V(NF,e.fromState)}function KF(e){return V(FF,e.fromState)}function k0(e){return function(t){return V(t,e.fromState)}}function VF(e,t){var n=k0(e);return function(r){return function(i){return t.chain(i,n(r))}}}const Wte=Object.freeze(Object.defineProperty({__proto__:null,chainStateK:VF,fromStateK:k0,get:UF,gets:KF,modify:zF,put:BF},Symbol.toStringTag,{value:"Module"}));function hs(e){return function(t){return V(t,e.fromTask)}}function _l(e,t){return function(n){var r=V(n,e.fromTask);return function(i){return t.chain(i,r)}}}function Sl(e,t){var n=ft(t);return function(r){return n(V(r,e.fromTask))}}const Lte=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:Sl,chainTaskK:_l,fromTaskK:hs},Symbol.toStringTag,{value:"Module"}));function HF(e){return function(t){return V(t,e.fromThese)}}const jte=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:HF},Symbol.toStringTag,{value:"Module"}));function GF(e,t){return function(n){return function(r){return e.mapWithIndex(r,function(i,o){return t.mapWithIndex(o,function(a,u){return n([i,a],u)})})}}}function Dte(e,t){var n=Ec(e,t).map,r=GF(e,t);return{map:n,mapWithIndex:function(i,o){return y(i,r(o))}}}const qte=Object.freeze(Object.defineProperty({__proto__:null,getFunctorWithIndexComposition:Dte,mapWithIndex:GF},Symbol.toStringTag,{value:"Module"})),Ute=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Bte=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),zte=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var eo=function(e,t){return y(e,QF(t))},$l=function(e,t){return y(e,eP(t))},Dv=function(e,t){return y(e,P0(t))},A0=function(e,t,n){return y(e,tP(t,n))},N0=function(e){return function(t,n){return y(t,nP()(n))}},F0=function(e,t,n){return y(e,rP(t,n))},YF=function(e,t){return y(e,aP())},JF=function(e,t){return y(e,W0(t))},ZF=function(e){var t=iP(e);return function(n,r){return y(n,t(r))}},XF=W$,QF=function(e){return function(t){return e(t)}},eP=function(e){return function(t){return t(e)}},Tl=D,P0=function(e){return function(t){return e(t)}},W0=function(e){return function(t){return e(t)}},L0=D,Kte=W0(D),Vte=P0(D),tP=function(e,t){return function(n){return t(e,n)}},nP=function(){return function(e){return function(t){return e(t)}}},rP=function(e,t){return function(n){return t(n,e)}},iP=function(e){return function(t){return function(n){return e.map(t(n),D)}}},j0=function(e){return function(t){return e.map(t,D)}},oP=function(){return D},aP=oP,br="Identity",Hte=D,Gte=D,D0={URI:br,map:eo},Yte=Ke(D0),Jte={URI:br,of:Tl},qv={URI:br,map:eo,ap:$l},Zte=Ct(qv),Xte=Et(qv),Qte={URI:br,map:eo,ap:$l,of:Tl},q0={URI:br,map:eo,ap:$l,chain:Dv},ene={URI:br,map:eo,ap:$l,of:Tl,chain:Dv},tne=ft(q0),nne={URI:br,reduce:A0,foldMap:N0,reduceRight:F0},rne={URI:br,map:eo,reduce:A0,foldMap:N0,reduceRight:F0,traverse:ZF,sequence:j0},ine={URI:br,map:eo,alt:YF},one={URI:br,map:eo,extend:JF,extract:L0},ane={URI:br,map:eo,ap:$l,chain:Dv,chainRec:XF},une=Tl(Yt),sne=wt(D0),cne=Mt(q0),lne=Rt(qv),fne={URI:br,map:eo,ap:$l,of:Tl,chain:Dv,reduce:A0,foldMap:N0,reduceRight:F0,traverse:ZF,sequence:j0,alt:YF,extract:L0,extend:JF,chainRec:XF};const dne=Object.freeze(Object.defineProperty({__proto__:null,Alt:ine,Applicative:Qte,Apply:qv,Chain:q0,ChainRec:ane,Comonad:one,Do:une,Foldable:nne,Functor:D0,Monad:ene,Pointed:Jte,Traversable:rne,URI:br,alt:aP,altW:oP,ap:eP,apFirst:Zte,apS:lne,apSecond:Xte,bind:cne,bindTo:sne,chain:P0,chainFirst:tne,duplicate:Kte,extend:W0,extract:L0,flap:Yte,flatten:Vte,foldMap:nP,getEq:Gte,getShow:Hte,identity:fne,map:QF,of:Tl,reduce:tP,reduceRight:rP,sequence:j0,traverse:iP},Symbol.toStringTag,{value:"Module"})),pne=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var qo=function(e,t){return function(){return t(e())}},Ka=function(e,t){return function(){return e()(t())}},Il=function(e,t){return function(){return t(e())()}},uP=function(e,t){return function(){for(var n=t(e)();n._tag==="Left";)n=t(n.left)();return n.right}},to=function(e){return function(t){return qo(t,e)}},hne=function(e){return function(t){return Ka(t,e)}},fi=Yn,U0=function(e){return function(t){return Il(t,e)}},mne=U0(D),di="IO",st={URI:di,map:qo},vne=Ke(st),no={URI:di,of:fi},Uo={URI:di,map:qo,ap:Ka},gne=Ct(Uo),yne=Et(Uo),sP={URI:di,map:qo,ap:Ka,of:fi},Uv={URI:di,map:qo,ap:Ka,chain:Il},Zn={URI:di,map:qo,ap:Ka,of:fi,chain:Il},bne=ft(Uv),B0=D,_ne={URI:di,map:qo,ap:Ka,of:fi,chain:Il,fromIO:B0},Sne={URI:di,map:qo,ap:Ka,chain:Il,chainRec:uP},$ne={URI:di,fromIO:D},Tne=fi(Yt),Ine=wt(st),One=Mt(Uv),wne=Rt(Uo),cP=fi(rn),Bv=function(e){return function(t){return function(){for(var n=[e(0,dr(t))()],r=1;r<t.length;r++)n.push(e(r,t[r])());return n}}},z0=function(e){var t=Bv(e);return function(n){return gt(n)?t(n):cP}},Cne=z0,lP=function(e){return z0(function(t,n){return e(n)})},Ene=lP(D),Rne={URI:di,map:qo,of:fi,ap:Ka,chain:Il,fromIO:B0,chainRec:uP},Mne=Jt(Uo),xne=Pr(sP);const kne=Object.freeze(Object.defineProperty({__proto__:null,ApT:cP,Applicative:sP,Apply:Uo,Chain:Uv,ChainRec:Sne,Do:Tne,FromIO:$ne,Functor:st,Monad:Zn,MonadIO:_ne,Pointed:no,URI:di,ap:hne,apFirst:gne,apS:wne,apSecond:yne,bind:One,bindTo:Ine,chain:U0,chainFirst:bne,flap:vne,flatten:mne,fromIO:B0,getMonoid:xne,getSemigroup:Mne,io:Rne,map:to,of:fi,sequenceArray:Ene,traverseArray:lP,traverseArrayWithIndex:Cne,traverseReadonlyArrayWithIndex:z0,traverseReadonlyNonEmptyArrayWithIndex:Bv},Symbol.toStringTag,{value:"Module"}));var fP=cl(no),dP=ss(no),pP=ll(st),Ane=fl(st),hP=fi,Qd=pP,mP=Dd(st),Nne=mP,K0=gl(Zn),Fne=K0,vP=K0,Pne=vP,gP=yl(Zn),Wne=gP,yP=function(e,t){return function(){return us(e,t)}},Lne=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return yP(function(){return e.apply(void 0,n)},t)}},jne=Bd(st),bP=ls(Zn),Dne=bP,V0=qd(Zn),qne=V0,Une=function(e){return V0(MP(e))},Bne=Ud(Zn),zne=bl(st),Xn=function(e,t){return y(e,Y0(t))},ms=function(e,t){return y(e,J0(t))},Kne=function(e,t){return y(e,zv(function(n){return y(t,Y0(n))}))},Ol=function(e,t){return y(e,zv(t))},H0=function(e,t,n){return y(e,SP(t,n))},G0=function(e,t){return y(e,$P(t))},_P=function(e,t){return y(e,Z0(t))},Y0=dl(st),SP=ml(st),$P=vl(st),J0=pl(Uo),Vne=J0,Dr=dP,zv=cs(Zn),Kv=zv,TP=Kv(D),Hne=TP,Z0=hl(Zn),Gne=Z0,Vv=fP,jt="IOEither";function IP(e){var t=$o(Uo,ja(e));return{URI:jt,_E:void 0,map:Xn,ap:function(n,r){return y(n,t(r))},of:Dr}}function OP(e){var t=jd(Zn,e);return{URI:jt,_E:void 0,map:Xn,alt:function(n,r){return y(n,t(r))}}}var wP=function(e){var t=is(e);return{URI:jt,_E:void 0,compact:Ji(st,t),separate:Ao(st,t,Da)}};function Yne(e){var t=al(e),n=wP(e),r=No(st,t),i=Fo(st,t),o=Ua(st,t),a=Ba(st,t);return{URI:jt,_E:void 0,map:Xn,compact:n.compact,separate:n.separate,filter:function(u,s){return y(u,r(s))},filterMap:function(u,s){return y(u,i(s))},partition:function(u,s){return y(u,o(s))},partitionMap:function(u,s){return y(u,a(s))}}}var X0={URI:jt,map:Xn},Jne=Ke(X0),Zne={URI:jt,of:Dr},Xne={URI:jt,bimap:H0,mapLeft:G0},ep={URI:jt,map:Xn,ap:ms},CP=Ct(ep),Qne=CP,EP=Et(ep),ere=EP,Q0={URI:jt,map:Xn,ap:ms,of:Dr},tre={URI:jt,map:Xn,ap:Kne,of:Dr},Bo={URI:jt,map:Xn,ap:ms,chain:Ol},nre={URI:jt,map:Xn,ap:ms,of:Dr,chain:Ol},RP=ft(Bo),rre=RP,ire={URI:jt,map:Xn,alt:_P},ore={URI:jt,map:Xn,ap:ms,of:Dr,chain:Ol,fromIO:Qd},are={URI:jt,map:Xn,ap:ms,of:Dr,chain:Ol,throwError:Vv},Hv={URI:jt,fromIO:Qd},MP=Xi(Hv),ure=Po(Hv,Bo),sre=Wo(Hv,Bo),zo={URI:jt,fromEither:hP},cre=Vi(zo),lre=Hi(zo),fre=Hu(zo,Bo),xP=wo(zo,Bo),dre=xP,kP=Co(zo,Bo),pre=kP,hre=Aa(zo),AP=Gu(zo,Bo),mre=AP,vre=gr(zo),gre=function(e,t,n){return NP(e,t,n)},NP=function(e,t,n){return y(e,Kv(function(r){return y(t(r),U0(function(i){return y(n(r,i),Kv(function(){return fi(i)}))}))}))},yre=Dr(Yt),bre=wt(X0),FP=Mt(Bo),_re=FP,PP=Rt(ep),Sre=PP,eT=Dr(rn),WP=function(e){return V(Bv(e),to(Ld(Jn)))},tT=function(e){var t=WP(e);return function(n){return gt(n)?t(n):eT}},LP=function(e){return function(t){return function(){var n=e(0,dr(t))();if(Gt(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i])();if(Gt(o))return o;r.push(o.right)}return Ma(r)}}},nT=function(e){var t=LP(e);return function(n){return gt(n)?t(n):eT}},$re=tT,jP=function(e){return tT(function(t,n){return e(n)})},Tre=jP(D),Ire=nT,DP=function(e){return nT(function(t,n){return e(n)})},Ore=DP(D),wre=Q0,Cre={URI:jt,bimap:H0,mapLeft:G0,map:Xn,of:Dr,ap:ms,chain:Ol,alt:_P,fromIO:Qd,throwError:Vv},Ere=Jt(ep),Rre=Pr(Q0),Mre=function(e){return Jt(Uo)(Nd(e))};function xre(e){var t=IP(e),n=OP(e);return{URI:jt,_E:void 0,map:Xn,ap:t.ap,of:Dr,chain:Ol,bimap:H0,mapLeft:G0,alt:n.alt,fromIO:Qd,throwError:Vv}}const kre=Object.freeze(Object.defineProperty({__proto__:null,Alt:ire,ApT:eT,Applicative:wre,ApplicativePar:Q0,ApplicativeSeq:tre,ApplyPar:ep,Bifunctor:Xne,Chain:Bo,Do:yre,FromEither:zo,FromIO:Hv,Functor:X0,Monad:nre,MonadIO:ore,MonadThrow:are,Pointed:Zne,URI:jt,alt:Z0,altW:Gne,ap:J0,apFirst:CP,apFirstW:Qne,apS:PP,apSW:Sre,apSecond:EP,apSecondW:ere,apW:Vne,bimap:SP,bind:FP,bindTo:bre,bindW:_re,bracket:gre,bracketW:NP,chain:zv,chainEitherK:xP,chainEitherKW:dre,chainFirst:RP,chainFirstEitherK:kP,chainFirstEitherKW:pre,chainFirstIOK:sre,chainFirstW:rre,chainIOK:ure,chainOptionK:fre,chainW:Kv,filterOrElse:AP,filterOrElseW:mre,flap:Jne,flatten:Hne,flattenW:TP,fold:Fne,foldW:Pne,fromEither:hP,fromEitherK:vre,fromIO:Qd,fromIOK:MP,fromOption:cre,fromOptionK:lre,fromPredicate:hre,getAltIOValidation:OP,getApplicativeIOValidation:IP,getApplyMonoid:Rre,getApplySemigroup:Ere,getCompactable:wP,getFilterable:Yne,getIOValidation:xre,getOrElse:gP,getOrElseW:Wne,getSemigroup:Mre,ioEither:Cre,left:fP,leftIO:Ane,map:Y0,mapLeft:$P,match:mP,matchE:K0,matchEW:vP,matchW:Nne,of:Dr,orElse:bP,orElseFirst:V0,orElseFirstIOK:Une,orElseFirstW:qne,orElseW:Dne,orLeft:Bne,right:dP,rightIO:pP,sequenceArray:Tre,sequenceSeqArray:Ore,swap:zne,throwError:Vv,toUnion:jne,traverseArray:jP,traverseArrayWithIndex:$re,traverseReadonlyArrayWithIndex:tT,traverseReadonlyArrayWithIndexSeq:nT,traverseReadonlyNonEmptyArrayWithIndex:WP,traverseReadonlyNonEmptyArrayWithIndexSeq:LP,traverseSeqArray:DP,traverseSeqArrayWithIndex:Ire,tryCatch:yP,tryCatchK:Lne},Symbol.toStringTag,{value:"Module"}));function tp(e){return V(_t,e.of)}function np(e){return Yn(e.of(ot))}function Gv(e){return function(t){return e.map(t,_t)}}function Yv(e){return V(ts,e.of)}function Jv(e){var t=Yv(e);return function(n){return V(n,t)}}function rT(e){var t=wl(e),n=Jv(e);return function(r){return t(n(r))}}function Zv(e){return function(t){return V(t,e.of)}}function iT(e){var t=wl(e),n=Zv(e);return function(r){return t(n(r))}}function oT(e){return function(t){return function(n){return e.of($v(t)(n))}}}function aT(e){return V(rl,e.of)}function uT(e){return function(t,n){return function(r){return e.map(r,xo(t,n))}}}function Xv(e){return function(t,n){return function(r){return e.chain(r,xo(t,n))}}}function Qv(e){return function(t){return function(n){return e.chain(n,xo(t,e.of))}}}function eg(e){return Cc(e,Qc)}function tg(e){return $o(e,el)}function wl(e){var t=np(e);return function(n){return function(r){return e.chain(r,xo(function(){return t()},n))}}}function ng(e){var t=tp(e);return function(n){return function(r){return e.chain(r,xo(n,t))}}}function Are(e){var t=tg(e),n=eg(e),r=wl(e),i=ng(e),o=Xv(e),a=Qv(e),u=np(e);return{map:function(s,c){return y(s,n(c))},ap:function(s,c){return y(s,t(c))},of:tp(e),chain:function(s,c){return y(s,r(c))},alt:function(s,c){return y(s,i(c))},fold:function(s,c,l){return y(s,o(c,l))},getOrElse:function(s,c){return y(s,a(c))},fromM:Gv(e),none:function(){return u()}}}const Nre=Object.freeze(Object.defineProperty({__proto__:null,alt:ng,ap:tg,chain:wl,chainNullableK:rT,chainOptionK:iT,fromEither:aT,fromF:Gv,fromNullable:Yv,fromNullableK:Jv,fromOptionK:Zv,fromPredicate:oT,getOptionM:Are,getOrElse:Qv,map:eg,match:uT,matchE:Xv,some:tp,zero:np},Symbol.toStringTag,{value:"Module"}));var qP=tp(no),Fre=oT(no),Pre=fi,UP=aT(no),sT=Gv(st),Wre=to(rl),BP=uT(st),Lre=BP,cT=Xv(Uv),jre=cT,Dre=cT,zP=Qv(Zn),qre=zP,Ure=to(mN),Bre=to(Q$),zre=Yv(no),Kre=Jv(no),Vre=rT(Zn),Hre=Zv(no),Gre=iT(Zn),KP=eg(st),VP=tg(Uo),Va=qP,lT=wl(Zn),Yre=lT(D),fT=ng(Zn),Jre=fT,rg=np(no),Zre=rg(),dT=Ji(st,es),pT=Ao(st,es,Qc),HP=No(st,Mo),GP=Fo(st,Mo),YP=Ua(st,Mo),JP=Ba(st,Mo),Ko=function(e,t){return y(e,KP(t))},Cl=function(e,t){return y(e,VP(t))},hT=function(e,t){return y(e,lT(t))},ZP=function(e,t){return y(e,fT(t))},Xre=function(e,t){return y(e,HP(t))},Qre=function(e,t){return y(e,GP(t))},eie=function(e,t){return y(e,YP(t))},tie=function(e,t){return y(e,JP(t))},Qn="IOOption",mT={URI:Qn,map:Ko},nie=Ke(mT),XP={URI:Qn,of:Va},ig={URI:Qn,map:Ko,ap:Cl},rie=Ct(ig),iie=Et(ig),oie={URI:Qn,map:Ko,ap:Cl,of:Va},vs={URI:Qn,map:Ko,ap:Cl,chain:hT},aie=ft(vs),uie={URI:Qn,map:Ko,alt:ZP},QP={URI:Qn,zero:rg},sie=qc(QP,XP),cie={URI:Qn,map:Ko,ap:Cl,of:Va,alt:ZP,zero:rg},lie={URI:Qn,map:Ko,ap:Cl,of:Va,chain:hT},fie={URI:Qn,map:Ko,ap:Cl,of:Va,chain:hT,fromIO:sT},die={URI:Qn,compact:dT,separate:pT},pie={URI:Qn,map:Ko,compact:dT,separate:pT,filter:Xre,filterMap:Qre,partition:eie,partitionMap:tie},og={URI:Qn,fromIO:sT},hie=Xi(og),mie=Po(og,vs),vie=Wo(og,vs),ag={URI:Qn,fromEither:UP},gie=gr(ag),yie=wo(ag,vs),bie=Co(ag,vs),_ie=Va(Yt),Sie=wt(mT),$ie=Mt(vs),Tie=Rt(ig),eW=Va(rn),tW=function(e){return V(Bv(e),to(kv(Jn)))},Iie=function(e){var t=tW(e);return function(n){return gt(n)?t(n):eW}};const Oie=Object.freeze(Object.defineProperty({__proto__:null,Alt:uie,Alternative:cie,ApT:eW,Applicative:oie,Apply:ig,Chain:vs,Compactable:die,Do:_ie,Filterable:pie,FromEither:ag,FromIO:og,Functor:mT,Monad:lie,MonadIO:fie,Pointed:XP,Zero:QP,alt:fT,altW:Jre,ap:VP,apFirst:rie,apS:Tie,apSecond:iie,bind:$ie,bindTo:Sie,chain:lT,chainEitherK:yie,chainFirst:aie,chainFirstEitherK:bie,chainFirstIOK:vie,chainIOK:mie,chainNullableK:Vre,chainOptionK:Gre,compact:dT,filter:HP,filterMap:GP,flap:nie,flatten:Yre,fold:jre,fromEither:UP,fromEitherK:gie,fromIO:sT,fromIOEither:Wre,fromIOK:hie,fromNullable:zre,fromNullableK:Kre,fromOption:Pre,fromOptionK:Hre,fromPredicate:Fre,getOrElse:zP,getOrElseW:qre,guard:sie,map:KP,match:BP,matchE:cT,matchEW:Dre,matchW:Lre,none:Zre,of:Va,partition:YP,partitionMap:JP,separate:pT,some:qP,toNullable:Bre,toUndefined:Ure,traverseReadonlyArrayWithIndex:Iie,traverseReadonlyNonEmptyArrayWithIndex:tW,zero:rg},Symbol.toStringTag,{value:"Module"}));var nW=function(){function e(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 e.prototype.write=function(t){var n=this;return function(){n.value=t}},e.prototype.modify=function(t){var n=this;return function(){n.value=t(n.value)}},e}();function wie(e){return function(){return new nW(e)}}const Cie=Object.freeze(Object.defineProperty({__proto__:null,IORef:nW,newIORef:wie},Symbol.toStringTag,{value:"Module"})),Eie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Rie=function(e){return us(function(){return JSON.parse(e)},D)},Mie=function(e){return us(function(){var t=JSON.stringify(e);if(typeof t!="string")throw new Error("Converting unsupported structure to JSON");return t},D)};const xie=Object.freeze(Object.defineProperty({__proto__:null,parse:Rie,stringify:Mie},Symbol.toStringTag,{value:"Module"})),kie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Aie=function(e){return new Map(e)};function Nie(e){return new Map(e)}function rW(e,t){return{show:function(n){var r=[];return n.forEach(function(i,o){r.push("[".concat(e.show(o),", ").concat(t.show(i),"]"))}),"new Map([".concat(r.sort().join(", "),"])")}}}var iW=function(e){return e.size},ro=function(e){return e.size===0};function ug(e){var t=gs(e);return function(n,r){if(r===void 0){var i=ug(e);return function(o){return i(n,o)}}return bt(t(n,r))}}function vT(e){return function(t,n){if(n===void 0){var r=vT(e);return function(u){return r(t,u)}}for(var i=n.values(),o;!(o=i.next()).done;){var a=o.value;if(e.equals(t,a))return!0}return!1}}var El=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},Fie=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function oW(e){var t=El(e);return function(n){return function(r){for(var i=[],o=t(r),a=0,u=o;a<u.length;a++){var s=u[a];i.push(n(s,r.get(s)))}return i}}}var aW=function(e){return oW(e)(function(t,n){return[t,n]})};function Pie(e,t){var n=aW(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?pe([i[a],a+1]):be})}}var uW=function(e){var t=Vo(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(Wt(a)){var u=new Map(o);return u.set(n,r),u}else if(a.value[1]!==r){var u=new Map(o);return u.set(a.value[0],r),u}return o}}},sW=function(e){var t=Vo(e);return function(n){return function(r){var i=t(n,r);if(bt(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},Wie=function(e){var t=cW(e);return function(n,r){return t(n,function(){return r})}},cW=function(e){var t=Vo(e);return function(n,r){return function(i){var o=t(n,i);if(Wt(o))return be;var a=o.value,u=a[0],s=a[1],c=r(s);if(c===s)return pe(i);var l=new Map(i);return l.set(u,c),pe(l)}}};function Lie(e){var t=gs(e),n=sW(e);return function(r){var i=n(r);return function(o){return y(t(r,o),Yi(function(a){return[a,i(o)]}))}}}function Vo(e){return function(t,n){if(n===void 0){var r=Vo(e);return function(c){return r(t,c)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];if(e.equals(u,t))return pe([u,s])}return be}}function gs(e){var t=Vo(e);return function(n,r){if(r===void 0){var i=gs(e);return function(o){return i(n,o)}}return y(t(n,r),Yi(function(o){o[0];var a=o[1];return a}))}}function sg(e,t){var n=Vo(e);return function(r,i){if(i===void 0){var o=sg(e,t);return function(d){return o(d,r)}}for(var a=r.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c,i);if(Wt(f)||!e.equals(c,f.value[0])||!t.equals(l,f.value[1]))return!1}return!0}}var cg=new Map;function lW(e,t){var n=sg(e,t);return Fr(function(r,i){return n(r,i)&&n(i,r)})}function jie(e,t){var n=Vo(e);return{concat:function(r,i){if(ro(r))return i;if(ro(i))return r;for(var o=new Map(r),a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c,r);bt(f)?o.set(f.value[0],t.concat(f.value[1],l)):o.set(c,l)}return o},empty:cg}}var Die=function(e,t){return new Map([[e,t]])};function qie(e,t,n){return function(r){var i=Vo(e);return n.reduce(r,new Map,function(o,a){var u=a[0],s=a[1],c=i(u,o);return bt(c)?o.set(c.value[0],t.concat(c.value[1],s)):o.set(u,s),o})}}var Rl=function(e,t){for(var n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];n.set(a,t(a,u))}return n},fW=function(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1],c=e(u,s);Gt(c)?n.set(u,c.left):r.set(u,c.right)}return Me(n,r)}};function dW(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];e(u,s)?r.set(u,s):n.set(u,s)}return Me(n,r)}}var pW=function(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1],s=e(a,u);bt(s)&&n.set(a,s.value)}return n}};function hW(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];e(a,u)&&n.set(a,u)}return n}}var Ho=function(e,t){return Rl(e,function(n,r){return t(r)})},rp=function(e,t){return mW(e,function(n,r){return t(r)})},ip=function(e,t){return vW(e,function(n,r){return t(r)})},op=function(e,t){return gW(e,function(n,r){return t(r)})},ap=function(e,t){return yW(e,function(n,r){return t(r)})},mW=function(e,t){return y(e,hW(t))},vW=function(e,t){return y(e,pW(t))},gW=function(e,t){return y(e,dW(t))},yW=function(e,t){return y(e,fW(t))},Ml=function(e){for(var t=new Map,n=e.entries(),r;!(r=n.next()).done;){var i=r.value,o=i[0],a=i[1];bt(a)&&t.set(o,a.value)}return t},Uie=function(e){return function(t){return rp(t,e)}},Bie=function(e){return function(t){return ip(t,e)}},zie=function(e){return function(t){return Ho(t,e)}},Kie=function(e){return function(t){return Rl(t,e)}},Vie=function(e){return function(t){return op(t,e)}},Hie=function(e){return function(t){return ap(t,e)}},xl=function(e){for(var t=new Map,n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];Gt(u)?t.set(a,u.left):n.set(a,u.right)}return Me(t,n)},qr="ReadonlyMap",bW=function(e,t){var n=TT(e,t);return{concat:function(r,i){return n(i)(r)}}},Gie=function(e,t){return{concat:bW(e,t).concat,empty:cg}},Yie=function(e,t){var n=IT(e,t);return{concat:function(r,i){return n(i)(r)}}},Jie=function(e){return function(){var t=OT(e);return{concat:function(n,r){return t(r)(n)}}}};function Zie(){return{URI:qr,_E:void 0,map:Ho,mapWithIndex:Rl,compact:Ml,separate:xl,filter:rp,filterMap:ip,partition:op,partitionMap:ap,partitionMapWithIndex:yW,partitionWithIndex:gW,filterMapWithIndex:vW,filterWithIndex:mW}}var _W={URI:qr,map:Ho},Xie=Ke(_W),Qie=function(){return{URI:qr,_E:void 0,map:Ho,mapWithIndex:Rl}},gT={URI:qr,compact:Ml,separate:xl},eoe={URI:qr,map:Ho,compact:Ml,separate:xl,filter:rp,filterMap:ip,partition:op,partitionMap:ap},yT=function(e){var t=fg(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},bT=function(e){var t=dg(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}},_T=function(e){var t=pg(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},lg=function(e){var t=yT(e),n=bT(e),r=_T(e);return{URI:qr,_E:void 0,reduce:function(i,o,a){return y(i,t(o,a))},foldMap:function(i){var o=n(i);return function(a,u){return y(a,o(u))}},reduceRight:function(i,o,a){return y(i,r(o,a))}}},fg=function(e){var t=El(e);return function(n,r){return function(i){for(var o=n,a=0,u=t(i);a<u.length;a++){var s=u[a];o=r(s,o,i.get(s))}return o}}},dg=function(e){var t=El(e);return function(n){return function(r){return function(i){for(var o=n.empty,a=0,u=t(i);a<u.length;a++){var s=u[a];o=n.concat(o,r(s,i.get(s)))}return o}}}},pg=function(e){var t=El(e);return function(n,r){return function(i){for(var o=n,a=t(i),u=a.length,s=u-1;s>=0;s--){var c=a[s];o=r(c,i.get(c),o)}return o}}},ST=function(e){var t=lg(e),n=fg(e),r=dg(e),i=pg(e);return{URI:qr,_E:void 0,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:function(o,a,u){return y(o,n(a,u))},foldMapWithIndex:function(o){var a=r(o);return function(u,s){return y(u,a(s))}},reduceRightWithIndex:function(o,a,u){return y(o,i(a,u))}}},toe=function(e){var t=$T(e),n=lg(e);return{URI:qr,_E:void 0,map:Ho,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:t.traverse,sequence:t.sequence}},$T=function(e){var t=ST(e),n=El(e),r=function(a){return function(u,s){for(var c=a.of(new Map),l=n(u),f=l.length,d=function(h){var v=l[h],m=u.get(v);c=a.ap(a.map(c,function(_){return function(g){return _.set(v,g)}}),s(v,m))},p=0;p<f;p++)d(p);return c}},i=function(a){var u=r(a);return function(s,c){return u(s,function(l,f){return c(f)})}},o=function(a){var u=r(a);return function(s){return u(s,Jn)}};return{URI:qr,_E:void 0,map:Ho,mapWithIndex:Rl,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:i,sequence:o,traverseWithIndex:r}};function noe(e){var t=$T(e);return{URI:qr,_E:void 0,map:Ho,compact:Ml,separate:xl,filter:rp,filterMap:ip,partition:op,partitionMap:ap,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:Rl,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:oi(t,gT),wither:ai(t,gT)}}var TT=function(e,t){var n=gs(e);return function(r){return function(i){if(ro(i))return r;if(ro(r))return i;for(var o=new Map,a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c)(r);bt(f)?o.set(c,t.concat(l,f.value)):o.set(c,l)}for(var d=r.entries();!(u=d.next()).done;){var p=u.value,c=p[0],l=p[1],f=n(c)(o);Wt(f)&&o.set(c,l)}return o}}},IT=function(e,t){var n=gs(e);return function(r){return function(i){if(ro(i)||ro(r))return cg;for(var o=new Map,a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c)(r);bt(f)&&o.set(c,t.concat(l,f.value))}return o}}},OT=function(e){var t=ug(e);return function(n){return function(r){if(ro(r))return n;if(ro(n))return r;for(var i=new Map,o=r.entries(),a;!(a=o.next()).done;){var u=a.value,s=u[0],c=u[1];t(s)(n)||i.set(s,c)}for(var l=n.entries();!(a=l.next()).done;){var f=a.value,s=f[0],c=f[1];t(s)(r)||i.set(s,c)}return i}}},roe=uW,ioe={URI:qr,map:Ho,compact:Ml,separate:xl,filter:rp,filterMap:ip,partition:op,partitionMap:ap};const ooe=Object.freeze(Object.defineProperty({__proto__:null,Compactable:gT,Filterable:eoe,Functor:_W,URI:qr,collect:oW,compact:Ml,deleteAt:sW,difference:OT,elem:vT,empty:cg,filter:Uie,filterMap:Bie,filterMapWithIndex:pW,filterWithIndex:hW,flap:Xie,foldMap:bT,foldMapWithIndex:dg,fromFoldable:qie,fromMap:Aie,getDifferenceMagma:Jie,getEq:lW,getFilterableWithIndex:Zie,getFoldable:lg,getFoldableWithIndex:ST,getFunctorWithIndex:Qie,getIntersectionSemigroup:Yie,getMonoid:jie,getShow:rW,getTraversable:toe,getTraversableWithIndex:$T,getUnionMonoid:Gie,getUnionSemigroup:bW,getWitherable:noe,insertAt:roe,intersection:IT,isEmpty:ro,isSubmap:sg,keys:El,lookup:gs,lookupWithKey:Vo,map:zie,mapWithIndex:Kie,member:ug,modifyAt:cW,partition:Vie,partitionMap:Hie,partitionMapWithIndex:fW,partitionWithIndex:dW,pop:Lie,readonlyMap:ioe,reduce:yT,reduceRight:_T,reduceRightWithIndex:pg,reduceWithIndex:fg,separate:xl,singleton:Die,size:iW,toMap:Nie,toReadonlyArray:aW,toUnfoldable:Pie,union:TT,updateAt:Wie,upsertAt:uW,values:Fie},Symbol.toStringTag,{value:"Module"}));var kl=globalThis&&globalThis.__assign||function(){return kl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},kl.apply(this,arguments)},aoe=rW,uoe=iW,Go=ro,soe=ug,coe=vT,wT=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},loe=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function SW(e){var t=wT(e);return function(n){return function(r){for(var i=[],o=t(r),a=0,u=o;a<u.length;a++){var s=u[a];i.push(n(s,r.get(s)))}return i}}}function $W(e){return SW(e)(function(t,n){return[t,n]})}function foe(e,t){var n=$W(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?pe([i[a],a+1]):be})}}var TW=function(e){var t=ys(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(Wt(a)){var u=new Map(o);return u.set(n,r),u}else if(a.value[1]!==r){var u=new Map(o);return u.set(a.value[0],r),u}return o}}},IW=function(e){var t=ys(e);return function(n){return function(r){var i=t(n,r);if(bt(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},doe=function(e){var t=OW(e);return function(n,r){return t(n,function(){return r})}},OW=function(e){var t=ys(e);return function(n,r){return function(i){var o=t(n,i);if(Wt(o))return be;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),pe(a)}}};function poe(e){var t=wW(e),n=IW(e);return function(r){var i=n(r);return function(o){return y(t(r,o),Yi(function(a){return[a,i(o)]}))}}}function ys(e){return function(t,n){if(n===void 0){var r=ys(e);return function(c){return r(t,c)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];if(e.equals(u,t))return pe([u,s])}return be}}var wW=gs,hoe=sg,moe=lW;function voe(e,t){var n=ys(e);return{concat:function(r,i){if(Go(r))return i;if(Go(i))return r;for(var o=new Map(r),a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c,r);bt(f)?o.set(f.value[0],t.concat(f.value[1],l)):o.set(c,l)}return o},empty:new Map}}var goe=function(e,t){return new Map([[e,t]])};function yoe(e,t,n){return function(r){var i=ys(e);return n.reduce(r,new Map,function(o,a){var u=a[0],s=a[1],c=i(u,o);return bt(c)?o.set(c.value[0],t.concat(c.value[1],s)):o.set(u,s),o})}}var up=function(e,t){for(var n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];n.set(a,t(a,u))}return n},CW=function(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1],c=e(u,s);Gt(c)?n.set(u,c.left):r.set(u,c.right)}return Me(n,r)}};function EW(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];e(u,s)?r.set(u,s):n.set(u,s)}return Me(n,r)}}var RW=function(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1],s=e(a,u);bt(s)&&n.set(a,s.value)}return n}};function MW(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];e(a,u)&&n.set(a,u)}return n}}var Al=function(e,t){return up(e,function(n,r){return t(r)})},hg=function(e,t){return xW(e,function(n,r){return t(r)})},mg=function(e,t){return kW(e,function(n,r){return t(r)})},vg=function(e,t){return AW(e,function(n,r){return t(r)})},gg=function(e,t){return NW(e,function(n,r){return t(r)})},xW=function(e,t){return y(e,MW(t))},kW=function(e,t){return y(e,RW(t))},AW=function(e,t){return y(e,EW(t))},NW=function(e,t){return y(e,CW(t))},sp=function(e){for(var t=new Map,n=e.entries(),r;!(r=n.next()).done;){var i=r.value,o=i[0],a=i[1];bt(a)&&t.set(o,a.value)}return t},boe=function(e){return function(t){return hg(t,e)}},_oe=function(e){return function(t){return mg(t,e)}},Soe=function(e){return function(t){return Al(t,e)}},$oe=function(e){return function(t){return up(t,e)}},Toe=function(e){return function(t){return vg(t,e)}},Ioe=function(e){return function(t){return gg(t,e)}},cp=function(e){for(var t=new Map,n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];Gt(u)?t.set(a,u.left):n.set(a,u.right)}return Me(t,n)},Yo="Map",FW=function(e,t){var n=DW(e,t);return{concat:function(r,i){return n(i)(r)}}},Ooe=function(e,t){return{concat:FW(e,t).concat,empty:new Map}},woe=function(e,t){var n=qW(e,t);return{concat:function(r,i){return n(i)(r)}}},Coe=function(e){return function(){var t=UW(e);return{concat:function(n,r){return t(r)(n)}}}};function Eoe(){return{URI:Yo,_E:void 0,map:Al,mapWithIndex:up,compact:sp,separate:cp,filter:hg,filterMap:mg,partition:vg,partitionMap:gg,partitionMapWithIndex:NW,partitionWithIndex:AW,filterMapWithIndex:kW,filterWithIndex:xW}}function Roe(e){var t=WW(e);return{URI:Yo,_E:void 0,map:Al,compact:sp,separate:cp,filter:hg,filterMap:mg,partition:vg,partitionMap:gg,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:up,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:oi(t,CT),wither:ai(t,CT)}}var Moe=yT,xoe=bT,koe=_T,Aoe=function(e){return kl(kl({},lg(e)),{URI:Yo})},Noe=fg,Foe=dg,Poe=pg,PW=function(e){return kl(kl({},ST(e)),{URI:Yo})},WW=function(e){var t=PW(e),n=wT(e),r=function(a){return function(u,s){for(var c=a.of(new Map),l=n(u),f=l.length,d=function(h){var v=l[h],m=u.get(v);c=a.ap(a.map(c,function(_){return function(g){return _.set(v,g)}}),s(v,m))},p=0;p<f;p++)d(p);return c}},i=function(a){var u=r(a);return function(s,c){return u(s,function(l,f){return c(f)})}},o=function(a){var u=r(a);return function(s){return u(s,function(c,l){return l})}};return{URI:Yo,_E:void 0,map:Al,mapWithIndex:up,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:i,sequence:o,traverseWithIndex:r}},LW={URI:Yo,map:Al},Woe=Ke(LW),CT={URI:Yo,compact:sp,separate:cp},jW={URI:Yo,map:Al,compact:sp,separate:cp,filter:hg,filterMap:mg,partition:vg,partitionMap:gg},yg=function(e){return new Map(e)},DW=function(e,t){var n=TT(e,t);return function(r){return function(i){return Go(i)?yg(r):Go(r)?yg(i):n(r)(i)}}},qW=function(e,t){var n=IT(e,t);return function(r){return function(i){return Go(i)||Go(r)?new Map:n(r)(i)}}},UW=function(e){var t=OT(e);return function(n){return function(r){return Go(r)?yg(n):Go(n)?yg(r):t(n)(r)}}},Loe=new Map,joe=TW,Doe=jW;const qoe=Object.freeze(Object.defineProperty({__proto__:null,Compactable:CT,Filterable:jW,Functor:LW,URI:Yo,collect:SW,compact:sp,deleteAt:IW,difference:UW,elem:coe,empty:Loe,filter:boe,filterMap:_oe,filterMapWithIndex:RW,filterWithIndex:MW,flap:Woe,foldMap:xoe,foldMapWithIndex:Foe,fromFoldable:yoe,getDifferenceMagma:Coe,getEq:moe,getFilterableWithIndex:Eoe,getFoldable:Aoe,getFoldableWithIndex:PW,getIntersectionSemigroup:woe,getMonoid:voe,getShow:aoe,getTraversableWithIndex:WW,getUnionMonoid:Ooe,getUnionSemigroup:FW,getWitherable:Roe,insertAt:joe,intersection:qW,isEmpty:Go,isSubmap:hoe,keys:wT,lookup:wW,lookupWithKey:ys,map:Soe,mapWithIndex:$oe,map_:Doe,member:soe,modifyAt:OW,partition:Toe,partitionMap:Ioe,partitionMapWithIndex:CW,partitionWithIndex:EW,pop:poe,reduce:Moe,reduceRight:koe,reduceRightWithIndex:Poe,reduceWithIndex:Noe,separate:cp,singleton:goe,size:uoe,toArray:$W,toUnfoldable:foe,union:DW,updateAt:doe,upsertAt:TW,values:loe},Symbol.toStringTag,{value:"Module"})),Uoe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Boe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),zoe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Koe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Voe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var BW=function(e){return{concat:cm(e).concat,empty:e.top}},zW=function(e){return{concat:lm(e).concat,empty:e.bottom}},ET=function(e){return{concat:S_(e).concat,empty:e.empty}},KW=function(e){var t={};for(var n in e)lt.call(e,n)&&(t[n]=e[n].empty);return{concat:$_(e).concat,empty:t}},VW=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:T_.apply(OM,e).concat,empty:e.map(function(n){return n.empty})}},HW=function(e){return O_(e)(e.empty)},Hoe={concat:bM.concat,empty:void 0},Goe=VW,Yoe=KW,Joe=ET,Zoe=zW,Xoe=BW,Qoe=HW,GW={concat:_M.concat,empty:!0},YW={concat:SM.concat,empty:!1},eae=VR,tae=function(){return ET(uF())},nae={concat:$M.concat,empty:""},rae={concat:TM.concat,empty:0},iae={concat:IM.concat,empty:1};const oae=Object.freeze(Object.defineProperty({__proto__:null,concatAll:HW,fold:Qoe,getDualMonoid:Joe,getEndomorphismMonoid:tae,getFunctionMonoid:eae,getJoinMonoid:Zoe,getMeetMonoid:Xoe,getStructMonoid:Yoe,getTupleMonoid:Goe,max:zW,min:BW,monoidAll:GW,monoidAny:YW,monoidProduct:iae,monoidString:nae,monoidSum:rae,monoidVoid:Hoe,reverse:ET,struct:KW,tuple:VW},Symbol.toStringTag,{value:"Module"})),aae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var JW=function(e,t,n){return function(r){return r===-1?e():r===0?t():n()}},uae=JW,ZW=function(e){return e===-1?1:e===1?-1:0},XW={equals:function(e,t){return e===t}},RT={concat:function(e,t){return e!==0?e:t}},QW={concat:RT.concat,empty:0},sae=function(e){return e<=-1?-1:e>=1?1:0},cae=ZW,lae=RT,fae=XW,dae=QW;const pae=Object.freeze(Object.defineProperty({__proto__:null,Eq:XW,Monoid:QW,Semigroup:RT,eqOrdering:fae,invert:cae,match:uae,matchW:JW,monoidOrdering:dae,reverse:ZW,semigroupOrdering:lae,sign:sae},Symbol.toStringTag,{value:"Module"}));var hae=function(e){return typeof e.map=="function"},mae=function(e){return typeof e.contramap=="function"},vae=function(e){return typeof e.mapWithIndex=="function"},gae=function(e){return typeof e.ap=="function"},yae=function(e){return typeof e.chain=="function"},bae=function(e){return typeof e.bimap=="function"},_ae=function(e){return typeof e.extend=="function"},Sae=function(e){return typeof e.reduce=="function"},$ae=function(e){return typeof e.reduceWithIndex=="function"},Tae=function(e){return typeof e.alt=="function"},Iae=function(e){return typeof e.compact=="function"},Oae=function(e){return typeof e.filter=="function"},wae=function(e){return typeof e.filterWithIndex=="function"},Cae=function(e){return typeof e.promap=="function"},Eae=function(e){return typeof e.compose=="function"},Rae=function(e){return typeof e.throwError=="function"};function Mae(e){var t={};if(hae(e)){var n=function(C){return function(O){return e.map(O,C)}};t.map=n}if(mae(e)){var r=function(C){return function(O){return e.contramap(O,C)}};t.contramap=r}if(vae(e)){var i=function(C){return function(O){return e.mapWithIndex(O,C)}};t.mapWithIndex=i}if(gae(e)){var o=function(C){return function(O){return e.ap(O,C)}},a=function(C){return function(O){return e.ap(e.map(O,function(F){return function(){return F}}),C)}};t.ap=o,t.apFirst=a,t.apSecond=function(C){return function(O){return e.ap(e.map(O,function(){return function(F){return F}}),C)}}}if(yae(e)){var u=function(C){return function(O){return e.chain(O,C)}},s=function(C){return function(O){return e.chain(O,function(F){return e.map(C(F),function(){return F})})}},c=function(C){return e.chain(C,D)};t.chain=u,t.chainFirst=s,t.flatten=c}if(bae(e)){var l=function(C,O){return function(F){return e.bimap(F,C,O)}},f=function(C){return function(O){return e.mapLeft(O,C)}};t.bimap=l,t.mapLeft=f}if(_ae(e)){var d=function(C){return function(O){return e.extend(O,C)}},p=function(C){return e.extend(C,D)};t.extend=d,t.duplicate=p}if(Sae(e)){var h=function(C,O){return function(F){return e.reduce(F,C,O)}},v=function(C){var O=e.foldMap(C);return function(F){return function(L){return O(L,F)}}},m=function(C,O){return function(F){return e.reduceRight(F,C,O)}};t.reduce=h,t.foldMap=v,t.reduceRight=m}if($ae(e)){var _=function(C,O){return function(F){return e.reduceWithIndex(F,C,O)}},g=function(C){var O=e.foldMapWithIndex(C);return function(F){return function(L){return O(L,F)}}},S=function(C,O){return function(F){return e.reduceRightWithIndex(F,C,O)}};t.reduceWithIndex=_,t.foldMapWithIndex=g,t.reduceRightWithIndex=S}if(Tae(e)){var b=function(C){return function(O){return e.alt(O,C)}};t.alt=b}if(Iae(e)&&(t.compact=e.compact,t.separate=e.separate),Oae(e)){var $=function(C){return function(O){return e.filter(O,C)}},T=function(C){return function(O){return e.filterMap(O,C)}},R=function(C){return function(O){return e.partition(O,C)}},E=function(C){return function(O){return e.partitionMap(O,C)}};t.filter=$,t.filterMap=T,t.partition=R,t.partitionMap=E}if(wae(e)){var q=function(C){return function(O){return e.filterWithIndex(O,C)}},Y=function(C){return function(O){return e.filterMapWithIndex(O,C)}},N=function(C){return function(O){return e.partitionWithIndex(O,C)}},Z=function(C){return function(O){return e.partitionMapWithIndex(O,C)}};t.filterWithIndex=q,t.filterMapWithIndex=Y,t.partitionWithIndex=N,t.partitionMapWithIndex=Z}if(Cae(e)){var ie=function(C,O){return function(F){return e.promap(F,C,O)}};t.promap=ie}if(Eae(e)){var J=function(C){return function(O){return e.compose(O,C)}};t.compose=J}if(Rae(e)){var ye=function(C){return function(O){return O._tag==="None"?e.throwError(C()):e.of(O.value)}},we=function(C){return C._tag==="Left"?e.throwError(C.left):e.of(C.right)},x=function(C,O){return function(F){return C(F)?e.of(F):e.throwError(O(F))}},k=function(C,O){return function(F){return e.chain(F,function(L){return C(L)?e.of(L):e.throwError(O(L))})}};t.fromOption=ye,t.fromEither=we,t.fromPredicate=x,t.filterOrElse=k}return t}var de=y;const xae=Object.freeze(Object.defineProperty({__proto__:null,pipe:de,pipeable:Mae},Symbol.toStringTag,{value:"Module"})),kae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Aae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var bg=function(){return Math.random()};function eL(e,t){return y(bg,to(function(n){return Math.floor((t-e+1)*n+e)}))}function Nae(e,t){return y(bg,to(function(n){return(t-e)*n+e}))}var Fae=y(bg,to(function(e){return e<.5})),Pae=function(e){return y(eL(0,e.length-1),to(function(t){return e[t]}))};const Wae=Object.freeze(Object.defineProperty({__proto__:null,random:bg,randomBool:Fae,randomElem:Pae,randomInt:eL,randomRange:Nae},Symbol.toStringTag,{value:"Module"}));var MT=cl(O0),tL=ss(O0),nL=ll(sn),Lae=fl(sn),rL=Qi,iL=nL,oL=Dd(sn),jae=oL,xT=gl(Do),Dae=xT,aL=xT,qae=aL,uL=yl(Do),Uae=uL,Bae=Bd(sn),zae=zd,sL=Kd,Kae=sL,cL=ls(Do),Vae=cL,lL=qd(Do),Hae=lL,Gae=Ud(Do),Yae=bl(sn),Ur=function(e,t){return y(e,dL(t))},kT=function(e,t,n){return y(e,pL(t,n))},AT=function(e,t){return y(e,hL(t))},Nl=function(e,t){return y(e,NT(t))},lp=function(e,t){return y(e,FT(t))},fL=function(e,t){return y(e,PT(t))},dL=dl(sn),pL=ml(sn),hL=vl(sn),NT=pl(jo),Jae=NT,io=tL,FT=cs(Do),mL=FT,vL=mL(D),Zae=vL,PT=hl(Do),Xae=PT,WT=MT,Zt="ReaderEither",gL=function(e){var t=is(e);return{URI:Zt,_E:void 0,compact:Ji(sn,t),separate:Ao(sn,t,Da)}};function Qae(e){var t=al(e),n=gL(e),r=No(sn,t),i=Fo(sn,t),o=Ua(sn,t),a=Ba(sn,t);return{URI:Zt,_E:void 0,map:Ur,compact:n.compact,separate:n.separate,filter:function(u,s){return y(u,r(s))},filterMap:function(u,s){return y(u,i(s))},partition:function(u,s){return y(u,o(s))},partitionMap:function(u,s){return y(u,a(s))}}}function yL(e){var t=$o(jo,ja(e));return{URI:Zt,_E:void 0,map:Ur,ap:function(n,r){return y(n,t(r))},of:io}}function bL(e){var t=jd(Do,e);return{URI:Zt,_E:void 0,map:Ur,alt:function(n,r){return y(n,t(r))}}}var LT={URI:Zt,map:Ur},eue=Ke(LT),tue={URI:Zt,of:io},fp={URI:Zt,map:Ur,ap:Nl},_L=Ct(fp),nue=_L,SL=Et(fp),rue=SL,$L={URI:Zt,map:Ur,ap:Nl,of:io},Jo={URI:Zt,map:Ur,ap:Nl,chain:lp},iue={URI:Zt,map:Ur,ap:Nl,of:io,chain:lp},TL=ft(Jo),oue=TL,aue={URI:Zt,bimap:kT,mapLeft:AT},uue={URI:Zt,map:Ur,alt:fL},Fl={URI:Zt,fromReader:iL},sue=Hd(Fl),cue=Gd(Fl),lue=ps(Fl),IL=Yd(Fl,Jo),fue=IL,OL=Jd(Fl,Jo),due=OL,pue={URI:Zt,map:Ur,ap:Nl,of:io,chain:lp,throwError:WT},Zo={URI:Zt,fromEither:rL},hue=Vi(Zo),mue=Hi(Zo),vue=Hu(Zo,Jo),wL=wo(Zo,Jo),gue=wL,CL=Co(Zo,Jo),yue=CL,bue=Aa(Zo),EL=Gu(Zo,Jo),_ue=EL,Sue=gr(Zo),$ue=io(Yt),Tue=wt(LT),RL=Mt(Jo),Iue=RL,ML=Rt(fp),Oue=ML,xL=io(rn),kL=function(e){return V(ds(e),fs(Ld(Jn)))},jT=function(e){var t=kL(e);return function(n){return gt(n)?t(n):xL}},wue=jT,AL=function(e){return jT(function(t,n){return e(n)})},Cue=AL(D),Eue={URI:Zt,bimap:kT,mapLeft:AT,map:Ur,of:io,ap:Nl,chain:lp,alt:fL,throwError:MT},Rue=Jt(fp),Mue=Pr($L),xue=function(e){return Jt(jo)(Nd(e))};function kue(e){var t=yL(e),n=bL(e);return{URI:Zt,_E:void 0,map:Ur,ap:t.ap,of:io,chain:lp,bimap:kT,mapLeft:AT,alt:n.alt,throwError:WT}}const Aue=Object.freeze(Object.defineProperty({__proto__:null,Alt:uue,ApT:xL,Applicative:$L,Apply:fp,Bifunctor:aue,Chain:Jo,Do:$ue,FromEither:Zo,FromReader:Fl,Functor:LT,Monad:iue,MonadThrow:pue,Pointed:tue,URI:Zt,alt:PT,altW:Xae,ap:NT,apFirst:_L,apFirstW:nue,apS:ML,apSW:Oue,apSecond:SL,apSecondW:rue,apW:Jae,ask:sue,asks:cue,asksReaderEither:Kae,asksReaderEitherW:sL,bimap:pL,bind:RL,bindTo:Tue,bindW:Iue,chain:FT,chainEitherK:wL,chainEitherKW:gue,chainFirst:TL,chainFirstEitherK:CL,chainFirstEitherKW:yue,chainFirstReaderK:OL,chainFirstReaderKW:due,chainFirstW:oue,chainOptionK:vue,chainReaderK:IL,chainReaderKW:fue,chainW:mL,filterOrElse:EL,filterOrElseW:_ue,flap:eue,flatten:Zae,flattenW:vL,fold:Dae,foldW:qae,fromEither:rL,fromEitherK:Sue,fromOption:hue,fromOptionK:mue,fromPredicate:bue,fromReader:iL,fromReaderK:lue,getAltReaderValidation:bL,getApplicativeReaderValidation:yL,getApplyMonoid:Mue,getApplySemigroup:Rue,getCompactable:gL,getFilterable:Qae,getOrElse:uL,getOrElseW:Uae,getReaderValidation:kue,getSemigroup:xue,left:MT,leftReader:Lae,local:zae,map:dL,mapLeft:hL,match:oL,matchE:xT,matchEW:aL,matchW:jae,of:io,orElse:cL,orElseFirst:lL,orElseFirstW:Hae,orElseW:Vae,orLeft:Gae,readerEither:Eue,right:tL,rightReader:nL,sequenceArray:Cue,swap:Yae,throwError:WT,toUnion:Bae,traverseArray:AL,traverseArrayWithIndex:wue,traverseReadonlyArrayWithIndex:jT,traverseReadonlyNonEmptyArrayWithIndex:kL},Symbol.toStringTag,{value:"Module"}));function DT(e){return function(t){return function(){return e.of(t)}}}function qT(e){return function(t){return function(n){return function(r){return e.map(n(r),t)}}}}function UT(e){return function(t){return function(n){return function(r){return e.ap(n(r),t(r))}}}}function BT(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){return t(i)(r)})}}}}function zT(e){return function(t){return V(t,e.of)}}function Nue(e){return function(t){return V(t,e)}}function Fue(e){var t=UT(e),n=qT(e),r=BT(e);return{map:function(i,o){return y(i,n(o))},ap:function(i,o){return y(i,t(o))},of:DT(e),chain:function(i,o){return y(i,r(o))},ask:function(){return e.of},asks:function(i){return V(i,e.of)},local:function(i,o){return function(a){return i(o(a))}},fromReader:zT(e),fromM:function(i){return function(){return i}}}}const Pue=Object.freeze(Object.defineProperty({__proto__:null,ap:UT,chain:BT,fromNaturalTransformation:Nue,fromReader:zT,getReaderM:Fue,map:qT,of:DT},Symbol.toStringTag,{value:"Module"}));var Fn=function(e){return function(){return Promise.resolve().then(e)}};function Wue(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var pi=function(e,t){return y(e,Ha(t))},bs=function(e,t){return y(e,NL(t))},KT=function(e,t){return y(e,dp(function(n){return y(t,Ha(n))}))},Pl=function(e,t){return y(e,dp(t))},Ha=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},NL=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(n){var r=n[0],i=n[1];return r(i)})}}},In=function(e){return function(){return Promise.resolve(e)}},dp=function(e){return function(t){return function(){return Promise.resolve().then(t).then(function(n){return e(n)()})}}},Lue=dp(D),Pn="Task";function jue(){return{concat:function(e,t){return function(){return Promise.race([Promise.resolve().then(e),Promise.resolve().then(t)])}},empty:PL}}var De={URI:Pn,map:pi},Due=Ke(De),cn={URI:Pn,of:In},_s={URI:Pn,map:pi,ap:bs},que=Ct(_s),Uue=Et(_s),pp={URI:Pn,map:pi,ap:bs,of:In},_g={URI:Pn,map:pi,ap:KT},FL={URI:Pn,map:pi,ap:KT,of:In},Wl={URI:Pn,map:pi,ap:bs,chain:Pl},Xt={URI:Pn,map:pi,of:In,ap:bs,chain:Pl},Bue={URI:Pn,map:pi,of:In,ap:bs,chain:Pl,fromIO:Fn},hp=D,zue={URI:Pn,map:pi,of:In,ap:bs,chain:Pl,fromIO:Fn,fromTask:hp},Kue=ft(Wl),Sg={URI:Pn,fromIO:Fn},Vue=Xi(Sg),Hue=Po(Sg,Wl),Gue=Wo(Sg,Wl),Yue={URI:Pn,fromIO:Fn,fromTask:hp},PL=function(){return new Promise(function(e){})},Jue=In(Yt),Zue=wt(De),Xue=Mt(Wl),Que=Rt(_s),VT=In(rn),Ll=function(e){return function(t){return function(){return Promise.all(t.map(function(n,r){return Promise.resolve().then(function(){return e(r,n)()})}))}}},HT=function(e){var t=Ll(e);return function(n){return gt(n)?t(n):VT}},GT=function(e){return function(t){return function(){return Rc(t).reduce(function(n,r,i){return n.then(function(o){return Promise.resolve().then(e(i+1,r)).then(function(a){return o.push(a),o})})},Promise.resolve().then(e(0,dr(t))).then(Vf))}}},YT=function(e){var t=GT(e);return function(n){return gt(n)?t(n):VT}},ese=HT,WL=function(e){return HT(function(t,n){return e(n)})},tse=WL(D),nse=YT,LL=function(e){return YT(function(t,n){return e(n)})},rse=LL(D),ise={URI:Pn,map:pi,of:In,ap:bs,chain:Pl,fromIO:Fn,fromTask:hp},ose={URI:Pn,map:pi,of:In,ap:KT,chain:Pl,fromIO:Fn,fromTask:hp},ase=Jt(_g),use=Pr(FL);const sse=Object.freeze(Object.defineProperty({__proto__:null,ApT:VT,ApplicativePar:pp,ApplicativeSeq:FL,ApplyPar:_s,ApplySeq:_g,Chain:Wl,Do:Jue,FromIO:Sg,FromTask:Yue,Functor:De,Monad:Xt,MonadIO:Bue,MonadTask:zue,Pointed:cn,URI:Pn,ap:NL,apFirst:que,apS:Que,apSecond:Uue,bind:Xue,bindTo:Zue,chain:dp,chainFirst:Kue,chainFirstIOK:Gue,chainIOK:Hue,delay:Wue,flap:Due,flatten:Lue,fromIO:Fn,fromIOK:Vue,fromTask:hp,getMonoid:use,getRaceMonoid:jue,getSemigroup:ase,map:Ha,never:PL,of:In,sequenceArray:tse,sequenceSeqArray:rse,task:ise,taskSeq:ose,traverseArray:WL,traverseArrayWithIndex:ese,traverseReadonlyArrayWithIndex:HT,traverseReadonlyArrayWithIndexSeq:YT,traverseReadonlyNonEmptyArrayWithIndex:Ll,traverseReadonlyNonEmptyArrayWithIndexSeq:GT,traverseSeqArray:LL,traverseSeqArrayWithIndex:nse},Symbol.toStringTag,{value:"Module"}));var jL=zT(cn),jl=Qi,Ss=V(Fn,jl),cse=zd,DL=Kd,lse=DL,hi=function(e,t){return y(e,ZT(t))},$s=function(e,t){return y(e,XT(t))},JT=function(e,t){return y(e,$g(function(n){return y(t,ZT(n))}))},Dl=function(e,t){return y(e,$g(t))},ZT=qT(De),XT=UT(_s),fse=XT,Br=DT(cn),$g=BT(Xt),qL=$g,UL=qL(D),dse=UL,On="ReaderTask",ln={URI:On,map:hi},pse=Ke(ln),mp={URI:On,of:Br},vp={URI:On,map:hi,ap:$s},hse=Ct(vp),mse=Et(vp),vse={URI:On,map:hi,ap:$s,of:Br},QT={URI:On,map:hi,ap:JT},BL={URI:On,map:hi,ap:JT,of:Br},oo={URI:On,map:hi,ap:$s,chain:Dl},Xo={URI:On,map:hi,of:Br,ap:$s,chain:Dl},gse={URI:On,map:hi,of:Br,ap:$s,chain:Dl,fromIO:Ss},yse={URI:On,map:hi,of:Br,ap:$s,chain:Dl,fromIO:Ss,fromTask:jl},zL=ft(oo),bse=zL,Tg={URI:On,fromIO:Ss},_se=Xi(Tg),Sse=Po(Tg,oo),$se=Wo(Tg,oo),ql={URI:On,fromReader:jL},Tse=Hd(ql),Ise=Gd(ql),Ose=ps(ql),KL=Yd(ql,oo),wse=KL,VL=Jd(ql,oo),Cse=VL,Ig={URI:On,fromIO:Ss,fromTask:jl},Ese=hs(Ig),Rse=_l(Ig,oo),Mse=Sl(Ig,oo),xse=Br(Yt),kse=wt(ln),HL=Mt(oo),Ase=HL,GL=Rt(vp),Nse=GL,eI=Br(rn),YL=function(e){return V(ds(e),fs(Ll(Jn)))},tI=function(e){var t=YL(e);return function(n){return gt(n)?t(n):eI}},JL=function(e){return V(ds(e),fs(GT(Jn)))},nI=function(e){var t=JL(e);return function(n){return gt(n)?t(n):eI}},Fse=tI,ZL=function(e){return tI(function(t,n){return e(n)})},Pse=ZL(D),Wse=nI,XL=function(e){return nI(function(t,n){return e(n)})},Lse=XL(D),jse={URI:On,map:hi,of:Br,ap:$s,chain:Dl,fromIO:Ss,fromTask:jl},Dse={URI:On,map:hi,of:Br,ap:JT,chain:Dl,fromIO:Ss,fromTask:jl},qse=Jt(QT),Use=Pr(BL);function Bse(e,t){return e(t)()}const zse=Object.freeze(Object.defineProperty({__proto__:null,ApT:eI,ApplicativePar:vse,ApplicativeSeq:BL,ApplyPar:vp,ApplySeq:QT,Chain:oo,Do:xse,FromIO:Tg,FromReader:ql,FromTask:Ig,Functor:ln,Monad:Xo,MonadIO:gse,MonadTask:yse,Pointed:mp,URI:On,ap:XT,apFirst:hse,apS:GL,apSW:Nse,apSecond:mse,apW:fse,ask:Tse,asks:Ise,asksReaderTask:lse,asksReaderTaskW:DL,bind:HL,bindTo:kse,bindW:Ase,chain:$g,chainFirst:zL,chainFirstIOK:$se,chainFirstReaderK:VL,chainFirstReaderKW:Cse,chainFirstTaskK:Mse,chainFirstW:bse,chainIOK:Sse,chainReaderK:KL,chainReaderKW:wse,chainTaskK:Rse,chainW:qL,flap:pse,flatten:dse,flattenW:UL,fromIO:Ss,fromIOK:_se,fromReader:jL,fromReaderK:Ose,fromTask:jl,fromTaskK:Ese,getMonoid:Use,getSemigroup:qse,local:cse,map:ZT,of:Br,readerTask:jse,readerTaskSeq:Dse,run:Bse,sequenceArray:Pse,sequenceSeqArray:Lse,traverseArray:ZL,traverseArrayWithIndex:Fse,traverseReadonlyArrayWithIndex:tI,traverseReadonlyArrayWithIndexSeq:nI,traverseReadonlyNonEmptyArrayWithIndex:YL,traverseReadonlyNonEmptyArrayWithIndexSeq:JL,traverseSeqArray:XL,traverseSeqArrayWithIndex:Wse},Symbol.toStringTag,{value:"Module"}));var Kse=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(l){try{c(r.next(l))}catch(f){a(f)}}function s(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(u,s)}c((r=r.apply(e,t||[])).next())})},Vse=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(l){return s([c,l])}}function s(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},rI=cl(cn),iI=ss(cn),Og=ll(De),oI=fl(De),aI=V(Fn,Og),QL=V(Fn,oI),Ga=aI,Ul=Og,uI=In,sI=Fn,ej=function(e){return Ha(UN(e))},tj=Dd(De),Hse=tj,cI=gl(Xt),Gse=cI,nj=cI,Yse=nj,rj=yl(Xt),Jse=rj,ij=function(e,t){return function(){return Kse(void 0,void 0,void 0,function(){var n;return Vse(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(Ma)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,So(t(n))];case 3:return[2]}})})}},Zse=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return ij(function(){return e.apply(void 0,n)},t)}},Xse=Bd(De),Qse=Fv(cn),ece=Pv(cn),tce=v0(Xt),oj=ls(Xt),nce=oj,wg=qd(Xt),rce=wg,ice=function(e){return wg(Tj(e))},oce=function(e){return wg(Ij(e))},ace=Ud(Xt),uce=bl(De),aj=function(e){var t=ej(e);return function(n){return V(n,t)}},uj=function(e){return function(t){return function(n){return y(n,gp(aj(e)(t)))}}},sce=uj,sj=function(e){return V(e,sI)},cj=function(e){return yp(sj(e))},cce=cj,fn=function(e,t){return y(e,dI(t))},Ya=function(e,t){return y(e,pI(t))},lI=function(e,t){return y(e,gp(function(n){return y(t,dI(n))}))},Ja=function(e,t){return y(e,gp(t))},Cg=function(e,t,n){return y(e,lj(t,n))},Eg=function(e,t){return y(e,fj(t))},fI=function(e,t){return y(e,hI(t))},dI=dl(De),lj=ml(De),fj=vl(De),pI=pl(_s),lce=pI,gp=cs(Xt),yp=gp,dj=yp(D),fce=dj,hI=hl(Xt),dce=hI,er=iI,bp=rI,yt="TaskEither";function mI(e,t){var n=$o(e,ja(t));return{URI:yt,_E:void 0,map:fn,ap:function(r,i){return y(r,n(i))},of:er}}function pj(e){var t=jd(Xt,e);return{URI:yt,_E:void 0,map:fn,alt:function(n,r){return y(n,t(r))}}}var hj=function(e){var t=is(e);return{URI:yt,_E:void 0,compact:Ji(De,t),separate:Ao(De,t,Da)}};function pce(e){var t=al(e),n=hj(e),r=No(De,t),i=Fo(De,t),o=Ua(De,t),a=Ba(De,t);return{URI:yt,_E:void 0,map:fn,compact:n.compact,separate:n.separate,filter:function(u,s){return y(u,r(s))},filterMap:function(u,s){return y(u,i(s))},partition:function(u,s){return y(u,o(s))},partitionMap:function(u,s){return y(u,a(s))}}}var vI={URI:yt,map:fn},hce=Ke(vI),mce={URI:yt,of:er},Rg={URI:yt,map:fn,ap:Ya},mj=Ct(Rg),vce=mj,vj=Et(Rg),gce=vj,yce={URI:yt,map:fn,ap:Ya,of:er},gj={URI:yt,map:fn,ap:lI},yj={URI:yt,map:fn,ap:lI,of:er},mi={URI:yt,map:fn,ap:Ya,chain:Ja},bce={URI:yt,map:fn,ap:Ya,chain:Ja,of:er},_ce={URI:yt,map:fn,ap:Ya,chain:Ja,of:er,fromIO:Ga},Sce={URI:yt,map:fn,ap:Ya,chain:Ja,of:er,fromIO:Ga,fromTask:Ul},$ce={URI:yt,map:fn,ap:Ya,chain:Ja,of:er,throwError:bp},bj=ft(mi),Tce=bj,Ice={URI:yt,bimap:Cg,mapLeft:Eg},Oce={URI:yt,map:fn,alt:fI},Qo={URI:yt,fromEither:uI},wce=Vi(Qo),Cce=Hi(Qo),Ece=Hu(Qo,mi),_j=wo(Qo,mi),Rce=_j,Sj=Co(Qo,mi),Mce=Sj,xce=Aa(Qo),$j=Gu(Qo,mi),kce=$j,Ace=gr(Qo),Mg={URI:yt,fromIO:Ga},Tj=Xi(Mg),Nce=Po(Mg,mi),Fce=Wo(Mg,mi),xg={URI:yt,fromIO:Ga,fromTask:Ul},Ij=hs(xg),Pce=_l(xg,mi),Wce=Sl(xg,mi);function Lce(e){return function(){var t=Array.prototype.slice.call(arguments);return function(){return new Promise(function(n){var r=function(i,o){return i!=null?n(So(i)):n(Ma(o))};e.apply(null,t.concat(r))})}}}var jce=function(e,t,n){return gI(e,t,n)},gI=function(e,t,n){return y(e,yp(function(r){return y(t(r),dp(function(i){return y(n(r,i),yp(function(){return In(i)}))}))}))},Dce=er(Yt),qce=wt(vI),Oj=Mt(mi),Uce=Oj,wj=Rt(Rg),Bce=wj,yI=er(rn),bI=function(e){return V(Ll(e),Ha(Ld(Jn)))},_I=function(e){var t=bI(e);return function(n){return gt(n)?t(n):yI}},SI=function(e){return function(t){return function(){return Rc(t).reduce(function(n,r,i){return n.then(function(o){return Gt(o)?n:e(i+1,r)().then(function(a){return Gt(a)?a:(o.right.push(a.right),o)})})},e(0,dr(t))().then(as(Vf)))}}},$I=function(e){var t=SI(e);return function(n){return gt(n)?t(n):yI}},zce=_I,Cj=function(e){return _I(function(t,n){return e(n)})},Kce=Cj(D),Vce=$I,Ej=function(e){return $I(function(t,n){return e(n)})},Hce=Ej(D),Gce={URI:yt,bimap:Cg,mapLeft:Eg,map:fn,of:er,ap:Ya,chain:Ja,alt:fI,fromIO:Ga,fromTask:Ul,throwError:bp},Yce={URI:yt,bimap:Cg,mapLeft:Eg,map:fn,of:er,ap:lI,chain:Ja,alt:fI,fromIO:Ga,fromTask:Ul,throwError:bp},Jce=Jt(gj),Zce=Pr(yj),Xce=function(e){return Jt(_g)(Nd(e))};function Qce(e){var t=mI(pp,e),n=pj(e);return{URI:yt,_E:void 0,map:fn,ap:t.ap,of:er,chain:Ja,bimap:Cg,mapLeft:Eg,alt:n.alt,fromIO:Ga,fromTask:Ul,throwError:bp}}const ele=Object.freeze(Object.defineProperty({__proto__:null,Alt:Oce,ApT:yI,ApplicativePar:yce,ApplicativeSeq:yj,ApplyPar:Rg,ApplySeq:gj,Bifunctor:Ice,Chain:mi,Do:Dce,FromEither:Qo,FromIO:Mg,FromTask:xg,Functor:vI,Monad:bce,MonadIO:_ce,MonadTask:Sce,MonadThrow:$ce,Pointed:mce,URI:yt,alt:hI,altW:dce,ap:pI,apFirst:mj,apFirstW:vce,apS:wj,apSW:Bce,apSecond:vj,apSecondW:gce,apW:lce,bimap:lj,bind:Oj,bindTo:qce,bindW:Uce,bracket:jce,bracketW:gI,chain:gp,chainEitherK:_j,chainEitherKW:Rce,chainFirst:bj,chainFirstEitherK:Sj,chainFirstEitherKW:Mce,chainFirstIOK:Fce,chainFirstTaskK:Wce,chainFirstW:Tce,chainIOEitherK:cce,chainIOEitherKW:cj,chainIOK:Nce,chainNullableK:tce,chainOptionK:Ece,chainTaskK:Pce,chainTaskOptionK:sce,chainTaskOptionKW:uj,chainW:yp,filterOrElse:$j,filterOrElseW:kce,flap:hce,flatten:fce,flattenW:dj,fold:Gse,foldW:Yse,fromEither:uI,fromEitherK:Ace,fromIO:Ga,fromIOEither:sI,fromIOEitherK:sj,fromIOK:Tj,fromNullable:Qse,fromNullableK:ece,fromOption:wce,fromOptionK:Cce,fromPredicate:xce,fromTask:Ul,fromTaskK:Ij,fromTaskOption:ej,fromTaskOptionK:aj,getAltTaskValidation:pj,getApplicativeTaskValidation:mI,getApplyMonoid:Zce,getApplySemigroup:Jce,getCompactable:hj,getFilterable:pce,getOrElse:rj,getOrElseW:Jse,getSemigroup:Xce,getTaskValidation:Qce,left:rI,leftIO:QL,leftTask:oI,map:dI,mapLeft:fj,match:tj,matchE:cI,matchEW:nj,matchW:Hse,of:er,orElse:oj,orElseFirst:wg,orElseFirstIOK:ice,orElseFirstTaskK:oce,orElseFirstW:rce,orElseW:nce,orLeft:ace,right:iI,rightIO:aI,rightTask:Og,sequenceArray:Kce,sequenceSeqArray:Hce,swap:uce,taskEither:Gce,taskEitherSeq:Yce,taskify:Lce,throwError:bp,toUnion:Xse,traverseArray:Cj,traverseArrayWithIndex:zce,traverseReadonlyArrayWithIndex:_I,traverseReadonlyArrayWithIndexSeq:$I,traverseReadonlyNonEmptyArrayWithIndex:bI,traverseReadonlyNonEmptyArrayWithIndexSeq:SI,traverseSeqArray:Ej,traverseSeqArrayWithIndex:Vce,tryCatch:ij,tryCatchK:Zse},Symbol.toStringTag,{value:"Module"}));var Za=Qi,kg=cl(mp),TI=ss(mp),II=V(Og,Za),Rj=V(oI,Za),OI=function(e){return V(e,iI)},Mj=function(e){return V(e,rI)},xj=ll(ln),tle=fl(ln),wI=V(aI,Za),kj=V(QL,Za),Aj=Br,Nj=OI,Xa=wI,Bl=II,CI=V(sI,Za),EI=function(e){return V(e,uI)},Fj=Dd(ln),nle=Fj,RI=gl(oo),rle=RI,Pj=RI,ile=Pj,Wj=yl(Xo),ole=Wj,ale=Bd(ln),ule=Fv(mp),sle=Pv(mp),cle=v0(Xo),lle=zd,Lj=Kd,fle=Lj,jj=ls(Xo),dle=jj,Dj=qd(Xo),ple=Dj,hle=Ud(Xo),mle=bl(ln),qj=function(e){return V(e,CI)},Uj=function(e){return zl(qj(e))},vle=Uj,MI=function(e){return V(e,Za)},Bj=function(e){return zl(MI(e))},gle=Bj,zj=function(e){return Lg(MI(e))},yle=zj,xI=function(e){return V(e,EI)},Kj=function(e){return zl(xI(e))},ble=Kj,Vj=function(e){return Lg(xI(e))},_le=Vj,dn=function(e,t){return y(e,_p(t))},Qa=function(e,t){return y(e,PI(t))},kI=function(e,t){return y(e,Fg(function(n){return y(t,_p(n))}))},eu=function(e,t){return y(e,Fg(t))},AI=function(e,t){return y(e,Pg(t))},Ag=function(e,t,n){return y(e,NI(t,n))},Ng=function(e,t){return y(e,FI(t))},_p=dl(ln),NI=ml(ln),FI=vl(ln),PI=pl(vp),Sle=PI,tr=TI,Fg=cs(Xo),zl=Fg,Hj=zl(D),$le=Hj,Pg=hl(Xo),Gj=Pg,Sp=kg,ht="ReaderTaskEither",Yj=function(e){var t=is(e);return{URI:ht,_E:void 0,compact:Ji(ln,t),separate:Ao(ln,t,Da)}};function Tle(e){var t=al(e),n=Yj(e),r=No(ln,t),i=Fo(ln,t),o=Ua(ln,t),a=Ba(ln,t);return{URI:ht,_E:void 0,map:dn,compact:n.compact,separate:n.separate,filter:function(u,s){return y(u,r(s))},filterMap:function(u,s){return y(u,i(s))},partition:function(u,s){return y(u,o(s))},partitionMap:function(u,s){return y(u,a(s))}}}function Jj(e,t){var n=$o(jo,mI(e,t));return{URI:ht,_E:void 0,map:dn,ap:function(r,i){return y(r,n(i))},of:tr}}function Zj(e){var t=jd(Xo,e);return{URI:ht,_E:void 0,map:dn,alt:function(n,r){return y(n,t(r))}}}var Ts={URI:ht,map:dn},Ile=Ke(Ts),WI={URI:ht,of:tr},Wg={URI:ht,map:dn,ap:Qa},Xj=Ct(Wg),Ole=Xj,Qj=Et(Wg),wle=Qj,Cle={URI:ht,map:dn,ap:Qa,of:tr},eD={URI:ht,map:dn,ap:kI},tD={URI:ht,map:dn,ap:kI,of:tr},Wn={URI:ht,map:dn,ap:Qa,chain:eu},Ele={URI:ht,map:dn,ap:Qa,chain:eu,of:tr},Rle={URI:ht,map:dn,ap:Qa,chain:eu,of:tr,fromIO:Xa},Mle={URI:ht,map:dn,ap:Qa,chain:eu,of:tr,fromIO:Xa,fromTask:Bl},xle={URI:ht,map:dn,ap:Qa,chain:eu,of:tr,throwError:Sp},nD=ft(Wn),Lg=nD,kle={URI:ht,bimap:Ag,mapLeft:Ng},Ale={URI:ht,map:dn,alt:AI},Kl={URI:ht,fromReader:Nj},Nle=Hd(Kl),Fle=Gd(Kl),Ple=ps(Kl),rD=Yd(Kl,Wn),Wle=rD,iD=Jd(Kl,Wn),Lle=iD,LI=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return xj(e.apply(void 0,t))}},oD=function(e){return zl(LI(e))},jle=oD,aD=function(e){return Lg(LI(e))},Dle=aD,ea={URI:ht,fromEither:Aj},qle=Vi(ea),Ule=Hi(ea),Ble=Hu(ea,Wn),uD=wo(ea,Wn),zle=uD,sD=Co(ea,Wn),Kle=sD,Vle=Aa(ea),cD=Gu(ea,Wn),Hle=cD,Gle=gr(ea),jg={URI:ht,fromIO:Xa},Yle=Xi(jg),Jle=Po(jg,Wn),Zle=Wo(jg,Wn),Dg={URI:ht,fromIO:Xa,fromTask:Bl},Xle=hs(Dg),Qle=_l(Dg,Wn),efe=Sl(Dg,Wn);function tfe(e,t,n){return lD(e,t,n)}function lD(e,t,n){return function(r){return gI(e(r),function(i){return t(i)(r)},function(i,o){return n(i,o)(r)})}}var nfe=tr(Yt),rfe=wt(Ts),fD=Mt(Wn),ife=fD,dD=Rt(Wg),ofe=dD,jI=tr(rn),pD=function(e){return V(ds(e),fs(bI(Jn)))},DI=function(e){var t=pD(e);return function(n){return gt(n)?t(n):jI}},hD=function(e){return V(ds(e),fs(SI(Jn)))},qI=function(e){var t=hD(e);return function(n){return gt(n)?t(n):jI}},afe=DI,mD=function(e){return DI(function(t,n){return e(n)})},ufe=mD(D),sfe=qI,vD=function(e){return qI(function(t,n){return e(n)})},cfe=vD(D),lfe={URI:ht,map:dn,of:tr,ap:Qa,chain:eu,alt:AI,bimap:Ag,mapLeft:Ng,fromIO:Xa,fromTask:Bl,throwError:Sp},ffe={URI:ht,map:dn,of:tr,ap:kI,chain:eu,alt:AI,bimap:Ag,mapLeft:Ng,fromIO:Xa,fromTask:Bl,throwError:Sp},dfe=Jt(eD),pfe=Pr(tD),hfe=function(e){return Jt(QT)(Nd(e))};function mfe(e){var t=Jj(pp,e),n=Zj(e);return{URI:ht,_E:void 0,map:dn,of:tr,chain:eu,bimap:Ag,mapLeft:Ng,ap:t.ap,alt:n.alt,fromIO:Xa,fromTask:Bl,throwError:Sp}}function vfe(e,t){return e(t)()}const gfe=Object.freeze(Object.defineProperty({__proto__:null,Alt:Ale,ApT:jI,ApplicativePar:Cle,ApplicativeSeq:tD,ApplyPar:Wg,ApplySeq:eD,Bifunctor:kle,Chain:Wn,Do:nfe,FromEither:ea,FromIO:jg,FromReader:Kl,FromTask:Dg,Functor:Ts,Monad:Ele,MonadIO:Rle,MonadTask:Mle,MonadThrow:xle,Pointed:WI,URI:ht,alt:Pg,altW:Gj,ap:PI,apFirst:Xj,apFirstW:Ole,apS:dD,apSW:ofe,apSecond:Qj,apSecondW:wle,apW:Sle,ask:Nle,asks:Fle,asksReaderTaskEither:fle,asksReaderTaskEitherW:Lj,bimap:NI,bind:fD,bindTo:rfe,bindW:ife,bracket:tfe,bracketW:lD,chain:Fg,chainEitherK:uD,chainEitherKW:zle,chainFirst:nD,chainFirstEitherK:sD,chainFirstEitherKW:Kle,chainFirstIOK:Zle,chainFirstReaderEitherK:_le,chainFirstReaderEitherKW:Vj,chainFirstReaderK:iD,chainFirstReaderKW:Lle,chainFirstReaderTaskK:Dle,chainFirstReaderTaskKW:aD,chainFirstTaskEitherK:yle,chainFirstTaskEitherKW:zj,chainFirstTaskK:efe,chainFirstW:Lg,chainIOEitherK:vle,chainIOEitherKW:Uj,chainIOK:Jle,chainNullableK:cle,chainOptionK:Ble,chainReaderEitherK:ble,chainReaderEitherKW:Kj,chainReaderK:rD,chainReaderKW:Wle,chainReaderTaskK:jle,chainReaderTaskKW:oD,chainTaskEitherK:gle,chainTaskEitherKW:Bj,chainTaskK:Qle,chainW:zl,filterOrElse:cD,filterOrElseW:Hle,flap:Ile,flatten:$le,flattenW:Hj,fold:rle,foldW:ile,fromEither:Aj,fromEitherK:Gle,fromIO:Xa,fromIOEither:CI,fromIOEitherK:qj,fromIOK:Yle,fromNullable:ule,fromNullableK:sle,fromOption:qle,fromOptionK:Ule,fromPredicate:Vle,fromReader:Nj,fromReaderEither:EI,fromReaderEitherK:xI,fromReaderK:Ple,fromReaderTaskK:LI,fromTask:Bl,fromTaskEither:Za,fromTaskEitherK:MI,fromTaskK:Xle,getAltReaderTaskValidation:Zj,getApplicativeReaderTaskValidation:Jj,getApplyMonoid:pfe,getApplySemigroup:dfe,getCompactable:Yj,getFilterable:Tle,getOrElse:Wj,getOrElseW:ole,getReaderTaskValidation:mfe,getSemigroup:hfe,left:kg,leftIO:kj,leftReader:Mj,leftReaderTask:tle,leftTask:Rj,local:lle,map:_p,mapLeft:FI,match:Fj,matchE:RI,matchEW:Pj,matchW:nle,of:tr,orElse:jj,orElseFirst:Dj,orElseFirstW:ple,orElseW:dle,orLeft:hle,readerTaskEither:lfe,readerTaskEitherSeq:ffe,right:TI,rightIO:wI,rightReader:OI,rightReaderTask:xj,rightTask:II,run:vfe,sequenceArray:ufe,sequenceSeqArray:cfe,swap:mle,throwError:Sp,toUnion:ale,traverseArray:mD,traverseArrayWithIndex:afe,traverseReadonlyArrayWithIndex:DI,traverseReadonlyArrayWithIndexSeq:qI,traverseReadonlyNonEmptyArrayWithIndex:pD,traverseReadonlyNonEmptyArrayWithIndexSeq:hD,traverseSeqArray:vD,traverseSeqArrayWithIndex:sfe},Symbol.toStringTag,{value:"Module"}));var yfe=function(e){return new Set(e)},bfe=function(e){return new Set([e])},gD=function(e){return function(t){for(var n=t.length,r=new Set,i=pn(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}};function _fe(e){return new Set(e)}function Sfe(e){var t=pn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);t(a,i)||i.add(a)}),i}}}function $fe(e){var t=pn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){n(o).forEach(function(a){t(a,i)||i.add(a)})}),i}}}function UI(e){return function(t){for(var n=t.values(),r,i=new Set;!(r=n.next()).done;){var o=r.value;e(o)&&i.add(o)}return i}}function Tfe(e){return function(t){for(var n=t.values(),r,i=new Set,o=new Set;!(r=n.next()).done;){var a=r.value;e(a)?i.add(a):o.add(a)}return Me(o,i)}}function BI(e){var t=pn(e);return function(n,r){if(r===void 0){var i=BI(e);return function(a){return i(n,a)}}if($p(n))return r;if($p(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function zI(e){var t=pn(e);return function(n,r){if(r===void 0){var i=zI(e);return function(a){return i(a,n)}}if($p(n)||$p(r))return VI;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function Ife(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,u=new Set,s=pn(e),c=pn(t);!(o=i.next()).done;){var l=n(o.value);switch(l._tag){case"Left":s(l.left,a)||a.add(l.left);break;case"Right":c(l.right,u)||u.add(l.right);break}}return Me(a,u)}}}function KI(e){var t=pn(e);return function(n,r){if(r===void 0){var i=KI(e);return function(o){return i(o,n)}}return UI(function(o){return!t(o,r)})(n)}}function yD(e){var t=qg(e);return function(n,r){return function(i){return t(i).reduce(r,n)}}}function bD(e,t){var n=qg(e);return function(r){return function(i){return n(i).reduce(function(o,a){return t.concat(o,r(a))},t.empty)}}}var _D=function(e){var t=qg(e);return function(n,r){return function(i){return t(i).reduceRight(function(o,a){return r(a,o)},n)}}};function SD(e){var t=pn(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var $D=function(e){return function(t){return function(n){return UI(function(r){return!e.equals(t,r)})(n)}}},Ofe=function(e){var t=pn(e),n=$D(e),r=SD(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},wfe=function(e){return TD(e)(D)};function Cfe(e,t){return function(n){var r=pn(e),i=pn(t),o=new Set,a=new Set;return n.forEach(function(u){switch(u._tag){case"Left":r(u.left,o)||o.add(u.left);break;case"Right":i(u.right,a)||a.add(u.right);break}}),Me(o,a)}}function TD(e){var t=pn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);a._tag==="Some"&&!t(a.value,i)&&i.add(a.value)}),i}}}var VI=new Set,$p=function(e){return e.size===0},Efe=function(e){return e.size},HI=function(e){return function(t){for(var n=t.values(),r,i=!1;!i&&!(r=n.next()).done;)i=e(r.value);return i}};function GI(e){return wd(HI(wd(e)))}function Tp(e){var t=pn(e);return function(n,r){if(r===void 0){var i=Tp(e);return function(o){return i(o,n)}}return GI(function(o){return t(o,r)})(n)}}function pn(e){return function(t,n){if(n===void 0){var r=pn(e);return function(u){return r(t,u)}}for(var i=n.values(),o,a=!1;!a&&!(o=i.next()).done;)a=e.equals(t,o.value);return a}}var qg=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},Rfe="ReadonlySet";function ID(e){return{show:function(t){var n=[];return t.forEach(function(r){n.push(e.show(r))}),"new Set([".concat(n.sort().join(", "),"])")}}}function OD(e){var t=Tp(e);return Fr(function(n,r){return t(n,r)&&t(r,n)})}var wD=function(e){return{concat:BI(e)}},Mfe=function(e){return{concat:wD(e).concat,empty:VI}},xfe=function(e){return{concat:zI(e)}},kfe=function(e){return{concat:KI(e)}},Afe=gD;const Nfe=Object.freeze(Object.defineProperty({__proto__:null,URI:Rfe,chain:$fe,compact:wfe,difference:KI,elem:pn,empty:VI,every:GI,filter:UI,filterMap:TD,foldMap:bD,fromArray:Afe,fromReadonlyArray:gD,fromSet:yfe,getDifferenceMagma:kfe,getEq:OD,getIntersectionSemigroup:xfe,getShow:ID,getUnionMonoid:Mfe,getUnionSemigroup:wD,insert:SD,intersection:zI,isEmpty:$p,isSubset:Tp,map:Sfe,partition:Tfe,partitionMap:Ife,reduce:yD,reduceRight:_D,remove:$D,separate:Cfe,singleton:bfe,size:Efe,some:HI,toReadonlyArray:qg,toSet:_fe,toggle:Ofe,union:BI},Symbol.toStringTag,{value:"Module"}));function Qt(e){return e[0]}function wn(e){return e[1]}var Ffe=function(e){return[wn(e),Qt(e)]};function YI(e){return{URI:_r,_E:void 0,map:Ip,ap:function(t,n){return[Qt(t)(Qt(n)),e.concat(wn(t),wn(n))]}}}var CD=function(e){return function(t){return[t,e.empty]}};function Pfe(e){var t=YI(e);return{URI:_r,_E:void 0,map:t.map,ap:t.ap,of:CD(e)}}function JI(e){var t=YI(e);return{URI:_r,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(Qt(n)),o=i[0],a=i[1];return[o,e.concat(wn(n),a)]}}}function Wfe(e){var t=JI(e);return{URI:_r,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:CD(e)}}function Lfe(e){var t=function(r,i){for(var o=i(r),a=e.empty,u=Qt(o);u._tag==="Left";)a=e.concat(a,wn(o)),o=i(u.left),u=Qt(o);return[u.right,e.concat(a,wn(o))]},n=JI(e);return{URI:_r,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var ED=function(e,t){return y(e,ND(t))},Ip=function(e,t){return y(e,e1(t))},RD=function(e,t,n){return y(e,AD(t,n))},MD=function(e,t){return y(e,t1(t))},xD=function(e,t){return y(e,n1(t))},ZI=function(e,t,n){return y(e,r1(t,n))},XI=function(e){var t=i1();return function(n,r){return y(n,t(r))}},QI=function(e,t,n){return y(e,o1(t,n))},kD=function(e){var t=FD(e);return function(n,r){return y(n,t(r))}},AD=function(e,t){return function(n){return[t(Qt(n)),e(wn(n))]}},e1=function(e){return function(t){return[e(Qt(t)),wn(t)]}},t1=function(e){return function(t){return[Qt(t),e(wn(t))]}},ND=function(e){return function(t){return[Qt(t),wn(e)]}},n1=function(e){return function(t){return[e(t),wn(t)]}},Ug=Qt,jfe=n1(D),r1=function(e,t){return function(n){return t(e,Qt(n))}},i1=function(){return function(e){return function(t){return e(Qt(t))}}},o1=function(e,t){return function(n){return t(Qt(n),e)}},FD=function(e){return function(t){return function(n){return e.map(t(Qt(n)),function(r){return[r,wn(n)]})}}},a1=function(e){return function(t){return e.map(Qt(t),function(n){return[n,wn(t)]})}},_r="ReadonlyTuple",PD={URI:_r,map:Ip},Dfe=Ke(PD),qfe={URI:_r,bimap:RD,mapLeft:MD},Ufe={URI:_r,compose:ED},Bfe={URI:_r,map:Ip,extend:xD,extract:Ug},zfe={URI:_r,reduce:ZI,foldMap:XI,reduceRight:QI},Kfe={URI:_r,map:Ip,reduce:ZI,foldMap:XI,reduceRight:QI,traverse:kD,sequence:a1},Vfe=e1,Hfe=t1,Gfe={URI:_r,compose:ED,map:Ip,bimap:RD,mapLeft:MD,extract:Ug,extend:xD,reduce:ZI,foldMap:XI,reduceRight:QI,traverse:kD,sequence:a1};const Yfe=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:qfe,Comonad:Bfe,Foldable:zfe,Functor:PD,Semigroupoid:Ufe,Traversable:Kfe,URI:_r,bimap:AD,compose:ND,duplicate:jfe,extend:n1,extract:Ug,flap:Dfe,foldMap:i1,fst:Qt,getApplicative:Pfe,getApply:YI,getChain:JI,getChainRec:Lfe,getMonad:Wfe,map:Vfe,mapFst:e1,mapLeft:Hfe,mapSnd:t1,readonlyTuple:Gfe,reduce:r1,reduceRight:o1,sequence:a1,snd:wn,swap:Ffe,traverse:FD},Symbol.toStringTag,{value:"Module"}));var Vl=globalThis&&globalThis.__assign||function(){return Vl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Vl.apply(this,arguments)},Jfe=nx,Is=ui,u1=function(e){return function(t){return Object.keys(t).sort(e.compare)}},Zfe=u1(K);function s1(e){if(typeof e=="function")return s1(K)(e);var t=u1(e);return function(n){return function(r){for(var i=[],o=0,a=t(r);o<a.length;o++){var u=a[o];i.push(n(u,r[u]))}return i}}}var c1=s1(K)(function(e,t){return[e,t]});function Xfe(e){return function(t){var n=c1(t),r=n.length;return e.unfold(0,function(i){return i<r?pe([n[i],i+1]):be})}}var WD=X_,LD=To;function jD(e){return function(t){if(!lt.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var Qfe=function(e,t){return DD(e,function(){return t})},DD=function(e,t){return function(n){if(!LD(e,n))return be;var r=Object.assign({},n);return r[e]=t(n[e]),pe(r)}};function ede(e){var t=jD(e);return function(n){var r=qD(e,n);return Wt(r)?be:pe([r.value,t(n)])}}var tde=Rm,qD=Wu,nde=Mm,rde=Q_;function ide(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?Ac(e[0]):Ac(K).apply(void 0,e)}function ode(e){return"compare"in e?Nc(e):Nc(K)(e)}function ade(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?Fc(e[0]):Fc(K).apply(void 0,e)}var ude=rx;function sde(e){return ix(e)}function l1(e){return xm(e)}function Op(e){return Pc(e)}var cde=function(e){var t=l1(e);return function(n){return function(r){return e.map(y(r,t(n)),tu)}}},lde=function(e){var t=l1(e);return function(n){return function(r){return e.map(y(r,t(n)),nu)}}},fde=km;function dde(e){return Am(e)}var pde=Nm;function hde(e){return Fm(e)}function UD(e,t){return ox(e,t)}var mde=c1,vde=function(e){return UD(fm(),RA)(e)};function gde(e,t){return eS(e,t)}var yde=ax,bde=ux,_de=tS,BD=function(e){var t=nS(e);return function(n){return function(r){return Is(r)?Vl({},n):Is(n)?Vl({},r):t(n)(r)}}},zD=function(e){return function(t){return function(n){return Is(n)||Is(t)?{}:rS(e)(t)(n)}}},KD=function(e){return function(t){return Is(t)?Vl({},e):Is(e)?Vl({},t):iS(e)(t)}},vi=pr,wp=Lu,gi=hr,yi=mr,bi=vr,Cp=ju,Ep=Du,Rp=qu,Mp=Uu,xp=Bu,kp=zu,Ap=Ku,VD=Pm,HD=Wm,GD=Lm,YD=jm,Hl=Ki,JD=id,f1=function(e){return function(t){var n=u1(e);return function(r,i){var o=n(r);if(o.length===0)return t.of({});for(var a=t.of({}),u=function(f){a=t.ap(t.map(a,function(d){return function(p){return d[f]=p,d}}),i(f,r[f]))},s=0,c=o;s<c.length;s++){var l=c[s];u(l)}return a}}},Sde=oS,$de=aS,Tde=Dm,Ide=uS;function Ode(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?ad(e[0]):ad(K).apply(void 0,e)}function wde(e){return"compare"in e?ud(e):ud(K)(e)}function Cde(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?sd(e[0]):sd(K).apply(void 0,e)}var tu=Io,nu=Oo,hn="Record";function Ede(e){return"compare"in e?qm(e):qm(K)(e)}var Rde=sx,Mde=cx,ZD={URI:hn,map:vi},xde=Ke(ZD),kde={URI:hn,map:vi,mapWithIndex:wp},Ade=function(e){return{URI:hn,reduce:gi(e),foldMap:yi(e),reduceRight:bi(e)}},Nde=function(e){return{URI:hn,reduce:gi(e),foldMap:yi(e),reduceRight:bi(e),reduceWithIndex:xp(e),foldMapWithIndex:kp(e),reduceRightWithIndex:Ap(e)}},Np={URI:hn,compact:tu,separate:nu},Fde={URI:hn,map:vi,compact:tu,separate:nu,filter:Cp,filterMap:Ep,partition:Rp,partitionMap:Mp},Pde={URI:hn,map:vi,mapWithIndex:wp,compact:tu,separate:nu,filter:Cp,filterMap:Ep,partition:Rp,partitionMap:Mp,filterMapWithIndex:GD,filterWithIndex:YD,partitionMapWithIndex:VD,partitionWithIndex:HD},XD=function(e){return{URI:hn,map:vi,reduce:gi(e),foldMap:yi(e),reduceRight:bi(e),traverse:Hl(e),sequence:JD(e)}},Wde=function(e){return{URI:hn,map:vi,mapWithIndex:wp,reduce:gi(e),foldMap:yi(e),reduceRight:bi(e),reduceWithIndex:xp(e),foldMapWithIndex:kp(e),reduceRightWithIndex:Ap(e),traverse:Hl(e),sequence:JD(e),traverseWithIndex:f1(e)}},Lde=function(e){var t=XD(e);return{URI:hn,map:vi,reduce:gi(e),foldMap:yi(e),reduceRight:bi(e),traverse:t.traverse,sequence:t.sequence,compact:tu,separate:nu,filter:Cp,filterMap:Ep,partition:Rp,partitionMap:Mp,wither:ai(t,Np),wilt:oi(t,Np)}},QD=function(e){var t=BD(e);return{concat:function(n,r){return t(r)(n)}}},jde=function(e){return{concat:QD(e).concat,empty:{}}},Dde=function(e){var t=zD(e);return{concat:function(n,r){return t(r)(n)}}},qde=function(){return{concat:function(e,t){return KD(t)(e)}}},Ude={URI:hn,reduce:gi(K),foldMap:yi(K),reduceRight:bi(K)},Bde={URI:hn,reduce:gi(K),foldMap:yi(K),reduceRight:bi(K),reduceWithIndex:xp(K),foldMapWithIndex:kp(K),reduceRightWithIndex:Ap(K)},d1={URI:hn,map:vi,reduce:gi(K),foldMap:yi(K),reduceRight:bi(K),traverse:Hl(K),sequence:Op},zde={URI:hn,map:vi,mapWithIndex:wp,reduce:gi(K),foldMap:yi(K),reduceRight:bi(K),reduceWithIndex:xp(K),foldMapWithIndex:kp(K),reduceRightWithIndex:Ap(K),traverse:Hl(K),sequence:Op,traverseWithIndex:f1(K)},eq=ai(d1,Np),tq=oi(d1,Np),Kde={URI:hn,map:vi,reduce:gi(K),foldMap:yi(K),reduceRight:bi(K),traverse:Hl(K),sequence:Op,compact:tu,separate:nu,filter:Cp,filterMap:Ep,partition:Rp,partitionMap:Mp,wither:eq,wilt:tq},Vde={},Hde=WD,Gde=mx,Yde={URI:hn,map:vi,reduce:gi(K),foldMap:yi(K),reduceRight:bi(K),traverse:Hl(K),sequence:Op,compact:tu,separate:nu,filter:Cp,filterMap:Ep,partition:Rp,partitionMap:Mp,mapWithIndex:wp,reduceWithIndex:xp(K),foldMapWithIndex:kp(K),reduceRightWithIndex:Ap(K),filterMapWithIndex:GD,filterWithIndex:YD,partitionMapWithIndex:VD,partitionWithIndex:HD,traverseWithIndex:f1(K),wither:eq,wilt:tq};const Jde=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Np,Filterable:Fde,FilterableWithIndex:Pde,Foldable:Ude,FoldableWithIndex:Bde,Functor:ZD,FunctorWithIndex:kde,Traversable:d1,TraversableWithIndex:zde,URI:hn,Witherable:Kde,collect:s1,compact:tu,deleteAt:jD,difference:KD,elem:_de,empty:Vde,every:yde,filter:Sde,filterMap:$de,filterMapWithIndex:pde,filterWithIndex:hde,flap:xde,foldMap:wde,foldMapWithIndex:ode,fromEntries:vde,fromFoldable:UD,fromFoldableMap:gde,getDifferenceMagma:qde,getEq:Rde,getFoldable:Ade,getFoldableWithIndex:Nde,getIntersectionSemigroup:Dde,getMonoid:Mde,getShow:Ede,getTraversable:XD,getTraversableWithIndex:Wde,getUnionMonoid:jde,getUnionSemigroup:QD,getWitherable:Lde,has:LD,hasOwnProperty:Gde,insertAt:Hde,intersection:zD,isEmpty:Is,isSubrecord:tde,keys:Zfe,lookup:qD,map:rde,mapWithIndex:nde,modifyAt:DD,partition:Tde,partitionMap:Ide,partitionMapWithIndex:fde,partitionWithIndex:dde,pop:ede,record:Yde,reduce:Ode,reduceRight:Cde,reduceRightWithIndex:ade,reduceWithIndex:ide,separate:nu,sequence:Op,singleton:ude,size:Jfe,some:bde,toArray:c1,toEntries:mde,toUnfoldable:Xfe,traverse:l1,traverseWithIndex:sde,union:BD,updateAt:Qfe,upsertAt:WD,wilt:lde,wither:cde},Symbol.toStringTag,{value:"Module"}));var Zde=function(e){return function(t){return bt(e(t))}},Xde=function(e){return function(t){return d_(e(t))}},Qde=function(){return function(e){return!0}},epe=function(e){return function(t){return!e(t)}},tpe=function(e){return function(t){return function(n){return t(n)||e(n)}}},npe=function(e){return function(t){return function(n){return t(n)&&e(n)}}},rpe=function(){return function(e){return!1}},ipe=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const ope=Object.freeze(Object.defineProperty({__proto__:null,and:npe,compose:ipe,fromEitherK:Xde,fromOptionK:Zde,id:Qde,not:epe,or:tpe,zero:rpe},Symbol.toStringTag,{value:"Module"}));var nq=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{add:function(n,r){return e.map(function(i,o){return i.add(n[o],r[o])})},zero:e.map(function(n){return n.zero}),mul:function(n,r){return e.map(function(i,o){return i.mul(n[o],r[o])})},one:e.map(function(n){return n.one}),sub:function(n,r){return e.map(function(i,o){return i.sub(n[o],r[o])})}}},ape=function(e){return function(t){return e.sub(e.zero,t)}},upe=nq,spe=HR;const cpe=Object.freeze(Object.defineProperty({__proto__:null,getFunctionRing:spe,getTupleRing:upe,negate:ape,tuple:nq},Symbol.toStringTag,{value:"Module"})),lpe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var fpe=c_;const dpe=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:fpe},Symbol.toStringTag,{value:"Module"}));var ppe=ID,hpe=OD;function mpe(e){var t=nr(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);t(a,i)||i.add(a)}),i}}}function vpe(e){var t=nr(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){n(o).forEach(function(a){t(a,i)||i.add(a)})}),i}}}function p1(e){return function(t){for(var n=t.values(),r,i=new Set;!(r=n.next()).done;){var o=r.value;e(o)&&i.add(o)}return i}}function gpe(e){return function(t){for(var n=t.values(),r,i=new Set,o=new Set;!(r=n.next()).done;){var a=r.value;e(a)?i.add(a):o.add(a)}return Me(o,i)}}function h1(e){var t=nr(e);return function(n,r){if(r===void 0){var i=h1(e);return function(a){return i(n,a)}}if(Fp(n))return r;if(Fp(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function m1(e){var t=nr(e);return function(n,r){if(r===void 0){var i=m1(e);return function(a){return i(a,n)}}if(Fp(n)||Fp(r))return new Set;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function ype(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,u=new Set,s=nr(e),c=nr(t);!(o=i.next()).done;){var l=n(o.value);switch(l._tag){case"Left":s(l.left,a)||a.add(l.left);break;case"Right":c(l.right,u)||u.add(l.right);break}}return Me(a,u)}}}function v1(e){var t=nr(e);return function(n,r){if(r===void 0){var i=v1(e);return function(o){return i(o,n)}}return p1(function(o){return!t(o,r)})(n)}}var rq=function(e){return{concat:h1(e)}},bpe=function(e){return{concat:rq(e).concat,empty:new Set}},_pe=function(e){return{concat:m1(e)}},Spe=function(e){return{concat:v1(e)}},$pe=yD,Tpe=bD,Ipe=_D,Ope=function(e){return new Set([e])};function iq(e){var t=nr(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var oq=function(e){return function(t){return function(n){return p1(function(r){return!e.equals(t,r)})(n)}}},wpe=function(e){var t=nr(e),n=oq(e),r=iq(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},aq=function(e){return function(t){for(var n=t.length,r=new Set,i=nr(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}},Cpe=function(e){return uq(e)(D)};function Epe(e,t){return function(n){var r=nr(e),i=nr(t),o=new Set,a=new Set;return n.forEach(function(u){switch(u._tag){case"Left":r(u.left,o)||o.add(u.left);break;case"Right":i(u.right,a)||a.add(u.right);break}}),Me(o,a)}}function uq(e){var t=nr(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);a._tag==="Some"&&!t(a.value,i)&&i.add(a.value)}),i}}}var Rpe=new Set,Fp=function(e){return e.size===0},Mpe=function(e){return e.size},xpe=HI,sq=GI,kpe=Tp,nr=pn,cq=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},Ape=Tp;const Npe=Object.freeze(Object.defineProperty({__proto__:null,chain:vpe,compact:Cpe,difference:v1,elem:nr,empty:Rpe,every:sq,filter:p1,filterMap:uq,foldMap:Tpe,fromArray:aq,getDifferenceMagma:Spe,getEq:hpe,getIntersectionSemigroup:_pe,getShow:ppe,getUnionMonoid:bpe,getUnionSemigroup:rq,insert:iq,intersection:m1,isEmpty:Fp,isSubset:kpe,map:mpe,partition:gpe,partitionMap:ype,reduce:$pe,reduceRight:Ipe,remove:oq,separate:Epe,singleton:Ope,size:Mpe,some:xpe,subset:Ape,toArray:cq,toggle:wpe,union:h1},Symbol.toStringTag,{value:"Module"}));var lq=function(e){return{show:function(t){var n="{";for(var r in e)lt.call(e,r)&&(n+=" ".concat(r,": ").concat(e[r].show(t[r]),","));return n.length>1&&(n=n.slice(0,-1)+" "),n+="}",n}}},fq=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{show:function(n){return"[".concat(n.map(function(r,i){return e[i].show(r)}).join(", "),"]")}}},Fpe=fq,Ppe=lq,Wpe={show:function(e){return JSON.stringify(e)}},Lpe={show:function(e){return JSON.stringify(e)}},jpe={show:function(e){return JSON.stringify(e)}};const Dpe=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:Ppe,getTupleShow:Fpe,showBoolean:Wpe,showNumber:jpe,showString:Lpe,struct:lq,tuple:fq},Symbol.toStringTag,{value:"Module"}));function g1(e){return function(t){return function(n){return e.of([t,n])}}}function y1(e){return function(t){return function(n){return function(r){return e.map(n(r),function(i){var o=i[0],a=i[1];return[t(o),a]})}}}}function b1(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){var o=i[0],a=i[1];return e.map(t(a),function(u){var s=u[0],c=u[1];return[o(s),c]})})}}}}function _1(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){var o=i[0],a=i[1];return t(o)(a)})}}}}function S1(e){return function(t){return function(n){return e.of(t(n))}}}function $1(e){return function(t){return function(n){return e.map(t,function(r){return[r,n]})}}}function T1(e){return function(t){return function(n){return e.map(n(t),function(r){var i=r[0];return i})}}}function I1(e){return function(t){return function(n){return e.map(n(t),wn)}}}function qpe(e){var t=b1(e),n=y1(e),r=_1(e),i=T1(e),o=I1(e);return{map:function(a,u){return y(a,n(u))},ap:function(a,u){return y(a,t(u))},of:g1(e),chain:function(a,u){return y(a,r(u))},get:function(){return function(a){return e.of([a,a])}},put:function(a){return function(){return e.of([void 0,a])}},modify:function(a){return function(u){return e.of([void 0,a(u)])}},gets:function(a){return function(u){return e.of([a(u),u])}},fromState:S1(e),fromM:$1(e),evalState:function(a,u){return y(a,i(u))},execState:function(a,u){return y(a,o(u))}}}const Upe=Object.freeze(Object.defineProperty({__proto__:null,ap:b1,chain:_1,evaluate:T1,execute:I1,fromF:$1,fromState:S1,getStateM:qpe,map:y1,of:g1},Symbol.toStringTag,{value:"Module"}));var O1=function(e){return function(){return kg(e)}},w1=g1(WI);function dq(e){return _i(II(e))}function Bpe(e){return _i(Rj(e))}function pq(e){return _i(OI(e))}function zpe(e){return _i(Mj(e))}function hq(e){return _i(wI(e))}function Kpe(e){return _i(kj(e))}var Vpe=function(e){return V(e,TI)},Hpe=function(e){return function(t){return kg(e(t)[0])}},mq=qa(function(e){return O1(e)},w1),vq=pq,Os=hq,Pp=dq,gq=S1(WI),yq=function(e){return _i(Za(e))},bq=function(e){return _i(CI(e))},Gpe=function(e){return _i(EI(e))},_i=$1(Ts),Ype=function(e){return function(t){return V(t,zd(e))}},_q=function(e){return function(t){return function(n){return e(n)(t)(n)}}},Jpe=_q,Sq=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return bq(e.apply(void 0,t))}},$q=function(e){return function(t){return y(t,Wp(Sq(e)))}},Zpe=$q,Tq=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return yq(e.apply(void 0,t))}},Iq=function(e){return function(t){return y(t,Wp(Tq(e)))}},Xpe=Iq,Oq=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return _i(e.apply(void 0,t))}},wq=function(e){return function(t){return y(t,Wp(Oq(e)))}},Qpe=wq,Si=function(e,t){return y(e,Cq(t))},ta=function(e,t){return y(e,E1(t))},ws=function(e,t){return y(e,R1(t))},C1=function(e,t){return function(n){return y(e(n),Pg(function(){return t()(n)}))}},Bg=function(e,t,n){return function(r){return y(e(r),NI(t,function(i){var o=i[0],a=i[1];return[n(o),a]}))}},zg=function(e,t){return function(n){return y(e(n),FI(t))}},Cq=y1(Ts),ehe=function(e,t){return function(n){return Bg(n,e,t)}},the=function(e){return function(t){return zg(t,e)}},E1=b1(Wn),nhe=E1,ao=w1,R1=_1(Wn),Wp=R1,Eq=Wp(D),rhe=Eq,Rq=function(e){return function(t){return function(n){return y(t(n),Gj(function(){return e()(n)}))}}},ihe=Rq,Kg=O1,zt="StateReaderTaskEither",M1={URI:zt,map:Si},ohe=Ke(M1),ahe={URI:zt,of:ao},Vg={URI:zt,map:Si,ap:ta},Mq=Ct(Vg),uhe=Mq,xq=Et(Vg),she=xq,che={URI:zt,map:Si,ap:ta,of:ao},rr={URI:zt,map:Si,ap:ta,chain:ws},Cs={URI:zt,fromState:gq},lhe=UF(Cs),fhe=BF(Cs),dhe=zF(Cs),phe=KF(Cs),hhe=k0(Cs),mhe=VF(Cs,rr),vhe={URI:zt,map:Si,ap:ta,of:ao,chain:ws},ghe={URI:zt,map:Si,ap:ta,of:ao,chain:ws,fromIO:Os},yhe={URI:zt,map:Si,ap:ta,of:ao,chain:ws,fromIO:Os,fromTask:Pp},bhe={URI:zt,map:Si,ap:ta,of:ao,chain:ws,throwError:Kg},kq=ft(rr),_he=kq,She={URI:zt,bimap:Bg,mapLeft:zg},$he={URI:zt,map:Si,alt:C1},Gl={URI:zt,fromReader:vq},The=Hd(Gl),Ihe=Gd(Gl),Ohe=ps(Gl),Aq=Yd(Gl,rr),whe=Aq,Nq=Jd(Gl,rr),Che=Nq,na={URI:zt,fromEither:mq},Ehe=Vi(na),Rhe=Hi(na),Mhe=Hu(na,rr),Fq=wo(na,rr),xhe=Fq,Pq=Co(na,rr),khe=Pq,Ahe=Aa(na),Wq=Gu(na,rr),Nhe=Wq,Fhe=gr(na),Hg={URI:zt,fromIO:Os},Phe=Xi(Hg),Whe=Po(Hg,rr),Lhe=Wo(Hg,rr),Gg={URI:zt,fromIO:Os,fromTask:Pp},jhe=hs(Gg),Dhe=_l(Gg,rr),qhe=Sl(Gg,rr),Uhe=T1(Ts),Bhe=I1(Ts),zhe=wt(M1),Lq=Mt(rr),Khe=Lq,jq=Rt(Vg),Vhe=jq,Dq=function(e){return function(t){return function(n){return function(r){return function(){return Rc(t).reduce(function(i,o,a){return i.then(function(u){return Gt(u)?i:e(a+1,o)(u.right[1])(r)().then(function(s){if(Gt(s))return s;var c=s.right,l=c[0],f=c[1];return u.right[0].push(l),u.right[1]=f,u})})},e(0,dr(t))(n)(r)().then(as(function(i){var o=i[0],a=i[1];return[[o],a]})))}}}}},x1=function(e){var t=Dq(e);return function(n){return gt(n)?t(n):ao(rn)}},Hhe=x1,qq=function(e){return x1(function(t,n){return e(n)})},Ghe=qq(D),Yhe={URI:zt,map:Si,of:ao,ap:ta,chain:ws,bimap:Bg,mapLeft:zg,alt:C1,fromIO:Os,fromTask:Pp,throwError:Kg},Jhe={URI:zt,map:Si,of:ao,ap:ta,chain:ws,bimap:Bg,mapLeft:zg,alt:C1,fromIO:Os,fromTask:Pp,throwError:Kg},Zhe=function(e,t){return y(e(t),_p(function(n){var r=n[0];return r}))},Xhe=function(e,t){return y(e(t),_p(function(n){n[0];var r=n[1];return r}))};function Qhe(e,t,n){return e(t)(n)()}const eme=Object.freeze(Object.defineProperty({__proto__:null,Alt:$he,Applicative:che,Apply:Vg,Bifunctor:She,Chain:rr,FromEither:na,FromIO:Hg,FromReader:Gl,FromState:Cs,FromTask:Gg,Functor:M1,Monad:vhe,MonadIO:ghe,MonadTask:yhe,MonadThrow:bhe,Pointed:ahe,URI:zt,alt:ihe,altW:Rq,ap:E1,apFirst:Mq,apFirstW:uhe,apS:jq,apSW:Vhe,apSecond:xq,apSecondW:she,apW:nhe,ask:The,asks:Ihe,asksStateReaderTaskEither:Jpe,asksStateReaderTaskEitherW:_q,bimap:ehe,bind:Lq,bindTo:zhe,bindW:Khe,chain:R1,chainEitherK:Fq,chainEitherKW:xhe,chainFirst:kq,chainFirstEitherK:Pq,chainFirstEitherKW:khe,chainFirstIOK:Lhe,chainFirstReaderK:Nq,chainFirstReaderKW:Che,chainFirstTaskK:qhe,chainFirstW:_he,chainIOEitherK:Zpe,chainIOEitherKW:$q,chainIOK:Whe,chainOptionK:Mhe,chainReaderK:Aq,chainReaderKW:whe,chainReaderTaskEitherK:Qpe,chainReaderTaskEitherKW:wq,chainStateK:mhe,chainTaskEitherK:Xpe,chainTaskEitherKW:Iq,chainTaskK:Dhe,chainW:Wp,evalState:Zhe,evaluate:Uhe,execState:Xhe,execute:Bhe,filterOrElse:Wq,filterOrElseW:Nhe,flap:ohe,flatten:rhe,flattenW:Eq,fromEither:mq,fromEitherK:Fhe,fromIO:Os,fromIOEither:bq,fromIOEitherK:Sq,fromIOK:Phe,fromOption:Ehe,fromOptionK:Rhe,fromPredicate:Ahe,fromReader:vq,fromReaderEither:Gpe,fromReaderK:Ohe,fromReaderTaskEither:_i,fromReaderTaskEitherK:Oq,fromState:gq,fromStateK:hhe,fromTask:Pp,fromTaskEither:yq,fromTaskEitherK:Tq,fromTaskK:jhe,get:lhe,gets:phe,left:O1,leftIO:Kpe,leftReader:zpe,leftState:Hpe,leftTask:Bpe,local:Ype,map:Cq,mapLeft:the,modify:dhe,of:ao,put:fhe,right:w1,rightIO:hq,rightReader:pq,rightState:Vpe,rightTask:dq,run:Qhe,sequenceArray:Ghe,stateReaderTaskEither:Yhe,stateReaderTaskEitherSeq:Jhe,throwError:Kg,traverseArray:qq,traverseArrayWithIndex:Hhe,traverseReadonlyArrayWithIndex:x1,traverseReadonlyNonEmptyArrayWithIndex:Dq},Symbol.toStringTag,{value:"Module"}));function tme(e){return function(t){return{peek:t.peek,pos:e}}}function nme(e){return function(t){return{peek:t.peek,pos:e(t.pos)}}}function rme(e){return function(t){return t.peek(e(t.pos))}}function ime(e){return function(t){return function(n){return e.map(t(n.pos),function(r){return n.peek(r)})}}}var Uq=function(e,t){return y(e,zq(t))},ome=function(e,t){return y(e,k1(t))},k1=function(e){return function(t){return{peek:function(n){return e({peek:t.peek,pos:n})},pos:t.pos}}},Bq=function(e){return e.peek(e.pos)},ame=k1(D),zq=function(e){return function(t){return{peek:function(n){return e(t.peek(n))},pos:t.pos}}},A1="Store",Kq={URI:A1,map:Uq},ume=Ke(Kq),Vq={URI:A1,map:Uq,extend:ome,extract:Bq},sme=Vq;const cme=Object.freeze(Object.defineProperty({__proto__:null,Comonad:Vq,Functor:Kq,URI:A1,duplicate:ame,experiment:ime,extend:k1,extract:Bq,flap:ume,map:zq,peeks:rme,seek:tme,seeks:nme,store:sme},Symbol.toStringTag,{value:"Module"}));function N1(e,t){return function(n,r){return t.compose(e.second(r),e.first(n))}}function Hq(e,t){var n=N1(e,t);return function(r,i){return t.compose(n(r,i),e.promap(t.id(),D,function(o){return[o,o]}))}}function lme(e){return N1(e,e)}function fme(e){return Hq(e,e)}const dme=Object.freeze(Object.defineProperty({__proto__:null,fanOut:Hq,fanout:fme,split:N1,splitStrong:lme},Symbol.toStringTag,{value:"Module"}));var pme=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},hme=function(e){return function(t){var n={};for(var r in t)lt.call(t,r)&&(n[r]=e[r](t[r]));return n}};const mme=Object.freeze(Object.defineProperty({__proto__:null,evolve:hme,getAssignSemigroup:pme},Symbol.toStringTag,{value:"Module"}));var vme=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(l){try{c(r.next(l))}catch(f){a(f)}}function s(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(u,s)}c((r=r.apply(e,t||[])).next())})},gme=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(l){return s([c,l])}}function s(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Gq=tp(cn),yme=oT(cn),bme=In,Yq=aT(cn),Lp=function(e){return Yg(Fn(e))},Yg=Gv(De),_me=Ha(rl),Jq=uT(De),Sme=Jq,F1=Xv(Wl),$me=F1,Zq=F1,Tme=Zq,Xq=Qv(Xt),Ime=Xq,Ome=Yv(cn),Qq=function(e){return function(){return vme(void 0,void 0,void 0,function(){return gme(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e().then(pe)];case 1:return[2,t.sent()];case 2:return t.sent(),[2,be];case 3:return[2]}})})}},wme=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Qq(function(){return e.apply(void 0,t)})}},Cme=Jv(cn),Eme=rT(Xt),Rme=Zv(cn),Mme=iT(Xt),P1=eg(De),eU=tg(_s),uo=Gq,Jg=wl(Xt),xme=Jg(D),W1=ng(Xt),kme=W1,Zg=np(cn),Ame=Zg(),L1=Ji(De,es),j1=Ao(De,es,Qc),tU=No(De,Mo),nU=Fo(De,Mo),rU=Ua(De,Mo),iU=Ba(De,Mo),zr=function(e,t){return y(e,P1(t))},Es=function(e,t){return y(e,eU(t))},Xg=function(e,t){return y(e,Jg(t))},oU=function(e,t){return y(e,W1(t))},Nme=function(e,t){return y(e,tU(t))},Fme=function(e,t){return y(e,nU(t))},Pme=function(e,t){return y(e,rU(t))},Wme=function(e,t){return y(e,iU(t))},en="TaskOption",D1={URI:en,map:zr},Lme=Ke(D1),aU={URI:en,of:uo},Qg={URI:en,map:zr,ap:Es},jme=Ct(Qg),Dme=Et(Qg),qme={URI:en,map:zr,ap:Es,of:uo},uU=function(e,t){return y(e,Jg(function(n){return y(t,P1(n))}))},Ume={URI:en,map:zr,ap:uU},Bme={URI:en,map:zr,ap:uU,of:uo},ra={URI:en,map:zr,ap:Es,chain:Xg},zme=ft(ra),Kme={URI:en,map:zr,alt:oU},sU={URI:en,zero:Zg},Vme=qc(sU,aU),Hme={URI:en,map:zr,ap:Es,of:uo,alt:oU,zero:Zg},Gme={URI:en,map:zr,ap:Es,of:uo,chain:Xg},Yme={URI:en,map:zr,ap:Es,of:uo,chain:Xg,fromIO:Lp},Jme={URI:en,map:zr,ap:Es,of:uo,chain:Xg,fromIO:Lp,fromTask:Yg},Zme={URI:en,compact:L1,separate:j1},Xme={URI:en,map:zr,compact:L1,separate:j1,filter:Nme,filterMap:Fme,partition:Pme,partitionMap:Wme},ey={URI:en,fromIO:Lp},Qme=Xi(ey),eve=Po(ey,ra),tve=Wo(ey,ra),ty={URI:en,fromEither:Yq},nve=gr(ty),rve=wo(ty,ra),ive=Co(ty,ra),ny={URI:en,fromIO:Lp,fromTask:Yg},ove=hs(ny),ave=_l(ny,ra),uve=Sl(ny,ra),sve=uo(Yt),cve=wt(D1),lve=Mt(ra),fve=Rt(Qg),q1=uo(rn),cU=function(e){return V(Ll(e),Ha(kv(Jn)))},U1=function(e){var t=cU(e);return function(n){return gt(n)?t(n):q1}},lU=function(e){return function(t){return function(){return Rc(t).reduce(function(n,r,i){return n.then(function(o){return Wt(o)?n:e(i+1,r)().then(function(a){return Wt(a)?a:(o.value.push(a.value),o)})})},e(0,dr(t))().then(Yi(Vf)))}}},B1=function(e){var t=lU(e);return function(n){return gt(n)?t(n):q1}},dve=U1,fU=function(e){return U1(function(t,n){return e(n)})},pve=fU(D),hve=B1,dU=function(e){return B1(function(t,n){return e(n)})},mve=dU(D);const vve=Object.freeze(Object.defineProperty({__proto__:null,Alt:Kme,Alternative:Hme,ApT:q1,ApplicativePar:qme,ApplicativeSeq:Bme,ApplyPar:Qg,ApplySeq:Ume,Chain:ra,Compactable:Zme,Do:sve,Filterable:Xme,FromEither:ty,FromIO:ey,FromTask:ny,Functor:D1,Monad:Gme,MonadIO:Yme,MonadTask:Jme,Pointed:aU,Zero:sU,alt:W1,altW:kme,ap:eU,apFirst:jme,apS:fve,apSecond:Dme,bind:lve,bindTo:cve,chain:Jg,chainEitherK:rve,chainFirst:zme,chainFirstEitherK:ive,chainFirstIOK:tve,chainFirstTaskK:uve,chainIOK:eve,chainNullableK:Eme,chainOptionK:Mme,chainTaskK:ave,compact:L1,filter:tU,filterMap:nU,flap:Lme,flatten:xme,fold:$me,foldW:Tme,fromEither:Yq,fromEitherK:nve,fromIO:Lp,fromIOK:Qme,fromNullable:Ome,fromNullableK:Cme,fromOption:bme,fromOptionK:Rme,fromPredicate:yme,fromTask:Yg,fromTaskEither:_me,fromTaskK:ove,getOrElse:Xq,getOrElseW:Ime,guard:Vme,map:P1,match:Jq,matchE:F1,matchEW:Zq,matchW:Sme,none:Ame,of:uo,partition:rU,partitionMap:iU,separate:j1,sequenceArray:pve,sequenceSeqArray:mve,some:Gq,traverseArray:fU,traverseArrayWithIndex:dve,traverseReadonlyArrayWithIndex:U1,traverseReadonlyArrayWithIndexSeq:B1,traverseReadonlyNonEmptyArrayWithIndex:cU,traverseReadonlyNonEmptyArrayWithIndexSeq:lU,traverseSeqArray:dU,traverseSeqArrayWithIndex:hve,tryCatch:Qq,tryCatchK:wme,zero:Zg},Symbol.toStringTag,{value:"Module"}));var Ze=function(e){return e._tag==="Left"},kt=function(e){return e._tag==="Right"};function Rs(e){return e._tag==="Both"}function mn(e){return{_tag:"Left",left:e}}function ir(e){return{_tag:"Right",right:e}}function nt(e,t){return{_tag:"Both",left:e,right:t}}var z1=function(e,t,n){return function(r){switch(r._tag){case"Left":return e(r.left);case"Right":return t(r.right);case"Both":return n(r.left,r.right)}}},gve=z1,ru=z1,yve=ru,pU=ru(ir,mn,function(e,t){return nt(t,e)});function bve(e,t){return{show:ru(function(n){return"left(".concat(e.show(n),")")},function(n){return"right(".concat(t.show(n),")")},function(n,r){return"both(".concat(e.show(n),", ").concat(t.show(r),")")})}}function _ve(e,t){return Fr(function(n,r){return Ze(n)?Ze(r)&&e.equals(n.left,r.left):kt(n)?kt(r)&&t.equals(n.right,r.right):Rs(r)&&e.equals(n.left,r.left)&&t.equals(n.right,r.right)})}function hU(e,t){return{concat:function(n,r){return Ze(n)?Ze(r)?mn(e.concat(n.left,r.left)):kt(r)?nt(n.left,r.right):nt(e.concat(n.left,r.left),r.right):kt(n)?Ze(r)?nt(r.left,n.right):kt(r)?ir(t.concat(n.right,r.right)):nt(r.left,t.concat(n.right,r.right)):Ze(r)?nt(e.concat(n.left,r.left),n.right):kt(r)?nt(n.left,t.concat(n.right,r.right)):nt(e.concat(n.left,r.left),t.concat(n.right,r.right))}}}var ry=function(e){return{URI:Sr,_E:void 0,map:Ms,ap:function(t,n){return Ze(t)?Ze(n)?mn(e.concat(t.left,n.left)):kt(n)?mn(t.left):mn(e.concat(t.left,n.left)):kt(t)?Ze(n)?mn(n.left):kt(n)?ir(t.right(n.right)):nt(n.left,t.right(n.right)):Ze(n)?mn(e.concat(t.left,n.left)):kt(n)?nt(t.left,t.right(n.right)):nt(e.concat(t.left,n.left),t.right(n.right))}}};function Sve(e){var t=ry(e);return{URI:Sr,_E:void 0,map:Ms,ap:t.ap,of:jp}}function mU(e){var t=ry(e),n=function(r,i){if(Ze(r))return r;if(kt(r))return i(r.right);var o=i(r.right);return Ze(o)?mn(e.concat(r.left,o.left)):kt(o)?nt(r.left,o.right):nt(e.concat(r.left,o.left),o.right)};return{URI:Sr,_E:void 0,map:Ms,ap:t.ap,chain:n}}function $ve(e){var t=mU(e);return{URI:Sr,_E:void 0,map:Ms,of:jp,ap:t.ap,chain:t.chain,throwError:mn}}function Tve(e){return Ze(e)?pe(e.left):kt(e)?be:pe(e.left)}function Ive(e){return Ze(e)?be:(kt(e),pe(e.right))}function Ove(e){return function(t){return Wt(t)?mn(e):nt(e,t.value)}}function wve(e){return function(t){return Wt(t)?ir(e):nt(t.value,e)}}function Cve(e){return Ze(e)?pe(e.left):be}function Eve(e){return kt(e)?pe(e.right):be}var Rve=function(e,t){return Wt(e)?Wt(t)?be:pe(ir(t.value)):Wt(t)?pe(mn(e.value)):pe(nt(e.value,t.value))},Ms=function(e,t){return y(e,J1(t))},vU=function(e,t,n){return y(e,G1(t,n))},gU=function(e,t){return y(e,Y1(t))},K1=function(e,t,n){return y(e,bU(t,n))},V1=function(e){var t=_U(e);return function(n,r){return y(n,t(r))}},H1=function(e,t,n){return y(e,SU(t,n))},yU=function(e){var t=$U(e);return function(n,r){return y(n,t(r))}},G1=function(e,t){return function(n){return Ze(n)?mn(e(n.left)):kt(n)?ir(t(n.right)):nt(e(n.left),t(n.right))}},Y1=function(e){return function(t){return Ze(t)?mn(e(t.left)):Rs(t)?nt(e(t.left),t.right):t}},J1=function(e){return function(t){return Ze(t)?t:kt(t)?ir(e(t.right)):nt(t.left,e(t.right))}},bU=function(e,t){return function(n){return Ze(n)?e:t(e,n.right)}},_U=function(e){return function(t){return function(n){return Ze(n)?e.empty:t(n.right)}}},SU=function(e,t){return function(n){return Ze(n)?e:t(n.right,e)}},$U=function(e){return function(t){return function(n){return Ze(n)?e.of(n):kt(n)?e.map(t(n.right),ir):e.map(t(n.right),function(r){return nt(n.left,r)})}}},Z1=function(e){return function(t){return Ze(t)?e.of(t):kt(t)?e.map(t.right,ir):e.map(t.right,function(n){return nt(t.left,n)})}},jp=ir,Sr="These",X1={URI:Sr,map:Ms},Mve=Ke(X1),xve={URI:Sr,of:jp},kve={URI:Sr,bimap:vU,mapLeft:gU},Ave={URI:Sr,fromThese:D},Nve={URI:Sr,reduce:K1,foldMap:V1,reduceRight:H1},Fve={URI:Sr,map:Ms,reduce:K1,foldMap:V1,reduceRight:H1,traverse:yU,sequence:Z1},Q1={URI:Sr,fromEither:D},Pve=Vi(Q1),Wve=Hi(Q1),Lve=function(e){return function(t){return function(n){return Ze(n)?!1:e.equals(t,n.right)}}},jve=function(e){return function(t){return Ze(t)?!1:e(t.right)}},eO=function(e,t){return function(n){return Ze(n)?[n.left,t()]:kt(n)?[e(),n.right]:[n.left,n.right]}},Dve=function(e,t){return eO(function(){return e},function(){return t})},TU=jp(rn),tO=function(e){return function(t){return function(n){var r=be,i=t(0,dr(n));if(Ze(i))return i;Rs(i)&&(r=pe(i.left));for(var o=[i.right],a=1;a<n.length;a++){var u=t(a,n[a]);if(Ze(u))return u;Rs(u)&&(r=Wt(r)?pe(u.left):pe(e.concat(r.value,u.left))),o.push(u.right)}return Wt(r)?ir(o):nt(r.value,o)}}},qve=function(e){return function(t){var n=tO(e)(t);return function(r){return gt(r)?n(r):TU}}},Uve={URI:Sr,map:Ms,bimap:vU,mapLeft:gU,reduce:K1,foldMap:V1,reduceRight:H1,traverse:yU,sequence:Z1};const Bve=Object.freeze(Object.defineProperty({__proto__:null,ApT:TU,Bifunctor:kve,Foldable:Nve,FromEither:Q1,FromThese:Ave,Functor:X1,Pointed:xve,Traversable:Fve,URI:Sr,bimap:G1,both:nt,elem:Lve,exists:jve,flap:Mve,fold:yve,foldMap:_U,foldW:gve,fromOption:Pve,fromOptionK:Wve,fromOptions:Rve,getApplicative:Sve,getApply:ry,getChain:mU,getEq:_ve,getLeft:Tve,getLeftOnly:Cve,getMonad:$ve,getRight:Ive,getRightOnly:Eve,getSemigroup:hU,getShow:bve,isBoth:Rs,isLeft:Ze,isRight:kt,left:mn,leftOrBoth:Ove,map:J1,mapLeft:Y1,match:ru,matchW:z1,of:jp,reduce:bU,reduceRight:SU,right:ir,rightOrBoth:wve,sequence:Z1,swap:pU,these:Uve,toTuple:Dve,toTuple2:eO,traverse:$U,traverseReadonlyArrayWithIndex:qve,traverseReadonlyNonEmptyArrayWithIndex:tO},Symbol.toStringTag,{value:"Module"}));function iy(e){return V(ir,e.of)}function oy(e){return V(mn,e.of)}function nO(e){return V(nt,e.of)}function rO(e){return function(t){return e.map(t,ir)}}function iO(e){return function(t){return e.map(t,mn)}}function oO(e){return Cc(e,X1)}function aO(e,t){return $o(e,ry(t))}function uO(e,t){var n=oy(e);return function(r){return function(i){return e.chain(i,ru(n,r,function(o,a){return e.map(r(a),ru(function(u){return mn(t.concat(o,u))},function(u){return nt(o,u)},function(u,s){return nt(t.concat(o,u),s)}))}))}}}function sO(e){return function(t,n){return function(r){return e.map(r,G1(t,n))}}}function cO(e){return function(t){return function(n){return e.map(n,Y1(t))}}}function IU(e){return function(t,n,r){return function(i){return e.map(i,ru(t,n,r))}}}function lO(e){return function(t,n,r){return function(i){return e.chain(i,ru(t,n,r))}}}function fO(e){return function(t){return e.map(t,pU)}}function dO(e){return function(t,n){return function(r){return e.map(r,eO(t,n))}}}function zve(e){var t=oO(e),n=sO(e),r=cO(e),i=lO(e),o=dO(e),a=iy(e),u=function(s,c){return y(s,t(c))};return{map:u,bimap:function(s,c,l){return y(s,n(c,l))},mapLeft:function(s,c){return y(s,r(c))},fold:function(s,c,l,f){return y(s,i(c,l,f))},swap:fO(e),rightM:rO(e),leftM:iO(e),left:oy(e),right:iy(e),both:nO(e),toTuple:function(s,c,l){return y(s,o(function(){return c},function(){return l}))},getMonad:function(s){var c=aO(e,s),l=uO(e,s);return{_E:void 0,map:u,of:a,ap:function(f,d){return y(f,c(d))},chain:function(f,d){return y(f,l(d))}}}}}const Kve=Object.freeze(Object.defineProperty({__proto__:null,ap:aO,bimap:sO,both:nO,chain:uO,getTheseM:zve,left:oy,leftF:iO,map:oO,mapLeft:cO,match:IU,matchE:lO,right:iy,rightF:rO,swap:fO,toTuple2:dO},Symbol.toStringTag,{value:"Module"}));var Vve=oy(cn),OU=iy(cn),Hve=nO(cn),pO=rO(De),wU=iO(De),CU=V(Fn,pO),Gve=V(Fn,wU),EU=In,RU=In,ay=CU,Yve=Fn,hO=pO,MU=IU(De),Jve=MU,xU=lO(Xt),kU=xU,AU=kU,Zve=AU,Xve=fO(De),xs=function(e,t){return y(e,NU(t))},mO=function(e,t,n){return y(e,FU(t,n))},vO=function(e,t){return y(e,PU(t))},NU=oO(De),FU=sO(De),PU=cO(De),Dp=OU,Ln="TaskThese",gO=function(e,t){var n=aO(e,t);return{URI:Ln,_E:void 0,map:xs,ap:function(r,i){return y(r,n(i))}}};function WU(e,t){var n=gO(e,t).ap;return{URI:Ln,_E:void 0,map:xs,ap:n,of:Dp}}function LU(e){var t=gO(pp,e),n=uO(Xt,e);return{URI:Ln,_E:void 0,map:xs,ap:t.ap,chain:function(r,i){return y(r,n(i))}}}function Qve(e){var t=WU(pp,e),n=LU(e);return{URI:Ln,_E:void 0,map:xs,ap:t.ap,of:Dp,chain:n.chain,fromIO:ay,fromTask:hO}}var jU={URI:Ln,map:xs},ege=Ke(jU),tge={URI:Ln,of:Dp},nge={URI:Ln,bimap:mO,mapLeft:vO},uy={URI:Ln,fromEither:EU},rge=Vi(uy),ige=Hi(uy),oge=Aa(uy),DU={URI:Ln,fromThese:RU},age=HF(DU),qU={URI:Ln,fromIO:ay},uge=Xi(qU),UU={URI:Ln,fromIO:ay,fromTask:hO},sge=hs(UU),BU=dO(De),yO=Dp(rn),zU=function(e){var t=tO(e);return function(n){return V(Ll(n),Ha(t(Jn)))}},cge=function(e){return function(t){var n=zU(e)(t);return function(r){return gt(r)?n(r):yO}}},KU=function(e){return function(t){return function(n){return function(){return Rc(n).reduce(function(r,i,o){return r.then(function(a){return Ze(a)?r:t(o+1,i)().then(function(u){if(Ze(u))return u;if(Rs(u)){var s=a.right;return s.push(u.right),Rs(a)?nt(e.concat(a.left,u.left),s):nt(u.left,s)}return a.right.push(u.right),a})})},t(0,dr(n))().then(J1(Vf)))}}}},lge=function(e){return function(t){var n=KU(e)(t);return function(r){return gt(r)?n(r):yO}}},fge={URI:Ln,map:xs},dge={URI:Ln,bimap:mO,mapLeft:vO},pge=function(e,t){return BU(function(){return e},function(){return t})},hge={URI:Ln,map:xs,bimap:mO,mapLeft:vO},mge=function(e,t){return Jt(_g)(hU(e,t))};const vge=Object.freeze(Object.defineProperty({__proto__:null,ApT:yO,Bifunctor:nge,FromEither:uy,FromIO:qU,FromTask:UU,FromThese:DU,Functor:jU,Pointed:tge,URI:Ln,bifunctorTaskThese:dge,bimap:FU,both:Hve,flap:ege,fold:kU,foldW:Zve,fromEither:EU,fromIO:ay,fromIOEither:Yve,fromIOK:uge,fromOption:rge,fromOptionK:ige,fromPredicate:oge,fromTask:hO,fromTaskK:sge,fromThese:RU,fromTheseK:age,functorTaskThese:fge,getApplicative:WU,getApply:gO,getChain:LU,getMonad:Qve,getSemigroup:mge,left:Vve,leftIO:Gve,leftTask:wU,map:NU,mapLeft:PU,match:MU,matchE:xU,matchEW:AU,matchW:Jve,of:Dp,right:OU,rightIO:CU,rightTask:pO,swap:Xve,taskThese:hge,toTuple:pge,toTuple2:BU,traverseReadonlyArrayWithIndex:cge,traverseReadonlyArrayWithIndexSeq:lge,traverseReadonlyNonEmptyArrayWithIndex:zU,traverseReadonlyNonEmptyArrayWithIndexSeq:KU},Symbol.toStringTag,{value:"Module"}));function gge(e,t){return function(n){return n(t(n(e.empty)))}}function yge(e){return function(t){return[e(t),t]}}function bge(e){return function(t){return function(n){return[t(n),e(n)]}}}function _ge(e){return function(t){return function(n){return t(e(n))}}}function Sge(e){function t(r,i){return function(o){return i(function(a){return r(e.concat(o,a))})}}function n(r){return r(e.empty)}return{URI:bO,_E:void 0,map:VU,extend:t,extract:n}}var VU=function(e,t){return y(e,HU(t))},HU=function(e){return function(t){return function(n){return e(t(n))}}},bO="Traced",_O={URI:bO,map:VU},$ge=Ke(_O),Tge=_O;const Ige=Object.freeze(Object.defineProperty({__proto__:null,Functor:_O,URI:bO,censor:_ge,flap:$ge,getComonad:Sge,listen:yge,listens:bge,map:HU,traced:Tge,tracks:gge},Symbol.toStringTag,{value:"Module"}));function GU(e,t){return function(n){var r=e.traverse(n),i=t.traverse(n);return function(o){return function(a){return r(a,function(u){return i(u,o)})}}}}function YU(e,t){return function(n){var r=e.sequence(n),i=t.sequence(n);return function(o){return r(e.map(o,i))}}}function Oge(e,t){var n=Ec(e,t).map,r=g0(e,t),i=GU(e,t),o=YU(e,t);return{map:n,reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,traverse:function(a){var u=i(a);return function(s,c){return y(s,u(c))}},sequence:function(a){var u=o(a);return function(s){return y(s,u)}}}}const wge=Object.freeze(Object.defineProperty({__proto__:null,getTraversableComposition:Oge,sequence:YU,traverse:GU},Symbol.toStringTag,{value:"Module"})),Cge=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function JU(e,t){return t===void 0&&(t=[]),{value:e,forest:t}}function Ege(e){var t=function(n){return Pa(n.forest)?"make(".concat(e.show(n.value),")"):"make(".concat(e.show(n.value),", [").concat(n.forest.map(t).join(", "),"])")};return{show:t}}function Rge(e){var t,n=Fr(function(r,i){return e.equals(r.value,i.value)&&t.equals(r.forest,i.forest)});return t=OA(n),n}var ZU=function(e,t){for(var n="",r=t.length,i,o=0;o<r;o++){i=t[o];var a=o===r-1;n+=e+(a?"└":"├")+"─ "+i.value,n+=ZU(e+(r>1&&!a?"│ ":" "),i.forest)}return n};function XU(e){return ZU(`
|
|
28
|
-
`,e)}function Mge(e){return e.value+XU(e.forest)}function QU(e,t){var n=t(e),r=n[0],i=n[1];return{value:r,forest:eB(i,t)}}function eB(e,t){return e.map(function(n){return QU(n,t)})}function tB(e){var t=nB(e);return function(n,r){return e.chain(r(n),function(i){var o=i[0],a=i[1];return e.map(t(a,r),function(u){return{value:o,forest:u}})})}}function nB(e){var t=_v(e);return function(n,r){return y(n,t(function(i){return tB(e)(i,r)}))}}function xge(e){var t=function(n){return e(n.value,n.forest.map(t))};return t}var iu=function(e,t){return y(e,cy(t))},Yl=function(e,t){return y(e,qp(function(n){return y(t,cy(n))}))},SO=function(e,t){return y(e,qp(t))},$O=function(e,t,n){return y(e,ly(t,n))},TO=function(e){var t=oB(e);return function(n,r){return y(n,t(r))}},IO=function(e,t,n){return y(e,OO(t,n))},rB=function(e,t){return y(e,sy(t))},iB=function(e){var t=CO(e);return function(n,r){return y(n,t(r))}},kge=function(e){return function(t){return Yl(t,e)}},qp=function(e){return function(t){var n=e(t.value),r=n.value,i=n.forest,o=M$().concat;return{value:r,forest:o(i,t.forest.map(qp(e)))}}},sy=function(e){return function(t){return{value:e(t),forest:t.forest.map(sy(e))}}},Age=sy(D),Nge=qp(D),cy=function(e){return function(t){return{value:e(t.value),forest:t.forest.map(cy(e))}}},ly=function(e,t){return function(n){for(var r=t(e,n.value),i=n.forest.length,o=0;o<i;o++)r=y(n.forest[o],ly(r,t));return r}},oB=function(e){return function(t){return ly(e.empty,function(n,r){return e.concat(n,t(r))})}},OO=function(e,t){return function(n){for(var r=e,i=n.forest.length,o=i-1;o>=0;o--)r=y(n.forest[o],OO(r,t));return t(n.value,r)}},wO=function(e){return e.value},CO=function(e){var t=_v(e),n=function(r){return function(i){return e.ap(e.map(r(i.value),function(o){return function(a){return{value:o,forest:a}}}),y(i.forest,t(n(r))))}};return n},EO=function(e){return CO(e)(D)},Jl=function(e){return JU(e)},$i="Tree",RO={URI:$i,map:iu},Fge=Ke(RO),Pge={URI:$i,of:Jl},fy={URI:$i,map:iu,ap:Yl},Wge=Ct(fy),Lge=Et(fy),jge={URI:$i,map:iu,ap:Yl,of:Jl},MO={URI:$i,map:iu,ap:Yl,chain:SO},Dge={URI:$i,map:iu,ap:Yl,of:Jl,chain:SO},qge=ft(MO),Uge={URI:$i,reduce:$O,foldMap:TO,reduceRight:IO},Bge={URI:$i,map:iu,reduce:$O,foldMap:TO,reduceRight:IO,traverse:iB,sequence:EO},zge={URI:$i,map:iu,extend:rB,extract:wO},Kge=Jl(Yt),Vge=wt(RO),Hge=Mt(MO),Gge=Rt(fy);function Yge(e){var t=function(n,r){return e.equals(n,r.value)||r.forest.some(function(i){return t(n,i)})};return t}var aB=function(e){return function(t){return e(t.value)||t.forest.some(aB(e))}},Jge={URI:$i,map:iu,of:Jl,ap:Yl,chain:SO,reduce:$O,foldMap:TO,reduceRight:IO,traverse:iB,sequence:EO,extract:wO,extend:rB};const Zge=Object.freeze(Object.defineProperty({__proto__:null,Applicative:jge,Apply:fy,Chain:MO,Comonad:zge,Do:Kge,Foldable:Uge,Functor:RO,Monad:Dge,Pointed:Pge,Traversable:Bge,URI:$i,ap:kge,apFirst:Wge,apS:Gge,apSecond:Lge,bind:Hge,bindTo:Vge,chain:qp,chainFirst:qge,drawForest:XU,drawTree:Mge,duplicate:Age,elem:Yge,exists:aB,extend:sy,extract:wO,flap:Fge,flatten:Nge,fold:xge,foldMap:oB,getEq:Rge,getShow:Ege,make:JU,map:cy,of:Jl,reduce:ly,reduceRight:OO,sequence:EO,traverse:CO,tree:Jge,unfoldForest:eB,unfoldForestM:nB,unfoldTree:QU,unfoldTreeM:tB},Symbol.toStringTag,{value:"Module"}));var $r=Qt,or=wn,Xge=function(e){return[or(e),$r(e)]};function xO(e){return{URI:Tr,_E:void 0,map:Up,ap:function(t,n){return[$r(t)($r(n)),e.concat(or(t),or(n))]}}}var uB=function(e){return function(t){return[t,e.empty]}};function Qge(e){var t=xO(e);return{URI:Tr,_E:void 0,map:t.map,ap:t.ap,of:uB(e)}}function kO(e){var t=xO(e);return{URI:Tr,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r($r(n)),o=i[0],a=i[1];return[o,e.concat(or(n),a)]}}}function eye(e){var t=kO(e);return{URI:Tr,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:uB(e)}}function tye(e){var t=function(r,i){for(var o=i(r),a=e.empty,u=$r(o);u._tag==="Left";)a=e.concat(a,or(o)),o=i(u.left),u=$r(o);return[u.right,e.concat(a,or(o))]},n=kO(e);return{URI:Tr,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var sB=function(e,t){return y(e,hB(t))},Up=function(e,t){return y(e,PO(t))},cB=function(e,t,n){return y(e,pB(t,n))},lB=function(e,t){return y(e,WO(t))},fB=function(e,t){return y(e,LO(t))},AO=function(e,t,n){return y(e,vB(t,n))},NO=function(e){var t=mB();return function(n,r){return y(n,t(r))}},FO=function(e,t,n){return y(e,gB(t,n))};function dB(e){var t=yB(e);return function(n,r){return y(n,t(r))}}var pB=function(e,t){return function(n){return[t($r(n)),e(or(n))]}},PO=function(e){return function(t){return[e($r(t)),or(t)]}},WO=function(e){return function(t){return[$r(t),e(or(t))]}},hB=function(e){return function(t){return[$r(t),or(e)]}},LO=function(e){return function(t){return[e(t),or(t)]}},nye=LO(D),jO=Ug,mB=i1,vB=r1,gB=o1,yB=function(e){return function(t){return function(n){return e.map(t($r(n)),function(r){return[r,or(n)]})}}},DO=function(e){return function(t){return e.map($r(t),function(n){return[n,or(t)]})}},Tr="Tuple",bB={URI:Tr,map:Up},rye=Ke(bB),iye={URI:Tr,bimap:cB,mapLeft:lB},oye={URI:Tr,compose:sB},aye={URI:Tr,map:Up,extend:fB,extract:jO},uye={URI:Tr,reduce:AO,foldMap:NO,reduceRight:FO},sye={URI:Tr,map:Up,reduce:AO,foldMap:NO,reduceRight:FO,traverse:dB,sequence:DO},cye=PO,lye=WO,fye={URI:Tr,compose:sB,map:Up,bimap:cB,mapLeft:lB,extract:jO,extend:fB,reduce:AO,foldMap:NO,reduceRight:FO,traverse:dB,sequence:DO};const dye=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:iye,Comonad:aye,Foldable:uye,Functor:bB,Semigroupoid:oye,Traversable:sye,URI:Tr,bimap:pB,compose:hB,duplicate:nye,extend:LO,extract:jO,flap:rye,foldMap:mB,fst:$r,getApplicative:Qge,getApply:xO,getChain:kO,getChainRec:tye,getMonad:eye,map:cye,mapFst:PO,mapLeft:lye,mapSnd:WO,reduce:vB,reduceRight:gB,sequence:DO,snd:or,swap:Xge,traverse:yB,tuple:fye},Symbol.toStringTag,{value:"Module"})),pye=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function hye(e,t){var n=gx(t,ja(e));return{map:n.map,ap:n.ap,of:n.of,chain:function(r,i){return t.chain(r,function(o){return Gt(o)?t.of(So(o.left)):i(o.right)})},alt:function(r,i){return t.chain(r,function(o){return d_(o)?t.of(o):t.map(i(),function(a){return Gt(a)?So(e.concat(o.left,a.left)):a})})}}}const mye=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:hye},Symbol.toStringTag,{value:"Module"}));var _B=__(void 0),vye={concat:_B.concat,empty:void 0};const gye=Object.freeze(Object.defineProperty({__proto__:null,Monoid:vye,Semigroup:_B},Symbol.toStringTag,{value:"Module"}));var yye=function(e){return function(){return[void 0,e]}},bye=function(e){return function(){var t=e(),n=t[0],r=t[1];return[[n,r],r]}},_ye=function(e){return function(){var t=e(),n=t[0],r=n[0],i=n[1],o=t[1];return[r,i(o)]}},Sye=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,e(i)],i]}}},$ye=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[r,e(i)]}}},Bp=function(e,t){return y(e,SB(t))},SB=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[e(r),i]}}},ks="Writer",$B=function(e){return{URI:ks,_E:void 0,of:function(t){return function(){return[t,e.empty]}}}},qO=function(e){return{URI:ks,_E:void 0,map:Bp,ap:function(t,n){return function(){var r=t(),i=r[0],o=r[1],a=n(),u=a[0],s=a[1];return[i(u),e.concat(o,s)]}}}},TB=function(e){var t=qO(e),n=$B(e);return{URI:ks,_E:void 0,map:Bp,ap:t.ap,of:n.of}};function IB(e){var t=qO(e);return{URI:ks,_E:void 0,map:Bp,ap:t.ap,chain:function(n,r){return function(){var i=n(),o=i[0],a=i[1],u=r(o)(),s=u[0],c=u[1];return[s,e.concat(a,c)]}}}}function Tye(e){var t=TB(e),n=IB(e);return{URI:ks,_E:void 0,map:Bp,ap:t.ap,of:t.of,chain:n.chain}}var UO={URI:ks,map:Bp},Iye=Ke(UO),Oye=function(e){return e()[0]},wye=function(e){return e()[1]},Cye=function(e){return e()[0]},Eye=function(e){return e()[1]},Rye=UO;const Mye=Object.freeze(Object.defineProperty({__proto__:null,Functor:UO,URI:ks,censor:$ye,evalWriter:Cye,evaluate:Oye,execWriter:Eye,execute:wye,flap:Iye,getApplicative:TB,getApply:qO,getChain:IB,getMonad:Tye,getPointed:$B,listen:bye,listens:Sye,map:SB,pass:_ye,tell:yye,writer:Rye},Symbol.toStringTag,{value:"Module"}));function xye(e){var t=function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[r(o),a]})}};return{map:t,evalWriter:function(n){return e.map(n(),function(r){var i=r[0];return i})},execWriter:function(n){return e.map(n(),function(r){r[0];var i=r[1];return i})},tell:function(n){return function(){return e.of([void 0,n])}},listen:function(n){return function(){return e.map(n(),function(r){var i=r[0],o=r[1];return[[i,o],o]})}},pass:function(n){return function(){return e.map(n(),function(r){var i=r[0],o=i[0],a=i[1],u=r[1];return[o,a(u)]})}},listens:function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[[o,r(a)],a]})}},censor:function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[o,r(a)]})}},getMonad:function(n){return{_E:void 0,map:t,of:function(r){return function(){return e.of([r,n.empty])}},ap:function(r,i){return function(){return e.chain(r(),function(o){var a=o[0],u=o[1];return e.map(i(),function(s){var c=s[0],l=s[1];return[a(c),n.concat(u,l)]})})}},chain:function(r,i){return function(){return e.chain(r(),function(o){var a=o[0],u=o[1];return e.map(i(a)(),function(s){var c=s[0],l=s[1];return[c,n.concat(u,l)]})})}}}}}}const mt=Ic(Object.freeze(Object.defineProperty({__proto__:null,alt:NY,alternative:PY,applicative:WY,apply:TG,array:H8,bifunctor:G8,boolean:nX,booleanAlgebra:uX,bounded:fX,boundedDistributiveLattice:hX,boundedJoinSemilattice:mX,boundedLattice:vX,boundedMeetSemilattice:gX,category:yX,chain:IG,chainRec:bX,choice:$X,comonad:TX,compactable:hQ,console:bQ,const:NQ,contravariant:FQ,date:BQ,distributiveLattice:dX,either:oF,eitherT:xee,endomorphism:Aee,eq:lG,extend:Nee,field:Wee,filterable:jee,filterableWithIndex:Dee,foldable:Vee,foldableWithIndex:Gee,fromEither:LY,fromIO:Yee,fromReader:gte,fromState:Wte,fromTask:Lte,fromThese:jte,function:XR,functor:fG,functorWithIndex:qte,group:Ute,heytingAlgebra:Bte,hkt:zte,identity:dne,invariant:pne,io:kne,ioEither:kre,ioOption:Oie,ioRef:Cie,joinSemilattice:Eie,json:xie,lattice:kie,magma:UG,map:qoe,meetSemilattice:Uoe,monad:Boe,monadIO:zoe,monadTask:Koe,monadThrow:Voe,monoid:oae,naturalTransformation:aae,nonEmptyArray:MJ,number:WJ,option:dQ,optionT:Nre,ord:LG,ordering:pae,pipeable:xae,pointed:kae,predicate:EX,profunctor:Aae,random:Wae,reader:vte,readerEither:Aue,readerT:Pue,readerTask:zse,readerTaskEither:gfe,readonlyArray:cZ,readonlyMap:ooe,readonlyNonEmptyArray:D9,readonlyRecord:kY,readonlySet:Nfe,readonlyTuple:Yfe,record:Jde,refinement:ope,ring:cpe,semigroup:OM,semigroupoid:lpe,semiring:dpe,separated:yG,set:Npe,show:Dpe,state:Pte,stateReaderTaskEither:eme,stateT:Upe,store:cme,string:rY,strong:dme,struct:mme,task:sse,taskEither:ele,taskOption:vve,taskThese:vge,these:Bve,theseT:Kve,traced:Ige,traversable:wge,traversableWithIndex:Cge,tree:Zge,tuple:dye,unfoldable:pye,validationT:mye,void:gye,witherable:iY,writer:Mye,writerT:Object.freeze(Object.defineProperty({__proto__:null,getWriterM:xye},Symbol.toStringTag,{value:"Module"})),zero:LJ},Symbol.toStringTag,{value:"Module"})));var BO={},As={},vn={},zO={},OB;function Qe(){return OB||(OB=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getEndomorphismMonoid=e.not=e.SK=e.hole=e.pipe=e.untupled=e.tupled=e.absurd=e.decrement=e.increment=e.tuple=e.flow=e.flip=e.constVoid=e.constUndefined=e.constNull=e.constFalse=e.constTrue=e.constant=e.unsafeCoerce=e.identity=e.apply=e.getRing=e.getSemiring=e.getMonoid=e.getSemigroup=e.getBooleanAlgebra=void 0;var t=function($){return function(){return{meet:function(T,R){return function(E){return $.meet(T(E),R(E))}},join:function(T,R){return function(E){return $.join(T(E),R(E))}},zero:function(){return $.zero},one:function(){return $.one},implies:function(T,R){return function(E){return $.implies(T(E),R(E))}},not:function(T){return function(R){return $.not(T(R))}}}}};e.getBooleanAlgebra=t;var n=function($){return function(){return{concat:function(T,R){return function(E){return $.concat(T(E),R(E))}}}}};e.getSemigroup=n;var r=function($){var T=(0,e.getSemigroup)($);return function(){return{concat:T().concat,empty:function(){return $.empty}}}};e.getMonoid=r;var i=function($){return{add:function(T,R){return function(E){return $.add(T(E),R(E))}},zero:function(){return $.zero},mul:function(T,R){return function(E){return $.mul(T(E),R(E))}},one:function(){return $.one}}};e.getSemiring=i;var o=function($){var T=(0,e.getSemiring)($);return{add:T.add,mul:T.mul,one:T.one,zero:T.zero,sub:function(R,E){return function(q){return $.sub(R(q),E(q))}}}};e.getRing=o;var a=function($){return function(T){return T($)}};e.apply=a;function u($){return $}e.identity=u,e.unsafeCoerce=u;function s($){return function(){return $}}e.constant=s,e.constTrue=s(!0),e.constFalse=s(!1),e.constNull=s(null),e.constUndefined=s(void 0),e.constVoid=e.constUndefined;function c($){return function(T,R){return $(R,T)}}e.flip=c;function l($,T,R,E,q,Y,N,Z,ie){switch(arguments.length){case 1:return $;case 2:return function(){return T($.apply(this,arguments))};case 3:return function(){return R(T($.apply(this,arguments)))};case 4:return function(){return E(R(T($.apply(this,arguments))))};case 5:return function(){return q(E(R(T($.apply(this,arguments)))))};case 6:return function(){return Y(q(E(R(T($.apply(this,arguments))))))};case 7:return function(){return N(Y(q(E(R(T($.apply(this,arguments)))))))};case 8:return function(){return Z(N(Y(q(E(R(T($.apply(this,arguments))))))))};case 9:return function(){return ie(Z(N(Y(q(E(R(T($.apply(this,arguments)))))))))}}}e.flow=l;function f(){for(var $=[],T=0;T<arguments.length;T++)$[T]=arguments[T];return $}e.tuple=f;function d($){return $+1}e.increment=d;function p($){return $-1}e.decrement=p;function h($){throw new Error("Called `absurd` function which should be uncallable")}e.absurd=h;function v($){return function(T){return $.apply(void 0,T)}}e.tupled=v;function m($){return function(){for(var T=[],R=0;R<arguments.length;R++)T[R]=arguments[R];return $(T)}}e.untupled=m;function _($,T,R,E,q,Y,N,Z,ie){switch(arguments.length){case 1:return $;case 2:return T($);case 3:return R(T($));case 4:return E(R(T($)));case 5:return q(E(R(T($))));case 6:return Y(q(E(R(T($)))));case 7:return N(Y(q(E(R(T($))))));case 8:return Z(N(Y(q(E(R(T($)))))));case 9:return ie(Z(N(Y(q(E(R(T($))))))));default:{for(var J=arguments[0],ye=1;ye<arguments.length;ye++)J=arguments[ye](J);return J}}}e.pipe=_,e.hole=h;var g=function($,T){return T};e.SK=g;function S($){return function(T){return!$(T)}}e.not=S;var b=function(){return{concat:function($,T){return l($,T)},empty:u}};e.getEndomorphismMonoid=b}(zO)),zO}var qe={},wB;function dy(){if(wB)return qe;wB=1;var e=he&&he.__spreadArray||function(p,h,v){if(v||arguments.length===2)for(var m=0,_=h.length,g;m<_;m++)(g||!(m in h))&&(g||(g=Array.prototype.slice.call(h,0,m)),g[m]=h[m]);return p.concat(g||Array.prototype.slice.call(h))};Object.defineProperty(qe,"__esModule",{value:!0}),qe.fromReadonlyNonEmptyArray=qe.has=qe.emptyRecord=qe.emptyReadonlyArray=qe.tail=qe.head=qe.isNonEmpty=qe.singleton=qe.right=qe.left=qe.isRight=qe.isLeft=qe.some=qe.none=qe.isSome=qe.isNone=void 0;var t=function(p){return p._tag==="None"};qe.isNone=t;var n=function(p){return p._tag==="Some"};qe.isSome=n,qe.none={_tag:"None"};var r=function(p){return{_tag:"Some",value:p}};qe.some=r;var i=function(p){return p._tag==="Left"};qe.isLeft=i;var o=function(p){return p._tag==="Right"};qe.isRight=o;var a=function(p){return{_tag:"Left",left:p}};qe.left=a;var u=function(p){return{_tag:"Right",right:p}};qe.right=u;var s=function(p){return[p]};qe.singleton=s;var c=function(p){return p.length>0};qe.isNonEmpty=c;var l=function(p){return p[0]};qe.head=l;var f=function(p){return p.slice(1)};qe.tail=f,qe.emptyReadonlyArray=[],qe.emptyRecord={},qe.has=Object.prototype.hasOwnProperty;var d=function(p){return e([p[0]],p.slice(1),!0)};return qe.fromReadonlyNonEmptyArray=d,qe}var CB;function EB(){if(CB)return vn;CB=1;var e=he&&he.__createBinding||(Object.create?function(m,_,g,S){S===void 0&&(S=g);var b=Object.getOwnPropertyDescriptor(_,g);(!b||("get"in b?!_.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return _[g]}}),Object.defineProperty(m,S,b)}:function(m,_,g,S){S===void 0&&(S=g),m[S]=_[g]}),t=he&&he.__setModuleDefault||(Object.create?function(m,_){Object.defineProperty(m,"default",{enumerable:!0,value:_})}:function(m,_){m.default=_}),n=he&&he.__importStar||function(m){if(m&&m.__esModule)return m;var _={};if(m!=null)for(var g in m)g!=="default"&&Object.prototype.hasOwnProperty.call(m,g)&&e(_,m,g);return t(_,m),_};Object.defineProperty(vn,"__esModule",{value:!0}),vn.sequenceS=vn.sequenceT=vn.getApplySemigroup=vn.apS=vn.apSecond=vn.apFirst=vn.ap=void 0;var r=Qe(),i=n(dy());function o(m,_){return function(g){return function(S){return m.ap(m.map(S,function(b){return function($){return _.ap(b,$)}}),g)}}}vn.ap=o;function a(m){return function(_){return function(g){return m.ap(m.map(g,function(S){return function(){return S}}),_)}}}vn.apFirst=a;function u(m){return function(_){return function(g){return m.ap(m.map(g,function(){return function(S){return S}}),_)}}}vn.apSecond=u;function s(m){return function(_,g){return function(S){return m.ap(m.map(S,function(b){return function($){var T;return Object.assign({},b,(T={},T[_]=$,T))}}),g)}}}vn.apS=s;function c(m){return function(_){return{concat:function(g,S){return m.ap(m.map(g,function(b){return function($){return _.concat(b,$)}}),S)}}}}vn.getApplySemigroup=c;function l(m,_,g){return function(S){for(var b=Array(g.length+1),$=0;$<g.length;$++)b[$]=g[$];return b[g.length]=S,_===0?m.apply(null,b):l(m,_-1,b)}}var f={1:function(m){return[m]},2:function(m){return function(_){return[m,_]}},3:function(m){return function(_){return function(g){return[m,_,g]}}},4:function(m){return function(_){return function(g){return function(S){return[m,_,g,S]}}}},5:function(m){return function(_){return function(g){return function(S){return function(b){return[m,_,g,S,b]}}}}}};function d(m){return i.has.call(f,m)||(f[m]=l(r.tuple,m-1,[])),f[m]}function p(m){return function(){for(var _=[],g=0;g<arguments.length;g++)_[g]=arguments[g];for(var S=_.length,b=d(S),$=m.map(_[0],b),T=1;T<S;T++)$=m.ap($,_[T]);return $}}vn.sequenceT=p;function h(m){var _=m.length;switch(_){case 1:return function(g){var S;return S={},S[m[0]]=g,S};case 2:return function(g){return function(S){var b;return b={},b[m[0]]=g,b[m[1]]=S,b}};case 3:return function(g){return function(S){return function(b){var $;return $={},$[m[0]]=g,$[m[1]]=S,$[m[2]]=b,$}}};case 4:return function(g){return function(S){return function(b){return function($){var T;return T={},T[m[0]]=g,T[m[1]]=S,T[m[2]]=b,T[m[3]]=$,T}}}};case 5:return function(g){return function(S){return function(b){return function($){return function(T){var R;return R={},R[m[0]]=g,R[m[1]]=S,R[m[2]]=b,R[m[3]]=$,R[m[4]]=T,R}}}}};default:return l(function(){for(var g=[],S=0;S<arguments.length;S++)g[S]=arguments[S];for(var b={},$=0;$<_;$++)b[m[$]]=g[$];return b},_-1,[])}}function v(m){return function(_){for(var g=Object.keys(_),S=g.length,b=h(g),$=m.map(_[g[0]],b),T=1;T<S;T++)$=m.ap($,_[g[T]]);return $}}return vn.sequenceS=v,vn}var Ti={},RB;function KO(){if(RB)return Ti;RB=1,Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.getFunctorComposition=Ti.bindTo=Ti.flap=Ti.map=void 0;var e=Qe();function t(o,a){return function(u){return function(s){return o.map(s,function(c){return a.map(c,u)})}}}Ti.map=t;function n(o){return function(a){return function(u){return o.map(u,function(s){return s(a)})}}}Ti.flap=n;function r(o){return function(a){return function(u){return o.map(u,function(s){var c;return c={},c[a]=s,c})}}}Ti.bindTo=r;function i(o,a){var u=t(o,a);return{map:function(s,c){return(0,e.pipe)(s,u(c))}}}return Ti.getFunctorComposition=i,Ti}var MB;function kye(){if(MB)return As;MB=1,Object.defineProperty(As,"__esModule",{value:!0}),As.getApplicativeComposition=As.getApplicativeMonoid=void 0;var e=EB(),t=Qe(),n=KO();function r(o){var a=(0,e.getApplySemigroup)(o);return function(u){return{concat:a(u).concat,empty:o.of(u.empty)}}}As.getApplicativeMonoid=r;function i(o,a){var u=(0,n.getFunctorComposition)(o,a).map,s=(0,e.ap)(o,a);return{map:u,of:function(c){return o.of(a.of(c))},ap:function(c,l){return(0,t.pipe)(c,s(l))}}}return As.getApplicativeComposition=i,As}var Ns={},xB;function kB(){if(xB)return Ns;xB=1,Object.defineProperty(Ns,"__esModule",{value:!0}),Ns.bind=Ns.chainFirst=void 0;function e(n){return function(r){return function(i){return n.chain(i,function(o){return n.map(r(o),function(){return o})})}}}Ns.chainFirst=e;function t(n){return function(r,i){return function(o){return n.chain(o,function(a){return n.map(i(a),function(u){var s;return Object.assign({},a,(s={},s[r]=u,s))})})}}}return Ns.bind=t,Ns}var zp={},AB;function Aye(){if(AB)return zp;AB=1,Object.defineProperty(zp,"__esModule",{value:!0}),zp.tailRec=void 0;var e=function(t,n){for(var r=n(t);r._tag==="Left";)r=n(r.left);return r.right};return zp.tailRec=e,zp}var Kt={},NB;function Nye(){if(NB)return Kt;NB=1;var e=he&&he.__createBinding||(Object.create?function(h,v,m,_){_===void 0&&(_=m);var g=Object.getOwnPropertyDescriptor(v,m);(!g||("get"in g?!v.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return v[m]}}),Object.defineProperty(h,_,g)}:function(h,v,m,_){_===void 0&&(_=m),h[_]=v[m]}),t=he&&he.__setModuleDefault||(Object.create?function(h,v){Object.defineProperty(h,"default",{enumerable:!0,value:v})}:function(h,v){h.default=v}),n=he&&he.__importStar||function(h){if(h&&h.__esModule)return h;var v={};if(h!=null)for(var m in h)m!=="default"&&Object.prototype.hasOwnProperty.call(h,m)&&e(v,h,m);return t(v,h),v};Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.filterOrElse=Kt.chainFirstEitherK=Kt.chainEitherK=Kt.fromEitherK=Kt.chainOptionK=Kt.fromOptionK=Kt.fromPredicate=Kt.fromOption=void 0;var r=kB(),i=Qe(),o=n(dy());function a(h){return function(v){return function(m){return h.fromEither(o.isNone(m)?o.left(v()):o.right(m.value))}}}Kt.fromOption=a;function u(h){return function(v,m){return function(_){return h.fromEither(v(_)?o.right(_):o.left(m(_)))}}}Kt.fromPredicate=u;function s(h){var v=a(h);return function(m){var _=v(m);return function(g){return(0,i.flow)(g,_)}}}Kt.fromOptionK=s;function c(h,v){var m=s(h);return function(_){var g=m(_);return function(S){return function(b){return v.chain(b,g(S))}}}}Kt.chainOptionK=c;function l(h){return function(v){return(0,i.flow)(v,h.fromEither)}}Kt.fromEitherK=l;function f(h,v){var m=l(h);return function(_){return function(g){return v.chain(g,m(_))}}}Kt.chainEitherK=f;function d(h,v){return(0,i.flow)(l(h),(0,r.chainFirst)(v))}Kt.chainFirstEitherK=d;function p(h,v){return function(m,_){return function(g){return v.chain(g,function(S){return h.fromEither(m(S)?o.right(S):o.left(_(S)))})}}}return Kt.filterOrElse=p,Kt}var VO={},FB;function Fye(){return FB||(FB=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.right=e.left=e.flap=e.Functor=e.Bifunctor=e.URI=e.bimap=e.mapLeft=e.map=e.separated=void 0;var t=Qe(),n=KO(),r=function(d,p){return{left:d,right:p}};e.separated=r;var i=function(d,p){return(0,t.pipe)(d,(0,e.map)(p))},o=function(d,p){return(0,t.pipe)(d,(0,e.mapLeft)(p))},a=function(d,p,h){return(0,t.pipe)(d,(0,e.bimap)(p,h))},u=function(d){return function(p){return(0,e.separated)((0,e.left)(p),d((0,e.right)(p)))}};e.map=u;var s=function(d){return function(p){return(0,e.separated)(d((0,e.left)(p)),(0,e.right)(p))}};e.mapLeft=s;var c=function(d,p){return function(h){return(0,e.separated)(d((0,e.left)(h)),p((0,e.right)(h)))}};e.bimap=c,e.URI="Separated",e.Bifunctor={URI:e.URI,mapLeft:o,bimap:a},e.Functor={URI:e.URI,map:i},e.flap=(0,n.flap)(e.Functor);var l=function(d){return d.left};e.left=l;var f=function(d){return d.right};e.right=f}(VO)),VO}var ia={},PB;function Pye(){if(PB)return ia;PB=1;var e=he&&he.__createBinding||(Object.create?function(u,s,c,l){l===void 0&&(l=c);var f=Object.getOwnPropertyDescriptor(s,c);(!f||("get"in f?!s.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return s[c]}}),Object.defineProperty(u,l,f)}:function(u,s,c,l){l===void 0&&(l=c),u[l]=s[c]}),t=he&&he.__setModuleDefault||(Object.create?function(u,s){Object.defineProperty(u,"default",{enumerable:!0,value:s})}:function(u,s){u.default=s}),n=he&&he.__importStar||function(u){if(u&&u.__esModule)return u;var s={};if(u!=null)for(var c in u)c!=="default"&&Object.prototype.hasOwnProperty.call(u,c)&&e(s,u,c);return t(s,u),s};Object.defineProperty(ia,"__esModule",{value:!0}),ia.filterE=ia.witherDefault=ia.wiltDefault=void 0;var r=n(dy());function i(u,s){return function(c){var l=u.traverse(c);return function(f,d){return c.map(l(f,d),s.separate)}}}ia.wiltDefault=i;function o(u,s){return function(c){var l=u.traverse(c);return function(f,d){return c.map(l(f,d),s.compact)}}}ia.witherDefault=o;function a(u){return function(s){var c=u.wither(s);return function(l){return function(f){return c(f,function(d){return s.map(l(d),function(p){return p?r.some(d):r.none})})}}}}return ia.filterE=a,ia}var WB;function jn(){return WB||(WB=1,function(e){var t=he&&he.__createBinding||(Object.create?function(P,A,j,Pe){Pe===void 0&&(Pe=j);var W=Object.getOwnPropertyDescriptor(A,j);(!W||("get"in W?!A.__esModule:W.writable||W.configurable))&&(W={enumerable:!0,get:function(){return A[j]}}),Object.defineProperty(P,Pe,W)}:function(P,A,j,Pe){Pe===void 0&&(Pe=j),P[Pe]=A[j]}),n=he&&he.__setModuleDefault||(Object.create?function(P,A){Object.defineProperty(P,"default",{enumerable:!0,value:A})}:function(P,A){P.default=A}),r=he&&he.__importStar||function(P){if(P&&P.__esModule)return P;var A={};if(P!=null)for(var j in P)j!=="default"&&Object.prototype.hasOwnProperty.call(P,j)&&t(A,P,j);return n(A,P),A};Object.defineProperty(e,"__esModule",{value:!0}),e.fold=e.match=e.foldW=e.matchW=e.isRight=e.isLeft=e.fromOption=e.fromPredicate=e.FromEither=e.MonadThrow=e.throwError=e.ChainRec=e.Extend=e.extend=e.Alt=e.alt=e.altW=e.Bifunctor=e.mapLeft=e.bimap=e.Traversable=e.sequence=e.traverse=e.Foldable=e.reduceRight=e.foldMap=e.reduce=e.Monad=e.Chain=e.chain=e.chainW=e.Applicative=e.Apply=e.ap=e.apW=e.Pointed=e.of=e.Functor=e.map=e.getAltValidation=e.getApplicativeValidation=e.getWitherable=e.getFilterable=e.getCompactable=e.getSemigroup=e.getEq=e.getShow=e.URI=e.right=e.left=void 0,e.getValidation=e.getValidationMonoid=e.getValidationSemigroup=e.getApplyMonoid=e.getApplySemigroup=e.either=e.stringifyJSON=e.parseJSON=e.sequenceArray=e.traverseArray=e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex=e.traverseReadonlyNonEmptyArrayWithIndex=e.ApT=e.apSW=e.apS=e.bindW=e.bind=e.bindTo=e.Do=e.exists=e.elem=e.toError=e.toUnion=e.chainNullableK=e.fromNullableK=e.tryCatchK=e.tryCatch=e.fromNullable=e.orElse=e.orElseW=e.swap=e.filterOrElseW=e.filterOrElse=e.chainOptionK=e.fromOptionK=e.duplicate=e.flatten=e.flattenW=e.chainFirstW=e.chainFirst=e.apSecondW=e.apSecond=e.apFirstW=e.apFirst=e.flap=e.getOrElse=e.getOrElseW=void 0;var i=kye(),o=EB(),a=kB(),u=Aye(),s=Nye(),c=Qe(),l=KO(),f=r(dy()),d=Fye(),p=Pye();e.left=f.left,e.right=f.right;var h=function(P,A){return(0,c.pipe)(P,(0,e.map)(A))},v=function(P,A){return(0,c.pipe)(P,(0,e.ap)(A))},m=function(P,A){return(0,c.pipe)(P,(0,e.chain)(A))},_=function(P,A,j){return(0,c.pipe)(P,(0,e.reduce)(A,j))},g=function(P){return function(A,j){var Pe=(0,e.foldMap)(P);return(0,c.pipe)(A,Pe(j))}},S=function(P,A,j){return(0,c.pipe)(P,(0,e.reduceRight)(A,j))},b=function(P){var A=(0,e.traverse)(P);return function(j,Pe){return(0,c.pipe)(j,A(Pe))}},$=function(P,A,j){return(0,c.pipe)(P,(0,e.bimap)(A,j))},T=function(P,A){return(0,c.pipe)(P,(0,e.mapLeft)(A))},R=function(P,A){return(0,c.pipe)(P,(0,e.alt)(A))},E=function(P,A){return(0,c.pipe)(P,(0,e.extend)(A))},q=function(P,A){return(0,u.tailRec)(A(P),function(j){return(0,e.isLeft)(j)?(0,e.right)((0,e.left)(j.left)):(0,e.isLeft)(j.right)?(0,e.left)(A(j.right.left)):(0,e.right)((0,e.right)(j.right.right))})};e.URI="Either";var Y=function(P,A){return{show:function(j){return(0,e.isLeft)(j)?"left(".concat(P.show(j.left),")"):"right(".concat(A.show(j.right),")")}}};e.getShow=Y;var N=function(P,A){return{equals:function(j,Pe){return j===Pe||((0,e.isLeft)(j)?(0,e.isLeft)(Pe)&&P.equals(j.left,Pe.left):(0,e.isRight)(Pe)&&A.equals(j.right,Pe.right))}}};e.getEq=N;var Z=function(P){return{concat:function(A,j){return(0,e.isLeft)(j)?A:(0,e.isLeft)(A)?j:(0,e.right)(P.concat(A.right,j.right))}}};e.getSemigroup=Z;var ie=function(P){var A=(0,e.left)(P.empty);return{URI:e.URI,_E:void 0,compact:function(j){return(0,e.isLeft)(j)?j:j.right._tag==="None"?A:(0,e.right)(j.right.value)},separate:function(j){return(0,e.isLeft)(j)?(0,d.separated)(j,j):(0,e.isLeft)(j.right)?(0,d.separated)((0,e.right)(j.right.left),A):(0,d.separated)(A,(0,e.right)(j.right.right))}}};e.getCompactable=ie;var J=function(P){var A=(0,e.left)(P.empty),j=(0,e.getCompactable)(P),Pe=j.compact,W=j.separate,ae=function(ve,Ce){return(0,e.isLeft)(ve)||Ce(ve.right)?ve:A},ge=function(ve,Ce){return(0,e.isLeft)(ve)?(0,d.separated)(ve,ve):Ce(ve.right)?(0,d.separated)(A,(0,e.right)(ve.right)):(0,d.separated)((0,e.right)(ve.right),A)};return{URI:e.URI,_E:void 0,map:h,compact:Pe,separate:W,filter:ae,filterMap:function(ve,Ce){if((0,e.isLeft)(ve))return ve;var ct=Ce(ve.right);return ct._tag==="None"?A:(0,e.right)(ct.value)},partition:ge,partitionMap:function(ve,Ce){if((0,e.isLeft)(ve))return(0,d.separated)(ve,ve);var ct=Ce(ve.right);return(0,e.isLeft)(ct)?(0,d.separated)((0,e.right)(ct.left),A):(0,d.separated)(A,(0,e.right)(ct.right))}}};e.getFilterable=J;var ye=function(P){var A=(0,e.getFilterable)(P),j=(0,e.getCompactable)(P);return{URI:e.URI,_E:void 0,map:h,compact:A.compact,separate:A.separate,filter:A.filter,filterMap:A.filterMap,partition:A.partition,partitionMap:A.partitionMap,traverse:b,sequence:e.sequence,reduce:_,foldMap:g,reduceRight:S,wither:(0,p.witherDefault)(e.Traversable,j),wilt:(0,p.wiltDefault)(e.Traversable,j)}};e.getWitherable=ye;var we=function(P){return{URI:e.URI,_E:void 0,map:h,ap:function(A,j){return(0,e.isLeft)(A)?(0,e.isLeft)(j)?(0,e.left)(P.concat(A.left,j.left)):A:(0,e.isLeft)(j)?j:(0,e.right)(A.right(j.right))},of:e.of}};e.getApplicativeValidation=we;var x=function(P){return{URI:e.URI,_E:void 0,map:h,alt:function(A,j){if((0,e.isRight)(A))return A;var Pe=j();return(0,e.isLeft)(Pe)?(0,e.left)(P.concat(A.left,Pe.left)):Pe}}};e.getAltValidation=x;var k=function(P){return function(A){return(0,e.isLeft)(A)?A:(0,e.right)(P(A.right))}};e.map=k,e.Functor={URI:e.URI,map:h},e.of=e.right,e.Pointed={URI:e.URI,of:e.of};var C=function(P){return function(A){return(0,e.isLeft)(A)?A:(0,e.isLeft)(P)?P:(0,e.right)(A.right(P.right))}};e.apW=C,e.ap=e.apW,e.Apply={URI:e.URI,map:h,ap:v},e.Applicative={URI:e.URI,map:h,ap:v,of:e.of};var O=function(P){return function(A){return(0,e.isLeft)(A)?A:P(A.right)}};e.chainW=O,e.chain=e.chainW,e.Chain={URI:e.URI,map:h,ap:v,chain:m},e.Monad={URI:e.URI,map:h,ap:v,of:e.of,chain:m};var F=function(P,A){return function(j){return(0,e.isLeft)(j)?P:A(P,j.right)}};e.reduce=F;var L=function(P){return function(A){return function(j){return(0,e.isLeft)(j)?P.empty:A(j.right)}}};e.foldMap=L;var X=function(P,A){return function(j){return(0,e.isLeft)(j)?P:A(j.right,P)}};e.reduceRight=X,e.Foldable={URI:e.URI,reduce:_,foldMap:g,reduceRight:S};var te=function(P){return function(A){return function(j){return(0,e.isLeft)(j)?P.of((0,e.left)(j.left)):P.map(A(j.right),e.right)}}};e.traverse=te;var xe=function(P){return function(A){return(0,e.isLeft)(A)?P.of((0,e.left)(A.left)):P.map(A.right,e.right)}};e.sequence=xe,e.Traversable={URI:e.URI,map:h,reduce:_,foldMap:g,reduceRight:S,traverse:b,sequence:e.sequence};var ce=function(P,A){return function(j){return(0,e.isLeft)(j)?(0,e.left)(P(j.left)):(0,e.right)(A(j.right))}};e.bimap=ce;var Ne=function(P){return function(A){return(0,e.isLeft)(A)?(0,e.left)(P(A.left)):A}};e.mapLeft=Ne,e.Bifunctor={URI:e.URI,bimap:$,mapLeft:T};var ze=function(P){return function(A){return(0,e.isLeft)(A)?P():A}};e.altW=ze,e.alt=e.altW,e.Alt={URI:e.URI,map:h,alt:R};var He=function(P){return function(A){return(0,e.isLeft)(A)?A:(0,e.right)(P(A))}};e.extend=He,e.Extend={URI:e.URI,map:h,extend:E},e.ChainRec={URI:e.URI,map:h,ap:v,chain:m,chainRec:q},e.throwError=e.left,e.MonadThrow={URI:e.URI,map:h,ap:v,of:e.of,chain:m,throwError:e.throwError},e.FromEither={URI:e.URI,fromEither:c.identity},e.fromPredicate=(0,s.fromPredicate)(e.FromEither),e.fromOption=(0,s.fromOption)(e.FromEither),e.isLeft=f.isLeft,e.isRight=f.isRight;var it=function(P,A){return function(j){return(0,e.isLeft)(j)?P(j.left):A(j.right)}};e.matchW=it,e.foldW=e.matchW,e.match=e.matchW,e.fold=e.match;var Ft=function(P){return function(A){return(0,e.isLeft)(A)?P(A.left):A.right}};e.getOrElseW=Ft,e.getOrElse=e.getOrElseW,e.flap=(0,l.flap)(e.Functor),e.apFirst=(0,o.apFirst)(e.Apply),e.apFirstW=e.apFirst,e.apSecond=(0,o.apSecond)(e.Apply),e.apSecondW=e.apSecond,e.chainFirst=(0,a.chainFirst)(e.Chain),e.chainFirstW=e.chainFirst,e.flattenW=(0,e.chainW)(c.identity),e.flatten=e.flattenW,e.duplicate=(0,e.extend)(c.identity),e.fromOptionK=(0,s.fromOptionK)(e.FromEither),e.chainOptionK=(0,s.chainOptionK)(e.FromEither,e.Chain),e.filterOrElse=(0,s.filterOrElse)(e.FromEither,e.Chain),e.filterOrElseW=e.filterOrElse;var qt=function(P){return(0,e.isLeft)(P)?(0,e.right)(P.left):(0,e.left)(P.right)};e.swap=qt;var Ht=function(P){return function(A){return(0,e.isLeft)(A)?P(A.left):A}};e.orElseW=Ht,e.orElse=e.orElseW;var xn=function(P){return function(A){return A==null?(0,e.left)(P):(0,e.right)(A)}};e.fromNullable=xn;var Ar=function(P,A){try{return(0,e.right)(P())}catch(j){return(0,e.left)(A(j))}};e.tryCatch=Ar;var fr=function(P,A){return function(){for(var j=[],Pe=0;Pe<arguments.length;Pe++)j[Pe]=arguments[Pe];return(0,e.tryCatch)(function(){return P.apply(void 0,j)},A)}};e.tryCatchK=fr;var Q=function(P){var A=(0,e.fromNullable)(P);return function(j){return(0,c.flow)(j,A)}};e.fromNullableK=Q;var re=function(P){var A=(0,e.fromNullableK)(P);return function(j){return(0,e.chain)(A(j))}};e.chainNullableK=re,e.toUnion=(0,e.foldW)(c.identity,c.identity);function ke(P){return P instanceof Error?P:new Error(String(P))}e.toError=ke;function Ot(P){return function(A,j){if(j===void 0){var Pe=Ot(P);return function(W){return Pe(A,W)}}return(0,e.isLeft)(j)?!1:P.equals(A,j.right)}}e.elem=Ot;var ei=function(P){return function(A){return(0,e.isLeft)(A)?!1:P(A.right)}};e.exists=ei,e.Do=(0,e.of)(f.emptyRecord),e.bindTo=(0,l.bindTo)(e.Functor),e.bind=(0,a.bind)(e.Chain),e.bindW=e.bind,e.apS=(0,o.apS)(e.Apply),e.apSW=e.apS,e.ApT=(0,e.of)(f.emptyReadonlyArray);var qi=function(P){return function(A){var j=P(0,f.head(A));if((0,e.isLeft)(j))return j;for(var Pe=[j.right],W=1;W<A.length;W++){var ae=P(W,A[W]);if((0,e.isLeft)(ae))return ae;Pe.push(ae.right)}return(0,e.right)(Pe)}};e.traverseReadonlyNonEmptyArrayWithIndex=qi;var Ui=function(P){var A=(0,e.traverseReadonlyNonEmptyArrayWithIndex)(P);return function(j){return f.isNonEmpty(j)?A(j):e.ApT}};e.traverseReadonlyArrayWithIndex=Ui,e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex;var Oa=function(P){return(0,e.traverseReadonlyArrayWithIndex)(function(A,j){return P(j)})};e.traverseArray=Oa,e.sequenceArray=(0,e.traverseArray)(c.identity);function wa(P,A){return(0,e.tryCatch)(function(){return JSON.parse(P)},A)}e.parseJSON=wa;var Ca=function(P,A){return(0,e.tryCatch)(function(){var j=JSON.stringify(P);if(typeof j!="string")throw new Error("Converting unsupported structure to JSON");return j},A)};e.stringifyJSON=Ca,e.either={URI:e.URI,map:h,of:e.of,ap:v,chain:m,reduce:_,foldMap:g,reduceRight:S,traverse:b,sequence:e.sequence,bimap:$,mapLeft:T,alt:R,extend:E,chainRec:q,throwError:e.throwError},e.getApplySemigroup=(0,o.getApplySemigroup)(e.Apply),e.getApplyMonoid=(0,i.getApplicativeMonoid)(e.Applicative);var ti=function(P,A){return(0,o.getApplySemigroup)((0,e.getApplicativeValidation)(P))(A)};e.getValidationSemigroup=ti;var Fu=function(P,A){return(0,i.getApplicativeMonoid)((0,e.getApplicativeValidation)(P))(A)};e.getValidationMonoid=Fu;function Wf(P){var A=(0,e.getApplicativeValidation)(P).ap,j=(0,e.getAltValidation)(P).alt;return{URI:e.URI,_E:void 0,map:h,of:e.of,chain:m,bimap:$,mapLeft:T,reduce:_,foldMap:g,reduceRight:S,extend:E,traverse:b,sequence:e.sequence,chainRec:q,throwError:e.throwError,ap:A,alt:j}}e.getValidation=Wf}(BO)),BO}var et=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zl=globalThis&&globalThis.__assign||function(){return Zl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Zl.apply(this,arguments)},Wye=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},so=Tt,tt=function(e,t,n){return so([{value:e,context:t,message:n}])},Ee=Ye,Te=function(){function e(t,n,r,i){this.name=t,this.is=n,this.validate=r,this.encode=i,this.decode=this.decode.bind(this)}return e.prototype.pipe=function(t,n){var r=this;return n===void 0&&(n="pipe(".concat(this.name,", ").concat(t.name,")")),new e(n,t.is,function(i,o){var a=r.validate(i,o);return le(a)?a:t.validate(a.right,o)},this.encode===Ue&&t.encode===Ue?Ue:function(i){return r.encode(t.encode(i))})},e.prototype.asDecoder=function(){return this},e.prototype.asEncoder=function(){return this},e.prototype.decode=function(t){return this.validate(t,[{key:"",type:this,actual:t}])},e}(),Ue=function(e){return e};function LB(e){return e.displayName||e.name||"<function".concat(e.length,">")}function Lye(e,t){return{key:e,type:t}}function Ii(e,t,n,r){for(var i=e.length,o=Array(i+1),a=0;a<i;a++)o[a]=e[a];return o[i]={key:t,type:n,actual:r},o}function oa(e,t){for(var n=t.length,r=0;r<n;r++)e.push(t[r])}var Fs=Object.prototype.hasOwnProperty;function HO(e){return Object.keys(e).map(function(t){return"".concat(t,": ").concat(e[t].name)}).join(", ")}function Kp(e){for(var t=0;t<e.length;t++)if(e[t].encode!==Ue)return!1;return!0}function jB(e){return"{ ".concat(HO(e)," }")}function DB(e){return"Partial<".concat(e,">")}function jye(e,t,n,r){r===void 0&&(r="{ [K in ".concat(t.name,"]: ").concat(n.name," }"));var i=e.length;return new nw(r,function(o){return Dn.is(o)&&e.every(function(a){return n.is(o[a])})},function(o,a){var u=Dn.validate(o,a);if(le(u))return u;for(var s=u.right,c={},l=[],f=!1,d=0;d<i;d++){var p=e[d],h=s[p],v=n.validate(h,Ii(a,p,n,h));if(le(v))oa(l,v.left);else{var m=v.right;f=f||m!==h,c[p]=m}}return l.length>0?so(l):Ee(f||Object.keys(s).length!==i?c:s)},n.encode===Ue?Ue:function(o){for(var a={},u=0;u<i;u++){var s=e[u];a[s]=n.encode(o[s])}return a},t,n)}function GO(e){var t;if(KB(e)){var n=e.value;if(Oi.is(n))return t={},t[n]=null,t}else{if(Kye(e))return e.keys;if(HB(e)){var r=e.types.map(function(i){return GO(i)});return r.some(py.is)?void 0:Object.assign.apply(Object,Wye([{}],r,!1))}}}function Dye(e,t,n){return n===void 0&&(n="{ [K in ".concat(e.name,"]: ").concat(t.name," }")),new nw(n,function(r){return Dn.is(r)?Object.keys(r).every(function(i){return e.is(i)&&t.is(r[i])}):zB(t)&&Array.isArray(r)},function(r,i){if(Dn.is(r)){for(var o={},a=[],u=Object.keys(r),s=u.length,c=!1,l=0;l<s;l++){var f=u[l],d=r[f],p=e.validate(f,Ii(i,f,e,f));if(le(p))oa(a,p.left);else{var h=p.right;c=c||h!==f,f=h;var v=t.validate(d,Ii(i,f,t,d));if(le(v))oa(a,v.left);else{var m=v.right;c=c||m!==d,o[f]=m}}}return a.length>0?so(a):Ee(c?o:r)}return zB(t)&&Array.isArray(r)?Ee(r):tt(r,i)},e.encode===Ue&&t.encode===Ue?Ue:function(r){for(var i={},o=Object.keys(r),a=o.length,u=0;u<a;u++){var s=o[u];i[String(e.encode(s))]=t.encode(r[s])}return i},e,t)}function qB(e){return"("+e.map(function(t){return t.name}).join(" | ")+")"}function YO(e,t){for(var n=!0,r=!0,i=!Dn.is(e),o=0,a=t;o<a.length;o++){var u=a[o];u!==e&&(n=!1),Dn.is(u)&&(r=!1)}if(n)return e;if(r)return t[t.length-1];for(var s={},c=0,l=t;c<l.length;c++){var u=l[c];for(var f in u)(!Fs.call(s,f)||i||u[f]!==e[f])&&(s[f]=u[f])}return s}function JO(e){switch(e._tag){case"RefinementType":case"ReadonlyType":return JO(e.type);case"InterfaceType":case"StrictType":case"PartialType":return e.props;case"IntersectionType":return e.types.reduce(function(t,n){return Object.assign(t,JO(n))},{})}}function UB(e,t){for(var n=Object.getOwnPropertyNames(e),r=!1,i={},o=0;o<n.length;o++){var a=n[o];Fs.call(t,a)?i[a]=e[a]:r=!0}return r?i:e}function qye(e){return VB(e)?"{| ".concat(HO(e.props)," |}"):Vye(e)?DB("{| ".concat(HO(e.props)," |}")):"Exact<".concat(e.name,">")}function Uye(e){return e.length>0}var ar={};function BB(e,t){for(var n=[],r=0,i=e;r<i.length;r++){var o=i[r];t.indexOf(o)!==-1&&n.push(o)}return n}function Bye(e,t){if(e===ar)return t;if(t===ar)return e;var n=Object.assign({},e);for(var r in t)if(Fs.call(e,r)){var i=BB(e[r],t[r]);if(Uye(i))n[r]=i;else{n=ar;break}}else n[r]=t[r];return n}function zye(e,t){if(e===ar||t===ar)return ar;var n=ar;for(var r in e)if(Fs.call(t,r)){var i=BB(e[r],t[r]);i.length===0&&(n===ar&&(n={}),n[r]=e[r].concat(t[r]))}return n}function zB(e){return e._tag==="AnyType"}function KB(e){return e._tag==="LiteralType"}function Kye(e){return e._tag==="KeyofType"}function VB(e){return e._tag==="InterfaceType"}function Vye(e){return e._tag==="PartialType"}function Hye(e){return e._tag==="StrictType"}function Gye(e){return e._tag==="ExactType"}function Yye(e){return e._tag==="RefinementType"}function Jye(e){return e._tag==="IntersectionType"}function HB(e){return e._tag==="UnionType"}function Zye(e){return e._tag==="RecursiveType"}var ZO=[];function ou(e){if(ZO.indexOf(e)!==-1)return ar;if(VB(e)||Hye(e)){var t=ar;for(var n in e.props){var r=e.props[n];KB(r)&&(t===ar&&(t={}),t[n]=[r.value])}return t}else{if(Gye(e)||Yye(e))return ou(e.type);if(Jye(e))return e.types.reduce(function(o,a){return Bye(o,ou(a))},ar);if(HB(e))return e.types.slice(1).reduce(function(o,a){return zye(o,ou(a))},ou(e.types[0]));if(Zye(e)){ZO.push(e);var i=ou(e.type);return ZO.pop(),i}}return ar}function GB(e){var t=ou(e[0]),n=Object.keys(t),r=e.length,i=function(c){for(var l=t[c].slice(),f=[t[c]],d=1;d<r;d++){var p=e[d],h=ou(p),v=h[c];if(v===void 0)return"continue-keys";if(v.some(function(m){return l.indexOf(m)!==-1}))return"continue-keys";l.push.apply(l,v),f.push(v)}return{value:[c,f]}};e:for(var o=0,a=n;o<a.length;o++){var u=a[o],s=i(u);if(typeof s=="object")return s.value;switch(s){case"continue-keys":continue e}}}var YB=function(e){et(t,e);function t(){var n=e.call(this,"null",function(r){return r===null},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="NullType",n}return t}(Te),XO=new YB,JB=function(e){et(t,e);function t(){var n=e.call(this,"undefined",function(r){return r===void 0},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="UndefinedType",n}return t}(Te),py=new JB,ZB=function(e){et(t,e);function t(){var n=e.call(this,"void",py.is,py.validate,Ue)||this;return n._tag="VoidType",n}return t}(Te),XB=new ZB,QB=function(e){et(t,e);function t(){var n=e.call(this,"unknown",function(r){return!0},Ee,Ue)||this;return n._tag="UnknownType",n}return t}(Te),Xye=new QB,e2=function(e){et(t,e);function t(){var n=e.call(this,"string",function(r){return typeof r=="string"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="StringType",n}return t}(Te),Oi=new e2,t2=function(e){et(t,e);function t(){var n=e.call(this,"number",function(r){return typeof r=="number"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="NumberType",n}return t}(Te),Ps=new t2,n2=function(e){et(t,e);function t(){var n=e.call(this,"bigint",function(r){return typeof r=="bigint"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="BigIntType",n}return t}(Te),Qye=new n2,r2=function(e){et(t,e);function t(){var n=e.call(this,"boolean",function(r){return typeof r=="boolean"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="BooleanType",n}return t}(Te),hy=new r2,i2=function(e){et(t,e);function t(){var n=e.call(this,"UnknownArray",Array.isArray,function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="AnyArrayType",n}return t}(Te),Xl=new i2,o2=function(e){et(t,e);function t(){var n=e.call(this,"UnknownRecord",function(r){var i=Object.prototype.toString.call(r);return i==="[object Object]"||i==="[object Window]"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="AnyDictionaryType",n}return t}(Te),Dn=new o2,a2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.value=a,u._tag="LiteralType",u}return t}(Te);function Vp(e,t){t===void 0&&(t=JSON.stringify(e));var n=function(r){return r===e};return new a2(t,n,function(r,i){return n(r)?Ee(e):tt(r,i)},Ue,e)}var u2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.keys=a,u._tag="KeyofType",u}return t}(Te);function ebe(e,t){t===void 0&&(t=Object.keys(e).map(function(r){return JSON.stringify(r)}).join(" | "));var n=function(r){return Oi.is(r)&&Fs.call(e,r)};return new u2(t,n,function(r,i){return n(r)?Ee(r):tt(r,i)},Ue,e)}var s2=function(e){et(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o)||this;return s.type=a,s.predicate=u,s._tag="RefinementType",s}return t}(Te);function my(e,t,n){return ow(e,t,n)}var vy=my(Ps,function(e){return Number.isInteger(e)},"Int"),QO=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.runDefinition=a,u._tag="RecursiveType",u}return t}(Te);Object.defineProperty(QO.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});function ew(e,t){var n,r=function(){return n||(n=t(i),n.name=e),n},i=new QO(e,function(o){return r().is(o)},function(o,a){return r().validate(o,a)},function(o){return r().encode(o)},r);return i}var c2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ArrayType",u}return t}(Te);function gy(e,t){return t===void 0&&(t="Array<".concat(e.name,">")),new c2(t,function(n){return Xl.is(n)&&n.every(e.is)},function(n,r){var i=Xl.validate(n,r);if(le(i))return i;for(var o=i.right,a=o.length,u=o,s=[],c=0;c<a;c++){var l=o[c],f=e.validate(l,Ii(r,String(c),e,l));if(le(f))oa(s,f.left);else{var d=f.right;d!==l&&(u===o&&(u=o.slice()),u[c]=d)}}return s.length>0?so(s):Ee(u)},e.encode===Ue?Ue:function(n){return n.map(e.encode)},e)}var l2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="InterfaceType",u}return t}(Te);function tw(e,t){t===void 0&&(t=jB(e));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new l2(t,function(o){if(Dn.is(o)){for(var a=0;a<i;a++){var u=n[a],s=o[u];if(s===void 0&&!Fs.call(o,u)||!r[a].is(s))return!1}return!0}return!1},function(o,a){var u=Dn.validate(o,a);if(le(u))return u;for(var s=u.right,c=s,l=[],f=0;f<i;f++){var d=n[f],p=c[d],h=r[f],v=h.validate(p,Ii(a,d,h,p));if(le(v))oa(l,v.left);else{var m=v.right;(m!==p||m===void 0&&!Fs.call(c,d))&&(c===s&&(c=Zl({},s)),c[d]=m)}}return l.length>0?so(l):Ee(c)},Kp(r)?Ue:function(o){for(var a=Zl({},o),u=0;u<i;u++){var s=n[u],c=r[u].encode;c!==Ue&&(a[s]=c(o[s]))}return a},e)}var f2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="PartialType",u}return t}(Te);function tbe(e,t){t===void 0&&(t=DB(jB(e)));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new f2(t,function(o){if(Dn.is(o)){for(var a=0;a<i;a++){var u=n[a],s=o[u];if(s!==void 0&&!e[u].is(s))return!1}return!0}return!1},function(o,a){var u=Dn.validate(o,a);if(le(u))return u;for(var s=u.right,c=s,l=[],f=0;f<i;f++){var d=n[f],p=c[d],h=e[d],v=h.validate(p,Ii(a,d,h,p));if(le(v))p!==void 0&&oa(l,v.left);else{var m=v.right;m!==p&&(c===s&&(c=Zl({},s)),c[d]=m)}}return l.length>0?so(l):Ee(c)},Kp(r)?Ue:function(o){for(var a=Zl({},o),u=0;u<i;u++){var s=n[u],c=o[s];c!==void 0&&(a[s]=r[u].encode(c))}return a},e)}var nw=function(e){et(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o)||this;return s.domain=a,s.codomain=u,s._tag="DictionaryType",s}return t}(Te);function rw(e,t,n){var r=GO(e);return r?jye(Object.keys(r),e,t,n):Dye(e,t,n)}var iw=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="UnionType",u}return t}(Te);function Hp(e,t){t===void 0&&(t=qB(e));var n=GB(e);if(n!==void 0&&e.length>0){var r=n[0],i=n[1],o=i.length,a=function(u){for(var s=0;s<o;s++)if(i[s].indexOf(u)!==-1)return s};return new yy(t,function(u){if(Dn.is(u)){var s=a(u[r]);return s!==void 0?e[s].is(u):!1}return!1},function(u,s){var c=Dn.validate(u,s);if(le(c))return c;var l=c.right,f=a(l[r]);if(f===void 0)return tt(u,s);var d=e[f];return d.validate(l,Ii(s,String(f),d,l))},Kp(e)?Ue:function(u){var s=a(u[r]);if(s===void 0)throw new Error("no codec found to encode value in union codec ".concat(t));return e[s].encode(u)},e,r)}else return new iw(t,function(u){return e.some(function(s){return s.is(u)})},function(u,s){for(var c=[],l=0;l<e.length;l++){var f=e[l],d=f.validate(u,Ii(s,String(l),f,u));if(le(d))oa(c,d.left);else return Ee(d.right)}return so(c)},Kp(e)?Ue:function(u){for(var s=0,c=e;s<c.length;s++){var l=c[s];if(l.is(u))return l.encode(u)}throw new Error("no codec found to encode value in union type ".concat(t))},e)}var d2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="IntersectionType",u}return t}(Te);function nbe(e,t){t===void 0&&(t="(".concat(e.map(function(r){return r.name}).join(" & "),")"));var n=e.length;return new d2(t,function(r){return e.every(function(i){return i.is(r)})},e.length===0?Ee:function(r,i){for(var o=[],a=[],u=0;u<n;u++){var s=e[u],c=s.validate(r,Ii(i,String(u),s,r));le(c)?oa(a,c.left):o.push(c.right)}return a.length>0?so(a):Ee(YO(r,o))},e.length===0?Ue:function(r){return YO(r,e.map(function(i){return i.encode(r)}))},e)}var p2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="TupleType",u}return t}(Te);function rbe(e,t){t===void 0&&(t="[".concat(e.map(function(r){return r.name}).join(", "),"]"));var n=e.length;return new p2(t,function(r){return Xl.is(r)&&r.length===n&&e.every(function(i,o){return i.is(r[o])})},function(r,i){var o=Xl.validate(r,i);if(le(o))return o;for(var a=o.right,u=a.length>n?a.slice(0,n):a,s=[],c=0;c<n;c++){var l=a[c],f=e[c],d=f.validate(l,Ii(i,String(c),f,l));if(le(d))oa(s,d.left);else{var p=d.right;p!==l&&(u===a&&(u=a.slice()),u[c]=p)}}return s.length>0?so(s):Ee(u)},Kp(e)?Ue:function(r){return e.map(function(i,o){return i.encode(r[o])})},e)}var h2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyType",u}return t}(Te);function ibe(e,t){return t===void 0&&(t="Readonly<".concat(e.name,">")),new h2(t,e.is,e.validate,e.encode,e)}var m2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyArrayType",u}return t}(Te);function v2(e,t){t===void 0&&(t="ReadonlyArray<".concat(e.name,">"));var n=gy(e);return new m2(t,n.is,n.validate,n.encode,e)}var Gp=function(e,t){return y2(tw(e),t)},g2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ExactType",u}return t}(Te);function y2(e,t){t===void 0&&(t=qye(e));var n=JO(e);return new g2(t,e.is,function(r,i){var o=Dn.validate(r,i);if(le(o))return o;var a=e.validate(r,i);return le(a)?a:Ye(UB(a.right,n))},function(r){return e.encode(UB(r,n))},e)}var b2=function(e){et(t,e);function t(){var n=e.call(this,"Function",function(r){return typeof r=="function"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="FunctionType",n}return t}(Te),obe=new b2,yy=function(e){et(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o,a)||this;return s.tag=u,s}return t}(iw),abe=function(e,t,n){n===void 0&&(n=qB(t));var r=Hp(t,n);return r instanceof yy?r:(console.warn("[io-ts] Cannot build a tagged union for ".concat(n,", returning a de-optimized union")),new yy(n,r.is,r.validate,r.encode,t,e))},ube=function(e,t){return{value:e,context:t}},_2=function(e){return[{key:"",type:e}]},S2=function(e){et(t,e);function t(){var n=e.call(this,"never",function(r){return!1},function(r,i){return tt(r,i)},function(){throw new Error("cannot encode never")})||this;return n._tag="NeverType",n}return t}(Te),sbe=new S2,$2=function(e){et(t,e);function t(){var n=e.call(this,"any",function(r){return!0},Ee,Ue)||this;return n._tag="AnyType",n}return t}(Te),cbe=new $2,lbe=Dn,T2=function(e){et(t,e);function t(){var n=e.call(this,"object",function(r){return r!==null&&typeof r=="object"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="ObjectType",n}return t}(Te),fbe=new T2;function ow(e,t,n){return n===void 0&&(n="(".concat(e.name," | ").concat(LB(t),")")),new s2(n,function(r){return e.is(r)&&t(r)},function(r,i){var o=e.validate(r,i);if(le(o))return o;var a=o.right;return t(a)?Ee(a):tt(a,i)},e.encode,e,t)}var dbe=ow(Ps,Number.isInteger,"Integer"),pbe=rw,hbe=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="StrictType",u}return t}(Te);function mbe(e){return e}function vbe(e){return function(){return e}}const ee=Ic(Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:i2,AnyDictionaryType:o2,AnyType:$2,Array:Xl,ArrayType:c2,BigIntType:n2,BooleanType:r2,Dictionary:lbe,DictionaryType:nw,ExactType:g2,Function:obe,FunctionType:b2,Int:vy,Integer:dbe,InterfaceType:l2,IntersectionType:d2,KeyofType:u2,LiteralType:a2,NeverType:S2,NullType:YB,NumberType:t2,ObjectType:T2,PartialType:f2,ReadonlyArrayType:m2,ReadonlyType:h2,RecursiveType:QO,RefinementType:s2,StrictType:hbe,StringType:e2,TaggedUnionType:yy,TupleType:p2,Type:Te,UndefinedType:JB,UnionType:iw,UnknownArray:Xl,UnknownRecord:Dn,UnknownType:QB,VoidType:ZB,alias:vbe,any:cbe,appendContext:Ii,array:gy,bigint:Qye,boolean:hy,brand:my,clean:mbe,dictionary:pbe,emptyTags:ar,exact:y2,failure:tt,failures:so,getContextEntry:Lye,getDefaultContext:_2,getDomainKeys:GO,getFunctionName:LB,getIndex:GB,getTags:ou,getValidationError:ube,identity:Ue,interface:tw,intersection:nbe,keyof:ebe,literal:Vp,mergeAll:YO,never:sbe,null:XO,nullType:XO,number:Ps,object:fbe,partial:tbe,readonly:ibe,readonlyArray:v2,record:rw,recursion:ew,refinement:ow,strict:Gp,string:Oi,success:Ee,taggedUnion:abe,tuple:rbe,type:tw,undefined:py,union:Hp,unknown:Xye,void:XB,voidType:XB},Symbol.toStringTag,{value:"Module"})));var aw={},Yp={},At={};const wi=Ic(XR);function I2(e,t,n){return n===void 0&&(n=e.name),new Te(n,e.is,e.validate,function(r){return t(e.encode(r))})}const gbe=Ic(Object.freeze(Object.defineProperty({__proto__:null,mapOutput:I2},Symbol.toStringTag,{value:"Module"})));var O2;function au(){if(O2)return At;O2=1,Object.defineProperty(At,"__esModule",{value:!0}),At.addType=At.isEmpty=At.objectToMap=At.grouped=At.formatDate=At.formatDateTime=At.filterDouble=At.refineType=At.nullable=void 0;const e=H,t=mt,n=wi,r=e.__importStar(ee),i=gbe;function o(h){return r.union([h,r.null,r.undefined])}At.nullable=o;function a(h,v,m){return new r.Type(v,h.is,(_,g)=>(0,n.pipe)(h.validate(_,g),t.either.chain(S=>m(S)?r.success(S):r.failure(_,g))),h.encode)}At.refineType=a;function u(h){if(h==="")return null;const v=Number(h);return Number.isNaN(v)?null:v}At.filterDouble=u;function s(h){return h.toISOString().replace(/\.\d{3}Z$/,"+0000")}At.formatDateTime=s;function c(h){return h.toISOString().replace(/T.*/,"")}At.formatDate=c;function l(h,v){return h.reduce((m,_,g)=>(g%v===0?m.push([_]):m[Math.floor(g/v)].push(_),m),new Array)}At.grouped=l;function f(h){return new Map(Object.entries(h))}At.objectToMap=f;function d(h){for(const v in h)return!1;return!0}At.isEmpty=d;function p(h,v){return(0,i.mapOutput)(h,m=>({...m,__TYPE__:v}))}return At.addType=p,At}var w2;function ybe(){if(w2)return Yp;w2=1,Object.defineProperty(Yp,"__esModule",{value:!0}),Yp.WidgetKey=void 0;const t=H.__importStar(ee),n=au(),r=new RegExp("^[^<>]+$");return Yp.WidgetKey=(0,n.refineType)(t.string,"WidgetKey",i=>i.length===0||r.test(i)),Yp}var C2;function Ql(){return C2||(C2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),H.__exportStar(ybe(),e)}(aw)),aw}var uw={},sw={},Ci={},cw={},lw={},fw={},by={};const aa=Ic(oF);var E2;function bbe(){if(E2)return by;E2=1,Object.defineProperty(by,"__esModule",{value:!0});const e=H,t=aa,n=wi,r=e.__importStar(ee);return by.default=new r.Type("dateFromString",i=>i instanceof Date,(i,o)=>(0,n.pipe)(r.string.validate(i,o),(0,t.chain)(a=>{const u=new Date(a);return isNaN(u.getTime())?r.failure(i,o):r.success(u)})),i=>i.toISOString()),by}var _y={},R2;function _be(){if(R2)return _y;R2=1,Object.defineProperty(_y,"__esModule",{value:!0});const e=H,t=aa,n=wi,r=e.__importStar(ee);return _y.default=new r.Type("dateFromStringOrNumber",i=>i instanceof Date,(i,o)=>(0,n.pipe)(r.union([r.number,r.string]).validate(i,o),(0,t.chain)(a=>{const u=new Date(a);return isNaN(u.getTime())?r.failure(i,o):r.success(u)})),i=>i),_y}var Sy={},M2;function Sbe(){if(M2)return Sy;M2=1,Object.defineProperty(Sy,"__esModule",{value:!0});const e=H,t=aa,n=wi,r=e.__importStar(ee);return Sy.default=new r.Type("dateFromTsMs",i=>i instanceof Date,(i,o)=>(0,n.pipe)(r.number.validate(i,o),(0,t.chain)(a=>{const u=new Date(a);return isNaN(u.getTime())?r.failure(i,o):r.success(u)})),i=>i.getTime()),Sy}var $y={},x2;function $be(){if(x2)return $y;x2=1,Object.defineProperty($y,"__esModule",{value:!0});const e=H,t=aa,n=wi,r=e.__importStar(ee);return $y.default=new r.Type("IntFromNumber",r.Int.is,(i,o)=>(0,n.pipe)(r.number.validate(i,o),(0,t.chain)(a=>r.Int.is(a)?r.success(a):r.success(Math.round(a)))),r.Int.encode),$y}var Ty={},k2;function Tbe(){if(k2)return Ty;k2=1,Object.defineProperty(Ty,"__esModule",{value:!0});const e=H,t=aa,n=wi,r=e.__importStar(ee),i=/^([0-9]+)px$/;return Ty.default=new r.Type("IntFromPixels",r.Int.is,(o,a)=>(0,n.pipe)(r.string.validate(o,a),(0,t.chain)(u=>{try{const s=u.match(i);if(!s)return r.failure(o,a);const c=parseInt(s[1]);return r.success(c)}catch{return r.failure(o,a)}})),String),Ty}var Iy={},A2;function Ibe(){if(A2)return Iy;A2=1,Object.defineProperty(Iy,"__esModule",{value:!0});const t=H.__importStar(ee),n=au();return Iy.default=(0,n.refineType)(t.string,"nonEmptyString",r=>r.trim().length>0),Iy}var Oy={},wy={},N2;function F2(){if(N2)return wy;N2=1,Object.defineProperty(wy,"__esModule",{value:!0});const t=H.__importStar(ee),n=au();return wy.default=(0,n.nullable)(t.string),wy}var P2;function Obe(){if(P2)return Oy;P2=1,Object.defineProperty(Oy,"__esModule",{value:!0});const e=H,t=aa,n=wi,r=ee,i=e.__importDefault(F2());return Oy.default=new r.Type("nonEmptyStringOrNull",o=>typeof o=="string"||o===null,(o,a)=>(0,n.pipe)(i.default.validate(o,a),(0,t.chain)(u=>typeof u=="string"&&u.length>0?(0,r.success)(u):(0,r.success)(null))),o=>o),Oy}var Cy={},W2;function wbe(){if(W2)return Cy;W2=1,Object.defineProperty(Cy,"__esModule",{value:!0});const t=H.__importStar(ee),n=au();return Cy.default=(0,n.nullable)(t.number),Cy}var Ey={},L2;function Cbe(){if(L2)return Ey;L2=1,Object.defineProperty(Ey,"__esModule",{value:!0});const e=H,t=aa,n=wi,r=e.__importStar(ee);return Ey.default=new r.Type("StringFromInt",r.string.is,(i,o)=>(0,n.pipe)(r.boolean.validate(i,o),(0,t.chain)(a=>r.success(a.toString()))),i=>i),Ey}var Ry={},j2;function Ebe(){if(j2)return Ry;j2=1,Object.defineProperty(Ry,"__esModule",{value:!0});const e=H,t=aa,n=wi,r=e.__importStar(ee);return Ry.default=new r.Type("StringFromInt",r.string.is,(i,o)=>(0,n.pipe)(r.number.validate(i,o),(0,t.chain)(a=>r.success(a.toString()))),i=>i),Ry}var D2;function vt(){return D2||(D2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StringOrNull=e.StringFromNumber=e.StringFromBoolean=e.NumberOrNull=e.NonEmptyStringOrNull=e.NonEmptyString=e.IntFromPixels=e.IntFromNumber=e.Function=e.DateFromTsMs=e.DateFromStringOrNumber=e.DateFromString=void 0;const t=H;var n=bbe();Object.defineProperty(e,"DateFromString",{enumerable:!0,get:function(){return t.__importDefault(n).default}});var r=_be();Object.defineProperty(e,"DateFromStringOrNumber",{enumerable:!0,get:function(){return t.__importDefault(r).default}});var i=Sbe();Object.defineProperty(e,"DateFromTsMs",{enumerable:!0,get:function(){return t.__importDefault(i).default}}),e.Function=t.__importStar(au());var o=$be();Object.defineProperty(e,"IntFromNumber",{enumerable:!0,get:function(){return t.__importDefault(o).default}});var a=Tbe();Object.defineProperty(e,"IntFromPixels",{enumerable:!0,get:function(){return t.__importDefault(a).default}});var u=Ibe();Object.defineProperty(e,"NonEmptyString",{enumerable:!0,get:function(){return t.__importDefault(u).default}});var s=Obe();Object.defineProperty(e,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return t.__importDefault(s).default}});var c=wbe();Object.defineProperty(e,"NumberOrNull",{enumerable:!0,get:function(){return t.__importDefault(c).default}});var l=Cbe();Object.defineProperty(e,"StringFromBoolean",{enumerable:!0,get:function(){return t.__importDefault(l).default}});var f=Ebe();Object.defineProperty(e,"StringFromNumber",{enumerable:!0,get:function(){return t.__importDefault(f).default}});var d=F2();Object.defineProperty(e,"StringOrNull",{enumerable:!0,get:function(){return t.__importDefault(d).default}})}(fw)),fw}var Jp={},dw={},q2;function U2(){return q2||(q2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanField=e.BooleanConfig=e.BooleanFieldType=void 0;const n=H.__importStar(ee),r=vt();e.BooleanFieldType="Boolean",e.BooleanConfig=n.exact(n.partial({label:r.StringOrNull,default_value:n.boolean,placeholder_true:n.string,placeholder_false:n.string})),e.BooleanField=n.exact(n.intersection([n.type({type:n.literal(e.BooleanFieldType)}),n.partial({config:e.BooleanConfig})]))}(dw)),dw}var pw={},B2;function z2(){return B2||(B2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Color=e.ColorConfig=e.ColorFieldType=void 0;const n=H.__importStar(ee),r=vt();e.ColorFieldType="Color",e.ColorConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string})),e.Color=n.exact(n.intersection([n.type({type:n.literal(e.ColorFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.ColorConfig})]))}(pw)),pw}var hw={},K2;function V2(){return K2||(K2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Date=e.DateConfig=e.DateFieldType=void 0;const n=H.__importStar(ee),r=vt();e.DateFieldType="Date",e.DateConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),e.Date=n.exact(n.intersection([n.type({type:n.literal(e.DateFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.DateConfig})]))}(hw)),hw}var mw={},H2;function G2(){return H2||(H2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Embed=e.EmbedConfig=e.EmbedFieldType=void 0;const n=H.__importStar(ee),r=vt();e.EmbedFieldType="Embed",e.EmbedConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,useAsTitle:n.boolean})),e.Embed=n.exact(n.intersection([n.type({type:n.literal(e.EmbedFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.EmbedConfig})]))}(mw)),mw}var vw={},Y2;function J2(){return Y2||(Y2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPoint=e.GeoPointConfig=e.GeoPointFieldType=void 0;const n=H.__importStar(ee),r=vt();e.GeoPointFieldType="GeoPoint",e.GeoPointConfig=n.exact(n.partial({label:r.StringOrNull})),e.GeoPoint=n.exact(n.intersection([n.type({type:n.literal(e.GeoPointFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.GeoPointConfig})]))}(vw)),vw}var gw={},My={},Zp={},Xp={},Ws={},Z2;function X2(){if(Z2)return Ws;Z2=1,Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.pipe=Ws.pipeable=void 0;var e=Qe(),t=function(g){return typeof g.map=="function"},n=function(g){return typeof g.contramap=="function"},r=function(g){return typeof g.mapWithIndex=="function"},i=function(g){return typeof g.ap=="function"},o=function(g){return typeof g.chain=="function"},a=function(g){return typeof g.bimap=="function"},u=function(g){return typeof g.extend=="function"},s=function(g){return typeof g.reduce=="function"},c=function(g){return typeof g.reduceWithIndex=="function"},l=function(g){return typeof g.alt=="function"},f=function(g){return typeof g.compact=="function"},d=function(g){return typeof g.filter=="function"},p=function(g){return typeof g.filterWithIndex=="function"},h=function(g){return typeof g.promap=="function"},v=function(g){return typeof g.compose=="function"},m=function(g){return typeof g.throwError=="function"};function _(g){var S={};if(t(g)){var b=function(Q){return function(re){return g.map(re,Q)}};S.map=b}if(n(g)){var $=function(Q){return function(re){return g.contramap(re,Q)}};S.contramap=$}if(r(g)){var T=function(Q){return function(re){return g.mapWithIndex(re,Q)}};S.mapWithIndex=T}if(i(g)){var R=function(Q){return function(re){return g.ap(re,Q)}},E=function(Q){return function(re){return g.ap(g.map(re,function(ke){return function(){return ke}}),Q)}};S.ap=R,S.apFirst=E,S.apSecond=function(Q){return function(re){return g.ap(g.map(re,function(){return function(ke){return ke}}),Q)}}}if(o(g)){var q=function(Q){return function(re){return g.chain(re,Q)}},Y=function(Q){return function(re){return g.chain(re,function(ke){return g.map(Q(ke),function(){return ke})})}},N=function(Q){return g.chain(Q,e.identity)};S.chain=q,S.chainFirst=Y,S.flatten=N}if(a(g)){var Z=function(Q,re){return function(ke){return g.bimap(ke,Q,re)}},ie=function(Q){return function(re){return g.mapLeft(re,Q)}};S.bimap=Z,S.mapLeft=ie}if(u(g)){var J=function(Q){return function(re){return g.extend(re,Q)}},ye=function(Q){return g.extend(Q,e.identity)};S.extend=J,S.duplicate=ye}if(s(g)){var we=function(Q,re){return function(ke){return g.reduce(ke,Q,re)}},x=function(Q){var re=g.foldMap(Q);return function(ke){return function(Ot){return re(Ot,ke)}}},k=function(Q,re){return function(ke){return g.reduceRight(ke,Q,re)}};S.reduce=we,S.foldMap=x,S.reduceRight=k}if(c(g)){var C=function(Q,re){return function(ke){return g.reduceWithIndex(ke,Q,re)}},O=function(Q){var re=g.foldMapWithIndex(Q);return function(ke){return function(Ot){return re(Ot,ke)}}},F=function(Q,re){return function(ke){return g.reduceRightWithIndex(ke,Q,re)}};S.reduceWithIndex=C,S.foldMapWithIndex=O,S.reduceRightWithIndex=F}if(l(g)){var L=function(Q){return function(re){return g.alt(re,Q)}};S.alt=L}if(f(g)&&(S.compact=g.compact,S.separate=g.separate),d(g)){var X=function(Q){return function(re){return g.filter(re,Q)}},te=function(Q){return function(re){return g.filterMap(re,Q)}},xe=function(Q){return function(re){return g.partition(re,Q)}},ce=function(Q){return function(re){return g.partitionMap(re,Q)}};S.filter=X,S.filterMap=te,S.partition=xe,S.partitionMap=ce}if(p(g)){var Ne=function(Q){return function(re){return g.filterWithIndex(re,Q)}},ze=function(Q){return function(re){return g.filterMapWithIndex(re,Q)}},He=function(Q){return function(re){return g.partitionWithIndex(re,Q)}},it=function(Q){return function(re){return g.partitionMapWithIndex(re,Q)}};S.filterWithIndex=Ne,S.filterMapWithIndex=ze,S.partitionWithIndex=He,S.partitionMapWithIndex=it}if(h(g)){var Ft=function(Q,re){return function(ke){return g.promap(ke,Q,re)}};S.promap=Ft}if(v(g)){var qt=function(Q){return function(re){return g.compose(re,Q)}};S.compose=qt}if(m(g)){var Ht=function(Q){return function(re){return re._tag==="None"?g.throwError(Q()):g.of(re.value)}},xn=function(Q){return Q._tag==="Left"?g.throwError(Q.left):g.of(Q.right)},Ar=function(Q,re){return function(ke){return Q(ke)?g.of(ke):g.throwError(re(ke))}},fr=function(Q,re){return function(ke){return g.chain(ke,function(Ot){return Q(Ot)?g.of(Ot):g.throwError(re(Ot))})}};S.fromOption=Ht,S.fromEither=xn,S.fromPredicate=Ar,S.filterOrElse=fr}return S}return Ws.pipeable=_,Ws.pipe=e.pipe,Ws}var Q2;function yw(){if(Q2)return Xp;Q2=1;var e=he&&he.__createBinding||(Object.create?function(a,u,s,c){c===void 0&&(c=s),Object.defineProperty(a,c,{enumerable:!0,get:function(){return u[s]}})}:function(a,u,s,c){c===void 0&&(c=s),a[c]=u[s]}),t=he&&he.__setModuleDefault||(Object.create?function(a,u){Object.defineProperty(a,"default",{enumerable:!0,value:u})}:function(a,u){a.default=u}),n=he&&he.__importStar||function(a){if(a&&a.__esModule)return a;var u={};if(a!=null)for(var s in a)Object.hasOwnProperty.call(a,s)&&e(u,a,s);return t(u,a),u};Object.defineProperty(Xp,"__esModule",{value:!0}),Xp.NumberFromString=void 0;var r=n(ee),i=X2(),o=jn();return Xp.NumberFromString=new r.Type("NumberFromString",r.number.is,function(a,u){return i.pipe(r.string.validate(a,u),o.chain(function(s){var c=+s;return isNaN(c)||s.trim()===""?r.failure(a,u):r.success(c)}))},String),Xp}var ez;function Rbe(){if(ez)return Zp;ez=1;var e=he&&he.__createBinding||(Object.create?function(u,s,c,l){l===void 0&&(l=c),Object.defineProperty(u,l,{enumerable:!0,get:function(){return s[c]}})}:function(u,s,c,l){l===void 0&&(l=c),u[l]=s[c]}),t=he&&he.__setModuleDefault||(Object.create?function(u,s){Object.defineProperty(u,"default",{enumerable:!0,value:s})}:function(u,s){u.default=s}),n=he&&he.__importStar||function(u){if(u&&u.__esModule)return u;var s={};if(u!=null)for(var c in u)Object.hasOwnProperty.call(u,c)&&e(s,u,c);return t(s,u),s};Object.defineProperty(Zp,"__esModule",{value:!0}),Zp.IntFromString=void 0;var r=n(ee),i=yw(),o=X2(),a=jn();return Zp.IntFromString=new r.Type("IntFromString",r.Int.is,function(u,s){return o.pipe(i.NumberFromString.validate(u,s),a.chain(function(c){return r.Int.is(c)?r.success(c):r.failure(u,s)}))},i.NumberFromString.encode),Zp}var tz;function bw(){if(tz)return My;tz=1,Object.defineProperty(My,"__esModule",{value:!0});const e=H,t=jn(),n=e.__importStar(ee),r=Rbe(),i=vt(),o=new n.Type("SideConstraints",u=>!u||typeof u=="number",(u,s)=>t.either.chain(n.union([n.literal("auto"),n.literal(""),n.Int,r.IntFromString,i.IntFromNumber,i.IntFromPixels,n.null]).validate(u,s),c=>c==="auto"||c===""?n.success(null):n.success(c)),u=>u),a=n.partial({width:o,height:o});return My.default=a,My}var nz;function rz(){return nz||(nz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Image=e.ImageConfig=e.Thumbnail=e.ImageFieldType=void 0;const t=H,n=t.__importStar(ee),r=vt(),i=t.__importDefault(bw());e.ImageFieldType="Image",e.Thumbnail=n.exact(n.intersection([n.type({name:n.string}),i.default])),e.ImageConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,constraint:i.default,thumbnails:n.readonlyArray(e.Thumbnail)})),e.Image=n.exact(n.intersection([n.type({type:n.literal(e.ImageFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.ImageConfig})]))}(gw)),gw}var _w={},iz;function oz(){return iz||(iz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationField=e.IntegrationFieldConfig=e.IntegrationFieldType=void 0;const n=H.__importStar(ee),r=vt();e.IntegrationFieldType="IntegrationFields",e.IntegrationFieldConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,catalog:n.string})),e.IntegrationField=n.exact(n.intersection([n.type({type:n.literal(e.IntegrationFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.IntegrationFieldConfig})]))}(_w)),_w}var Sw={},Qp={},eh={},th={},az;function Mbe(){if(az)return th;az=1,Object.defineProperty(th,"__esModule",{value:!0}),th.clone=void 0;function e(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n}return th.clone=e,th}var uz;function xbe(){if(uz)return eh;uz=1;var e=he&&he.__createBinding||(Object.create?function(a,u,s,c){c===void 0&&(c=s),Object.defineProperty(a,c,{enumerable:!0,get:function(){return u[s]}})}:function(a,u,s,c){c===void 0&&(c=s),a[c]=u[s]}),t=he&&he.__setModuleDefault||(Object.create?function(a,u){Object.defineProperty(a,"default",{enumerable:!0,value:u})}:function(a,u){a.default=u}),n=he&&he.__importStar||function(a){if(a&&a.__esModule)return a;var u={};if(a!=null)for(var s in a)Object.hasOwnProperty.call(a,s)&&e(u,a,s);return t(u,a),u};Object.defineProperty(eh,"__esModule",{value:!0}),eh.withValidate=void 0;var r=n(ee),i=Mbe();function o(a,u,s){s===void 0&&(s=a.name);var c=i.clone(a);return c.validate=u,c.decode=function(l){return u(l,r.getDefaultContext(c))},c.name=s,c}return eh.withValidate=o,eh}var sz;function $w(){if(sz)return Qp;sz=1;var e=he&&he.__createBinding||(Object.create?function(u,s,c,l){l===void 0&&(l=c),Object.defineProperty(u,l,{enumerable:!0,get:function(){return s[c]}})}:function(u,s,c,l){l===void 0&&(l=c),u[l]=s[c]}),t=he&&he.__setModuleDefault||(Object.create?function(u,s){Object.defineProperty(u,"default",{enumerable:!0,value:s})}:function(u,s){u.default=s}),n=he&&he.__importStar||function(u){if(u&&u.__esModule)return u;var s={};if(u!=null)for(var c in u)Object.hasOwnProperty.call(u,c)&&e(s,u,c);return t(s,u),s};Object.defineProperty(Qp,"__esModule",{value:!0}),Qp.withFallback=void 0;var r=n(ee),i=xbe(),o=jn();function a(u,s,c){return c===void 0&&(c="withFallback("+u.name+")"),i.withValidate(u,function(l,f){return o.orElse(function(){return r.success(s)})(u.validate(l,f))},c)}return Qp.withFallback=a,Qp}var cz;function lz(){return cz||(cz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Link=e.LinkConfig=e.LinkFieldType=void 0;const t=H,n=jn(),r=t.__importStar(ee),i=$w(),o=vt(),a=c=>{if(c instanceof Array&&c.reduce((f,d)=>f&&typeof d=="string",!0))return r.success(c)},u=c=>{if(typeof c=="string")return r.success([c])},s=new r.Type("MasksArrayString",c=>c instanceof Array,(c,l)=>n.either.chain(r.union([r.array(r.string),r.string]).validate(c,l),f=>a(f)||u(f)||r.failure(c,l)),c=>c);e.LinkFieldType="Link",e.LinkConfig=r.exact(r.partial({label:o.StringOrNull,useAsTitle:r.boolean,placeholder:r.string,select:(0,i.withFallback)(r.union([r.literal("media"),r.literal("document"),r.literal("web"),r.null]),null),customtypes:r.readonlyArray(r.string),masks:s,tags:s,allowTargetBlank:r.boolean})),e.Link=r.exact(r.intersection([r.type({type:r.literal(e.LinkFieldType)}),r.partial({fieldset:o.StringOrNull,config:e.LinkConfig})]))}(Sw)),Sw}var Tw={},fz;function dz(){return fz||(fz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Number=e.NumberConfig=e.NumberFieldType=void 0;const n=H.__importStar(ee),r=yw(),i=vt();e.NumberFieldType="Number",e.NumberConfig=n.exact(n.partial({label:i.StringOrNull,placeholder:n.string,min:n.union([n.number,r.NumberFromString]),max:n.union([n.number,r.NumberFromString]),step:n.union([n.number,r.NumberFromString])})),e.Number=n.exact(n.intersection([n.type({type:n.literal(e.NumberFieldType)}),n.partial({fieldset:i.StringOrNull,config:e.NumberConfig})]))}(Tw)),Tw}var Iw={},pz;function hz(){return pz||(pz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Range=e.RangeConfig=e.RangeFieldType=void 0;const n=H.__importStar(ee),r=yw(),i=vt();e.RangeFieldType="Range",e.RangeConfig=n.exact(n.partial({label:i.StringOrNull,placeholder:n.string,min:n.union([n.number,r.NumberFromString]),max:n.union([n.number,r.NumberFromString]),step:n.union([n.number,r.NumberFromString])})),e.Range=n.exact(n.intersection([n.type({type:n.literal(e.RangeFieldType)}),n.partial({fieldset:i.StringOrNull,config:e.RangeConfig})]))}(Iw)),Iw}var Ow={},mz;function vz(){return mz||(mz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichText=e.RichTextConfig=e.RichTextNodeTypeCodec=e.RichTextNodeType=e.DEFAULT_OPTION=e.RichTextFieldType=void 0;const t=H,n=mt,r=jn(),i=Qe(),o=t.__importStar(ee),a=vt(),u=t.__importDefault(bw());e.RichTextFieldType="StructuredText",e.DEFAULT_OPTION="paragraph",e.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"},e.RichTextNodeTypeCodec=o.keyof({[e.RichTextNodeType.heading1]:null,[e.RichTextNodeType.heading2]:null,[e.RichTextNodeType.heading3]:null,[e.RichTextNodeType.heading4]:null,[e.RichTextNodeType.heading5]:null,[e.RichTextNodeType.heading6]:null,[e.RichTextNodeType.paragraph]:null,[e.RichTextNodeType.strong]:null,[e.RichTextNodeType.em]:null,[e.RichTextNodeType.preformatted]:null,[e.RichTextNodeType.hyperlink]:null,[e.RichTextNodeType.image]:null,[e.RichTextNodeType.embed]:null,[e.RichTextNodeType.list]:null,[e.RichTextNodeType.orderedList]:null,[e.RichTextNodeType.rtl]:null});const s=new o.Type("RichTextOptions",h=>typeof h=="string",h=>(0,i.pipe)(o.union([o.string,o.null]).decode(h),n.either.map(v=>{if(!v)return e.DEFAULT_OPTION;const _=v.split(",").map(g=>g.trim()).filter(g=>(0,r.getOrElseW)(()=>{})(e.RichTextNodeTypeCodec.decode(g)));return _.length?_.join(","):e.DEFAULT_OPTION})),h=>h),c=h=>{if(!h)return o.success([])},l=h=>{if(h instanceof Object){const v=h;if(!Object.entries(v).length)return o.success([]);if(v[""])return o.success(v[""].map(_=>_.name));const m=Object.entries(v).reduce((_,[,g])=>_.concat(g.map(S=>S.name)),[]).filter(Boolean);return o.success(m)}},f=h=>{if(h instanceof Array&&h.reduce((m,_)=>m&&typeof _=="string",!0))return o.success(h)},d=h=>{if(typeof h=="string")return o.success([h])},p=new o.Type("RichTextLabels",h=>h instanceof Array,(h,v)=>{const m=o.record(o.string,o.readonlyArray(o.record(o.literal("name"),o.string))),_=o.readonlyArray(o.string);return(0,i.pipe)(o.union([m,_,o.string,o.null]).decode(h),n.either.chain(g=>c(g)||f(g)||l(g)||d(g)||o.failure(h,v)))},h=>h);e.RichTextConfig=o.exact(o.partial({label:a.StringOrNull,placeholder:o.string,useAsTitle:o.boolean,single:s,multi:s,imageConstraint:u.default,labels:p,allowTargetBlank:o.boolean})),e.RichText=o.exact(o.intersection([o.type({type:o.literal(e.RichTextFieldType)}),o.partial({fieldset:a.StringOrNull,config:e.RichTextConfig})]))}(Ow)),Ow}var ww={},gz;function yz(){return gz||(gz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Select=e.SelectConfig=e.SelectFieldType=void 0;const n=H.__importStar(ee),r=vt();e.SelectFieldType="Select",e.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]))})),e.Select=n.exact(n.intersection([n.type({type:n.literal(e.SelectFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.SelectConfig})]))}(ww)),ww}var Cw={},bz;function _z(){return bz||(bz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Separator=e.SeparatorConfig=e.SeparatorFieldType=void 0;const n=H.__importStar(ee),r=vt();e.SeparatorFieldType="Separator",e.SeparatorConfig=n.exact(n.partial({label:r.StringOrNull})),e.Separator=n.exact(n.intersection([n.type({type:n.literal(e.SeparatorFieldType)}),n.partial({config:e.SeparatorConfig})]))}(Cw)),Cw}var Ew={},Sz;function $z(){return Sz||(Sz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Text=e.TextConfig=e.TextFieldType=void 0;const n=H.__importStar(ee),r=vt();e.TextFieldType="Text",e.TextConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),e.Text=n.exact(n.intersection([n.type({type:n.literal(e.TextFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.TextConfig})]))}(Ew)),Ew}var Rw={},Tz;function Iz(){return Tz||(Tz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.TimestampConfig=e.TimestampFieldType=void 0;const n=H.__importStar(ee),r=vt();e.TimestampFieldType="Timestamp",e.TimestampConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),e.Timestamp=n.exact(n.intersection([n.type({type:n.literal(e.TimestampFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.TimestampConfig})]))}(Rw)),Rw}var Oz;function ef(){if(Oz)return Jp;Oz=1,Object.defineProperty(Jp,"__esModule",{value:!0}),Jp.NestableWidget=void 0;const t=H.__importStar(ee),n=U2(),r=z2(),i=V2(),o=G2(),a=J2(),u=rz(),s=oz(),c=lz(),l=dz(),f=hz(),d=vz(),p=yz(),h=_z(),v=$z(),m=Iz();return Jp.NestableWidget=t.union([r.Color,n.BooleanField,o.Embed,a.GeoPoint,i.Date,l.Number,f.Range,d.RichText,p.Select,h.Separator,v.Text,m.Timestamp,c.Link,u.Image,s.IntegrationField]),Jp}var wz;function Mw(){return wz||(wz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Group=e.GroupConfig=e.GroupFieldType=void 0;const n=H.__importStar(ee),r=Ql(),i=vt(),o=ef();e.GroupFieldType="Group",e.GroupConfig=n.exact(n.partial({label:i.StringOrNull,repeat:n.boolean,fields:n.record(r.WidgetKey,o.NestableWidget)})),e.Group=n.exact(n.intersection([n.type({type:n.literal(e.GroupFieldType)}),n.partial({fieldset:i.StringOrNull,icon:n.string,description:n.string,config:e.GroupConfig})]))}(lw)),lw}var xw={},Cz;function kw(){return Cz||(Cz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(U2(),e),t.__exportStar(z2(),e),t.__exportStar(V2(),e),t.__exportStar(G2(),e),t.__exportStar(J2(),e),t.__exportStar(rz(),e),t.__exportStar(oz(),e),t.__exportStar(lz(),e),t.__exportStar(ef(),e),t.__exportStar(dz(),e),t.__exportStar(hz(),e),t.__exportStar(vz(),e),t.__exportStar(yz(),e),t.__exportStar(_z(),e),t.__exportStar($z(),e),t.__exportStar(Iz(),e)}(xw)),xw}var Aw={},Ez;function kbe(){return Ez||(Ez=1,function(e){var t=he&&he.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageConstraint=void 0;var n=bw();Object.defineProperty(e,"ImageConstraint",{enumerable:!0,get:function(){return t(n).default}})}(Aw)),Aw}var Nw={},Fw={},Rz;function Pw(){return Rz||(Rz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CompositeSlice=e.CompositeSliceConfig=e.CompositeSliceType=void 0;const n=H.__importStar(ee),r=Ql(),i=vt(),o=ef();e.CompositeSliceType="Slice",e.CompositeSliceConfig=n.exact(n.partial({label:i.StringOrNull})),e.CompositeSlice=n.exact(n.intersection([n.type({type:n.literal(e.CompositeSliceType)}),n.partial({fieldset:i.StringOrNull,description:n.string,icon:n.string,display:n.string,"non-repeat":n.record(r.WidgetKey,o.NestableWidget),repeat:n.record(r.WidgetKey,o.NestableWidget),config:e.CompositeSliceConfig})]))}(Fw)),Fw}var nh={},Mz;function xz(){if(Mz)return nh;Mz=1,Object.defineProperty(nh,"__esModule",{value:!0}),nh.LegacySlice=void 0;const t=H.__importStar(ee),n=Mw(),r=ef();return nh.LegacySlice=t.union([r.NestableWidget,n.Group]),nh}var Ww={},kz;function xy(){return kz||(kz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SharedSlice=e.SharedSliceType=e.Variation=void 0;const n=H.__importStar(ee),r=$w(),i=Ql(),o=ef(),a="https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format";e.Variation=n.exact(n.intersection([n.type({id:n.string,name:n.string,description:n.string,imageUrl:(0,r.withFallback)(n.string,a),docURL:n.string,version:n.string}),n.partial({display:n.string,primary:n.record(i.WidgetKey,o.NestableWidget),items:n.record(i.WidgetKey,o.NestableWidget)})])),e.SharedSliceType="SharedSlice",e.SharedSlice=n.exact(n.intersection([n.type({id:n.string,type:n.literal(e.SharedSliceType),name:n.string,variations:n.readonlyArray(e.Variation)}),n.partial({description:n.string})]))}(Ww)),Ww}var rh={},Az;function Nz(){if(Az)return rh;Az=1,Object.defineProperty(rh,"__esModule",{value:!0}),rh.SharedSliceRef=void 0;const t=H.__importStar(ee),n=xy();return rh.SharedSliceRef=t.exact(t.type({type:t.literal(n.SharedSliceType)})),rh}var Lw={},Fz;function Abe(){return Fz||(Fz=1,Object.defineProperty(Lw,"__esModule",{value:!0})),Lw}var jw={},Pz;function Wz(){return Pz||(Pz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Slices=e.DynamicSlices=e.StaticSlices=e.slicesReader=e.DynamicSlicesConfig=e.StaticSlicesConfig=e.slicesConfigReader=e.SlicesLabels=e.SlicesFieldType=e.LegacySlicesFieldType=void 0;const n=H.__importStar(ee),r=Ql(),i=vt(),o=Pw(),a=xz(),u=xy(),s=Nz();e.LegacySlicesFieldType="Choice",e.SlicesFieldType="Slices",e.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]);function c(d){return n.exact(n.partial({label:i.StringOrNull,labels:e.SlicesLabels,choices:n.record(r.WidgetKey,n.union([a.LegacySlice,o.CompositeSlice,d]))}))}e.slicesConfigReader=c,e.StaticSlicesConfig=c(u.SharedSlice),e.DynamicSlicesConfig=c(s.SharedSliceRef);const l={toStatic(d,p){const h=Object.entries(d.choices||{}).reduce((v,[m,_])=>{if(_.type==="SharedSlice"){const g=p.get(m);return g?{...v,[m]:g}:v}else return{...v,[m]:_}},{});return{...d,choices:h}}};function f(d){return n.exact(n.intersection([n.type({type:n.keyof({[e.SlicesFieldType]:null,[e.LegacySlicesFieldType]:null})}),n.partial({fieldset:i.StringOrNull,config:d})]))}e.slicesReader=f,e.StaticSlices=f(e.StaticSlicesConfig),e.DynamicSlices=f(e.DynamicSlicesConfig),e.Slices={toStatic(d,p){return d.config?{...d,config:l.toStatic(d.config,p)}:d}}}(jw)),jw}var ih={},Lz;function Nbe(){if(Lz)return ih;Lz=1,Object.defineProperty(ih,"__esModule",{value:!0}),ih.SlicesTypes=void 0;const t=H.__importStar(ee),n=Pw(),r=xy();return ih.SlicesTypes=t.keyof({[n.CompositeSliceType]:null,[r.SharedSliceType]:null}),ih}var jz;function Fbe(){return jz||(jz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(Pw(),e),t.__exportStar(xz(),e),t.__exportStar(xy(),e),t.__exportStar(Nz(),e),t.__exportStar(Abe(),e),t.__exportStar(Wz(),e),t.__exportStar(Nbe(),e)}(Nw)),Nw}var Dw={},Dz;function qz(){return Dz||(Dz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UID=e.UIDConfig=e.UIDFieldType=void 0;const n=H.__importStar(ee),r=vt();e.UIDFieldType="UID",e.UIDConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),e.UID=n.exact(n.intersection([n.type({type:n.literal(e.UIDFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.UIDConfig})]))}(Dw)),Dw}var Ir={},Uz;function Bz(){if(Uz)return Ir;Uz=1,Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.Widgets=Ir.FieldType=Ir.DynamicWidget=Ir.StaticWidget=Ir.widgetReader=void 0;const t=H.__importStar(ee),n=Mw(),r=kw(),i=ef(),o=Wz(),a=qz();function u(s){return t.union([a.UID,i.NestableWidget,n.Group,s])}return Ir.widgetReader=u,Ir.StaticWidget=u(o.StaticSlices),Ir.DynamicWidget=u(o.DynamicSlices),Ir.FieldType=t.keyof({[r.ColorFieldType]:null,[r.BooleanFieldType]:null,[r.NumberFieldType]:null,[r.EmbedFieldType]:null,[r.GeoPointFieldType]:null,[r.DateFieldType]:null,[r.RangeFieldType]:null,[r.RichTextFieldType]:null,[r.SelectFieldType]:null,[r.SeparatorFieldType]:null,[r.TextFieldType]:null,[r.TimestampFieldType]:null,[r.LinkFieldType]:null,[r.ImageFieldType]:null,[r.IntegrationFieldType]:null,[a.UIDFieldType]:null,[n.GroupFieldType]:null,[o.SlicesFieldType]:null,[o.LegacySlicesFieldType]:null}),Ir.Widgets={toStatic(s,c){switch(s.type){case"Choice":case"Slices":return o.Slices.toStatic(s,c);default:return s}}},Ir}var zz;function ua(){return zz||(zz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(Mw(),e),t.__exportStar(kw(),e),t.__exportStar(kbe(),e),t.__exportStar(Fbe(),e),t.__exportStar(qz(),e),t.__exportStar(Bz(),e)}(cw)),cw}var Kz;function tf(){if(Kz)return Ci;Kz=1,Object.defineProperty(Ci,"__esModule",{value:!0}),Ci.defaultCtx=Ci.getFieldCtx=Ci.LegacyContentCtx=Ci.FieldOrSliceType=void 0;const t=H.__importStar(ee),n=ua();Ci.FieldOrSliceType=t.union([n.FieldType,n.SlicesTypes]);let r=class{constructor(u,s,c){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=u,this.fieldPath=s||[],this.allTypes=c||new Map;const l=Array.of(this.fieldPath,[this.fieldKey]).flat().join(".");this.prefixedKey=l,this.keyOfType=`${l}_TYPE`,this.fieldType=this.allTypes.get(this.prefixedKey)}};Ci.LegacyContentCtx=r;function i(a,u,s){return new r(a,[...u.fieldPath,u.fieldKey,...s||[]],u.allTypes)}Ci.getFieldCtx=i;function o(a,u=new Map){return new r(a,[],u)}return Ci.defaultCtx=o,Ci}var Ls={},Vz;function Nt(){if(Vz)return Ls;Vz=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.hasContentType=Ls.hasFieldContentType=void 0;const e=jn(),t=NC();function n(i){return r(i)&&i.__TYPE__===t.FieldContentType&&(i==null?void 0:i.type)!==void 0&&typeof i.type=="string"&&(0,e.isRight)(t.FieldType.decode(i.type))}Ls.hasFieldContentType=n;function r(i){return typeof i=="object"&&i!==null&&"__TYPE__"in i}return Ls.hasContentType=r,Ls}var qw={},Uw={},Hz;function Gz(){return Hz||(Hz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanContent=e.BooleanLegacy=e.isBooleanContent=e.BooleanContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=Nt();e.BooleanContentType="BooleanContent";const a=s=>(0,o.hasContentType)(s)&&s.__TYPE__===e.BooleanContentType;e.isBooleanContent=a;const u=s=>new i.Type("BooleanLegacy",e.isBooleanContent,c=>(0,r.pipe)(i.boolean.decode(c),n.either.map(l=>e.BooleanContent.encode({value:l,__TYPE__:e.BooleanContentType}))),c=>({content:c.value,types:{[s.keyOfType]:"Boolean"}}));e.BooleanLegacy=u,e.BooleanContent=i.strict({__TYPE__:i.literal(e.BooleanContentType),value:i.boolean})}(Uw)),Uw}var Bw={},Yz;function zw(){return Yz||(Yz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmbedContent=e.EmbedLegacy=e.EmbedContentLegacy=e.isEmbedContent=e.EmbedContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=vt(),a=Nt();e.EmbedContentType="EmbedContent";const u=c=>(0,a.hasContentType)(c)&&c.__TYPE__===e.EmbedContentType;e.isEmbedContent=u,e.EmbedContentLegacy=i.exact(i.intersection([i.type({embed_url:i.string,type:i.string}),i.partial({version:i.union([i.string,i.number,i.null]),title:o.StringOrNull,author_name:o.StringOrNull,author_url:o.StringOrNull,provider_name:o.StringOrNull,provider_url:o.StringOrNull,cache_age:i.union([i.string,i.number,i.null]),thumbnail_url:o.StringOrNull,thumbnail_width:o.NumberOrNull,thumbnail_height:o.NumberOrNull,html:o.StringOrNull})]));const s=c=>new i.Type("EmbedLegacy",e.isEmbedContent,l=>(0,r.pipe)(e.EmbedContentLegacy.decode(l),n.either.map(f=>({...f,all:l,__TYPE__:e.EmbedContentType}))),l=>({content:l.all,types:{[c.keyOfType]:"Embed"}}));e.EmbedLegacy=s,e.EmbedContent=i.intersection([e.EmbedContentLegacy,i.strict({__TYPE__:i.literal(e.EmbedContentType),all:i.unknown})])}(Bw)),Bw}var Kw={},Vw={},ky={},Jz;function js(){if(Jz)return ky;Jz=1,Object.defineProperty(ky,"__esModule",{value:!0});const e=H,t=aa,n=wi,r=e.__importStar(ee);function i(o){let a=0;for(;a<o.length&&o[a]<=" ";)a++;let u=o.length;for(;a<u&&o[u-1]<=" ";)u--;return o.substring(a,u)}return ky.default=new r.Type("TrimmedString",r.string.is,(o,a)=>(0,n.pipe)(r.string.validate(o,a),(0,t.chain)(u=>r.success(i(u)))),o=>o),ky}var oh={},Zz;function sa(){return Zz||(Zz=1,Object.defineProperty(oh,"__esModule",{value:!0}),oh.FieldContentType=void 0,oh.FieldContentType="FieldContent"),oh}var Xz;function Qz(){return Xz||(Xz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorContent=e.ColorLegacy=e.isColorContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=ua(),a=t.__importDefault(js()),u=Nt(),s=sa(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Color";e.isColorContent=c;const l=f=>new i.Type("ColorLegacy",e.isColorContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.ColorContent.encode({value:p,type:o.ColorFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.ColorFieldType}}));e.ColorLegacy=l,e.ColorContent=i.strict({type:i.literal(o.ColorFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Vw)),Vw}var Hw={},eK;function tK(){return eK||(eK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DateContent=e.DateLegacy=e.isDateContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=ua(),a=t.__importDefault(js()),u=Nt(),s=sa(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Date";e.isDateContent=c;const l=f=>new i.Type("DateLegacy",e.isDateContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.DateContent.encode({value:p,type:o.DateFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.DateFieldType}}));e.DateLegacy=l,e.DateContent=i.strict({type:i.literal(o.DateFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Hw)),Hw}var Gw={},nK;function rK(){return nK||(nK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NumberContent=e.NumberLegacy=e.isNumberContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=ua(),a=t.__importDefault(js()),u=Nt(),s=sa(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Number";e.isNumberContent=c;const l=f=>new i.Type("NumberLegacy",e.isNumberContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.NumberContent.encode({value:p,type:o.NumberFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.NumberFieldType}}));e.NumberLegacy=l,e.NumberContent=i.strict({type:i.literal(o.NumberFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Gw)),Gw}var Yw={},iK;function oK(){return iK||(iK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RangeContent=e.RangeLegacy=e.isRangeContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=ua(),a=t.__importDefault(js()),u=Nt(),s=sa(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Range";e.isRangeContent=c;const l=f=>new i.Type("RangeLegacy",e.isRangeContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.RangeContent.encode({value:p,type:o.RangeFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.RangeFieldType}}));e.RangeLegacy=l,e.RangeContent=i.strict({type:i.literal(o.RangeFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Yw)),Yw}var Jw={},aK;function uK(){return aK||(aK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectContent=e.SelectLegacy=e.isSelectContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=ua(),a=t.__importDefault(js()),u=Nt(),s=sa(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Select";e.isSelectContent=c;const l=f=>new i.Type("SelectLegacy",e.isSelectContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.SelectContent.encode({value:p,type:o.SelectFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.SelectFieldType}}));e.SelectLegacy=l,e.SelectContent=i.strict({type:i.literal(o.SelectFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Jw)),Jw}var Zw={},sK;function cK(){return sK||(sK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextContent=e.TextLegacy=e.isTextContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=ua(),a=t.__importDefault(js()),u=Nt(),s=sa(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Text";e.isTextContent=c;const l=f=>new i.Type("TextLegacy",e.isTextContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.TextContent.encode({value:p,type:o.TextFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.TextFieldType}}));e.TextLegacy=l,e.TextContent=i.strict({type:i.literal(o.TextFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Zw)),Zw}var Xw={},lK;function fK(){return lK||(lK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TimestampContent=e.TimestampLegacy=e.isTimestampContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=ua(),a=t.__importDefault(js()),u=Nt(),s=sa(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Timestamp";e.isTimestampContent=c;const l=f=>new i.Type("TimestampLegacy",e.isTimestampContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.TimestampContent.encode({value:p,type:o.TimestampFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.TimestampFieldType}}));e.TimestampLegacy=l,e.TimestampContent=i.strict({type:i.literal(o.TimestampFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Xw)),Xw}var dK;function pK(){return dK||(dK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FieldContent=e.FieldType=void 0;const t=H,n=t.__importStar(ee),r=Qz(),i=tK(),o=rK(),a=oK(),u=uK(),s=cK(),c=fK();e.FieldType=n.keyof({Text:null,Date:null,Timestamp:null,Color:null,Number:null,Range:null,Select:null}),e.FieldContent=n.union([i.DateContent,r.ColorContent,o.NumberContent,a.RangeContent,u.SelectContent,s.TextContent,c.TimestampContent]),t.__exportStar(Qz(),e),t.__exportStar(sa(),e),t.__exportStar(tK(),e),t.__exportStar(rK(),e),t.__exportStar(oK(),e),t.__exportStar(uK(),e),t.__exportStar(cK(),e),t.__exportStar(fK(),e)}(Kw)),Kw}var Qw={},hK;function mK(){return hK||(hK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPointContent=e.GeoPointLegacy=e.isGeoPointContent=e.GeoPointContentType=void 0;const t=H,n=mt,r=wi,i=t.__importStar(ee),o=Nt();e.GeoPointContentType="GeoPointContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.GeoPointContentType;e.isGeoPointContent=a;const u=i.strict({position:i.strict({lat:i.number,lng:i.number})}),s=c=>new i.Type("GeoPointLegacy",e.isGeoPointContent,l=>(0,r.pipe)(u.decode(l),n.either.map(f=>e.GeoPointContent.encode({...f,__TYPE__:e.GeoPointContentType}))),l=>({content:{position:l.position},types:{[c.keyOfType]:"GeoPoint"}}));e.GeoPointLegacy=s,e.GeoPointContent=i.intersection([u,i.strict({__TYPE__:i.literal(e.GeoPointContentType)})])}(Qw)),Qw}var eC={},ca={},vK;function gK(){if(vK)return ca;vK=1,Object.defineProperty(ca,"__esModule",{value:!0}),ca.withOptionals=ca.isNotEmpty=ca.zipObjects=void 0;function e(r,i){return[...new Set(Object.keys(r||{}).concat(Object.keys(i||{})))].reduce((a,u)=>{const s=r==null?void 0:r[u],c=i==null?void 0:i[u];return{...a,[u]:{left:s,right:c}}},{})}ca.zipObjects=e;function t(r){return Boolean(Object.keys(r).length)}ca.isNotEmpty=t;function n(r,i){return{...r,...i.reduce((o,[a,u])=>u?{...o,[a]:u}:o,{})}}return ca.withOptionals=n,ca}var yK;function tC(){return yK||(yK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageContent=e.ImageLegacy=e.ImageContentView=e.isImageContent=e.ImageContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=gK(),a=vt(),u=Nt();e.ImageContentType="ImageContent";const s=d=>(0,u.hasContentType)(d)&&d.__TYPE__===e.ImageContentType;e.isImageContent=s;const c=i.exact(i.type({id:i.string,url:i.string,width:i.number,height:i.number}));e.ImageContentView=i.exact(i.intersection([i.type({origin:c,width:i.number,height:i.number,edit:i.type({zoom:i.number,crop:i.type({x:i.number,y:i.number}),background:i.string})}),i.partial({url:i.string,credits:a.NonEmptyStringOrNull,alt:a.NonEmptyStringOrNull,provider:a.StringOrNull})]));const l=i.intersection([e.ImageContentView,i.partial({thumbnails:i.record(i.string,e.ImageContentView)})]),f=d=>new i.Type("ImageLegacy",e.isImageContent,p=>(0,r.pipe)(l.decode(p),n.either.map(h=>e.ImageContent.encode({...h,__TYPE__:e.ImageContentType}))),p=>({content:(0,o.withOptionals)({edit:p.edit,height:p.height,origin:p.origin,width:p.width},[["alt",p.alt],["credits",p.credits],["provider",p.provider],["thumbnails",p.thumbnails],["url",p.url]]),types:{[d.keyOfType]:"Image"}}));e.ImageLegacy=f,e.ImageContent=i.intersection([l,i.strict({__TYPE__:i.literal(e.ImageContentType)})])}(eC)),eC}var nC={},bK;function _K(){return bK||(bK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationFieldContent=e.IntegrationFieldLegacy=e.isIntegrationFieldContent=e.IntegrationFieldContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=Nt();e.IntegrationFieldContentType="IntegrationFieldsContent";const a=s=>(0,o.hasContentType)(s)&&s.__TYPE__===e.IntegrationFieldContentType;e.isIntegrationFieldContent=a;const u=s=>new i.Type("IntegrationFieldLegacy",e.isIntegrationFieldContent,c=>(0,r.pipe)(i.string.decode(c),n.either.map(l=>e.IntegrationFieldContent.encode({value:l,__TYPE__:e.IntegrationFieldContentType}))),c=>({content:c.value,types:{[s.keyOfType]:"IntegrationFields"}}));e.IntegrationFieldLegacy=u,e.IntegrationFieldContent=i.strict({__TYPE__:i.literal(e.IntegrationFieldContentType),value:i.string})}(nC)),nC}var rC={},SK=my(Oi,function(e){return e.length>0},"NonEmptyString");function $K(e,t){t===void 0&&(t="NonEmptyArray<"+e.name+">");var n=gy(e);return new Te(t,function(r){return n.is(r)&&Lt(r)},function(r,i){return de(n.validate(r,i),Lr(function(o){var a=bS(o);return je(a)?tt(r,i):Ee(a.value)}))},function(r){return n.encode(r)})}function TK(e,t,n){n===void 0&&(n="Set<"+e.name+">");var r=gy(e),i=cq(t),o=aq(t);return new Te(n,function(a){return a instanceof Set&&sq(e.is)(a)},function(a,u){return de(r.validate(a,u),Lr(function(s){var c=o(s);return c.size!==s.length?tt(a,u):Ee(c)}))},function(a){return r.encode(i(a))})}function Pbe(e,t,n){return n===void 0&&(n="ReadonlySet<"+e.name+">"),TK(e,t,n)}function iC(e,t){return new Te(e,t,function(n,r){return t(n)?Ee(n):tt(n,r)},Ue)}var Wbe=function(e){return e instanceof Date},Lbe=iC("Date",Wbe),jbe=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Dbe=function(e,t){return{get:e,reverseGet:t}},IK=function(e){return uu(e.get,V(e.reverseGet,Yn))},qbe=function(e){return Ds(V(e.get,_t),e.reverseGet)},Ube=function(e){return la(V(e.get,_t),V(e.reverseGet,Yn))},Bbe=function(e){return nf(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.reverseGet(i)})}}})},uu=function(e,t){return{get:e,set:t}},oC=function(e){return la(V(e.get,_t),e.set)},zbe=function(e){return nf(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.set(i)(r)})}}})},OK=function(e){return function(t){return uu(function(n){return e.get(t.get(n))},function(n){return function(r){return t.set(e.set(n)(t.get(r)))(r)}})}},Kbe=function(e){return function(t){return Ds(V(t.getOption,Rd(e.getOption)),V(e.reverseGet,t.reverseGet))}},Vbe=function(e){return function(t){return qs(aC(e))(oC(t))}},Hbe=function(){return uu(D,Yn)},Gbe=function(e){return function(t){return uu(function(n){return t.get(n)[e]},function(n){return function(r){var i,o=t.get(r);return n===o[e]?r:t.set(Object.assign({},o,(i={},i[e]=n,i)))(r)}})}},Ybe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return uu(function(r){for(var i=n.get(r),o={},a=0,u=e;a<u.length;a++){var s=u[a];o[s]=i[s]}return o},function(r){return function(i){for(var o=n.get(i),a=0,u=e;a<u.length;a++){var s=u[a];if(r[s]!==o[s])return n.set(Object.assign({},o,r))(i)}return i}})}},Jbe=function(e){return function(t){return uu(function(n){return t.get(n)[e]},function(n){return function(r){var i=t.get(r);if(n===i[e])return r;var o=i.slice();return o[e]=n,t.set(o)(r)}})}},Zbe=function(e){return function(t){return de(t,OK(b_e().at(e)))}},Ds=function(e,t){return{getOption:e,reverseGet:t}},aC=function(e){return la(e.getOption,function(t){return CK(t)(e)})},wK=function(e){return nf(function(t){return function(n){return function(r){return de(e.getOption(r),ko(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return CK(o)(e)(r)})}))}}})},Xbe=function(e){return function(t){return function(n){return de(t.getOption(n),Yi(function(r){var i=e(r);return i===r?n:t.reverseGet(i)}))}}},Qbe=function(e){return function(t){var n=Xbe(e)(t);return function(r){return de(n(r),X$(function(){return r}))}}},CK=function(e){return Qbe(function(){return e})},e_e=function(e){return function(t){return qs(oC(e))(aC(t))}},t_e=function(){return Ds(ts,D)},uC=function(e){return Ds($v(e),D)},n_e=function(){return Ds(D,_t)},r_e=function(){return Ds(rl,Ye)},i_e=function(){return Ds(function(e){return le(e)?_t(e.left):ot},Tt)},la=function(e,t){return{getOption:e,set:t}},o_e=function(e){return nf(function(t){return function(n){return function(r){return de(e.getOption(r),ko(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return e.set(o)(r)})}))}}})},EK=function(e){return function(t){return function(n){return de(t.getOption(n),Yi(function(r){var i=e(r);return i===r?n:t.set(i)(n)}))}}},RK=function(e){return function(t){var n=EK(e)(t);return function(r){return de(n(r),X$(function(){return r}))}}},qs=function(e){return function(t){return la(V(t.getOption,Rd(e.getOption)),function(n){return RK(e.set(n))(t)})}},a_e=function(e){return function(t){return de(t,qs(m_e().index(e)))}},u_e=function(e){return function(t){return de(t,qs(v_e().index(e)))}},s_e=function(e){return function(t){return de(t,qs(g_e().index(e)))}},c_e=function(e){return la(ev(e),function(t){return function(n){return de(Qm(e)(n),ko(function(){return n},function(r){return dv(r,t,n)}))}})},MK=function(e,t,n){if(n[e]===t)return n;var r=jbe([n[0]],n.slice(1),!0);return r[e]=t,r},l_e=function(e){return la(ev(e),function(t){return function(n){return de(Qm(e)(n),ko(function(){return n},function(r){return MK(r,t,n)}))}})},nf=function(e){return{modifyF:e}};function sC(e){return function(t){return nf(function(n){return function(r){return t.modifyF(n)(e.modifyF(n)(r))}})}}var f_e={URI:"Identity",map:function(e,t){return t(e)},of:D,ap:function(e,t){return e(t)}},d_e=function(e){return e.URI==="Identity"};function p_e(e){return function(){return nf(function(t){var n=d_e(t)?e.map:e.traverse(t);return function(r){return function(i){return n(i,r)}}})}}function h_e(e){return sC(p_e(e)())}var cC=function(e){return{index:e}},m_e=function(){return cC(function(e){return la(function(t){return Yu(e,t)},function(t){return function(n){return de(Yu(e,n),ko(function(){return n},function(){return dv(e,t,n)}))}})})},v_e=function(){return cC(function(e){return la(function(t){return Yu(e,t)},function(t){return function(n){return de(Yu(e,n),ko(function(){return n},function(){return MK(e,t,n)}))}})})},g_e=function(){return cC(function(e){return la(function(t){return Wu(e,t)},function(t){return function(n){return n[e]===t||je(Wu(e,n))?n:cS(e,t)(n)}})})},y_e=function(e){return{at:e}};function b_e(){return y_e(function(e){return uu(function(t){return Wu(e,t)},ko(function(){return Em(e)},function(t){return cS(e,t)}))})}var xK=Dbe,lC=IK,fC=qbe,dC=Ube,pC=Bbe,__e=function(e){return function(t){return xK(V(t.get,e.get),V(e.reverseGet,t.reverseGet))}},S_e=function(e){return xK(e.reverseGet,e.get)},$_e=function(e){return function(t){return function(n){return t.reverseGet(e(t.get(n)))}}},kK=uu,Ay=Hbe,su=oC,rf=zbe,Us=OK,T_e=Us,I_e=V(IK,Us),Bs=Vbe,hC=function(e){return V(su,qs(e))},O_e=function(e){return V(rf,sC(e))},AK=function(e){return function(t){return function(n){var r=t.get(n),i=e(r);return r===i?n:t.set(i)(n)}}};function w_e(e){return function(t){return function(n){return function(r){return de(n.get(r),t,function(i){return e.map(i,function(o){return n.set(o)(r)})})}}}}var C_e=function(e){return Bs(t_e())(e)};function E_e(e){return Bs(uC(e))}var NK=Gbe,FK=Ybe,R_e=Jbe,M_e=function(e){return V(su,a_e(e))},x_e=function(e){return V(su,u_e(e))},k_e=function(e){return V(su,s_e(e))},A_e=Zbe,N_e=Bs(n_e()),F_e=Bs(r_e()),P_e=Bs(i_e());function W_e(e){return V(rf,h_e(e))}function L_e(e){return hC(c_e(e))}function j_e(e){return hC(l_e(e))}var D_e=function(e,t){return function(n){return PK(n,e,t)}},PK=function(e,t,n){return kK(V(e.get,t),V(n,e.set))},Ny="monocle-ts/Lens",q_e={URI:Ny,imap:PK},WK={URI:Ny,compose:function(e,t){return Us(e)(t)}},U_e={URI:Ny,compose:WK.compose,id:Ay};const B_e=Object.freeze(Object.defineProperty({__proto__:null,Category:U_e,Invariant:q_e,Semigroupoid:WK,URI:Ny,asOptional:su,asTraversal:rf,atKey:A_e,component:R_e,compose:Us,composeIso:I_e,composeLens:T_e,composeOptional:hC,composePrism:Bs,composeTraversal:O_e,filter:E_e,findFirst:L_e,findFirstNonEmpty:j_e,fromNullable:C_e,id:Ay,imap:D_e,index:M_e,indexNonEmpty:x_e,key:k_e,left:P_e,lens:kK,modify:AK,modifyF:w_e,prop:NK,props:FK,right:F_e,some:N_e,traverse:W_e},Symbol.toStringTag,{value:"Module"}));var LK=o_e,zs=qs,z_e=EK,K_e=RK,V_e=uC,mC=aC,vC=wK,gC=Kbe,H_e=e_e,fa=sC,jK=function(e){return function(t){return t.modifyF(f_e)(e)}},G_e=function(e){return jK(function(){return e})};function Y_e(e){return fa(wK(uC(e)))}var DK=function(e){return new UK(e.get,e.reverseGet)},of=function(e){return new yC(e.get,e.set)},ah=function(e){return new BK(e.getOption,e.reverseGet)},Kr=function(e){return new J_e(e.getOption,e.set)},Or=function(e){return new Z_e(e.modifyF)},qK=function(e,t,n){var r;return n===e[t]?e:Object.assign({},e,(r={},r[t]=n,r))},UK=function(){function e(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 e.prototype.reverse=function(){return DK(S_e(this))},e.prototype.modify=function(t){return $_e(t)(this)},e.prototype.asLens=function(){return of(lC(this))},e.prototype.asPrism=function(){return ah(fC(this))},e.prototype.asOptional=function(){return Kr(dC(this))},e.prototype.asTraversal=function(){return Or(pC(this))},e.prototype.asFold=function(){var t=this;return new af(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.asGetter=function(){var t=this;return new KK(function(n){return t.get(n)})},e.prototype.asSetter=function(){var t=this;return new uh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return DK(__e(t)(this))},e.prototype.composeIso=function(t){return this.compose(t)},e.prototype.composeLens=function(t){return of(de(this,lC,Us(t)))},e.prototype.composePrism=function(t){return ah(de(this,fC,gC(t)))},e.prototype.composeOptional=function(t){return Kr(de(this,dC,zs(t)))},e.prototype.composeTraversal=function(t){return Or(de(this,pC,fa(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeGetter=function(t){return this.asGetter().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e}(),yC=function(){function e(t,n){this.get=t,this.set=n,this._tag="Lens"}return e.fromPath=function(){var t=e.fromProp();return function(n){var r=t(n[0]);return n.slice(1).reduce(function(i,o){return i.compose(t(o))},r)}},e.fromProp=function(){return function(t){return of(de(Ay(),NK(t)))}},e.fromProps=function(){return function(t){return of(de(Ay(),FK.apply(B_e,t)))}},e.fromNullableProp=function(){return function(t,n){return new e(function(r){var i=ts(r[t]);return je(i)?n:i.value},function(r){return function(i){return qK(i,t,r)}})}},e.prototype.modify=function(t){return AK(t)(this)},e.prototype.asOptional=function(){return Kr(su(this))},e.prototype.asTraversal=function(){return Or(rf(this))},e.prototype.asSetter=function(){var t=this;return new uh(function(n){return t.modify(n)})},e.prototype.asGetter=function(){var t=this;return new KK(function(n){return t.get(n)})},e.prototype.asFold=function(){var t=this;return new af(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){return of(Us(t)(this))},e.prototype.composeLens=function(t){return this.compose(t)},e.prototype.composeGetter=function(t){return this.asGetter().compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeOptional=function(t){return Kr(de(this,su,zs(t)))},e.prototype.composeTraversal=function(t){return Or(de(this,rf,fa(t)))},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return of(de(this,Us(de(t,lC))))},e.prototype.composePrism=function(t){return Kr(Bs(t)(this))},e}(),BK=function(){function e(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return e.fromPredicate=function(t){return ah(V_e(t))},e.some=function(){return zK},e.prototype.modify=function(t){var n=this;return function(r){var i=n.modifyOption(t)(r);return je(i)?r:i.value}},e.prototype.modifyOption=function(t){var n=this;return function(r){return bN.map(n.getOption(r),function(i){var o=t(i);return o===i?r:n.reverseGet(o)})}},e.prototype.set=function(t){return this.modify(function(){return t})},e.prototype.asOptional=function(){return Kr(mC(this))},e.prototype.asTraversal=function(){return Or(vC(this))},e.prototype.asSetter=function(){var t=this;return new uh(function(n){return t.modify(n)})},e.prototype.asFold=function(){var t=this;return new af(function(n){return function(r){return function(i){var o=t.getOption(i);return je(o)?n.empty:r(o.value)}}})},e.prototype.compose=function(t){return ah(gC(t)(this))},e.prototype.composePrism=function(t){return this.compose(t)},e.prototype.composeOptional=function(t){return Kr(de(this,mC,zs(t)))},e.prototype.composeTraversal=function(t){return Or(de(this,vC,fa(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return ah(de(this,gC(de(t,fC))))},e.prototype.composeLens=function(t){return Kr(H_e(t)(this))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),zK=new BK(D,_t),J_e=function(){function e(t,n){this.getOption=t,this.set=n,this._tag="Optional"}return e.fromPath=function(){var t=e.fromNullableProp();return function(n){var r=t(n[0]);return n.slice(1).reduce(function(i,o){return i.compose(t(o))},r)}},e.fromNullableProp=function(){return function(t){return new e(function(n){return ts(n[t])},function(n){return function(r){return r[t]==null?r:qK(r,t,n)}})}},e.fromOptionProp=function(){var t=yC.fromProp();return function(n){return t(n).composePrism(zK)}},e.prototype.modify=function(t){return K_e(t)(this)},e.prototype.modifyOption=function(t){return z_e(t)(this)},e.prototype.asTraversal=function(){return Or(LK(this))},e.prototype.asFold=function(){var t=this;return new af(function(n){return function(r){return function(i){var o=t.getOption(i);return je(o)?n.empty:r(o.value)}}})},e.prototype.asSetter=function(){var t=this;return new uh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return Kr(zs(t)(this))},e.prototype.composeOptional=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return Or(de(this,LK,fa(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeLens=function(t){return Kr(de(this,zs(de(t,su))))},e.prototype.composePrism=function(t){return Kr(de(this,zs(de(t,mC))))},e.prototype.composeIso=function(t){return Kr(de(this,zs(de(t,dC))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),Z_e=function(){function e(t){this.modifyF=t,this._tag="Traversal"}return e.prototype.modify=function(t){return jK(t)(this)},e.prototype.set=function(t){return G_e(t)(this)},e.prototype.filter=function(t){return Or(Y_e(t)(this))},e.prototype.asFold=function(){var t=this;return new af(function(n){return function(r){return t.modifyF($N(n))(function(i){return il(r(i))})}})},e.prototype.asSetter=function(){var t=this;return new uh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return Or(fa(t)(this))},e.prototype.composeTraversal=function(t){return this.compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeOptional=function(t){return this.compose(t.asTraversal())},e.prototype.composeLens=function(t){return Or(de(this,fa(de(t,rf))))},e.prototype.composePrism=function(t){return Or(de(this,fa(de(t,vC))))},e.prototype.composeIso=function(t){return Or(de(this,fa(de(t,pC))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),KK=function(){function e(t){this.get=t,this._tag="Getter"}return e.prototype.asFold=function(){var t=this;return new af(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){var n=this;return new e(function(r){return t.get(n.get(r))})},e.prototype.composeGetter=function(t){return this.compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeLens=function(t){return this.compose(t.asGetter())},e.prototype.composeIso=function(t){return this.compose(t.asGetter())},e.prototype.composeTraversal=function(t){return this.asFold().compose(t.asFold())},e.prototype.composeOptional=function(t){return this.asFold().compose(t.asFold())},e.prototype.composePrism=function(t){return this.asFold().compose(t.asFold())},e}(),af=function(){function e(t){this.foldMap=t,this._tag="Fold",this.getAll=t(M$())(La),this.exist=t(YW),this.all=t(GW),this.foldMapFirst=t(_N())}return e.prototype.compose=function(t){var n=this;return new e(function(r){return function(i){return n.foldMap(r)(t.foldMap(r)(i))}})},e.prototype.composeFold=function(t){return this.compose(t)},e.prototype.composeGetter=function(t){return this.compose(t.asFold())},e.prototype.composeTraversal=function(t){return this.compose(t.asFold())},e.prototype.composeOptional=function(t){return this.compose(t.asFold())},e.prototype.composeLens=function(t){return this.compose(t.asFold())},e.prototype.composePrism=function(t){return this.compose(t.asFold())},e.prototype.composeIso=function(t){return this.compose(t.asFold())},e.prototype.find=function(t){return this.foldMapFirst($v(t))},e.prototype.headOption=function(t){return this.find(function(){return!0})(t)},e}(),uh=function(){function e(t){this.modify=t,this._tag="Setter"}return e.prototype.set=function(t){return this.modify(Yn(t))},e.prototype.compose=function(t){var n=this;return new e(function(r){return n.modify(t.modify(r))})},e.prototype.composeSetter=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return this.compose(t.asSetter())},e.prototype.composeOptional=function(t){return this.compose(t.asSetter())},e.prototype.composeLens=function(t){return this.compose(t.asSetter())},e.prototype.composePrism=function(t){return this.compose(t.asSetter())},e.prototype.composeIso=function(t){return this.compose(t.asSetter())},e}(),X_e=new UK(Oc,Oc);function Q_e(){return X_e}function eSe(e,t){t===void 0&&(t="fromNewtype("+e.name+")");var n=Q_e();return new Te(t,function(r){return e.is(r)},function(r,i){return de(e.validate(r,i),as(n.wrap))},function(r){return e.encode(n.unwrap(r))})}var tSe=Gp({_tag:Vp("None")}),nSe=Vp("Some");function VK(e,t){return t===void 0&&(t="Option<"+e.name+">"),Hp([tSe,Gp({_tag:nSe,value:e},"Some<"+e.name+">")],t)}function rSe(e,t){return t===void 0&&(t="Option<"+e.name+">"),new Te(t,VK(e).is,function(n,r){return n==null?Ee(ot):de(e.validate(n,r),as(_t))},function(n){return Q$(de(n,Yi(e.encode)))})}var iSe=new Te("DateFromISOString",function(e){return e instanceof Date},function(e,t){return de(Oi.validate(e,t),Lr(function(n){var r=new Date(n);return isNaN(r.getTime())?tt(e,t):Ee(r)}))},function(e){return e.toISOString()});function oSe(e,t){return t===void 0&&(t="ReadonlyNonEmptyArray<"+e.name+">"),$K(e,t)}function HK(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}var aSe=new Te("DateFromNumber",function(e){return e instanceof Date},function(e,t){return de(Ps.validate(e,t),Lr(function(n){var r=new Date(n);return isNaN(r.getTime())?tt(e,t):Ee(r)}))},function(e){return e.getTime()});function Fy(e,t,n){n===void 0&&(n=e.name);var r=HK(e);return r.validate=t,r.decode=function(i){return t(i,_2(r))},r.name=n,r}function uSe(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),Fy(e,function(r,i){return ZN(function(){return Ee(t)})(e.validate(r,i))},n)}var sSe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,cSe=my(Oi,function(e){return sSe.test(e)},"UUID");function lSe(e,t,n){return n===void 0&&(n="fromNullable("+e.name+")"),Fy(e,function(r,i){return r==null?Ee(t):e.validate(r,i)},n)}var fSe=new Te("BooleanFromString",hy.is,function(e,t){return de(Oi.validate(e,t),Lr(function(n){return n==="true"?Ee(!0):n==="false"?Ee(!1):tt(e,t)}))},String);function dSe(e,t){return Fy(e,function(n,r){return Wd(function(){return[{value:n,context:r,message:t(n,r),actual:n}]})(e.validate(n,r))})}function GK(e){switch(e._tag){case"InterfaceType":return e.props;case"ExactType":return GK(e.type)}}var pSe=yC.fromProp();function hSe(e){var t={};for(var n in GK(e))t[n]=pSe(n);return t}var mSe=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},vSe=iC("RegExp",mSe),gSe=new Te("DateFromUnixTime",function(e){return e instanceof Date},function(e,t){return de(vy.validate(e,t),Lr(function(n){var r=new Date(n*1e3);return isNaN(r.getTime())?tt(e,t):Ee(r)}))},function(e){return Math.floor(e.getTime()/1e3)}),bC=new Te("NumberFromString",Ps.is,function(e,t){return de(Oi.validate(e,t),Lr(function(n){var r=+n;return isNaN(r)||n.trim()===""?tt(e,t):Ee(r)}))},String),ySe=new Te("IntFromString",vy.is,function(e,t){return de(bC.validate(e,t),Lr(function(n){return vy.is(n)?Ee(n):tt(e,t)}))},bC.encode),YK=ew("JsonArray",function(){return v2(Py)}),JK=ew("JsonRecord",function(){return rw(Oi,Py)}),Py=Hp([hy,Ps,Oi,XO,YK,JK],"Json"),bSe=new Te("JsonFromString",Py.is,function(e,t){try{return Ee(JSON.parse(e))}catch{return tt(e,t)}},function(e){return JSON.stringify(e)}),_Se=Vp("Left"),SSe=Vp("Right");function $Se(e,t,n){return n===void 0&&(n="Either<"+e.name+", "+t.name+">"),Hp([Gp({_tag:_Se,left:e},"Left<"+e.name+">"),Gp({_tag:SSe,right:t},"Right<"+e.name+">")],n)}var TSe=new Te("BigIntFromString",function(e){return typeof e=="bigint"},function(e,t){return de(Oi.validate(e,t),Lr(function(n){if(!SK.is(n.trim()))return tt(e,t);try{return Ee(BigInt(n))}catch{return tt(e,t)}}))},String);function ISe(e,t,n){return n===void 0&&(n=e.name),new Te(n,e.is,e.validate,t)}var OSe=new Te("BooleanFromNumber",hy.is,function(e,t){return de(Ps.validate(e,t),as(function(n){return n!==0}))},Number);const ZK=Ic(Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:TSe,BooleanFromNumber:OSe,BooleanFromString:fSe,DateFromISOString:iSe,DateFromNumber:aSe,DateFromUnixTime:gSe,IntFromString:ySe,Json:Py,JsonArray:YK,JsonFromString:bSe,JsonRecord:JK,NonEmptyString:SK,NumberFromString:bC,UUID:cSe,clone:HK,date:Lbe,either:$Se,fromNewtype:eSe,fromNullable:lSe,fromRefinement:iC,getLenses:hSe,mapOutput:I2,nonEmptyArray:$K,option:VK,optionFromNullable:rSe,readonlyNonEmptyArray:oSe,readonlySetFromArray:Pbe,regexp:vSe,setFromArray:TK,withEncode:ISe,withFallback:uSe,withMessage:dSe,withValidate:Fy},Symbol.toStringTag,{value:"Module"})));var XK;function _C(){return XK||(XK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkContent=e.Link=e.LinkContentLegacy=e.LinkLegacy=e.isLinkContent=e.LinkContentType=e.ExternalLinkContent=e.ExternalLinkType=e.DocumentLinkContent=e.DocumentLinkType=e.FileLinkContent=e.FileLinkType=e.ImageLinkContent=e.ImageLinkType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=ZK,a=vt(),u=au(),s=Nt();e.ImageLinkType="ImageLink";const c=i.exact(i.intersection([i.type({id:i.string,url:i.string,height:i.string,width:i.string,size:i.string,name:i.string,kind:i.string}),i.partial({date:a.StringOrNull})])),l=new i.Type("ImageLink",S=>(0,s.hasContentType)(S)&&S.__TYPE__===e.ImageLinkType,S=>(0,r.pipe)(c.decode(S),n.either.map(b=>e.ImageLinkContent.encode({...b,__TYPE__:e.ImageLinkType}))),S=>c.encode(S));e.ImageLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ImageLinkType)}),c]),e.FileLinkType="FileLink";const f=i.exact(i.intersection([i.type({id:i.string,url:i.string,name:i.string,kind:i.string,size:(0,o.withFallback)(i.string,"0")}),i.partial({date:(0,u.nullable)(i.string)})])),d=new i.Type("FileLink",S=>(0,s.hasContentType)(S)&&S.__TYPE__===e.FileLinkType,S=>(0,r.pipe)(f.decode(S),n.either.map(b=>e.FileLinkContent.encode({...b,__TYPE__:e.FileLinkType}))),S=>f.encode(S));e.FileLinkContent=i.intersection([f,i.exact(i.intersection([i.type({__TYPE__:i.literal(e.FileLinkType)}),i.partial({size:(0,o.withFallback)(i.string,"0")})]))]),e.DocumentLinkType="DocumentLink";const p=i.strict({id:a.NonEmptyString}),h=new i.Type("DocumentLink",S=>(0,s.hasContentType)(S)&&S.__TYPE__===e.DocumentLinkType,S=>(0,r.pipe)(p.decode(S),n.either.map(b=>e.DocumentLinkContent.encode({...b,__TYPE__:e.DocumentLinkType}))),S=>p.encode(S));e.DocumentLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.DocumentLinkType)}),p]),e.ExternalLinkType="ExternalLink";const v=i.exact(i.intersection([i.type({url:i.string}),i.partial({kind:i.literal("web"),target:a.StringOrNull,preview:(0,u.nullable)(i.partial({title:i.string}))})])),m=new i.Type("ExternalLink",S=>(0,s.hasContentType)(S)&&S.__TYPE__===e.ExternalLinkType,S=>(0,r.pipe)(v.decode(S),n.either.map(b=>e.ExternalLinkContent.encode({...b,__TYPE__:e.ExternalLinkType}))),S=>v.encode(S));e.ExternalLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ExternalLinkType)}),v]),e.LinkContentType="LinkContent";const _=S=>(0,s.hasContentType)(S)&&S.__TYPE__===e.LinkContentType;e.isLinkContent=_,e.LinkLegacy=i.union([l,d,h,m]);const g=S=>new i.Type("LinkLegacy",e.isLinkContent,b=>(0,r.pipe)(e.LinkLegacy.decode(b),n.either.map($=>e.LinkContent.encode({value:$,__TYPE__:e.LinkContentType}))),b=>({content:e.LinkLegacy.encode(b.value),types:{[S.keyOfType]:"Link"}}));e.LinkContentLegacy=g,e.Link=i.union([e.ImageLinkContent,e.FileLinkContent,e.DocumentLinkContent,e.ExternalLinkContent]),e.LinkContent=i.strict({__TYPE__:i.literal(e.LinkContentType),value:e.Link})}(rC)),rC}var da={},SC={},QK;function wSe(){return QK||(QK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyContent=e.EmptyLegacy=e.isEmptyContent=e.EmptyContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=Nt();e.EmptyContentType="EmptyContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.EmptyContentType;e.isEmptyContent=a;const u=i.union([i.null,i.type({value:i.null})]),s=c=>new i.Type("EmptyLegacy",e.isEmptyContent,l=>(0,r.pipe)(u.decode(l),n.either.map(()=>({type:c,__TYPE__:e.EmptyContentType}))),()=>null);e.EmptyLegacy=s,e.EmptyContent=i.strict({type:i.string,__TYPE__:i.literal(e.EmptyContentType)})}(SC)),SC}var $C={},TC={},eV;function tV(){return eV||(eV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Block=e.BlockLegacy=e.TextBlock=e.checkEmbedBlock=e.EmbedBlock=e.checkImageBlock=e.ImageBlock=e.ValidatedMetas=e.Span=e.Meta=void 0;const t=H,n=mt,r=jn(),i=Qe(),o=t.__importStar(ee),a=kw(),u=vt(),s=au(),c=zw(),l=tC(),f=_C();e.Meta=o.exact(o.intersection([o.partial({data:o.unknown}),o.type({start:o.number,end:o.number,type:o.union([a.RichTextNodeTypeCodec,o.literal("label")])})])),e.Span=e.Meta;const d=b=>new o.Type("ValidatedMetas",$=>Array.isArray($)&&$.every(e.Meta.is),($,T)=>{if(Array.isArray($)){const R=$.reduce((E,q)=>{const Y=e.Meta.decode(q);if((0,r.isRight)(Y)){const N=Y.right;if(N.data&&N.type==="hyperlink"){const Z=b.decode(N.data);return(0,r.isLeft)(Z)?E:[...E,{...N,data:Z.right}]}else if(N.type!=="hyperlink")return[...E,N]}return E},[]).sort((E,q)=>E.start-q.start);return o.success(R)}else return o.failure($,T)},$=>$.reduce((T,R)=>{if(R.type==="hyperlink"&&R.data){const E=b.decode(R.data);return(0,r.isLeft)(E)?T:[...T,{...R,data:b.encode(E.right)}]}return[...T,e.Meta.encode(R)]},[]));e.ValidatedMetas=d,e.ImageBlock=o.exact(o.intersection([o.type({type:o.literal(a.RichTextNodeType.image),data:o.intersection([l.ImageContentView,o.partial({linkTo:(0,s.nullable)(f.Link)})])}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})]));function p(b){return b.type===a.RichTextNodeType.image}e.checkImageBlock=p;const h=o.exact(o.intersection([o.type({type:o.literal(a.RichTextNodeType.embed),data:o.unknown}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})])),v=new o.Type("EmbedBlockLegacy",b=>b.type==="embed",b=>(0,i.pipe)(h.decode(b),n.either.chain($=>n.either.map(T=>[$,T])(c.EmbedContentLegacy.decode($.data))),n.either.map(([$,T])=>e.EmbedBlock.encode({...$,data:{...T,__TYPE__:c.EmbedContentType,all:$.data}}))),b=>({...h.encode(b),data:c.EmbedContentLegacy.encode(b.data)}));e.EmbedBlock=o.exact(o.intersection([o.type({type:o.literal(a.RichTextNodeType.embed),data:c.EmbedContent}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})]));function m(b){return b.type===a.RichTextNodeType.embed}e.checkEmbedBlock=m;const _=b=>o.exact(o.intersection([o.type({type:(0,s.refineType)(a.RichTextNodeTypeCodec,`string which isn't ${a.RichTextNodeType.image} ${a.RichTextNodeType.embed}`,$=>$!==a.RichTextNodeType.image&&$!==a.RichTextNodeType.embed),content:o.intersection([o.type({text:o.string}),o.partial({spans:(0,e.ValidatedMetas)(b)})])}),o.partial({label:o.string,direction:o.string})]));e.TextBlock=_(f.Link);const g=_(f.LinkLegacy),S=o.union([v,e.ImageBlock,g]);e.BlockLegacy=new o.Type("BlockLegacy",b=>v.is(b)||e.ImageBlock.is(b)||g.is(b),b=>S.decode(b),b=>e.ImageBlock.is(b)?e.ImageBlock.encode(b):e.EmbedBlock.is(b)?v.encode(b):g.encode(b)),e.Block=o.union([e.ImageBlock,e.EmbedBlock,e.TextBlock])}(TC)),TC}var nV;function rV(){return nV||(nV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichTextLegacy=e.RichTextContent=e.isRichTextContent=e.RichTextContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=Nt(),a=tV();e.RichTextContentType="StructuredTextContent";const u=l=>(0,o.hasContentType)(l)&&l.__TYPE__===e.RichTextContentType;e.isRichTextContent=u;const s=i.array(a.BlockLegacy);e.RichTextContent=i.strict({__TYPE__:i.literal(e.RichTextContentType),value:i.array(a.Block)}),t.__exportStar(tV(),e);const c=l=>new i.Type("RichTextLegacy",e.isRichTextContent,f=>(0,r.pipe)(s.decode(f),n.either.map(d=>e.RichTextContent.encode({value:d,__TYPE__:e.RichTextContentType}))),f=>({content:s.encode(f.value),types:{[l.keyOfType]:"StructuredText"}}));e.RichTextLegacy=c}($C)),$C}var IC={},iV;function oV(){return iV||(iV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SeparatorContent=e.SeparatorLegacy=e.isSeparatorContent=e.SeparatorContentType=void 0;const n=H.__importStar(ee),r=Nt();e.SeparatorContentType="SeparatorContent";const i=a=>(0,r.hasContentType)(a)&&a.__TYPE__===e.SeparatorContentType;e.isSeparatorContent=i;const o=a=>new n.Type("SeparatorLegacy",e.isSeparatorContent,()=>n.success(e.SeparatorContent.encode({__TYPE__:e.SeparatorContentType})),()=>({content:{},types:{[a.keyOfType]:"Separator"}}));e.SeparatorLegacy=o,e.SeparatorContent=n.strict({__TYPE__:n.literal(e.SeparatorContentType)})}(IC)),IC}var aV;function CSe(){if(aV)return da;aV=1,Object.defineProperty(da,"__esModule",{value:!0}),da.NestableLegacy=da.isNestableContent=da.NestableContent=void 0;const e=H,t=jn(),n=e.__importStar(ee),r=wSe(),i=Gz(),o=zw(),a=pK(),u=sa(),s=mK(),c=tC(),l=_K(),f=_C(),d=rV(),p=oV();da.NestableContent=n.union([r.EmptyContent,i.BooleanContent,o.EmbedContent,a.TextContent,a.TimestampContent,a.SelectContent,a.RangeContent,a.NumberContent,a.DateContent,a.ColorContent,s.GeoPointContent,c.ImageContent,l.IntegrationFieldContent,f.LinkContent,d.RichTextContent,p.SeparatorContent]);const h=m=>(0,a.isTextContent)(m)||(0,a.isColorContent)(m)||(0,a.isDateContent)(m)||(0,a.isTimestampContent)(m)||(0,a.isNumberContent)(m)||(0,a.isRangeContent)(m)||(0,a.isSelectContent)(m)||(0,s.isGeoPointContent)(m)||(0,d.isRichTextContent)(m)||(0,i.isBooleanContent)(m)||(0,o.isEmbedContent)(m)||(0,c.isImageContent)(m)||(0,l.isIntegrationFieldContent)(m)||(0,f.isLinkContent)(m)||(0,p.isSeparatorContent)(m);da.isNestableContent=h;const v=m=>({decode(_){if(!m.fieldType)return;const g=(0,r.EmptyLegacy)(m.fieldType).decode(_);if((0,t.isRight)(g))return g;const S=(()=>{switch(m.fieldType){case"Text":return(0,a.TextLegacy)(m);case"Color":return(0,a.ColorLegacy)(m);case"Date":return(0,a.DateLegacy)(m);case"Timestamp":return(0,a.TimestampLegacy)(m);case"Number":return(0,a.NumberLegacy)(m);case"Range":return(0,a.RangeLegacy)(m);case"Select":return(0,a.SelectLegacy)(m);case"GeoPoint":return(0,s.GeoPointLegacy)(m);case"StructuredText":return(0,d.RichTextLegacy)(m);case"Boolean":return(0,i.BooleanLegacy)(m);case"Embed":return(0,o.EmbedLegacy)(m);case"Image":return(0,c.ImageLegacy)(m);case"IntegrationFields":return(0,l.IntegrationFieldLegacy)(m);case"Link":return(0,f.LinkContentLegacy)(m);case"Separator":return(0,p.SeparatorLegacy)(m);default:return}})();if(S)return S.decode(_)},encode(_){switch(_.__TYPE__){case u.FieldContentType:return _.type==="Text"?(0,a.TextLegacy)(m).encode(_):_.type==="Color"?(0,a.ColorLegacy)(m).encode(_):_.type==="Range"?(0,a.RangeLegacy)(m).encode(_):_.type==="Date"?(0,a.DateLegacy)(m).encode(_):_.type==="Number"?(0,a.NumberLegacy)(m).encode(_):_.type==="Timestamp"?(0,a.TimestampLegacy)(m).encode(_):_.type==="Select"?(0,a.SelectLegacy)(m).encode(_):void 0;case s.GeoPointContentType:return(0,s.GeoPointLegacy)(m).encode(_);case d.RichTextContentType:return(0,d.RichTextLegacy)(m).encode(_);case o.EmbedContentType:return(0,o.EmbedLegacy)(m).encode(_);case i.BooleanContentType:return(0,i.BooleanLegacy)(m).encode(_);case c.ImageContentType:return(0,c.ImageLegacy)(m).encode(_);case l.IntegrationFieldContentType:return(0,l.IntegrationFieldLegacy)(m).encode(_);case f.LinkContentType:return(0,f.LinkContentLegacy)(m).encode(_);case p.SeparatorContentType:return(0,p.SeparatorLegacy)(m).encode(_);default:return}}});return da.NestableLegacy=v,da}var uV;function Ks(){return uV||(uV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(Gz(),e),t.__exportStar(zw(),e),t.__exportStar(pK(),e),t.__exportStar(mK(),e),t.__exportStar(tC(),e),t.__exportStar(_K(),e),t.__exportStar(_C(),e),t.__exportStar(CSe(),e),t.__exportStar(rV(),e),t.__exportStar(oV(),e)}(qw)),qw}var sV;function Wy(){return sV||(sV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GroupContent=e.isGroupContent=e.GroupContentType=e.GroupLegacy=e.GroupItemLegacy=e.GroupItemContent=e.GroupItemContentType=void 0;const t=H,n=mt,r=jn(),i=Qe(),o=t.__importStar(ee),a=tf(),u=Nt(),s=Ks();e.GroupItemContentType="GroupItemContent",e.GroupItemContent=o.strict({__TYPE__:o.literal(e.GroupItemContentType),value:o.array(o.tuple([o.string,s.NestableContent]))});const c=o.array(o.tuple([o.string,o.unknown])),l=p=>new o.Type("GroupItemLegacy",h=>(0,u.hasContentType)(h)&&h.__TYPE__===e.GroupItemContentType,h=>(0,i.pipe)(c.decode(h),n.either.map(m=>({value:m.reduce((g,[S,b])=>{const $=(0,a.getFieldCtx)(S,p),T=(0,s.NestableLegacy)($).decode(b);return!T||(0,r.isLeft)(T)?g:[...g,[S,T.right]]},[]),__TYPE__:e.GroupItemContentType}))),h=>h.value.reduce((v,[m,_])=>{const g=(0,a.getFieldCtx)(m,p),S=(0,s.NestableLegacy)(g).encode(_);return S?{content:[...v.content,[m,S.content]],types:{...v.types,...S.types}}:v},{content:[],types:{}}));e.GroupItemLegacy=l;const f=p=>{const h=o.array((0,e.GroupItemLegacy)(p));return new o.Type("GroupLegacy",e.isGroupContent,v=>(0,i.pipe)(h.decode(v),n.either.map(m=>({value:m,__TYPE__:e.GroupContentType}))),v=>{const m=h.encode(v.value);return{content:m.map(_=>_.content),types:m.reduce((_,g)=>({..._,...g.types}),{[p.keyOfType]:"Group"})}})};e.GroupLegacy=f,e.GroupContentType="GroupContentType";const d=p=>(0,u.hasContentType)(p)&&p.__TYPE__===e.GroupContentType;e.isGroupContent=d,e.GroupContent=o.strict({__TYPE__:o.literal(e.GroupContentType),value:o.array(e.GroupItemContent)})}(sw)),sw}var OC={},wC={},CC={},Vs={},cV;function lV(){if(cV)return Vs;cV=1,Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.RepeatableWidgets=Vs.RepeatableWidgetsLegacy=void 0;const t=H.__importStar(ee),n=Wy(),r=Ks(),i=u=>t.array((0,n.GroupItemLegacy)(u));Vs.RepeatableWidgetsLegacy=i;const o=t.tuple([t.string,r.NestableContent]),a=t.strict({__TYPE__:t.literal(n.GroupItemContentType),value:t.array(o)});return t.array(o),Vs.RepeatableWidgets=t.array(a),Vs}var fV;function EC(){return fV||(fV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CompositeSliceContent=e.CompositeSliceLegacy=e.isCompositeSliceContent=e.CompositeSliceContentType=void 0;const t=H,n=mt,r=jn(),i=Qe(),o=t.__importStar(ee),a=tf(),u=Nt(),s=Ks(),c=lV();e.CompositeSliceContentType="CompositeSliceContent";const l=p=>(0,u.hasContentType)(p)&&p.__TYPE__===e.CompositeSliceContentType;e.isCompositeSliceContent=l;const f=o.exact(o.partial({repeat:o.array(o.unknown),"non-repeat":o.UnknownRecord})),d=p=>new o.Type("CompositeSliceLegacy",e.isCompositeSliceContent,h=>(0,i.pipe)(f.decode(h),n.either.map(v=>{const m=(()=>{const g=(0,a.getFieldCtx)("repeat",p),S=(0,c.RepeatableWidgetsLegacy)(g).decode(v.repeat);if(!(!S||(0,r.isLeft)(S)))return S.right})()||[];return{nonRepeat:Object.entries(v["non-repeat"]||{}).reduce((g,[S,b])=>{const $=(0,a.getFieldCtx)(S,p,["non-repeat"]);if(!$)return g;const T=(0,s.NestableLegacy)($).decode(b);return!T||(0,r.isLeft)(T)?g:{...g,[S]:T.right}},{}),repeat:m,__TYPE__:e.CompositeSliceContentType}})),h=>{const v=Object.entries(h.nonRepeat).reduce((_,[g,S])=>{const b=(0,a.getFieldCtx)(g,p,["non-repeat"]),$=(0,s.NestableLegacy)(b).encode(S);return $?{content:{..._.content,[g]:$.content},types:{..._.types,...$.types}}:_},{content:{},types:{}}),m=(()=>{const _=(0,a.getFieldCtx)("repeat",p);return(0,c.RepeatableWidgetsLegacy)(_).encode(h.repeat)})()||[];return{content:{"non-repeat":v.content,repeat:m.map(_=>_.content)},types:{[p.keyOfType]:"Slice",...v.types,...m.reduce((_,g)=>({..._,...g.types}),{})}}});e.CompositeSliceLegacy=d,e.CompositeSliceContent=o.strict({__TYPE__:o.literal(e.CompositeSliceContentType),nonRepeat:o.record(o.string,s.NestableContent),repeat:c.RepeatableWidgets})}(CC)),CC}var RC={},dV;function MC(){return dV||(dV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SharedSliceContent=e.SharedSliceLegacy=e.isSharedSliceContent=e.SharedSliceContentType=void 0;const t=H,n=mt,r=jn(),i=Qe(),o=t.__importStar(ee),a=ZK,u=tf(),s=Nt(),c=Ks(),l=lV();e.SharedSliceContentType="SharedSliceContent";const f=h=>(0,s.hasContentType)(h)&&h.__TYPE__===e.SharedSliceContentType;e.isSharedSliceContent=f;const d=o.exact(o.type({variation:o.string,items:(0,a.withFallback)(o.array(o.unknown),[]),primary:(0,a.withFallback)(o.UnknownRecord,{})})),p=h=>new o.Type("SharedSliceLegacy",e.isSharedSliceContent,v=>(0,i.pipe)(d.decode(v),n.either.map(m=>{const _=(()=>{const S=(0,u.getFieldCtx)("items",h,["variations",m.variation]),b=(0,l.RepeatableWidgetsLegacy)(S).decode(m.items);if(!(!b||(0,r.isLeft)(b)))return b.right})()||[],g=Object.entries(m.primary).reduce((S,[b,$])=>{const T=(0,u.getFieldCtx)(b,h,["variations",m.variation,"primary"]),R=(0,c.NestableLegacy)(T).decode($);return!R||(0,r.isLeft)(R)?S:{...S,[b]:R.right}},{});return{variation:m.variation,primary:g,items:_,__TYPE__:e.SharedSliceContentType}})),v=>{const m=Object.entries(v.primary).reduce((g,[S,b])=>{const $=(0,u.getFieldCtx)(S,h,["variations",v.variation,"primary"]),T=(0,c.NestableLegacy)($).encode(b);return T?{content:{...g.content,[S]:T.content},types:{...g.types,...T.types}}:g},{content:{},types:{}}),_=(()=>{const g=(0,u.getFieldCtx)("items",h,["variations",v.variation]);return(0,l.RepeatableWidgetsLegacy)(g).encode(v.items)})()||[];return{content:{primary:m.content,items:_.map(g=>g.content),variation:v.variation},types:{[h.keyOfType]:"SharedSlice",...m.types,..._.reduce((g,S)=>({...g,...S.types}),{})}}});e.SharedSliceLegacy=p,e.SharedSliceContent=o.strict({__TYPE__:o.literal(e.SharedSliceContentType),variation:o.string,primary:o.record(o.string,c.NestableContent),items:l.RepeatableWidgets})}(RC)),RC}var pa={},pV;function xC(){if(pV)return pa;pV=1,Object.defineProperty(pa,"__esModule",{value:!0}),pa.SimpleSliceLegacy=pa.isSimpleSliceContent=pa.SimpleSliceContent=void 0;const t=H.__importStar(ee),n=Wy(),r=Ks();pa.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);const i=a=>(0,r.isNestableContent)(a)||(0,n.isGroupContent)(a);pa.isSimpleSliceContent=i;const o=a=>({decode:((0,r.NestableLegacy)(a)||(0,n.GroupLegacy)(a)).decode.bind(null),encode:u=>{switch(u.__TYPE__){case"GroupContentType":return(0,n.GroupLegacy)(a).encode(u);default:return(0,r.NestableLegacy)(a).encode(u)}}});return pa.SimpleSliceLegacy=o,pa}var hV;function mV(){return hV||(hV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SliceContent=e.SliceLegacy=void 0;const t=H,n=t.__importStar(ee),r=EC(),i=MC(),o=xC(),a=u=>({decode:s=>(()=>{switch(u.fieldType){case"Slice":return(0,r.CompositeSliceLegacy)(u);case"SharedSlice":return(0,i.SharedSliceLegacy)(u);default:return(0,o.SimpleSliceLegacy)(u)}})().decode(s),encode:s=>{switch(s.__TYPE__){case"SharedSliceContent":return(0,i.SharedSliceLegacy)(u).encode(s);case"CompositeSliceContent":return(0,r.CompositeSliceLegacy)(u).encode(s);default:return(0,o.SimpleSliceLegacy)(u).encode(s)}}});e.SliceLegacy=a,e.SliceContent=n.union([r.CompositeSliceContent,i.SharedSliceContent,o.SimpleSliceContent]),t.__exportStar(EC(),e),t.__exportStar(MC(),e),t.__exportStar(xC(),e)}(wC)),wC}var Hs={},vV;function gV(){if(vV)return Hs;vV=1,Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.SlicesItemLegacy=Hs.SliceItemContent=void 0;const e=H,t=mt,n=jn(),r=Qe(),i=e.__importStar(ee),o=au(),a=tf(),u=mV(),s=EC(),c=MC(),l=xC();Hs.SliceItemContent=i.type({key:i.string,name:i.string,maybeLabel:i.union([i.string,i.undefined]),widget:u.SliceContent});const f=i.exact(i.intersection([i.type({key:i.string,value:i.unknown}),i.partial({label:(0,o.nullable)(i.string)})])),d=p=>new i.Type("SlicesItemLegacy",h=>((0,c.isSharedSliceContent)(h.widget),(0,s.isCompositeSliceContent)(h.widget),(0,l.isSimpleSliceContent)(h.widget)),(h,v)=>(0,r.pipe)(f.decode(h),t.either.chain(m=>{var _;const g=m.key.indexOf("$"),S=m.key.substring(0,g>0?g:void 0),b=(0,a.getFieldCtx)(S,p),$=(0,u.SliceLegacy)(b).decode(m.value);return!$||(0,n.isLeft)($)?i.failure(h,v):i.success({key:m.key,name:S,maybeLabel:(_=m.label)!==null&&_!==void 0?_:void 0,widget:$.right})})),h=>{const v=(0,a.getFieldCtx)(h.name,p),m=(0,u.SliceLegacy)(v).encode(h.widget);return{content:{key:h.key,label:h.maybeLabel,value:(m==null?void 0:m.content)||{}},types:(m==null?void 0:m.types)||{}}});return Hs.SlicesItemLegacy=d,Hs}var kC={},yV;function ESe(){return yV||(yV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SlicesContent=e.SlicesLegacy=e.isSlicesContent=e.SlicesContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=Nt(),a=gV();e.SlicesContentType="SliceContentType";const u=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.SlicesContentType;e.isSlicesContent=u;const s=c=>{const l=i.array((0,a.SlicesItemLegacy)(c));return new i.Type("SlicesLegacy",e.isSlicesContent,f=>(0,r.pipe)(l.decode(f),n.either.map(d=>({__TYPE__:e.SlicesContentType,value:d}))),f=>{const d=l.encode(f.value);return{content:d.map(p=>p.content),types:d.reduce((p,h)=>({...p,...h.types}),{[c.keyOfType]:"Slices"})}})};e.SlicesLegacy=s,e.SlicesContent=i.type({__TYPE__:i.literal(e.SlicesContentType),value:i.array(a.SliceItemContent)})}(kC)),kC}var bV;function _V(){return bV||(bV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(mV(),e),t.__exportStar(gV(),e),t.__exportStar(ESe(),e)}(OC)),OC}var AC={},SV;function $V(){return SV||(SV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UIDContent=e.UIDLegacy=e.isUIDContent=e.UIDContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=Nt();e.UIDContentType="UIDContent";const a=s=>(0,o.hasContentType)(s)&&s.__TYPE__===e.UIDContentType;e.isUIDContent=a;const u=s=>new i.Type("UIDLegacy",e.isUIDContent,c=>(0,r.pipe)(i.string.decode(c),n.either.map(l=>e.UIDContent.encode({value:l,__TYPE__:e.UIDContentType}))),c=>({content:c.value,types:{[s.keyOfType]:"UID"}}));e.UIDLegacy=u,e.UIDContent=i.type({__TYPE__:i.literal(e.UIDContentType),value:i.string})}(AC)),AC}var ha={},TV;function RSe(){if(TV)return ha;TV=1,Object.defineProperty(ha,"__esModule",{value:!0}),ha.WidgetLegacy=ha.isWidgetContent=ha.WidgetContent=void 0;const t=H.__importStar(ee),n=Wy(),r=Ks(),i=_V(),o=$V();ha.WidgetContent=t.union([n.GroupContent,r.NestableContent,o.UIDContent,i.SlicesContent]);const a=s=>(0,n.isGroupContent)(s)||(0,r.isNestableContent)(s)||(0,o.isUIDContent)(s)||(0,i.isSlicesContent)(s);ha.isWidgetContent=a;const u=s=>({decode(c){if(!s.fieldType)return;const l=(()=>{switch(s.fieldType){case"UID":return(0,o.UIDLegacy)(s);case"Group":return(0,n.GroupLegacy)(s);case"Choice":case"Slices":return(0,i.SlicesLegacy)(s);default:return(0,r.NestableLegacy)(s)}})();if(l)return l.decode(c)},encode(c){switch(c.__TYPE__){case o.UIDContentType:return(0,o.UIDLegacy)(s).encode(c);case n.GroupContentType:return(0,n.GroupLegacy)(s).encode(c);case i.SlicesContentType:return(0,i.SlicesLegacy)(s).encode(c);default:return(0,r.NestableLegacy)(s).encode(c)}}});return ha.WidgetLegacy=u,ha}var IV;function NC(){return IV||(IV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(Wy(),e),t.__exportStar(Ks(),e),t.__exportStar(_V(),e),t.__exportStar($V(),e),t.__exportStar(RSe(),e)}(uw)),uw}var OV;function MSe(){if(OV)return Vu;OV=1,Object.defineProperty(Vu,"__esModule",{value:!0}),Vu.DocumentLegacy=Vu.Document=void 0;const e=H,t=mt,n=jn(),r=Qe(),i=e.__importStar(ee),o=Ql(),a=NC(),u=tf();Vu.Document=i.record(o.WidgetKey,a.WidgetContent);const s=i.record(o.WidgetKey,i.unknown),c=p=>new i.Type("Document",h=>!!h&&typeof h=="object",h=>(0,r.pipe)(s.decode(h),t.either.map(v=>Object.entries(v).reduce((m,[_,g])=>{const S=(0,u.defaultCtx)(_,p),b=(0,a.WidgetLegacy)(S).decode(g);return!b||(0,n.isLeft)(b)?m:{...m,[_]:b.right}},{}))),h=>Object.entries(h).reduce((v,[m,_])=>{const g=(0,u.defaultCtx)(m,p),S=(0,a.WidgetLegacy)(g).encode(_);return S?{content:{...v.content,[m]:S.content},types:{...v.types,...S.types}}:v},{content:{},types:{}}));function l(p){const h=Object.entries(p),{types:v,widgets:m}=h.reduce((S,[b,$])=>{if(b.endsWith("_TYPE")){const T=u.FieldOrSliceType.decode($);if((0,n.isRight)(T))return{...S,types:S.types.set(b.substring(0,b.length-5),T.right)}}return!b.endsWith("_POSITION")&&!b.endsWith("_TYPE")?{...S,widgets:{...S.widgets,[b]:$}}:S},{types:new Map,widgets:{}}),_=p.slugs_INTERNAL||[],g=p.uid;return{widgets:m,types:v,uid:g,slugs:_}}function f(p){const h=(0,r.pipe)(i.record(o.WidgetKey,i.unknown).decode(p),t.either.chain(v=>{const{types:m,widgets:_}=l(v);return c(m).decode(_)}));return(0,n.isLeft)(h)?void 0:h.right}function d(p){const h=c().encode(p);return{...h.content,...h.types}}return Vu.DocumentLegacy={_codec:c,extractMetadata:l,parse:f,encode:d},Vu}(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(MSe(),e),t.__exportStar(NC(),e),t.__exportStar(tf(),e)})(ut);function Vr(e){var t;return((t=e.config)==null?void 0:t.label)??(e.type==="Boolean"||e.type==="Separator"?void 0:e.fieldset)??e.type}const wV="...";function Gs(e,t){var n,r,i;return e.type==="Boolean"?(t?(n=e.config)==null?void 0:n.placeholder_true:(r=e.config)==null?void 0:r.placeholder_false)??wV:e.type==="GeoPoint"?"TODO":((i=e.config)==null?void 0:i.placeholder)??wV}const xSe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var a;const o=(e==null?void 0:e.value)??((a=t.config)==null?void 0:a.default_value)??!1;return I.jsxs(M.Field,{children:[I.jsx(M.FieldIcon,{children:I.jsx(M.Icon,{name:"toggleOff"})}),I.jsx(M.FieldLabel,{htmlFor:n,children:Vr(t)}),I.jsxs(M.FieldControl,{children:[I.jsx(M.Text,{children:Gs(t,o)}),I.jsx(M.Switch,{checked:o,id:n,onCheckedChange:u=>{i||r(kSe(u))}})]})]})};function kSe(e){return{__TYPE__:"BooleanContent",value:e}}const ASe=e=>e===void 0?void 0:{__TYPE__:"FieldContent",type:"Color",value:e},NSe=({id:e,field:t,content:n,onContentChange:r})=>I.jsxs(M.Field,{children:[I.jsx(M.FieldIcon,{children:I.jsx(M.Icon,{name:"colorLens"})}),I.jsx(M.FieldLabel,{id:e,children:Vr(t)}),I.jsx(M.FieldControl,{children:I.jsx(I.Fragment,{children:I.jsx(M.Box,{padding:{left:4},alignItems:"center",children:I.jsx(M.ColorInput,{onValueChange:i=>r(ASe(i)),value:n==null?void 0:n.value,"aria-labelledby":e,placeholder:Gs(t)})})})})]}),FSe=e=>e===void 0?void 0:{__TYPE__:"FieldContent",type:"Date",value:e},PSe=({id:e,readOnly:t,field:n,content:r,onContentChange:i})=>I.jsxs(M.Field,{children:[I.jsx(M.FieldIcon,{children:I.jsx(M.Icon,{name:"dateRange"})}),I.jsx(M.FieldLabel,{id:e,children:Vr(n)}),I.jsx(M.FieldControl,{children:I.jsx(I.Fragment,{children:I.jsx(M.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:I.jsx(M.DateInput,{mode:"date","aria-labelledby":e,readOnly:t,value:r==null?void 0:r.value,onValueChange:o=>i(FSe(o))})})})})]});var Je;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),a={};for(const u of o)a[u]=i[u];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Je||(Je={}));var FC;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(FC||(FC={}));const oe=Je.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),cu=e=>{switch(typeof e){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(e)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(e)?oe.array:e===null?oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?oe.promise:typeof Map<"u"&&e instanceof Map?oe.map:typeof Set<"u"&&e instanceof Set?oe.set:typeof Date<"u"&&e instanceof Date?oe.date:oe.object;default:return oe.unknown}},G=Je.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"]),WSe=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Ei extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const 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){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let u=r,s=0;for(;s<a.path.length;){const c=a.path[s];s===a.path.length-1?(u[c]=u[c]||{_errors:[]},u[c]._errors.push(n(a))):u[c]=u[c]||{_errors:[]},u=u[c],s++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Je.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const 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()}}Ei.create=e=>new Ei(e);const sh=(e,t)=>{let n;switch(e.code){case G.invalid_type:e.received===oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case G.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Je.jsonStringifyReplacer)}`;break;case G.unrecognized_keys:n=`Unrecognized key(s) in object: ${Je.joinValues(e.keys,", ")}`;break;case G.invalid_union:n="Invalid input";break;case G.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Je.joinValues(e.options)}`;break;case G.invalid_enum_value:n=`Invalid enum value. Expected ${Je.joinValues(e.options)}, received '${e.received}'`;break;case G.invalid_arguments:n="Invalid function arguments";break;case G.invalid_return_type:n="Invalid function return type";break;case G.invalid_date:n="Invalid date";break;case G.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Je.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case G.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case G.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case G.custom:n="Invalid input";break;case G.invalid_intersection_types:n="Intersection results could not be merged";break;case G.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case G.not_finite:n="Number must be finite";break;default:n=t.defaultError,Je.assertNever(e)}return{message:n}};let CV=sh;function LSe(e){CV=e}function Ly(){return CV}const jy=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let u="";const s=r.filter(c=>!!c).slice().reverse();for(const c of s)u=c(a,{data:t,defaultError:u}).message;return{...i,path:o,message:i.message||u}},jSe=[];function ue(e,t){const n=jy({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Ly(),sh].filter(r=>!!r)});e.common.issues.push(n)}class Cn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return Oe;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return Cn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return Oe;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const Oe=Object.freeze({status:"aborted"}),EV=e=>({status:"dirty",value:e}),qn=e=>({status:"valid",value:e}),PC=e=>e.status==="aborted",WC=e=>e.status==="dirty",Dy=e=>e.status==="valid",qy=e=>typeof Promise<"u"&&e instanceof Promise;var me;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(me||(me={}));class co{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}}const RV=(e,t)=>{if(Dy(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ei(e.common.issues);return this._error=n,this._error}}};function Re(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,u)=>a.code!=="invalid_type"?{message:u.defaultError}:typeof u.data>"u"?{message:r??u.defaultError}:{message:n??u.defaultError},description:i}}class Ae{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 cu(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:cu(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Cn,ctx:{common:t.parent.common,data:t.data,parsedType:cu(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(qy(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:cu(t)},o=this._parseSync({data:t,path:i.path,parent:i});return RV(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:cu(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(qy(i)?i:Promise.resolve(i));return RV(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const a=t(i),u=()=>o.addIssue({code:G.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(s=>s?!0:(u(),!1)):a?!0:(u(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new xi({schema:this,typeName:_e.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return va.create(this,this._def)}nullable(){return Xs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Mi.create(this,this._def)}promise(){return lf.create(this,this._def)}or(t){return dh.create([this,t],this._def)}and(t){return ph.create(this,t,this._def)}transform(t){return new xi({...Re(this._def),schema:this,typeName:_e.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new yh({...Re(this._def),innerType:this,defaultValue:n,typeName:_e.ZodDefault})}brand(){return new xV({typeName:_e.ZodBranded,type:this,...Re(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Hy({...Re(this._def),innerType:this,catchValue:n,typeName:_e.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return bh.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const DSe=/^c[^\s-]{8,}$/i,qSe=/^[a-z][a-z0-9]*$/,USe=/[0-9A-HJKMNP-TV-Z]{26}/,BSe=/^([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,zSe=/^(([^<>()[\]\\.,;:\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,})+))$/,KSe=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,VSe=/^(((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}))$/,HSe=/^(([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})))$/,GSe=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function YSe(e,t){return!!((t==="v4"||!t)&&VSe.test(e)||(t==="v6"||!t)&&HSe.test(e))}class Ri extends Ae{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(i=>t.test(i),{validation:n,code:G.invalid_string,...me.errToObj(r)}),this.nonempty=t=>this.min(1,me.errToObj(t)),this.trim=()=>new Ri({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new Ri({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new Ri({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==oe.string){const o=this._getOrReturnCtx(t);return ue(o,{code:G.invalid_type,expected:oe.string,received:o.parsedType}),Oe}const r=new Cn;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:G.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:G.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,u=t.data.length<o.value;(a||u)&&(i=this._getOrReturnCtx(t,i),a?ue(i,{code:G.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&ue(i,{code:G.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")zSe.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"email",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")KSe.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"emoji",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")BSe.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"uuid",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")DSe.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"cuid",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")qSe.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"cuid2",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")USe.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"ulid",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),ue(i,{validation:"url",code:G.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"regex",code:G.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),ue(i,{code:G.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),ue(i,{code:G.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),ue(i,{code:G.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?GSe(o).test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{code:G.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?YSe(t.data,o.version)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"ip",code:G.invalid_string,message:o.message}),r.dirty()):Je.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new Ri({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...me.errToObj(t)})}url(t){return this._addCheck({kind:"url",...me.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...me.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...me.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...me.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...me.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...me.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...me.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...me.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...me.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...me.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...me.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...me.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...me.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...me.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...me.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ri.create=e=>{var t;return new Ri({checks:[],typeName:_e.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Re(e)})};function JSe(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}class lu extends Ae{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)!==oe.number){const o=this._getOrReturnCtx(t);return ue(o,{code:G.invalid_type,expected:oe.number,received:o.parsedType}),Oe}let r;const i=new Cn;for(const o of this._def.checks)o.kind==="int"?Je.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ue(r,{code:G.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:G.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:G.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?JSe(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),ue(r,{code:G.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ue(r,{code:G.not_finite,message:o.message}),i.dirty()):Je.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,me.toString(n))}gt(t,n){return this.setLimit("min",t,!1,me.toString(n))}lte(t,n){return this.setLimit("max",t,!0,me.toString(n))}lt(t,n){return this.setLimit("max",t,!1,me.toString(n))}setLimit(t,n,r,i){return new lu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:me.toString(i)}]})}_addCheck(t){return new lu({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:me.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:me.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:me.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:me.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:me.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:me.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Je.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}lu.create=e=>new lu({checks:[],typeName:_e.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Re(e)});class fu extends Ae{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)!==oe.bigint){const o=this._getOrReturnCtx(t);return ue(o,{code:G.invalid_type,expected:oe.bigint,received:o.parsedType}),Oe}let r;const i=new Cn;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:G.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:G.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:G.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Je.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,me.toString(n))}gt(t,n){return this.setLimit("min",t,!1,me.toString(n))}lte(t,n){return this.setLimit("max",t,!0,me.toString(n))}lt(t,n){return this.setLimit("max",t,!1,me.toString(n))}setLimit(t,n,r,i){return new fu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:me.toString(i)}]})}_addCheck(t){return new fu({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:me.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:me.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}fu.create=e=>{var t;return new fu({checks:[],typeName:_e.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Re(e)})};class ch extends Ae{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==oe.boolean){const r=this._getOrReturnCtx(t);return ue(r,{code:G.invalid_type,expected:oe.boolean,received:r.parsedType}),Oe}return qn(t.data)}}ch.create=e=>new ch({typeName:_e.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Re(e)});class Ys extends Ae{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==oe.date){const o=this._getOrReturnCtx(t);return ue(o,{code:G.invalid_type,expected:oe.date,received:o.parsedType}),Oe}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ue(o,{code:G.invalid_date}),Oe}const r=new Cn;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:G.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:G.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Je.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Ys({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:me.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:me.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Ys.create=e=>new Ys({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:_e.ZodDate,...Re(e)});class Uy extends Ae{_parse(t){if(this._getType(t)!==oe.symbol){const r=this._getOrReturnCtx(t);return ue(r,{code:G.invalid_type,expected:oe.symbol,received:r.parsedType}),Oe}return qn(t.data)}}Uy.create=e=>new Uy({typeName:_e.ZodSymbol,...Re(e)});class lh extends Ae{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return ue(r,{code:G.invalid_type,expected:oe.undefined,received:r.parsedType}),Oe}return qn(t.data)}}lh.create=e=>new lh({typeName:_e.ZodUndefined,...Re(e)});class fh extends Ae{_parse(t){if(this._getType(t)!==oe.null){const r=this._getOrReturnCtx(t);return ue(r,{code:G.invalid_type,expected:oe.null,received:r.parsedType}),Oe}return qn(t.data)}}fh.create=e=>new fh({typeName:_e.ZodNull,...Re(e)});class uf extends Ae{constructor(){super(...arguments),this._any=!0}_parse(t){return qn(t.data)}}uf.create=e=>new uf({typeName:_e.ZodAny,...Re(e)});class Js extends Ae{constructor(){super(...arguments),this._unknown=!0}_parse(t){return qn(t.data)}}Js.create=e=>new Js({typeName:_e.ZodUnknown,...Re(e)});class ma extends Ae{_parse(t){const n=this._getOrReturnCtx(t);return ue(n,{code:G.invalid_type,expected:oe.never,received:n.parsedType}),Oe}}ma.create=e=>new ma({typeName:_e.ZodNever,...Re(e)});class By extends Ae{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return ue(r,{code:G.invalid_type,expected:oe.void,received:r.parsedType}),Oe}return qn(t.data)}}By.create=e=>new By({typeName:_e.ZodVoid,...Re(e)});class Mi extends Ae{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==oe.array)return ue(n,{code:G.invalid_type,expected:oe.array,received:n.parsedType}),Oe;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,u=n.data.length<i.exactLength.value;(a||u)&&(ue(n,{code:a?G.too_big:G.too_small,minimum:u?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ue(n,{code:G.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ue(n,{code:G.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((a,u)=>i.type._parseAsync(new co(n,a,n.path,u)))).then(a=>Cn.mergeArray(r,a));const o=[...n.data].map((a,u)=>i.type._parseSync(new co(n,a,n.path,u)));return Cn.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Mi({...this._def,minLength:{value:t,message:me.toString(n)}})}max(t,n){return new Mi({...this._def,maxLength:{value:t,message:me.toString(n)}})}length(t,n){return new Mi({...this._def,exactLength:{value:t,message:me.toString(n)}})}nonempty(t){return this.min(1,t)}}Mi.create=(e,t)=>new Mi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:_e.ZodArray,...Re(t)});function sf(e){if(e instanceof St){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=va.create(sf(r))}return new St({...e._def,shape:()=>t})}else return e instanceof Mi?new Mi({...e._def,type:sf(e.element)}):e instanceof va?va.create(sf(e.unwrap())):e instanceof Xs?Xs.create(sf(e.unwrap())):e instanceof lo?lo.create(e.items.map(t=>sf(t))):e}class St extends Ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Je.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==oe.object){const c=this._getOrReturnCtx(t);return ue(c,{code:G.invalid_type,expected:oe.object,received:c.parsedType}),Oe}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof ma&&this._def.unknownKeys==="strip"))for(const c in i.data)a.includes(c)||u.push(c);const s=[];for(const c of a){const l=o[c],f=i.data[c];s.push({key:{status:"valid",value:c},value:l._parse(new co(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof ma){const c=this._def.unknownKeys;if(c==="passthrough")for(const l of u)s.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(c==="strict")u.length>0&&(ue(i,{code:G.unrecognized_keys,keys:u}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const l of u){const f=i.data[l];s.push({key:{status:"valid",value:l},value:c._parse(new co(i,f,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const l of s){const f=await l.key;c.push({key:f,value:await l.value,alwaysSet:l.alwaysSet})}return c}).then(c=>Cn.mergeObjectSync(r,c)):Cn.mergeObjectSync(r,s)}get shape(){return this._def.shape()}strict(t){return me.errToObj,new St({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,a,u;const s=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(u=me.errToObj(t).message)!==null&&u!==void 0?u:s}:{message:s}}}:{}})}strip(){return new St({...this._def,unknownKeys:"strip"})}passthrough(){return new St({...this._def,unknownKeys:"passthrough"})}extend(t){return new St({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new St({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:_e.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new St({...this._def,catchall:t})}pick(t){const n={};return Je.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new St({...this._def,shape:()=>n})}omit(t){const n={};return Je.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new St({...this._def,shape:()=>n})}deepPartial(){return sf(this)}partial(t){const n={};return Je.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new St({...this._def,shape:()=>n})}required(t){const n={};return Je.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof va;)o=o._def.innerType;n[r]=o}}),new St({...this._def,shape:()=>n})}keyof(){return MV(Je.objectKeys(this.shape))}}St.create=(e,t)=>new St({shape:()=>e,unknownKeys:"strip",catchall:ma.create(),typeName:_e.ZodObject,...Re(t)}),St.strictCreate=(e,t)=>new St({shape:()=>e,unknownKeys:"strict",catchall:ma.create(),typeName:_e.ZodObject,...Re(t)}),St.lazycreate=(e,t)=>new St({shape:e,unknownKeys:"strip",catchall:ma.create(),typeName:_e.ZodObject,...Re(t)});class dh extends Ae{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const u of o)if(u.result.status==="valid")return u.result;for(const u of o)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const a=o.map(u=>new Ei(u.ctx.common.issues));return ue(n,{code:G.invalid_union,unionErrors:a}),Oe}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const s of r){const c={...n,common:{...n.common,issues:[]},parent:null},l=s._parseSync({data:n.data,path:n.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const u=a.map(s=>new Ei(s));return ue(n,{code:G.invalid_union,unionErrors:u}),Oe}}get options(){return this._def.options}}dh.create=(e,t)=>new dh({options:e,typeName:_e.ZodUnion,...Re(t)});const zy=e=>e instanceof mh?zy(e.schema):e instanceof xi?zy(e.innerType()):e instanceof vh?[e.value]:e instanceof du?e.options:e instanceof gh?Object.keys(e.enum):e instanceof yh?zy(e._def.innerType):e instanceof lh?[void 0]:e instanceof fh?[null]:null;class Ky extends Ae{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.object)return ue(n,{code:G.invalid_type,expected:oe.object,received:n.parsedType}),Oe;const 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}):(ue(n,{code:G.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Oe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const a=zy(o.shape[t]);if(!a)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const u of a){if(i.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);i.set(u,o)}}return new Ky({typeName:_e.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Re(r)})}}function LC(e,t){const n=cu(e),r=cu(t);if(e===t)return{valid:!0,data:e};if(n===oe.object&&r===oe.object){const i=Je.objectKeys(t),o=Je.objectKeys(e).filter(u=>i.indexOf(u)!==-1),a={...e,...t};for(const u of o){const s=LC(e[u],t[u]);if(!s.valid)return{valid:!1};a[u]=s.data}return{valid:!0,data:a}}else if(n===oe.array&&r===oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const a=e[o],u=t[o],s=LC(a,u);if(!s.valid)return{valid:!1};i.push(s.data)}return{valid:!0,data:i}}else return n===oe.date&&r===oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ph extends Ae{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(PC(o)||PC(a))return Oe;const u=LC(o.value,a.value);return u.valid?((WC(o)||WC(a))&&n.dirty(),{status:n.value,value:u.data}):(ue(r,{code:G.invalid_intersection_types}),Oe)};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(([o,a])=>i(o,a)):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}))}}ph.create=(e,t,n)=>new ph({left:e,right:t,typeName:_e.ZodIntersection,...Re(n)});class lo extends Ae{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.array)return ue(r,{code:G.invalid_type,expected:oe.array,received:r.parsedType}),Oe;if(r.data.length<this._def.items.length)return ue(r,{code:G.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Oe;!this._def.rest&&r.data.length>this._def.items.length&&(ue(r,{code:G.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,u)=>{const s=this._def.items[u]||this._def.rest;return s?s._parse(new co(r,a,r.path,u)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Cn.mergeArray(n,a)):Cn.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new lo({...this._def,rest:t})}}lo.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new lo({items:e,typeName:_e.ZodTuple,rest:null,...Re(t)})};class hh extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.object)return ue(r,{code:G.invalid_type,expected:oe.object,received:r.parsedType}),Oe;const i=[],o=this._def.keyType,a=this._def.valueType;for(const u in r.data)i.push({key:o._parse(new co(r,u,r.path,u)),value:a._parse(new co(r,r.data[u],r.path,u))});return r.common.async?Cn.mergeObjectAsync(n,i):Cn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Ae?new hh({keyType:t,valueType:n,typeName:_e.ZodRecord,...Re(r)}):new hh({keyType:Ri.create(),valueType:t,typeName:_e.ZodRecord,...Re(n)})}}class Vy extends Ae{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.map)return ue(r,{code:G.invalid_type,expected:oe.map,received:r.parsedType}),Oe;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([u,s],c)=>({key:i._parse(new co(r,u,r.path,[c,"key"])),value:o._parse(new co(r,s,r.path,[c,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const s of a){const c=await s.key,l=await s.value;if(c.status==="aborted"||l.status==="aborted")return Oe;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),u.set(c.value,l.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const s of a){const c=s.key,l=s.value;if(c.status==="aborted"||l.status==="aborted")return Oe;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),u.set(c.value,l.value)}return{status:n.value,value:u}}}}Vy.create=(e,t,n)=>new Vy({valueType:t,keyType:e,typeName:_e.ZodMap,...Re(n)});class Zs extends Ae{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.set)return ue(r,{code:G.invalid_type,expected:oe.set,received:r.parsedType}),Oe;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(ue(r,{code:G.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(ue(r,{code:G.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(s){const c=new Set;for(const l of s){if(l.status==="aborted")return Oe;l.status==="dirty"&&n.dirty(),c.add(l.value)}return{status:n.value,value:c}}const u=[...r.data.values()].map((s,c)=>o._parse(new co(r,s,r.path,c)));return r.common.async?Promise.all(u).then(s=>a(s)):a(u)}min(t,n){return new Zs({...this._def,minSize:{value:t,message:me.toString(n)}})}max(t,n){return new Zs({...this._def,maxSize:{value:t,message:me.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Zs.create=(e,t)=>new Zs({valueType:e,minSize:null,maxSize:null,typeName:_e.ZodSet,...Re(t)});class cf extends Ae{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.function)return ue(n,{code:G.invalid_type,expected:oe.function,received:n.parsedType}),Oe;function r(u,s){return jy({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ly(),sh].filter(c=>!!c),issueData:{code:G.invalid_arguments,argumentsError:s}})}function i(u,s){return jy({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ly(),sh].filter(c=>!!c),issueData:{code:G.invalid_return_type,returnTypeError:s}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof lf?qn(async(...u)=>{const s=new Ei([]),c=await this._def.args.parseAsync(u,o).catch(d=>{throw s.addIssue(r(u,d)),s}),l=await a(...c);return await this._def.returns._def.type.parseAsync(l,o).catch(d=>{throw s.addIssue(i(l,d)),s})}):qn((...u)=>{const s=this._def.args.safeParse(u,o);if(!s.success)throw new Ei([r(u,s.error)]);const c=a(...s.data),l=this._def.returns.safeParse(c,o);if(!l.success)throw new Ei([i(c,l.error)]);return l.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new cf({...this._def,args:lo.create(t).rest(Js.create())})}returns(t){return new cf({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new cf({args:t||lo.create([]).rest(Js.create()),returns:n||Js.create(),typeName:_e.ZodFunction,...Re(r)})}}class mh extends Ae{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}mh.create=(e,t)=>new mh({getter:e,typeName:_e.ZodLazy,...Re(t)});class vh extends Ae{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ue(n,{received:n.data,code:G.invalid_literal,expected:this._def.value}),Oe}return{status:"valid",value:t.data}}get value(){return this._def.value}}vh.create=(e,t)=>new vh({value:e,typeName:_e.ZodLiteral,...Re(t)});function MV(e,t){return new du({values:e,typeName:_e.ZodEnum,...Re(t)})}class du extends Ae{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ue(n,{expected:Je.joinValues(r),received:n.parsedType,code:G.invalid_type}),Oe}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return ue(n,{received:n.data,code:G.invalid_enum_value,options:r}),Oe}return qn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return du.create(t)}exclude(t){return du.create(this.options.filter(n=>!t.includes(n)))}}du.create=MV;class gh extends Ae{_parse(t){const n=Je.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==oe.string&&r.parsedType!==oe.number){const i=Je.objectValues(n);return ue(r,{expected:Je.joinValues(i),received:r.parsedType,code:G.invalid_type}),Oe}if(n.indexOf(t.data)===-1){const i=Je.objectValues(n);return ue(r,{received:r.data,code:G.invalid_enum_value,options:i}),Oe}return qn(t.data)}get enum(){return this._def.values}}gh.create=(e,t)=>new gh({values:e,typeName:_e.ZodNativeEnum,...Re(t)});class lf extends Ae{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.promise&&n.common.async===!1)return ue(n,{code:G.invalid_type,expected:oe.promise,received:n.parsedType}),Oe;const r=n.parsedType===oe.promise?n.data:Promise.resolve(n.data);return qn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}lf.create=(e,t)=>new lf({type:e,typeName:_e.ZodPromise,...Re(t)});class xi extends Ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null;if(i.type==="preprocess"){const a=i.transform(r.data);return r.common.async?Promise.resolve(a).then(u=>this._def.schema._parseAsync({data:u,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}const o={addIssue:a=>{ue(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="refinement"){const a=u=>{const s=i.refinement(u,o);if(r.common.async)return Promise.resolve(s);if(s instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?Oe:(u.status==="dirty"&&n.dirty(),a(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?Oe:(u.status==="dirty"&&n.dirty(),a(u.value).then(()=>({status:n.value,value:u.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Dy(a))return a;const u=i.transform(a.value,o);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Dy(a)?Promise.resolve(i.transform(a.value,o)).then(u=>({status:n.value,value:u})):a);Je.assertNever(i)}}xi.create=(e,t,n)=>new xi({schema:e,typeName:_e.ZodEffects,effect:t,...Re(n)}),xi.createWithPreprocess=(e,t,n)=>new xi({schema:t,effect:{type:"preprocess",transform:e},typeName:_e.ZodEffects,...Re(n)});class va extends Ae{_parse(t){return this._getType(t)===oe.undefined?qn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}va.create=(e,t)=>new va({innerType:e,typeName:_e.ZodOptional,...Re(t)});class Xs extends Ae{_parse(t){return this._getType(t)===oe.null?qn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Xs.create=(e,t)=>new Xs({innerType:e,typeName:_e.ZodNullable,...Re(t)});class yh extends Ae{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}yh.create=(e,t)=>new yh({innerType:e,typeName:_e.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Re(t)});class Hy extends Ae{_parse(t){const{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 qy(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ei(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ei(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Hy.create=(e,t)=>new Hy({innerType:e,typeName:_e.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Re(t)});class Gy extends Ae{_parse(t){if(this._getType(t)!==oe.nan){const r=this._getOrReturnCtx(t);return ue(r,{code:G.invalid_type,expected:oe.nan,received:r.parsedType}),Oe}return{status:"valid",value:t.data}}}Gy.create=e=>new Gy({typeName:_e.ZodNaN,...Re(e)});const ZSe=Symbol("zod_brand");class xV extends Ae{_parse(t){const{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 bh extends Ae{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Oe:o.status==="dirty"?(n.dirty(),EV(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Oe:i.status==="dirty"?(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 bh({in:t,out:n,typeName:_e.ZodPipeline})}}const kV=(e,t={},n)=>e?uf.create().superRefine((r,i)=>{var o,a;if(!e(r)){const u=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,s=(a=(o=u.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,c=typeof u=="string"?{message:u}:u;i.addIssue({code:"custom",...c,fatal:s})}}):uf.create(),XSe={object:St.lazycreate};var _e;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"})(_e||(_e={}));const QSe=(e,t={message:`Input not instance of ${e.name}`})=>kV(n=>n instanceof e,t),_h=Ri.create,Yy=lu.create,e$e=Gy.create,t$e=fu.create,AV=ch.create,n$e=Ys.create,r$e=Uy.create,i$e=lh.create,o$e=fh.create,a$e=uf.create,NV=Js.create,u$e=ma.create,s$e=By.create,FV=Mi.create,Jy=St.create,c$e=St.strictCreate,l$e=dh.create,f$e=Ky.create,d$e=ph.create,p$e=lo.create,h$e=hh.create,m$e=Vy.create,v$e=Zs.create,g$e=cf.create,y$e=mh.create,b$e=vh.create,_$e=du.create,S$e=gh.create,$$e=lf.create,PV=xi.create,T$e=va.create,I$e=Xs.create,O$e=xi.createWithPreprocess,w$e=bh.create;var Un=Object.freeze({__proto__:null,defaultErrorMap:sh,setErrorMap:LSe,getErrorMap:Ly,makeIssue:jy,EMPTY_PATH:jSe,addIssueToContext:ue,ParseStatus:Cn,INVALID:Oe,DIRTY:EV,OK:qn,isAborted:PC,isDirty:WC,isValid:Dy,isAsync:qy,get util(){return Je},get objectUtil(){return FC},ZodParsedType:oe,getParsedType:cu,ZodType:Ae,ZodString:Ri,ZodNumber:lu,ZodBigInt:fu,ZodBoolean:ch,ZodDate:Ys,ZodSymbol:Uy,ZodUndefined:lh,ZodNull:fh,ZodAny:uf,ZodUnknown:Js,ZodNever:ma,ZodVoid:By,ZodArray:Mi,ZodObject:St,ZodUnion:dh,ZodDiscriminatedUnion:Ky,ZodIntersection:ph,ZodTuple:lo,ZodRecord:hh,ZodMap:Vy,ZodSet:Zs,ZodFunction:cf,ZodLazy:mh,ZodLiteral:vh,ZodEnum:du,ZodNativeEnum:gh,ZodPromise:lf,ZodEffects:xi,ZodTransformer:xi,ZodOptional:va,ZodNullable:Xs,ZodDefault:yh,ZodCatch:Hy,ZodNaN:Gy,BRAND:ZSe,ZodBranded:xV,ZodPipeline:bh,custom:kV,Schema:Ae,ZodSchema:Ae,late:XSe,get ZodFirstPartyTypeKind(){return _e},coerce:{string:e=>Ri.create({...e,coerce:!0}),number:e=>lu.create({...e,coerce:!0}),boolean:e=>ch.create({...e,coerce:!0}),bigint:e=>fu.create({...e,coerce:!0}),date:e=>Ys.create({...e,coerce:!0})},any:a$e,array:FV,bigint:t$e,boolean:AV,date:n$e,discriminatedUnion:f$e,effect:PV,enum:_$e,function:g$e,instanceof:QSe,intersection:d$e,lazy:y$e,literal:b$e,map:m$e,nan:e$e,nativeEnum:S$e,never:u$e,null:o$e,nullable:I$e,number:Yy,object:Jy,oboolean:()=>AV().optional(),onumber:()=>Yy().optional(),optional:T$e,ostring:()=>_h().optional(),pipeline:w$e,preprocess:O$e,promise:$$e,record:h$e,set:v$e,strictObject:c$e,string:_h,symbol:r$e,transformer:PV,tuple:p$e,undefined:i$e,union:l$e,unknown:NV,void:s$e,NEVER:Oe,ZodIssueCode:G,quotelessJson:WSe,ZodError:Ei});function ga(e){return e!=null}async function WV(e,t){const{okType:n,errorType:r=R$e,signal:i,headers:o,body:a,timeout:u=1e4,...s}=t,c=new Headers(o);c.has("Content-Type")||c.set("Content-Type","application/json");const l=k$e();l&&c.set("Authorization",`Bearer ${l}`);const f=c.get("Content-Type")==="application/json"?JSON.stringify(a):a;let d=!1;try{const p=new AbortController,h=M$e([p.signal,i].filter(ga));setTimeout(()=>{d=!0,p.abort()},u);const v=await fetch(e,{...s,body:f,headers:c,signal:h}),{status:m}=v,_=v.clone(),g=await v.json().catch(S=>_.text());if(v.ok){const S=n.safeParse(g);return S.success?{ok:!0,body:S.data}:{ok:!1,error:"validation",status:m,cause:S.error}}else{const S=r.safeParse(g);return S.success?{ok:!1,error:"http",status:m,body:S.data}:{ok:!1,error:"validation",status:m,cause:S.error}}}catch(p){return x$e(p)?{ok:!1,error:d?"timeout":"abort"}:{ok:!1,error:"unknown",cause:p}}}const C$e=new Set(["http","abort","timeout","unknown","validation"]);function LV(e){return ga(e)&&!e.ok&&C$e.has(e.error)}function E$e(e){return LV(e)?e.error==="unknown"?!0:e.error!=="http"?!1:e.status===401||e.status===403:!1}const R$e=NV();function M$e(e){const t=new AbortController;function n(){t.abort();for(const r of e)r.removeEventListener("abort",n)}for(const r of e){if(r.aborted){n();break}r.addEventListener("abort",n)}return t.signal}function x$e(e){return e instanceof DOMException&&e.name==="AbortError"}let k$e=()=>"";function jV(e){const t=U.useRef(e);return U.useLayoutEffect(()=>{t.current=e}),U.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function DV(){const[e,t]=U.useState({});return U.useCallback(()=>t({}),[])}function qV(e,t,n){U.useEffect(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[n,t,e])}function A$e(e,t){F$e(e,t),N$e(e,t);const n=ya.get(e,t);if(!n){const r=e(...t);throw ya.set(e,t,{state:"fetching",promise:r}),UV(e,t,r).catch(i=>console.error(i)),r}if(n.state==="fetching")throw n.promise;if(n.ok)return n.body;throw n.error}function N$e(e,t){const n=DV(),r=jC(t);U.useEffect(()=>()=>{},[e,n,r])}function F$e(e,t){const n=DV();U.useEffect(()=>{const r=ya.getFetcherConfig(e).revalidationStrategy;if((r==null?void 0:r.type)==="never"||!(r!=null&&r.onFocus))return;function i(){if(document.visibilityState==="hidden")return;const o=ya.get(e,t);if(!o||o.state!=="fetched")return;const a=e(...t);o.ok?ya.set(e,t,{state:"revalidating",promise:a,ok:!0,body:o.body}):ya.set(e,t,{state:"revalidating",promise:a,ok:!1,error:o.error}),UV(e,t,a).then(n).catch(u=>console.error(u))}return document.addEventListener("visibilitychange",i),()=>document.removeEventListener("visibilitychange",i)})}function UV(e,t,n){return n.then(r=>ya.set(e,t,{state:"fetched",ok:!0,body:r})).catch(r=>ya.set(e,t,{state:"fetched",ok:!1,error:r}))}const ya=P$e(),BV=ya;function P$e(){const e=new Map,t=new Map,n={cacheCapacity:100,revalidationStrategy:{type:"swr",onFocus:!0}};function r(i){return e.get(i)??n}return{get(i,o){const a=jC(o),u=t.get(i);if(!u||!u.has(a))return;const s=u.get(a);return u.delete(a),s!==void 0&&u.set(a,s),s},set(i,o,a){let u=t.get(i);u||(u=new Map,t.set(i,u));const s=r(i),c=jC(o);u.size===s.cacheCapacity&&!u.has(c)&&u.delete(u.keys().next().value),u.set(c,a)},getFetcherConfig:r,registerFetcherConfig(i,o){e.set(i,o)},clear(...i){if(i.length>0)for(const o of i)t.delete(o);else t.clear()}}}function jC(e){return e.join(`
|
|
29
|
-
`)}function zV(e,t){const n=A$e(e,t);if(!n.ok)throw n;return n.body}function Zy(e){try{return new URL(e)}catch{return}}const W$e=({id:e,readOnly:t,field:n,content:r,onContentChange:i})=>{const[o,a]=U.useState((r==null?void 0:r.embed_url)??""),u=f=>{a(f),Zy(f)||i(void 0)},[s,c]=U.useState(o),l=U.useCallback(f=>U.startTransition(()=>c(f)),[]);return qV(o,300,l),I.jsxs(M.Field,{footer:I.jsx(L$e,{url:s,content:r,onContentChange:i}),children:[I.jsx(M.FieldIcon,{children:I.jsx(M.Icon,{name:"cloud"})}),I.jsx(M.FieldLabel,{htmlFor:e,children:Vr(n)}),I.jsx(M.FieldControl,{children:I.jsx(M.TextInput,{id:e,readOnly:t,placeholder:Gs(n),value:o,onValueChange:u,variant:Zy(o)?"link":"normal",endAdornment:I.jsx(M.Button,{startIcon:I.jsx(M.Icon,{name:"close"}),variant:"secondary",size:"small",disabled:!o,onClick:()=>u("")})})})]})},L$e=({url:e,content:t,onContentChange:n})=>Zy(e)?e===(t==null?void 0:t.embed_url)?I.jsx(DC,{content:t}):I.jsx(j$e,{url:e,onError:()=>n(void 0),children:I.jsx(U.Suspense,{fallback:t&&I.jsx(DC,{content:t}),children:I.jsx(D$e,{url:e,onContentChange:n})})}):null;class j$e extends U.Component{constructor(){super(...arguments);Bf(this,"state",{hasError:!1})}static getDerivedStateFromError(n){return{hasError:KV(n)}}componentDidUpdate(n){this.state.hasError&&this.props.url!==n.url&&(BV.clear(VV),this.setState({hasError:!1}))}componentDidCatch(n){KV(n)&&this.props.onError()}render(){return this.state.hasError?I.jsx(M.FieldFooter,{children:I.jsx(M.EmptyEmbed,{title:"There is no embed data available."})}):this.props.children}}const KV=e=>LV(e)&&!E$e(e),DC=({content:e})=>I.jsx(M.FieldFooter,{children:I.jsx(M.EmbedPreview,{...B$e({content:e})})}),D$e=({url:e,onContentChange:t})=>{const n=q$e({url:e,onContentChange:t});return I.jsx(DC,{content:n})},q$e=({url:e,onContentChange:t})=>{const{embeds:n}=fS(),r=zV(VV,[e,n.url]),i=jV(t);return U.useEffect(()=>i(r),[r,i]),r},VV=async(e,t)=>{const n=new URL(t);return n.search=new URLSearchParams({url:e}).toString(),WV(n.toString(),{okType:U$e({url:e})})},U$e=({url:e})=>Un.object({type:Un.string(),version:Un.string().or(Un.number()).nullish(),title:Un.string().nullish(),author_name:Un.string().nullish(),author_url:Un.string().nullish(),provider_name:Un.string().nullish(),provider_url:Un.string().nullish(),cache_age:Un.string().or(Un.number()).nullish(),thumbnail_url:Un.string().nullish(),thumbnail_width:Un.number().nullish(),thumbnail_height:Un.number().nullish(),html:Un.string().nullish()}).passthrough().transform(t=>{const n={embed_url:e};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}}}),B$e=({content:e})=>{let t="";switch(e.type){case"video":t=e.title??"";break;case"photo":t="View this post"+(e.provider_name?` on ${e.provider_name}`:"");break;default:t="Open"+(e.provider_name?` on ${e.provider_name}`:"")}return{url:e.embed_url,thumbnail:{url:e.thumbnail_url??"",aspectRatio:e.type==="video"?"16:9":"1:1"},provider:e.provider_name??"",author:e.author_name??"",subtitle:t}},Sh="__MAIN_THUMBNAIL__";function HV(e,t,n){const r=e.name===Sh?void 0:e.name;let i;return t?ga(n)?i=[n.width,n.height]:ga(e.width)||ga(e.height)?i=[e.width??void 0,e.height??void 0]:i=[t.origin.width,t.origin.height]:i=void 0,[r,i?`${i[0]??"auto"}x${i[1]??"auto"}px`:void 0]}function z$e(e){var t,n;return[{...(t=e.config)==null?void 0:t.constraint,name:Sh}].concat(((n=e.config)==null?void 0:n.thumbnails)??[])}function K$e(e,t){var a,u;const{__TYPE__:n,thumbnails:r,...i}=t,o=(u=(a=e.config)==null?void 0:a.thumbnails)==null?void 0:u.map(({name:s})=>r==null?void 0:r[s]);return[i,...o??[]]}function V$e(e,t,n,r){const i=r.length===0?void 0:r;return e===Sh?{...t,alt:i}:{...t,thumbnails:{...t.thumbnails,[e]:{...n,alt:i}}}}function GV(e,t){const{width:n,height:r}=t??{};return n&&r?[n,r]:n?[n,Math.round(e.height*(n/e.width))]:r?[Math.round(e.width*(r/e.height)),r]:[e.width,e.height]}function YV(e,t,n,r,i){const o=new URL(e);if(i){const{x:a,y:u,width:s,height:c}=t;o.searchParams.set("rect",[a,u,s,c].join(",")),o.searchParams.set("w",n.toString()),o.searchParams.set("h",r.toString())}return o.toString()}function JV(e){const t=new URL(e);return t.searchParams.delete("q"),t.searchParams.set("w","800"),t.searchParams.set("h","800"),t.searchParams.set("auto","compress,format"),t.searchParams.set("fit","max"),t.toString()}function H$e(e){const t=new URL(e);return t.searchParams.delete("q"),t.searchParams.delete("fm"),t.searchParams.set("w","300"),t.searchParams.set("auto","compress,format"),t.toString()}const ZV=({contentView:e,constraints:t,croppedImage:n})=>{const[r,i]=GV(e.origin,t),o=YV(e.origin.url,n,r,i,!0);return{...e,width:r,height:i,url:o,edit:{...e.edit,zoom:n.zoom,crop:{x:n.x,y:n.y}}}},G$e=({field:e,content:t,thumbnail:n,croppedImage:r})=>{var u,s,c,l;if(n===Sh){const f=ZV({contentView:t,constraints:(u=e.config)==null?void 0:u.constraint,croppedImage:r});return f.url===t.url?t:{...t,...f}}const i=(c=(s=e.config)==null?void 0:s.thumbnails)==null?void 0:c.find(f=>f.name===n),o=(l=t.thumbnails)==null?void 0:l[n];if(!i||!o)return t;const a=ZV({contentView:o,constraints:i,croppedImage:r});return a.url===o.url?t:{...t,thumbnails:{...t.thumbnails,[n]:a}}},Y$e=({initialSize:e,constraints:t})=>{const n=t!=null&&t.width&&(t!=null&&t.height)?t.width/t.height:e.width/e.height,[r,i]=e.width<e.height?[e.width,Math.round(e.width/n)]:[Math.round(e.height*n),e.height],o=Math.max(r/e.width,i/e.height,1);return{width:Math.round(r/o),height:Math.round(i/o)}},J$e=({contentView:e,constraints:t})=>{const n=Y$e({initialSize:e.origin,constraints:t}),r=e.edit.zoom??1,i=Math.round(n.width/r),o=Math.round(n.height/r);return{...e.edit.crop,width:i,height:o,zoom:r}},XV={x:0,y:0,width:0,height:0,zoom:1},Z$e=({selectedImage:{thumbnail:e,contentView:t}})=>e.width&&e.height?e.width/e.height:t?t.origin.width/t.origin.height:1,X$e=({trigger:e,initialImages:t,initialOption:n,onClose:r})=>{var T;const[i,o]=$e.useState({}),[a,u]=$e.useState({}),[s,c]=$e.useState(!1),[l,f]=$e.useState(!1),[d,p]=$e.useState(n),h=t[d],v=R=>{if(!h)return;const E=h.thumbnail.name,q=i[E]??XV;o({...i,[E]:{...q,zoom:R}})},m=R=>{if(!h)return;const E=h.thumbnail.name,q=i[E]??XV;o({...i,[E]:{...q,...R}})},_=R=>{if(!h)return;const E=h.thumbnail.name,q=a[E];u({...a,[E]:{...q,crop:R}})},g=R=>{if(!h)return;const E=h.thumbnail.name,q=a[E]??{};u({...a,[E]:{...q,aspectRatio:R}})},S=i[(h==null?void 0:h.thumbnail.name)??""],b=s?S??((h==null?void 0:h.contentView)&&J$e({contentView:h.contentView,constraints:h.thumbnail})):void 0,$=a[(h==null?void 0:h.thumbnail.name)??""];return I.jsxs(M.Dialog,{trigger:e,onAnimationEnd:()=>f(!0),open:s,onOpenChange:R=>{R?(p(n),o({}),u({})):(f(!1),r({option:d,croppedImages:i})),c(R)},children:[I.jsx(M.DialogHeader,{icon:"photo",title:"Image editor"}),I.jsx(M.DialogOptions,{value:String(d),onValueChange:R=>p(Number(R)),children:t.map((R,E)=>I.jsx(M.DialogOptionsItem,{value:String(E),icon:"photo",title:R.labels[0]??"Main",subtitle:R.labels[1]??""},R.thumbnail.name))}),h&&I.jsx(M.DialogContent,{children:l&&I.jsx(M.CropperControls,{image:((T=h.contentView)==null?void 0:T.origin.url)??"",crop:($==null?void 0:$.crop)??{x:0,y:0},onCropChange:_,zoom:(S==null?void 0:S.zoom)??1,onZoomChange:v,aspectRatio:Z$e({selectedImage:h,cropper:$}),onAspectRatioChange:g,initialCroppedArea:b,onCropAreaChange:m},h.thumbnail.name)})]})},Q$e=Jy({id:_h(),width:Yy(),height:Yy(),urls:Jy({full:_h(),small:_h().transform(H$e)})}),e0e=Jy({results:FV(Q$e)}).transform(e=>e.results);function QV(e,t){const n=new URLSearchParams({page:"1",per_page:"30",query:t});return WV(`${e}/search/photos?${n.toString()}`,{okType:e0e})}BV.registerFetcherConfig(QV,{cacheCapacity:5,revalidationStrategy:{type:"never"}});function t0e(e,t){return zV(QV,[e,t])}const e3=e=>{const{trigger:t,onMediaSelected:n}=e,[r,i]=U.useState(!1),[o,a]=U.useState(""),[u,s]=U.useState(o),[c,l]=U.useTransition(),f=U.useCallback(d=>l(()=>s(d)),[]);return qV(o,200,f),I.jsxs(M.Dialog,{trigger:t,open:r,onOpenChange:i,children:[I.jsx(M.DialogHeader,{icon:"folder",title:"Add an image from Unsplash.com"}),I.jsxs(M.DialogContent,{children:[I.jsx(M.Box,{padding:{left:24,right:24},flexDirection:"column",children:I.jsx(M.SearchInput,{value:o,placeholder:"Search on Unsplash.com",onValueChange:a})}),I.jsx(i0e,{children:I.jsx(M.ErrorBoundary,{errorImageSrc:M.dialogErrorImage,title:"Request failed",description:"An error occurred while searching for your image.",renderError:d=>I.jsx(M.Box,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:d}),children:I.jsx(U.Suspense,{fallback:I.jsx(M.MasonrySkeleton,{}),children:I.jsx(n0e,{term:u,isUpdating:c,onMediaSelected:d=>{i(!1),n==null||n(d)}})})})})]})]})},n0e=e=>{const{term:t,isUpdating:n,onMediaSelected:r}=e,i=fS(),o=t0e(i.unsplash.url,t||"fruit"),a=r0e(n);return o.length?I.jsx(M.Masonry,{items:o,getItemInfo:o0e,style:a,children:u=>I.jsx(M.MasonryMedia,{url:u.urls.small,onClick:()=>r({id:u.id,url:u.urls.full,width:u.width,height:u.height})})}):I.jsxs(M.BlankSlate,{style:{marginTop:"auto",marginBottom:"auto",...a},children:[I.jsx(M.BlankSlateImage,{children:I.jsx("img",{src:M.dialogErrorImage,alt:"No results"})}),I.jsx(M.BlankSlateTitle,{size:"big",children:"Oh no ..."}),I.jsx(M.BlankSlateDescription,{children:"The search returned no result."})]})};function r0e(e){return{opacity:e?.4:1,transitionProperty:e?"opacity":"none",transitionDuration:M.tokens.transitionDuration[300],transitionTimingFunction:M.tokens.transitionTimingFunction.easeInOut}}const i0e=({children:e})=>I.jsx(M.ScrollArea,{style:{height:"100%",paddingInline:M.tokens.space[24],paddingTop:M.tokens.space[4]},children:e});function o0e(e){return{key:e.id,aspectRatio:e.width/e.height}}function a0e(e,t){const n={};for(const r in e)n[r]=t(e[r],r);return n}function u0e(e,t,n,r){var u,s,c,l,f,d;if(!n){const p=(u=t.config)==null?void 0:u.thumbnails,h=p&&Object.fromEntries(p.map(v=>[v.name,Xy(r,v)]));return{__TYPE__:"ImageContent",...Xy(r,(s=t.config)==null?void 0:s.constraint),thumbnails:h}}if(e===Sh){const p=Xy(r,(c=t.config)==null?void 0:c.constraint);return p.url===n.url?n:{...n,...p}}const i=(f=(l=t.config)==null?void 0:l.thumbnails)==null?void 0:f.find(p=>p.name===e);if(!i)return n;const o=(d=n.thumbnails)==null?void 0:d[e],a=Xy(r,i);return a.url===(o==null?void 0:o.url)?n:{...n,thumbnails:a0e(n.thumbnails??{},(p,h)=>h===e?a:p)}}function Xy(e,t){const{width:n,height:r,rect:i}=s0e(e,t),o=Boolean((t==null?void 0:t.width)||(t==null?void 0:t.height));return{url:YV(e.url,i,n,r,o),origin:{id:e.id,url:e.url,width:e.width,height:e.height},width:n,height:r,edit:{background:"transparent",zoom:1,crop:{x:i.x,y:i.y}}}}function s0e(e,t){const[n,r]=GV(e,t),i=Math.max(n/e.width,r/e.height),o=Math.round((e.width-n/i)/2),a=Math.round((e.height-r/i)/2),u=Math.round(n/i),s=Math.round(r/i);return{width:n,height:r,rect:{x:o,y:a,width:u,height:s}}}const c0e=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{const[o,a]=U.useState(0),[u,s]=U.useTransition(),c=l0e(t),l=c[o],f=e?K$e(t,e):void 0,d=f==null?void 0:f[o],p=Vr(t),h=l?HV(l,e,d).filter(ga):[],v=e&&!i?"visible":"hidden";function m(b){if(!l)return;const $=u0e(l.name,t,e,b);$!==e&&s(()=>r($))}function _(b){s(()=>a(b))}const g=c.map((b,$)=>{const T=f==null?void 0:f[$];return{thumbnail:b,contentView:T,labels:HV(b,e,T)}}),S=({option:b,croppedImages:$})=>{if(a(b),!e)return;const T=Object.entries($).reduce((R,[E,q])=>G$e({field:t,content:R,thumbnail:E,croppedImage:q}),e);T!==e&&s(()=>r(T))};return I.jsxs(M.Card,{color:"grey2",variant:"dashed",children:[I.jsxs(M.CardHeader,{children:[I.jsxs(M.CardHeaderTitle,{children:[p,h.length&&I.jsx(M.Text,{color:"grey11",component:"span",children:` • ${h.join(" • ")}`})]}),I.jsxs(M.CardHeaderActions,{style:{visibility:v},children:[I.jsx(X$e,{trigger:I.jsx(M.Button,{startIcon:I.jsx(M.Icon,{name:"crop"}),children:"Crop & Resize"}),initialImages:g,initialOption:o,onClose:S}),I.jsx(e3,{trigger:I.jsx(M.Button,{startIcon:I.jsx(M.Icon,{name:"imageSearch"}),children:"Replace"}),onMediaSelected:m}),I.jsx(M.Button,{onClick:()=>{a(0),r(void 0)},startIcon:I.jsx(M.Icon,{name:"delete"}),children:"Clear"})]})]}),I.jsx(U.Suspense,{fallback:I.jsx("div",{style:{height:466}}),children:l&&e&&f?I.jsx(f0e,{allContentViews:f,content:e,contentView:d,id:n,onContentChange:r,onPageChange:_,page:o,readOnly:i,thumbnailName:l.name,isUpdating:u}):I.jsx(d0e,{onMediaSelected:m,readOnly:i,isUpdating:u})})]})};function l0e(e){return U.useMemo(()=>z$e(e),[e])}const f0e=e=>{const{allContentViews:t,content:n,contentView:r,id:i,onContentChange:o,onPageChange:a,page:u,readOnly:s,thumbnailName:c,isUpdating:l}=e;return I.jsxs(M.CardContent,{children:[I.jsx(M.Carousel,{getItemSource:p0e,items:t,onPageChange:a,page:u,style:{height:400},children:f=>(f==null?void 0:f.url)&&I.jsx(M.CarouselItem,{src:JV(f.url),alt:f.alt??void 0,isUpdating:l},`${c}_${f.url}`)}),I.jsxs(M.Field,{labelPosition:"side",children:[I.jsx(M.FieldLabel,{htmlFor:i,children:"Alt text"}),I.jsx(M.FieldControl,{children:I.jsx(M.TextInput,{id:i,onValueChange:f=>{r&&o(V$e(c,n,r,f))},placeholder:"Short description for the visually impaired",readOnly:s||!r,value:(r==null?void 0:r.alt)??""})})]})]})},d0e=({onMediaSelected:e,readOnly:t,isUpdating:n})=>I.jsx(M.CardContent,{children:I.jsx(M.Card,{color:"grey3",variant:"outlined",children:I.jsx(M.CardContent,{style:{paddingBlock:parseFloat(M.tokens.space[48])},children:I.jsxs(M.BlankSlate,{children:[I.jsx(M.BlankSlateIcon,{name:"cloudUpload"}),I.jsx(M.BlankSlateTitle,{children:n?"Preparing your image...":"You haven't selected an image"}),!t&&I.jsx(M.BlankSlateActions,{children:I.jsx(e3,{trigger:I.jsx(M.Button,{disabled:n,children:"Select image"}),onMediaSelected:e})})]})})})});function p0e(e){return e!=null&&e.url?JV(e.url):void 0}const h0e=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>I.jsxs(M.Field,{children:[I.jsx(M.FieldIcon,{children:I.jsx(M.Icon,{name:"notes"})}),I.jsx(M.FieldLabel,{htmlFor:n,children:Vr(t)}),I.jsx(M.FieldControl,{children:I.jsx(M.TextArea,{id:n,onChange:o=>{r(m0e(o.target.value))},placeholder:Gs(t),readOnly:i,value:(e==null?void 0:e.value)??""})})]});function m0e(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Text",value:e}}function v0e(e){return e.charAt(0).toUpperCase()+e.slice(1)}const g0e=e=>{const{hasLink:t,onUnlink:n}=e;return I.jsxs(I.Fragment,{children:[I.jsx(M.Select,{value:"web",variant:"secondary",size:"small",icon:"public",disabled:!0,children:I.jsx(M.SelectItem,{value:"web",icon:"public",children:"Link to web page"})}),I.jsx(M.Button,{startIcon:I.jsx(M.Icon,{name:"linkOff"}),variant:"secondary",size:"small",disabled:!t,onClick:n})]})},y0e=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var h,v;const[o,a]=U.useState(!1),[u,s]=U.useState(!1);if((h=t.config)!=null&&h.select&&((v=t.config)==null?void 0:v.select)!=="web")return null;const c=(e==null?void 0:e.value.__TYPE__)==="ExternalLink"?e.value:void 0,l=c==null?void 0:c.url,f=l?Zy(l):void 0,d=(o||u)&&Boolean(f),p=m=>r(b0e(c,m));return I.jsx(M.LinkDescriptionPopover,{url:f,title:f?_0e(f):"",open:d,align:"start",sideOffset:-3,openDelay:100,closeDelay:200,onMouseOverChange:s,anchor:I.jsxs(M.Field,{onMouseOverChange:a,children:[I.jsx(M.FieldIcon,{children:I.jsx(M.Icon,{name:"link"})}),I.jsx(M.FieldLabel,{htmlFor:n,children:Vr(t)}),I.jsx(M.FieldControl,{children:I.jsx(M.TextInput,{id:n,onValueChange:p,placeholder:Gs(t),readOnly:i,value:l??"",variant:f?"link":"normal",onFocus:()=>a(!0),onBlur:()=>a(!1),endAdornment:I.jsx(g0e,{hasLink:Boolean(l),onUnlink:()=>p("")})})})]})})};function b0e(e,t){if(t)return e?{__TYPE__:"LinkContent",value:{...e,url:t}}:{__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:t}}}function _0e(e){return e.host.split(".").slice(0,-1).filter(t=>t!=="www").map(v0e).join("")}const S0e=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var u,s;const o=Number(e==null?void 0:e.value),a=Number.isFinite(o)?o:void 0;return I.jsxs(M.Field,{children:[I.jsx(M.FieldIcon,{children:I.jsx(M.Icon,{name:"pin"})}),I.jsx(M.FieldLabel,{htmlFor:n,children:Vr(t)}),I.jsx(M.FieldControl,{children:I.jsx(M.NumberInput,{id:n,value:a,min:(u=t.config)==null?void 0:u.min,max:(s=t.config)==null?void 0:s.max,placeholder:Gs(t),readOnly:i,onValueChange:c=>r($0e(c))})})]})};function $0e(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(e)}}function gn(e){this.content=e}gn.prototype={constructor:gn,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new gn(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new gn(n)},addToStart:function(e,t){return new gn([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new gn(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new gn(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=gn.from(e),e.size?new gn(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=gn.from(e),e.size?new gn(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=gn.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},gn.from=function(e){if(e instanceof gn)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new gn(t)};function t3(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){let a=t3(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function n3(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let a=e.child(--i),u=t.child(--o),s=a.nodeSize;if(a==u){n-=s,r-=s;continue}if(!a.sameMarkup(u))return{a:n,b:r};if(a.isText&&a.text!=u.text){let c=0,l=Math.min(a.text.length,u.text.length);for(;c<l&&a.text[a.text.length-c-1]==u.text[u.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||u.content.size){let c=n3(a.content,u.content,n-1,r-1);if(c)return c}n-=s,r-=s}}class z{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let a=0,u=0;u<n;a++){let s=this.content[a],c=u+s.nodeSize;if(c>t&&r(s,i+u,o||null,a)!==!1&&s.content.size){let l=u+1;s.nodesBetween(Math.max(0,t-l),Math.min(s.content.size,n-l),r,i+l)}u=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",a=!0;return this.nodesBetween(t,n,(u,s)=>{u.isText?(o+=u.text.slice(Math.max(t,s)-s,n-s),a=!r):u.isLeaf?(i?o+=typeof i=="function"?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 z(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&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.isText?u=u.cut(Math.max(0,t-a),Math.min(u.text.length,n-a)):u=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 z(r,i)}cutByIndex(t,n){return t==n?z.empty:t==0&&n==this.content.length?this:new z(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 z(i,o)}addToStart(t){return new z([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new z(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 new 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 t3(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return n3(this,t,n,r)}findIndex(t,n=-1){if(t==0)return Qy(0,t);if(t==this.size)return Qy(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=t)return a==t||n>0?Qy(r+1,a):Qy(r,i);i=a}}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 z.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new z(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return z.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 z(n||t,r)}static from(t){if(!t)return z.empty;if(t instanceof z)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new z([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}z.empty=new z([],0);const qC={index:0,offset:0};function Qy(e,t){return qC.index=e,qC.offset=t,qC}function eb(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!eb(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!eb(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let rt=class jR{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&&eb(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 new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new 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(t){if(!t||Array.isArray(t)&&t.length==0)return jR.none;if(t instanceof jR)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};rt.none=[];class tb extends Error{}class se{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=i3(this.content,t+this.openStart,n);return r&&new se(r,this.openStart,this.openEnd)}removeBetween(t,n){return new se(r3(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 se.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new se(z.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 o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new se(t,r,i)}}se.empty=new se(z.empty,0,0);function r3(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:a,offset:u}=e.findIndex(n);if(i==t||o.isText){if(u!=n&&!e.child(a).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(r3(o.content,t-i-1,n-i-1)))}function i3(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),a=e.maybeChild(i);if(o==t||a.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=i3(a.content,t-o-1,n);return u&&e.replaceChild(i,a.copy(u))}function T0e(e,t,n){if(n.openStart>e.depth)throw new tb("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new tb("Inconsistent open depths");return o3(e,t,n,0)}function o3(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let a=o3(e,t,n,r+1);return o.copy(o.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let a=e.parent,u=a.content;return ec(a,u.cut(0,e.parentOffset).append(n.content).append(u.cut(t.parentOffset)))}else{let{start:a,end:u}=I0e(n,e);return ec(o,u3(e,a,u,t,r))}else return ec(o,nb(e,t,r))}function a3(e,t){if(!t.type.compatibleContent(e.type))throw new tb("Cannot join "+t.type.name+" onto "+e.type.name)}function UC(e,t,n){let r=e.node(n);return a3(r,t.node(n)),r}function Qs(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function $h(e,t,n,r){let i=(t||e).node(n),o=0,a=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Qs(e.nodeAfter,r),o++));for(let u=o;u<a;u++)Qs(i.child(u),r);t&&t.depth==n&&t.textOffset&&Qs(t.nodeBefore,r)}function ec(e,t){return e.type.checkContent(t),e.copy(t)}function u3(e,t,n,r,i){let o=e.depth>i&&UC(e,t,i+1),a=r.depth>i&&UC(n,r,i+1),u=[];return $h(null,e,i,u),o&&a&&t.index(i)==n.index(i)?(a3(o,a),Qs(ec(o,u3(e,t,n,r,i+1)),u)):(o&&Qs(ec(o,nb(e,t,i+1)),u),$h(t,n,i,u),a&&Qs(ec(a,nb(n,r,i+1)),u)),$h(r,null,i,u),new z(u)}function nb(e,t,n){let r=[];if($h(null,e,n,r),e.depth>n){let i=UC(e,t,n+1);Qs(ec(i,nb(e,t,n+1)),r)}return $h(t,null,n,r),new z(r)}function I0e(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)i=t.node(o).copy(z.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class Th{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?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[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].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):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-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(t.content.size==0)return rt.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let u=r;r=i,i=u}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}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++)r[o].type.spec.inclusive===!1&&(!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 rb(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 new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=t;;){let{index:u,offset:s}=a.content.findIndex(o),c=o-s;if(r.push(a,u,i+s),!c||(a=a.child(u),a.isText))break;o=c-1,i+=s+1}return new Th(n,r,o)}static resolveCached(t,n){for(let i=0;i<BC.length;i++){let o=BC[i];if(o.pos==n&&o.doc==t)return o}let r=BC[zC]=Th.resolve(t,n);return zC=(zC+1)%O0e,r}}let BC=[],zC=0,O0e=12;class rb{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)}}const w0e=Object.create(null);let tc=class DR{constructor(t,n,r,i=rt.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||z.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&&eb(this.attrs,n||t.defaultAttrs||w0e)&&rt.sameSet(this.marks,r||rt.none)}copy(t=null){return t==this.content?this:new DR(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new DR(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return se.empty;let i=this.resolve(t),o=this.resolve(n),a=r?0:i.sharedDepth(n),u=i.start(a),c=i.node(a).content.cut(i.pos-u,o.pos-u);return new se(c,i.depth-a,o.depth-a)}replace(t,n,r){return T0e(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),!n)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(t==0)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 Th.resolveCached(this,t)}resolveNoCache(t){return Th.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,o=>(r.isInSet(o.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()+")"),s3(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=z.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:!1}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=rt.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!rt.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.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(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=z.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}};tc.prototype.text=void 0;class ib extends tc{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):s3(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 ib(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new ib(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&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 s3(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class nc{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new C0e(t,n);if(r.next==null)return nc.empty;let i=c3(r);r.next&&r.err("Unexpected trailing text");let o=N0e(A0e(i));return F0e(o,r),o}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 this.next.length!=0&&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];function o(a,u){let s=a.matchFragment(t,r);if(s&&(!n||s.validEnd))return z.from(u.map(c=>c.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:l,next:f}=a.next[c];if(!(l.isText||l.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let d=o(f,u.concat(l));if(d)return d}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}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 a=0;a<o.next.length;a++){let{type:u,next:s}=o.next[a];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in n)&&(!i.type||s.validEnd)&&(r.push({match:u.contentMatch,type:u,via:i}),n[u.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+t.indexOf(r.next[a].next);return o}).join(`
|
|
30
|
-
`)}}nc.empty=new nc(!0);class C0e{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 new SyntaxError(t+" (in content expression '"+this.string+"')")}}function c3(e){let t=[];do t.push(E0e(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function E0e(e){let t=[];do t.push(R0e(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function R0e(e){let t=k0e(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=M0e(e,t);else break;return t}function l3(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function M0e(e,t){let n=l3(e),r=n;return e.eat(",")&&(e.next!="}"?r=l3(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function x0e(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let a=n[o];a.groups.indexOf(t)>-1&&i.push(a)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function k0e(e){if(e.eat("(")){let t=c3(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=x0e(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function A0e(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(a,u,s){let c={term:s,to:u};return t[a].push(c),c}function i(a,u){a.forEach(s=>s.to=u)}function o(a,u){if(a.type=="choice")return a.exprs.reduce((s,c)=>s.concat(o(c,u)),[]);if(a.type=="seq")for(let s=0;;s++){let c=o(a.exprs[s],u);if(s==a.exprs.length-1)return c;i(c,u=n())}else if(a.type=="star"){let s=n();return r(u,s),i(o(a.expr,s),s),[r(s)]}else if(a.type=="plus"){let s=n();return i(o(a.expr,u),s),i(o(a.expr,s),s),[r(s)]}else{if(a.type=="opt")return[r(u)].concat(o(a.expr,u));if(a.type=="range"){let s=u;for(let c=0;c<a.min;c++){let l=n();i(o(a.expr,s),l),s=l}if(a.max==-1)i(o(a.expr,s),s);else for(let c=a.min;c<a.max;c++){let l=n();r(s,l),i(o(a.expr,s),l),s=l}return[r(s)]}else{if(a.type=="name")return[r(u,void 0,a.value)];throw new Error("Unknown expr type")}}}}function f3(e,t){return t-e}function d3(e,t){let n=[];return r(t),n.sort(f3);function r(i){let o=e[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let a=0;a<o.length;a++){let{term:u,to:s}=o[a];!u&&n.indexOf(s)==-1&&r(s)}}}function N0e(e){let t=Object.create(null);return n(d3(e,0));function n(r){let i=[];r.forEach(a=>{e[a].forEach(({term:u,to:s})=>{if(!u)return;let c;for(let l=0;l<i.length;l++)i[l][0]==u&&(c=i[l][1]);d3(e,s).forEach(l=>{c||i.push([u,c=[]]),c.indexOf(l)==-1&&c.push(l)})})});let o=t[r.join(",")]=new nc(r.indexOf(e.length-1)>-1);for(let a=0;a<i.length;a++){let u=i[a][1].sort(f3);o.next.push({type:i[a][0],next:t[u.join(",")]||n(u)})}return o}}function F0e(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],o=!i.validEnd,a=[];for(let u=0;u<i.next.length;u++){let{type:s,next:c}=i.next[u];a.push(s.name),o&&!(s.isText||s.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function p3(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function h3(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let o=e[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function m3(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new P0e(e[n]);return t}let v3=class W6{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=m3(r.attrs),this.defaultAttrs=p3(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==nc.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:h3(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new tc(this,this.computeAttrs(t),z.from(n),rt.setFrom(r))}createChecked(t=null,n,r){return n=z.from(n),this.checkContent(n),new tc(this,this.computeAttrs(t),n,rt.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=z.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(z.empty,!0);return o?new tc(this,t,n.append(o),rt.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 new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)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:rt.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,a)=>r[o]=new W6(o,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class P0e{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class ob{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=m3(i.attrs),this.excluded=null;let o=p3(this.attrs);this.instance=o?new rt(this,o):null}create(t=null){return!t&&this.instance?this.instance:new rt(this,h3(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,a)=>r[o]=new ob(o,i++,n,a)),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 W0e{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=gn.from(t.nodes),n.marks=gn.from(t.marks||{}),this.nodes=v3.compile(this.spec.nodes,this),this.marks=ob.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",u=o.spec.marks;o.contentMatch=r[a]||(r[a]=nc.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=u=="_"?null:u?g3(this,u.split(" ")):u==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:g3(this,a.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(typeof t=="string")t=this.nodeType(t);else if(t instanceof v3){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new ib(r,r.defaultAttrs,t,rt.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return tc.fromJSON(this,t)}markFromJSON(t){return rt.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function g3(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],a=o;if(o)n.push(o);else for(let u in e.marks){let s=e.marks[u];(i=="_"||s.spec.group&&s.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=s)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class ff{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=t.nodes[r.node];return i.contentMatch.matchType(i)})}parse(t,n={}){let r=new S3(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new S3(this,n,!0);return r.addAll(t,n.from,n.to),se.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(D0e(t,o.tag)&&(o.namespace===void 0||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)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(!(u.indexOf(t)!=0||a.context&&!r.matchesContext(a.context)||u.length>t.length&&(u.charCodeAt(t.length)!=61||u.slice(t.length+1)!=n))){if(a.getAttrs){let s=a.getAttrs(n);if(s===!1)continue;a.attrs=s||void 0}return a}}}static schemaRules(t){let n=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let u=n[a];if((u.priority==null?50:u.priority)<o)break}n.splice(a,0,i)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=$3(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=$3(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new ff(t,ff.schemaRules(t)))}}const y3={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},L0e={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},b3={ol:!0,ul:!0},ab=1,ub=2,Ih=4;function _3(e,t,n){return t!=null?(t?ab:0)|(t==="full"?ub:0):e&&e.whitespace=="pre"?ab|ub:n&~Ih}class sb{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=rt.none,this.stashMarks=[],this.match=a||(u&Ih?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(z.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(!(this.options&ab)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=z.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(z.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}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):U0e(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&&!y3.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class S3{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=_3(null,n.preserveWhitespace,0)|(r?Ih:0);i?o=new sb(i.type,i.attrs,rt.none,rt.none,!0,n.topMatch||i.type.contentMatch,a):r?o=new sb(null,null,rt.none,rt.none,!0,null,a):o=new sb(t.schema.topNodeType,null,rt.none,rt.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(t.nodeType==3)this.addTextNode(t);else if(t.nodeType==1){let n=t.getAttribute("style");if(!n)this.addElement(t);else{let r=this.readStyles(q0e(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 u=0;u<i.length;u++)this.addPendingMark(i[u]);this.addElement(t);for(let u=0;u<i.length;u++)this.removePendingMark(i[u],a);for(let u=0;u<o.length;u++)this.addPendingMark(o[u])}}}addTextNode(t){let n=t.nodeValue,r=this.top;if(r.options&ub||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&ab)r.options&ub?n=n.replace(/\r\n?/g,`
|
|
31
|
-
`):n=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&&o.nodeName=="BR"||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;b3.hasOwnProperty(r)&&this.parser.normalizeLists&&
|
|
32
|
-
`))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=rt.none,r=rt.none;e:for(let i=0;i<t.length;i+=2)for(let o=void 0;;){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(u=>{a.clearMark(u)&&(r=u.addToSet(r))}):n=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(n),a.consuming===!1)o=a;else break}return[n,r]}addElementByRule(t,n,r){let i,o,a;n.node?(o=this.parser.schema.nodes[n.node],o.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(s=>this.insertNode(s));else{let s=t;typeof n.contentElement=="string"?s=t.querySelector(n.contentElement):typeof n.contentElement=="function"?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=r==null?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 i=0;i<n.length;i++)this.enterInner(n[i],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 n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));let r=n.activeMarks;for(let i=0;i<t.marks.length;i++)(!n.type||n.type.allowsMarkType(t.marks[i].type))&&(r=t.marks[i].addToSet(r));return n.content.push(t.mark(r)),!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=_3(t,i,o.options);o.options&Ih&&o.content.length==0&&(a|=Ih),this.nodes.push(new sb(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++)this.find[n].pos==null&&t.nodeType==1&&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++)this.find[i].pos==null&&t.nodeType==1&&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=(u,s)=>{for(;u>=0;u--){let c=n[u];if(c==""){if(u==n.length-1||u==0)continue;for(;s>=o;s--)if(a(u-1,s))return!0;return!1}else{let l=s>0||s==0&&i?this.nodes[s].type:r&&s>=o?r.node(s-o).type:null;if(!l||l.name!=c&&l.groups.indexOf(c)==-1)return!1;s--}}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 n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(t){let n=B0e(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 a=i.popFromStashMark(t);a&&i.type&&i.type.allowsMarkType(a.type)&&(i.activeMarks=a.addToSet(i.activeMarks))}if(i==n)break}}}function j0e(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&b3.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function D0e(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function q0e(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=t.exec(e);)r.push(n[1],n[2].trim());return r}function $3(e){let t={};for(let n in e)t[n]=e[n];return t}function U0e(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],a=u=>{o.push(u);for(let s=0;s<u.edgeCount;s++){let{type:c,next:l}=u.edge(s);if(c==t||o.indexOf(l)<0&&a(l))return!0}};if(a(i.contentMatch))return!0}}function B0e(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}class fo{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=KC(n).createDocumentFragment());let i=r,o=[];return t.forEach(a=>{if(o.length||a.marks.length){let u=0,s=0;for(;u<o.length&&s<a.marks.length;){let c=a.marks[s];if(!this.marks[c.type.name]){s++;continue}if(!c.eq(o[u][0])||c.type.spec.spanning===!1)break;u++,s++}for(;u<o.length;)i=o.pop()[1];for(;s<a.marks.length;){let c=a.marks[s++],l=this.serializeMark(c,a.isInline,n);l&&(o.push([c,i]),i.appendChild(l.dom),i=l.contentDOM||l.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=fo.renderSpec(KC(n),this.nodes[t.type.name](t));if(i){if(t.isLeaf)throw new 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&&fo.renderSpec(KC(r),i(t,n))}static renderSpec(t,n,r=null){if(typeof n=="string")return{dom:t.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,u=r?t.createElementNS(r,i):t.createElement(i),s=n[1],c=1;if(s&&typeof s=="object"&&s.nodeType==null&&!Array.isArray(s)){c=2;for(let l in s)if(s[l]!=null){let f=l.indexOf(" ");f>0?u.setAttributeNS(l.slice(0,f),l.slice(f+1),s[l]):u.setAttribute(l,s[l])}}for(let l=c;l<n.length;l++){let f=n[l];if(f===0){if(l<n.length-1||l>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:d,contentDOM:p}=fo.renderSpec(t,f,r);if(u.appendChild(d),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:u,contentDOM:a}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new fo(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=T3(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return T3(t.marks)}}function T3(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function KC(e){return e.document||window.document}const I3=65535,O3=Math.pow(2,16);function z0e(e,t){return e+t*O3}function w3(e){return e&I3}function K0e(e){return(e-(e&I3))/O3}const C3=1,E3=2,cb=4,R3=8;class VC{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&R3)>0}get deletedBefore(){return(this.delInfo&(C3|cb))>0}get deletedAfter(){return(this.delInfo&(E3|cb))>0}get deletedAcross(){return(this.delInfo&cb)>0}}class Hr{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Hr.empty)return Hr.empty}recover(t){let n=0,r=w3(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+K0e(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?i:0);if(s>t)break;let c=this.ranges[u+o],l=this.ranges[u+a],f=s+c;if(t<=f){let d=c?t==s?-1:t==f?1:n:n,p=s+i+(d<0?0:l);if(r)return p;let h=t==(n<0?s:f)?null:z0e(u/3,t-s),v=t==s?E3:t==f?C3:cb;return(n<0?t!=s:t!=f)&&(v|=R3),new VC(p,v,h)}i+=l-c}return r?t+i:new VC(t+i,0,null)}touches(t,n){let r=0,i=w3(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?r:0);if(s>t)break;let c=this.ranges[u+o],l=s+c;if(t<=l&&u==i*3)return!0;r+=this.ranges[u+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],u=a-(this.inverted?o:0),s=a+(this.inverted?0:o),c=this.ranges[i+n],l=this.ranges[i+r];t(u,u+c,s,s+l),o+=l-c}}invert(){return new Hr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Hr.empty:new Hr(t<0?[0,-t,0]:[0,0,t])}}Hr.empty=new Hr([]);class Oh{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 Oh(this.maps,this.mirror,t,n)}copy(){return new Oh(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),n!=null&&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],i!=null&&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(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new Oh;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],u=a.mapResult(t,n);if(u.recover!=null){let s=this.getMirror(o);if(s!=null&&s>o&&s<this.to){o=s,t=this.maps[s].recover(u.recover);continue}}i|=u.delInfo,t=u.pos}return r?t:new VC(t,i,null)}}const HC=Object.create(null);class ur{getMap(){return Hr.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=HC[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in HC)throw new RangeError("Duplicate use of step JSON ID "+t);return HC[t]=n,n.prototype.jsonID=t,n}}class Vt{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Vt(t,null)}static fail(t){return new Vt(null,t)}static fromReplace(t,n,r,i){try{return Vt.ok(t.replace(n,r,i))}catch(o){if(o instanceof tb)return Vt.fail(o.message);throw o}}}function GC(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(GC(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return z.fromArray(r)}class pu extends ur{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 se(GC(n.content,(a,u)=>!a.isAtom||!u.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return Vt.fromReplace(t,this.from,this.to,o)}invert(){return new po(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 pu(n.pos,r.pos,this.mark)}merge(t){return t instanceof pu&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new pu(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(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new pu(n.from,n.to,t.markFromJSON(n.mark))}}ur.jsonID("addMark",pu);class po extends ur{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 se(GC(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Vt.fromReplace(t,this.from,this.to,r)}invert(){return new pu(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 po(n.pos,r.pos,this.mark)}merge(t){return t instanceof po&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new po(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(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new po(n.from,n.to,t.markFromJSON(n.mark))}}ur.jsonID("removeMark",po);class hu extends ur{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Vt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Vt.fromReplace(t,this.pos,this.pos+1,new se(z.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 hu(this.pos,n.marks[i]);return new hu(this.pos,this.mark)}}return new df(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new hu(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new hu(n.pos,t.markFromJSON(n.mark))}}ur.jsonID("addNodeMark",hu);class df extends ur{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Vt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Vt.fromReplace(t,this.pos,this.pos+1,new se(z.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new hu(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new df(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new df(n.pos,t.markFromJSON(n.mark))}}ur.jsonID("removeNodeMark",df);class En extends ur{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&YC(t,this.from,this.to)?Vt.fail("Structure replace would overwrite content"):Vt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Hr([this.from,this.to-this.from,this.slice.size])}invert(t){return new En(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 En(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof En)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?se.empty:new se(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new En(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?se.empty:new se(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new En(t.from,this.to,n,this.structure)}else return null}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(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new En(n.from,n.to,se.fromJSON(t,n.slice),!!n.structure)}}ur.jsonID("replace",En);class tn extends ur{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&&(YC(t,this.from,this.gapFrom)||YC(t,this.gapTo,this.to)))return Vt.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Vt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Vt.fromReplace(t,this.from,this.to,r):Vt.fail("Content does not fit in gap")}getMap(){return new Hr([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 tn(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 tn(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(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new tn(n.from,n.to,n.gapFrom,n.gapTo,se.fromJSON(t,n.slice),n.insert,!!n.structure)}}ur.jsonID("replaceAround",tn);function YC(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function V0e(e,t,n,r){let i=[],o=[],a,u;e.doc.nodesBetween(t,n,(s,c,l)=>{if(!s.isInline)return;let f=s.marks;if(!r.isInSet(f)&&l.type.allowsMarkType(r.type)){let d=Math.max(c,t),p=Math.min(c+s.nodeSize,n),h=r.addToSet(f);for(let v=0;v<f.length;v++)f[v].isInSet(h)||(a&&a.to==d&&a.mark.eq(f[v])?a.to=p:i.push(a=new po(d,p,f[v])));u&&u.to==d?u.to=p:o.push(u=new pu(d,p,r))}}),i.forEach(s=>e.step(s)),o.forEach(s=>e.step(s))}function H0e(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,(a,u)=>{if(!a.isInline)return;o++;let s=null;if(r instanceof ob){let c=a.marks,l;for(;l=r.isInSet(c);)(s||(s=[])).push(l),c=l.removeFromSet(c)}else r?r.isInSet(a.marks)&&(s=[r]):s=a.marks;if(s&&s.length){let c=Math.min(u+a.nodeSize,n);for(let l=0;l<s.length;l++){let f=s[l],d;for(let p=0;p<i.length;p++){let h=i[p];h.step==o-1&&f.eq(i[p].style)&&(d=h)}d?(d.to=c,d.step=o):i.push({style:f,from:Math.max(u,t),to:c,step:o})}}}),i.forEach(a=>e.step(new po(a.from,a.to,a.style)))}function G0e(e,t,n,r=n.contentMatch){let i=e.doc.nodeAt(t),o=[],a=t+1;for(let u=0;u<i.childCount;u++){let s=i.child(u),c=a+s.nodeSize,l=r.matchType(s.type);if(!l)o.push(new En(a,c,se.empty));else{r=l;for(let f=0;f<s.marks.length;f++)n.allowsMarkType(s.marks[f].type)||e.step(new po(a,c,s.marks[f]))}a=c}if(!r.validEnd){let u=r.fillBefore(z.empty,!0);e.replace(a,a,new se(u,0,0))}for(let u=o.length-1;u>=0;u--)e.step(o[u])}function Y0e(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function pf(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let i=e.$from.node(r),o=e.$from.index(r),a=e.$to.indexAfter(r);if(r<e.depth&&i.canReplace(o,a,n))return r;if(r==0||i.type.spec.isolating||!Y0e(i,o,a))break}return null}function J0e(e,t,n){let{$from:r,$to:i,depth:o}=t,a=r.before(o+1),u=i.after(o+1),s=a,c=u,l=z.empty,f=0;for(let h=o,v=!1;h>n;h--)v||r.index(h)>0?(v=!0,l=z.from(r.node(h).copy(l)),f++):s--;let d=z.empty,p=0;for(let h=o,v=!1;h>n;h--)v||i.after(h+1)<i.end(h)?(v=!0,d=z.from(i.node(h).copy(d)),p++):c++;e.step(new tn(s,c,a,u,new se(l.append(d),f,p),l.size-f,!0))}function JC(e,t,n=null,r=e){let i=Z0e(e,t),o=i&&X0e(r,t);return o?i.map(M3).concat({type:t,attrs:n}).concat(o.map(M3)):null}function M3(e){return{type:e,attrs:null}}function Z0e(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let a=o.length?o[0]:t;return n.canReplaceWith(r,i,a)?o:null}function X0e(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),a=t.contentMatch.findWrapping(o.type);if(!a)return null;let s=(a.length?a[a.length-1]:t).contentMatch;for(let c=r;s&&c<i;c++)s=s.matchType(n.child(c).type);return!s||!s.validEnd?null:a}function Q0e(e,t,n){let r=z.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let u=n[a].type.contentMatch.matchFragment(r);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=z.from(n[a].type.create(n[a].attrs,r))}let i=t.start,o=t.end;e.step(new tn(i,o,i,o,new se(r,0,0),n.length,!0))}function eTe(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(a,u)=>{if(a.isTextblock&&!a.hasMarkup(r,i)&&tTe(e.doc,e.mapping.slice(o).map(u),r)){e.clearIncompatible(e.mapping.slice(o).map(u,1),r);let s=e.mapping.slice(o),c=s.map(u,1),l=s.map(u+a.nodeSize,1);return e.step(new tn(c,l,c+1,l-1,new se(z.from(r.create(i,null,a.marks)),0,0),1,!0)),!1}})}function tTe(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function nTe(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let a=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,a);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new tn(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new se(z.from(a),0,0),1,!0))}function hf(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,l=n-2;c>o;c--,l--){let f=i.node(c),d=i.index(c);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(d,f.childCount),h=r&&r[l]||f;if(h!=f&&(p=p.replaceChild(0,h.type.create(h.attrs))),!f.canReplace(d+1,f.childCount)||!h.type.validContent(p))return!1}let u=i.indexAfter(o),s=r&&r[0];return i.node(o).canReplaceWith(u,u,s?s.type:i.node(o+1).type)}function rTe(e,t,n=1,r){let i=e.doc.resolve(t),o=z.empty,a=z.empty;for(let u=i.depth,s=i.depth-n,c=n-1;u>s;u--,c--){o=z.from(i.node(u).copy(o));let l=r&&r[c];a=z.from(l?l.type.create(l.attrs,a):i.node(u).copy(a))}e.step(new En(t,t,new se(o.append(a),n,n),!0))}function mu(e,t){let n=e.resolve(t),r=n.index();return x3(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function x3(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function k3(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,a,u=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):n>0?(o=r.node(i+1),u++,a=r.node(i).maybeChild(u)):(o=r.node(i).maybeChild(u-1),a=r.node(i+1)),o&&!o.isTextblock&&x3(o,a)&&r.node(i).canReplace(u,u+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function iTe(e,t,n){let r=new En(t-n,t+n,se.empty,!0);e.step(r)}function oTe(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function aTe(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let a=r.depth;a>=0;a--){let u=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,s=r.index(a)+(u>0?1:0),c=r.node(a),l=!1;if(o==1)l=c.canReplace(s,s,i);else{let f=c.contentMatchAt(s).findWrapping(i.firstChild.type);l=f&&c.canReplaceWith(s,s,f[0])}if(l)return u==0?r.pos:u<0?r.before(a+1):r.after(a+1)}return null}function ZC(e,t,n=t,r=se.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return A3(i,o,r)?new En(t,n,r):new uTe(i,o,r).fit()}function A3(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class uTe{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=z.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 i=t.depth;i>0;i--)this.placed=z.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,a=r.depth,u=i.depth;for(;a&&u&&o.childCount==1;)o=o.firstChild.content,a--,u--;let s=new se(o,a,u);return t>-1?new tn(r.pos,t,this.$to.pos,this.$to.end(),s,n):s.size||r.pos!=this.$to.pos?new En(r.pos,i.pos,s):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 n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=XC(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let a=i.firstChild;for(let u=this.depth;u>=0;u--){let{type:s,match:c}=this.frontier[u],l,f=null;if(n==1&&(a?c.matchType(a.type)||(f=c.fillBefore(z.from(a),!1)):o&&s.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:u,parent:o,inject:f};if(n==2&&a&&(l=c.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:u,parent:o,wrap:l};if(o&&c.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=XC(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new se(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=XC(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new se(wh(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new se(wh(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 v=0;v<o.length;v++)this.openFrontierNode(o[v]);let a=this.unplaced,u=r?r.content:a.content,s=a.openStart-t,c=0,l=[],{match:f,type:d}=this.frontier[n];if(i){for(let v=0;v<i.childCount;v++)l.push(i.child(v));f=f.matchFragment(i)}let p=u.size+t-(a.content.size-a.openEnd);for(;c<u.childCount;){let v=u.child(c),m=f.matchType(v.type);if(!m)break;c++,(c>1||s==0||v.content.size)&&(f=m,l.push(N3(v.mark(d.allowedMarks(v.marks)),c==1?s:0,c==u.childCount?p:-1)))}let h=c==u.childCount;h||(p=-1),this.placed=Ch(this.placed,n,z.from(l)),this.frontier[n].match=f,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,m=u;v<p;v++){let _=m.lastChild;this.frontier.push({type:_.type,match:_.contentMatchAt(_.childCount)}),m=_.content}this.unplaced=h?t==0?se.empty:new se(wh(a.content,t-1,1),t-1,p<0?a.openEnd:t-1):new se(wh(a.content,t,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!QC(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=QC(t,n,i,r,o);if(a){for(let u=n-1;u>=0;u--){let{match:s,type:c}=this.frontier[u],l=QC(t,u,c,s,!0);if(!l||l.childCount)continue e}return{depth:n,fit:a,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Ch(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=Ch(this.placed,this.depth,z.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(z.empty,!0);n.childCount&&(this.placed=Ch(this.placed,this.frontier.length,n))}}function wh(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(wh(e.firstChild.content,t-1,n)))}function Ch(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Ch(e.lastChild.content,t-1,n)))}function XC(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function N3(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,N3(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(z.empty,!0)))),e.copy(r)}function QC(e,t,n,r,i){let o=e.node(t),a=i?e.indexAfter(t):e.index(t);if(a==o.childCount&&!n.compatibleContent(o.type))return null;let u=r.fillBefore(o.content,!0,a);return u&&!sTe(n,o.content,a)?u:null}function sTe(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function cTe(e){return e.spec.defining||e.spec.definingForContent}function lTe(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(A3(i,o,r))return e.step(new En(t,n,r));let a=P3(i,e.doc.resolve(n));a[a.length-1]==0&&a.pop();let u=-(i.depth+1);a.unshift(u);for(let d=i.depth,p=i.pos-1;d>0;d--,p--){let h=i.node(d).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;a.indexOf(d)>-1?u=d:i.before(d)==p&&a.splice(1,0,-d)}let s=a.indexOf(u),c=[],l=r.openStart;for(let d=r.content,p=0;;p++){let h=d.firstChild;if(c.push(h),p==r.openStart)break;d=h.content}for(let d=l-1;d>=0;d--){let p=c[d].type,h=cTe(p);if(h&&i.node(s).type!=p)l=d;else if(h||!p.isTextblock)break}for(let d=r.openStart;d>=0;d--){let p=(d+l+1)%(r.openStart+1),h=c[p];if(h)for(let v=0;v<a.length;v++){let m=a[(v+s)%a.length],_=!0;m<0&&(_=!1,m=-m);let g=i.node(m-1),S=i.index(m-1);if(g.canReplaceWith(S,S,h.type,h.marks))return e.replace(i.before(m),_?o.after(m):n,new se(F3(r.content,0,r.openStart,p),p,r.openEnd))}}let f=e.steps.length;for(let d=a.length-1;d>=0&&(e.replace(t,n,r),!(e.steps.length>f));d--){let p=a[d];p<0||(t=i.before(p),n=o.after(p))}}function F3(e,t,n,r,i){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(F3(o.content,t+1,n,r,o)))}if(t>r){let o=i.contentMatchAt(0),a=o.fillBefore(e).append(e);e=a.append(o.matchFragment(a).fillBefore(z.empty,!0))}return e}function fTe(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=oTe(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new se(z.from(r),0,0))}function dTe(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=P3(r,i);for(let a=0;a<o.length;a++){let u=o[a],s=a==o.length-1;if(s&&u==0||r.node(u).type.contentMatch.validEnd)return e.delete(r.start(u),i.end(u));if(u>0&&(s||r.node(u-1).canReplace(r.index(u-1),i.indexAfter(u-1))))return e.delete(r.before(u),i.after(u))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a)return e.delete(r.before(a),n);e.delete(t,n)}function P3(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let o=e.start(i);if(o<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(o==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==o-1)&&n.push(i)}return n}class mf extends ur{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 Vt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Vt.fromReplace(t,this.pos,this.pos+1,new se(z.from(i),0,n.isLeaf?0:1))}getMap(){return Hr.empty}invert(t){return new mf(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 mf(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new mf(n.pos,n.attr,n.value)}}ur.jsonID("attr",mf);let vf=class extends Error{};vf=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},vf.prototype=Object.create(Error.prototype),vf.prototype.constructor=vf,vf.prototype.name="TransformError";class pTe{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Oh}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new vf(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=se.empty){let i=ZC(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new se(z.from(r),0,0))}delete(t,n){return this.replace(t,n,se.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return lTe(this,t,n,r),this}replaceRangeWith(t,n,r){return fTe(this,t,n,r),this}deleteRange(t,n){return dTe(this,t,n),this}lift(t,n){return J0e(this,t,n),this}join(t,n=1){return iTe(this,t,n),this}wrap(t,n){return Q0e(this,t,n),this}setBlockType(t,n=t,r,i=null){return eTe(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return nTe(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new mf(t,n,r)),this}addNodeMark(t,n){return this.step(new hu(t,n)),this}removeNodeMark(t,n){if(!(n instanceof rt)){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n=n.isInSet(r.marks),!n)return this}return this.step(new df(t,n)),this}split(t,n=1,r){return rTe(this,t,n,r),this}addMark(t,n,r){return V0e(this,t,n,r),this}removeMark(t,n,r){return H0e(this,t,n,r),this}clearIncompatible(t,n,r){return G0e(this,t,n,r),this}}const eE=Object.create(null);class We{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new hTe(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=se.empty){let r=n.content.lastChild,i=null;for(let u=0;u<n.openEnd;u++)i=r,r=r.lastChild;let o=t.steps.length,a=this.ranges;for(let u=0;u<a.length;u++){let{$from:s,$to:c}=a[u],l=t.mapping.slice(o);t.replaceRange(l.map(s.pos),l.map(c.pos),u?se.empty:n),u==0&&j3(t,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:u}=i[o],s=t.mapping.slice(r),c=s.map(a.pos),l=s.map(u.pos);o?t.deleteRange(c,l):(t.replaceRangeWith(c,l,n),j3(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new Be(t):gf(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?gf(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):gf(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 ki(t.node(0))}static atStart(t){return gf(t,t,0,0,1)||new ki(t)}static atEnd(t){return gf(t,t,t.content.size,t.childCount,-1)||new ki(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=eE[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in eE)throw new RangeError("Duplicate use of selection JSON ID "+t);return eE[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Be.between(this.$anchor,this.$head).getBookmark()}}We.prototype.visible=!0;class hTe{constructor(t,n){this.$from=t,this.$to=n}}let W3=!1;function L3(e){!W3&&!e.parent.inlineContent&&(W3=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Be extends We{constructor(t,n=t){L3(t),L3(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 We.near(r);let i=t.resolve(n.map(this.anchor));return new Be(i.parent.inlineContent?i:r,r)}replace(t,n=se.empty){if(super.replace(t,n),n==se.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Be&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new lb(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Be(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=We.findFrom(n,r,!0)||We.findFrom(n,-r,!0);if(o)n=o.$head;else return We.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(We.findFrom(t,-r,!0)||We.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new Be(t,n)}}We.jsonID("text",Be);class lb{constructor(t,n){this.anchor=t,this.head=n}map(t){return new lb(t.map(this.anchor),t.map(this.head))}resolve(t){return Be.between(t.resolve(this.anchor),t.resolve(this.head))}}class Se extends We{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=t.resolve(i);return r?We.near(o):new Se(o)}content(){return new se(z.from(this.node),0,0)}eq(t){return t instanceof Se&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new tE(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Se(t.resolve(n.anchor))}static create(t,n){return new Se(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}Se.prototype.visible=!1,We.jsonID("node",Se);class tE{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new lb(r,r):new tE(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&Se.isSelectable(r)?new Se(n):We.near(n)}}class ki extends We{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=se.empty){if(n==se.empty){t.delete(0,t.doc.content.size);let r=We.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new ki(t)}map(t){return new ki(t)}eq(t){return t instanceof ki}getBookmark(){return mTe}}We.jsonID("all",ki);const mTe={map(){return this},resolve(e){return new ki(e)}};function gf(e,t,n,r,i,o=!1){if(t.inlineContent)return Be.create(e,n);for(let a=r-(i>0?0:1);i>0?a<t.childCount:a>=0;a+=i){let u=t.child(a);if(u.isAtom){if(!o&&Se.isSelectable(u))return Se.create(e,n-(i<0?u.nodeSize:0))}else{let s=gf(e,u,n+i,i<0?u.childCount:0,i,o);if(s)return s}n+=u.nodeSize*i}return null}function j3(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof En||i instanceof tn))return;let o=e.mapping.maps[r],a;o.forEach((u,s,c,l)=>{a==null&&(a=l)}),e.setSelection(We.near(e.doc.resolve(a),n))}const D3=1,fb=2,q3=4;class vTe extends pTe{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 new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|D3)&~fb,this.storedMarks=null,this}get selectionSet(){return(this.updated&D3)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=fb,this}ensureMarks(t){return rt.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(this.updated&fb)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~fb,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)||rt.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(r==null&&(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(We.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=q3,this}get scrolledIntoView(){return(this.updated&q3)>0}}function U3(e,t){return!t||!e?e:e.bind(t)}class Eh{constructor(t,n,r){this.name=t,this.init=U3(n.init,r),this.apply=U3(n.apply,r)}}const gTe=[new Eh("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Eh("selection",{init(e,t){return e.selection||We.atStart(t.doc)},apply(e){return e.selection}}),new Eh("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Eh("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class nE{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=gTe.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Eh(r.key,r.spec.state,r))})}}class yf{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),i=null;for(;;){let o=!1;for(let a=0;a<this.config.plugins.length;a++){let u=this.config.plugins[a];if(u.spec.appendTransaction){let s=i?i[a].n:0,c=i?i[a].state:this,l=s<n.length&&u.spec.appendTransaction.call(u,s?n.slice(s):n,c,r);if(l&&r.filterTransaction(l,a)){if(l.setMeta("appendedTransaction",t),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<a?{state:r,n:n.length}:{state:this,n:0})}n.push(l),r=r.applyInner(l),o=!0}i&&(i[a]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new yf(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 vTe(this)}static create(t){let n=new nE(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new yf(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 nE(this.schema,t.plugins),r=n.fields,i=new yf(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(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new 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 new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new nE(t.schema,t.plugins),o=new yf(i);return i.fields.forEach(a=>{if(a.name=="doc")o.doc=tc.fromJSON(t.schema,n.doc);else if(a.name=="selection")o.selection=We.fromJSON(o.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let u in r){let s=r[u],c=s.spec.state;if(s.key==a.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,u)){o[a.name]=c.fromJSON.call(s,t,n[u],o);return}}o[a.name]=a.init(t,o)}}),o}}function B3(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=B3(i,t,{})),n[r]=i}return n}class Gr{constructor(t){this.spec=t,this.props={},t.props&&B3(t.props,this,this.props),this.key=t.key?t.key.key:z3("plugin")}getState(t){return t[this.key]}}const rE=Object.create(null);function z3(e){return e in rE?e+"$"+ ++rE[e]:(rE[e]=0,e+"$")}class vu{constructor(t="key"){this.key=z3(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const wr=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Rh=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let K3=null;const ba=function(e,t,n){let r=K3||(K3=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},rc=function(e,t,n,r){return n&&(V3(e,t,n,r,-1)||V3(e,t,n,r,1))},yTe=/^(img|br|input|textarea|hr)$/i;function V3(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:ho(e))){let o=e.parentNode;if(!o||o.nodeType!=1||_Te(e)||yTe.test(e.nodeName)||e.contentEditable=="false")return!1;t=wr(e)+(i<0?0:1),e=o}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.contentEditable=="false")return!1;t=i<0?ho(e):0}else return!1}}function ho(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function bTe(e,t,n){for(let r=t==0,i=t==ho(e);r||i;){if(e==n)return!0;let o=wr(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,i=i&&o==ho(e)}}function _Te(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const db=function(e){return e.focusNode&&rc(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function ic(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function STe(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}const gu=typeof navigator<"u"?navigator:null,H3=typeof document<"u"?document:null,yu=gu&&gu.userAgent||"",iE=/Edge\/(\d+)/.exec(yu),G3=/MSIE \d/.exec(yu),oE=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(yu),sr=!!(G3||oE||iE),bu=G3?document.documentMode:oE?+oE[1]:iE?+iE[1]:0,Ai=!sr&&/gecko\/(\d+)/i.test(yu);Ai&&+(/Firefox\/(\d+)/.exec(yu)||[0,0])[1];const aE=!sr&&/Chrome\/(\d+)/.exec(yu),Bn=!!aE,$Te=aE?+aE[1]:0,zn=!sr&&!!gu&&/Apple Computer/.test(gu.vendor),bf=zn&&(/Mobile\/\w+/.test(yu)||!!gu&&gu.maxTouchPoints>2),Yr=bf||(gu?/Mac/.test(gu.platform):!1),Ni=/Android \d/.test(yu),pb=!!H3&&"webkitFontSmoothing"in H3.documentElement.style,TTe=pb?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function ITe(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function _u(e,t){return typeof e=="number"?e:e[t]}function OTe(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Y3(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let a=n||e.dom;a;a=Rh(a)){if(a.nodeType!=1)continue;let u=a,s=u==o.body,c=s?ITe(o):OTe(u),l=0,f=0;if(t.top<c.top+_u(r,"top")?f=-(c.top-t.top+_u(i,"top")):t.bottom>c.bottom-_u(r,"bottom")&&(f=t.bottom-c.bottom+_u(i,"bottom")),t.left<c.left+_u(r,"left")?l=-(c.left-t.left+_u(i,"left")):t.right>c.right-_u(r,"right")&&(l=t.right-c.right+_u(i,"right")),l||f)if(s)o.defaultView.scrollBy(l,f);else{let d=u.scrollLeft,p=u.scrollTop;f&&(u.scrollTop+=f),l&&(u.scrollLeft+=l);let h=u.scrollLeft-d,v=u.scrollTop-p;t={left:t.left-h,top:t.top-v,right:t.right-h,bottom:t.bottom-v}}if(s)break}}function wTe(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let o=(t.left+t.right)/2,a=n+1;a<Math.min(innerHeight,t.bottom);a+=5){let u=e.root.elementFromPoint(o,a);if(!u||u==e.dom||!e.dom.contains(u))continue;let s=u.getBoundingClientRect();if(s.top>=n-20){r=u,i=s.top;break}}return{refDOM:r,refTop:i,stack:J3(e.dom)}}function J3(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Rh(r));return t}function CTe({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Z3(n,r==0?0:r-t)}function Z3(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let _f=null;function ETe(e){if(e.setActive)return e.setActive();if(_f)return e.focus(_f);let t=J3(e);e.focus(_f==null?{get preventScroll(){return _f={preventScroll:!0},!0}}:void 0),_f||(_f=!1,Z3(t,0))}function X3(e,t){let n,r=2e8,i,o=0,a=t.top,u=t.top;for(let s=e.firstChild,c=0;s;s=s.nextSibling,c++){let l;if(s.nodeType==1)l=s.getClientRects();else if(s.nodeType==3)l=ba(s).getClientRects();else continue;for(let f=0;f<l.length;f++){let d=l[f];if(d.top<=a&&d.bottom>=u){a=Math.max(d.bottom,a),u=Math.min(d.top,u);let p=d.left>t.left?d.left-t.left:d.right<t.left?t.left-d.right:0;if(p<r){n=s,r=p,i=p&&n.nodeType==3?{left:d.right<t.left?d.right:d.left,top:t.top}:t,s.nodeType==1&&p&&(o=c+(t.left>=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(o=c+1)}}return n&&n.nodeType==3?RTe(n,i):!n||r&&n.nodeType==1?{node:e,offset:o}:X3(n,i)}function RTe(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let o=Su(r,1);if(o.top!=o.bottom&&uE(t,o))return{node:e,offset:i+(t.left>=(o.left+o.right)/2?1:0)}}return{node:e,offset:0}}function uE(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function MTe(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function xTe(e,t,n){let{node:r,offset:i}=X3(t,n),o=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();o=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}function kTe(e,t,n,r){let i=-1;for(let o=t;o!=e.dom;){let a=e.docView.nearestDesc(o,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)){let u=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&(u.left>r.left||u.top>r.top?i=a.posBefore:(u.right<r.left||u.bottom<r.top)&&(i=a.posAfter)),!a.contentDOM&&i<0)return(a.node.isBlock?r.top<(u.top+u.bottom)/2:r.left<(u.left+u.right)/2)?a.posBefore:a.posAfter}o=a.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function Q3(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let a=e.childNodes[o];if(a.nodeType==1){let u=a.getClientRects();for(let s=0;s<u.length;s++){let c=u[s];if(uE(t,c))return Q3(a,t,c)}}if((o=(o+1)%r)==i)break}return e}function ATe(e,t){let n=e.dom.ownerDocument,r,i=0;if(n.caretPositionFromPoint)try{let s=n.caretPositionFromPoint(t.left,t.top);s&&({offsetNode:r,offset:i}=s)}catch{}if(!r&&n.caretRangeFromPoint){let s=n.caretRangeFromPoint(t.left,t.top);s&&({startContainer:r,startOffset:i}=s)}let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),a;if(!o||!e.dom.contains(o.nodeType!=1?o.parentNode:o)){let s=e.dom.getBoundingClientRect();if(!uE(t,s)||(o=Q3(e.dom,t,s),!o))return null}if(zn)for(let s=o;r&&s;s=Rh(s))s.draggable&&(r=void 0);if(o=MTe(o,t),r){if(Ai&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let s=r.childNodes[i],c;s.nodeName=="IMG"&&(c=s.getBoundingClientRect()).right<=t.left&&c.bottom>t.top&&i++}r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=kTe(e,r,i,t))}a==null&&(a=xTe(e,o,t));let u=e.docView.nearestDesc(o,!0);return{pos:a,inside:u?u.posAtStart-u.border:-1}}function Su(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const NTe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function e4(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),a=pb||Ai;if(r.nodeType==3)if(a&&(NTe.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let s=Su(ba(r,i,i),n);if(Ai&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=Su(ba(r,i-1,i-1),-1);if(c.top==s.top){let l=Su(ba(r,i,i+1),-1);if(l.top!=s.top)return Mh(l,l.left<c.left)}}return s}else{let s=i,c=i,l=n<0?1:-1;return n<0&&!i?(c++,l=-1):n>=0&&i==r.nodeValue.length?(s--,l=1):n<0?s--:c++,Mh(Su(ba(r,s,c),1),l<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==ho(r))){let s=r.childNodes[i-1];if(s.nodeType==1)return sE(s.getBoundingClientRect(),!1)}if(o==null&&i<ho(r)){let s=r.childNodes[i];if(s.nodeType==1)return sE(s.getBoundingClientRect(),!0)}return sE(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==ho(r))){let s=r.childNodes[i-1],c=s.nodeType==3?ba(s,ho(s)-(a?0:1)):s.nodeType==1&&(s.nodeName!="BR"||!s.nextSibling)?s:null;if(c)return Mh(Su(c,1),!1)}if(o==null&&i<ho(r)){let s=r.childNodes[i];for(;s.pmViewDesc&&s.pmViewDesc.ignoreForCoords;)s=s.nextSibling;let c=s?s.nodeType==3?ba(s,0,a?0:1):s.nodeType==1?s:null:null;if(c)return Mh(Su(c,-1),!0)}return Mh(Su(r.nodeType==3?ba(r):r,-n),n>=0)}function Mh(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function sE(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function t4(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function FTe(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return t4(e,t,()=>{let{node:o}=e.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let u=e.docView.nearestDesc(o,!0);if(!u)break;if(u.node.isBlock){o=u.contentDOM||u.dom;break}o=u.dom.parentNode}let a=e4(e,i.pos,1);for(let u=o.firstChild;u;u=u.nextSibling){let s;if(u.nodeType==1)s=u.getClientRects();else if(u.nodeType==3)s=ba(u,0,u.nodeValue.length).getClientRects();else continue;for(let c=0;c<s.length;c++){let l=s[c];if(l.bottom>l.top+1&&(n=="up"?a.top-l.top>(l.bottom-a.top)*2:l.bottom-a.bottom>(a.bottom-l.top)*2))return!1}}return!0})}const PTe=/[\u0590-\u08ac]/;function WTe(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,a=i==r.parent.content.size,u=e.domSelection();return!PTe.test(r.parent.textContent)||!u.modify?n=="left"||n=="backward"?o:a:t4(e,t,()=>{let{focusNode:s,focusOffset:c,anchorNode:l,anchorOffset:f}=e.domSelectionRange(),d=u.caretBidiLevel;u.modify("move",n,"character");let p=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:h,focusOffset:v}=e.domSelectionRange(),m=h&&!p.contains(h.nodeType==1?h:h.parentNode)||s==h&&c==v;try{u.collapse(l,f),s&&(s!=l||c!=f)&&u.extend&&u.extend(s,c)}catch{}return d!=null&&(u.caretBidiLevel=d),m})}let n4=null,r4=null,i4=!1;function LTe(e,t,n){return n4==t&&r4==n?i4:(n4=t,r4=n,i4=n=="up"||n=="down"?FTe(e,t,n):WTe(e,t,n))}const Fi=0,o4=1,Sf=2,mo=3;class xh{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Fi,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(t.nodeType==1?t:t.parentNode))if(r<0){let o,a;if(t==this.contentDOM)o=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.previousSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(a)+a.size:this.posAtStart}else{let o,a;if(t==this.contentDOM)o=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.nextSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(a):this.posAtEnd}let i;if(t==this.dom&&this.contentDOM)i=n>wr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==t.childNodes.length)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??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)&&!(a.nodeType==1?a.contains(t.nodeType==1?t:t.parentNode):a==t))r=!1;else return o}}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 s4){i=t-o;break}o=u}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof a4&&o.side>=0;r--);if(n<=0){let o,a=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,a=!1);return o&&n&&a&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?wr(o.dom)+1:0}}else{let o,a=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,a=!1);return o&&a&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?wr(o.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let a=r,u=0;;u++){let s=this.children[u],c=a+s.size;if(i==-1&&t<=c){let l=a+s.border;if(t>=l&&n<=c-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(t,n,l);t=a;for(let f=u;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=wr(d.dom)+1;break}t-=d.size}i==-1&&(i=0)}if(i>-1&&(c>n||u==this.children.length-1)){n=c;for(let l=u+1;l<this.children.length;l++){let f=this.children[l];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=wr(f.dom);break}n+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}a=c}return{node:this.contentDOM,from:t,to:n,fromOffset:i,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(n.nodeType!=1||r==n.childNodes.length)throw new 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 d=0,p=0;d<this.children.length;d++){let h=this.children[d],v=p+h.size;if(o>p&&a<v)return h.setSelection(t-p-h.border,n-p-h.border,r,i);p=v}let u=this.domFromPos(t,t?-1:1),s=n==t?u:this.domFromPos(n,n?-1:1),c=r.getSelection(),l=!1;if((Ai||zn)&&t==n){let{node:d,offset:p}=u;if(d.nodeType==3){if(l=!!(p&&d.nodeValue[p-1]==`
|
|
33
|
-
`),l&&p==d.nodeValue.length)for(let h=d,v;h;h=h.parentNode){if(v=h.nextSibling){v.nodeName=="BR"&&(u=s={node:v.parentNode,offset:wr(v)+1});break}let m=h.pmViewDesc;if(m&&m.node&&m.node.isBlock)break}}else{let h=d.childNodes[p-1];l=h&&(h.nodeName=="BR"||h.contentEditable=="false")}}if(Ai&&c.focusNode&&c.focusNode!=s.node&&c.focusNode.nodeType==1){let d=c.focusNode.childNodes[c.focusOffset];d&&d.contentEditable=="false"&&(i=!0)}if(!(i||l&&zn)&&rc(u.node,u.offset,c.anchorNode,c.anchorOffset)&&rc(s.node,s.offset,c.focusNode,c.focusOffset))return;let f=!1;if((c.extend||t==n)&&!l){c.collapse(u.node,u.offset);try{t!=n&&c.extend(s.node,s.offset),f=!0}catch{}}if(!f){if(t>n){let p=u;u=s,s=p}let d=document.createRange();d.setEnd(s.node,s.offset),d.setStart(u.node,u.offset),c.removeAllRanges(),c.addRange(d)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}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?Sf:o4,t==u&&n==s&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=mo:o.markDirty(t-u,n-u);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Sf:mo}r=a}this.dirty=Sf}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?Sf:o4;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class a4 extends xh{constructor(t,n,r,i){let o,a=n.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(a.nodeType!=1){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 this.dirty==Fi&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||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 jTe extends xh{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 t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class oc extends xh{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=fo.renderSpec(document,n.type.spec.toDOM(n,r))),new oc(t,n,a.dom,a.contentDOM||a.dom)}parseRule(){return this.dirty&mo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(t){return this.dirty!=mo&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Fi){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Fi}}slice(t,n,r){let i=oc.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;n<a&&(o=fE(o,n,a,r)),t>0&&(o=fE(o,0,t,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}}class ac extends xh{constructor(t,n,r,i,o,a,u,s,c){super(t,[],o,a),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=u,a&&this.updateChildren(s,c)}static create(t,n,r,i,o,a){let u=o.nodeViews[n.type.name],s,c=u&&u(n,o,()=>{if(!s)return a;if(s.parent)return s.parent.posBeforeChild(s)},r,i),l=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(!l)l=document.createTextNode(n.text);else if(l.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else l||({dom:l,contentDOM:f}=fo.renderSpec(document,n.type.spec.toDOM(n)));!f&&!n.isText&&l.nodeName!="BR"&&(l.hasAttribute("contenteditable")||(l.contentEditable="false"),n.type.spec.draggable&&(l.draggable=!0));let d=l;return l=f4(l,r,n),c?s=new DTe(t,n,r,i,l,f||null,d,c,o,a+1):n.isText?new hb(t,n,r,i,l,d,o):new ac(t,n,r,i,l,f||null,d,o,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{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=()=>z.empty)}return t}matchesNode(t,n,r){return this.dirty==Fi&&t.eq(this.node)&&lE(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 UTe(this,a&&a.node,t);KTe(this.node,this.innerDeco,(c,l,f)=>{c.spec.marks?s.syncToMarks(c.spec.marks,r,t):c.type.side>=0&&!f&&s.syncToMarks(l==this.node.childCount?rt.none:this.node.child(l).marks,r,t),s.placeWidget(c,t,i)},(c,l,f,d)=>{s.syncToMarks(c.marks,r,t);let p;s.findNodeMatch(c,l,f,d)||u&&t.state.selection.from>i&&t.state.selection.to<i+c.nodeSize&&(p=s.findIndexWithChild(o.node))>-1&&s.updateNodeAt(c,l,f,p,t)||s.updateNextNode(c,l,f,t,d)||s.addNode(c,l,f,t,i),i+=c.nodeSize}),s.syncToMarks([],r,t),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==Sf)&&(a&&this.protectLocalComposition(t,a),c4(this.contentDOM,this.children,t),bf&&VTe(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof Be)||r<n||i>n+this.node.content.size)return null;let o=t.domSelectionRange(),a=HTe(o.focusNode,o.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){let u=a.nodeValue,s=GTe(this.node.content,u,r-n,i-n);return s<0?null:{node:a,pos:s,text:u}}else return{node:a,pos:-1,text:""}}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 jTe(this,o,n,i);t.input.compositionNodes.push(a),this.children=fE(this.children,r,r+i.length,t,a)}update(t,n,r,i){return this.dirty==mo||!t.sameMarkup(this.node)?!1:(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=Fi}updateOuterDeco(t){if(lE(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=l4(this.dom,this.nodeDOM,cE(this.outerDeco,this.node,n),cE(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function u4(e,t,n,r,i){return f4(r,t,e),new ac(void 0,e,t,n,r,r,r,i,0)}class hb extends ac{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 this.dirty==mo||this.dirty!=Fi&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Fi||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=Fi,!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 t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let i=this.node.cut(t,n),o=document.createTextNode(i.text);return new hb(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=mo)}get domAtom(){return!1}}class s4 extends xh{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Fi&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class DTe extends ac{constructor(t,n,r,i,o,a,u,s,c,l){super(t,n,r,i,o,a,u,c,l),this.spec=s}update(t,n,r,i){if(this.dirty==mo)return!1;if(this.spec.update){let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,i)}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):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function c4(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let a=t[o],u=a.dom;if(u.parentNode==e){for(;u!=r;)r=d4(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(u,r);if(a instanceof oc){let s=r?r.previousSibling:e.lastChild;c4(a.contentDOM,a.children,n),r=s?s.nextSibling:e.firstChild}}for(;r;)r=d4(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const kh=function(e){e&&(this.nodeName=e)};kh.prototype=Object.create(null);const uc=[new kh];function cE(e,t,n){if(e.length==0)return uc;let r=n?uc[0]:new kh,i=[r];for(let o=0;o<e.length;o++){let a=e[o].type.attrs;if(a){a.nodeName&&i.push(r=new kh(a.nodeName));for(let u in a){let s=a[u];s!=null&&(n&&i.length==1&&i.push(r=new kh(t.isInline?"span":"div")),u=="class"?r.class=(r.class?r.class+" ":"")+s:u=="style"?r.style=(r.style?r.style+";":"")+s:u!="nodeName"&&(r[u]=s))}}}return i}function l4(e,t,n,r){if(n==uc&&r==uc)return t;let i=t;for(let o=0;o<r.length;o++){let a=r[o],u=n[o];if(o){let s;u&&u.nodeName==a.nodeName&&i!=e&&(s=i.parentNode)&&s.nodeName.toLowerCase()==a.nodeName||(s=document.createElement(a.nodeName),s.pmIsDeco=!0,s.appendChild(i),u=uc[0]),i=s}qTe(i,u||uc[0],a)}return i}function qTe(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&e.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&e.classList.add(i[o]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(t.style);)e.style.removeProperty(i[1])}n.style&&(e.style.cssText+=n.style)}}function f4(e,t,n){return l4(e,e,uc,cE(t,n,e.nodeType!=1))}function lE(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function d4(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class UTe{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=BTe(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])&&t[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=Fi,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<t.length;){this.stack.push(this.top,this.index+1);let u=-1;for(let s=this.index;s<Math.min(this.index+3,this.top.children.length);s++){let c=this.top.children[s];if(c.matchesMark(t[o])&&!this.isLocked(c.dom)){u=s;break}}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let s=oc.create(this.top,t[o],n,r);this.top.children.splice(this.index,0,s),this.top=s,this.changed=!0}this.index=0,o++}}findNodeMatch(t,n,r,i){let o=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(t,n,r))o=this.top.children.indexOf(a,this.index);else for(let u=this.index,s=Math.min(this.top.children.length,u+5);u<s;u++){let c=this.top.children[u];if(c.matchesNode(t,n,r)&&!this.preMatch.matched.has(c)){o=u;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,n,r,i,o){let a=this.top.children[i];return a.dirty==mo&&a.dom==a.contentDOM&&(a.dirty=Sf),a.update(t,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}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){for(let a=this.index;a<this.top.children.length;a++){let u=this.top.children[a];if(u instanceof ac){let s=this.preMatch.matched.get(u);if(s!=null&&s!=o)return!1;let c=u.dom;if(!(this.isLocked(c)&&!(t.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==t.text&&u.dirty!=mo&&lE(n,u.outerDeco)))&&u.update(t,n,r,i))return this.destroyBetween(this.index,a),u.dom!=c&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(t,n,r,i,o){this.top.children.splice(this.index++,0,ac.create(this.top,t,n,r,i,o)),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 a4(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 oc;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof hb)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((zn||Bn)&&t&&t.dom.contentEditable=="false"&&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);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new s4(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||t.nodeType==1&&t.contains(this.lock.parentNode))}}function BTe(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,a=[];e:for(;i>0;){let u;for(;;)if(r){let c=n.children[r-1];if(c instanceof oc)n=c,r=c.children.length;else{u=c,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let s=u.node;if(s){if(s!=e.child(i-1))break;--i,o.set(u,i),a.push(u)}}return{index:i,matched:o,matches:a.reverse()}}function zTe(e,t){return e.type.side-t.type.side}function KTe(e,t,n,r){let i=t.locals(e),o=0;if(i.length==0){for(let c=0;c<e.childCount;c++){let l=e.child(c);r(l,i,t.forChild(o,l),c),o+=l.nodeSize}return}let a=0,u=[],s=null;for(let c=0;;){if(a<i.length&&i[a].to==o){let h=i[a++],v;for(;a<i.length&&i[a].to==o;)(v||(v=[h])).push(i[a++]);if(v){v.sort(zTe);for(let m=0;m<v.length;m++)n(v[m],c,!!s)}else n(h,c,!!s)}let l,f;if(s)f=-1,l=s,s=null;else if(c<e.childCount)f=c,l=e.child(c++);else break;for(let h=0;h<u.length;h++)u[h].to<=o&&u.splice(h--,1);for(;a<i.length&&i[a].from<=o&&i[a].to>o;)u.push(i[a++]);let d=o+l.nodeSize;if(l.isText){let h=d;a<i.length&&i[a].from<h&&(h=i[a].from);for(let v=0;v<u.length;v++)u[v].to<h&&(h=u[v].to);h<d&&(s=l.cut(h-o),l=l.cut(0,h-o),d=h,f=-1)}let p=l.isInline&&!l.isLeaf?u.filter(h=>!h.inline):u.slice();r(l,p,t.forChild(o,l),f),o=d}}function VTe(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function HTe(e,t){for(;;){if(e.nodeType==3)return e;if(e.nodeType==1&&t>0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=ho(e)}else if(e.nodeType==1&&t<e.childNodes.length)e=e.childNodes[t],t=0;else return null}}function GTe(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let a=e.child(i++),u=o;if(o+=a.nodeSize,!a.isText)continue;let s=a.text;for(;i<e.childCount;){let c=e.child(i++);if(o+=c.nodeSize,!c.isText)break;s+=c.text}if(o>=n){let c=u<r?s.lastIndexOf(t,r-u-1):-1;if(c>=0&&c+t.length+u>=n)return u+c;if(n==r&&s.length>=r+t.length-u&&s.slice(r-u,r-u+t.length)==t)return r}}return-1}function fE(e,t,n,r,i){let o=[];for(let a=0,u=0;a<e.length;a++){let s=e[a],c=u,l=u+=s.size;c>=n||l<=t?o.push(s):(c<t&&o.push(s.slice(0,t-c,r)),i&&(o.push(i),i=void 0),l>n&&o.push(s.slice(n-c,s.size,r)))}return o}function dE(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&i.size==0,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let u=r.resolve(a),s,c;if(db(n)){for(s=u;i&&!i.node;)i=i.parent;let l=i.node;if(i&&l.isAtom&&Se.isSelectable(l)&&i.parent&&!(l.isInline&&bTe(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new Se(a==f?u:r.resolve(f))}}else{let l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null;s=r.resolve(l)}if(!c){let l=t=="pointer"||e.state.selection.head<u.pos&&!o?1:-1;c=hE(e,s,u,l)}return c}function p4(e){return e.editable?e.hasFocus():_4(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function _a(e,t=!1){let n=e.state.selection;if(g4(e,n),!!p4(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Bn){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&rc(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)JTe(e);else{let{anchor:r,head:i}=n,o,a;h4&&!(n instanceof Be)&&(n.$from.parent.inlineContent||(o=m4(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=m4(e,n.to))),e.docView.setSelection(r,i,e.root,t),h4&&(o&&v4(o),a&&v4(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&YTe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const h4=zn||Bn&&$Te<63;function m4(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(zn&&i&&i.contentEditable=="false")return pE(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return pE(i);if(o)return pE(o)}}function pE(e){return e.contentEditable="true",zn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function v4(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function YTe(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!p4(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function JTe(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,wr(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&sr&&bu<=11&&(r.disabled=!0,r.disabled=!1)}function g4(e,t){if(t instanceof Se){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(y4(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else y4(e)}function y4(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function hE(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||Be.between(t,n,r)}function b4(e){return e.editable&&!e.hasFocus()?!1:_4(e)}function _4(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function ZTe(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return rc(t.node,t.offset,n.anchorNode,n.anchorOffset)}function mE(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&We.findFrom(o,t)}function sc(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function S4(e,t,n){let r=e.state.selection;if(r instanceof Be){if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let i=mE(e.state,t);return i&&i instanceof Se?sc(e,i):!1}else if(!(Yr&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let u=t<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=e.docView.descAt(u))&&!a.contentDOM?Se.isSelectable(o)?sc(e,new Se(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):pb?sc(e,new Be(e.state.doc.resolve(t<0?u:u+o.nodeSize))):!1:!1}}else{if(r instanceof Se&&r.node.isInline)return sc(e,new Be(t>0?r.$to:r.$from));{let i=mE(e.state,t);return i?sc(e,i):!1}}}function mb(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Ah(e){let t=e.pmViewDesc;return t&&t.size==0&&(e.nextSibling||e.nodeName!="BR")}function vE(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,a=!1;for(Ai&&n.nodeType==1&&r<mb(n)&&Ah(n.childNodes[r])&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let u=n.childNodes[r-1];if(Ah(u))i=n,o=--r;else if(u.nodeType==3)n=u,r=n.nodeValue.length;else break}}else{if($4(n))break;{let u=n.previousSibling;for(;u&&Ah(u);)i=n.parentNode,o=wr(u),u=u.previousSibling;if(u)n=u,r=mb(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?yE(e,n,r):i&&yE(e,i,o)}function gE(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=mb(n),o,a;for(;;)if(r<i){if(n.nodeType!=1)break;let u=n.childNodes[r];if(Ah(u))o=n,a=++r;else break}else{if($4(n))break;{let u=n.nextSibling;for(;u&&Ah(u);)o=u.parentNode,a=wr(u)+1,u=u.nextSibling;if(u)n=u,r=0,i=mb(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&yE(e,o,a)}function $4(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function yE(e,t,n){let r=e.domSelection();if(db(r)){let o=document.createRange();o.setEnd(t,n),o.setStart(t,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&_a(e)},50)}function T4(e,t,n){let r=e.state.selection;if(r instanceof Be&&!r.empty||n.indexOf("s")>-1||Yr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let a=mE(e.state,t);if(a&&a instanceof Se)return sc(e,a)}if(!i.parent.inlineContent){let a=t<0?i:o,u=r instanceof ki?We.near(a,t):We.findFrom(a,t);return u?sc(e,u):!1}return!1}function I4(e,t){if(!(e.state.selection instanceof Be))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let a=e.state.tr;return t<0?a.delete(n.pos-o.nodeSize,n.pos):a.delete(n.pos,n.pos+o.nodeSize),e.dispatch(a),!0}return!1}function O4(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function XTe(e){if(!zn||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;O4(e,r,"true"),setTimeout(()=>O4(e,r,"false"),20)}return!1}function QTe(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function eIe(e,t){let n=t.keyCode,r=QTe(t);return n==8||Yr&&n==72&&r=="c"?I4(e,-1)||vE(e):n==46||Yr&&n==68&&r=="c"?I4(e,1)||gE(e):n==13||n==27?!0:n==37||Yr&&n==66&&r=="c"?S4(e,-1,r)||vE(e):n==39||Yr&&n==70&&r=="c"?S4(e,1,r)||gE(e):n==38||Yr&&n==80&&r=="c"?T4(e,-1,r)||vE(e):n==40||Yr&&n==78&&r=="c"?XTe(e)||T4(e,1,r)||gE(e):r==(Yr?"m":"c")&&(n==66||n==73||n==89||n==90)}function w4(e,t){e.someProp("transformCopied",p=>{t=p(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let a=e.someProp("clipboardSerializer")||fo.fromSchema(e.state.schema),u=N4(),s=u.createElement("div");s.appendChild(a.serializeFragment(r,{document:u}));let c=s.firstChild,l,f=0;for(;c&&c.nodeType==1&&(l=k4[c.nodeName.toLowerCase()]);){for(let p=l.length-1;p>=0;p--){let h=u.createElement(l[p]);for(;s.firstChild;)h.appendChild(s.firstChild);s.appendChild(h),f++}c=s.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=e.someProp("clipboardTextSerializer",p=>p(t,e))||t.content.textBetween(0,t.content.size,`
|
|
27
|
+
Check the top-level render call using <`+ne+">.")}return B}}function qf(w,B){{if(!w._store||w._store.validated||w.key!=null)return;w._store.validated=!0;var ne=jR(B);if(Ea[ne])return;Ea[ne]=!0;var Ie="";w&&w._owner&&w._owner!==ct.current&&(Ie=" It was passed a child from "+ie(w._owner.type)+"."),Fr(w),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ne,Ie),Fr(null)}}function Tc(w,B){{if(typeof w!="object")return;if(qi(w))for(var ne=0;ne<w.length;ne++){var Ie=w[ne];Bi(Ie)&&qf(Ie,B)}else if(Bi(w))w._store&&(w._store.validated=!0);else if(w){var Xe=m(w);if(typeof Xe=="function"&&Xe!==w.entries)for(var ut=Xe.call(w),Ge;!(Ge=ut.next()).done;)Bi(Ge.value)&&qf(Ge.value,B)}}}function Nxe(w){{var B=w.type;if(B==null||typeof B=="string")return;var ne;if(typeof B=="function")ne=B.propTypes;else if(typeof B=="object"&&(B.$$typeof===s||B.$$typeof===f))ne=B.propTypes;else return;if(ne){var Ie=ie(B);Ot(ne,w.props,"prop",Ie,w)}else if(B.PropTypes!==void 0&&!jf){jf=!0;var Xe=ie(B);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Xe||"Unknown")}typeof B.getDefaultProps=="function"&&!B.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Fxe(w){{for(var B=Object.keys(w.props),ne=0;ne<B.length;ne++){var Ie=B[ne];if(Ie!=="children"&&Ie!=="key"){Fr(w),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ie),Fr(null);break}}w.ref!==null&&(Fr(w),g("Invalid attribute `ref` supplied to `React.Fragment`."),Fr(null))}}function F6(w,B,ne,Ie,Xe,ut){{var Ge=Y(w);if(!Ge){var je="";(w===void 0||typeof w=="object"&&w!==null&&Object.keys(w).length===0)&&(je+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Gn=Df(Xe);Gn?je+=Gn:je+=Lf();var Pt;w===null?Pt="null":qi(w)?Pt="array":w!==void 0&&w.$$typeof===t?(Pt="<"+(ie(w.type)||"Unknown")+" />",je=" Did you accidentally export a JSX literal instead of a component?"):Pt=typeof w,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Pt,je)}var Ut=Ce(w,B,ne,Xe,ut);if(Ut==null)return Ut;if(Ge){var ni=B.children;if(ni!==void 0)if(Ie)if(qi(ni)){for(var Uf=0;Uf<ni.length;Uf++)Tc(ni[Uf],w);Object.freeze&&Object.freeze(ni)}else g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Tc(ni,w)}return w===r?Fxe(Ut):Nxe(Ut),Ut}}function Pxe(w,B,ne){return F6(w,B,ne,!0)}function Wxe(w,B,ne){return F6(w,B,ne,!1)}var jxe=Wxe,Lxe=Pxe;Kf.Fragment=r,Kf.jsx=jxe,Kf.jsxs=Lxe}()),Kf}(function(e){process.env.NODE_ENV==="production"?e.exports=q6():e.exports=U6()})(D6);var KR=function(e){return function(){return{meet:function(t,n){return function(r){return e.meet(t(r),n(r))}},join:function(t,n){return function(r){return e.join(t(r),n(r))}},zero:function(){return e.zero},one:function(){return e.one},implies:function(t,n){return function(r){return e.implies(t(r),n(r))}},not:function(t){return function(n){return e.not(t(n))}}}}},s_=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},VR=function(e){var t=s_(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}},c_=function(e){return{add:function(t,n){return function(r){return e.add(t(r),n(r))}},zero:function(){return e.zero},mul:function(t,n){return function(r){return e.mul(t(r),n(r))}},one:function(){return e.one}}},HR=function(e){var t=c_(e);return{add:t.add,mul:t.mul,one:t.one,zero:t.zero,sub:function(n,r){return function(i){return e.sub(n(i),r(i))}}}},B6=function(e){return function(t){return t(e)}};function D(e){return e}var Oc=D;function Yn(e){return function(){return e}}var l_=Yn(!0),GR=Yn(!1),YR=Yn(null),f_=Yn(void 0),z6=f_;function K6(e){return function(t,n){return e(n,t)}}function V(e,t,n,r,i,o,a,u,s){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return u(a(o(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return s(u(a(o(i(r(n(t(e.apply(this,arguments)))))))))}}}function JR(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e}function V6(e){return e+1}function H6(e){return e-1}function ZR(e){throw new Error("Called `absurd` function which should be uncallable")}function G6(e){return function(t){return e.apply(void 0,t)}}function Y6(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(t)}}function y(e,t,n,r,i,o,a,u,s){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return o(i(r(n(t(e)))));case 7:return a(o(i(r(n(t(e))))));case 8:return u(a(o(i(r(n(t(e)))))));case 9:return s(u(a(o(i(r(n(t(e))))))));default:{for(var c=arguments[0],l=1;l<arguments.length;l++)c=arguments[l](c);return c}}}var J6=ZR,Jn=function(e,t){return t};function Z6(e){return function(t){return!e(t)}}var X6=function(){return{concat:function(e,t){return V(e,t)},empty:D}};const XR=Object.freeze(Object.defineProperty({__proto__:null,SK:Jn,absurd:ZR,apply:B6,constFalse:GR,constNull:YR,constTrue:l_,constUndefined:f_,constVoid:z6,constant:Yn,decrement:H6,flip:K6,flow:V,getBooleanAlgebra:KR,getEndomorphismMonoid:X6,getMonoid:VR,getRing:HR,getSemigroup:s_,getSemiring:c_,hole:J6,identity:D,increment:V6,not:Z6,pipe:y,tuple:JR,tupled:G6,unsafeCoerce:Oc,untupled:Y6},Symbol.toStringTag,{value:"Module"}));var Pr=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},QR=function(e){return Pr(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},eM=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Pr(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},Q6=function(e,t){return y(e,tM(t))},tM=function(e){return function(t){return Pr(function(n,r){return t.equals(e(n),e(r))})}},nM="Eq",wc={equals:function(e,t){return e===t}},eG={equals:function(){return!0}},rM=function(){return{concat:function(e,t){return Pr(function(n,r){return e.equals(n,r)&&t.equals(n,r)})}}},tG=function(){return{concat:rM().concat,empty:eG}},iM={URI:nM,contramap:Q6},nG=eM,rG=QR,iG=wc.equals,oG=iM,aG=wc,uG=wc,sG=wc,cG={equals:function(e,t){return e.valueOf()===t.valueOf()}};const lG=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:iM,URI:nM,contramap:tM,eq:oG,eqBoolean:aG,eqDate:cG,eqNumber:sG,eqStrict:wc,eqString:uG,fromEquals:Pr,getMonoid:tG,getSemigroup:rM,getStructEq:rG,getTupleEq:nG,strictEqual:iG,struct:QR,tuple:eM},Symbol.toStringTag,{value:"Module"}));function Cc(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function Ke(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}function wt(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}function Ec(e,t){var n=Cc(e,t);return{map:function(r,i){return y(r,n(i))}}}const fG=Object.freeze(Object.defineProperty({__proto__:null,bindTo:wt,flap:Ke,getFunctorComposition:Ec,map:Cc},Symbol.toStringTag,{value:"Module"}));var dG=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Wt=function(e){return e._tag==="None"},bt=function(e){return e._tag==="Some"},be={_tag:"None"},pe=function(e){return{_tag:"Some",value:e}},Gt=function(e){return e._tag==="Left"},d_=function(e){return e._tag==="Right"},So=function(e){return{_tag:"Left",left:e}},Ma=function(e){return{_tag:"Right",right:e}},Vf=function(e){return[e]},gt=function(e){return e.length>0},dr=function(e){return e[0]},Rc=function(e){return e.slice(1)},rn=[],Yt={},lt=Object.prototype.hasOwnProperty,im=function(e){return dG([e[0]],e.slice(1),!0)},Me=function(e,t){return{left:e,right:t}},pG=function(e,t){return y(e,p_(t))},hG=function(e,t){return y(e,oM(t))},mG=function(e,t,n){return y(e,aM(t,n))},p_=function(e){return function(t){return Me(Hf(t),e(Gf(t)))}},oM=function(e){return function(t){return Me(e(Hf(t)),Gf(t))}},aM=function(e,t){return function(n){return Me(e(Hf(n)),t(Gf(n)))}},h_="Separated",vG={URI:h_,mapLeft:hG,bimap:mG},uM={URI:h_,map:pG},gG=Ke(uM),Hf=function(e){return e.left},Gf=function(e){return e.right};const yG=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:vG,Functor:uM,URI:h_,bimap:aM,flap:gG,left:Hf,map:p_,mapLeft:oM,right:Gf,separated:Me},Symbol.toStringTag,{value:"Module"}));function $o(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}function Ct(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}function Et(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}function Rt(e){return function(t,n){return function(r){return e.ap(e.map(r,function(i){return function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))}}),n)}}}function Jt(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}function m_(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,t===0?e.apply(null,i):m_(e,t-1,i)}}var v_={1:function(e){return[e]},2:function(e){return function(t){return[e,t]}},3:function(e){return function(t){return function(n){return[e,t,n]}}},4:function(e){return function(t){return function(n){return function(r){return[e,t,n,r]}}}},5:function(e){return function(t){return function(n){return function(r){return function(i){return[e,t,n,r,i]}}}}}};function bG(e){return lt.call(v_,e)||(v_[e]=m_(JR,e-1,[])),v_[e]}function _G(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=bG(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}function SG(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var u;return u={},u[e[0]]=n,u[e[1]]=r,u[e[2]]=i,u[e[3]]=o,u[e[4]]=a,u}}}}};default:return m_(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}function $G(e){return function(t){for(var n=Object.keys(t),r=n.length,i=SG(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}const TG=Object.freeze(Object.defineProperty({__proto__:null,ap:$o,apFirst:Ct,apS:Rt,apSecond:Et,getApplySemigroup:Jt,sequenceS:$G,sequenceT:_G},Symbol.toStringTag,{value:"Module"}));function ft(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}function Mt(e){return function(t,n){return function(r){return e.chain(r,function(i){return e.map(n(i),function(o){var a;return Object.assign({},i,(a={},a[t]=o,a))})})}}}const IG=Object.freeze(Object.defineProperty({__proto__:null,bind:Mt,chainFirst:ft},Symbol.toStringTag,{value:"Module"}));var sM=function(e){return function(t,n){return t===n||e(t,n)===0}},Wu=function(e){return{equals:sM(e),compare:function(t,n){return t===n?0:e(t,n)}}},cM=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Wu(function(n,r){for(var i=0;i<e.length-1;i++){var o=e[i].compare(n[i],r[i]);if(o!==0)return o}return e[i].compare(n[i],r[i])})},g_=function(e){return Wu(function(t,n){return e.compare(n,t)})},OG=function(e,t){return y(e,om(t))},om=function(e){return function(t){return Wu(function(n,r){return t.compare(e(n),e(r))})}},lM="Ord",fM=function(){return{concat:function(e,t){return Wu(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},y_=function(){return{concat:fM().concat,empty:Wu(function(){return 0})}},dM={URI:lM,contramap:OG},wG={equals:l_,compare:Yn(0)},CG=function(e){return function(t){return function(n){return n===t||e.compare(n,t)===0}}},pM=function(e){return function(t,n){return e.compare(t,n)===-1}},hM=function(e){return function(t,n){return e.compare(t,n)===1}},EG=function(e){return function(t,n){return e.compare(t,n)!==1}},RG=function(e){return function(t,n){return e.compare(t,n)!==-1}},am=function(e){return function(t,n){return t===n||e.compare(t,n)<1?t:n}},um=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}},mM=function(e){var t=am(e),n=um(e);return function(r,i){return function(o){return n(t(o,i),r)}}},MG=function(e){var t=pM(e),n=hM(e);return function(r,i){return function(o){return!(t(o,r)||n(o,i))}}},xG=cM,kG=g_,AG=dM;function NG(e,t){return e<t?-1:e>t?1:0}var b_={equals:wc.equals,compare:NG},FG=b_,PG=b_,sm=b_,WG=y(sm,om(function(e){return e.valueOf()}));const jG=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:dM,URI:lM,between:MG,clamp:mM,contramap:om,equals:CG,equalsDefault:sM,fromCompare:Wu,geq:RG,getDualOrd:kG,getMonoid:y_,getSemigroup:fM,getTupleOrd:xG,gt:hM,leq:EG,lt:pM,max:um,min:am,ord:AG,ordBoolean:FG,ordDate:WG,ordNumber:sm,ordString:PG,reverse:g_,trivial:wG,tuple:cM},Symbol.toStringTag,{value:"Module"}));var vM=function(e){return{concat:function(t,n){return e.concat(n,t)}}},LG=function(e){return function(t){return{concat:function(n,r){return e(n)?t.concat(n,r):r}}}},DG=function(e){return function(t){return{concat:function(n,r){return e(r)?t.concat(n,r):n}}}},qG=function(e){return function(t){return{concat:function(n,r){return t.concat(e(n),e(r))}}}},gM=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}};const UG=Object.freeze(Object.defineProperty({__proto__:null,concatAll:gM,endo:qG,filterFirst:LG,filterSecond:DG,reverse:vM},Symbol.toStringTag,{value:"Module"}));var cm=function(e){return{concat:am(e)}},lm=function(e){return{concat:um(e)}},__=function(e){return{concat:function(){return e}}},S_=vM,$_=function(e){return{concat:function(t,n){var r={};for(var i in e)lt.call(e,i)&&(r[i]=e[i].concat(t[i],n[i]));return r}}},T_=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:function(n,r){return e.map(function(i,o){return i.concat(n[o],r[o])})}}},yM=function(e){return function(t){return{concat:function(n,r){return t.concat(n,t.concat(e,r))}}}},I_=function(){return{concat:D}},fm=function(){return{concat:function(e,t){return t}}},O_=gM,bM=__(void 0),BG=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},zG=fm,KG=I_,VG=T_,HG=$_,GG=S_,YG=lm,JG=cm,ZG=yM;function XG(e){var t=O_(e);return function(n,r){return r===void 0?t(n):t(n)(r)}}var _M={concat:function(e,t){return e&&t}},SM={concat:function(e,t){return e||t}},QG=s_,$M={concat:function(e,t){return e+t}},TM={concat:function(e,t){return e+t}},IM={concat:function(e,t){return e*t}};const OM=Object.freeze(Object.defineProperty({__proto__:null,concatAll:O_,constant:__,first:I_,fold:XG,getDualSemigroup:GG,getFirstSemigroup:KG,getFunctionSemigroup:QG,getIntercalateSemigroup:ZG,getJoinSemigroup:YG,getLastSemigroup:zG,getMeetSemigroup:JG,getObjectSemigroup:BG,getStructSemigroup:HG,getTupleSemigroup:VG,intercalate:yM,last:fm,max:lm,min:cm,reverse:S_,semigroupAll:_M,semigroupAny:SM,semigroupProduct:IM,semigroupString:$M,semigroupSum:TM,semigroupVoid:bM,struct:$_,tuple:T_},Symbol.toStringTag,{value:"Module"}));var Yf=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Jf=rn,zi=gt,dm=function(e,t){return e<0||e>=t.length},w_=function(e){return function(t){return Yf([e],t,!0)}},Mc=w_,C_=function(e){return function(t){return Yf(Yf([],t,!0),[e],!1)}},pm=C_,hm=function(e,t,n){if(zi(n)){var r=im(n);return r.splice(e,0,t),r}return[t]},E_=function(e,t,n){if(n[e]===t)return n;var r=im(n);return r[e]=t,r},R_=function(e){return function(t){if(t.length===1)return t;for(var n=[An(t)],r=ii(t),i=function(s){n.every(function(c){return!e.equals(c,s)})&&n.push(s)},o=0,a=r;o<a.length;o++){var u=a[o];i(u)}return n}},wM=function(e){if(zi(e)){var t=y_();return k_(e.reduce(t.concat,t.empty))}return D},M_=function(e){var t=R_(e);return function(n){return function(r){return t(y(r,Xf(n)))}}},x_=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(dm(Math.abs(r),t)||r===0)return t;if(r<0){var i=gm(-r)(t),o=i[0],a=i[1];return y(a,Xf(o))}else return x_(r-n)(t)}},Zf=function(e){return zi(e)?pe(e):be},mm=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},e9=function(e){return mm(function(){return e})},CM=function(e,t){return e<=t?mm(function(n){return e+n})(t-e+1):[e]},EM=function(e){return[An(e),ii(e)]},RM=function(e){return[xc(e),ka(e)]},t9=function(e){return Zf(e.slice())};function MM(e){return function(t){return t.concat(e)}}function Xf(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var n9=function(e){return e.length===1?e:Yf([ka(e)],e.slice(0,-1).reverse(),!0)};function xM(e){return function(t){var n=t.length;if(n===0)return Jf;for(var r=[],i=t[0],o=[i],a=1;a<n;a++){var u=t[a];e.equals(u,i)?o.push(u):(r.push(o),i=u,o=[i])}return r.push(o),r}}var r9=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);lt.call(n,a)?n[a].push(o):n[a]=[o]}return n}},k_=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},i9=function(e,t){return kM(e,function(){return t})},kM=function(e,t){return function(n){return dm(e,n)?be:pe(E_(e,t(n[e]),n))}},AM=function(e,t,n){for(var r=[n(e[0],t[0])],i=Math.min(e.length,t.length),o=1;o<i;o++)r[o]=n(e[o],t[o]);return r};function NM(e,t){return t===void 0?function(n){return NM(n,e)}:AM(e,t,function(n,r){return[n,r]})}var o9=function(e){for(var t=[e[0][0]],n=[e[0][1]],r=1;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},vm=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},A_=function(e){return function(t){var n=ii(t);return zi(n)?y(n,vm(e),Mc(An(t))):t}},FM=function(e){return function(t){for(var n=im(e(0,An(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},N_=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;zi(a);){var u=e(a),s=u[0],c=u[1];o.push(s),a=c}return o}},gm=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[t,Jf]:[y(t.slice(1,n),Mc(An(t))),t.slice(n)]}},PM=function(e){return N_(gm(e))},ri=function(e,t){return y(e,U_(t))},F_=function(e,t){return y(e,B_(t))},Qf=function(e,t){return y(e,UM(t))},P_=function(e,t){return y(e,ym(t))},WM=function(e,t){return y(e,q_(t))},ed=function(e,t,n){return y(e,z_(t,n))},td=function(e){var t=K_(e);return function(n,r){return y(n,t(r))}},nd=function(e,t,n){return y(e,V_(t,n))},W_=function(e){var t=BM(e);return function(n,r){return y(n,t(r))}},jM=function(e,t){return y(e,qM(t))},j_=function(e,t,n){return y(e,bm(t,n))},L_=function(e){var t=H_(e);return function(n,r){return y(n,t(r))}},D_=function(e,t,n){return y(e,_m(t,n))},LM=function(e){var t=$m(e);return function(n,r){return y(n,t(r))}},xa=Vf,DM=function(e){return function(t){return y(t,MM(e()))}},qM=DM,UM=function(e){return ym(function(t){return y(e,U_(t))})},ym=function(e){return FM(function(t,n){return e(n)})},q_=function(e){return function(t){for(var n=ii(t),r=[e(t)];zi(n);)r.push(e(n)),n=ii(n);return r}},a9=q_(D),u9=ym(D),U_=function(e){return B_(function(t,n){return e(n)})},B_=function(e){return function(t){for(var n=[e(0,An(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},z_=function(e,t){return bm(e,function(n,r,i){return t(r,i)})},K_=function(e){return function(t){return function(n){return n.slice(1).reduce(function(r,i){return e.concat(r,t(i))},t(n[0]))}}},V_=function(e,t){return _m(e,function(n,r,i){return t(r,i)})},bm=function(e,t){return function(n){return n.reduce(function(r,i,o){return t(o,r,i)},e)}},H_=function(e){return function(t){return function(n){return n.slice(1).reduce(function(r,i,o){return e.concat(r,t(o+1,i))},t(0,n[0]))}}},_m=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},BM=function(e){var t=$m(e);return function(n){return t(function(r,i){return n(i)})}},Sm=function(e){return $m(e)(Jn)},$m=function(e){return function(t){return function(n){for(var r=e.map(t(0,An(n)),xa),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return y(o,pm(a))}}),t(i,n[i]));return r}}},Tm=dr,kn="ReadonlyNonEmptyArray",zM=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},s9=function(){return{concat:Xf}},KM=function(e){return Pr(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},c9=function(e){var t=M_(e);return{concat:function(n,r){return t(r)(n)}}},G_={URI:kn,map:ri},l9=Ke(G_),f9={URI:kn,of:xa},d9={URI:kn,map:ri,mapWithIndex:F_},Im={URI:kn,map:ri,ap:Qf},p9=Ct(Im),h9=Et(Im),m9={URI:kn,map:ri,ap:Qf,of:xa},Y_={URI:kn,map:ri,ap:Qf,chain:P_},v9=ft(Y_),g9={URI:kn,map:ri,ap:Qf,of:xa,chain:P_},y9={URI:kn,reduce:ed,foldMap:td,reduceRight:nd},b9={URI:kn,reduce:ed,foldMap:td,reduceRight:nd,reduceWithIndex:j_,foldMapWithIndex:L_,reduceRightWithIndex:D_},_9={URI:kn,map:ri,reduce:ed,foldMap:td,reduceRight:nd,traverse:W_,sequence:Sm},S9={URI:kn,map:ri,mapWithIndex:F_,reduce:ed,foldMap:td,reduceRight:nd,traverse:W_,sequence:Sm,reduceWithIndex:j_,foldMapWithIndex:L_,reduceRightWithIndex:D_,traverseWithIndex:LM},$9={URI:kn,map:ri,alt:jM},T9={URI:kn,map:ri,extend:WM,extract:Tm},I9=xa(Yt),O9=wt(G_),w9=Mt(Y_),C9=Rt(Im),An=Tm,ii=Rc,ka=function(e){return e[e.length-1]},xc=function(e){return e.slice(0,-1)},VM=function(e){var t=cm(e);return function(n){return n.reduce(t.concat)}},HM=function(e){var t=lm(e);return function(n){return n.reduce(t.concat)}},Om=function(e){return function(t){return t.reduce(e.concat)}},E9=function(e){return function(t){return e(An(t),ii(t))}},R9=function(e){return function(t){return e(xc(t),ka(t))}},GM=function(e){return function(t){return Yf([e(An(t))],ii(t),!0)}},M9=function(e){return GM(function(){return e})},YM=function(e){return function(t){return y(xc(t),pm(e(ka(t))))}},x9=function(e){return YM(function(){return e})},J_=function(e){var t=Om(e);return function(n){return V(A_(n),t)}};function k9(e){var t=k_(e),n=xM(e);return function(r){return zi(r)?n(t(r)):Jf}}function A9(e){return JM(function(t,n){return e(n)})}var JM=function(e){return function(t){return Zf(t.filter(function(n,r){return e(r,n)}))}},N9=EM,F9=RM;function ZM(e,t){return t===void 0?Mc(e):y(t,Mc(e))}var XM=function(e,t){return y(e,Xf([t]))},P9=function(e,t){return function(n){return e<0||e>n.length?be:pe(hm(e,t,n))}},W9=vm,j9=Om,L9={URI:kn,of:xa,map:ri,mapWithIndex:F_,ap:Qf,chain:P_,extend:WM,extract:Tm,reduce:ed,foldMap:td,reduceRight:nd,traverse:W_,sequence:Sm,reduceWithIndex:j_,foldMapWithIndex:L_,reduceRightWithIndex:D_,traverseWithIndex:LM,alt:jM};const D9=Object.freeze(Object.defineProperty({__proto__:null,Alt:$9,Applicative:m9,Apply:Im,Chain:Y_,Comonad:T9,Do:I9,Foldable:y9,FoldableWithIndex:b9,Functor:G_,FunctorWithIndex:d9,Monad:g9,Pointed:f9,Traversable:_9,TraversableWithIndex:S9,URI:kn,alt:qM,altW:DM,ap:UM,apFirst:p9,apS:C9,apSecond:h9,append:pm,appendW:C_,bind:w9,bindTo:O9,chain:ym,chainFirst:v9,chainWithIndex:FM,chop:N_,chunksOf:PM,concat:Xf,concatAll:Om,concatW:MM,cons:ZM,duplicate:a9,empty:Jf,extend:q_,extract:Tm,filter:A9,filterWithIndex:JM,flap:l9,flatten:u9,fold:j9,foldMap:K_,foldMapWithIndex:H_,fromArray:t9,fromReadonlyArray:Zf,getEq:KM,getSemigroup:s9,getShow:zM,getUnionSemigroup:c9,group:xM,groupBy:r9,groupSort:k9,head:An,init:xc,insertAt:P9,intercalate:J_,intersperse:A_,isNonEmpty:zi,isOutOfBound:dm,last:ka,makeBy:mm,map:U_,mapWithIndex:B_,matchLeft:E9,matchRight:R9,max:HM,min:VM,modifyAt:kM,modifyHead:GM,modifyLast:YM,of:xa,prepend:Mc,prependAll:vm,prependToAll:W9,prependW:w_,range:CM,readonlyNonEmptyArray:L9,reduce:z_,reduceRight:V_,reduceRightWithIndex:_m,reduceWithIndex:bm,replicate:e9,reverse:n9,rotate:x_,sequence:Sm,snoc:XM,sort:k_,sortBy:wM,splitAt:gm,tail:ii,traverse:BM,traverseWithIndex:$m,unappend:RM,uncons:N9,union:M_,uniq:R_,unprepend:EM,unsafeInsertAt:hm,unsafeUpdateAt:E_,unsnoc:F9,unzip:o9,updateAt:i9,updateHead:M9,updateLast:x9,zip:NM,zipWith:AM},Symbol.toStringTag,{value:"Module"}));var QM={equals:function(e,t){return e===t}},ex={concat:function(e,t){return e+t}},tx="",q9={concat:ex.concat,empty:tx},K={equals:QM.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},U9={show:function(e){return JSON.stringify(e)}},B9=function(e){return typeof e=="string"},z9=function(e){return e.toUpperCase()},K9=function(e){return e.toLowerCase()},V9=function(e,t){return function(n){return n.replace(e,t)}},H9=function(e){return e.trim()},G9=function(e){return e.trimLeft()},Y9=function(e){return e.trimRight()},J9=function(e,t){return function(n){return n.slice(e,t)}},Z9=function(e){return e.length===0},X9=function(e){return e.length},Q9=function(e){return function(t){var n=t.split(e);return zi(n)?n:[t]}},eY=function(e,t){return function(n){return n.includes(e,t)}},tY=function(e,t){return function(n){return n.startsWith(e,t)}},nY=function(e,t){return function(n){return n.endsWith(e,t)}};const rY=Object.freeze(Object.defineProperty({__proto__:null,Eq:QM,Monoid:q9,Ord:K,Semigroup:ex,Show:U9,empty:tx,endsWith:nY,includes:eY,isEmpty:Z9,isString:B9,replace:V9,size:X9,slice:J9,split:Q9,startsWith:tY,toLowerCase:K9,toUpperCase:z9,trim:H9,trimLeft:G9,trimRight:Y9},Symbol.toStringTag,{value:"Module"}));function oi(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}function ai(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}function Z_(e){return function(t){var n=e.wither(t);return function(r){return function(i){return n(i,function(o){return t.map(r(o),function(a){return a?pe(o):be})})}}}}const iY=Object.freeze(Object.defineProperty({__proto__:null,filterE:Z_,wiltDefault:oi,witherDefault:ai},Symbol.toStringTag,{value:"Module"}));var oY=function(e){return Object.assign({},e)},aY=function(e){return Object.assign({},e)},nx=function(e){return Object.keys(e).length},ui=function(e){for(var t in e)if(lt.call(e,t))return!1;return!0},kc=function(e){return function(t){return Object.keys(t).sort(e.compare)}},uY=kc(K);function wm(e){if(typeof e=="function")return wm(K)(e);var t=kc(e);return function(n){return function(r){for(var i=[],o=0,a=t(r);o<a.length;o++){var u=a[o];i.push(n(u,r[u]))}return i}}}var Cm=wm(K)(function(e,t){return[e,t]});function sY(e){return function(t){var n=Cm(t),r=n.length;return e.unfold(0,function(i){return i<r?pe([n[i],i+1]):be})}}var X_=function(e,t){return function(n){if(lt.call(n,e)&&n[e]===t)return n;var r=Object.assign({},n);return r[e]=t,r}},To=function(e,t){return lt.call(t,e)};function Em(e){return function(t){if(!lt.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var cY=function(e,t){return function(n){if(!To(e,n))return be;if(n[e]===t)return pe(n);var r=Object.assign({},n);return r[e]=t,pe(r)}},lY=function(e,t){return function(n){if(!To(e,n))return be;var r=t(n[e]);if(r===n[e])return pe(n);var i=Object.assign({},n);return i[e]=r,pe(i)}};function fY(e){var t=Em(e);return function(n){var r=ju(e,n);return Wt(r)?be:pe([r.value,t(n)])}}function Rm(e){return function(t,n){if(n===void 0){var r=Rm(e);return function(o){return r(o,t)}}for(var i in t)if(!lt.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function ju(e,t){return t===void 0?function(n){return ju(e,n)}:lt.call(t,e)?pe(t[e]):be}var rd={};function Mm(e){return function(t){var n={};for(var r in t)lt.call(t,r)&&(n[r]=e(r,t[r]));return n}}function Q_(e){return Mm(function(t,n){return e(n)})}function Ac(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return Ac(K).apply(void 0,e);var n=kc(e[0]);return function(r,i){return function(o){for(var a=r,u=n(o),s=u.length,c=0;c<s;c++){var l=u[c];a=i(l,a,o[l])}return a}}}function Nc(e){if("compare"in e){var t=kc(e);return function(n){return function(r){return function(i){for(var o=n.empty,a=t(i),u=a.length,s=0;s<u;s++){var c=a[s];o=n.concat(o,r(c,i[c]))}return o}}}}return Nc(K)(e)}function Fc(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return Fc(K).apply(void 0,e);var n=kc(e[0]);return function(r,i){return function(o){for(var a=r,u=n(o),s=u.length,c=s-1;c>=0;c--){var l=u[c];a=i(l,o[l],a)}return a}}}var rx=function(e,t){var n;return n={},n[e]=t,n};function ix(e){var t=od(K)(e);return function(n){return function(r){return t(r,n)}}}function xm(e){var t=Ki(K)(e);return function(n){return function(r){return t(r,n)}}}function Pc(e){return id(K)(e)}var dY=function(e){var t=xm(e);return function(n){return function(r){return e.map(y(r,t(n)),Io)}}},pY=function(e){var t=xm(e);return function(n){return function(r){return e.map(y(r,t(n)),Oo)}}};function km(e){return function(t){var n={},r={};for(var i in t)if(lt.call(t,i)){var o=e(i,t[i]);switch(o._tag){case"Left":n[i]=o.left;break;case"Right":r[i]=o.right;break}}return Me(n,r)}}function Am(e){return function(t){var n={},r={};for(var i in t)if(lt.call(t,i)){var o=t[i];e(i,o)?r[i]=o:n[i]=o}return Me(n,r)}}function Nm(e){return function(t){var n={};for(var r in t)if(lt.call(t,r)){var i=e(r,t[r]);bt(i)&&(n[r]=i.value)}return n}}function Fm(e){return function(t){var n={},r=!1;for(var i in t)if(lt.call(t,i)){var o=t[i];e(i,o)?n[i]=o:r=!0}return r?n:t}}function ox(e,t){var n=eS(e,t);return function(r){return n(r,D)}}function eS(e,t){return function(n,r){return t.reduce(n,{},function(i,o){var a=r(o),u=a[0],s=a[1];return i[u]=lt.call(i,u)?e.concat(i[u],s):s,i})}}var hY=Cm,mY=function(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];t[i[0]]=i[1]}return t};function ax(e){return function(t){for(var n in t)if(!e(t[n]))return!1;return!0}}function ux(e){return function(t){for(var n in t)if(e(t[n]))return!0;return!1}}function tS(e){return function(t,n){if(n===void 0){var r=tS(e);return function(o){return r(t,o)}}for(var i in n)if(e.equals(n[i],t))return!0;return!1}}var nS=function(e){return function(t){return function(n){if(ui(n))return t;if(ui(t))return n;var r={};for(var i in n)To(i,t)?r[i]=e.concat(n[i],t[i]):r[i]=n[i];for(var i in t)To(i,r)||(r[i]=t[i]);return r}}},rS=function(e){return function(t){return function(n){if(ui(n)||ui(t))return rd;var r={};for(var i in n)To(i,t)&&(r[i]=e.concat(n[i],t[i]));return r}}},iS=function(e){return function(t){if(ui(t))return e;if(ui(e))return t;var n={};for(var r in t)To(r,e)||(n[r]=t[r]);for(var r in e)To(r,t)||(n[r]=e[r]);return n}},pr=function(e,t){return y(e,Q_(t))},Lu=function(e,t){return y(e,Mm(t))},hr=function(e){var t=ad(e);return function(n,r,i){return y(n,t(r,i))}},mr=function(e){return function(t){var n=ud(e)(t);return function(r,i){return y(r,n(i))}}},vr=function(e){var t=sd(e);return function(n,r,i){return y(n,t(r,i))}},Du=function(e,t){return y(e,oS(t))},qu=function(e,t){return y(e,aS(t))},Uu=function(e,t){return y(e,Dm(t))},Bu=function(e,t){return y(e,uS(t))},zu=function(e){var t=Ac(e);return function(n,r,i){return y(n,t(r,i))}},Ku=function(e){var t=Nc(e);return function(n){var r=t(n);return function(i,o){return y(i,r(o))}}},Vu=function(e){var t=Fc(e);return function(n,r,i){return y(n,t(r,i))}},Pm=function(e,t){return y(e,km(t))},Wm=function(e,t){return y(e,Am(t))},jm=function(e,t){return y(e,Nm(t))},Lm=function(e,t){return y(e,Fm(t))},Ki=function(e){var t=od(e);return function(n){var r=t(n);return function(i,o){return r(i,V(Jn,o))}}},id=function(e){var t=Ki(e);return function(n){var r=t(n);return function(i){return r(i,D)}}},od=function(e){return function(t){var n=kc(e);return function(r,i){var o=n(r);if(o.length===0)return t.of(rd);for(var a=t.of({}),u=function(f){a=t.ap(t.map(a,function(d){return function(p){var h;return Object.assign({},d,(h={},h[f]=p,h))}}),i(f,r[f]))},s=0,c=o;s<c.length;s++){var l=c[s];u(l)}return a}}},oS=function(e){return Fm(function(t,n){return e(n)})},aS=function(e){return Nm(function(t,n){return e(n)})},Dm=function(e){return Am(function(t,n){return e(n)})},uS=function(e){return km(function(t,n){return e(n)})};function ad(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=Ac(e[0]);return function(r,i){return n(r,function(o,a,u){return i(a,u)})}}return ad(K).apply(void 0,e)}function ud(e){if("compare"in e){var t=Nc(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}}return ud(K)(e)}function sd(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=Fc(e[0]);return function(r,i){return n(r,function(o,a,u){return i(a,u)})}}return sd(K).apply(void 0,e)}var Io=function(e){var t={};for(var n in e)if(lt.call(e,n)){var r=e[n];bt(r)&&(t[n]=r.value)}return t},Oo=function(e){var t={},n={};for(var r in e)if(lt.call(e,r)){var i=e[r];Gt(i)?t[r]=i.left:n[r]=i.right}return Me(t,n)},on="ReadonlyRecord";function qm(e){return"compare"in e?function(t){return{show:function(n){var r=wm(e)(function(i,o){return"".concat(JSON.stringify(i),": ").concat(t.show(o))})(n).join(", ");return r===""?"{}":"{ ".concat(r," }")}}}:qm(K)(e)}function sx(e){var t=Rm(e);return Pr(function(n,r){return t(n)(r)&&t(r)(n)})}function cx(e){return{concat:function(t,n){if(ui(t))return n;if(ui(n))return t;var r=Object.assign({},t);for(var i in n)lt.call(n,i)&&(r[i]=lt.call(t,i)?e.concat(t[i],n[i]):n[i]);return r},empty:rd}}var lx={URI:on,map:pr},vY=Ke(lx),gY={URI:on,map:pr,mapWithIndex:Lu},yY=function(e){return{URI:on,reduce:hr(e),foldMap:mr(e),reduceRight:vr(e)}},bY=function(e){return{URI:on,reduce:hr(e),foldMap:mr(e),reduceRight:vr(e),reduceWithIndex:zu(e),foldMapWithIndex:Ku(e),reduceRightWithIndex:Vu(e)}},cd={URI:on,compact:Io,separate:Oo},_Y={URI:on,map:pr,compact:Io,separate:Oo,filter:Du,filterMap:qu,partition:Uu,partitionMap:Bu},SY={URI:on,map:pr,mapWithIndex:Lu,compact:Io,separate:Oo,filter:Du,filterMap:qu,partition:Uu,partitionMap:Bu,filterMapWithIndex:jm,filterWithIndex:Lm,partitionMapWithIndex:Pm,partitionWithIndex:Wm},fx=function(e){return{URI:on,map:pr,reduce:hr(e),foldMap:mr(e),reduceRight:vr(e),traverse:Ki(e),sequence:id(e)}},$Y=function(e){return{URI:on,map:pr,mapWithIndex:Lu,reduce:hr(e),foldMap:mr(e),reduceRight:vr(e),reduceWithIndex:zu(e),foldMapWithIndex:Ku(e),reduceRightWithIndex:Vu(e),traverse:Ki(e),sequence:id(e),traverseWithIndex:od(e)}},TY=function(e){var t=fx(e);return{URI:on,map:pr,reduce:hr(e),foldMap:mr(e),reduceRight:vr(e),traverse:t.traverse,sequence:t.sequence,compact:Io,separate:Oo,filter:Du,filterMap:qu,partition:Uu,partitionMap:Bu,wither:ai(t,cd),wilt:oi(t,cd)}},dx=function(e){var t=nS(e);return{concat:function(n,r){return t(r)(n)}}},IY=function(e){return{concat:dx(e).concat,empty:rd}},OY=function(e){var t=rS(e);return{concat:function(n,r){return t(r)(n)}}},wY=function(){return{concat:function(e,t){return iS(t)(e)}}},CY={URI:on,reduce:hr(K),foldMap:mr(K),reduceRight:vr(K)},EY={URI:on,reduce:hr(K),foldMap:mr(K),reduceRight:vr(K),reduceWithIndex:zu(K),foldMapWithIndex:Ku(K),reduceRightWithIndex:Vu(K)},sS={URI:on,map:pr,reduce:hr(K),foldMap:mr(K),reduceRight:vr(K),traverse:Ki(K),sequence:Pc},RY={URI:on,map:pr,mapWithIndex:Lu,reduce:hr(K),foldMap:mr(K),reduceRight:vr(K),reduceWithIndex:zu(K),foldMapWithIndex:Ku(K),reduceRightWithIndex:Vu(K),traverse:Ki(K),sequence:Pc,traverseWithIndex:od(K)},px=ai(sS,cd),hx=oi(sS,cd),MY={URI:on,map:pr,reduce:hr(K),foldMap:mr(K),reduceRight:vr(K),traverse:Ki(K),sequence:Pc,compact:Io,separate:Oo,filter:Du,filterMap:qu,partition:Uu,partitionMap:Bu,wither:px,wilt:hx},cS=X_;function mx(e,t){return lt.call(t===void 0?this:t,e)}var xY={URI:on,map:pr,reduce:hr(K),foldMap:mr(K),reduceRight:vr(K),traverse:Ki(K),sequence:Pc,compact:Io,separate:Oo,filter:Du,filterMap:qu,partition:Uu,partitionMap:Bu,mapWithIndex:Lu,reduceWithIndex:zu(K),foldMapWithIndex:Ku(K),reduceRightWithIndex:Vu(K),filterMapWithIndex:jm,filterWithIndex:Lm,partitionMapWithIndex:Pm,partitionWithIndex:Wm,traverseWithIndex:od(K),wither:px,wilt:hx};const kY=Object.freeze(Object.defineProperty({__proto__:null,Compactable:cd,Filterable:_Y,FilterableWithIndex:SY,Foldable:CY,FoldableWithIndex:EY,Functor:lx,FunctorWithIndex:gY,Traversable:sS,TraversableWithIndex:RY,URI:on,Witherable:MY,_filter:Du,_filterMap:qu,_filterMapWithIndex:jm,_filterWithIndex:Lm,_foldMap:mr,_foldMapWithIndex:Ku,_map:pr,_mapWithIndex:Lu,_partition:Uu,_partitionMap:Bu,_partitionMapWithIndex:Pm,_partitionWithIndex:Wm,_reduce:hr,_reduceRight:vr,_reduceRightWithIndex:Vu,_reduceWithIndex:zu,_sequence:id,_traverse:Ki,collect:wm,compact:Io,deleteAt:Em,difference:iS,elem:tS,empty:rd,every:ax,filter:oS,filterMap:aS,filterMapWithIndex:Nm,filterWithIndex:Fm,flap:vY,foldMap:ud,foldMapWithIndex:Nc,fromEntries:mY,fromFoldable:ox,fromFoldableMap:eS,fromRecord:oY,getDifferenceMagma:wY,getEq:sx,getFoldable:yY,getFoldableWithIndex:bY,getIntersectionSemigroup:OY,getMonoid:cx,getShow:qm,getTraversable:fx,getTraversableWithIndex:$Y,getUnionMonoid:IY,getUnionSemigroup:dx,getWitherable:TY,has:To,hasOwnProperty:mx,insertAt:cS,intersection:rS,isEmpty:ui,isSubrecord:Rm,keys:uY,lookup:ju,map:Q_,mapWithIndex:Mm,modifyAt:lY,partition:Dm,partitionMap:uS,partitionMapWithIndex:km,partitionWithIndex:Am,pop:fY,readonlyRecord:xY,reduce:ad,reduceRight:sd,reduceRightWithIndex:Fc,reduceWithIndex:Ac,separate:Oo,sequence:Pc,singleton:rx,size:nx,some:ux,toEntries:hY,toReadonlyArray:Cm,toRecord:aY,toUnfoldable:sY,traverse:xm,traverseWithIndex:ix,union:nS,updateAt:cY,upsertAt:X_,wilt:pY,wither:dY},Symbol.toStringTag,{value:"Module"})),lS=U.createContext(void 0);function fS(){const e=U.useContext(lS);if(!e)throw new Error("Missing EditorConfigContext.Provider");return e}var ot={},H={},AY={get exports(){return H},set exports(e){H=e}};(function(e){var t,n,r,i,o,a,u,s,c,l,f,d,p,h,v,m,_,g,S,b,$,T,M,R,q,Y,N,Z,ie;(function(J){var ye=typeof he=="object"?he:typeof self=="object"?self:typeof this=="object"?this:{};J(we(ye,we(e.exports)));function we(x,k){return x!==ye&&(typeof Object.create=="function"?Object.defineProperty(x,"__esModule",{value:!0}):x.__esModule=!0),function(C,O){return x[C]=k?k(C,O):O}}})(function(J){var ye=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,k){x.__proto__=k}||function(x,k){for(var C in k)Object.prototype.hasOwnProperty.call(k,C)&&(x[C]=k[C])};t=function(x,k){if(typeof k!="function"&&k!==null)throw new TypeError("Class extends value "+String(k)+" is not a constructor or null");ye(x,k);function C(){this.constructor=x}x.prototype=k===null?Object.create(k):(C.prototype=k.prototype,new C)},n=Object.assign||function(x){for(var k,C=1,O=arguments.length;C<O;C++){k=arguments[C];for(var F in k)Object.prototype.hasOwnProperty.call(k,F)&&(x[F]=k[F])}return x},r=function(x,k){var C={};for(var O in x)Object.prototype.hasOwnProperty.call(x,O)&&k.indexOf(O)<0&&(C[O]=x[O]);if(x!=null&&typeof Object.getOwnPropertySymbols=="function")for(var F=0,O=Object.getOwnPropertySymbols(x);F<O.length;F++)k.indexOf(O[F])<0&&Object.prototype.propertyIsEnumerable.call(x,O[F])&&(C[O[F]]=x[O[F]]);return C},i=function(x,k,C,O){var F=arguments.length,j=F<3?k:O===null?O=Object.getOwnPropertyDescriptor(k,C):O,X;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(x,k,C,O);else for(var te=x.length-1;te>=0;te--)(X=x[te])&&(j=(F<3?X(j):F>3?X(k,C,j):X(k,C))||j);return F>3&&j&&Object.defineProperty(k,C,j),j},o=function(x,k){return function(C,O){k(C,O,x)}},a=function(x,k,C,O,F,j){function X(xn){if(xn!==void 0&&typeof xn!="function")throw new TypeError("Function expected");return xn}for(var te=O.kind,xe=te==="getter"?"get":te==="setter"?"set":"value",ce=!k&&x?O.static?x:x.prototype:null,Ne=k||(ce?Object.getOwnPropertyDescriptor(ce,O.name):{}),ze,He=!1,it=C.length-1;it>=0;it--){var Ft={};for(var qt in O)Ft[qt]=qt==="access"?{}:O[qt];for(var qt in O.access)Ft.access[qt]=O.access[qt];Ft.addInitializer=function(xn){if(He)throw new TypeError("Cannot add initializers after decoration has completed");j.push(X(xn||null))};var Ht=(0,C[it])(te==="accessor"?{get:Ne.get,set:Ne.set}:Ne[xe],Ft);if(te==="accessor"){if(Ht===void 0)continue;if(Ht===null||typeof Ht!="object")throw new TypeError("Object expected");(ze=X(Ht.get))&&(Ne.get=ze),(ze=X(Ht.set))&&(Ne.set=ze),(ze=X(Ht.init))&&F.push(ze)}else(ze=X(Ht))&&(te==="field"?F.push(ze):Ne[xe]=ze)}ce&&Object.defineProperty(ce,O.name,Ne),He=!0},u=function(x,k,C){for(var O=arguments.length>2,F=0;F<k.length;F++)C=O?k[F].call(x,C):k[F].call(x);return O?C:void 0},s=function(x){return typeof x=="symbol"?x:"".concat(x)},c=function(x,k,C){return typeof k=="symbol"&&(k=k.description?"[".concat(k.description,"]"):""),Object.defineProperty(x,"name",{configurable:!0,value:C?"".concat(C," ",k):k})},l=function(x,k){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(x,k)},f=function(x,k,C,O){function F(j){return j instanceof C?j:new C(function(X){X(j)})}return new(C||(C=Promise))(function(j,X){function te(Ne){try{ce(O.next(Ne))}catch(ze){X(ze)}}function xe(Ne){try{ce(O.throw(Ne))}catch(ze){X(ze)}}function ce(Ne){Ne.done?j(Ne.value):F(Ne.value).then(te,xe)}ce((O=O.apply(x,k||[])).next())})},d=function(x,k){var C={label:0,sent:function(){if(j[0]&1)throw j[1];return j[1]},trys:[],ops:[]},O,F,j,X;return X={next:te(0),throw:te(1),return:te(2)},typeof Symbol=="function"&&(X[Symbol.iterator]=function(){return this}),X;function te(ce){return function(Ne){return xe([ce,Ne])}}function xe(ce){if(O)throw new TypeError("Generator is already executing.");for(;X&&(X=0,ce[0]&&(C=0)),C;)try{if(O=1,F&&(j=ce[0]&2?F.return:ce[0]?F.throw||((j=F.return)&&j.call(F),0):F.next)&&!(j=j.call(F,ce[1])).done)return j;switch(F=0,j&&(ce=[ce[0]&2,j.value]),ce[0]){case 0:case 1:j=ce;break;case 4:return C.label++,{value:ce[1],done:!1};case 5:C.label++,F=ce[1],ce=[0];continue;case 7:ce=C.ops.pop(),C.trys.pop();continue;default:if(j=C.trys,!(j=j.length>0&&j[j.length-1])&&(ce[0]===6||ce[0]===2)){C=0;continue}if(ce[0]===3&&(!j||ce[1]>j[0]&&ce[1]<j[3])){C.label=ce[1];break}if(ce[0]===6&&C.label<j[1]){C.label=j[1],j=ce;break}if(j&&C.label<j[2]){C.label=j[2],C.ops.push(ce);break}j[2]&&C.ops.pop(),C.trys.pop();continue}ce=k.call(x,C)}catch(Ne){ce=[6,Ne],F=0}finally{O=j=0}if(ce[0]&5)throw ce[1];return{value:ce[0]?ce[1]:void 0,done:!0}}},p=function(x,k){for(var C in x)C!=="default"&&!Object.prototype.hasOwnProperty.call(k,C)&&ie(k,x,C)},ie=Object.create?function(x,k,C,O){O===void 0&&(O=C);var F=Object.getOwnPropertyDescriptor(k,C);(!F||("get"in F?!k.__esModule:F.writable||F.configurable))&&(F={enumerable:!0,get:function(){return k[C]}}),Object.defineProperty(x,O,F)}:function(x,k,C,O){O===void 0&&(O=C),x[O]=k[C]},h=function(x){var k=typeof Symbol=="function"&&Symbol.iterator,C=k&&x[k],O=0;if(C)return C.call(x);if(x&&typeof x.length=="number")return{next:function(){return x&&O>=x.length&&(x=void 0),{value:x&&x[O++],done:!x}}};throw new TypeError(k?"Object is not iterable.":"Symbol.iterator is not defined.")},v=function(x,k){var C=typeof Symbol=="function"&&x[Symbol.iterator];if(!C)return x;var O=C.call(x),F,j=[],X;try{for(;(k===void 0||k-- >0)&&!(F=O.next()).done;)j.push(F.value)}catch(te){X={error:te}}finally{try{F&&!F.done&&(C=O.return)&&C.call(O)}finally{if(X)throw X.error}}return j},m=function(){for(var x=[],k=0;k<arguments.length;k++)x=x.concat(v(arguments[k]));return x},_=function(){for(var x=0,k=0,C=arguments.length;k<C;k++)x+=arguments[k].length;for(var O=Array(x),F=0,k=0;k<C;k++)for(var j=arguments[k],X=0,te=j.length;X<te;X++,F++)O[F]=j[X];return O},g=function(x,k,C){if(C||arguments.length===2)for(var O=0,F=k.length,j;O<F;O++)(j||!(O in k))&&(j||(j=Array.prototype.slice.call(k,0,O)),j[O]=k[O]);return x.concat(j||Array.prototype.slice.call(k))},S=function(x){return this instanceof S?(this.v=x,this):new S(x)},b=function(x,k,C){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var O=C.apply(x,k||[]),F,j=[];return F={},X("next"),X("throw"),X("return"),F[Symbol.asyncIterator]=function(){return this},F;function X(He){O[He]&&(F[He]=function(it){return new Promise(function(Ft,qt){j.push([He,it,Ft,qt])>1||te(He,it)})})}function te(He,it){try{xe(O[He](it))}catch(Ft){ze(j[0][3],Ft)}}function xe(He){He.value instanceof S?Promise.resolve(He.value.v).then(ce,Ne):ze(j[0][2],He)}function ce(He){te("next",He)}function Ne(He){te("throw",He)}function ze(He,it){He(it),j.shift(),j.length&&te(j[0][0],j[0][1])}},$=function(x){var k,C;return k={},O("next"),O("throw",function(F){throw F}),O("return"),k[Symbol.iterator]=function(){return this},k;function O(F,j){k[F]=x[F]?function(X){return(C=!C)?{value:S(x[F](X)),done:!1}:j?j(X):X}:j}},T=function(x){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var k=x[Symbol.asyncIterator],C;return k?k.call(x):(x=typeof h=="function"?h(x):x[Symbol.iterator](),C={},O("next"),O("throw"),O("return"),C[Symbol.asyncIterator]=function(){return this},C);function O(j){C[j]=x[j]&&function(X){return new Promise(function(te,xe){X=x[j](X),F(te,xe,X.done,X.value)})}}function F(j,X,te,xe){Promise.resolve(xe).then(function(ce){j({value:ce,done:te})},X)}},M=function(x,k){return Object.defineProperty?Object.defineProperty(x,"raw",{value:k}):x.raw=k,x};var we=Object.create?function(x,k){Object.defineProperty(x,"default",{enumerable:!0,value:k})}:function(x,k){x.default=k};R=function(x){if(x&&x.__esModule)return x;var k={};if(x!=null)for(var C in x)C!=="default"&&Object.prototype.hasOwnProperty.call(x,C)&&ie(k,x,C);return we(k,x),k},q=function(x){return x&&x.__esModule?x:{default:x}},Y=function(x,k,C,O){if(C==="a"&&!O)throw new TypeError("Private accessor was defined without a getter");if(typeof k=="function"?x!==k||!O:!k.has(x))throw new TypeError("Cannot read private member from an object whose class did not declare it");return C==="m"?O:C==="a"?O.call(x):O?O.value:k.get(x)},N=function(x,k,C,O,F){if(O==="m")throw new TypeError("Private method is not writable");if(O==="a"&&!F)throw new TypeError("Private accessor was defined without a setter");if(typeof k=="function"?x!==k||!F:!k.has(x))throw new TypeError("Cannot write private member to an object whose class did not declare it");return O==="a"?F.call(x,C):F?F.value=C:k.set(x,C),C},Z=function(x,k){if(k===null||typeof k!="object"&&typeof k!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof x=="function"?k===x:x.has(k)},J("__extends",t),J("__assign",n),J("__rest",r),J("__decorate",i),J("__param",o),J("__esDecorate",a),J("__runInitializers",u),J("__propKey",s),J("__setFunctionName",c),J("__metadata",l),J("__awaiter",f),J("__generator",d),J("__exportStar",p),J("__createBinding",ie),J("__values",h),J("__read",v),J("__spread",m),J("__spreadArrays",_),J("__spreadArray",g),J("__await",S),J("__asyncGenerator",b),J("__asyncDelegator",$),J("__asyncValues",T),J("__makeTemplateObject",M),J("__importStar",R),J("__importDefault",q),J("__classPrivateFieldGet",Y),J("__classPrivateFieldSet",N),J("__classPrivateFieldIn",Z)})})(AY);var Hu={};function vx(e){return function(t){return function(n){return n.reduce(function(r,i){return e.alt(r,function(){return i})},t)}}}const NY=Object.freeze(Object.defineProperty({__proto__:null,altAll:vx},Symbol.toStringTag,{value:"Module"}));function FY(e){return vx(e)(e.zero())}const PY=Object.freeze(Object.defineProperty({__proto__:null,altAll:FY},Symbol.toStringTag,{value:"Module"}));function Wr(e){var t=Jt(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function gx(e,t){var n=Ec(e,t).map,r=$o(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return y(i,r(o))}}}const WY=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeComposition:gx,getApplicativeMonoid:Wr},Symbol.toStringTag,{value:"Module"}));function Vi(e){return function(t){return function(n){return e.fromEither(Wt(n)?So(t()):Ma(n.value))}}}function Aa(e){return function(t,n){return function(r){return e.fromEither(t(r)?Ma(r):So(n(r)))}}}function Hi(e){var t=Vi(e);return function(n){var r=t(n);return function(i){return V(i,r)}}}function Gu(e,t){var n=Hi(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}function gr(e){return function(t){return V(t,e.fromEither)}}function wo(e,t){var n=gr(e);return function(r){return function(i){return t.chain(i,n(r))}}}function Co(e,t){return V(gr(e),ft(t))}function Yu(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Ma(o):So(r(o)))})}}}const jY=Object.freeze(Object.defineProperty({__proto__:null,chainEitherK:wo,chainFirstEitherK:Co,chainOptionK:Gu,filterOrElse:Yu,fromEitherK:gr,fromOption:Vi,fromOptionK:Hi,fromPredicate:Aa},Symbol.toStringTag,{value:"Module"}));var ld=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Eo=function(e){return e.length>0},Um=function(e,t){return e<0||e>=t.length},dS=function(e){return function(t){return ld([e],t,!0)}},Wc=dS,pS=function(e){return function(t){return ld(ld([],t,!0),[e],!1)}},fd=pS,hS=function(e,t,n){if(Eo(n)){var r=dd(n);return r.splice(e,0,t),r}return[t]},mS=function(e,t,n){var r=dd(n);return r[e]=t,r},vS=function(e){return function(t){if(t.length===1)return jc(t);for(var n=[jr(t)],r=ci(t),i=function(s){n.every(function(c){return!e.equals(c,s)})&&n.push(s)},o=0,a=r;o<a.length;o++){var u=a[o];i(u)}return n}},yx=function(e){if(Eo(e)){var t=y_();return _S(e.reduce(t.concat,t.empty))}return jc},gS=function(e){var t=vS(e);return function(n){return function(r){return t(y(r,zm(n)))}}},yS=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(Um(Math.abs(r),t)||r===0)return jc(t);if(r<0){var i=Vm(-r)(t),o=i[0],a=i[1];return y(a,zm(o))}else return yS(r-n)(t)}},dd=im,bS=function(e){return Eo(e)?pe(e):be},Bm=function(e){return function(t){for(var n=Math.max(0,Math.floor(t)),r=[e(0)],i=1;i<n;i++)r.push(e(i));return r}},LY=function(e){return Bm(function(){return e})},bx=function(e,t){return e<=t?Bm(function(n){return e+n})(t-e+1):[e]},_x=function(e){return[jr(e),ci(e)]},Sx=function(e){return[Dc(e),Lc(e)]};function $x(e){return function(t){return t.concat(e)}}function zm(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var DY=function(e){return ld([Lc(e)],e.slice(0,-1).reverse(),!0)};function Tx(e){return function(t){var n=t.length;if(n===0)return[];for(var r=[],i=t[0],o=[i],a=1;a<n;a++){var u=t[a];e.equals(u,i)?o.push(u):(r.push(o),i=u,o=[i])}return r.push(o),r}}var qY=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);lt.call(n,a)?n[a].push(o):n[a]=[o]}return n}},_S=function(e){return function(t){return t.slice().sort(e.compare)}},UY=function(e,t){return function(n){return e<0||e>n.length?be:pe(hS(e,t,n))}},BY=function(e,t){return Ix(e,function(){return t})},Ix=function(e,t){return function(n){return Um(e,n)?be:pe(mS(e,t(n[e]),n))}},jc=dd,Na=function(e){return[e]},Ox=function(e,t,n){for(var r=[n(e[0],t[0])],i=Math.min(e.length,t.length),o=1;o<i;o++)r[o]=n(e[o],t[o]);return r};function wx(e,t){return t===void 0?function(n){return wx(n,e)}:Ox(e,t,function(n,r){return[n,r]})}var zY=function(e){for(var t=[e[0][0]],n=[e[0][1]],r=1;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},Km=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},Cx=function(e){return function(t){var n=ci(t);return Eo(n)?y(n,Km(e),Wc(jr(t))):jc(t)}},Ex=H_,Rx=K_,Mx=function(e){return function(t){for(var n=dd(e(0,jr(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},SS=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;Eo(a);){var u=e(a),s=u[0],c=u[1];o.push(s),a=c}return o}},Vm=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[jc(t),[]]:[y(t.slice(1,n),Wc(jr(t))),t.slice(n)]}},xx=function(e){return SS(Vm(e))},si=function(e,t){return y(e,RS(t))},$S=function(e,t){return y(e,MS(t))},pd=function(e,t){return y(e,Wx(t))},TS=function(e,t){return y(e,Hm(t))},kx=function(e,t){return y(e,ES(t))},hd=function(e,t,n){return y(e,jx(t,n))},md=function(e){var t=Rx(e);return function(n,r){return y(n,t(r))}},vd=function(e,t,n){return y(e,Dx(t,n))},IS=function(e){var t=Ux(e);return function(n,r){return y(n,t(r))}},Ax=function(e,t){return y(e,Px(t))},OS=function(e,t,n){return y(e,Lx(t,n))},wS=function(e){var t=Ex(e);return function(n,r){return y(n,t(r))}},CS=function(e,t,n){return y(e,qx(t,n))},Nx=function(e){var t=Ym(e);return function(n,r){return y(n,t(r))}},Fx=function(e){return function(t){return y(t,$x(e()))}},Px=Fx,Wx=function(e){return Hm(function(t){return y(e,RS(t))})},Hm=function(e){return Mx(function(t,n){return e(n)})},ES=function(e){return function(t){for(var n=ci(t),r=[e(t)];Eo(n);)r.push(e(n)),n=ci(n);return r}},KY=ES(D),VY=Hm(D),RS=function(e){return MS(function(t,n){return e(n)})},MS=function(e){return function(t){for(var n=[e(0,jr(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},jx=z_,Lx=bm,Dx=V_,qx=_m,Ux=function(e){var t=Ym(e);return function(n){return t(function(r,i){return n(i)})}},Gm=function(e){return Ym(e)(function(t,n){return n})},Ym=function(e){return function(t){return function(n){for(var r=e.map(t(0,jr(n)),Na),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return y(o,fd(a))}}),t(i,n[i]));return r}}},xS=An,Nn="NonEmptyArray",HY=zM,GY=function(){return{concat:zm}},YY=KM,JY=function(e){var t=gS(e);return{concat:function(n,r){return t(r)(n)}}},kS={URI:Nn,map:si},ZY=Ke(kS),XY={URI:Nn,of:Na},QY={URI:Nn,map:si,mapWithIndex:$S},Jm={URI:Nn,map:si,ap:pd},eJ=Ct(Jm),tJ=Et(Jm),nJ={URI:Nn,map:si,ap:pd,of:Na},AS={URI:Nn,map:si,ap:pd,chain:TS},rJ=ft(AS),iJ={URI:Nn,map:si,ap:pd,of:Na,chain:TS},oJ={URI:Nn,reduce:hd,foldMap:md,reduceRight:vd},aJ={URI:Nn,reduce:hd,foldMap:md,reduceRight:vd,reduceWithIndex:OS,foldMapWithIndex:wS,reduceRightWithIndex:CS},uJ={URI:Nn,map:si,reduce:hd,foldMap:md,reduceRight:vd,traverse:IS,sequence:Gm},sJ={URI:Nn,map:si,mapWithIndex:$S,reduce:hd,foldMap:md,reduceRight:vd,traverse:IS,sequence:Gm,reduceWithIndex:OS,foldMapWithIndex:wS,reduceRightWithIndex:CS,traverseWithIndex:Nx},cJ={URI:Nn,map:si,alt:Ax},lJ={URI:Nn,map:si,extend:kx,extract:xS},fJ=Na(Yt),dJ=wt(kS),pJ=Mt(AS),hJ=Rt(Jm),jr=An,ci=function(e){return e.slice(1)},Lc=ka,Dc=function(e){return e.slice(0,-1)},mJ=VM,vJ=HM,gJ=function(e){return function(t){return t.reduce(e.concat)}},yJ=function(e){return function(t){return e(jr(t),ci(t))}},bJ=function(e){return function(t){return e(Dc(t),Lc(t))}},Bx=function(e){return function(t){return ld([e(jr(t))],ci(t),!0)}},_J=function(e){return Bx(function(){return e})},zx=function(e){return function(t){return y(Dc(t),fd(e(Lc(t))))}},SJ=function(e){return zx(function(){return e})},$J=J_;function TJ(e){var t=_S(e),n=Tx(e);return function(r){return Eo(r)?n(t(r)):[]}}function IJ(e){return Kx(function(t,n){return e(n)})}var Kx=function(e){return function(t){return bS(t.filter(function(n,r){return e(r,n)}))}},OJ=_x,wJ=Sx;function Vx(e,t){return t===void 0?Wc(e):y(t,Wc(e))}var Hx=function(e,t){return y(e,fd(t))},CJ=Km,EJ=Om,RJ={URI:Nn,of:Na,map:si,mapWithIndex:$S,ap:pd,chain:TS,extend:kx,extract:xS,reduce:hd,foldMap:md,reduceRight:vd,traverse:IS,sequence:Gm,reduceWithIndex:OS,foldMapWithIndex:wS,reduceRightWithIndex:CS,traverseWithIndex:Nx,alt:Ax};const MJ=Object.freeze(Object.defineProperty({__proto__:null,Alt:cJ,Applicative:nJ,Apply:Jm,Chain:AS,Comonad:lJ,Do:fJ,Foldable:oJ,FoldableWithIndex:aJ,Functor:kS,FunctorWithIndex:QY,Monad:iJ,Pointed:XY,Traversable:uJ,TraversableWithIndex:sJ,URI:Nn,alt:Px,altW:Fx,ap:Wx,apFirst:eJ,apS:hJ,apSecond:tJ,append:fd,appendW:pS,bind:pJ,bindTo:dJ,chain:Hm,chainFirst:rJ,chainWithIndex:Mx,chop:SS,chunksOf:xx,concat:zm,concatAll:gJ,concatW:$x,cons:Vx,copy:jc,duplicate:KY,extend:ES,extract:xS,filter:IJ,filterWithIndex:Kx,flap:ZY,flatten:VY,fold:EJ,foldMap:Rx,foldMapWithIndex:Ex,fromArray:bS,fromReadonlyNonEmptyArray:dd,getEq:YY,getSemigroup:GY,getShow:HY,getUnionSemigroup:JY,group:Tx,groupBy:qY,groupSort:TJ,head:jr,init:Dc,insertAt:UY,intercalate:$J,intersperse:Cx,isNonEmpty:Eo,isOutOfBound:Um,last:Lc,makeBy:Bm,map:RS,mapWithIndex:MS,matchLeft:yJ,matchRight:bJ,max:vJ,min:mJ,modifyAt:Ix,modifyHead:Bx,modifyLast:zx,nonEmptyArray:RJ,of:Na,prepend:Wc,prependAll:Km,prependToAll:CJ,prependW:dS,range:bx,reduce:jx,reduceRight:Dx,reduceRightWithIndex:qx,reduceWithIndex:Lx,replicate:LY,reverse:DY,rotate:yS,sequence:Gm,snoc:Hx,sort:_S,sortBy:yx,splitAt:Vm,tail:ci,traverse:Ux,traverseWithIndex:Ym,unappend:Sx,uncons:OJ,union:gS,uniq:vS,unprepend:_x,unsafeInsertAt:hS,unsafeUpdateAt:mS,unsnoc:wJ,unzip:zY,updateAt:BY,updateHead:_J,updateLast:SJ,zip:wx,zipWith:Ox},Symbol.toStringTag,{value:"Module"}));var xJ=function(e){return typeof e=="number"},NS={equals:function(e,t){return e===t}},Zm={equals:NS.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},kJ={equals:NS.equals,compare:Zm.compare,top:1/0,bottom:-1/0},AJ={show:function(e){return JSON.stringify(e)}},Gx={concat:function(e,t){return e-t}},FS={concat:function(e,t){return e+t}},PS={concat:function(e,t){return e*t}},NJ={concat:FS.concat,empty:0},FJ={concat:PS.concat,empty:1},PJ={add:FS.concat,zero:0,mul:PS.concat,one:1,sub:Gx.concat,degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const WJ=Object.freeze(Object.defineProperty({__proto__:null,Bounded:kJ,Eq:NS,Field:PJ,MagmaSub:Gx,MonoidProduct:FJ,MonoidSum:NJ,Ord:Zm,SemigroupProduct:PS,SemigroupSum:FS,Show:AJ,isNumber:xJ},Symbol.toStringTag,{value:"Module"}));function qc(e,t){return function(n){return n?t.of(void 0):e.zero()}}const jJ=Object.freeze(Object.defineProperty({__proto__:null,guard:qc},Symbol.toStringTag,{value:"Module"}));var LJ=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Gi=function(e){return e.length===0},xt=zi,DJ=Mc,qJ=w_,Xm=pm,UJ=C_,Yx=function(e,t){return e<=0?$t:mm(t)(e)},BJ=function(e,t){return Yx(e,function(){return t})};function zJ(e){return function(t){return e(t)?[t]:$t}}var Jx=function(e){return Wt(e)?$t:[e.value]},Zx=function(e){return Gt(e)?$t:[e.right]},Xx=function(e,t){return function(n){return xt(n)?t(n):e()}},Qx=Xx,ek=function(e,t){return function(n){return xt(n)?t(An(n),ii(n)):e()}},tk=ek,KJ=tk,nk=function(e,t){return function(n){return xt(n)?t(xc(n),ka(n)):e()}},rk=nk,VJ=rk,ik=function(e){return function(t){if(Gi(t))return $t;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},HJ=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[0]=e;for(var o=0;o<r;o++)i[o+1]=t(i[o],n[o]);return i}},GJ=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[r]=e;for(var o=r-1;o>=0;o--)i[o]=t(n[o],i[o+1]);return i}},YJ=function(e){return e.length},Uc=dm;function Ju(e,t){return t===void 0?function(n){return Ju(e,n)}:Uc(e,t)?be:pe(t[e])}var ok=function(e){return xt(e)?pe(An(e)):be},WS=function(e){return xt(e)?pe(ka(e)):be},JJ=function(e){return xt(e)?pe(ii(e)):be},ZJ=function(e){return xt(e)?pe(xc(e)):be},XJ=function(e){return function(t){return Uc(e,t)?t:e===0?$t:t.slice(0,e)}},QJ=function(e){return function(t){return Uc(e,t)?t:e===0?$t:t.slice(-e)}};function e7(e){return function(t){for(var n=[],r=0,i=t;r<i.length;r++){var o=i[r];if(!e(o))break;n.push(o)}var a=n.length;return a===t.length?t:a===0?$t:n}}var ak=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function t7(e){return function(t){var n=jS(ak(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var n7=function(e){return function(t){return e<=0||Gi(t)?t:e>=t.length?$t:t.slice(e,t.length)}},r7=function(e){return function(t){return e<=0||Gi(t)?t:e>=t.length?$t:t.slice(0,t.length-e)}};function i7(e){return function(t){var n=ak(t,e);return n===0?t:n===t.length?$t:t.slice(n)}}var Qm=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return pe(n);return be}};function ev(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return pe(t[n]);return be}}var uk=function(e){return function(t){for(var n=0;n<t.length;n++){var r=e(t[n]);if(bt(r))return r}return be}};function sk(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return pe(t[n]);return be}}var ck=function(e){return function(t){for(var n=t.length-1;n>=0;n--){var r=e(t[n]);if(bt(r))return r}return be}},lk=function(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return pe(n);return be}},o7=function(e,t){return function(n){return e<0||e>n.length?be:pe(hm(e,t,n))}},a7=function(e,t){return fk(e,function(){return t})},u7=function(e){return function(t){return Uc(e,t)?be:pe(Lk(e,t))}},fk=function(e,t){return function(n){return Uc(e,n)?be:pe(dv(e,t(n[e]),n))}},s7=function(e){return e.length<=1?e:e.slice().reverse()},c7=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},l7=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},f7=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}},dk=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r};function pk(e,t){return t===void 0?function(n){return pk(n,e)}:dk(e,t,function(n,r){return[n,r]})}var d7=function(e){for(var t=[],n=[],r=0;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},hk=function(e){var t=vm(e);return function(n){return xt(n)?t(n):n}},p7=function(e){var t=A_(e);return function(n){return xt(n)?t(n):n}},h7=function(e){var t=x_(e);return function(n){return xt(n)?t(n):n}};function gd(e){return function(t,n){if(n===void 0){var r=gd(e);return function(a){return r(t,a)}}for(var i=function(a){return e.equals(a,t)},o=0;o<n.length;o++)if(i(n[o]))return!0;return!1}}var m7=function(e){var t=R_(e);return function(n){return xt(n)?t(n):n}},v7=function(e){var t=wM(e);return function(n){return xt(n)?t(n):n}},g7=function(e){var t=N_(e);return function(n){return xt(n)?t(n):$t}},jS=function(e){return function(t){return e>=1&&xt(t)?gm(e)(t):Gi(t)?[t,$t]:[$t,t]}},y7=function(e){var t=PM(e);return function(n){return xt(n)?t(n):$t}},b7=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Jx(e.apply(void 0,t))}};function _7(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return xt(o)?y(An(o),bd(function(a){return r(y(i,Xm(a)),ii(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:$t};return r($t,e)}var mk=function(e){return function(t){return Gi(t)?e:Gi(e)?t:t.concat(e)}},S7=mk;function LS(e){var t=M_(e);return function(n,r){if(r===void 0){var i=LS(e);return function(o){return i(o,n)}}return xt(n)&&xt(r)?t(r)(n):xt(n)?n:r}}function DS(e){var t=gd(e);return function(n,r){if(r===void 0){var i=DS(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function qS(e){var t=gd(e);return function(n,r){if(r===void 0){var i=qS(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var an=function(e,t){return y(e,uv(t))},tv=function(e,t){return y(e,Ok(t))},Fa=function(e,t){return y(e,Ik(t))},yd=function(e,t){return y(e,bd(t))},nv=function(e,t){return y(e,li(t))},rv=function(e,t){return y(e,JS(t))},iv=function(e,t){return y(e,wk(t))},ov=function(e,t){return y(e,Ck(t))},vk=function(e,t){return y(e,ZS(t))},gk=function(e,t){return y(e,XS(t))},US=function(e,t){return y(e,Tk(t))},Zu=function(e,t,n){return y(e,cv(t,n))},Bc=function(e){var t=e$(e);return function(n,r){return y(n,t(r))}},zc=function(e,t,n){return y(e,t$(t,n))},BS=function(e,t,n){return y(e,_d(t,n))},zS=function(e){var t=sv(e);return function(n,r){return y(n,t(r))}},KS=function(e,t,n){return y(e,lv(t,n))},yk=function(e,t){return y(e,YS(t))},bk=function(e,t){return y(e,Ek(t))},_k=function(e,t){return y(e,QS(t))},av=function(e){var t=Rk(e);return function(n,r){return y(n,t(r))}},Sk=function(e){var t=n$(e);return function(n,r){return y(n,t(r))}},VS=function(e,t){return y(e,s$(t))},HS=function(e,t){return y(e,c$(t))},Xu=xa,Kc=function(){return $t},$k=function(e){return function(t){return t.concat(e())}},Tk=$k,Ik=function(e){return bd(function(t){return y(e,uv(t))})},bd=function(e){return function(t){return y(t,ik(function(n,r){return e(r)}))}},GS=bd(D),uv=function(e){return function(t){return t.map(function(n){return e(n)})}},Ok=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},Vc=function(e){for(var t=[],n=[],r=0,i=e;r<i.length;r++){var o=i[r];o._tag==="Left"?t.push(o.left):n.push(o.right)}return Me(t,n)},li=function(e){return function(t){return t.filter(e)}},YS=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);bt(i)&&n.push(i.value)}return n}},JS=function(e){return YS(function(t,n){return e(n)})},Hc=JS(D),wk=function(e){return ZS(function(t,n){return e(n)})},ZS=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return Me(n,r)}},Ck=function(e){return XS(function(t,n){return e(n)})},XS=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);o._tag==="Left"?n.push(o.left):r.push(o.right)}return Me(n,r)}},Ek=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},QS=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},$7=QS(D),sv=function(e){return function(t){return function(n){return n.reduce(function(r,i,o){return e.concat(r,t(o,i))},e.empty)}}},cv=function(e,t){return _d(e,function(n,r,i){return t(r,i)})},e$=function(e){var t=sv(e);return function(n){return t(function(r,i){return n(i)})}},_d=function(e,t){return function(n){for(var r=n.length,i=e,o=0;o<r;o++)i=t(o,i,n[o]);return i}},t$=function(e,t){return lv(e,function(n,r,i){return t(r,i)})},lv=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},Rk=function(e){var t=n$(e);return function(n){return t(function(r,i){return n(i)})}},Sd=function(e){return function(t){return Zu(t,e.of(Kc()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return y(i,Xm(o))}}),r)})}},n$=function(e){return function(t){return _d(e.of(Kc()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return y(o,Xm(a))}}),t(n,i))})}},T7=function(e){var t=l$(e);return function(n){return function(r){return t(r,n)}}},I7=function(e){var t=f$(e);return function(n){return function(r){return t(r,n)}}},r$=function(e,t){for(var n=[],r=e;;){var i=t(r);if(bt(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},dt="ReadonlyArray",Mk=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},xk=function(){return{concat:function(e,t){return Gi(e)?t:Gi(t)?e:e.concat(t)}}},O7=function(){return{concat:xk().concat,empty:$t}},kk=function(e){return Pr(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},Ak=function(e){return Wu(function(t,n){for(var r=t.length,i=n.length,o=Math.min(r,i),a=0;a<o;a++){var u=e.compare(t[a],n[a]);if(u!==0)return u}return Zm.compare(r,i)})},Nk=function(e){var t=LS(e);return{concat:function(n,r){return t(r)(n)}}},w7=function(e){return{concat:Nk(e).concat,empty:$t}},C7=function(e){var t=DS(e);return{concat:function(n,r){return t(r)(n)}}},E7=function(e){var t=qS(e);return{concat:function(n,r){return t(r)(n)}}},i$={URI:dt,map:an},R7=Ke(i$),Fk={URI:dt,of:Xu},M7={URI:dt,map:an,mapWithIndex:tv},fv={URI:dt,map:an,ap:Fa},x7=Ct(fv),k7=Et(fv),A7={URI:dt,map:an,ap:Fa,of:Xu},o$={URI:dt,map:an,ap:Fa,chain:yd},N7={URI:dt,map:an,ap:Fa,of:Xu,chain:yd},F7=ft(o$),P7={URI:dt,unfold:r$},W7={URI:dt,map:an,alt:US},Pk={URI:dt,zero:Kc},j7=qc(Pk,Fk),L7={URI:dt,map:an,ap:Fa,of:Xu,alt:US,zero:Kc},D7={URI:dt,map:an,extend:_k},a$={URI:dt,compact:Hc,separate:Vc},q7={URI:dt,map:an,compact:Hc,separate:Vc,filter:nv,filterMap:rv,partition:iv,partitionMap:ov},U7={URI:dt,map:an,mapWithIndex:tv,compact:Hc,separate:Vc,filter:nv,filterMap:rv,partition:iv,partitionMap:ov,partitionMapWithIndex:gk,partitionWithIndex:vk,filterMapWithIndex:yk,filterWithIndex:bk},B7={URI:dt,reduce:Zu,foldMap:Bc,reduceRight:zc},z7={URI:dt,reduce:Zu,foldMap:Bc,reduceRight:zc,reduceWithIndex:BS,foldMapWithIndex:zS,reduceRightWithIndex:KS},u$={URI:dt,map:an,reduce:Zu,foldMap:Bc,reduceRight:zc,traverse:av,sequence:Sd},K7={URI:dt,map:an,mapWithIndex:tv,reduce:Zu,foldMap:Bc,reduceRight:zc,reduceWithIndex:BS,foldMapWithIndex:zS,reduceRightWithIndex:KS,traverse:av,sequence:Sd,traverseWithIndex:Sk},s$=function(e){return function(t){for(var n=LJ([],e(t),!0),r=[];n.length>0;){var i=n.shift();Gt(i)?n.unshift.apply(n,e(i.left)):r.push(i.right)}return r}},V7={URI:dt,map:an,ap:Fa,chain:yd,chainRec:VS},c$=function(e){return function(t){var n=e(t),r=[],i=[];function o(c){Gt(c)?e(c.left).forEach(function(l){return r.push(l)}):i.push(c.right)}for(var a=0,u=n;a<u.length;a++){var s=u[a];o(s)}for(;r.length>0;)o(r.shift());return i}},H7={URI:dt,map:an,ap:Fa,chain:yd,chainRec:HS},l$=ai(u$,a$),f$=oi(u$,a$),Wk={URI:dt,map:an,compact:Hc,separate:Vc,filter:nv,filterMap:rv,partition:iv,partitionMap:ov,reduce:Zu,foldMap:Bc,reduceRight:zc,traverse:av,sequence:Sd,wither:l$,wilt:f$},G7=Z_(Wk),jk={URI:dt,fromEither:Zx},Y7=gr(jk),J7=hm,dv=function(e,t,n){return xt(n)?E_(e,t,n):n},Lk=function(e,t){var n=t.slice();return n.splice(e,1),n},Z7=function(e){return e.slice()},X7=function(e){return Gi(e)?$t:e.slice()},$t=Jf;function Dk(e){return function(t){return t.every(e)}}var qk=function(e){return function(t){return t.some(e)}},Q7=qk,Uk=function(e){var t=J_(e);return function(n){return Qx(function(){return e.empty},t(n))}},eZ=Xu(Yt),tZ=wt(i$),nZ=Mt(o$),rZ=Rt(fv),iZ=CM,oZ=ZM,aZ=XM,uZ=hk,sZ={URI:dt,compact:Hc,separate:Vc,map:an,ap:Fa,of:Xu,chain:yd,filter:nv,filterMap:rv,partition:iv,partitionMap:ov,mapWithIndex:tv,partitionMapWithIndex:gk,partitionWithIndex:vk,filterMapWithIndex:yk,filterWithIndex:bk,alt:US,zero:Kc,unfold:r$,reduce:Zu,foldMap:Bc,reduceRight:zc,traverse:av,sequence:Sd,reduceWithIndex:BS,foldMapWithIndex:zS,reduceRightWithIndex:KS,traverseWithIndex:Sk,extend:_k,wither:l$,wilt:f$};const cZ=Object.freeze(Object.defineProperty({__proto__:null,Alt:W7,Alternative:L7,Applicative:A7,Apply:fv,Chain:o$,ChainRecBreadthFirst:H7,ChainRecDepthFirst:V7,Compactable:a$,Do:eZ,Extend:D7,Filterable:q7,FilterableWithIndex:U7,Foldable:B7,FoldableWithIndex:z7,FromEither:jk,Functor:i$,FunctorWithIndex:M7,Monad:N7,Pointed:Fk,Traversable:u$,TraversableWithIndex:K7,URI:dt,Unfoldable:P7,Witherable:Wk,Zero:Pk,_chainRecBreadthFirst:HS,_chainRecDepthFirst:VS,alt:Tk,altW:$k,ap:Ik,apFirst:x7,apS:rZ,apSecond:k7,append:Xm,appendW:UJ,bind:nZ,bindTo:tZ,chain:bd,chainFirst:F7,chainRecBreadthFirst:c$,chainRecDepthFirst:s$,chainWithIndex:ik,chop:g7,chunksOf:y7,compact:Hc,comprehension:_7,concat:S7,concatW:mk,cons:oZ,deleteAt:u7,difference:qS,dropLeft:n7,dropLeftWhile:i7,dropRight:r7,duplicate:$7,elem:gd,empty:$t,every:Dk,exists:Q7,extend:QS,filter:li,filterE:G7,filterMap:JS,filterMapWithIndex:YS,filterWithIndex:Ek,findFirst:ev,findFirstMap:uk,findIndex:Qm,findLast:sk,findLastIndex:lk,findLastMap:ck,flap:R7,flatten:GS,foldLeft:KJ,foldMap:e$,foldMapWithIndex:sv,foldRight:VJ,fromArray:X7,fromEither:Zx,fromEitherK:Y7,fromOption:Jx,fromOptionK:b7,fromPredicate:zJ,getDifferenceMagma:E7,getEq:kk,getIntersectionSemigroup:C7,getMonoid:O7,getOrd:Ak,getSemigroup:xk,getShow:Mk,getUnionMonoid:w7,getUnionSemigroup:Nk,guard:j7,head:ok,init:ZJ,insertAt:o7,intercalate:Uk,intersection:DS,intersperse:p7,isEmpty:Gi,isNonEmpty:xt,isOutOfBound:Uc,last:WS,lefts:l7,lookup:Ju,makeBy:Yx,map:uv,mapWithIndex:Ok,match:Qx,matchLeft:tk,matchLeftW:ek,matchRight:rk,matchRightW:nk,matchW:Xx,modifyAt:fk,of:Xu,partition:wk,partitionMap:Ck,partitionMapWithIndex:XS,partitionWithIndex:ZS,prepend:DJ,prependAll:hk,prependToAll:uZ,prependW:qJ,range:iZ,readonlyArray:sZ,reduce:cv,reduceRight:t$,reduceRightWithIndex:lv,reduceWithIndex:_d,replicate:BJ,reverse:s7,rights:c7,rotate:h7,scanLeft:HJ,scanRight:GJ,separate:Vc,sequence:Sd,size:YJ,snoc:aZ,some:qk,sort:f7,sortBy:v7,spanLeft:t7,splitAt:jS,tail:JJ,takeLeft:XJ,takeLeftWhile:e7,takeRight:QJ,toArray:Z7,traverse:Rk,traverseWithIndex:n$,unfold:r$,union:LS,uniq:m7,unsafeDeleteAt:Lk,unsafeInsertAt:J7,unsafeUpdateAt:dv,unzip:d7,updateAt:a7,wilt:I7,wither:T7,zero:Kc,zip:pk,zipWith:dk},Symbol.toStringTag,{value:"Module"}));var Pa=function(e){return e.length===0},jt=Eo,lZ=Wc,fZ=dS,pv=fd,dZ=pS,Bk=function(e,t){return e<=0?[]:Bm(t)(e)},pZ=function(e,t){return Bk(e,function(){return t})};function hZ(e){return function(t){return e(t)?[t]:[]}}var zk=function(e){return Wt(e)?[]:[e.value]},Kk=function(e){return Gt(e)?[]:[e.right]},Vk=function(e,t){return function(n){return jt(n)?t(n):e()}},mZ=Vk,Hk=function(e,t){return function(n){return jt(n)?t(jr(n),ci(n)):e()}},Gk=Hk,vZ=Gk,Yk=function(e,t){return function(n){return jt(n)?t(Dc(n),Lc(n)):e()}},Jk=Yk,gZ=Jk,Zk=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},yZ=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[0]=e;for(var o=0;o<r;o++)i[o+1]=t(i[o],n[o]);return i}},bZ=function(e,t){return function(n){var r=n.length,i=new Array(r+1);i[r]=e;for(var o=r-1;o>=0;o--)i[o]=t(n[o],i[o+1]);return i}},_Z=function(e){return e.length},$d=Um,SZ=Ju,$Z=ok,TZ=WS,IZ=function(e){return jt(e)?pe(ci(e)):be},OZ=function(e){return jt(e)?pe(Dc(e)):be},wZ=function(e){return function(t){return $d(e,t)?$n(t):t.slice(0,e)}},CZ=function(e){return function(t){return $d(e,t)?$n(t):e===0?[]:t.slice(-e)}};function EZ(e){return function(t){for(var n=[],r=0,i=t;r<i.length;r++){var o=i[r];if(!e(o))break;n.push(o)}return n}}var Xk=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function RZ(e){return function(t){var n=rA(Xk(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var MZ=function(e){return function(t){return e<=0||Pa(t)?$n(t):e>=t.length?[]:t.slice(e,t.length)}},xZ=function(e){return function(t){return e<=0||Pa(t)?$n(t):e>=t.length?[]:t.slice(0,t.length-e)}};function kZ(e){return function(t){return t.slice(Xk(t,e))}}var AZ=Qm;function NZ(e){return ev(e)}var FZ=uk;function PZ(e){return sk(e)}var WZ=ck,jZ=lk,$n=function(e){return e.slice()},LZ=function(e,t){return function(n){return e<0||e>n.length?be:pe(kA(e,t,n))}},DZ=function(e,t){return Qk(e,function(){return t})},qZ=function(e){return function(t){return $d(e,t)?be:pe(NA(e,t))}},Qk=function(e,t){return function(n){return $d(e,n)?be:pe(AA(e,t(n[e]),n))}},UZ=function(e){return Pa(e)?[]:e.slice().reverse()},BZ=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},zZ=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},KZ=function(e){return function(t){return t.length<=1?$n(t):t.slice().sort(e.compare)}},eA=function(e,t,n){for(var r=[],i=Math.min(e.length,t.length),o=0;o<i;o++)r[o]=n(e[o],t[o]);return r};function tA(e,t){return t===void 0?function(n){return tA(n,e)}:eA(e,t,function(n,r){return[n,r]})}var VZ=function(e){for(var t=[],n=[],r=0;r<e.length;r++)t[r]=e[r][0],n[r]=e[r][1];return[t,n]},nA=function(e){var t=Km(e);return function(n){return jt(n)?t(n):[]}},HZ=function(e){var t=Cx(e);return function(n){return jt(n)?t(n):$n(n)}},GZ=function(e){var t=yS(e);return function(n){return jt(n)?t(n):$n(n)}},d$=gd,YZ=function(e){var t=vS(e);return function(n){return jt(n)?t(n):$n(n)}},JZ=function(e){var t=yx(e);return function(n){return jt(n)?t(n):$n(n)}},ZZ=function(e){var t=SS(e);return function(n){return jt(n)?t(n):[]}},rA=function(e){return function(t){return e>=1&&jt(t)?Vm(e)(t):Pa(t)?[$n(t),[]]:[[],$n(t)]}},XZ=function(e){var t=xx(e);return function(n){return jt(n)?t(n):[]}},QZ=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return zk(e.apply(void 0,t))}};function e8(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return jt(o)?y(jr(o),Id(function(a){return r(y(i,pv(a)),ci(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:[]};return r([],e)}var iA=function(e){return function(t){return Pa(t)?$n(e):Pa(e)?$n(t):t.concat(e)}},t8=iA;function p$(e){var t=gS(e);return function(n,r){if(r===void 0){var i=p$(e);return function(o){return i(o,n)}}return jt(n)&&jt(r)?t(r)(n):jt(n)?$n(n):$n(r)}}function h$(e){var t=d$(e);return function(n,r){if(r===void 0){var i=h$(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function m$(e){var t=d$(e);return function(n,r){if(r===void 0){var i=m$(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var un=function(e,t){return y(e,_$(t))},hv=function(e,t){return y(e,dA(t))},Wa=function(e,t){return y(e,fA(t))},Td=function(e,t){return y(e,Id(t))},mv=function(e,t){return y(e,pA(t))},vv=function(e,t){return y(e,T$(t))},gv=function(e,t){return y(e,hA(t))},yv=function(e,t){return y(e,mA(t))},oA=function(e,t){return y(e,I$(t))},aA=function(e,t){return y(e,O$(t))},v$=function(e,t){return y(e,gA(t))},Qu=function(e,t,n){return y(e,SA(t,n))},Gc=function(e){var t=bA(e);return function(n,r){return y(n,t(r))}},Yc=function(e,t,n){return y(e,$A(t,n))},g$=function(e,t,n){return y(e,C$(t,n))},y$=function(e){var t=_A(e);return function(n,r){return y(n,t(r))}},b$=function(e,t,n){return y(e,TA(t,n))},uA=function(e,t){return y(e,$$(t))},sA=function(e,t){return y(e,yA(t))},cA=function(e,t){return y(e,w$(t))},bv=function(e){var t=_v(e);return function(n,r){return y(n,t(r))}},lA=function(e){var t=E$(e);return function(n,r){return y(n,t(r))}},n8=VS,r8=HS,ja=Na,Jc=function(){return[]},_$=function(e){return function(t){return t.map(function(n){return e(n)})}},fA=function(e){return Id(function(t){return y(e,_$(t))})},Id=function(e){return function(t){return y(t,Zk(function(n,r){return e(r)}))}},S$=Id(D),dA=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},$$=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);bt(i)&&n.push(i.value)}return n}},T$=function(e){return $$(function(t,n){return e(n)})},Zc=T$(D),Xc=function(e){for(var t=[],n=[],r=0,i=e;r<i.length;r++){var o=i[r];o._tag==="Left"?t.push(o.left):n.push(o.right)}return Me(t,n)},pA=function(e){return function(t){return t.filter(e)}},hA=function(e){return I$(function(t,n){return e(n)})},I$=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i];e(i,o)?r.push(o):n.push(o)}return Me(n,r)}},mA=function(e){return O$(function(t,n){return e(n)})},O$=function(e){return function(t){for(var n=[],r=[],i=0;i<t.length;i++){var o=e(i,t[i]);o._tag==="Left"?n.push(o.left):r.push(o.right)}return Me(n,r)}},vA=function(e){return function(t){return t.concat(e())}},gA=vA,yA=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},w$=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},i8=w$(D),bA=e$,_A=sv,SA=cv,C$=_d,$A=t$,TA=lv,_v=function(e){var t=E$(e);return function(n){return t(function(r,i){return n(i)})}},Od=function(e){return function(t){return Qu(t,e.of(Jc()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return y(i,pv(o))}}),r)})}},E$=function(e){return function(t){return C$(e.of(Jc()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return y(o,pv(a))}}),t(n,i))})}},o8=function(e){var t=F$(e);return function(n){return function(r){return t(r,n)}}},a8=function(e){var t=P$(e);return function(n){return function(r){return t(r,n)}}},R$=function(e,t){for(var n=[],r=e;;){var i=t(r);if(bt(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},pt="Array",u8=Mk,IA=function(){return{concat:function(e,t){return e.concat(t)}}},M$=function(){return{concat:IA().concat,empty:[]}},OA=kk,s8=Ak,wA=function(e){var t=p$(e);return{concat:function(n,r){return t(r)(n)}}},c8=function(e){return{concat:wA(e).concat,empty:[]}},l8=function(e){var t=h$(e);return{concat:function(n,r){return t(r)(n)}}},f8=function(e){var t=m$(e);return{concat:function(n,r){return t(r)(n)}}},x$={URI:pt,map:un},d8=Ke(x$),CA={URI:pt,of:ja},p8={URI:pt,map:un,mapWithIndex:hv},Sv={URI:pt,map:un,ap:Wa},h8=Ct(Sv),m8=Et(Sv),v8={URI:pt,map:un,ap:Wa,of:ja},k$={URI:pt,map:un,ap:Wa,chain:Td},g8=ft(k$),y8={URI:pt,map:un,ap:Wa,of:ja,chain:Td},b8={URI:pt,unfold:R$},_8={URI:pt,map:un,alt:v$},EA={URI:pt,zero:Jc},S8=qc(EA,CA),$8={URI:pt,map:un,ap:Wa,of:ja,alt:v$,zero:Jc},T8={URI:pt,map:un,extend:cA},A$={URI:pt,compact:Zc,separate:Xc},I8={URI:pt,map:un,compact:Zc,separate:Xc,filter:mv,filterMap:vv,partition:gv,partitionMap:yv},O8={URI:pt,map:un,mapWithIndex:hv,compact:Zc,separate:Xc,filter:mv,filterMap:vv,partition:gv,partitionMap:yv,partitionMapWithIndex:aA,partitionWithIndex:oA,filterMapWithIndex:uA,filterWithIndex:sA},RA={URI:pt,reduce:Qu,foldMap:Gc,reduceRight:Yc},w8={URI:pt,reduce:Qu,foldMap:Gc,reduceRight:Yc,reduceWithIndex:g$,foldMapWithIndex:y$,reduceRightWithIndex:b$},N$={URI:pt,map:un,reduce:Qu,foldMap:Gc,reduceRight:Yc,traverse:bv,sequence:Od},C8={URI:pt,map:un,mapWithIndex:hv,reduce:Qu,foldMap:Gc,reduceRight:Yc,reduceWithIndex:g$,foldMapWithIndex:y$,reduceRightWithIndex:b$,traverse:bv,sequence:Od,traverseWithIndex:lA},F$=ai(N$,A$),P$=oi(N$,A$),MA={URI:pt,map:un,compact:Zc,separate:Xc,filter:mv,filterMap:vv,partition:gv,partitionMap:yv,reduce:Qu,foldMap:Gc,reduceRight:Yc,traverse:bv,sequence:Od,wither:F$,wilt:P$},E8=s$,R8={URI:pt,map:un,ap:Wa,chain:Td,chainRec:n8},M8=c$,x8={URI:pt,map:un,ap:Wa,chain:Td,chainRec:r8},k8=Z_(MA),xA={URI:pt,fromEither:Kk},A8=gr(xA),kA=hS,AA=function(e,t,n){return jt(n)?mS(e,t,n):[]},NA=function(e,t){var n=t.slice();return n.splice(e,1),n},N8=Dk,FA=function(e){return function(t){return t.some(e)}},F8=FA,P8=Uk,W8=ja(Yt),j8=wt(x$),L8=Mt(k$),D8=Rt(Sv),q8=bx,U8=[],B8=Vx,z8=Hx,K8=nA,V8={URI:pt,compact:Zc,separate:Xc,map:un,ap:Wa,of:ja,chain:Td,filter:mv,filterMap:vv,partition:gv,partitionMap:yv,mapWithIndex:hv,partitionMapWithIndex:aA,partitionWithIndex:oA,filterMapWithIndex:uA,filterWithIndex:sA,alt:v$,zero:Jc,unfold:R$,reduce:Qu,foldMap:Gc,reduceRight:Yc,traverse:bv,sequence:Od,reduceWithIndex:g$,foldMapWithIndex:y$,reduceRightWithIndex:b$,traverseWithIndex:lA,extend:cA,wither:F$,wilt:P$};const H8=Object.freeze(Object.defineProperty({__proto__:null,Alt:_8,Alternative:$8,Applicative:v8,Apply:Sv,Chain:k$,ChainRecBreadthFirst:x8,ChainRecDepthFirst:R8,Compactable:A$,Do:W8,Extend:T8,Filterable:I8,FilterableWithIndex:O8,Foldable:RA,FoldableWithIndex:w8,FromEither:xA,Functor:x$,FunctorWithIndex:p8,Monad:y8,Pointed:CA,Traversable:N$,TraversableWithIndex:C8,URI:pt,Unfoldable:b8,Witherable:MA,Zero:EA,alt:gA,altW:vA,ap:fA,apFirst:h8,apS:D8,apSecond:m8,append:pv,appendW:dZ,array:V8,bind:L8,bindTo:j8,chain:Id,chainFirst:g8,chainRecBreadthFirst:M8,chainRecDepthFirst:E8,chainWithIndex:Zk,chop:ZZ,chunksOf:XZ,compact:Zc,comprehension:e8,concat:t8,concatW:iA,cons:B8,copy:$n,deleteAt:qZ,difference:m$,dropLeft:MZ,dropLeftWhile:kZ,dropRight:xZ,duplicate:i8,elem:d$,empty:U8,every:N8,exists:F8,extend:w$,filter:pA,filterE:k8,filterMap:T$,filterMapWithIndex:$$,filterWithIndex:yA,findFirst:NZ,findFirstMap:FZ,findIndex:AZ,findLast:PZ,findLastIndex:jZ,findLastMap:WZ,flap:d8,flatten:S$,foldLeft:vZ,foldMap:bA,foldMapWithIndex:_A,foldRight:gZ,fromEither:Kk,fromEitherK:A8,fromOption:zk,fromOptionK:QZ,fromPredicate:hZ,getDifferenceMagma:f8,getEq:OA,getIntersectionSemigroup:l8,getMonoid:M$,getOrd:s8,getSemigroup:IA,getShow:u8,getUnionMonoid:c8,getUnionSemigroup:wA,guard:S8,head:$Z,init:OZ,insertAt:LZ,intercalate:P8,intersection:h$,intersperse:HZ,isEmpty:Pa,isNonEmpty:jt,isOutOfBound:$d,last:TZ,lefts:zZ,lookup:SZ,makeBy:Bk,map:_$,mapWithIndex:dA,match:mZ,matchLeft:Gk,matchLeftW:Hk,matchRight:Jk,matchRightW:Yk,matchW:Vk,modifyAt:Qk,of:ja,partition:hA,partitionMap:mA,partitionMapWithIndex:O$,partitionWithIndex:I$,prepend:lZ,prependAll:nA,prependToAll:K8,prependW:fZ,range:q8,reduce:SA,reduceRight:$A,reduceRightWithIndex:TA,reduceWithIndex:C$,replicate:pZ,reverse:UZ,rights:BZ,rotate:GZ,scanLeft:yZ,scanRight:bZ,separate:Xc,sequence:Od,size:_Z,snoc:z8,some:FA,sort:KZ,sortBy:JZ,spanLeft:RZ,splitAt:rA,tail:IZ,takeLeft:wZ,takeLeftWhile:EZ,takeRight:CZ,traverse:_v,traverseWithIndex:E$,unfold:R$,union:p$,uniq:YZ,unsafeDeleteAt:NA,unsafeInsertAt:kA,unsafeUpdateAt:AA,unzip:VZ,updateAt:DZ,wilt:a8,wither:o8,zero:Jc,zip:tA,zipWith:eA},Symbol.toStringTag,{value:"Module"})),G8=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Y8=function(e){return typeof e=="boolean"},PA=function(e,t){return function(n){return n?t():e()}},WA=PA,jA=WA,J8=jA,LA={equals:function(e,t){return e===t}},Z8={meet:function(e,t){return e&&t},join:function(e,t){return e||t},zero:!1,one:!0,implies:function(e,t){return!e||t},not:function(e){return!e}},DA={concat:function(e,t){return e&&t}},qA={concat:function(e,t){return e||t}},X8={concat:DA.concat,empty:!0},Q8={concat:qA.concat,empty:!1},eX={equals:LA.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},tX={show:function(e){return JSON.stringify(e)}};const nX=Object.freeze(Object.defineProperty({__proto__:null,BooleanAlgebra:Z8,Eq:LA,MonoidAll:X8,MonoidAny:Q8,Ord:eX,SemigroupAll:DA,SemigroupAny:qA,Show:tX,fold:J8,foldW:WA,isBoolean:Y8,match:jA,matchW:PA},Symbol.toStringTag,{value:"Module"}));var UA=function(e){return{meet:function(t,n){return e.join(t,n)},join:function(t,n){return e.meet(t,n)},zero:e.one,one:e.zero,implies:function(t,n){return e.join(e.not(t),n)},not:e.not}},rX={meet:function(){},join:function(){},zero:void 0,one:void 0,implies:function(){},not:function(){}},iX=UA,oX={meet:function(e,t){return e&&t},join:function(e,t){return e||t},zero:!1,one:!0,implies:function(e,t){return!e||t},not:function(e){return!e}},aX=KR;const uX=Object.freeze(Object.defineProperty({__proto__:null,booleanAlgebraBoolean:oX,booleanAlgebraVoid:rX,getDualBooleanAlgebra:iX,getFunctionBooleanAlgebra:aX,reverse:UA},Symbol.toStringTag,{value:"Module"}));var sX=function(e){return mM(e)(e.bottom,e.top)},cX=function(e){var t=g_(e);return{equals:t.equals,compare:t.compare,top:e.bottom,bottom:e.top}},lX={equals:sm.equals,compare:sm.compare,top:1/0,bottom:-1/0};const fX=Object.freeze(Object.defineProperty({__proto__:null,boundedNumber:lX,clamp:sX,reverse:cX},Symbol.toStringTag,{value:"Module"}));function BA(e){return{meet:am(e),join:um(e)}}const dX=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:BA},Symbol.toStringTag,{value:"Module"}));function pX(e){var t=BA(e);return function(n,r){return{join:t.join,meet:t.meet,zero:n,one:r}}}const hX=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:pX},Symbol.toStringTag,{value:"Module"})),mX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),vX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),gX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),yX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var W$=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};const bX=Object.freeze(Object.defineProperty({__proto__:null,tailRec:W$},Symbol.toStringTag,{value:"Module"}));function j$(e,t){return function(n,r){return t.compose(e.right(r),e.left(n))}}function zA(e,t){var n=j$(e,t);return function(r,i){return t.compose(e.promap(t.id(),function(o){return o._tag==="Left"?o.left:o.right},D),n(r,i))}}function _X(e){return j$(e,e)}function SX(e){return zA(e,e)}const $X=Object.freeze(Object.defineProperty({__proto__:null,fanIn:zA,fanin:SX,split:j$,splitChoice:_X},Symbol.toStringTag,{value:"Module"})),TX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var IX=function(e,t){return y(e,KA(t))},KA=function(e){return function(t){return V(e,t)}},VA="Predicate",HA=function(){return{concat:function(e,t){return y(e,YA(t))}}},OX=function(){return{concat:HA().concat,empty:GR}},GA=function(){return{concat:function(e,t){return y(e,JA(t))}}},wX=function(){return{concat:GA().concat,empty:l_}},CX={URI:VA,contramap:IX},wd=function(e){return function(t){return!e(t)}},YA=function(e){return function(t){return function(n){return t(n)||e(n)}}},JA=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const EX=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:CX,URI:VA,and:JA,contramap:KA,getMonoidAll:wX,getMonoidAny:OX,getSemigroupAll:GA,getSemigroupAny:HA,not:wd,or:YA},Symbol.toStringTag,{value:"Module"}));var at=be,_t=pe;function $v(e){return function(t){return e(t)?_t(t):at}}var Tv=function(e){return e._tag==="Right"?at:_t(e.left)},Cd=function(e){return e._tag==="Left"?at:_t(e.right)},yr=function(e,t){return y(e,Yi(t))},es=function(e,t){return y(e,eN(t))},Iv=function(e,t){return y(e,Rd(t))},Ov=function(e,t,n){return y(e,nN(t,n))},wv=function(e){var t=rN(e);return function(n,r){return y(n,t(r))}},Cv=function(e,t,n){return y(e,iN(t,n))},L$=function(e){var t=dN(e);return function(n,r){return y(n,t(r))}},D$=function(e,t){return y(e,aN(t))},Ed=function(e,t){return y(e,sN(t))},q$=function(e,t){return y(e,cN(t))},ZA=function(e,t){return y(e,K$(t))},U$=function(e,t){return y(e,lN(t))},B$=function(e,t){return y(e,fN(t))},Bt="Option",RX=function(e){return{show:function(t){return Le(t)?"none":"some(".concat(e.show(t.value),")")}}},XA=function(e){return{equals:function(t,n){return t===n||(Le(t)?Le(n):Le(n)?!1:e.equals(t.value,n.value))}}},MX=function(e){return{equals:XA(e).equals,compare:function(t,n){return t===n?0:xv(t)?xv(n)?e.compare(t.value,n.value):1:-1}}},z$=function(e){return{concat:function(t,n){return Le(t)?n:Le(n)?t:_t(e.concat(t.value,n.value))},empty:at}},Yi=function(e){return function(t){return Le(t)?at:_t(e(t.value))}},Qc={URI:Bt,map:yr},Ro=_t,QA={URI:Bt,of:Ro},eN=function(e){return function(t){return Le(t)||Le(e)?at:_t(t.value(e.value))}},el={URI:Bt,map:yr,ap:es},tN={URI:Bt,map:yr,ap:es,of:Ro},Rd=function(e){return function(t){return Le(t)?at:e(t.value)}},Md={URI:Bt,map:yr,ap:es,chain:Iv},xX={URI:Bt,map:yr,ap:es,of:Ro,chain:Iv},nN=function(e,t){return function(n){return Le(n)?e:t(e,n.value)}},rN=function(e){return function(t){return function(n){return Le(n)?e.empty:t(n.value)}}},iN=function(e,t){return function(n){return Le(n)?e:t(n.value,e)}},kX={URI:Bt,reduce:Ov,foldMap:wv,reduceRight:Cv},oN=function(e){return function(t){return Le(t)?e():t}},aN=oN,AX={URI:Bt,map:yr,alt:D$},Ev=function(){return at},uN={URI:Bt,zero:Ev},NX=qc(uN,QA),FX={URI:Bt,map:yr,ap:es,of:Ro,alt:D$,zero:Ev},K$=function(e){return function(t){return Le(t)?at:_t(e(t))}},PX={URI:Bt,map:yr,extend:ZA},tl=Rd(D),WX=Me(at,at),nl=function(e){return Le(e)?WX:Me(Tv(e.value),Cd(e.value))},ts={URI:Bt,compact:tl,separate:nl},sN=function(e){return function(t){return Le(t)?at:e(t.value)?t:at}},cN=function(e){return function(t){return Le(t)?at:e(t.value)}},lN=function(e){return function(t){return Me(Ed(t,wd(e)),Ed(t,e))}},fN=function(e){return V(Yi(e),nl)},Mo={URI:Bt,map:yr,compact:tl,separate:nl,filter:Ed,filterMap:q$,partition:U$,partitionMap:B$},dN=function(e){return function(t){return function(n){return Le(n)?e.of(at):e.map(t(n.value),_t)}}},Rv=function(e){return function(t){return Le(t)?e.of(at):e.map(t.value,_t)}},V$={URI:Bt,map:yr,reduce:Ov,foldMap:wv,reduceRight:Cv,traverse:L$,sequence:Rv},H$=ai(V$,ts),G$=oi(V$,ts),jX=function(e){var t=H$(e);return function(n){return function(r){return t(r,n)}}},LX=function(e){var t=G$(e);return function(n){return function(r){return t(r,n)}}},DX={URI:Bt,map:yr,reduce:Ov,foldMap:wv,reduceRight:Cv,traverse:L$,sequence:Rv,compact:tl,separate:nl,filter:Ed,filterMap:q$,partition:U$,partitionMap:B$,wither:H$,wilt:G$},Y$=function(){return at},qX={URI:Bt,map:yr,ap:es,of:Ro,chain:Iv,throwError:Y$},rl=Cd,Mv={URI:Bt,fromEither:rl},xv=bt,Le=function(e){return e._tag==="None"},J$=function(e,t){return function(n){return Le(n)?e():t(n.value)}},UX=J$,xo=J$,ko=xo,Z$=function(e){return function(t){return Le(t)?e():t.value}},X$=Z$,BX=Ke(Qc),zX=Ct(el),KX=Et(el),VX=tl,HX=ft(Md),GX=K$(D),YX=gr(Mv),JX=wo(Mv,Md),ZX=Co(Mv,Md),ns=function(e){return e==null?at:_t(e)},pN=function(e){try{return _t(e())}catch{return at}},XX=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return pN(function(){return e.apply(void 0,t)})}},QX=function(e){return V(e,ns)},hN=function(e){return function(t){return Le(t)?at:ns(e(t.value))}},Q$=xo(YR,D),mN=xo(f_,D);function vN(e){return function(t,n){if(n===void 0){var r=vN(e);return function(i){return r(t,i)}}return Le(n)?!1:e.equals(t,n.value)}}var eQ=function(e){return function(t){return Le(t)?!1:e(t.value)}},tQ=Ro(Yt),nQ=wt(Qc),rQ=Mt(Md),iQ=Rt(el),gN=Ro(rn),kv=function(e){return function(t){var n=e(0,dr(t));if(Le(n))return at;for(var r=[n.value],i=1;i<t.length;i++){var o=e(i,t[i]);if(Le(o))return at;r.push(o.value)}return _t(r)}},e0=function(e){var t=kv(e);return function(n){return gt(n)?t(n):gN}},oQ=e0,yN=function(e){return e0(function(t,n){return e(n)})},aQ=yN(D);function uQ(e){return function(t){return xv(e(t))}}var sQ=hN,bN={URI:Bt,map:yr,of:Ro,ap:es,chain:Iv,reduce:Ov,foldMap:wv,reduceRight:Cv,traverse:L$,sequence:Rv,zero:Ev,alt:D$,extend:ZA,compact:tl,separate:nl,filter:Ed,filterMap:q$,partition:U$,partitionMap:B$,wither:H$,wilt:G$,throwError:Y$},cQ=Jt(el),lQ=Wr(tN),_N=function(){return z$(I_())},fQ=function(){return z$(fm())};const dQ=Object.freeze(Object.defineProperty({__proto__:null,Alt:AX,Alternative:FX,ApT:gN,Applicative:tN,Apply:el,Chain:Md,Compactable:ts,Do:tQ,Extend:PX,Filterable:Mo,Foldable:kX,FromEither:Mv,Functor:Qc,Monad:xX,MonadThrow:qX,Pointed:QA,Traversable:V$,URI:Bt,Witherable:DX,Zero:uN,alt:aN,altW:oN,ap:eN,apFirst:zX,apS:iQ,apSecond:KX,bind:rQ,bindTo:nQ,chain:Rd,chainEitherK:JX,chainFirst:HX,chainFirstEitherK:ZX,chainNullableK:hN,compact:tl,duplicate:GX,elem:vN,exists:eQ,extend:K$,filter:sN,filterMap:cN,flap:BX,flatten:VX,fold:ko,foldMap:rN,foldW:UX,fromEither:rl,fromEitherK:YX,fromNullable:ns,fromNullableK:QX,fromPredicate:$v,getApplyMonoid:lQ,getApplySemigroup:cQ,getEq:XA,getFirstMonoid:_N,getLastMonoid:fQ,getLeft:Tv,getMonoid:z$,getOrElse:X$,getOrElseW:Z$,getOrd:MX,getRefinement:uQ,getRight:Cd,getShow:RX,guard:NX,isNone:Le,isSome:xv,map:Yi,mapNullable:sQ,match:xo,matchW:J$,none:at,of:Ro,option:bN,partition:lN,partitionMap:fN,reduce:nN,reduceRight:iN,separate:nl,sequence:Rv,sequenceArray:aQ,some:_t,throwError:Y$,toNullable:Q$,toUndefined:mN,traverse:dN,traverseArray:yN,traverseArrayWithIndex:oQ,traverseReadonlyArrayWithIndex:e0,traverseReadonlyNonEmptyArrayWithIndex:kv,tryCatch:pN,tryCatchK:XX,wilt:LX,wither:jX,zero:Ev},Symbol.toStringTag,{value:"Module"}));function Ji(e,t){return function(n){return e.map(n,t.compact)}}function Ao(e,t,n){var r=Ji(e,t),i=Cc(e,n);return function(o){return Me(r(y(o,i(Tv))),r(y(o,i(Cd))))}}function pQ(e,t){var n=Ec(e,t).map;return{map:n,compact:Ji(e,t),separate:Ao(e,t,t)}}const hQ=Object.freeze(Object.defineProperty({__proto__:null,compact:Ji,getCompactableComposition:pQ,separate:Ao},Symbol.toStringTag,{value:"Module"}));var mQ=function(e){return function(){return console.log(e)}},vQ=function(e){return function(){return console.warn(e)}},gQ=function(e){return function(){return console.error(e)}},yQ=function(e){return function(){return console.info(e)}};const bQ=Object.freeze(Object.defineProperty({__proto__:null,error:gQ,info:yQ,log:mQ,warn:vQ},Symbol.toStringTag,{value:"Module"}));var il=Oc;function _Q(e){return{show:function(t){return"make(".concat(e.show(t),")")}}}var SQ=D,$Q=D,TQ=D,IQ=D,OQ=D,wQ=D,CQ=D,EQ=D,RQ=D;function SN(e){return{URI:rs,_E:void 0,map:t0,ap:function(t,n){return il(e.concat(t,n))}}}function $N(e){var t=SN(e);return{URI:rs,_E:void 0,map:t.map,ap:t.ap,of:function(){return il(e.empty)}}}var TN=function(e,t){return y(e,wN())},t0=function(e,t){return y(e,CN())},IN=function(e,t,n){return y(e,EN(t))},ON=function(e,t){return y(e,RN(t))},wN=function(){return Oc},CN=function(){return Oc},EN=function(e){return function(t){return il(e(t))}},RN=function(e){return function(t){return il(e(t))}},rs="Const",MN={URI:rs,map:t0},MQ=Ke(MN),xQ={URI:rs,contramap:TN},kQ={URI:rs,bimap:IN,mapLeft:ON},AQ={URI:rs,map:t0,contramap:TN,bimap:IN,mapLeft:ON};const NQ=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:kQ,Contravariant:xQ,Functor:MN,URI:rs,bimap:EN,const_:AQ,contramap:wN,flap:MQ,getApplicative:$N,getApply:SN,getBooleanAlgebra:RQ,getBounded:TQ,getEq:SQ,getHeytingAlgebra:EQ,getMonoid:OQ,getOrd:$Q,getRing:CQ,getSemigroup:IQ,getSemiring:wQ,getShow:_Q,make:il,map:CN,mapLeft:RN},Symbol.toStringTag,{value:"Module"})),FQ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var PQ={equals:function(e,t){return e.valueOf()===t.valueOf()}},WQ={equals:function(e,t){return e.getDate()===t.getDate()}},jQ={equals:function(e,t){return e.getMonth()===t.getMonth()}},LQ={equals:function(e,t){return e.getFullYear()===t.getFullYear()}},DQ=y(Zm,om(function(e){return e.valueOf()})),qQ=function(){return new Date},UQ=function(){return new Date().getTime()};const BQ=Object.freeze(Object.defineProperty({__proto__:null,Eq:PQ,Ord:DQ,create:qQ,eqDate:WQ,eqMonth:jQ,eqYear:LQ,now:UQ},Symbol.toStringTag,{value:"Module"}));var Tt=So,Ye=Ma,Tn=function(e,t){return y(e,us(t))},is=function(e,t){return y(e,NN(t))},ol=function(e,t){return y(e,Lr(t))},xd=function(e,t,n){return y(e,PN(t,n))},kd=function(e){return function(t,n){var r=WN(e);return y(t,r(n))}},Ad=function(e,t,n){return y(e,jN(t,n))},Av=function(e){var t=LN(e);return function(n,r){return y(n,t(r))}},n0=function(e,t,n){return y(e,s0(t,n))},r0=function(e,t){return y(e,Wd(t))},xN=function(e,t){return y(e,qN(t))},i0=function(e,t){return y(e,c0(t))},o0=function(e,t){return W$(t(e),function(n){return le(n)?Ye(Tt(n.left)):le(n.right)?Tt(t(n.right.left)):Ye(Ye(n.right.right))})},It="Either",zQ=function(e,t){return{show:function(n){return le(n)?"left(".concat(e.show(n.left),")"):"right(".concat(t.show(n.right),")")}}},KQ=function(e,t){return{equals:function(n,r){return n===r||(le(n)?le(r)&&e.equals(n.left,r.left):l0(r)&&t.equals(n.right,r.right))}}},Nd=function(e){return{concat:function(t,n){return le(n)?t:le(t)?n:Ye(e.concat(t.right,n.right))}}},as=function(e){var t=Tt(e.empty);return{URI:It,_E:void 0,compact:function(n){return le(n)?n:n.right._tag==="None"?t:Ye(n.right.value)},separate:function(n){return le(n)?Me(n,n):le(n.right)?Me(Ye(n.right.left),t):Me(t,Ye(n.right.right))}}},al=function(e){var t=Tt(e.empty),n=as(e),r=n.compact,i=n.separate,o=function(u,s){return le(u)||s(u.right)?u:t},a=function(u,s){return le(u)?Me(u,u):s(u.right)?Me(t,Ye(u.right)):Me(Ye(u.right),t)};return{URI:It,_E:void 0,map:Tn,compact:r,separate:i,filter:o,filterMap:function(u,s){if(le(u))return u;var c=s(u.right);return c._tag==="None"?t:Ye(c.value)},partition:a,partitionMap:function(u,s){if(le(u))return Me(u,u);var c=s(u.right);return le(c)?Me(Ye(c.left),t):Me(t,Ye(c.right))}}},VQ=function(e){var t=al(e),n=as(e);return{URI:It,_E:void 0,map:Tn,compact:t.compact,separate:t.separate,filter:t.filter,filterMap:t.filterMap,partition:t.partition,partitionMap:t.partitionMap,traverse:Av,sequence:Pd,reduce:xd,foldMap:kd,reduceRight:Ad,wither:ai(u0,n),wilt:oi(u0,n)}},La=function(e){return{URI:It,_E:void 0,map:Tn,ap:function(t,n){return le(t)?le(n)?Tt(e.concat(t.left,n.left)):t:le(n)?n:Ye(t.right(n.right))},of:Zi}},kN=function(e){return{URI:It,_E:void 0,map:Tn,alt:function(t,n){if(l0(t))return t;var r=n();return le(r)?Tt(e.concat(t.left,r.left)):r}}},us=function(e){return function(t){return le(t)?t:Ye(e(t.right))}},Da={URI:It,map:Tn},Zi=Ye,HQ={URI:It,of:Zi},AN=function(e){return function(t){return le(t)?t:le(e)?e:Ye(t.right(e.right))}},NN=AN,ul={URI:It,map:Tn,ap:is},FN={URI:It,map:Tn,ap:is,of:Zi},a0=function(e){return function(t){return le(t)?t:e(t.right)}},Lr=a0,Fd={URI:It,map:Tn,ap:is,chain:ol},GQ={URI:It,map:Tn,ap:is,of:Zi,chain:ol},PN=function(e,t){return function(n){return le(n)?e:t(e,n.right)}},WN=function(e){return function(t){return function(n){return le(n)?e.empty:t(n.right)}}},jN=function(e,t){return function(n){return le(n)?e:t(n.right,e)}},YQ={URI:It,reduce:xd,foldMap:kd,reduceRight:Ad},LN=function(e){return function(t){return function(n){return le(n)?e.of(Tt(n.left)):e.map(t(n.right),Ye)}}},Pd=function(e){return function(t){return le(t)?e.of(Tt(t.left)):e.map(t.right,Ye)}},u0={URI:It,map:Tn,reduce:xd,foldMap:kd,reduceRight:Ad,traverse:Av,sequence:Pd},s0=function(e,t){return function(n){return le(n)?Tt(e(n.left)):Ye(t(n.right))}},Wd=function(e){return function(t){return le(t)?Tt(e(t.left)):t}},JQ={URI:It,bimap:n0,mapLeft:r0},DN=function(e){return function(t){return le(t)?e():t}},qN=DN,ZQ={URI:It,map:Tn,alt:xN},c0=function(e){return function(t){return le(t)?t:Ye(e(t))}},XQ={URI:It,map:Tn,extend:i0},QQ={URI:It,map:Tn,ap:is,chain:ol,chainRec:o0},Nv=Tt,eee={URI:It,map:Tn,ap:is,of:Zi,chain:ol,throwError:Nv},sl={URI:It,fromEither:D},tee=Aa(sl),UN=Vi(sl),le=Gt,l0=d_,f0=function(e,t){return function(n){return le(n)?e(n.left):t(n.right)}},BN=f0,qa=f0,d0=qa,p0=function(e){return function(t){return le(t)?e(t.left):t.right}},nee=p0,ree=Ke(Da),zN=Ct(ul),iee=zN,KN=Et(ul),oee=KN,VN=ft(Fd),aee=VN,HN=a0(D),uee=HN,see=c0(D),cee=Hi(sl),lee=Gu(sl,Fd),GN=Yu(sl,Fd),fee=GN,YN=function(e){return le(e)?Ye(e.left):Tt(e.right)},JN=function(e){return function(t){return le(t)?e(t.left):t}},ZN=JN,h0=function(e){return function(t){return t==null?Tt(e):Ye(t)}},ss=function(e,t){try{return Ye(e())}catch(n){return Tt(t(n))}},dee=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return ss(function(){return e.apply(void 0,n)},t)}},XN=function(e){var t=h0(e);return function(n){return V(n,t)}},pee=function(e){var t=XN(e);return function(n){return Lr(t(n))}},QN=BN(D,D);function hee(e){return e instanceof Error?e:new Error(String(e))}function eF(e){return function(t,n){if(n===void 0){var r=eF(e);return function(i){return r(t,i)}}return le(n)?!1:e.equals(t,n.right)}}var mee=function(e){return function(t){return le(t)?!1:e(t.right)}},vee=Zi(Yt),gee=wt(Da),tF=Mt(Fd),yee=tF,nF=Rt(ul),bee=nF,rF=Zi(rn),jd=function(e){return function(t){var n=e(0,dr(t));if(le(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i]);if(le(o))return o;r.push(o.right)}return Ye(r)}},m0=function(e){var t=jd(e);return function(n){return gt(n)?t(n):rF}},_ee=m0,iF=function(e){return m0(function(t,n){return e(n)})},See=iF(D);function $ee(e,t){return ss(function(){return JSON.parse(e)},t)}var Tee=function(e,t){return ss(function(){var n=JSON.stringify(e);if(typeof n!="string")throw new Error("Converting unsupported structure to JSON");return n},t)},Iee={URI:It,map:Tn,of:Zi,ap:is,chain:ol,reduce:xd,foldMap:kd,reduceRight:Ad,traverse:Av,sequence:Pd,bimap:n0,mapLeft:r0,alt:xN,extend:i0,chainRec:o0,throwError:Nv},Oee=Jt(ul),wee=Wr(FN),Cee=function(e,t){return Jt(La(e))(t)},Eee=function(e,t){return Wr(La(e))(t)};function Ree(e){var t=La(e).ap,n=kN(e).alt;return{URI:It,_E:void 0,map:Tn,of:Zi,chain:ol,bimap:n0,mapLeft:r0,reduce:xd,foldMap:kd,reduceRight:Ad,extend:i0,traverse:Av,sequence:Pd,chainRec:o0,throwError:Nv,ap:t,alt:n}}const oF=Object.freeze(Object.defineProperty({__proto__:null,Alt:ZQ,ApT:rF,Applicative:FN,Apply:ul,Bifunctor:JQ,Chain:Fd,ChainRec:QQ,Do:vee,Extend:XQ,Foldable:YQ,FromEither:sl,Functor:Da,Monad:GQ,MonadThrow:eee,Pointed:HQ,Traversable:u0,URI:It,alt:qN,altW:DN,ap:NN,apFirst:zN,apFirstW:iee,apS:nF,apSW:bee,apSecond:KN,apSecondW:oee,apW:AN,bimap:s0,bind:tF,bindTo:gee,bindW:yee,chain:Lr,chainFirst:VN,chainFirstW:aee,chainNullableK:pee,chainOptionK:lee,chainW:a0,duplicate:see,either:Iee,elem:eF,exists:mee,extend:c0,filterOrElse:GN,filterOrElseW:fee,flap:ree,flatten:uee,flattenW:HN,fold:d0,foldMap:WN,foldW:BN,fromNullable:h0,fromNullableK:XN,fromOption:UN,fromOptionK:cee,fromPredicate:tee,getAltValidation:kN,getApplicativeValidation:La,getApplyMonoid:wee,getApplySemigroup:Oee,getCompactable:as,getEq:KQ,getFilterable:al,getOrElse:nee,getOrElseW:p0,getSemigroup:Nd,getShow:zQ,getValidation:Ree,getValidationMonoid:Eee,getValidationSemigroup:Cee,getWitherable:VQ,isLeft:le,isRight:l0,left:Tt,map:us,mapLeft:Wd,match:qa,matchW:f0,of:Zi,orElse:ZN,orElseW:JN,parseJSON:$ee,reduce:PN,reduceRight:jN,right:Ye,sequence:Pd,sequenceArray:See,stringifyJSON:Tee,swap:YN,throwError:Nv,toError:hee,toUnion:QN,traverse:LN,traverseArray:iF,traverseArrayWithIndex:_ee,traverseReadonlyArrayWithIndex:m0,traverseReadonlyNonEmptyArrayWithIndex:jd,tryCatch:ss,tryCatchK:dee},Symbol.toStringTag,{value:"Module"}));function cs(e){return V(Ye,e.of)}function cl(e){return V(Tt,e.of)}function ll(e){return function(t){return e.map(t,Ye)}}function fl(e){return function(t){return e.map(t,Tt)}}function Fv(e){return function(t){return V(h0(t),e.of)}}function Pv(e){var t=Fv(e);return function(n){var r=t(n);return function(i){return V(i,r)}}}function v0(e){var t=ls(e),n=Pv(e);return function(r){var i=n(r);return function(o){return t(i(o))}}}function dl(e){return Cc(e,Da)}function pl(e){return $o(e,ul)}function ls(e){return function(t){return function(n){return e.chain(n,function(r){return le(r)?e.of(r):t(r.right)})}}}function hl(e){return function(t){return function(n){return e.chain(n,function(r){return le(r)?t():e.of(r)})}}}function ml(e){return function(t,n){return function(r){return e.map(r,s0(t,n))}}}function vl(e){return function(t){return function(n){return e.map(n,Wd(t))}}}function Ld(e,t){return function(n){return function(r){return e.chain(r,qa(function(i){return e.map(n(),Wd(function(o){return t.concat(i,o)}))},cs(e)))}}}function Dd(e){return function(t,n){return function(r){return e.map(r,qa(t,n))}}}function gl(e){return function(t,n){return function(r){return e.chain(r,qa(t,n))}}}function yl(e){return function(t){return function(n){return e.chain(n,qa(t,e.of))}}}function fs(e){return function(t){return function(n){return e.chain(n,function(r){return le(r)?t(r.left):e.of(r)})}}}function qd(e){var t=fs(e);return function(n){return t(function(r){return e.map(n(r),function(i){return le(i)?i:Tt(r)})})}}function Ud(e){return function(t){return function(n){return e.chain(n,qa(function(r){return e.map(t(r),Tt)},function(r){return e.of(Ye(r))}))}}}function bl(e){return function(t){return e.map(t,YN)}}function Bd(e){return function(t){return e.map(t,QN)}}function Mee(e){var t=pl(e),n=dl(e),r=ls(e),i=hl(e),o=ml(e),a=vl(e),u=gl(e),s=yl(e),c=fs(e);return{map:function(l,f){return y(l,n(f))},ap:function(l,f){return y(l,t(f))},of:cs(e),chain:function(l,f){return y(l,r(f))},alt:function(l,f){return y(l,i(f))},bimap:function(l,f,d){return y(l,o(f,d))},mapLeft:function(l,f){return y(l,a(f))},fold:function(l,f,d){return y(l,u(f,d))},getOrElse:function(l,f){return y(l,s(f))},orElse:function(l,f){return y(l,c(f))},swap:bl(e),rightM:ll(e),leftM:fl(e),left:cl(e)}}const xee=Object.freeze(Object.defineProperty({__proto__:null,alt:hl,altValidation:Ld,ap:pl,bimap:ml,chain:ls,chainNullableK:v0,fromNullable:Fv,fromNullableK:Pv,getEitherM:Mee,getOrElse:yl,left:cl,leftF:fl,map:dl,mapLeft:vl,match:Dd,matchE:gl,orElse:fs,orElseFirst:qd,orLeft:Ud,right:cs,rightF:ll,swap:bl,toUnion:Bd},Symbol.toStringTag,{value:"Module"}));var kee="Endomorphism",aF=function(){return{concat:function(e,t){return V(e,t)}}},uF=function(){return{concat:aF().concat,empty:D}};const Aee=Object.freeze(Object.defineProperty({__proto__:null,URI:kee,getMonoid:uF,getSemigroup:aF},Symbol.toStringTag,{value:"Module"})),Nee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function sF(e,t){var n=t.zero,r=function(i,o){return e.equals(o,n)?i:r(o,t.mod(i,o))};return r}function Fee(e,t){var n=t.zero,r=sF(e,t);return function(i,o){return e.equals(i,n)||e.equals(o,n)?n:t.div(t.mul(i,o),r(i,o))}}var Pee={add:function(e,t){return e+t},zero:0,mul:function(e,t){return e*t},one:1,sub:function(e,t){return e-t},degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const Wee=Object.freeze(Object.defineProperty({__proto__:null,fieldNumber:Pee,gcd:sF,lcm:Fee},Symbol.toStringTag,{value:"Module"}));function No(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filter(i,n)})}}}function Fo(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filterMap(i,n)})}}}function Ua(e,t){var n=No(e,t);return function(r){var i=n(wd(r)),o=n(r);return function(a){return Me(i(a),o(a))}}}function Ba(e,t){var n=Fo(e,t);return function(r){return function(i){return Me(y(i,n(function(o){return Tv(r(o))})),y(i,n(function(o){return Cd(r(o))})))}}}function jee(e,t){var n=Ec(e,t).map,r=Ji(e,t),i=Ao(e,t,t),o=No(e,t),a=Fo(e,t),u=Ua(e,t),s=Ba(e,t);return{map:n,compact:r,separate:i,filter:function(c,l){return y(c,o(l))},filterMap:function(c,l){return y(c,a(l))},partition:function(c,l){return y(c,u(l))},partitionMap:function(c,l){return y(c,s(l))}}}const Lee=Object.freeze(Object.defineProperty({__proto__:null,filter:No,filterMap:Fo,getFilterableComposition:jee,partition:Ua,partitionMap:Ba},Symbol.toStringTag,{value:"Module"})),Dee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function cF(e,t){return function(n,r){return function(i){return e.reduce(i,n,function(o,a){return t.reduce(a,o,r)})}}}function lF(e,t){return function(n){var r=e.foldMap(n),i=t.foldMap(n);return function(o){return function(a){return r(a,function(u){return i(u,o)})}}}}function fF(e,t){return function(n,r){return function(i){return e.reduceRight(i,n,function(o,a){return t.reduceRight(o,a,r)})}}}function qee(e,t){return function(n,r){return function(i){return t.reduce(i,e.of(n),function(o,a){return e.chain(o,function(u){return r(u,a)})})}}}function Uee(e,t){return function(n,r){var i=function(o,a){var u=o.init,s=o.acc;return u?{init:!1,acc:a}:{init:!1,acc:e.concat(e.concat(s,n),a)}};return t.reduce(r,{init:!0,acc:e.empty},i).acc}}function dF(e){return function(t){return e.reduce(t,[],function(n,r){return n.push(r),n})}}function Bee(e,t){var n=function(i,o){return e.ap(e.map(i,Yn),o)},r=e.of(void 0);return function(i,o){return t.reduce(i,r,function(a,u){return n(a,o(u))})}}function zee(e,t){return function(n,r,i){return t.reduce(n,e.of(r),function(o,a){return e.chain(o,function(u){return i(u,a)})})}}var Kee=dF;function g0(e,t){var n=cF(e,t),r=lF(e,t),i=fF(e,t);return{reduce:function(o,a,u){return y(o,n(a,u))},foldMap:function(o){var a=r(o);return function(u,s){return y(u,a(s))}},reduceRight:function(o,a,u){return y(o,i(a,u))}}}const Vee=Object.freeze(Object.defineProperty({__proto__:null,foldM:zee,foldMap:lF,getFoldableComposition:g0,intercalate:Uee,reduce:cF,reduceM:qee,reduceRight:fF,toArray:Kee,toReadonlyArray:dF,traverse_:Bee},Symbol.toStringTag,{value:"Module"}));function pF(e,t){return function(n,r){return function(i){return e.reduceWithIndex(i,n,function(o,a,u){return t.reduceWithIndex(u,a,function(s,c,l){return r([o,s],c,l)})})}}}function hF(e,t){return function(n){var r=e.foldMapWithIndex(n),i=t.foldMapWithIndex(n);return function(o){return function(a){return r(a,function(u,s){return i(s,function(c,l){return o([u,c],l)})})}}}}function mF(e,t){return function(n,r){return function(i){return e.reduceRightWithIndex(i,n,function(o,a,u){return t.reduceRightWithIndex(a,u,function(s,c,l){return r([o,s],c,l)})})}}}function Hee(e,t){var n=g0(e,t),r=pF(e,t),i=hF(e,t),o=mF(e,t);return{reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(a,u,s){return y(a,r(u,s))},foldMapWithIndex:function(a){var u=i(a);return function(s,c){return y(s,u(c))}},reduceRightWithIndex:function(a,u,s){return y(a,o(u,s))}}}const Gee=Object.freeze(Object.defineProperty({__proto__:null,foldMapWithIndex:hF,getFoldableWithIndexComposition:Hee,reduceRightWithIndex:mF,reduceWithIndex:pF},Symbol.toStringTag,{value:"Module"}));function Xi(e){return function(t){return V(t,e.fromIO)}}function Po(e,t){return function(n){var r=V(n,e.fromIO);return function(i){return t.chain(i,r)}}}function Wo(e,t){var n=ft(t);return function(r){return n(V(r,e.fromIO))}}const Yee=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:Wo,chainIOK:Po,fromIOK:Xi},Symbol.toStringTag,{value:"Module"}));var vF=function(){return D},Jee=D,zd=function(e){return function(t){return function(n){return t(e(n))}}},Kd=function(e){return function(t){return e(t)(t)}},Zee=Kd,jo=function(e,t){return y(e,ds(t))},Vd=function(e,t){return y(e,bF(t))},y0=function(e,t){return y(e,_F(t))},gF=function(e,t){return y(e,$F(t))},Wv=function(e,t,n){return y(e,TF(t,n))},ds=function(e){return function(t){return function(n){return e(t(n))}}},yF=function(e){return function(t){return function(n){return t(n)(e(n))}}},bF=yF,Qi=Yn,b0=function(e){return function(t){return function(n){return e(t(n))(n)}}},_F=b0,SF=b0(D),Xee=SF,$F=function(e){return function(t){return V(e,t)}},TF=function(e,t){return function(n){return function(r){return t(n(e(r)))}}},_0=function(){return D},S0=function(e){return function(t){var n=t[0],r=t[1];return[e(n),r]}},$0=function(e){return function(t){var n=t[0],r=t[1];return[n,e(r)]}},T0=function(e){return d0(function(t){return So(e(t))},Ye)},I0=function(e){return d0(Tt,function(t){return Ma(e(t))})},Dr="Reader",sn={URI:Dr,map:jo},Qee=Ke(sn),O0={URI:Dr,of:Qi},Lo={URI:Dr,map:jo,ap:Vd},IF=Ct(Lo),ete=IF,OF=Et(Lo),tte=OF,wF={URI:Dr,map:jo,ap:Vd,of:Qi},w0={URI:Dr,map:jo,ap:Vd,chain:y0},Do={URI:Dr,map:jo,of:Qi,ap:Vd,chain:y0},CF=ft(w0),nte=CF,rte={URI:Dr,map:jo,promap:Wv},ite={URI:Dr,compose:gF,id:_0},ote={URI:Dr,map:jo,promap:Wv,first:S0,second:$0},ate={URI:Dr,map:jo,promap:Wv,left:T0,right:I0},ute=wt(sn),EF=Mt(w0),ste=EF,cte=Qi(Yt),RF=Rt(Lo),lte=RF,MF=Qi(rn),ps=function(e){return function(t){return function(n){for(var r=[e(0,dr(t))(n)],i=1;i<t.length;i++)r.push(e(i,t[i])(n));return r}}},C0=function(e){var t=ps(e);return function(n){return gt(n)?t(n):MF}},fte=C0,xF=function(e){return C0(function(t,n){return e(n)})},dte=xF(D),pte={URI:Dr,map:jo,of:Qi,ap:Vd,chain:y0,promap:Wv,compose:gF,id:_0,first:S0,second:$0,left:T0,right:I0},hte=Jt(Lo),mte=Wr(wF);const vte=Object.freeze(Object.defineProperty({__proto__:null,ApT:MF,Applicative:wF,Apply:Lo,Category:ite,Chain:w0,Choice:ate,Do:cte,Functor:sn,Monad:Do,Pointed:O0,Profunctor:rte,Strong:ote,URI:Dr,ap:bF,apFirst:IF,apFirstW:ete,apS:RF,apSW:lte,apSecond:OF,apSecondW:tte,apW:yF,ask:vF,asks:Jee,asksReader:Zee,asksReaderW:Kd,bind:EF,bindTo:ute,bindW:ste,chain:_F,chainFirst:CF,chainFirstW:nte,chainW:b0,compose:$F,first:S0,flap:Qee,flatten:Xee,flattenW:SF,getMonoid:mte,getSemigroup:hte,id:_0,left:T0,local:zd,map:ds,of:Qi,promap:TF,reader:pte,right:I0,second:$0,sequenceArray:dte,traverseArray:xF,traverseArrayWithIndex:fte,traverseReadonlyArrayWithIndex:C0,traverseReadonlyNonEmptyArrayWithIndex:ps},Symbol.toStringTag,{value:"Module"}));function Hd(e){return function(){return e.fromReader(vF())}}function Gd(e){return e.fromReader}function hs(e){return function(t){return V(t,e.fromReader)}}function Yd(e,t){var n=hs(e);return function(r){return function(i){return t.chain(i,n(r))}}}function Jd(e,t){return V(hs(e),ft(t))}const gte=Object.freeze(Object.defineProperty({__proto__:null,ask:Hd,asks:Gd,chainFirstReaderK:Jd,chainReaderK:Yd,fromReaderK:hs},Symbol.toStringTag,{value:"Module"}));var kF=function(){return function(e){return[e,e]}},AF=function(e){return function(){return[void 0,e]}},NF=function(e){return function(t){return[void 0,e(t)]}},FF=function(e){return function(t){return[e(t),t]}},Zd=function(e,t){return y(e,WF(t))},jv=function(e,t){return y(e,jF(t))},PF=function(e,t){return y(e,E0(t))},WF=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return[e(i),o]}}},jF=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1],a=e(o),u=a[0],s=a[1];return[i(u),s]}}},Xd=function(e){return function(t){return[e,t]}},E0=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return e(i)(o)}}},yte=E0(D),za="State",R0={URI:za,map:Zd},bte=Ke(R0),_te={URI:za,of:Xd},Lv={URI:za,map:Zd,ap:jv},Ste=Ct(Lv),$te=Et(Lv),Tte={URI:za,map:Zd,ap:jv,of:Xd},M0={URI:za,map:Zd,ap:jv,chain:PF},LF={URI:za,map:Zd,ap:jv,of:Xd,chain:PF},Ite=ft(M0),Ote={URI:za,fromState:D},wte=function(e){return function(t){return t(e)[0]}},Cte=function(e){return function(t){return t(e)[1]}},Ete=wt(R0),Rte=Mt(M0),Mte=Rt(Lv),DF=function(e){return function(t){return function(n){for(var r=e(0,dr(t))(n),i=r[0],o=r[1],a=[i],u=o,s=1;s<t.length;s++){var c=e(s,t[s])(u),l=c[0],f=c[1];a.push(l),u=f}return[a,u]}}},x0=function(e){var t=DF(e);return function(n){return gt(n)?t(n):Xd(rn)}},xte=x0,qF=function(e){return x0(function(t,n){return e(n)})},kte=qF(D),Ate=function(e,t){return e(t)[0]},Nte=function(e,t){return e(t)[1]},Fte=LF;const Pte=Object.freeze(Object.defineProperty({__proto__:null,Applicative:Tte,Apply:Lv,Chain:M0,FromState:Ote,Functor:R0,Monad:LF,Pointed:_te,URI:za,ap:jF,apFirst:Ste,apS:Mte,apSecond:$te,bind:Rte,bindTo:Ete,chain:E0,chainFirst:Ite,evalState:Ate,evaluate:wte,execState:Nte,execute:Cte,flap:bte,flatten:yte,get:kF,gets:FF,map:WF,modify:NF,of:Xd,put:AF,sequenceArray:kte,state:Fte,traverseArray:qF,traverseArrayWithIndex:xte,traverseReadonlyArrayWithIndex:x0,traverseReadonlyNonEmptyArrayWithIndex:DF},Symbol.toStringTag,{value:"Module"}));function UF(e){return function(){return e.fromState(kF())}}function BF(e){return function(t){return e.fromState(AF(t))}}function zF(e){return V(NF,e.fromState)}function KF(e){return V(FF,e.fromState)}function k0(e){return function(t){return V(t,e.fromState)}}function VF(e,t){var n=k0(e);return function(r){return function(i){return t.chain(i,n(r))}}}const Wte=Object.freeze(Object.defineProperty({__proto__:null,chainStateK:VF,fromStateK:k0,get:UF,gets:KF,modify:zF,put:BF},Symbol.toStringTag,{value:"Module"}));function ms(e){return function(t){return V(t,e.fromTask)}}function _l(e,t){return function(n){var r=V(n,e.fromTask);return function(i){return t.chain(i,r)}}}function Sl(e,t){var n=ft(t);return function(r){return n(V(r,e.fromTask))}}const jte=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:Sl,chainTaskK:_l,fromTaskK:ms},Symbol.toStringTag,{value:"Module"}));function HF(e){return function(t){return V(t,e.fromThese)}}const Lte=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:HF},Symbol.toStringTag,{value:"Module"}));function GF(e,t){return function(n){return function(r){return e.mapWithIndex(r,function(i,o){return t.mapWithIndex(o,function(a,u){return n([i,a],u)})})}}}function Dte(e,t){var n=Ec(e,t).map,r=GF(e,t);return{map:n,mapWithIndex:function(i,o){return y(i,r(o))}}}const qte=Object.freeze(Object.defineProperty({__proto__:null,getFunctorWithIndexComposition:Dte,mapWithIndex:GF},Symbol.toStringTag,{value:"Module"})),Ute=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Bte=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),zte=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var eo=function(e,t){return y(e,QF(t))},$l=function(e,t){return y(e,eP(t))},Dv=function(e,t){return y(e,P0(t))},A0=function(e,t,n){return y(e,tP(t,n))},N0=function(e){return function(t,n){return y(t,nP()(n))}},F0=function(e,t,n){return y(e,rP(t,n))},YF=function(e,t){return y(e,aP())},JF=function(e,t){return y(e,W0(t))},ZF=function(e){var t=iP(e);return function(n,r){return y(n,t(r))}},XF=W$,QF=function(e){return function(t){return e(t)}},eP=function(e){return function(t){return t(e)}},Tl=D,P0=function(e){return function(t){return e(t)}},W0=function(e){return function(t){return e(t)}},j0=D,Kte=W0(D),Vte=P0(D),tP=function(e,t){return function(n){return t(e,n)}},nP=function(){return function(e){return function(t){return e(t)}}},rP=function(e,t){return function(n){return t(n,e)}},iP=function(e){return function(t){return function(n){return e.map(t(n),D)}}},L0=function(e){return function(t){return e.map(t,D)}},oP=function(){return D},aP=oP,br="Identity",Hte=D,Gte=D,D0={URI:br,map:eo},Yte=Ke(D0),Jte={URI:br,of:Tl},qv={URI:br,map:eo,ap:$l},Zte=Ct(qv),Xte=Et(qv),Qte={URI:br,map:eo,ap:$l,of:Tl},q0={URI:br,map:eo,ap:$l,chain:Dv},ene={URI:br,map:eo,ap:$l,of:Tl,chain:Dv},tne=ft(q0),nne={URI:br,reduce:A0,foldMap:N0,reduceRight:F0},rne={URI:br,map:eo,reduce:A0,foldMap:N0,reduceRight:F0,traverse:ZF,sequence:L0},ine={URI:br,map:eo,alt:YF},one={URI:br,map:eo,extend:JF,extract:j0},ane={URI:br,map:eo,ap:$l,chain:Dv,chainRec:XF},une=Tl(Yt),sne=wt(D0),cne=Mt(q0),lne=Rt(qv),fne={URI:br,map:eo,ap:$l,of:Tl,chain:Dv,reduce:A0,foldMap:N0,reduceRight:F0,traverse:ZF,sequence:L0,alt:YF,extract:j0,extend:JF,chainRec:XF};const dne=Object.freeze(Object.defineProperty({__proto__:null,Alt:ine,Applicative:Qte,Apply:qv,Chain:q0,ChainRec:ane,Comonad:one,Do:une,Foldable:nne,Functor:D0,Monad:ene,Pointed:Jte,Traversable:rne,URI:br,alt:aP,altW:oP,ap:eP,apFirst:Zte,apS:lne,apSecond:Xte,bind:cne,bindTo:sne,chain:P0,chainFirst:tne,duplicate:Kte,extend:W0,extract:j0,flap:Yte,flatten:Vte,foldMap:nP,getEq:Gte,getShow:Hte,identity:fne,map:QF,of:Tl,reduce:tP,reduceRight:rP,sequence:L0,traverse:iP},Symbol.toStringTag,{value:"Module"})),pne=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var qo=function(e,t){return function(){return t(e())}},Ka=function(e,t){return function(){return e()(t())}},Il=function(e,t){return function(){return t(e())()}},uP=function(e,t){return function(){for(var n=t(e)();n._tag==="Left";)n=t(n.left)();return n.right}},to=function(e){return function(t){return qo(t,e)}},hne=function(e){return function(t){return Ka(t,e)}},fi=Yn,U0=function(e){return function(t){return Il(t,e)}},mne=U0(D),di="IO",st={URI:di,map:qo},vne=Ke(st),no={URI:di,of:fi},Uo={URI:di,map:qo,ap:Ka},gne=Ct(Uo),yne=Et(Uo),sP={URI:di,map:qo,ap:Ka,of:fi},Uv={URI:di,map:qo,ap:Ka,chain:Il},Zn={URI:di,map:qo,ap:Ka,of:fi,chain:Il},bne=ft(Uv),B0=D,_ne={URI:di,map:qo,ap:Ka,of:fi,chain:Il,fromIO:B0},Sne={URI:di,map:qo,ap:Ka,chain:Il,chainRec:uP},$ne={URI:di,fromIO:D},Tne=fi(Yt),Ine=wt(st),One=Mt(Uv),wne=Rt(Uo),cP=fi(rn),Bv=function(e){return function(t){return function(){for(var n=[e(0,dr(t))()],r=1;r<t.length;r++)n.push(e(r,t[r])());return n}}},z0=function(e){var t=Bv(e);return function(n){return gt(n)?t(n):cP}},Cne=z0,lP=function(e){return z0(function(t,n){return e(n)})},Ene=lP(D),Rne={URI:di,map:qo,of:fi,ap:Ka,chain:Il,fromIO:B0,chainRec:uP},Mne=Jt(Uo),xne=Wr(sP);const kne=Object.freeze(Object.defineProperty({__proto__:null,ApT:cP,Applicative:sP,Apply:Uo,Chain:Uv,ChainRec:Sne,Do:Tne,FromIO:$ne,Functor:st,Monad:Zn,MonadIO:_ne,Pointed:no,URI:di,ap:hne,apFirst:gne,apS:wne,apSecond:yne,bind:One,bindTo:Ine,chain:U0,chainFirst:bne,flap:vne,flatten:mne,fromIO:B0,getMonoid:xne,getSemigroup:Mne,io:Rne,map:to,of:fi,sequenceArray:Ene,traverseArray:lP,traverseArrayWithIndex:Cne,traverseReadonlyArrayWithIndex:z0,traverseReadonlyNonEmptyArrayWithIndex:Bv},Symbol.toStringTag,{value:"Module"}));var fP=cl(no),dP=cs(no),pP=ll(st),Ane=fl(st),hP=fi,Qd=pP,mP=Dd(st),Nne=mP,K0=gl(Zn),Fne=K0,vP=K0,Pne=vP,gP=yl(Zn),Wne=gP,yP=function(e,t){return function(){return ss(e,t)}},jne=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return yP(function(){return e.apply(void 0,n)},t)}},Lne=Bd(st),bP=fs(Zn),Dne=bP,V0=qd(Zn),qne=V0,Une=function(e){return V0(MP(e))},Bne=Ud(Zn),zne=bl(st),Xn=function(e,t){return y(e,Y0(t))},vs=function(e,t){return y(e,J0(t))},Kne=function(e,t){return y(e,zv(function(n){return y(t,Y0(n))}))},Ol=function(e,t){return y(e,zv(t))},H0=function(e,t,n){return y(e,SP(t,n))},G0=function(e,t){return y(e,$P(t))},_P=function(e,t){return y(e,Z0(t))},Y0=dl(st),SP=ml(st),$P=vl(st),J0=pl(Uo),Vne=J0,qr=dP,zv=ls(Zn),Kv=zv,TP=Kv(D),Hne=TP,Z0=hl(Zn),Gne=Z0,Vv=fP,Lt="IOEither";function IP(e){var t=$o(Uo,La(e));return{URI:Lt,_E:void 0,map:Xn,ap:function(n,r){return y(n,t(r))},of:qr}}function OP(e){var t=Ld(Zn,e);return{URI:Lt,_E:void 0,map:Xn,alt:function(n,r){return y(n,t(r))}}}var wP=function(e){var t=as(e);return{URI:Lt,_E:void 0,compact:Ji(st,t),separate:Ao(st,t,Da)}};function Yne(e){var t=al(e),n=wP(e),r=No(st,t),i=Fo(st,t),o=Ua(st,t),a=Ba(st,t);return{URI:Lt,_E:void 0,map:Xn,compact:n.compact,separate:n.separate,filter:function(u,s){return y(u,r(s))},filterMap:function(u,s){return y(u,i(s))},partition:function(u,s){return y(u,o(s))},partitionMap:function(u,s){return y(u,a(s))}}}var X0={URI:Lt,map:Xn},Jne=Ke(X0),Zne={URI:Lt,of:qr},Xne={URI:Lt,bimap:H0,mapLeft:G0},ep={URI:Lt,map:Xn,ap:vs},CP=Ct(ep),Qne=CP,EP=Et(ep),ere=EP,Q0={URI:Lt,map:Xn,ap:vs,of:qr},tre={URI:Lt,map:Xn,ap:Kne,of:qr},Bo={URI:Lt,map:Xn,ap:vs,chain:Ol},nre={URI:Lt,map:Xn,ap:vs,of:qr,chain:Ol},RP=ft(Bo),rre=RP,ire={URI:Lt,map:Xn,alt:_P},ore={URI:Lt,map:Xn,ap:vs,of:qr,chain:Ol,fromIO:Qd},are={URI:Lt,map:Xn,ap:vs,of:qr,chain:Ol,throwError:Vv},Hv={URI:Lt,fromIO:Qd},MP=Xi(Hv),ure=Po(Hv,Bo),sre=Wo(Hv,Bo),zo={URI:Lt,fromEither:hP},cre=Vi(zo),lre=Hi(zo),fre=Gu(zo,Bo),xP=wo(zo,Bo),dre=xP,kP=Co(zo,Bo),pre=kP,hre=Aa(zo),AP=Yu(zo,Bo),mre=AP,vre=gr(zo),gre=function(e,t,n){return NP(e,t,n)},NP=function(e,t,n){return y(e,Kv(function(r){return y(t(r),U0(function(i){return y(n(r,i),Kv(function(){return fi(i)}))}))}))},yre=qr(Yt),bre=wt(X0),FP=Mt(Bo),_re=FP,PP=Rt(ep),Sre=PP,eT=qr(rn),WP=function(e){return V(Bv(e),to(jd(Jn)))},tT=function(e){var t=WP(e);return function(n){return gt(n)?t(n):eT}},jP=function(e){return function(t){return function(){var n=e(0,dr(t))();if(Gt(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i])();if(Gt(o))return o;r.push(o.right)}return Ma(r)}}},nT=function(e){var t=jP(e);return function(n){return gt(n)?t(n):eT}},$re=tT,LP=function(e){return tT(function(t,n){return e(n)})},Tre=LP(D),Ire=nT,DP=function(e){return nT(function(t,n){return e(n)})},Ore=DP(D),wre=Q0,Cre={URI:Lt,bimap:H0,mapLeft:G0,map:Xn,of:qr,ap:vs,chain:Ol,alt:_P,fromIO:Qd,throwError:Vv},Ere=Jt(ep),Rre=Wr(Q0),Mre=function(e){return Jt(Uo)(Nd(e))};function xre(e){var t=IP(e),n=OP(e);return{URI:Lt,_E:void 0,map:Xn,ap:t.ap,of:qr,chain:Ol,bimap:H0,mapLeft:G0,alt:n.alt,fromIO:Qd,throwError:Vv}}const kre=Object.freeze(Object.defineProperty({__proto__:null,Alt:ire,ApT:eT,Applicative:wre,ApplicativePar:Q0,ApplicativeSeq:tre,ApplyPar:ep,Bifunctor:Xne,Chain:Bo,Do:yre,FromEither:zo,FromIO:Hv,Functor:X0,Monad:nre,MonadIO:ore,MonadThrow:are,Pointed:Zne,URI:Lt,alt:Z0,altW:Gne,ap:J0,apFirst:CP,apFirstW:Qne,apS:PP,apSW:Sre,apSecond:EP,apSecondW:ere,apW:Vne,bimap:SP,bind:FP,bindTo:bre,bindW:_re,bracket:gre,bracketW:NP,chain:zv,chainEitherK:xP,chainEitherKW:dre,chainFirst:RP,chainFirstEitherK:kP,chainFirstEitherKW:pre,chainFirstIOK:sre,chainFirstW:rre,chainIOK:ure,chainOptionK:fre,chainW:Kv,filterOrElse:AP,filterOrElseW:mre,flap:Jne,flatten:Hne,flattenW:TP,fold:Fne,foldW:Pne,fromEither:hP,fromEitherK:vre,fromIO:Qd,fromIOK:MP,fromOption:cre,fromOptionK:lre,fromPredicate:hre,getAltIOValidation:OP,getApplicativeIOValidation:IP,getApplyMonoid:Rre,getApplySemigroup:Ere,getCompactable:wP,getFilterable:Yne,getIOValidation:xre,getOrElse:gP,getOrElseW:Wne,getSemigroup:Mre,ioEither:Cre,left:fP,leftIO:Ane,map:Y0,mapLeft:$P,match:mP,matchE:K0,matchEW:vP,matchW:Nne,of:qr,orElse:bP,orElseFirst:V0,orElseFirstIOK:Une,orElseFirstW:qne,orElseW:Dne,orLeft:Bne,right:dP,rightIO:pP,sequenceArray:Tre,sequenceSeqArray:Ore,swap:zne,throwError:Vv,toUnion:Lne,traverseArray:LP,traverseArrayWithIndex:$re,traverseReadonlyArrayWithIndex:tT,traverseReadonlyArrayWithIndexSeq:nT,traverseReadonlyNonEmptyArrayWithIndex:WP,traverseReadonlyNonEmptyArrayWithIndexSeq:jP,traverseSeqArray:DP,traverseSeqArrayWithIndex:Ire,tryCatch:yP,tryCatchK:jne},Symbol.toStringTag,{value:"Module"}));function tp(e){return V(_t,e.of)}function np(e){return Yn(e.of(at))}function Gv(e){return function(t){return e.map(t,_t)}}function Yv(e){return V(ns,e.of)}function Jv(e){var t=Yv(e);return function(n){return V(n,t)}}function rT(e){var t=wl(e),n=Jv(e);return function(r){return t(n(r))}}function Zv(e){return function(t){return V(t,e.of)}}function iT(e){var t=wl(e),n=Zv(e);return function(r){return t(n(r))}}function oT(e){return function(t){return function(n){return e.of($v(t)(n))}}}function aT(e){return V(rl,e.of)}function uT(e){return function(t,n){return function(r){return e.map(r,xo(t,n))}}}function Xv(e){return function(t,n){return function(r){return e.chain(r,xo(t,n))}}}function Qv(e){return function(t){return function(n){return e.chain(n,xo(t,e.of))}}}function eg(e){return Cc(e,Qc)}function tg(e){return $o(e,el)}function wl(e){var t=np(e);return function(n){return function(r){return e.chain(r,xo(function(){return t()},n))}}}function ng(e){var t=tp(e);return function(n){return function(r){return e.chain(r,xo(n,t))}}}function Are(e){var t=tg(e),n=eg(e),r=wl(e),i=ng(e),o=Xv(e),a=Qv(e),u=np(e);return{map:function(s,c){return y(s,n(c))},ap:function(s,c){return y(s,t(c))},of:tp(e),chain:function(s,c){return y(s,r(c))},alt:function(s,c){return y(s,i(c))},fold:function(s,c,l){return y(s,o(c,l))},getOrElse:function(s,c){return y(s,a(c))},fromM:Gv(e),none:function(){return u()}}}const Nre=Object.freeze(Object.defineProperty({__proto__:null,alt:ng,ap:tg,chain:wl,chainNullableK:rT,chainOptionK:iT,fromEither:aT,fromF:Gv,fromNullable:Yv,fromNullableK:Jv,fromOptionK:Zv,fromPredicate:oT,getOptionM:Are,getOrElse:Qv,map:eg,match:uT,matchE:Xv,some:tp,zero:np},Symbol.toStringTag,{value:"Module"}));var qP=tp(no),Fre=oT(no),Pre=fi,UP=aT(no),sT=Gv(st),Wre=to(rl),BP=uT(st),jre=BP,cT=Xv(Uv),Lre=cT,Dre=cT,zP=Qv(Zn),qre=zP,Ure=to(mN),Bre=to(Q$),zre=Yv(no),Kre=Jv(no),Vre=rT(Zn),Hre=Zv(no),Gre=iT(Zn),KP=eg(st),VP=tg(Uo),Va=qP,lT=wl(Zn),Yre=lT(D),fT=ng(Zn),Jre=fT,rg=np(no),Zre=rg(),dT=Ji(st,ts),pT=Ao(st,ts,Qc),HP=No(st,Mo),GP=Fo(st,Mo),YP=Ua(st,Mo),JP=Ba(st,Mo),Ko=function(e,t){return y(e,KP(t))},Cl=function(e,t){return y(e,VP(t))},hT=function(e,t){return y(e,lT(t))},ZP=function(e,t){return y(e,fT(t))},Xre=function(e,t){return y(e,HP(t))},Qre=function(e,t){return y(e,GP(t))},eie=function(e,t){return y(e,YP(t))},tie=function(e,t){return y(e,JP(t))},Qn="IOOption",mT={URI:Qn,map:Ko},nie=Ke(mT),XP={URI:Qn,of:Va},ig={URI:Qn,map:Ko,ap:Cl},rie=Ct(ig),iie=Et(ig),oie={URI:Qn,map:Ko,ap:Cl,of:Va},gs={URI:Qn,map:Ko,ap:Cl,chain:hT},aie=ft(gs),uie={URI:Qn,map:Ko,alt:ZP},QP={URI:Qn,zero:rg},sie=qc(QP,XP),cie={URI:Qn,map:Ko,ap:Cl,of:Va,alt:ZP,zero:rg},lie={URI:Qn,map:Ko,ap:Cl,of:Va,chain:hT},fie={URI:Qn,map:Ko,ap:Cl,of:Va,chain:hT,fromIO:sT},die={URI:Qn,compact:dT,separate:pT},pie={URI:Qn,map:Ko,compact:dT,separate:pT,filter:Xre,filterMap:Qre,partition:eie,partitionMap:tie},og={URI:Qn,fromIO:sT},hie=Xi(og),mie=Po(og,gs),vie=Wo(og,gs),ag={URI:Qn,fromEither:UP},gie=gr(ag),yie=wo(ag,gs),bie=Co(ag,gs),_ie=Va(Yt),Sie=wt(mT),$ie=Mt(gs),Tie=Rt(ig),eW=Va(rn),tW=function(e){return V(Bv(e),to(kv(Jn)))},Iie=function(e){var t=tW(e);return function(n){return gt(n)?t(n):eW}};const Oie=Object.freeze(Object.defineProperty({__proto__:null,Alt:uie,Alternative:cie,ApT:eW,Applicative:oie,Apply:ig,Chain:gs,Compactable:die,Do:_ie,Filterable:pie,FromEither:ag,FromIO:og,Functor:mT,Monad:lie,MonadIO:fie,Pointed:XP,Zero:QP,alt:fT,altW:Jre,ap:VP,apFirst:rie,apS:Tie,apSecond:iie,bind:$ie,bindTo:Sie,chain:lT,chainEitherK:yie,chainFirst:aie,chainFirstEitherK:bie,chainFirstIOK:vie,chainIOK:mie,chainNullableK:Vre,chainOptionK:Gre,compact:dT,filter:HP,filterMap:GP,flap:nie,flatten:Yre,fold:Lre,fromEither:UP,fromEitherK:gie,fromIO:sT,fromIOEither:Wre,fromIOK:hie,fromNullable:zre,fromNullableK:Kre,fromOption:Pre,fromOptionK:Hre,fromPredicate:Fre,getOrElse:zP,getOrElseW:qre,guard:sie,map:KP,match:BP,matchE:cT,matchEW:Dre,matchW:jre,none:Zre,of:Va,partition:YP,partitionMap:JP,separate:pT,some:qP,toNullable:Bre,toUndefined:Ure,traverseReadonlyArrayWithIndex:Iie,traverseReadonlyNonEmptyArrayWithIndex:tW,zero:rg},Symbol.toStringTag,{value:"Module"}));var nW=function(){function e(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 e.prototype.write=function(t){var n=this;return function(){n.value=t}},e.prototype.modify=function(t){var n=this;return function(){n.value=t(n.value)}},e}();function wie(e){return function(){return new nW(e)}}const Cie=Object.freeze(Object.defineProperty({__proto__:null,IORef:nW,newIORef:wie},Symbol.toStringTag,{value:"Module"})),Eie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Rie=function(e){return ss(function(){return JSON.parse(e)},D)},Mie=function(e){return ss(function(){var t=JSON.stringify(e);if(typeof t!="string")throw new Error("Converting unsupported structure to JSON");return t},D)};const xie=Object.freeze(Object.defineProperty({__proto__:null,parse:Rie,stringify:Mie},Symbol.toStringTag,{value:"Module"})),kie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Aie=function(e){return new Map(e)};function Nie(e){return new Map(e)}function rW(e,t){return{show:function(n){var r=[];return n.forEach(function(i,o){r.push("[".concat(e.show(o),", ").concat(t.show(i),"]"))}),"new Map([".concat(r.sort().join(", "),"])")}}}var iW=function(e){return e.size},ro=function(e){return e.size===0};function ug(e){var t=ys(e);return function(n,r){if(r===void 0){var i=ug(e);return function(o){return i(n,o)}}return bt(t(n,r))}}function vT(e){return function(t,n){if(n===void 0){var r=vT(e);return function(u){return r(t,u)}}for(var i=n.values(),o;!(o=i.next()).done;){var a=o.value;if(e.equals(t,a))return!0}return!1}}var El=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},Fie=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function oW(e){var t=El(e);return function(n){return function(r){for(var i=[],o=t(r),a=0,u=o;a<u.length;a++){var s=u[a];i.push(n(s,r.get(s)))}return i}}}var aW=function(e){return oW(e)(function(t,n){return[t,n]})};function Pie(e,t){var n=aW(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?pe([i[a],a+1]):be})}}var uW=function(e){var t=Vo(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(Wt(a)){var u=new Map(o);return u.set(n,r),u}else if(a.value[1]!==r){var u=new Map(o);return u.set(a.value[0],r),u}return o}}},sW=function(e){var t=Vo(e);return function(n){return function(r){var i=t(n,r);if(bt(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},Wie=function(e){var t=cW(e);return function(n,r){return t(n,function(){return r})}},cW=function(e){var t=Vo(e);return function(n,r){return function(i){var o=t(n,i);if(Wt(o))return be;var a=o.value,u=a[0],s=a[1],c=r(s);if(c===s)return pe(i);var l=new Map(i);return l.set(u,c),pe(l)}}};function jie(e){var t=ys(e),n=sW(e);return function(r){var i=n(r);return function(o){return y(t(r,o),Yi(function(a){return[a,i(o)]}))}}}function Vo(e){return function(t,n){if(n===void 0){var r=Vo(e);return function(c){return r(t,c)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];if(e.equals(u,t))return pe([u,s])}return be}}function ys(e){var t=Vo(e);return function(n,r){if(r===void 0){var i=ys(e);return function(o){return i(n,o)}}return y(t(n,r),Yi(function(o){o[0];var a=o[1];return a}))}}function sg(e,t){var n=Vo(e);return function(r,i){if(i===void 0){var o=sg(e,t);return function(d){return o(d,r)}}for(var a=r.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c,i);if(Wt(f)||!e.equals(c,f.value[0])||!t.equals(l,f.value[1]))return!1}return!0}}var cg=new Map;function lW(e,t){var n=sg(e,t);return Pr(function(r,i){return n(r,i)&&n(i,r)})}function Lie(e,t){var n=Vo(e);return{concat:function(r,i){if(ro(r))return i;if(ro(i))return r;for(var o=new Map(r),a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c,r);bt(f)?o.set(f.value[0],t.concat(f.value[1],l)):o.set(c,l)}return o},empty:cg}}var Die=function(e,t){return new Map([[e,t]])};function qie(e,t,n){return function(r){var i=Vo(e);return n.reduce(r,new Map,function(o,a){var u=a[0],s=a[1],c=i(u,o);return bt(c)?o.set(c.value[0],t.concat(c.value[1],s)):o.set(u,s),o})}}var Rl=function(e,t){for(var n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];n.set(a,t(a,u))}return n},fW=function(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1],c=e(u,s);Gt(c)?n.set(u,c.left):r.set(u,c.right)}return Me(n,r)}};function dW(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];e(u,s)?r.set(u,s):n.set(u,s)}return Me(n,r)}}var pW=function(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1],s=e(a,u);bt(s)&&n.set(a,s.value)}return n}};function hW(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];e(a,u)&&n.set(a,u)}return n}}var Ho=function(e,t){return Rl(e,function(n,r){return t(r)})},rp=function(e,t){return mW(e,function(n,r){return t(r)})},ip=function(e,t){return vW(e,function(n,r){return t(r)})},op=function(e,t){return gW(e,function(n,r){return t(r)})},ap=function(e,t){return yW(e,function(n,r){return t(r)})},mW=function(e,t){return y(e,hW(t))},vW=function(e,t){return y(e,pW(t))},gW=function(e,t){return y(e,dW(t))},yW=function(e,t){return y(e,fW(t))},Ml=function(e){for(var t=new Map,n=e.entries(),r;!(r=n.next()).done;){var i=r.value,o=i[0],a=i[1];bt(a)&&t.set(o,a.value)}return t},Uie=function(e){return function(t){return rp(t,e)}},Bie=function(e){return function(t){return ip(t,e)}},zie=function(e){return function(t){return Ho(t,e)}},Kie=function(e){return function(t){return Rl(t,e)}},Vie=function(e){return function(t){return op(t,e)}},Hie=function(e){return function(t){return ap(t,e)}},xl=function(e){for(var t=new Map,n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];Gt(u)?t.set(a,u.left):n.set(a,u.right)}return Me(t,n)},Ur="ReadonlyMap",bW=function(e,t){var n=TT(e,t);return{concat:function(r,i){return n(i)(r)}}},Gie=function(e,t){return{concat:bW(e,t).concat,empty:cg}},Yie=function(e,t){var n=IT(e,t);return{concat:function(r,i){return n(i)(r)}}},Jie=function(e){return function(){var t=OT(e);return{concat:function(n,r){return t(r)(n)}}}};function Zie(){return{URI:Ur,_E:void 0,map:Ho,mapWithIndex:Rl,compact:Ml,separate:xl,filter:rp,filterMap:ip,partition:op,partitionMap:ap,partitionMapWithIndex:yW,partitionWithIndex:gW,filterMapWithIndex:vW,filterWithIndex:mW}}var _W={URI:Ur,map:Ho},Xie=Ke(_W),Qie=function(){return{URI:Ur,_E:void 0,map:Ho,mapWithIndex:Rl}},gT={URI:Ur,compact:Ml,separate:xl},eoe={URI:Ur,map:Ho,compact:Ml,separate:xl,filter:rp,filterMap:ip,partition:op,partitionMap:ap},yT=function(e){var t=fg(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},bT=function(e){var t=dg(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}},_T=function(e){var t=pg(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},lg=function(e){var t=yT(e),n=bT(e),r=_T(e);return{URI:Ur,_E:void 0,reduce:function(i,o,a){return y(i,t(o,a))},foldMap:function(i){var o=n(i);return function(a,u){return y(a,o(u))}},reduceRight:function(i,o,a){return y(i,r(o,a))}}},fg=function(e){var t=El(e);return function(n,r){return function(i){for(var o=n,a=0,u=t(i);a<u.length;a++){var s=u[a];o=r(s,o,i.get(s))}return o}}},dg=function(e){var t=El(e);return function(n){return function(r){return function(i){for(var o=n.empty,a=0,u=t(i);a<u.length;a++){var s=u[a];o=n.concat(o,r(s,i.get(s)))}return o}}}},pg=function(e){var t=El(e);return function(n,r){return function(i){for(var o=n,a=t(i),u=a.length,s=u-1;s>=0;s--){var c=a[s];o=r(c,i.get(c),o)}return o}}},ST=function(e){var t=lg(e),n=fg(e),r=dg(e),i=pg(e);return{URI:Ur,_E:void 0,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:function(o,a,u){return y(o,n(a,u))},foldMapWithIndex:function(o){var a=r(o);return function(u,s){return y(u,a(s))}},reduceRightWithIndex:function(o,a,u){return y(o,i(a,u))}}},toe=function(e){var t=$T(e),n=lg(e);return{URI:Ur,_E:void 0,map:Ho,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:t.traverse,sequence:t.sequence}},$T=function(e){var t=ST(e),n=El(e),r=function(a){return function(u,s){for(var c=a.of(new Map),l=n(u),f=l.length,d=function(h){var v=l[h],m=u.get(v);c=a.ap(a.map(c,function(_){return function(g){return _.set(v,g)}}),s(v,m))},p=0;p<f;p++)d(p);return c}},i=function(a){var u=r(a);return function(s,c){return u(s,function(l,f){return c(f)})}},o=function(a){var u=r(a);return function(s){return u(s,Jn)}};return{URI:Ur,_E:void 0,map:Ho,mapWithIndex:Rl,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:i,sequence:o,traverseWithIndex:r}};function noe(e){var t=$T(e);return{URI:Ur,_E:void 0,map:Ho,compact:Ml,separate:xl,filter:rp,filterMap:ip,partition:op,partitionMap:ap,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:Rl,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:oi(t,gT),wither:ai(t,gT)}}var TT=function(e,t){var n=ys(e);return function(r){return function(i){if(ro(i))return r;if(ro(r))return i;for(var o=new Map,a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c)(r);bt(f)?o.set(c,t.concat(l,f.value)):o.set(c,l)}for(var d=r.entries();!(u=d.next()).done;){var p=u.value,c=p[0],l=p[1],f=n(c)(o);Wt(f)&&o.set(c,l)}return o}}},IT=function(e,t){var n=ys(e);return function(r){return function(i){if(ro(i)||ro(r))return cg;for(var o=new Map,a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c)(r);bt(f)&&o.set(c,t.concat(l,f.value))}return o}}},OT=function(e){var t=ug(e);return function(n){return function(r){if(ro(r))return n;if(ro(n))return r;for(var i=new Map,o=r.entries(),a;!(a=o.next()).done;){var u=a.value,s=u[0],c=u[1];t(s)(n)||i.set(s,c)}for(var l=n.entries();!(a=l.next()).done;){var f=a.value,s=f[0],c=f[1];t(s)(r)||i.set(s,c)}return i}}},roe=uW,ioe={URI:Ur,map:Ho,compact:Ml,separate:xl,filter:rp,filterMap:ip,partition:op,partitionMap:ap};const ooe=Object.freeze(Object.defineProperty({__proto__:null,Compactable:gT,Filterable:eoe,Functor:_W,URI:Ur,collect:oW,compact:Ml,deleteAt:sW,difference:OT,elem:vT,empty:cg,filter:Uie,filterMap:Bie,filterMapWithIndex:pW,filterWithIndex:hW,flap:Xie,foldMap:bT,foldMapWithIndex:dg,fromFoldable:qie,fromMap:Aie,getDifferenceMagma:Jie,getEq:lW,getFilterableWithIndex:Zie,getFoldable:lg,getFoldableWithIndex:ST,getFunctorWithIndex:Qie,getIntersectionSemigroup:Yie,getMonoid:Lie,getShow:rW,getTraversable:toe,getTraversableWithIndex:$T,getUnionMonoid:Gie,getUnionSemigroup:bW,getWitherable:noe,insertAt:roe,intersection:IT,isEmpty:ro,isSubmap:sg,keys:El,lookup:ys,lookupWithKey:Vo,map:zie,mapWithIndex:Kie,member:ug,modifyAt:cW,partition:Vie,partitionMap:Hie,partitionMapWithIndex:fW,partitionWithIndex:dW,pop:jie,readonlyMap:ioe,reduce:yT,reduceRight:_T,reduceRightWithIndex:pg,reduceWithIndex:fg,separate:xl,singleton:Die,size:iW,toMap:Nie,toReadonlyArray:aW,toUnfoldable:Pie,union:TT,updateAt:Wie,upsertAt:uW,values:Fie},Symbol.toStringTag,{value:"Module"}));var kl=globalThis&&globalThis.__assign||function(){return kl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},kl.apply(this,arguments)},aoe=rW,uoe=iW,Go=ro,soe=ug,coe=vT,wT=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},loe=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function SW(e){var t=wT(e);return function(n){return function(r){for(var i=[],o=t(r),a=0,u=o;a<u.length;a++){var s=u[a];i.push(n(s,r.get(s)))}return i}}}function $W(e){return SW(e)(function(t,n){return[t,n]})}function foe(e,t){var n=$W(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?pe([i[a],a+1]):be})}}var TW=function(e){var t=bs(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(Wt(a)){var u=new Map(o);return u.set(n,r),u}else if(a.value[1]!==r){var u=new Map(o);return u.set(a.value[0],r),u}return o}}},IW=function(e){var t=bs(e);return function(n){return function(r){var i=t(n,r);if(bt(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},doe=function(e){var t=OW(e);return function(n,r){return t(n,function(){return r})}},OW=function(e){var t=bs(e);return function(n,r){return function(i){var o=t(n,i);if(Wt(o))return be;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),pe(a)}}};function poe(e){var t=wW(e),n=IW(e);return function(r){var i=n(r);return function(o){return y(t(r,o),Yi(function(a){return[a,i(o)]}))}}}function bs(e){return function(t,n){if(n===void 0){var r=bs(e);return function(c){return r(t,c)}}for(var i=n.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];if(e.equals(u,t))return pe([u,s])}return be}}var wW=ys,hoe=sg,moe=lW;function voe(e,t){var n=bs(e);return{concat:function(r,i){if(Go(r))return i;if(Go(i))return r;for(var o=new Map(r),a=i.entries(),u;!(u=a.next()).done;){var s=u.value,c=s[0],l=s[1],f=n(c,r);bt(f)?o.set(f.value[0],t.concat(f.value[1],l)):o.set(c,l)}return o},empty:new Map}}var goe=function(e,t){return new Map([[e,t]])};function yoe(e,t,n){return function(r){var i=bs(e);return n.reduce(r,new Map,function(o,a){var u=a[0],s=a[1],c=i(u,o);return bt(c)?o.set(c.value[0],t.concat(c.value[1],s)):o.set(u,s),o})}}var up=function(e,t){for(var n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];n.set(a,t(a,u))}return n},CW=function(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1],c=e(u,s);Gt(c)?n.set(u,c.left):r.set(u,c.right)}return Me(n,r)}};function EW(e){return function(t){for(var n=new Map,r=new Map,i=t.entries(),o;!(o=i.next()).done;){var a=o.value,u=a[0],s=a[1];e(u,s)?r.set(u,s):n.set(u,s)}return Me(n,r)}}var RW=function(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1],s=e(a,u);bt(s)&&n.set(a,s.value)}return n}};function MW(e){return function(t){for(var n=new Map,r=t.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];e(a,u)&&n.set(a,u)}return n}}var Al=function(e,t){return up(e,function(n,r){return t(r)})},hg=function(e,t){return xW(e,function(n,r){return t(r)})},mg=function(e,t){return kW(e,function(n,r){return t(r)})},vg=function(e,t){return AW(e,function(n,r){return t(r)})},gg=function(e,t){return NW(e,function(n,r){return t(r)})},xW=function(e,t){return y(e,MW(t))},kW=function(e,t){return y(e,RW(t))},AW=function(e,t){return y(e,EW(t))},NW=function(e,t){return y(e,CW(t))},sp=function(e){for(var t=new Map,n=e.entries(),r;!(r=n.next()).done;){var i=r.value,o=i[0],a=i[1];bt(a)&&t.set(o,a.value)}return t},boe=function(e){return function(t){return hg(t,e)}},_oe=function(e){return function(t){return mg(t,e)}},Soe=function(e){return function(t){return Al(t,e)}},$oe=function(e){return function(t){return up(t,e)}},Toe=function(e){return function(t){return vg(t,e)}},Ioe=function(e){return function(t){return gg(t,e)}},cp=function(e){for(var t=new Map,n=new Map,r=e.entries(),i;!(i=r.next()).done;){var o=i.value,a=o[0],u=o[1];Gt(u)?t.set(a,u.left):n.set(a,u.right)}return Me(t,n)},Yo="Map",FW=function(e,t){var n=DW(e,t);return{concat:function(r,i){return n(i)(r)}}},Ooe=function(e,t){return{concat:FW(e,t).concat,empty:new Map}},woe=function(e,t){var n=qW(e,t);return{concat:function(r,i){return n(i)(r)}}},Coe=function(e){return function(){var t=UW(e);return{concat:function(n,r){return t(r)(n)}}}};function Eoe(){return{URI:Yo,_E:void 0,map:Al,mapWithIndex:up,compact:sp,separate:cp,filter:hg,filterMap:mg,partition:vg,partitionMap:gg,partitionMapWithIndex:NW,partitionWithIndex:AW,filterMapWithIndex:kW,filterWithIndex:xW}}function Roe(e){var t=WW(e);return{URI:Yo,_E:void 0,map:Al,compact:sp,separate:cp,filter:hg,filterMap:mg,partition:vg,partitionMap:gg,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:up,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:oi(t,CT),wither:ai(t,CT)}}var Moe=yT,xoe=bT,koe=_T,Aoe=function(e){return kl(kl({},lg(e)),{URI:Yo})},Noe=fg,Foe=dg,Poe=pg,PW=function(e){return kl(kl({},ST(e)),{URI:Yo})},WW=function(e){var t=PW(e),n=wT(e),r=function(a){return function(u,s){for(var c=a.of(new Map),l=n(u),f=l.length,d=function(h){var v=l[h],m=u.get(v);c=a.ap(a.map(c,function(_){return function(g){return _.set(v,g)}}),s(v,m))},p=0;p<f;p++)d(p);return c}},i=function(a){var u=r(a);return function(s,c){return u(s,function(l,f){return c(f)})}},o=function(a){var u=r(a);return function(s){return u(s,function(c,l){return l})}};return{URI:Yo,_E:void 0,map:Al,mapWithIndex:up,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:i,sequence:o,traverseWithIndex:r}},jW={URI:Yo,map:Al},Woe=Ke(jW),CT={URI:Yo,compact:sp,separate:cp},LW={URI:Yo,map:Al,compact:sp,separate:cp,filter:hg,filterMap:mg,partition:vg,partitionMap:gg},yg=function(e){return new Map(e)},DW=function(e,t){var n=TT(e,t);return function(r){return function(i){return Go(i)?yg(r):Go(r)?yg(i):n(r)(i)}}},qW=function(e,t){var n=IT(e,t);return function(r){return function(i){return Go(i)||Go(r)?new Map:n(r)(i)}}},UW=function(e){var t=OT(e);return function(n){return function(r){return Go(r)?yg(n):Go(n)?yg(r):t(n)(r)}}},joe=new Map,Loe=TW,Doe=LW;const qoe=Object.freeze(Object.defineProperty({__proto__:null,Compactable:CT,Filterable:LW,Functor:jW,URI:Yo,collect:SW,compact:sp,deleteAt:IW,difference:UW,elem:coe,empty:joe,filter:boe,filterMap:_oe,filterMapWithIndex:RW,filterWithIndex:MW,flap:Woe,foldMap:xoe,foldMapWithIndex:Foe,fromFoldable:yoe,getDifferenceMagma:Coe,getEq:moe,getFilterableWithIndex:Eoe,getFoldable:Aoe,getFoldableWithIndex:PW,getIntersectionSemigroup:woe,getMonoid:voe,getShow:aoe,getTraversableWithIndex:WW,getUnionMonoid:Ooe,getUnionSemigroup:FW,getWitherable:Roe,insertAt:Loe,intersection:qW,isEmpty:Go,isSubmap:hoe,keys:wT,lookup:wW,lookupWithKey:bs,map:Soe,mapWithIndex:$oe,map_:Doe,member:soe,modifyAt:OW,partition:Toe,partitionMap:Ioe,partitionMapWithIndex:CW,partitionWithIndex:EW,pop:poe,reduce:Moe,reduceRight:koe,reduceRightWithIndex:Poe,reduceWithIndex:Noe,separate:cp,singleton:goe,size:uoe,toArray:$W,toUnfoldable:foe,union:DW,updateAt:doe,upsertAt:TW,values:loe},Symbol.toStringTag,{value:"Module"})),Uoe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Boe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),zoe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Koe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Voe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var BW=function(e){return{concat:cm(e).concat,empty:e.top}},zW=function(e){return{concat:lm(e).concat,empty:e.bottom}},ET=function(e){return{concat:S_(e).concat,empty:e.empty}},KW=function(e){var t={};for(var n in e)lt.call(e,n)&&(t[n]=e[n].empty);return{concat:$_(e).concat,empty:t}},VW=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:T_.apply(OM,e).concat,empty:e.map(function(n){return n.empty})}},HW=function(e){return O_(e)(e.empty)},Hoe={concat:bM.concat,empty:void 0},Goe=VW,Yoe=KW,Joe=ET,Zoe=zW,Xoe=BW,Qoe=HW,GW={concat:_M.concat,empty:!0},YW={concat:SM.concat,empty:!1},eae=VR,tae=function(){return ET(uF())},nae={concat:$M.concat,empty:""},rae={concat:TM.concat,empty:0},iae={concat:IM.concat,empty:1};const oae=Object.freeze(Object.defineProperty({__proto__:null,concatAll:HW,fold:Qoe,getDualMonoid:Joe,getEndomorphismMonoid:tae,getFunctionMonoid:eae,getJoinMonoid:Zoe,getMeetMonoid:Xoe,getStructMonoid:Yoe,getTupleMonoid:Goe,max:zW,min:BW,monoidAll:GW,monoidAny:YW,monoidProduct:iae,monoidString:nae,monoidSum:rae,monoidVoid:Hoe,reverse:ET,struct:KW,tuple:VW},Symbol.toStringTag,{value:"Module"})),aae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var JW=function(e,t,n){return function(r){return r===-1?e():r===0?t():n()}},uae=JW,ZW=function(e){return e===-1?1:e===1?-1:0},XW={equals:function(e,t){return e===t}},RT={concat:function(e,t){return e!==0?e:t}},QW={concat:RT.concat,empty:0},sae=function(e){return e<=-1?-1:e>=1?1:0},cae=ZW,lae=RT,fae=XW,dae=QW;const pae=Object.freeze(Object.defineProperty({__proto__:null,Eq:XW,Monoid:QW,Semigroup:RT,eqOrdering:fae,invert:cae,match:uae,matchW:JW,monoidOrdering:dae,reverse:ZW,semigroupOrdering:lae,sign:sae},Symbol.toStringTag,{value:"Module"}));var hae=function(e){return typeof e.map=="function"},mae=function(e){return typeof e.contramap=="function"},vae=function(e){return typeof e.mapWithIndex=="function"},gae=function(e){return typeof e.ap=="function"},yae=function(e){return typeof e.chain=="function"},bae=function(e){return typeof e.bimap=="function"},_ae=function(e){return typeof e.extend=="function"},Sae=function(e){return typeof e.reduce=="function"},$ae=function(e){return typeof e.reduceWithIndex=="function"},Tae=function(e){return typeof e.alt=="function"},Iae=function(e){return typeof e.compact=="function"},Oae=function(e){return typeof e.filter=="function"},wae=function(e){return typeof e.filterWithIndex=="function"},Cae=function(e){return typeof e.promap=="function"},Eae=function(e){return typeof e.compose=="function"},Rae=function(e){return typeof e.throwError=="function"};function Mae(e){var t={};if(hae(e)){var n=function(C){return function(O){return e.map(O,C)}};t.map=n}if(mae(e)){var r=function(C){return function(O){return e.contramap(O,C)}};t.contramap=r}if(vae(e)){var i=function(C){return function(O){return e.mapWithIndex(O,C)}};t.mapWithIndex=i}if(gae(e)){var o=function(C){return function(O){return e.ap(O,C)}},a=function(C){return function(O){return e.ap(e.map(O,function(F){return function(){return F}}),C)}};t.ap=o,t.apFirst=a,t.apSecond=function(C){return function(O){return e.ap(e.map(O,function(){return function(F){return F}}),C)}}}if(yae(e)){var u=function(C){return function(O){return e.chain(O,C)}},s=function(C){return function(O){return e.chain(O,function(F){return e.map(C(F),function(){return F})})}},c=function(C){return e.chain(C,D)};t.chain=u,t.chainFirst=s,t.flatten=c}if(bae(e)){var l=function(C,O){return function(F){return e.bimap(F,C,O)}},f=function(C){return function(O){return e.mapLeft(O,C)}};t.bimap=l,t.mapLeft=f}if(_ae(e)){var d=function(C){return function(O){return e.extend(O,C)}},p=function(C){return e.extend(C,D)};t.extend=d,t.duplicate=p}if(Sae(e)){var h=function(C,O){return function(F){return e.reduce(F,C,O)}},v=function(C){var O=e.foldMap(C);return function(F){return function(j){return O(j,F)}}},m=function(C,O){return function(F){return e.reduceRight(F,C,O)}};t.reduce=h,t.foldMap=v,t.reduceRight=m}if($ae(e)){var _=function(C,O){return function(F){return e.reduceWithIndex(F,C,O)}},g=function(C){var O=e.foldMapWithIndex(C);return function(F){return function(j){return O(j,F)}}},S=function(C,O){return function(F){return e.reduceRightWithIndex(F,C,O)}};t.reduceWithIndex=_,t.foldMapWithIndex=g,t.reduceRightWithIndex=S}if(Tae(e)){var b=function(C){return function(O){return e.alt(O,C)}};t.alt=b}if(Iae(e)&&(t.compact=e.compact,t.separate=e.separate),Oae(e)){var $=function(C){return function(O){return e.filter(O,C)}},T=function(C){return function(O){return e.filterMap(O,C)}},M=function(C){return function(O){return e.partition(O,C)}},R=function(C){return function(O){return e.partitionMap(O,C)}};t.filter=$,t.filterMap=T,t.partition=M,t.partitionMap=R}if(wae(e)){var q=function(C){return function(O){return e.filterWithIndex(O,C)}},Y=function(C){return function(O){return e.filterMapWithIndex(O,C)}},N=function(C){return function(O){return e.partitionWithIndex(O,C)}},Z=function(C){return function(O){return e.partitionMapWithIndex(O,C)}};t.filterWithIndex=q,t.filterMapWithIndex=Y,t.partitionWithIndex=N,t.partitionMapWithIndex=Z}if(Cae(e)){var ie=function(C,O){return function(F){return e.promap(F,C,O)}};t.promap=ie}if(Eae(e)){var J=function(C){return function(O){return e.compose(O,C)}};t.compose=J}if(Rae(e)){var ye=function(C){return function(O){return O._tag==="None"?e.throwError(C()):e.of(O.value)}},we=function(C){return C._tag==="Left"?e.throwError(C.left):e.of(C.right)},x=function(C,O){return function(F){return C(F)?e.of(F):e.throwError(O(F))}},k=function(C,O){return function(F){return e.chain(F,function(j){return C(j)?e.of(j):e.throwError(O(j))})}};t.fromOption=ye,t.fromEither=we,t.fromPredicate=x,t.filterOrElse=k}return t}var de=y;const xae=Object.freeze(Object.defineProperty({__proto__:null,pipe:de,pipeable:Mae},Symbol.toStringTag,{value:"Module"})),kae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Aae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var bg=function(){return Math.random()};function ej(e,t){return y(bg,to(function(n){return Math.floor((t-e+1)*n+e)}))}function Nae(e,t){return y(bg,to(function(n){return(t-e)*n+e}))}var Fae=y(bg,to(function(e){return e<.5})),Pae=function(e){return y(ej(0,e.length-1),to(function(t){return e[t]}))};const Wae=Object.freeze(Object.defineProperty({__proto__:null,random:bg,randomBool:Fae,randomElem:Pae,randomInt:ej,randomRange:Nae},Symbol.toStringTag,{value:"Module"}));var MT=cl(O0),tj=cs(O0),nj=ll(sn),jae=fl(sn),rj=Qi,ij=nj,oj=Dd(sn),Lae=oj,xT=gl(Do),Dae=xT,aj=xT,qae=aj,uj=yl(Do),Uae=uj,Bae=Bd(sn),zae=zd,sj=Kd,Kae=sj,cj=fs(Do),Vae=cj,lj=qd(Do),Hae=lj,Gae=Ud(Do),Yae=bl(sn),Br=function(e,t){return y(e,dj(t))},kT=function(e,t,n){return y(e,pj(t,n))},AT=function(e,t){return y(e,hj(t))},Nl=function(e,t){return y(e,NT(t))},lp=function(e,t){return y(e,FT(t))},fj=function(e,t){return y(e,PT(t))},dj=dl(sn),pj=ml(sn),hj=vl(sn),NT=pl(Lo),Jae=NT,io=tj,FT=ls(Do),mj=FT,vj=mj(D),Zae=vj,PT=hl(Do),Xae=PT,WT=MT,Zt="ReaderEither",gj=function(e){var t=as(e);return{URI:Zt,_E:void 0,compact:Ji(sn,t),separate:Ao(sn,t,Da)}};function Qae(e){var t=al(e),n=gj(e),r=No(sn,t),i=Fo(sn,t),o=Ua(sn,t),a=Ba(sn,t);return{URI:Zt,_E:void 0,map:Br,compact:n.compact,separate:n.separate,filter:function(u,s){return y(u,r(s))},filterMap:function(u,s){return y(u,i(s))},partition:function(u,s){return y(u,o(s))},partitionMap:function(u,s){return y(u,a(s))}}}function yj(e){var t=$o(Lo,La(e));return{URI:Zt,_E:void 0,map:Br,ap:function(n,r){return y(n,t(r))},of:io}}function bj(e){var t=Ld(Do,e);return{URI:Zt,_E:void 0,map:Br,alt:function(n,r){return y(n,t(r))}}}var jT={URI:Zt,map:Br},eue=Ke(jT),tue={URI:Zt,of:io},fp={URI:Zt,map:Br,ap:Nl},_j=Ct(fp),nue=_j,Sj=Et(fp),rue=Sj,$j={URI:Zt,map:Br,ap:Nl,of:io},Jo={URI:Zt,map:Br,ap:Nl,chain:lp},iue={URI:Zt,map:Br,ap:Nl,of:io,chain:lp},Tj=ft(Jo),oue=Tj,aue={URI:Zt,bimap:kT,mapLeft:AT},uue={URI:Zt,map:Br,alt:fj},Fl={URI:Zt,fromReader:ij},sue=Hd(Fl),cue=Gd(Fl),lue=hs(Fl),Ij=Yd(Fl,Jo),fue=Ij,Oj=Jd(Fl,Jo),due=Oj,pue={URI:Zt,map:Br,ap:Nl,of:io,chain:lp,throwError:WT},Zo={URI:Zt,fromEither:rj},hue=Vi(Zo),mue=Hi(Zo),vue=Gu(Zo,Jo),wj=wo(Zo,Jo),gue=wj,Cj=Co(Zo,Jo),yue=Cj,bue=Aa(Zo),Ej=Yu(Zo,Jo),_ue=Ej,Sue=gr(Zo),$ue=io(Yt),Tue=wt(jT),Rj=Mt(Jo),Iue=Rj,Mj=Rt(fp),Oue=Mj,xj=io(rn),kj=function(e){return V(ps(e),ds(jd(Jn)))},LT=function(e){var t=kj(e);return function(n){return gt(n)?t(n):xj}},wue=LT,Aj=function(e){return LT(function(t,n){return e(n)})},Cue=Aj(D),Eue={URI:Zt,bimap:kT,mapLeft:AT,map:Br,of:io,ap:Nl,chain:lp,alt:fj,throwError:MT},Rue=Jt(fp),Mue=Wr($j),xue=function(e){return Jt(Lo)(Nd(e))};function kue(e){var t=yj(e),n=bj(e);return{URI:Zt,_E:void 0,map:Br,ap:t.ap,of:io,chain:lp,bimap:kT,mapLeft:AT,alt:n.alt,throwError:WT}}const Aue=Object.freeze(Object.defineProperty({__proto__:null,Alt:uue,ApT:xj,Applicative:$j,Apply:fp,Bifunctor:aue,Chain:Jo,Do:$ue,FromEither:Zo,FromReader:Fl,Functor:jT,Monad:iue,MonadThrow:pue,Pointed:tue,URI:Zt,alt:PT,altW:Xae,ap:NT,apFirst:_j,apFirstW:nue,apS:Mj,apSW:Oue,apSecond:Sj,apSecondW:rue,apW:Jae,ask:sue,asks:cue,asksReaderEither:Kae,asksReaderEitherW:sj,bimap:pj,bind:Rj,bindTo:Tue,bindW:Iue,chain:FT,chainEitherK:wj,chainEitherKW:gue,chainFirst:Tj,chainFirstEitherK:Cj,chainFirstEitherKW:yue,chainFirstReaderK:Oj,chainFirstReaderKW:due,chainFirstW:oue,chainOptionK:vue,chainReaderK:Ij,chainReaderKW:fue,chainW:mj,filterOrElse:Ej,filterOrElseW:_ue,flap:eue,flatten:Zae,flattenW:vj,fold:Dae,foldW:qae,fromEither:rj,fromEitherK:Sue,fromOption:hue,fromOptionK:mue,fromPredicate:bue,fromReader:ij,fromReaderK:lue,getAltReaderValidation:bj,getApplicativeReaderValidation:yj,getApplyMonoid:Mue,getApplySemigroup:Rue,getCompactable:gj,getFilterable:Qae,getOrElse:uj,getOrElseW:Uae,getReaderValidation:kue,getSemigroup:xue,left:MT,leftReader:jae,local:zae,map:dj,mapLeft:hj,match:oj,matchE:xT,matchEW:aj,matchW:Lae,of:io,orElse:cj,orElseFirst:lj,orElseFirstW:Hae,orElseW:Vae,orLeft:Gae,readerEither:Eue,right:tj,rightReader:nj,sequenceArray:Cue,swap:Yae,throwError:WT,toUnion:Bae,traverseArray:Aj,traverseArrayWithIndex:wue,traverseReadonlyArrayWithIndex:LT,traverseReadonlyNonEmptyArrayWithIndex:kj},Symbol.toStringTag,{value:"Module"}));function DT(e){return function(t){return function(){return e.of(t)}}}function qT(e){return function(t){return function(n){return function(r){return e.map(n(r),t)}}}}function UT(e){return function(t){return function(n){return function(r){return e.ap(n(r),t(r))}}}}function BT(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){return t(i)(r)})}}}}function zT(e){return function(t){return V(t,e.of)}}function Nue(e){return function(t){return V(t,e)}}function Fue(e){var t=UT(e),n=qT(e),r=BT(e);return{map:function(i,o){return y(i,n(o))},ap:function(i,o){return y(i,t(o))},of:DT(e),chain:function(i,o){return y(i,r(o))},ask:function(){return e.of},asks:function(i){return V(i,e.of)},local:function(i,o){return function(a){return i(o(a))}},fromReader:zT(e),fromM:function(i){return function(){return i}}}}const Pue=Object.freeze(Object.defineProperty({__proto__:null,ap:UT,chain:BT,fromNaturalTransformation:Nue,fromReader:zT,getReaderM:Fue,map:qT,of:DT},Symbol.toStringTag,{value:"Module"}));var Fn=function(e){return function(){return Promise.resolve().then(e)}};function Wue(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var pi=function(e,t){return y(e,Ha(t))},_s=function(e,t){return y(e,Nj(t))},KT=function(e,t){return y(e,dp(function(n){return y(t,Ha(n))}))},Pl=function(e,t){return y(e,dp(t))},Ha=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},Nj=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(n){var r=n[0],i=n[1];return r(i)})}}},In=function(e){return function(){return Promise.resolve(e)}},dp=function(e){return function(t){return function(){return Promise.resolve().then(t).then(function(n){return e(n)()})}}},jue=dp(D),Pn="Task";function Lue(){return{concat:function(e,t){return function(){return Promise.race([Promise.resolve().then(e),Promise.resolve().then(t)])}},empty:Pj}}var De={URI:Pn,map:pi},Due=Ke(De),cn={URI:Pn,of:In},Ss={URI:Pn,map:pi,ap:_s},que=Ct(Ss),Uue=Et(Ss),pp={URI:Pn,map:pi,ap:_s,of:In},_g={URI:Pn,map:pi,ap:KT},Fj={URI:Pn,map:pi,ap:KT,of:In},Wl={URI:Pn,map:pi,ap:_s,chain:Pl},Xt={URI:Pn,map:pi,of:In,ap:_s,chain:Pl},Bue={URI:Pn,map:pi,of:In,ap:_s,chain:Pl,fromIO:Fn},hp=D,zue={URI:Pn,map:pi,of:In,ap:_s,chain:Pl,fromIO:Fn,fromTask:hp},Kue=ft(Wl),Sg={URI:Pn,fromIO:Fn},Vue=Xi(Sg),Hue=Po(Sg,Wl),Gue=Wo(Sg,Wl),Yue={URI:Pn,fromIO:Fn,fromTask:hp},Pj=function(){return new Promise(function(e){})},Jue=In(Yt),Zue=wt(De),Xue=Mt(Wl),Que=Rt(Ss),VT=In(rn),jl=function(e){return function(t){return function(){return Promise.all(t.map(function(n,r){return Promise.resolve().then(function(){return e(r,n)()})}))}}},HT=function(e){var t=jl(e);return function(n){return gt(n)?t(n):VT}},GT=function(e){return function(t){return function(){return Rc(t).reduce(function(n,r,i){return n.then(function(o){return Promise.resolve().then(e(i+1,r)).then(function(a){return o.push(a),o})})},Promise.resolve().then(e(0,dr(t))).then(Vf))}}},YT=function(e){var t=GT(e);return function(n){return gt(n)?t(n):VT}},ese=HT,Wj=function(e){return HT(function(t,n){return e(n)})},tse=Wj(D),nse=YT,jj=function(e){return YT(function(t,n){return e(n)})},rse=jj(D),ise={URI:Pn,map:pi,of:In,ap:_s,chain:Pl,fromIO:Fn,fromTask:hp},ose={URI:Pn,map:pi,of:In,ap:KT,chain:Pl,fromIO:Fn,fromTask:hp},ase=Jt(_g),use=Wr(Fj);const sse=Object.freeze(Object.defineProperty({__proto__:null,ApT:VT,ApplicativePar:pp,ApplicativeSeq:Fj,ApplyPar:Ss,ApplySeq:_g,Chain:Wl,Do:Jue,FromIO:Sg,FromTask:Yue,Functor:De,Monad:Xt,MonadIO:Bue,MonadTask:zue,Pointed:cn,URI:Pn,ap:Nj,apFirst:que,apS:Que,apSecond:Uue,bind:Xue,bindTo:Zue,chain:dp,chainFirst:Kue,chainFirstIOK:Gue,chainIOK:Hue,delay:Wue,flap:Due,flatten:jue,fromIO:Fn,fromIOK:Vue,fromTask:hp,getMonoid:use,getRaceMonoid:Lue,getSemigroup:ase,map:Ha,never:Pj,of:In,sequenceArray:tse,sequenceSeqArray:rse,task:ise,taskSeq:ose,traverseArray:Wj,traverseArrayWithIndex:ese,traverseReadonlyArrayWithIndex:HT,traverseReadonlyArrayWithIndexSeq:YT,traverseReadonlyNonEmptyArrayWithIndex:jl,traverseReadonlyNonEmptyArrayWithIndexSeq:GT,traverseSeqArray:jj,traverseSeqArrayWithIndex:nse},Symbol.toStringTag,{value:"Module"}));var Lj=zT(cn),Ll=Qi,$s=V(Fn,Ll),cse=zd,Dj=Kd,lse=Dj,hi=function(e,t){return y(e,ZT(t))},Ts=function(e,t){return y(e,XT(t))},JT=function(e,t){return y(e,$g(function(n){return y(t,ZT(n))}))},Dl=function(e,t){return y(e,$g(t))},ZT=qT(De),XT=UT(Ss),fse=XT,zr=DT(cn),$g=BT(Xt),qj=$g,Uj=qj(D),dse=Uj,On="ReaderTask",ln={URI:On,map:hi},pse=Ke(ln),mp={URI:On,of:zr},vp={URI:On,map:hi,ap:Ts},hse=Ct(vp),mse=Et(vp),vse={URI:On,map:hi,ap:Ts,of:zr},QT={URI:On,map:hi,ap:JT},Bj={URI:On,map:hi,ap:JT,of:zr},oo={URI:On,map:hi,ap:Ts,chain:Dl},Xo={URI:On,map:hi,of:zr,ap:Ts,chain:Dl},gse={URI:On,map:hi,of:zr,ap:Ts,chain:Dl,fromIO:$s},yse={URI:On,map:hi,of:zr,ap:Ts,chain:Dl,fromIO:$s,fromTask:Ll},zj=ft(oo),bse=zj,Tg={URI:On,fromIO:$s},_se=Xi(Tg),Sse=Po(Tg,oo),$se=Wo(Tg,oo),ql={URI:On,fromReader:Lj},Tse=Hd(ql),Ise=Gd(ql),Ose=hs(ql),Kj=Yd(ql,oo),wse=Kj,Vj=Jd(ql,oo),Cse=Vj,Ig={URI:On,fromIO:$s,fromTask:Ll},Ese=ms(Ig),Rse=_l(Ig,oo),Mse=Sl(Ig,oo),xse=zr(Yt),kse=wt(ln),Hj=Mt(oo),Ase=Hj,Gj=Rt(vp),Nse=Gj,eI=zr(rn),Yj=function(e){return V(ps(e),ds(jl(Jn)))},tI=function(e){var t=Yj(e);return function(n){return gt(n)?t(n):eI}},Jj=function(e){return V(ps(e),ds(GT(Jn)))},nI=function(e){var t=Jj(e);return function(n){return gt(n)?t(n):eI}},Fse=tI,Zj=function(e){return tI(function(t,n){return e(n)})},Pse=Zj(D),Wse=nI,Xj=function(e){return nI(function(t,n){return e(n)})},jse=Xj(D),Lse={URI:On,map:hi,of:zr,ap:Ts,chain:Dl,fromIO:$s,fromTask:Ll},Dse={URI:On,map:hi,of:zr,ap:JT,chain:Dl,fromIO:$s,fromTask:Ll},qse=Jt(QT),Use=Wr(Bj);function Bse(e,t){return e(t)()}const zse=Object.freeze(Object.defineProperty({__proto__:null,ApT:eI,ApplicativePar:vse,ApplicativeSeq:Bj,ApplyPar:vp,ApplySeq:QT,Chain:oo,Do:xse,FromIO:Tg,FromReader:ql,FromTask:Ig,Functor:ln,Monad:Xo,MonadIO:gse,MonadTask:yse,Pointed:mp,URI:On,ap:XT,apFirst:hse,apS:Gj,apSW:Nse,apSecond:mse,apW:fse,ask:Tse,asks:Ise,asksReaderTask:lse,asksReaderTaskW:Dj,bind:Hj,bindTo:kse,bindW:Ase,chain:$g,chainFirst:zj,chainFirstIOK:$se,chainFirstReaderK:Vj,chainFirstReaderKW:Cse,chainFirstTaskK:Mse,chainFirstW:bse,chainIOK:Sse,chainReaderK:Kj,chainReaderKW:wse,chainTaskK:Rse,chainW:qj,flap:pse,flatten:dse,flattenW:Uj,fromIO:$s,fromIOK:_se,fromReader:Lj,fromReaderK:Ose,fromTask:Ll,fromTaskK:Ese,getMonoid:Use,getSemigroup:qse,local:cse,map:ZT,of:zr,readerTask:Lse,readerTaskSeq:Dse,run:Bse,sequenceArray:Pse,sequenceSeqArray:jse,traverseArray:Zj,traverseArrayWithIndex:Fse,traverseReadonlyArrayWithIndex:tI,traverseReadonlyArrayWithIndexSeq:nI,traverseReadonlyNonEmptyArrayWithIndex:Yj,traverseReadonlyNonEmptyArrayWithIndexSeq:Jj,traverseSeqArray:Xj,traverseSeqArrayWithIndex:Wse},Symbol.toStringTag,{value:"Module"}));var Kse=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(l){try{c(r.next(l))}catch(f){a(f)}}function s(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(u,s)}c((r=r.apply(e,t||[])).next())})},Vse=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(l){return s([c,l])}}function s(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},rI=cl(cn),iI=cs(cn),Og=ll(De),oI=fl(De),aI=V(Fn,Og),Qj=V(Fn,oI),Ga=aI,Ul=Og,uI=In,sI=Fn,eL=function(e){return Ha(UN(e))},tL=Dd(De),Hse=tL,cI=gl(Xt),Gse=cI,nL=cI,Yse=nL,rL=yl(Xt),Jse=rL,iL=function(e,t){return function(){return Kse(void 0,void 0,void 0,function(){var n;return Vse(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(Ma)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,So(t(n))];case 3:return[2]}})})}},Zse=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return iL(function(){return e.apply(void 0,n)},t)}},Xse=Bd(De),Qse=Fv(cn),ece=Pv(cn),tce=v0(Xt),oL=fs(Xt),nce=oL,wg=qd(Xt),rce=wg,ice=function(e){return wg(TL(e))},oce=function(e){return wg(IL(e))},ace=Ud(Xt),uce=bl(De),aL=function(e){var t=eL(e);return function(n){return V(n,t)}},uL=function(e){return function(t){return function(n){return y(n,gp(aL(e)(t)))}}},sce=uL,sL=function(e){return V(e,sI)},cL=function(e){return yp(sL(e))},cce=cL,fn=function(e,t){return y(e,dI(t))},Ya=function(e,t){return y(e,pI(t))},lI=function(e,t){return y(e,gp(function(n){return y(t,dI(n))}))},Ja=function(e,t){return y(e,gp(t))},Cg=function(e,t,n){return y(e,lL(t,n))},Eg=function(e,t){return y(e,fL(t))},fI=function(e,t){return y(e,hI(t))},dI=dl(De),lL=ml(De),fL=vl(De),pI=pl(Ss),lce=pI,gp=ls(Xt),yp=gp,dL=yp(D),fce=dL,hI=hl(Xt),dce=hI,er=iI,bp=rI,yt="TaskEither";function mI(e,t){var n=$o(e,La(t));return{URI:yt,_E:void 0,map:fn,ap:function(r,i){return y(r,n(i))},of:er}}function pL(e){var t=Ld(Xt,e);return{URI:yt,_E:void 0,map:fn,alt:function(n,r){return y(n,t(r))}}}var hL=function(e){var t=as(e);return{URI:yt,_E:void 0,compact:Ji(De,t),separate:Ao(De,t,Da)}};function pce(e){var t=al(e),n=hL(e),r=No(De,t),i=Fo(De,t),o=Ua(De,t),a=Ba(De,t);return{URI:yt,_E:void 0,map:fn,compact:n.compact,separate:n.separate,filter:function(u,s){return y(u,r(s))},filterMap:function(u,s){return y(u,i(s))},partition:function(u,s){return y(u,o(s))},partitionMap:function(u,s){return y(u,a(s))}}}var vI={URI:yt,map:fn},hce=Ke(vI),mce={URI:yt,of:er},Rg={URI:yt,map:fn,ap:Ya},mL=Ct(Rg),vce=mL,vL=Et(Rg),gce=vL,yce={URI:yt,map:fn,ap:Ya,of:er},gL={URI:yt,map:fn,ap:lI},yL={URI:yt,map:fn,ap:lI,of:er},mi={URI:yt,map:fn,ap:Ya,chain:Ja},bce={URI:yt,map:fn,ap:Ya,chain:Ja,of:er},_ce={URI:yt,map:fn,ap:Ya,chain:Ja,of:er,fromIO:Ga},Sce={URI:yt,map:fn,ap:Ya,chain:Ja,of:er,fromIO:Ga,fromTask:Ul},$ce={URI:yt,map:fn,ap:Ya,chain:Ja,of:er,throwError:bp},bL=ft(mi),Tce=bL,Ice={URI:yt,bimap:Cg,mapLeft:Eg},Oce={URI:yt,map:fn,alt:fI},Qo={URI:yt,fromEither:uI},wce=Vi(Qo),Cce=Hi(Qo),Ece=Gu(Qo,mi),_L=wo(Qo,mi),Rce=_L,SL=Co(Qo,mi),Mce=SL,xce=Aa(Qo),$L=Yu(Qo,mi),kce=$L,Ace=gr(Qo),Mg={URI:yt,fromIO:Ga},TL=Xi(Mg),Nce=Po(Mg,mi),Fce=Wo(Mg,mi),xg={URI:yt,fromIO:Ga,fromTask:Ul},IL=ms(xg),Pce=_l(xg,mi),Wce=Sl(xg,mi);function jce(e){return function(){var t=Array.prototype.slice.call(arguments);return function(){return new Promise(function(n){var r=function(i,o){return i!=null?n(So(i)):n(Ma(o))};e.apply(null,t.concat(r))})}}}var Lce=function(e,t,n){return gI(e,t,n)},gI=function(e,t,n){return y(e,yp(function(r){return y(t(r),dp(function(i){return y(n(r,i),yp(function(){return In(i)}))}))}))},Dce=er(Yt),qce=wt(vI),OL=Mt(mi),Uce=OL,wL=Rt(Rg),Bce=wL,yI=er(rn),bI=function(e){return V(jl(e),Ha(jd(Jn)))},_I=function(e){var t=bI(e);return function(n){return gt(n)?t(n):yI}},SI=function(e){return function(t){return function(){return Rc(t).reduce(function(n,r,i){return n.then(function(o){return Gt(o)?n:e(i+1,r)().then(function(a){return Gt(a)?a:(o.right.push(a.right),o)})})},e(0,dr(t))().then(us(Vf)))}}},$I=function(e){var t=SI(e);return function(n){return gt(n)?t(n):yI}},zce=_I,CL=function(e){return _I(function(t,n){return e(n)})},Kce=CL(D),Vce=$I,EL=function(e){return $I(function(t,n){return e(n)})},Hce=EL(D),Gce={URI:yt,bimap:Cg,mapLeft:Eg,map:fn,of:er,ap:Ya,chain:Ja,alt:fI,fromIO:Ga,fromTask:Ul,throwError:bp},Yce={URI:yt,bimap:Cg,mapLeft:Eg,map:fn,of:er,ap:lI,chain:Ja,alt:fI,fromIO:Ga,fromTask:Ul,throwError:bp},Jce=Jt(gL),Zce=Wr(yL),Xce=function(e){return Jt(_g)(Nd(e))};function Qce(e){var t=mI(pp,e),n=pL(e);return{URI:yt,_E:void 0,map:fn,ap:t.ap,of:er,chain:Ja,bimap:Cg,mapLeft:Eg,alt:n.alt,fromIO:Ga,fromTask:Ul,throwError:bp}}const ele=Object.freeze(Object.defineProperty({__proto__:null,Alt:Oce,ApT:yI,ApplicativePar:yce,ApplicativeSeq:yL,ApplyPar:Rg,ApplySeq:gL,Bifunctor:Ice,Chain:mi,Do:Dce,FromEither:Qo,FromIO:Mg,FromTask:xg,Functor:vI,Monad:bce,MonadIO:_ce,MonadTask:Sce,MonadThrow:$ce,Pointed:mce,URI:yt,alt:hI,altW:dce,ap:pI,apFirst:mL,apFirstW:vce,apS:wL,apSW:Bce,apSecond:vL,apSecondW:gce,apW:lce,bimap:lL,bind:OL,bindTo:qce,bindW:Uce,bracket:Lce,bracketW:gI,chain:gp,chainEitherK:_L,chainEitherKW:Rce,chainFirst:bL,chainFirstEitherK:SL,chainFirstEitherKW:Mce,chainFirstIOK:Fce,chainFirstTaskK:Wce,chainFirstW:Tce,chainIOEitherK:cce,chainIOEitherKW:cL,chainIOK:Nce,chainNullableK:tce,chainOptionK:Ece,chainTaskK:Pce,chainTaskOptionK:sce,chainTaskOptionKW:uL,chainW:yp,filterOrElse:$L,filterOrElseW:kce,flap:hce,flatten:fce,flattenW:dL,fold:Gse,foldW:Yse,fromEither:uI,fromEitherK:Ace,fromIO:Ga,fromIOEither:sI,fromIOEitherK:sL,fromIOK:TL,fromNullable:Qse,fromNullableK:ece,fromOption:wce,fromOptionK:Cce,fromPredicate:xce,fromTask:Ul,fromTaskK:IL,fromTaskOption:eL,fromTaskOptionK:aL,getAltTaskValidation:pL,getApplicativeTaskValidation:mI,getApplyMonoid:Zce,getApplySemigroup:Jce,getCompactable:hL,getFilterable:pce,getOrElse:rL,getOrElseW:Jse,getSemigroup:Xce,getTaskValidation:Qce,left:rI,leftIO:Qj,leftTask:oI,map:dI,mapLeft:fL,match:tL,matchE:cI,matchEW:nL,matchW:Hse,of:er,orElse:oL,orElseFirst:wg,orElseFirstIOK:ice,orElseFirstTaskK:oce,orElseFirstW:rce,orElseW:nce,orLeft:ace,right:iI,rightIO:aI,rightTask:Og,sequenceArray:Kce,sequenceSeqArray:Hce,swap:uce,taskEither:Gce,taskEitherSeq:Yce,taskify:jce,throwError:bp,toUnion:Xse,traverseArray:CL,traverseArrayWithIndex:zce,traverseReadonlyArrayWithIndex:_I,traverseReadonlyArrayWithIndexSeq:$I,traverseReadonlyNonEmptyArrayWithIndex:bI,traverseReadonlyNonEmptyArrayWithIndexSeq:SI,traverseSeqArray:EL,traverseSeqArrayWithIndex:Vce,tryCatch:iL,tryCatchK:Zse},Symbol.toStringTag,{value:"Module"}));var Za=Qi,kg=cl(mp),TI=cs(mp),II=V(Og,Za),RL=V(oI,Za),OI=function(e){return V(e,iI)},ML=function(e){return V(e,rI)},xL=ll(ln),tle=fl(ln),wI=V(aI,Za),kL=V(Qj,Za),AL=zr,NL=OI,Xa=wI,Bl=II,CI=V(sI,Za),EI=function(e){return V(e,uI)},FL=Dd(ln),nle=FL,RI=gl(oo),rle=RI,PL=RI,ile=PL,WL=yl(Xo),ole=WL,ale=Bd(ln),ule=Fv(mp),sle=Pv(mp),cle=v0(Xo),lle=zd,jL=Kd,fle=jL,LL=fs(Xo),dle=LL,DL=qd(Xo),ple=DL,hle=Ud(Xo),mle=bl(ln),qL=function(e){return V(e,CI)},UL=function(e){return zl(qL(e))},vle=UL,MI=function(e){return V(e,Za)},BL=function(e){return zl(MI(e))},gle=BL,zL=function(e){return jg(MI(e))},yle=zL,xI=function(e){return V(e,EI)},KL=function(e){return zl(xI(e))},ble=KL,VL=function(e){return jg(xI(e))},_le=VL,dn=function(e,t){return y(e,_p(t))},Qa=function(e,t){return y(e,PI(t))},kI=function(e,t){return y(e,Fg(function(n){return y(t,_p(n))}))},eu=function(e,t){return y(e,Fg(t))},AI=function(e,t){return y(e,Pg(t))},Ag=function(e,t,n){return y(e,NI(t,n))},Ng=function(e,t){return y(e,FI(t))},_p=dl(ln),NI=ml(ln),FI=vl(ln),PI=pl(vp),Sle=PI,tr=TI,Fg=ls(Xo),zl=Fg,HL=zl(D),$le=HL,Pg=hl(Xo),GL=Pg,Sp=kg,ht="ReaderTaskEither",YL=function(e){var t=as(e);return{URI:ht,_E:void 0,compact:Ji(ln,t),separate:Ao(ln,t,Da)}};function Tle(e){var t=al(e),n=YL(e),r=No(ln,t),i=Fo(ln,t),o=Ua(ln,t),a=Ba(ln,t);return{URI:ht,_E:void 0,map:dn,compact:n.compact,separate:n.separate,filter:function(u,s){return y(u,r(s))},filterMap:function(u,s){return y(u,i(s))},partition:function(u,s){return y(u,o(s))},partitionMap:function(u,s){return y(u,a(s))}}}function JL(e,t){var n=$o(Lo,mI(e,t));return{URI:ht,_E:void 0,map:dn,ap:function(r,i){return y(r,n(i))},of:tr}}function ZL(e){var t=Ld(Xo,e);return{URI:ht,_E:void 0,map:dn,alt:function(n,r){return y(n,t(r))}}}var Is={URI:ht,map:dn},Ile=Ke(Is),WI={URI:ht,of:tr},Wg={URI:ht,map:dn,ap:Qa},XL=Ct(Wg),Ole=XL,QL=Et(Wg),wle=QL,Cle={URI:ht,map:dn,ap:Qa,of:tr},eD={URI:ht,map:dn,ap:kI},tD={URI:ht,map:dn,ap:kI,of:tr},Wn={URI:ht,map:dn,ap:Qa,chain:eu},Ele={URI:ht,map:dn,ap:Qa,chain:eu,of:tr},Rle={URI:ht,map:dn,ap:Qa,chain:eu,of:tr,fromIO:Xa},Mle={URI:ht,map:dn,ap:Qa,chain:eu,of:tr,fromIO:Xa,fromTask:Bl},xle={URI:ht,map:dn,ap:Qa,chain:eu,of:tr,throwError:Sp},nD=ft(Wn),jg=nD,kle={URI:ht,bimap:Ag,mapLeft:Ng},Ale={URI:ht,map:dn,alt:AI},Kl={URI:ht,fromReader:NL},Nle=Hd(Kl),Fle=Gd(Kl),Ple=hs(Kl),rD=Yd(Kl,Wn),Wle=rD,iD=Jd(Kl,Wn),jle=iD,jI=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return xL(e.apply(void 0,t))}},oD=function(e){return zl(jI(e))},Lle=oD,aD=function(e){return jg(jI(e))},Dle=aD,ea={URI:ht,fromEither:AL},qle=Vi(ea),Ule=Hi(ea),Ble=Gu(ea,Wn),uD=wo(ea,Wn),zle=uD,sD=Co(ea,Wn),Kle=sD,Vle=Aa(ea),cD=Yu(ea,Wn),Hle=cD,Gle=gr(ea),Lg={URI:ht,fromIO:Xa},Yle=Xi(Lg),Jle=Po(Lg,Wn),Zle=Wo(Lg,Wn),Dg={URI:ht,fromIO:Xa,fromTask:Bl},Xle=ms(Dg),Qle=_l(Dg,Wn),efe=Sl(Dg,Wn);function tfe(e,t,n){return lD(e,t,n)}function lD(e,t,n){return function(r){return gI(e(r),function(i){return t(i)(r)},function(i,o){return n(i,o)(r)})}}var nfe=tr(Yt),rfe=wt(Is),fD=Mt(Wn),ife=fD,dD=Rt(Wg),ofe=dD,LI=tr(rn),pD=function(e){return V(ps(e),ds(bI(Jn)))},DI=function(e){var t=pD(e);return function(n){return gt(n)?t(n):LI}},hD=function(e){return V(ps(e),ds(SI(Jn)))},qI=function(e){var t=hD(e);return function(n){return gt(n)?t(n):LI}},afe=DI,mD=function(e){return DI(function(t,n){return e(n)})},ufe=mD(D),sfe=qI,vD=function(e){return qI(function(t,n){return e(n)})},cfe=vD(D),lfe={URI:ht,map:dn,of:tr,ap:Qa,chain:eu,alt:AI,bimap:Ag,mapLeft:Ng,fromIO:Xa,fromTask:Bl,throwError:Sp},ffe={URI:ht,map:dn,of:tr,ap:kI,chain:eu,alt:AI,bimap:Ag,mapLeft:Ng,fromIO:Xa,fromTask:Bl,throwError:Sp},dfe=Jt(eD),pfe=Wr(tD),hfe=function(e){return Jt(QT)(Nd(e))};function mfe(e){var t=JL(pp,e),n=ZL(e);return{URI:ht,_E:void 0,map:dn,of:tr,chain:eu,bimap:Ag,mapLeft:Ng,ap:t.ap,alt:n.alt,fromIO:Xa,fromTask:Bl,throwError:Sp}}function vfe(e,t){return e(t)()}const gfe=Object.freeze(Object.defineProperty({__proto__:null,Alt:Ale,ApT:LI,ApplicativePar:Cle,ApplicativeSeq:tD,ApplyPar:Wg,ApplySeq:eD,Bifunctor:kle,Chain:Wn,Do:nfe,FromEither:ea,FromIO:Lg,FromReader:Kl,FromTask:Dg,Functor:Is,Monad:Ele,MonadIO:Rle,MonadTask:Mle,MonadThrow:xle,Pointed:WI,URI:ht,alt:Pg,altW:GL,ap:PI,apFirst:XL,apFirstW:Ole,apS:dD,apSW:ofe,apSecond:QL,apSecondW:wle,apW:Sle,ask:Nle,asks:Fle,asksReaderTaskEither:fle,asksReaderTaskEitherW:jL,bimap:NI,bind:fD,bindTo:rfe,bindW:ife,bracket:tfe,bracketW:lD,chain:Fg,chainEitherK:uD,chainEitherKW:zle,chainFirst:nD,chainFirstEitherK:sD,chainFirstEitherKW:Kle,chainFirstIOK:Zle,chainFirstReaderEitherK:_le,chainFirstReaderEitherKW:VL,chainFirstReaderK:iD,chainFirstReaderKW:jle,chainFirstReaderTaskK:Dle,chainFirstReaderTaskKW:aD,chainFirstTaskEitherK:yle,chainFirstTaskEitherKW:zL,chainFirstTaskK:efe,chainFirstW:jg,chainIOEitherK:vle,chainIOEitherKW:UL,chainIOK:Jle,chainNullableK:cle,chainOptionK:Ble,chainReaderEitherK:ble,chainReaderEitherKW:KL,chainReaderK:rD,chainReaderKW:Wle,chainReaderTaskK:Lle,chainReaderTaskKW:oD,chainTaskEitherK:gle,chainTaskEitherKW:BL,chainTaskK:Qle,chainW:zl,filterOrElse:cD,filterOrElseW:Hle,flap:Ile,flatten:$le,flattenW:HL,fold:rle,foldW:ile,fromEither:AL,fromEitherK:Gle,fromIO:Xa,fromIOEither:CI,fromIOEitherK:qL,fromIOK:Yle,fromNullable:ule,fromNullableK:sle,fromOption:qle,fromOptionK:Ule,fromPredicate:Vle,fromReader:NL,fromReaderEither:EI,fromReaderEitherK:xI,fromReaderK:Ple,fromReaderTaskK:jI,fromTask:Bl,fromTaskEither:Za,fromTaskEitherK:MI,fromTaskK:Xle,getAltReaderTaskValidation:ZL,getApplicativeReaderTaskValidation:JL,getApplyMonoid:pfe,getApplySemigroup:dfe,getCompactable:YL,getFilterable:Tle,getOrElse:WL,getOrElseW:ole,getReaderTaskValidation:mfe,getSemigroup:hfe,left:kg,leftIO:kL,leftReader:ML,leftReaderTask:tle,leftTask:RL,local:lle,map:_p,mapLeft:FI,match:FL,matchE:RI,matchEW:PL,matchW:nle,of:tr,orElse:LL,orElseFirst:DL,orElseFirstW:ple,orElseW:dle,orLeft:hle,readerTaskEither:lfe,readerTaskEitherSeq:ffe,right:TI,rightIO:wI,rightReader:OI,rightReaderTask:xL,rightTask:II,run:vfe,sequenceArray:ufe,sequenceSeqArray:cfe,swap:mle,throwError:Sp,toUnion:ale,traverseArray:mD,traverseArrayWithIndex:afe,traverseReadonlyArrayWithIndex:DI,traverseReadonlyArrayWithIndexSeq:qI,traverseReadonlyNonEmptyArrayWithIndex:pD,traverseReadonlyNonEmptyArrayWithIndexSeq:hD,traverseSeqArray:vD,traverseSeqArrayWithIndex:sfe},Symbol.toStringTag,{value:"Module"}));var yfe=function(e){return new Set(e)},bfe=function(e){return new Set([e])},gD=function(e){return function(t){for(var n=t.length,r=new Set,i=pn(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}};function _fe(e){return new Set(e)}function Sfe(e){var t=pn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);t(a,i)||i.add(a)}),i}}}function $fe(e){var t=pn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){n(o).forEach(function(a){t(a,i)||i.add(a)})}),i}}}function UI(e){return function(t){for(var n=t.values(),r,i=new Set;!(r=n.next()).done;){var o=r.value;e(o)&&i.add(o)}return i}}function Tfe(e){return function(t){for(var n=t.values(),r,i=new Set,o=new Set;!(r=n.next()).done;){var a=r.value;e(a)?i.add(a):o.add(a)}return Me(o,i)}}function BI(e){var t=pn(e);return function(n,r){if(r===void 0){var i=BI(e);return function(a){return i(n,a)}}if($p(n))return r;if($p(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function zI(e){var t=pn(e);return function(n,r){if(r===void 0){var i=zI(e);return function(a){return i(a,n)}}if($p(n)||$p(r))return VI;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function Ife(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,u=new Set,s=pn(e),c=pn(t);!(o=i.next()).done;){var l=n(o.value);switch(l._tag){case"Left":s(l.left,a)||a.add(l.left);break;case"Right":c(l.right,u)||u.add(l.right);break}}return Me(a,u)}}}function KI(e){var t=pn(e);return function(n,r){if(r===void 0){var i=KI(e);return function(o){return i(o,n)}}return UI(function(o){return!t(o,r)})(n)}}function yD(e){var t=qg(e);return function(n,r){return function(i){return t(i).reduce(r,n)}}}function bD(e,t){var n=qg(e);return function(r){return function(i){return n(i).reduce(function(o,a){return t.concat(o,r(a))},t.empty)}}}var _D=function(e){var t=qg(e);return function(n,r){return function(i){return t(i).reduceRight(function(o,a){return r(a,o)},n)}}};function SD(e){var t=pn(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var $D=function(e){return function(t){return function(n){return UI(function(r){return!e.equals(t,r)})(n)}}},Ofe=function(e){var t=pn(e),n=$D(e),r=SD(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},wfe=function(e){return TD(e)(D)};function Cfe(e,t){return function(n){var r=pn(e),i=pn(t),o=new Set,a=new Set;return n.forEach(function(u){switch(u._tag){case"Left":r(u.left,o)||o.add(u.left);break;case"Right":i(u.right,a)||a.add(u.right);break}}),Me(o,a)}}function TD(e){var t=pn(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);a._tag==="Some"&&!t(a.value,i)&&i.add(a.value)}),i}}}var VI=new Set,$p=function(e){return e.size===0},Efe=function(e){return e.size},HI=function(e){return function(t){for(var n=t.values(),r,i=!1;!i&&!(r=n.next()).done;)i=e(r.value);return i}};function GI(e){return wd(HI(wd(e)))}function Tp(e){var t=pn(e);return function(n,r){if(r===void 0){var i=Tp(e);return function(o){return i(o,n)}}return GI(function(o){return t(o,r)})(n)}}function pn(e){return function(t,n){if(n===void 0){var r=pn(e);return function(u){return r(t,u)}}for(var i=n.values(),o,a=!1;!a&&!(o=i.next()).done;)a=e.equals(t,o.value);return a}}var qg=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},Rfe="ReadonlySet";function ID(e){return{show:function(t){var n=[];return t.forEach(function(r){n.push(e.show(r))}),"new Set([".concat(n.sort().join(", "),"])")}}}function OD(e){var t=Tp(e);return Pr(function(n,r){return t(n,r)&&t(r,n)})}var wD=function(e){return{concat:BI(e)}},Mfe=function(e){return{concat:wD(e).concat,empty:VI}},xfe=function(e){return{concat:zI(e)}},kfe=function(e){return{concat:KI(e)}},Afe=gD;const Nfe=Object.freeze(Object.defineProperty({__proto__:null,URI:Rfe,chain:$fe,compact:wfe,difference:KI,elem:pn,empty:VI,every:GI,filter:UI,filterMap:TD,foldMap:bD,fromArray:Afe,fromReadonlyArray:gD,fromSet:yfe,getDifferenceMagma:kfe,getEq:OD,getIntersectionSemigroup:xfe,getShow:ID,getUnionMonoid:Mfe,getUnionSemigroup:wD,insert:SD,intersection:zI,isEmpty:$p,isSubset:Tp,map:Sfe,partition:Tfe,partitionMap:Ife,reduce:yD,reduceRight:_D,remove:$D,separate:Cfe,singleton:bfe,size:Efe,some:HI,toReadonlyArray:qg,toSet:_fe,toggle:Ofe,union:BI},Symbol.toStringTag,{value:"Module"}));function Qt(e){return e[0]}function wn(e){return e[1]}var Ffe=function(e){return[wn(e),Qt(e)]};function YI(e){return{URI:_r,_E:void 0,map:Ip,ap:function(t,n){return[Qt(t)(Qt(n)),e.concat(wn(t),wn(n))]}}}var CD=function(e){return function(t){return[t,e.empty]}};function Pfe(e){var t=YI(e);return{URI:_r,_E:void 0,map:t.map,ap:t.ap,of:CD(e)}}function JI(e){var t=YI(e);return{URI:_r,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(Qt(n)),o=i[0],a=i[1];return[o,e.concat(wn(n),a)]}}}function Wfe(e){var t=JI(e);return{URI:_r,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:CD(e)}}function jfe(e){var t=function(r,i){for(var o=i(r),a=e.empty,u=Qt(o);u._tag==="Left";)a=e.concat(a,wn(o)),o=i(u.left),u=Qt(o);return[u.right,e.concat(a,wn(o))]},n=JI(e);return{URI:_r,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var ED=function(e,t){return y(e,ND(t))},Ip=function(e,t){return y(e,e1(t))},RD=function(e,t,n){return y(e,AD(t,n))},MD=function(e,t){return y(e,t1(t))},xD=function(e,t){return y(e,n1(t))},ZI=function(e,t,n){return y(e,r1(t,n))},XI=function(e){var t=i1();return function(n,r){return y(n,t(r))}},QI=function(e,t,n){return y(e,o1(t,n))},kD=function(e){var t=FD(e);return function(n,r){return y(n,t(r))}},AD=function(e,t){return function(n){return[t(Qt(n)),e(wn(n))]}},e1=function(e){return function(t){return[e(Qt(t)),wn(t)]}},t1=function(e){return function(t){return[Qt(t),e(wn(t))]}},ND=function(e){return function(t){return[Qt(t),wn(e)]}},n1=function(e){return function(t){return[e(t),wn(t)]}},Ug=Qt,Lfe=n1(D),r1=function(e,t){return function(n){return t(e,Qt(n))}},i1=function(){return function(e){return function(t){return e(Qt(t))}}},o1=function(e,t){return function(n){return t(Qt(n),e)}},FD=function(e){return function(t){return function(n){return e.map(t(Qt(n)),function(r){return[r,wn(n)]})}}},a1=function(e){return function(t){return e.map(Qt(t),function(n){return[n,wn(t)]})}},_r="ReadonlyTuple",PD={URI:_r,map:Ip},Dfe=Ke(PD),qfe={URI:_r,bimap:RD,mapLeft:MD},Ufe={URI:_r,compose:ED},Bfe={URI:_r,map:Ip,extend:xD,extract:Ug},zfe={URI:_r,reduce:ZI,foldMap:XI,reduceRight:QI},Kfe={URI:_r,map:Ip,reduce:ZI,foldMap:XI,reduceRight:QI,traverse:kD,sequence:a1},Vfe=e1,Hfe=t1,Gfe={URI:_r,compose:ED,map:Ip,bimap:RD,mapLeft:MD,extract:Ug,extend:xD,reduce:ZI,foldMap:XI,reduceRight:QI,traverse:kD,sequence:a1};const Yfe=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:qfe,Comonad:Bfe,Foldable:zfe,Functor:PD,Semigroupoid:Ufe,Traversable:Kfe,URI:_r,bimap:AD,compose:ND,duplicate:Lfe,extend:n1,extract:Ug,flap:Dfe,foldMap:i1,fst:Qt,getApplicative:Pfe,getApply:YI,getChain:JI,getChainRec:jfe,getMonad:Wfe,map:Vfe,mapFst:e1,mapLeft:Hfe,mapSnd:t1,readonlyTuple:Gfe,reduce:r1,reduceRight:o1,sequence:a1,snd:wn,swap:Ffe,traverse:FD},Symbol.toStringTag,{value:"Module"}));var Vl=globalThis&&globalThis.__assign||function(){return Vl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Vl.apply(this,arguments)},Jfe=nx,Os=ui,u1=function(e){return function(t){return Object.keys(t).sort(e.compare)}},Zfe=u1(K);function s1(e){if(typeof e=="function")return s1(K)(e);var t=u1(e);return function(n){return function(r){for(var i=[],o=0,a=t(r);o<a.length;o++){var u=a[o];i.push(n(u,r[u]))}return i}}}var c1=s1(K)(function(e,t){return[e,t]});function Xfe(e){return function(t){var n=c1(t),r=n.length;return e.unfold(0,function(i){return i<r?pe([n[i],i+1]):be})}}var WD=X_,jD=To;function LD(e){return function(t){if(!lt.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var Qfe=function(e,t){return DD(e,function(){return t})},DD=function(e,t){return function(n){if(!jD(e,n))return be;var r=Object.assign({},n);return r[e]=t(n[e]),pe(r)}};function ede(e){var t=LD(e);return function(n){var r=qD(e,n);return Wt(r)?be:pe([r.value,t(n)])}}var tde=Rm,qD=ju,nde=Mm,rde=Q_;function ide(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?Ac(e[0]):Ac(K).apply(void 0,e)}function ode(e){return"compare"in e?Nc(e):Nc(K)(e)}function ade(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?Fc(e[0]):Fc(K).apply(void 0,e)}var ude=rx;function sde(e){return ix(e)}function l1(e){return xm(e)}function Op(e){return Pc(e)}var cde=function(e){var t=l1(e);return function(n){return function(r){return e.map(y(r,t(n)),tu)}}},lde=function(e){var t=l1(e);return function(n){return function(r){return e.map(y(r,t(n)),nu)}}},fde=km;function dde(e){return Am(e)}var pde=Nm;function hde(e){return Fm(e)}function UD(e,t){return ox(e,t)}var mde=c1,vde=function(e){return UD(fm(),RA)(e)};function gde(e,t){return eS(e,t)}var yde=ax,bde=ux,_de=tS,BD=function(e){var t=nS(e);return function(n){return function(r){return Os(r)?Vl({},n):Os(n)?Vl({},r):t(n)(r)}}},zD=function(e){return function(t){return function(n){return Os(n)||Os(t)?{}:rS(e)(t)(n)}}},KD=function(e){return function(t){return Os(t)?Vl({},e):Os(e)?Vl({},t):iS(e)(t)}},vi=pr,wp=Lu,gi=hr,yi=mr,bi=vr,Cp=Du,Ep=qu,Rp=Uu,Mp=Bu,xp=zu,kp=Ku,Ap=Vu,VD=Pm,HD=Wm,GD=jm,YD=Lm,Hl=Ki,JD=id,f1=function(e){return function(t){var n=u1(e);return function(r,i){var o=n(r);if(o.length===0)return t.of({});for(var a=t.of({}),u=function(f){a=t.ap(t.map(a,function(d){return function(p){return d[f]=p,d}}),i(f,r[f]))},s=0,c=o;s<c.length;s++){var l=c[s];u(l)}return a}}},Sde=oS,$de=aS,Tde=Dm,Ide=uS;function Ode(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?ad(e[0]):ad(K).apply(void 0,e)}function wde(e){return"compare"in e?ud(e):ud(K)(e)}function Cde(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?sd(e[0]):sd(K).apply(void 0,e)}var tu=Io,nu=Oo,hn="Record";function Ede(e){return"compare"in e?qm(e):qm(K)(e)}var Rde=sx,Mde=cx,ZD={URI:hn,map:vi},xde=Ke(ZD),kde={URI:hn,map:vi,mapWithIndex:wp},Ade=function(e){return{URI:hn,reduce:gi(e),foldMap:yi(e),reduceRight:bi(e)}},Nde=function(e){return{URI:hn,reduce:gi(e),foldMap:yi(e),reduceRight:bi(e),reduceWithIndex:xp(e),foldMapWithIndex:kp(e),reduceRightWithIndex:Ap(e)}},Np={URI:hn,compact:tu,separate:nu},Fde={URI:hn,map:vi,compact:tu,separate:nu,filter:Cp,filterMap:Ep,partition:Rp,partitionMap:Mp},Pde={URI:hn,map:vi,mapWithIndex:wp,compact:tu,separate:nu,filter:Cp,filterMap:Ep,partition:Rp,partitionMap:Mp,filterMapWithIndex:GD,filterWithIndex:YD,partitionMapWithIndex:VD,partitionWithIndex:HD},XD=function(e){return{URI:hn,map:vi,reduce:gi(e),foldMap:yi(e),reduceRight:bi(e),traverse:Hl(e),sequence:JD(e)}},Wde=function(e){return{URI:hn,map:vi,mapWithIndex:wp,reduce:gi(e),foldMap:yi(e),reduceRight:bi(e),reduceWithIndex:xp(e),foldMapWithIndex:kp(e),reduceRightWithIndex:Ap(e),traverse:Hl(e),sequence:JD(e),traverseWithIndex:f1(e)}},jde=function(e){var t=XD(e);return{URI:hn,map:vi,reduce:gi(e),foldMap:yi(e),reduceRight:bi(e),traverse:t.traverse,sequence:t.sequence,compact:tu,separate:nu,filter:Cp,filterMap:Ep,partition:Rp,partitionMap:Mp,wither:ai(t,Np),wilt:oi(t,Np)}},QD=function(e){var t=BD(e);return{concat:function(n,r){return t(r)(n)}}},Lde=function(e){return{concat:QD(e).concat,empty:{}}},Dde=function(e){var t=zD(e);return{concat:function(n,r){return t(r)(n)}}},qde=function(){return{concat:function(e,t){return KD(t)(e)}}},Ude={URI:hn,reduce:gi(K),foldMap:yi(K),reduceRight:bi(K)},Bde={URI:hn,reduce:gi(K),foldMap:yi(K),reduceRight:bi(K),reduceWithIndex:xp(K),foldMapWithIndex:kp(K),reduceRightWithIndex:Ap(K)},d1={URI:hn,map:vi,reduce:gi(K),foldMap:yi(K),reduceRight:bi(K),traverse:Hl(K),sequence:Op},zde={URI:hn,map:vi,mapWithIndex:wp,reduce:gi(K),foldMap:yi(K),reduceRight:bi(K),reduceWithIndex:xp(K),foldMapWithIndex:kp(K),reduceRightWithIndex:Ap(K),traverse:Hl(K),sequence:Op,traverseWithIndex:f1(K)},eq=ai(d1,Np),tq=oi(d1,Np),Kde={URI:hn,map:vi,reduce:gi(K),foldMap:yi(K),reduceRight:bi(K),traverse:Hl(K),sequence:Op,compact:tu,separate:nu,filter:Cp,filterMap:Ep,partition:Rp,partitionMap:Mp,wither:eq,wilt:tq},Vde={},Hde=WD,Gde=mx,Yde={URI:hn,map:vi,reduce:gi(K),foldMap:yi(K),reduceRight:bi(K),traverse:Hl(K),sequence:Op,compact:tu,separate:nu,filter:Cp,filterMap:Ep,partition:Rp,partitionMap:Mp,mapWithIndex:wp,reduceWithIndex:xp(K),foldMapWithIndex:kp(K),reduceRightWithIndex:Ap(K),filterMapWithIndex:GD,filterWithIndex:YD,partitionMapWithIndex:VD,partitionWithIndex:HD,traverseWithIndex:f1(K),wither:eq,wilt:tq};const Jde=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Np,Filterable:Fde,FilterableWithIndex:Pde,Foldable:Ude,FoldableWithIndex:Bde,Functor:ZD,FunctorWithIndex:kde,Traversable:d1,TraversableWithIndex:zde,URI:hn,Witherable:Kde,collect:s1,compact:tu,deleteAt:LD,difference:KD,elem:_de,empty:Vde,every:yde,filter:Sde,filterMap:$de,filterMapWithIndex:pde,filterWithIndex:hde,flap:xde,foldMap:wde,foldMapWithIndex:ode,fromEntries:vde,fromFoldable:UD,fromFoldableMap:gde,getDifferenceMagma:qde,getEq:Rde,getFoldable:Ade,getFoldableWithIndex:Nde,getIntersectionSemigroup:Dde,getMonoid:Mde,getShow:Ede,getTraversable:XD,getTraversableWithIndex:Wde,getUnionMonoid:Lde,getUnionSemigroup:QD,getWitherable:jde,has:jD,hasOwnProperty:Gde,insertAt:Hde,intersection:zD,isEmpty:Os,isSubrecord:tde,keys:Zfe,lookup:qD,map:rde,mapWithIndex:nde,modifyAt:DD,partition:Tde,partitionMap:Ide,partitionMapWithIndex:fde,partitionWithIndex:dde,pop:ede,record:Yde,reduce:Ode,reduceRight:Cde,reduceRightWithIndex:ade,reduceWithIndex:ide,separate:nu,sequence:Op,singleton:ude,size:Jfe,some:bde,toArray:c1,toEntries:mde,toUnfoldable:Xfe,traverse:l1,traverseWithIndex:sde,union:BD,updateAt:Qfe,upsertAt:WD,wilt:lde,wither:cde},Symbol.toStringTag,{value:"Module"}));var Zde=function(e){return function(t){return bt(e(t))}},Xde=function(e){return function(t){return d_(e(t))}},Qde=function(){return function(e){return!0}},epe=function(e){return function(t){return!e(t)}},tpe=function(e){return function(t){return function(n){return t(n)||e(n)}}},npe=function(e){return function(t){return function(n){return t(n)&&e(n)}}},rpe=function(){return function(e){return!1}},ipe=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const ope=Object.freeze(Object.defineProperty({__proto__:null,and:npe,compose:ipe,fromEitherK:Xde,fromOptionK:Zde,id:Qde,not:epe,or:tpe,zero:rpe},Symbol.toStringTag,{value:"Module"}));var nq=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{add:function(n,r){return e.map(function(i,o){return i.add(n[o],r[o])})},zero:e.map(function(n){return n.zero}),mul:function(n,r){return e.map(function(i,o){return i.mul(n[o],r[o])})},one:e.map(function(n){return n.one}),sub:function(n,r){return e.map(function(i,o){return i.sub(n[o],r[o])})}}},ape=function(e){return function(t){return e.sub(e.zero,t)}},upe=nq,spe=HR;const cpe=Object.freeze(Object.defineProperty({__proto__:null,getFunctionRing:spe,getTupleRing:upe,negate:ape,tuple:nq},Symbol.toStringTag,{value:"Module"})),lpe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var fpe=c_;const dpe=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:fpe},Symbol.toStringTag,{value:"Module"}));var ppe=ID,hpe=OD;function mpe(e){var t=nr(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);t(a,i)||i.add(a)}),i}}}function vpe(e){var t=nr(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){n(o).forEach(function(a){t(a,i)||i.add(a)})}),i}}}function p1(e){return function(t){for(var n=t.values(),r,i=new Set;!(r=n.next()).done;){var o=r.value;e(o)&&i.add(o)}return i}}function gpe(e){return function(t){for(var n=t.values(),r,i=new Set,o=new Set;!(r=n.next()).done;){var a=r.value;e(a)?i.add(a):o.add(a)}return Me(o,i)}}function h1(e){var t=nr(e);return function(n,r){if(r===void 0){var i=h1(e);return function(a){return i(n,a)}}if(Fp(n))return r;if(Fp(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function m1(e){var t=nr(e);return function(n,r){if(r===void 0){var i=m1(e);return function(a){return i(a,n)}}if(Fp(n)||Fp(r))return new Set;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function ype(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,u=new Set,s=nr(e),c=nr(t);!(o=i.next()).done;){var l=n(o.value);switch(l._tag){case"Left":s(l.left,a)||a.add(l.left);break;case"Right":c(l.right,u)||u.add(l.right);break}}return Me(a,u)}}}function v1(e){var t=nr(e);return function(n,r){if(r===void 0){var i=v1(e);return function(o){return i(o,n)}}return p1(function(o){return!t(o,r)})(n)}}var rq=function(e){return{concat:h1(e)}},bpe=function(e){return{concat:rq(e).concat,empty:new Set}},_pe=function(e){return{concat:m1(e)}},Spe=function(e){return{concat:v1(e)}},$pe=yD,Tpe=bD,Ipe=_D,Ope=function(e){return new Set([e])};function iq(e){var t=nr(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var oq=function(e){return function(t){return function(n){return p1(function(r){return!e.equals(t,r)})(n)}}},wpe=function(e){var t=nr(e),n=oq(e),r=iq(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},aq=function(e){return function(t){for(var n=t.length,r=new Set,i=nr(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}},Cpe=function(e){return uq(e)(D)};function Epe(e,t){return function(n){var r=nr(e),i=nr(t),o=new Set,a=new Set;return n.forEach(function(u){switch(u._tag){case"Left":r(u.left,o)||o.add(u.left);break;case"Right":i(u.right,a)||a.add(u.right);break}}),Me(o,a)}}function uq(e){var t=nr(e);return function(n){return function(r){var i=new Set;return r.forEach(function(o){var a=n(o);a._tag==="Some"&&!t(a.value,i)&&i.add(a.value)}),i}}}var Rpe=new Set,Fp=function(e){return e.size===0},Mpe=function(e){return e.size},xpe=HI,sq=GI,kpe=Tp,nr=pn,cq=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},Ape=Tp;const Npe=Object.freeze(Object.defineProperty({__proto__:null,chain:vpe,compact:Cpe,difference:v1,elem:nr,empty:Rpe,every:sq,filter:p1,filterMap:uq,foldMap:Tpe,fromArray:aq,getDifferenceMagma:Spe,getEq:hpe,getIntersectionSemigroup:_pe,getShow:ppe,getUnionMonoid:bpe,getUnionSemigroup:rq,insert:iq,intersection:m1,isEmpty:Fp,isSubset:kpe,map:mpe,partition:gpe,partitionMap:ype,reduce:$pe,reduceRight:Ipe,remove:oq,separate:Epe,singleton:Ope,size:Mpe,some:xpe,subset:Ape,toArray:cq,toggle:wpe,union:h1},Symbol.toStringTag,{value:"Module"}));var lq=function(e){return{show:function(t){var n="{";for(var r in e)lt.call(e,r)&&(n+=" ".concat(r,": ").concat(e[r].show(t[r]),","));return n.length>1&&(n=n.slice(0,-1)+" "),n+="}",n}}},fq=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{show:function(n){return"[".concat(n.map(function(r,i){return e[i].show(r)}).join(", "),"]")}}},Fpe=fq,Ppe=lq,Wpe={show:function(e){return JSON.stringify(e)}},jpe={show:function(e){return JSON.stringify(e)}},Lpe={show:function(e){return JSON.stringify(e)}};const Dpe=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:Ppe,getTupleShow:Fpe,showBoolean:Wpe,showNumber:Lpe,showString:jpe,struct:lq,tuple:fq},Symbol.toStringTag,{value:"Module"}));function g1(e){return function(t){return function(n){return e.of([t,n])}}}function y1(e){return function(t){return function(n){return function(r){return e.map(n(r),function(i){var o=i[0],a=i[1];return[t(o),a]})}}}}function b1(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){var o=i[0],a=i[1];return e.map(t(a),function(u){var s=u[0],c=u[1];return[o(s),c]})})}}}}function _1(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){var o=i[0],a=i[1];return t(o)(a)})}}}}function S1(e){return function(t){return function(n){return e.of(t(n))}}}function $1(e){return function(t){return function(n){return e.map(t,function(r){return[r,n]})}}}function T1(e){return function(t){return function(n){return e.map(n(t),function(r){var i=r[0];return i})}}}function I1(e){return function(t){return function(n){return e.map(n(t),wn)}}}function qpe(e){var t=b1(e),n=y1(e),r=_1(e),i=T1(e),o=I1(e);return{map:function(a,u){return y(a,n(u))},ap:function(a,u){return y(a,t(u))},of:g1(e),chain:function(a,u){return y(a,r(u))},get:function(){return function(a){return e.of([a,a])}},put:function(a){return function(){return e.of([void 0,a])}},modify:function(a){return function(u){return e.of([void 0,a(u)])}},gets:function(a){return function(u){return e.of([a(u),u])}},fromState:S1(e),fromM:$1(e),evalState:function(a,u){return y(a,i(u))},execState:function(a,u){return y(a,o(u))}}}const Upe=Object.freeze(Object.defineProperty({__proto__:null,ap:b1,chain:_1,evaluate:T1,execute:I1,fromF:$1,fromState:S1,getStateM:qpe,map:y1,of:g1},Symbol.toStringTag,{value:"Module"}));var O1=function(e){return function(){return kg(e)}},w1=g1(WI);function dq(e){return _i(II(e))}function Bpe(e){return _i(RL(e))}function pq(e){return _i(OI(e))}function zpe(e){return _i(ML(e))}function hq(e){return _i(wI(e))}function Kpe(e){return _i(kL(e))}var Vpe=function(e){return V(e,TI)},Hpe=function(e){return function(t){return kg(e(t)[0])}},mq=qa(function(e){return O1(e)},w1),vq=pq,ws=hq,Pp=dq,gq=S1(WI),yq=function(e){return _i(Za(e))},bq=function(e){return _i(CI(e))},Gpe=function(e){return _i(EI(e))},_i=$1(Is),Ype=function(e){return function(t){return V(t,zd(e))}},_q=function(e){return function(t){return function(n){return e(n)(t)(n)}}},Jpe=_q,Sq=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return bq(e.apply(void 0,t))}},$q=function(e){return function(t){return y(t,Wp(Sq(e)))}},Zpe=$q,Tq=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return yq(e.apply(void 0,t))}},Iq=function(e){return function(t){return y(t,Wp(Tq(e)))}},Xpe=Iq,Oq=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return _i(e.apply(void 0,t))}},wq=function(e){return function(t){return y(t,Wp(Oq(e)))}},Qpe=wq,Si=function(e,t){return y(e,Cq(t))},ta=function(e,t){return y(e,E1(t))},Cs=function(e,t){return y(e,R1(t))},C1=function(e,t){return function(n){return y(e(n),Pg(function(){return t()(n)}))}},Bg=function(e,t,n){return function(r){return y(e(r),NI(t,function(i){var o=i[0],a=i[1];return[n(o),a]}))}},zg=function(e,t){return function(n){return y(e(n),FI(t))}},Cq=y1(Is),ehe=function(e,t){return function(n){return Bg(n,e,t)}},the=function(e){return function(t){return zg(t,e)}},E1=b1(Wn),nhe=E1,ao=w1,R1=_1(Wn),Wp=R1,Eq=Wp(D),rhe=Eq,Rq=function(e){return function(t){return function(n){return y(t(n),GL(function(){return e()(n)}))}}},ihe=Rq,Kg=O1,zt="StateReaderTaskEither",M1={URI:zt,map:Si},ohe=Ke(M1),ahe={URI:zt,of:ao},Vg={URI:zt,map:Si,ap:ta},Mq=Ct(Vg),uhe=Mq,xq=Et(Vg),she=xq,che={URI:zt,map:Si,ap:ta,of:ao},rr={URI:zt,map:Si,ap:ta,chain:Cs},Es={URI:zt,fromState:gq},lhe=UF(Es),fhe=BF(Es),dhe=zF(Es),phe=KF(Es),hhe=k0(Es),mhe=VF(Es,rr),vhe={URI:zt,map:Si,ap:ta,of:ao,chain:Cs},ghe={URI:zt,map:Si,ap:ta,of:ao,chain:Cs,fromIO:ws},yhe={URI:zt,map:Si,ap:ta,of:ao,chain:Cs,fromIO:ws,fromTask:Pp},bhe={URI:zt,map:Si,ap:ta,of:ao,chain:Cs,throwError:Kg},kq=ft(rr),_he=kq,She={URI:zt,bimap:Bg,mapLeft:zg},$he={URI:zt,map:Si,alt:C1},Gl={URI:zt,fromReader:vq},The=Hd(Gl),Ihe=Gd(Gl),Ohe=hs(Gl),Aq=Yd(Gl,rr),whe=Aq,Nq=Jd(Gl,rr),Che=Nq,na={URI:zt,fromEither:mq},Ehe=Vi(na),Rhe=Hi(na),Mhe=Gu(na,rr),Fq=wo(na,rr),xhe=Fq,Pq=Co(na,rr),khe=Pq,Ahe=Aa(na),Wq=Yu(na,rr),Nhe=Wq,Fhe=gr(na),Hg={URI:zt,fromIO:ws},Phe=Xi(Hg),Whe=Po(Hg,rr),jhe=Wo(Hg,rr),Gg={URI:zt,fromIO:ws,fromTask:Pp},Lhe=ms(Gg),Dhe=_l(Gg,rr),qhe=Sl(Gg,rr),Uhe=T1(Is),Bhe=I1(Is),zhe=wt(M1),jq=Mt(rr),Khe=jq,Lq=Rt(Vg),Vhe=Lq,Dq=function(e){return function(t){return function(n){return function(r){return function(){return Rc(t).reduce(function(i,o,a){return i.then(function(u){return Gt(u)?i:e(a+1,o)(u.right[1])(r)().then(function(s){if(Gt(s))return s;var c=s.right,l=c[0],f=c[1];return u.right[0].push(l),u.right[1]=f,u})})},e(0,dr(t))(n)(r)().then(us(function(i){var o=i[0],a=i[1];return[[o],a]})))}}}}},x1=function(e){var t=Dq(e);return function(n){return gt(n)?t(n):ao(rn)}},Hhe=x1,qq=function(e){return x1(function(t,n){return e(n)})},Ghe=qq(D),Yhe={URI:zt,map:Si,of:ao,ap:ta,chain:Cs,bimap:Bg,mapLeft:zg,alt:C1,fromIO:ws,fromTask:Pp,throwError:Kg},Jhe={URI:zt,map:Si,of:ao,ap:ta,chain:Cs,bimap:Bg,mapLeft:zg,alt:C1,fromIO:ws,fromTask:Pp,throwError:Kg},Zhe=function(e,t){return y(e(t),_p(function(n){var r=n[0];return r}))},Xhe=function(e,t){return y(e(t),_p(function(n){n[0];var r=n[1];return r}))};function Qhe(e,t,n){return e(t)(n)()}const eme=Object.freeze(Object.defineProperty({__proto__:null,Alt:$he,Applicative:che,Apply:Vg,Bifunctor:She,Chain:rr,FromEither:na,FromIO:Hg,FromReader:Gl,FromState:Es,FromTask:Gg,Functor:M1,Monad:vhe,MonadIO:ghe,MonadTask:yhe,MonadThrow:bhe,Pointed:ahe,URI:zt,alt:ihe,altW:Rq,ap:E1,apFirst:Mq,apFirstW:uhe,apS:Lq,apSW:Vhe,apSecond:xq,apSecondW:she,apW:nhe,ask:The,asks:Ihe,asksStateReaderTaskEither:Jpe,asksStateReaderTaskEitherW:_q,bimap:ehe,bind:jq,bindTo:zhe,bindW:Khe,chain:R1,chainEitherK:Fq,chainEitherKW:xhe,chainFirst:kq,chainFirstEitherK:Pq,chainFirstEitherKW:khe,chainFirstIOK:jhe,chainFirstReaderK:Nq,chainFirstReaderKW:Che,chainFirstTaskK:qhe,chainFirstW:_he,chainIOEitherK:Zpe,chainIOEitherKW:$q,chainIOK:Whe,chainOptionK:Mhe,chainReaderK:Aq,chainReaderKW:whe,chainReaderTaskEitherK:Qpe,chainReaderTaskEitherKW:wq,chainStateK:mhe,chainTaskEitherK:Xpe,chainTaskEitherKW:Iq,chainTaskK:Dhe,chainW:Wp,evalState:Zhe,evaluate:Uhe,execState:Xhe,execute:Bhe,filterOrElse:Wq,filterOrElseW:Nhe,flap:ohe,flatten:rhe,flattenW:Eq,fromEither:mq,fromEitherK:Fhe,fromIO:ws,fromIOEither:bq,fromIOEitherK:Sq,fromIOK:Phe,fromOption:Ehe,fromOptionK:Rhe,fromPredicate:Ahe,fromReader:vq,fromReaderEither:Gpe,fromReaderK:Ohe,fromReaderTaskEither:_i,fromReaderTaskEitherK:Oq,fromState:gq,fromStateK:hhe,fromTask:Pp,fromTaskEither:yq,fromTaskEitherK:Tq,fromTaskK:Lhe,get:lhe,gets:phe,left:O1,leftIO:Kpe,leftReader:zpe,leftState:Hpe,leftTask:Bpe,local:Ype,map:Cq,mapLeft:the,modify:dhe,of:ao,put:fhe,right:w1,rightIO:hq,rightReader:pq,rightState:Vpe,rightTask:dq,run:Qhe,sequenceArray:Ghe,stateReaderTaskEither:Yhe,stateReaderTaskEitherSeq:Jhe,throwError:Kg,traverseArray:qq,traverseArrayWithIndex:Hhe,traverseReadonlyArrayWithIndex:x1,traverseReadonlyNonEmptyArrayWithIndex:Dq},Symbol.toStringTag,{value:"Module"}));function tme(e){return function(t){return{peek:t.peek,pos:e}}}function nme(e){return function(t){return{peek:t.peek,pos:e(t.pos)}}}function rme(e){return function(t){return t.peek(e(t.pos))}}function ime(e){return function(t){return function(n){return e.map(t(n.pos),function(r){return n.peek(r)})}}}var Uq=function(e,t){return y(e,zq(t))},ome=function(e,t){return y(e,k1(t))},k1=function(e){return function(t){return{peek:function(n){return e({peek:t.peek,pos:n})},pos:t.pos}}},Bq=function(e){return e.peek(e.pos)},ame=k1(D),zq=function(e){return function(t){return{peek:function(n){return e(t.peek(n))},pos:t.pos}}},A1="Store",Kq={URI:A1,map:Uq},ume=Ke(Kq),Vq={URI:A1,map:Uq,extend:ome,extract:Bq},sme=Vq;const cme=Object.freeze(Object.defineProperty({__proto__:null,Comonad:Vq,Functor:Kq,URI:A1,duplicate:ame,experiment:ime,extend:k1,extract:Bq,flap:ume,map:zq,peeks:rme,seek:tme,seeks:nme,store:sme},Symbol.toStringTag,{value:"Module"}));function N1(e,t){return function(n,r){return t.compose(e.second(r),e.first(n))}}function Hq(e,t){var n=N1(e,t);return function(r,i){return t.compose(n(r,i),e.promap(t.id(),D,function(o){return[o,o]}))}}function lme(e){return N1(e,e)}function fme(e){return Hq(e,e)}const dme=Object.freeze(Object.defineProperty({__proto__:null,fanOut:Hq,fanout:fme,split:N1,splitStrong:lme},Symbol.toStringTag,{value:"Module"}));var pme=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},hme=function(e){return function(t){var n={};for(var r in t)lt.call(t,r)&&(n[r]=e[r](t[r]));return n}};const mme=Object.freeze(Object.defineProperty({__proto__:null,evolve:hme,getAssignSemigroup:pme},Symbol.toStringTag,{value:"Module"}));var vme=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(l){try{c(r.next(l))}catch(f){a(f)}}function s(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(u,s)}c((r=r.apply(e,t||[])).next())})},gme=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(l){return s([c,l])}}function s(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Gq=tp(cn),yme=oT(cn),bme=In,Yq=aT(cn),jp=function(e){return Yg(Fn(e))},Yg=Gv(De),_me=Ha(rl),Jq=uT(De),Sme=Jq,F1=Xv(Wl),$me=F1,Zq=F1,Tme=Zq,Xq=Qv(Xt),Ime=Xq,Ome=Yv(cn),Qq=function(e){return function(){return vme(void 0,void 0,void 0,function(){return gme(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e().then(pe)];case 1:return[2,t.sent()];case 2:return t.sent(),[2,be];case 3:return[2]}})})}},wme=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Qq(function(){return e.apply(void 0,t)})}},Cme=Jv(cn),Eme=rT(Xt),Rme=Zv(cn),Mme=iT(Xt),P1=eg(De),eU=tg(Ss),uo=Gq,Jg=wl(Xt),xme=Jg(D),W1=ng(Xt),kme=W1,Zg=np(cn),Ame=Zg(),j1=Ji(De,ts),L1=Ao(De,ts,Qc),tU=No(De,Mo),nU=Fo(De,Mo),rU=Ua(De,Mo),iU=Ba(De,Mo),Kr=function(e,t){return y(e,P1(t))},Rs=function(e,t){return y(e,eU(t))},Xg=function(e,t){return y(e,Jg(t))},oU=function(e,t){return y(e,W1(t))},Nme=function(e,t){return y(e,tU(t))},Fme=function(e,t){return y(e,nU(t))},Pme=function(e,t){return y(e,rU(t))},Wme=function(e,t){return y(e,iU(t))},en="TaskOption",D1={URI:en,map:Kr},jme=Ke(D1),aU={URI:en,of:uo},Qg={URI:en,map:Kr,ap:Rs},Lme=Ct(Qg),Dme=Et(Qg),qme={URI:en,map:Kr,ap:Rs,of:uo},uU=function(e,t){return y(e,Jg(function(n){return y(t,P1(n))}))},Ume={URI:en,map:Kr,ap:uU},Bme={URI:en,map:Kr,ap:uU,of:uo},ra={URI:en,map:Kr,ap:Rs,chain:Xg},zme=ft(ra),Kme={URI:en,map:Kr,alt:oU},sU={URI:en,zero:Zg},Vme=qc(sU,aU),Hme={URI:en,map:Kr,ap:Rs,of:uo,alt:oU,zero:Zg},Gme={URI:en,map:Kr,ap:Rs,of:uo,chain:Xg},Yme={URI:en,map:Kr,ap:Rs,of:uo,chain:Xg,fromIO:jp},Jme={URI:en,map:Kr,ap:Rs,of:uo,chain:Xg,fromIO:jp,fromTask:Yg},Zme={URI:en,compact:j1,separate:L1},Xme={URI:en,map:Kr,compact:j1,separate:L1,filter:Nme,filterMap:Fme,partition:Pme,partitionMap:Wme},ey={URI:en,fromIO:jp},Qme=Xi(ey),eve=Po(ey,ra),tve=Wo(ey,ra),ty={URI:en,fromEither:Yq},nve=gr(ty),rve=wo(ty,ra),ive=Co(ty,ra),ny={URI:en,fromIO:jp,fromTask:Yg},ove=ms(ny),ave=_l(ny,ra),uve=Sl(ny,ra),sve=uo(Yt),cve=wt(D1),lve=Mt(ra),fve=Rt(Qg),q1=uo(rn),cU=function(e){return V(jl(e),Ha(kv(Jn)))},U1=function(e){var t=cU(e);return function(n){return gt(n)?t(n):q1}},lU=function(e){return function(t){return function(){return Rc(t).reduce(function(n,r,i){return n.then(function(o){return Wt(o)?n:e(i+1,r)().then(function(a){return Wt(a)?a:(o.value.push(a.value),o)})})},e(0,dr(t))().then(Yi(Vf)))}}},B1=function(e){var t=lU(e);return function(n){return gt(n)?t(n):q1}},dve=U1,fU=function(e){return U1(function(t,n){return e(n)})},pve=fU(D),hve=B1,dU=function(e){return B1(function(t,n){return e(n)})},mve=dU(D);const vve=Object.freeze(Object.defineProperty({__proto__:null,Alt:Kme,Alternative:Hme,ApT:q1,ApplicativePar:qme,ApplicativeSeq:Bme,ApplyPar:Qg,ApplySeq:Ume,Chain:ra,Compactable:Zme,Do:sve,Filterable:Xme,FromEither:ty,FromIO:ey,FromTask:ny,Functor:D1,Monad:Gme,MonadIO:Yme,MonadTask:Jme,Pointed:aU,Zero:sU,alt:W1,altW:kme,ap:eU,apFirst:Lme,apS:fve,apSecond:Dme,bind:lve,bindTo:cve,chain:Jg,chainEitherK:rve,chainFirst:zme,chainFirstEitherK:ive,chainFirstIOK:tve,chainFirstTaskK:uve,chainIOK:eve,chainNullableK:Eme,chainOptionK:Mme,chainTaskK:ave,compact:j1,filter:tU,filterMap:nU,flap:jme,flatten:xme,fold:$me,foldW:Tme,fromEither:Yq,fromEitherK:nve,fromIO:jp,fromIOK:Qme,fromNullable:Ome,fromNullableK:Cme,fromOption:bme,fromOptionK:Rme,fromPredicate:yme,fromTask:Yg,fromTaskEither:_me,fromTaskK:ove,getOrElse:Xq,getOrElseW:Ime,guard:Vme,map:P1,match:Jq,matchE:F1,matchEW:Zq,matchW:Sme,none:Ame,of:uo,partition:rU,partitionMap:iU,separate:L1,sequenceArray:pve,sequenceSeqArray:mve,some:Gq,traverseArray:fU,traverseArrayWithIndex:dve,traverseReadonlyArrayWithIndex:U1,traverseReadonlyArrayWithIndexSeq:B1,traverseReadonlyNonEmptyArrayWithIndex:cU,traverseReadonlyNonEmptyArrayWithIndexSeq:lU,traverseSeqArray:dU,traverseSeqArrayWithIndex:hve,tryCatch:Qq,tryCatchK:wme,zero:Zg},Symbol.toStringTag,{value:"Module"}));var Ze=function(e){return e._tag==="Left"},kt=function(e){return e._tag==="Right"};function Ms(e){return e._tag==="Both"}function mn(e){return{_tag:"Left",left:e}}function ir(e){return{_tag:"Right",right:e}}function nt(e,t){return{_tag:"Both",left:e,right:t}}var z1=function(e,t,n){return function(r){switch(r._tag){case"Left":return e(r.left);case"Right":return t(r.right);case"Both":return n(r.left,r.right)}}},gve=z1,ru=z1,yve=ru,pU=ru(ir,mn,function(e,t){return nt(t,e)});function bve(e,t){return{show:ru(function(n){return"left(".concat(e.show(n),")")},function(n){return"right(".concat(t.show(n),")")},function(n,r){return"both(".concat(e.show(n),", ").concat(t.show(r),")")})}}function _ve(e,t){return Pr(function(n,r){return Ze(n)?Ze(r)&&e.equals(n.left,r.left):kt(n)?kt(r)&&t.equals(n.right,r.right):Ms(r)&&e.equals(n.left,r.left)&&t.equals(n.right,r.right)})}function hU(e,t){return{concat:function(n,r){return Ze(n)?Ze(r)?mn(e.concat(n.left,r.left)):kt(r)?nt(n.left,r.right):nt(e.concat(n.left,r.left),r.right):kt(n)?Ze(r)?nt(r.left,n.right):kt(r)?ir(t.concat(n.right,r.right)):nt(r.left,t.concat(n.right,r.right)):Ze(r)?nt(e.concat(n.left,r.left),n.right):kt(r)?nt(n.left,t.concat(n.right,r.right)):nt(e.concat(n.left,r.left),t.concat(n.right,r.right))}}}var ry=function(e){return{URI:Sr,_E:void 0,map:xs,ap:function(t,n){return Ze(t)?Ze(n)?mn(e.concat(t.left,n.left)):kt(n)?mn(t.left):mn(e.concat(t.left,n.left)):kt(t)?Ze(n)?mn(n.left):kt(n)?ir(t.right(n.right)):nt(n.left,t.right(n.right)):Ze(n)?mn(e.concat(t.left,n.left)):kt(n)?nt(t.left,t.right(n.right)):nt(e.concat(t.left,n.left),t.right(n.right))}}};function Sve(e){var t=ry(e);return{URI:Sr,_E:void 0,map:xs,ap:t.ap,of:Lp}}function mU(e){var t=ry(e),n=function(r,i){if(Ze(r))return r;if(kt(r))return i(r.right);var o=i(r.right);return Ze(o)?mn(e.concat(r.left,o.left)):kt(o)?nt(r.left,o.right):nt(e.concat(r.left,o.left),o.right)};return{URI:Sr,_E:void 0,map:xs,ap:t.ap,chain:n}}function $ve(e){var t=mU(e);return{URI:Sr,_E:void 0,map:xs,of:Lp,ap:t.ap,chain:t.chain,throwError:mn}}function Tve(e){return Ze(e)?pe(e.left):kt(e)?be:pe(e.left)}function Ive(e){return Ze(e)?be:(kt(e),pe(e.right))}function Ove(e){return function(t){return Wt(t)?mn(e):nt(e,t.value)}}function wve(e){return function(t){return Wt(t)?ir(e):nt(t.value,e)}}function Cve(e){return Ze(e)?pe(e.left):be}function Eve(e){return kt(e)?pe(e.right):be}var Rve=function(e,t){return Wt(e)?Wt(t)?be:pe(ir(t.value)):Wt(t)?pe(mn(e.value)):pe(nt(e.value,t.value))},xs=function(e,t){return y(e,J1(t))},vU=function(e,t,n){return y(e,G1(t,n))},gU=function(e,t){return y(e,Y1(t))},K1=function(e,t,n){return y(e,bU(t,n))},V1=function(e){var t=_U(e);return function(n,r){return y(n,t(r))}},H1=function(e,t,n){return y(e,SU(t,n))},yU=function(e){var t=$U(e);return function(n,r){return y(n,t(r))}},G1=function(e,t){return function(n){return Ze(n)?mn(e(n.left)):kt(n)?ir(t(n.right)):nt(e(n.left),t(n.right))}},Y1=function(e){return function(t){return Ze(t)?mn(e(t.left)):Ms(t)?nt(e(t.left),t.right):t}},J1=function(e){return function(t){return Ze(t)?t:kt(t)?ir(e(t.right)):nt(t.left,e(t.right))}},bU=function(e,t){return function(n){return Ze(n)?e:t(e,n.right)}},_U=function(e){return function(t){return function(n){return Ze(n)?e.empty:t(n.right)}}},SU=function(e,t){return function(n){return Ze(n)?e:t(n.right,e)}},$U=function(e){return function(t){return function(n){return Ze(n)?e.of(n):kt(n)?e.map(t(n.right),ir):e.map(t(n.right),function(r){return nt(n.left,r)})}}},Z1=function(e){return function(t){return Ze(t)?e.of(t):kt(t)?e.map(t.right,ir):e.map(t.right,function(n){return nt(t.left,n)})}},Lp=ir,Sr="These",X1={URI:Sr,map:xs},Mve=Ke(X1),xve={URI:Sr,of:Lp},kve={URI:Sr,bimap:vU,mapLeft:gU},Ave={URI:Sr,fromThese:D},Nve={URI:Sr,reduce:K1,foldMap:V1,reduceRight:H1},Fve={URI:Sr,map:xs,reduce:K1,foldMap:V1,reduceRight:H1,traverse:yU,sequence:Z1},Q1={URI:Sr,fromEither:D},Pve=Vi(Q1),Wve=Hi(Q1),jve=function(e){return function(t){return function(n){return Ze(n)?!1:e.equals(t,n.right)}}},Lve=function(e){return function(t){return Ze(t)?!1:e(t.right)}},eO=function(e,t){return function(n){return Ze(n)?[n.left,t()]:kt(n)?[e(),n.right]:[n.left,n.right]}},Dve=function(e,t){return eO(function(){return e},function(){return t})},TU=Lp(rn),tO=function(e){return function(t){return function(n){var r=be,i=t(0,dr(n));if(Ze(i))return i;Ms(i)&&(r=pe(i.left));for(var o=[i.right],a=1;a<n.length;a++){var u=t(a,n[a]);if(Ze(u))return u;Ms(u)&&(r=Wt(r)?pe(u.left):pe(e.concat(r.value,u.left))),o.push(u.right)}return Wt(r)?ir(o):nt(r.value,o)}}},qve=function(e){return function(t){var n=tO(e)(t);return function(r){return gt(r)?n(r):TU}}},Uve={URI:Sr,map:xs,bimap:vU,mapLeft:gU,reduce:K1,foldMap:V1,reduceRight:H1,traverse:yU,sequence:Z1};const Bve=Object.freeze(Object.defineProperty({__proto__:null,ApT:TU,Bifunctor:kve,Foldable:Nve,FromEither:Q1,FromThese:Ave,Functor:X1,Pointed:xve,Traversable:Fve,URI:Sr,bimap:G1,both:nt,elem:jve,exists:Lve,flap:Mve,fold:yve,foldMap:_U,foldW:gve,fromOption:Pve,fromOptionK:Wve,fromOptions:Rve,getApplicative:Sve,getApply:ry,getChain:mU,getEq:_ve,getLeft:Tve,getLeftOnly:Cve,getMonad:$ve,getRight:Ive,getRightOnly:Eve,getSemigroup:hU,getShow:bve,isBoth:Ms,isLeft:Ze,isRight:kt,left:mn,leftOrBoth:Ove,map:J1,mapLeft:Y1,match:ru,matchW:z1,of:Lp,reduce:bU,reduceRight:SU,right:ir,rightOrBoth:wve,sequence:Z1,swap:pU,these:Uve,toTuple:Dve,toTuple2:eO,traverse:$U,traverseReadonlyArrayWithIndex:qve,traverseReadonlyNonEmptyArrayWithIndex:tO},Symbol.toStringTag,{value:"Module"}));function iy(e){return V(ir,e.of)}function oy(e){return V(mn,e.of)}function nO(e){return V(nt,e.of)}function rO(e){return function(t){return e.map(t,ir)}}function iO(e){return function(t){return e.map(t,mn)}}function oO(e){return Cc(e,X1)}function aO(e,t){return $o(e,ry(t))}function uO(e,t){var n=oy(e);return function(r){return function(i){return e.chain(i,ru(n,r,function(o,a){return e.map(r(a),ru(function(u){return mn(t.concat(o,u))},function(u){return nt(o,u)},function(u,s){return nt(t.concat(o,u),s)}))}))}}}function sO(e){return function(t,n){return function(r){return e.map(r,G1(t,n))}}}function cO(e){return function(t){return function(n){return e.map(n,Y1(t))}}}function IU(e){return function(t,n,r){return function(i){return e.map(i,ru(t,n,r))}}}function lO(e){return function(t,n,r){return function(i){return e.chain(i,ru(t,n,r))}}}function fO(e){return function(t){return e.map(t,pU)}}function dO(e){return function(t,n){return function(r){return e.map(r,eO(t,n))}}}function zve(e){var t=oO(e),n=sO(e),r=cO(e),i=lO(e),o=dO(e),a=iy(e),u=function(s,c){return y(s,t(c))};return{map:u,bimap:function(s,c,l){return y(s,n(c,l))},mapLeft:function(s,c){return y(s,r(c))},fold:function(s,c,l,f){return y(s,i(c,l,f))},swap:fO(e),rightM:rO(e),leftM:iO(e),left:oy(e),right:iy(e),both:nO(e),toTuple:function(s,c,l){return y(s,o(function(){return c},function(){return l}))},getMonad:function(s){var c=aO(e,s),l=uO(e,s);return{_E:void 0,map:u,of:a,ap:function(f,d){return y(f,c(d))},chain:function(f,d){return y(f,l(d))}}}}}const Kve=Object.freeze(Object.defineProperty({__proto__:null,ap:aO,bimap:sO,both:nO,chain:uO,getTheseM:zve,left:oy,leftF:iO,map:oO,mapLeft:cO,match:IU,matchE:lO,right:iy,rightF:rO,swap:fO,toTuple2:dO},Symbol.toStringTag,{value:"Module"}));var Vve=oy(cn),OU=iy(cn),Hve=nO(cn),pO=rO(De),wU=iO(De),CU=V(Fn,pO),Gve=V(Fn,wU),EU=In,RU=In,ay=CU,Yve=Fn,hO=pO,MU=IU(De),Jve=MU,xU=lO(Xt),kU=xU,AU=kU,Zve=AU,Xve=fO(De),ks=function(e,t){return y(e,NU(t))},mO=function(e,t,n){return y(e,FU(t,n))},vO=function(e,t){return y(e,PU(t))},NU=oO(De),FU=sO(De),PU=cO(De),Dp=OU,jn="TaskThese",gO=function(e,t){var n=aO(e,t);return{URI:jn,_E:void 0,map:ks,ap:function(r,i){return y(r,n(i))}}};function WU(e,t){var n=gO(e,t).ap;return{URI:jn,_E:void 0,map:ks,ap:n,of:Dp}}function jU(e){var t=gO(pp,e),n=uO(Xt,e);return{URI:jn,_E:void 0,map:ks,ap:t.ap,chain:function(r,i){return y(r,n(i))}}}function Qve(e){var t=WU(pp,e),n=jU(e);return{URI:jn,_E:void 0,map:ks,ap:t.ap,of:Dp,chain:n.chain,fromIO:ay,fromTask:hO}}var LU={URI:jn,map:ks},ege=Ke(LU),tge={URI:jn,of:Dp},nge={URI:jn,bimap:mO,mapLeft:vO},uy={URI:jn,fromEither:EU},rge=Vi(uy),ige=Hi(uy),oge=Aa(uy),DU={URI:jn,fromThese:RU},age=HF(DU),qU={URI:jn,fromIO:ay},uge=Xi(qU),UU={URI:jn,fromIO:ay,fromTask:hO},sge=ms(UU),BU=dO(De),yO=Dp(rn),zU=function(e){var t=tO(e);return function(n){return V(jl(n),Ha(t(Jn)))}},cge=function(e){return function(t){var n=zU(e)(t);return function(r){return gt(r)?n(r):yO}}},KU=function(e){return function(t){return function(n){return function(){return Rc(n).reduce(function(r,i,o){return r.then(function(a){return Ze(a)?r:t(o+1,i)().then(function(u){if(Ze(u))return u;if(Ms(u)){var s=a.right;return s.push(u.right),Ms(a)?nt(e.concat(a.left,u.left),s):nt(u.left,s)}return a.right.push(u.right),a})})},t(0,dr(n))().then(J1(Vf)))}}}},lge=function(e){return function(t){var n=KU(e)(t);return function(r){return gt(r)?n(r):yO}}},fge={URI:jn,map:ks},dge={URI:jn,bimap:mO,mapLeft:vO},pge=function(e,t){return BU(function(){return e},function(){return t})},hge={URI:jn,map:ks,bimap:mO,mapLeft:vO},mge=function(e,t){return Jt(_g)(hU(e,t))};const vge=Object.freeze(Object.defineProperty({__proto__:null,ApT:yO,Bifunctor:nge,FromEither:uy,FromIO:qU,FromTask:UU,FromThese:DU,Functor:LU,Pointed:tge,URI:jn,bifunctorTaskThese:dge,bimap:FU,both:Hve,flap:ege,fold:kU,foldW:Zve,fromEither:EU,fromIO:ay,fromIOEither:Yve,fromIOK:uge,fromOption:rge,fromOptionK:ige,fromPredicate:oge,fromTask:hO,fromTaskK:sge,fromThese:RU,fromTheseK:age,functorTaskThese:fge,getApplicative:WU,getApply:gO,getChain:jU,getMonad:Qve,getSemigroup:mge,left:Vve,leftIO:Gve,leftTask:wU,map:NU,mapLeft:PU,match:MU,matchE:xU,matchEW:AU,matchW:Jve,of:Dp,right:OU,rightIO:CU,rightTask:pO,swap:Xve,taskThese:hge,toTuple:pge,toTuple2:BU,traverseReadonlyArrayWithIndex:cge,traverseReadonlyArrayWithIndexSeq:lge,traverseReadonlyNonEmptyArrayWithIndex:zU,traverseReadonlyNonEmptyArrayWithIndexSeq:KU},Symbol.toStringTag,{value:"Module"}));function gge(e,t){return function(n){return n(t(n(e.empty)))}}function yge(e){return function(t){return[e(t),t]}}function bge(e){return function(t){return function(n){return[t(n),e(n)]}}}function _ge(e){return function(t){return function(n){return t(e(n))}}}function Sge(e){function t(r,i){return function(o){return i(function(a){return r(e.concat(o,a))})}}function n(r){return r(e.empty)}return{URI:bO,_E:void 0,map:VU,extend:t,extract:n}}var VU=function(e,t){return y(e,HU(t))},HU=function(e){return function(t){return function(n){return e(t(n))}}},bO="Traced",_O={URI:bO,map:VU},$ge=Ke(_O),Tge=_O;const Ige=Object.freeze(Object.defineProperty({__proto__:null,Functor:_O,URI:bO,censor:_ge,flap:$ge,getComonad:Sge,listen:yge,listens:bge,map:HU,traced:Tge,tracks:gge},Symbol.toStringTag,{value:"Module"}));function GU(e,t){return function(n){var r=e.traverse(n),i=t.traverse(n);return function(o){return function(a){return r(a,function(u){return i(u,o)})}}}}function YU(e,t){return function(n){var r=e.sequence(n),i=t.sequence(n);return function(o){return r(e.map(o,i))}}}function Oge(e,t){var n=Ec(e,t).map,r=g0(e,t),i=GU(e,t),o=YU(e,t);return{map:n,reduce:r.reduce,foldMap:r.foldMap,reduceRight:r.reduceRight,traverse:function(a){var u=i(a);return function(s,c){return y(s,u(c))}},sequence:function(a){var u=o(a);return function(s){return y(s,u)}}}}const wge=Object.freeze(Object.defineProperty({__proto__:null,getTraversableComposition:Oge,sequence:YU,traverse:GU},Symbol.toStringTag,{value:"Module"})),Cge=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function JU(e,t){return t===void 0&&(t=[]),{value:e,forest:t}}function Ege(e){var t=function(n){return Pa(n.forest)?"make(".concat(e.show(n.value),")"):"make(".concat(e.show(n.value),", [").concat(n.forest.map(t).join(", "),"])")};return{show:t}}function Rge(e){var t,n=Pr(function(r,i){return e.equals(r.value,i.value)&&t.equals(r.forest,i.forest)});return t=OA(n),n}var ZU=function(e,t){for(var n="",r=t.length,i,o=0;o<r;o++){i=t[o];var a=o===r-1;n+=e+(a?"└":"├")+"─ "+i.value,n+=ZU(e+(r>1&&!a?"│ ":" "),i.forest)}return n};function XU(e){return ZU(`
|
|
28
|
+
`,e)}function Mge(e){return e.value+XU(e.forest)}function QU(e,t){var n=t(e),r=n[0],i=n[1];return{value:r,forest:eB(i,t)}}function eB(e,t){return e.map(function(n){return QU(n,t)})}function tB(e){var t=nB(e);return function(n,r){return e.chain(r(n),function(i){var o=i[0],a=i[1];return e.map(t(a,r),function(u){return{value:o,forest:u}})})}}function nB(e){var t=_v(e);return function(n,r){return y(n,t(function(i){return tB(e)(i,r)}))}}function xge(e){var t=function(n){return e(n.value,n.forest.map(t))};return t}var iu=function(e,t){return y(e,cy(t))},Yl=function(e,t){return y(e,qp(function(n){return y(t,cy(n))}))},SO=function(e,t){return y(e,qp(t))},$O=function(e,t,n){return y(e,ly(t,n))},TO=function(e){var t=oB(e);return function(n,r){return y(n,t(r))}},IO=function(e,t,n){return y(e,OO(t,n))},rB=function(e,t){return y(e,sy(t))},iB=function(e){var t=CO(e);return function(n,r){return y(n,t(r))}},kge=function(e){return function(t){return Yl(t,e)}},qp=function(e){return function(t){var n=e(t.value),r=n.value,i=n.forest,o=M$().concat;return{value:r,forest:o(i,t.forest.map(qp(e)))}}},sy=function(e){return function(t){return{value:e(t),forest:t.forest.map(sy(e))}}},Age=sy(D),Nge=qp(D),cy=function(e){return function(t){return{value:e(t.value),forest:t.forest.map(cy(e))}}},ly=function(e,t){return function(n){for(var r=t(e,n.value),i=n.forest.length,o=0;o<i;o++)r=y(n.forest[o],ly(r,t));return r}},oB=function(e){return function(t){return ly(e.empty,function(n,r){return e.concat(n,t(r))})}},OO=function(e,t){return function(n){for(var r=e,i=n.forest.length,o=i-1;o>=0;o--)r=y(n.forest[o],OO(r,t));return t(n.value,r)}},wO=function(e){return e.value},CO=function(e){var t=_v(e),n=function(r){return function(i){return e.ap(e.map(r(i.value),function(o){return function(a){return{value:o,forest:a}}}),y(i.forest,t(n(r))))}};return n},EO=function(e){return CO(e)(D)},Jl=function(e){return JU(e)},$i="Tree",RO={URI:$i,map:iu},Fge=Ke(RO),Pge={URI:$i,of:Jl},fy={URI:$i,map:iu,ap:Yl},Wge=Ct(fy),jge=Et(fy),Lge={URI:$i,map:iu,ap:Yl,of:Jl},MO={URI:$i,map:iu,ap:Yl,chain:SO},Dge={URI:$i,map:iu,ap:Yl,of:Jl,chain:SO},qge=ft(MO),Uge={URI:$i,reduce:$O,foldMap:TO,reduceRight:IO},Bge={URI:$i,map:iu,reduce:$O,foldMap:TO,reduceRight:IO,traverse:iB,sequence:EO},zge={URI:$i,map:iu,extend:rB,extract:wO},Kge=Jl(Yt),Vge=wt(RO),Hge=Mt(MO),Gge=Rt(fy);function Yge(e){var t=function(n,r){return e.equals(n,r.value)||r.forest.some(function(i){return t(n,i)})};return t}var aB=function(e){return function(t){return e(t.value)||t.forest.some(aB(e))}},Jge={URI:$i,map:iu,of:Jl,ap:Yl,chain:SO,reduce:$O,foldMap:TO,reduceRight:IO,traverse:iB,sequence:EO,extract:wO,extend:rB};const Zge=Object.freeze(Object.defineProperty({__proto__:null,Applicative:Lge,Apply:fy,Chain:MO,Comonad:zge,Do:Kge,Foldable:Uge,Functor:RO,Monad:Dge,Pointed:Pge,Traversable:Bge,URI:$i,ap:kge,apFirst:Wge,apS:Gge,apSecond:jge,bind:Hge,bindTo:Vge,chain:qp,chainFirst:qge,drawForest:XU,drawTree:Mge,duplicate:Age,elem:Yge,exists:aB,extend:sy,extract:wO,flap:Fge,flatten:Nge,fold:xge,foldMap:oB,getEq:Rge,getShow:Ege,make:JU,map:cy,of:Jl,reduce:ly,reduceRight:OO,sequence:EO,traverse:CO,tree:Jge,unfoldForest:eB,unfoldForestM:nB,unfoldTree:QU,unfoldTreeM:tB},Symbol.toStringTag,{value:"Module"}));var $r=Qt,or=wn,Xge=function(e){return[or(e),$r(e)]};function xO(e){return{URI:Tr,_E:void 0,map:Up,ap:function(t,n){return[$r(t)($r(n)),e.concat(or(t),or(n))]}}}var uB=function(e){return function(t){return[t,e.empty]}};function Qge(e){var t=xO(e);return{URI:Tr,_E:void 0,map:t.map,ap:t.ap,of:uB(e)}}function kO(e){var t=xO(e);return{URI:Tr,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r($r(n)),o=i[0],a=i[1];return[o,e.concat(or(n),a)]}}}function eye(e){var t=kO(e);return{URI:Tr,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:uB(e)}}function tye(e){var t=function(r,i){for(var o=i(r),a=e.empty,u=$r(o);u._tag==="Left";)a=e.concat(a,or(o)),o=i(u.left),u=$r(o);return[u.right,e.concat(a,or(o))]},n=kO(e);return{URI:Tr,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var sB=function(e,t){return y(e,hB(t))},Up=function(e,t){return y(e,PO(t))},cB=function(e,t,n){return y(e,pB(t,n))},lB=function(e,t){return y(e,WO(t))},fB=function(e,t){return y(e,jO(t))},AO=function(e,t,n){return y(e,vB(t,n))},NO=function(e){var t=mB();return function(n,r){return y(n,t(r))}},FO=function(e,t,n){return y(e,gB(t,n))};function dB(e){var t=yB(e);return function(n,r){return y(n,t(r))}}var pB=function(e,t){return function(n){return[t($r(n)),e(or(n))]}},PO=function(e){return function(t){return[e($r(t)),or(t)]}},WO=function(e){return function(t){return[$r(t),e(or(t))]}},hB=function(e){return function(t){return[$r(t),or(e)]}},jO=function(e){return function(t){return[e(t),or(t)]}},nye=jO(D),LO=Ug,mB=i1,vB=r1,gB=o1,yB=function(e){return function(t){return function(n){return e.map(t($r(n)),function(r){return[r,or(n)]})}}},DO=function(e){return function(t){return e.map($r(t),function(n){return[n,or(t)]})}},Tr="Tuple",bB={URI:Tr,map:Up},rye=Ke(bB),iye={URI:Tr,bimap:cB,mapLeft:lB},oye={URI:Tr,compose:sB},aye={URI:Tr,map:Up,extend:fB,extract:LO},uye={URI:Tr,reduce:AO,foldMap:NO,reduceRight:FO},sye={URI:Tr,map:Up,reduce:AO,foldMap:NO,reduceRight:FO,traverse:dB,sequence:DO},cye=PO,lye=WO,fye={URI:Tr,compose:sB,map:Up,bimap:cB,mapLeft:lB,extract:LO,extend:fB,reduce:AO,foldMap:NO,reduceRight:FO,traverse:dB,sequence:DO};const dye=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:iye,Comonad:aye,Foldable:uye,Functor:bB,Semigroupoid:oye,Traversable:sye,URI:Tr,bimap:pB,compose:hB,duplicate:nye,extend:jO,extract:LO,flap:rye,foldMap:mB,fst:$r,getApplicative:Qge,getApply:xO,getChain:kO,getChainRec:tye,getMonad:eye,map:cye,mapFst:PO,mapLeft:lye,mapSnd:WO,reduce:vB,reduceRight:gB,sequence:DO,snd:or,swap:Xge,traverse:yB,tuple:fye},Symbol.toStringTag,{value:"Module"})),pye=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function hye(e,t){var n=gx(t,La(e));return{map:n.map,ap:n.ap,of:n.of,chain:function(r,i){return t.chain(r,function(o){return Gt(o)?t.of(So(o.left)):i(o.right)})},alt:function(r,i){return t.chain(r,function(o){return d_(o)?t.of(o):t.map(i(),function(a){return Gt(a)?So(e.concat(o.left,a.left)):a})})}}}const mye=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:hye},Symbol.toStringTag,{value:"Module"}));var _B=__(void 0),vye={concat:_B.concat,empty:void 0};const gye=Object.freeze(Object.defineProperty({__proto__:null,Monoid:vye,Semigroup:_B},Symbol.toStringTag,{value:"Module"}));var yye=function(e){return function(){return[void 0,e]}},bye=function(e){return function(){var t=e(),n=t[0],r=t[1];return[[n,r],r]}},_ye=function(e){return function(){var t=e(),n=t[0],r=n[0],i=n[1],o=t[1];return[r,i(o)]}},Sye=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,e(i)],i]}}},$ye=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[r,e(i)]}}},Bp=function(e,t){return y(e,SB(t))},SB=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[e(r),i]}}},As="Writer",$B=function(e){return{URI:As,_E:void 0,of:function(t){return function(){return[t,e.empty]}}}},qO=function(e){return{URI:As,_E:void 0,map:Bp,ap:function(t,n){return function(){var r=t(),i=r[0],o=r[1],a=n(),u=a[0],s=a[1];return[i(u),e.concat(o,s)]}}}},TB=function(e){var t=qO(e),n=$B(e);return{URI:As,_E:void 0,map:Bp,ap:t.ap,of:n.of}};function IB(e){var t=qO(e);return{URI:As,_E:void 0,map:Bp,ap:t.ap,chain:function(n,r){return function(){var i=n(),o=i[0],a=i[1],u=r(o)(),s=u[0],c=u[1];return[s,e.concat(a,c)]}}}}function Tye(e){var t=TB(e),n=IB(e);return{URI:As,_E:void 0,map:Bp,ap:t.ap,of:t.of,chain:n.chain}}var UO={URI:As,map:Bp},Iye=Ke(UO),Oye=function(e){return e()[0]},wye=function(e){return e()[1]},Cye=function(e){return e()[0]},Eye=function(e){return e()[1]},Rye=UO;const Mye=Object.freeze(Object.defineProperty({__proto__:null,Functor:UO,URI:As,censor:$ye,evalWriter:Cye,evaluate:Oye,execWriter:Eye,execute:wye,flap:Iye,getApplicative:TB,getApply:qO,getChain:IB,getMonad:Tye,getPointed:$B,listen:bye,listens:Sye,map:SB,pass:_ye,tell:yye,writer:Rye},Symbol.toStringTag,{value:"Module"}));function xye(e){var t=function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[r(o),a]})}};return{map:t,evalWriter:function(n){return e.map(n(),function(r){var i=r[0];return i})},execWriter:function(n){return e.map(n(),function(r){r[0];var i=r[1];return i})},tell:function(n){return function(){return e.of([void 0,n])}},listen:function(n){return function(){return e.map(n(),function(r){var i=r[0],o=r[1];return[[i,o],o]})}},pass:function(n){return function(){return e.map(n(),function(r){var i=r[0],o=i[0],a=i[1],u=r[1];return[o,a(u)]})}},listens:function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[[o,r(a)],a]})}},censor:function(n,r){return function(){return e.map(n(),function(i){var o=i[0],a=i[1];return[o,r(a)]})}},getMonad:function(n){return{_E:void 0,map:t,of:function(r){return function(){return e.of([r,n.empty])}},ap:function(r,i){return function(){return e.chain(r(),function(o){var a=o[0],u=o[1];return e.map(i(),function(s){var c=s[0],l=s[1];return[a(c),n.concat(u,l)]})})}},chain:function(r,i){return function(){return e.chain(r(),function(o){var a=o[0],u=o[1];return e.map(i(a)(),function(s){var c=s[0],l=s[1];return[c,n.concat(u,l)]})})}}}}}}const mt=Ic(Object.freeze(Object.defineProperty({__proto__:null,alt:NY,alternative:PY,applicative:WY,apply:TG,array:H8,bifunctor:G8,boolean:nX,booleanAlgebra:uX,bounded:fX,boundedDistributiveLattice:hX,boundedJoinSemilattice:mX,boundedLattice:vX,boundedMeetSemilattice:gX,category:yX,chain:IG,chainRec:bX,choice:$X,comonad:TX,compactable:hQ,console:bQ,const:NQ,contravariant:FQ,date:BQ,distributiveLattice:dX,either:oF,eitherT:xee,endomorphism:Aee,eq:lG,extend:Nee,field:Wee,filterable:Lee,filterableWithIndex:Dee,foldable:Vee,foldableWithIndex:Gee,fromEither:jY,fromIO:Yee,fromReader:gte,fromState:Wte,fromTask:jte,fromThese:Lte,function:XR,functor:fG,functorWithIndex:qte,group:Ute,heytingAlgebra:Bte,hkt:zte,identity:dne,invariant:pne,io:kne,ioEither:kre,ioOption:Oie,ioRef:Cie,joinSemilattice:Eie,json:xie,lattice:kie,magma:UG,map:qoe,meetSemilattice:Uoe,monad:Boe,monadIO:zoe,monadTask:Koe,monadThrow:Voe,monoid:oae,naturalTransformation:aae,nonEmptyArray:MJ,number:WJ,option:dQ,optionT:Nre,ord:jG,ordering:pae,pipeable:xae,pointed:kae,predicate:EX,profunctor:Aae,random:Wae,reader:vte,readerEither:Aue,readerT:Pue,readerTask:zse,readerTaskEither:gfe,readonlyArray:cZ,readonlyMap:ooe,readonlyNonEmptyArray:D9,readonlyRecord:kY,readonlySet:Nfe,readonlyTuple:Yfe,record:Jde,refinement:ope,ring:cpe,semigroup:OM,semigroupoid:lpe,semiring:dpe,separated:yG,set:Npe,show:Dpe,state:Pte,stateReaderTaskEither:eme,stateT:Upe,store:cme,string:rY,strong:dme,struct:mme,task:sse,taskEither:ele,taskOption:vve,taskThese:vge,these:Bve,theseT:Kve,traced:Ige,traversable:wge,traversableWithIndex:Cge,tree:Zge,tuple:dye,unfoldable:pye,validationT:mye,void:gye,witherable:iY,writer:Mye,writerT:Object.freeze(Object.defineProperty({__proto__:null,getWriterM:xye},Symbol.toStringTag,{value:"Module"})),zero:jJ},Symbol.toStringTag,{value:"Module"})));var BO={},Ns={},vn={},zO={},OB;function Qe(){return OB||(OB=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getEndomorphismMonoid=e.not=e.SK=e.hole=e.pipe=e.untupled=e.tupled=e.absurd=e.decrement=e.increment=e.tuple=e.flow=e.flip=e.constVoid=e.constUndefined=e.constNull=e.constFalse=e.constTrue=e.constant=e.unsafeCoerce=e.identity=e.apply=e.getRing=e.getSemiring=e.getMonoid=e.getSemigroup=e.getBooleanAlgebra=void 0;var t=function($){return function(){return{meet:function(T,M){return function(R){return $.meet(T(R),M(R))}},join:function(T,M){return function(R){return $.join(T(R),M(R))}},zero:function(){return $.zero},one:function(){return $.one},implies:function(T,M){return function(R){return $.implies(T(R),M(R))}},not:function(T){return function(M){return $.not(T(M))}}}}};e.getBooleanAlgebra=t;var n=function($){return function(){return{concat:function(T,M){return function(R){return $.concat(T(R),M(R))}}}}};e.getSemigroup=n;var r=function($){var T=(0,e.getSemigroup)($);return function(){return{concat:T().concat,empty:function(){return $.empty}}}};e.getMonoid=r;var i=function($){return{add:function(T,M){return function(R){return $.add(T(R),M(R))}},zero:function(){return $.zero},mul:function(T,M){return function(R){return $.mul(T(R),M(R))}},one:function(){return $.one}}};e.getSemiring=i;var o=function($){var T=(0,e.getSemiring)($);return{add:T.add,mul:T.mul,one:T.one,zero:T.zero,sub:function(M,R){return function(q){return $.sub(M(q),R(q))}}}};e.getRing=o;var a=function($){return function(T){return T($)}};e.apply=a;function u($){return $}e.identity=u,e.unsafeCoerce=u;function s($){return function(){return $}}e.constant=s,e.constTrue=s(!0),e.constFalse=s(!1),e.constNull=s(null),e.constUndefined=s(void 0),e.constVoid=e.constUndefined;function c($){return function(T,M){return $(M,T)}}e.flip=c;function l($,T,M,R,q,Y,N,Z,ie){switch(arguments.length){case 1:return $;case 2:return function(){return T($.apply(this,arguments))};case 3:return function(){return M(T($.apply(this,arguments)))};case 4:return function(){return R(M(T($.apply(this,arguments))))};case 5:return function(){return q(R(M(T($.apply(this,arguments)))))};case 6:return function(){return Y(q(R(M(T($.apply(this,arguments))))))};case 7:return function(){return N(Y(q(R(M(T($.apply(this,arguments)))))))};case 8:return function(){return Z(N(Y(q(R(M(T($.apply(this,arguments))))))))};case 9:return function(){return ie(Z(N(Y(q(R(M(T($.apply(this,arguments)))))))))}}}e.flow=l;function f(){for(var $=[],T=0;T<arguments.length;T++)$[T]=arguments[T];return $}e.tuple=f;function d($){return $+1}e.increment=d;function p($){return $-1}e.decrement=p;function h($){throw new Error("Called `absurd` function which should be uncallable")}e.absurd=h;function v($){return function(T){return $.apply(void 0,T)}}e.tupled=v;function m($){return function(){for(var T=[],M=0;M<arguments.length;M++)T[M]=arguments[M];return $(T)}}e.untupled=m;function _($,T,M,R,q,Y,N,Z,ie){switch(arguments.length){case 1:return $;case 2:return T($);case 3:return M(T($));case 4:return R(M(T($)));case 5:return q(R(M(T($))));case 6:return Y(q(R(M(T($)))));case 7:return N(Y(q(R(M(T($))))));case 8:return Z(N(Y(q(R(M(T($)))))));case 9:return ie(Z(N(Y(q(R(M(T($))))))));default:{for(var J=arguments[0],ye=1;ye<arguments.length;ye++)J=arguments[ye](J);return J}}}e.pipe=_,e.hole=h;var g=function($,T){return T};e.SK=g;function S($){return function(T){return!$(T)}}e.not=S;var b=function(){return{concat:function($,T){return l($,T)},empty:u}};e.getEndomorphismMonoid=b}(zO)),zO}var qe={},wB;function dy(){if(wB)return qe;wB=1;var e=he&&he.__spreadArray||function(p,h,v){if(v||arguments.length===2)for(var m=0,_=h.length,g;m<_;m++)(g||!(m in h))&&(g||(g=Array.prototype.slice.call(h,0,m)),g[m]=h[m]);return p.concat(g||Array.prototype.slice.call(h))};Object.defineProperty(qe,"__esModule",{value:!0}),qe.fromReadonlyNonEmptyArray=qe.has=qe.emptyRecord=qe.emptyReadonlyArray=qe.tail=qe.head=qe.isNonEmpty=qe.singleton=qe.right=qe.left=qe.isRight=qe.isLeft=qe.some=qe.none=qe.isSome=qe.isNone=void 0;var t=function(p){return p._tag==="None"};qe.isNone=t;var n=function(p){return p._tag==="Some"};qe.isSome=n,qe.none={_tag:"None"};var r=function(p){return{_tag:"Some",value:p}};qe.some=r;var i=function(p){return p._tag==="Left"};qe.isLeft=i;var o=function(p){return p._tag==="Right"};qe.isRight=o;var a=function(p){return{_tag:"Left",left:p}};qe.left=a;var u=function(p){return{_tag:"Right",right:p}};qe.right=u;var s=function(p){return[p]};qe.singleton=s;var c=function(p){return p.length>0};qe.isNonEmpty=c;var l=function(p){return p[0]};qe.head=l;var f=function(p){return p.slice(1)};qe.tail=f,qe.emptyReadonlyArray=[],qe.emptyRecord={},qe.has=Object.prototype.hasOwnProperty;var d=function(p){return e([p[0]],p.slice(1),!0)};return qe.fromReadonlyNonEmptyArray=d,qe}var CB;function EB(){if(CB)return vn;CB=1;var e=he&&he.__createBinding||(Object.create?function(m,_,g,S){S===void 0&&(S=g);var b=Object.getOwnPropertyDescriptor(_,g);(!b||("get"in b?!_.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return _[g]}}),Object.defineProperty(m,S,b)}:function(m,_,g,S){S===void 0&&(S=g),m[S]=_[g]}),t=he&&he.__setModuleDefault||(Object.create?function(m,_){Object.defineProperty(m,"default",{enumerable:!0,value:_})}:function(m,_){m.default=_}),n=he&&he.__importStar||function(m){if(m&&m.__esModule)return m;var _={};if(m!=null)for(var g in m)g!=="default"&&Object.prototype.hasOwnProperty.call(m,g)&&e(_,m,g);return t(_,m),_};Object.defineProperty(vn,"__esModule",{value:!0}),vn.sequenceS=vn.sequenceT=vn.getApplySemigroup=vn.apS=vn.apSecond=vn.apFirst=vn.ap=void 0;var r=Qe(),i=n(dy());function o(m,_){return function(g){return function(S){return m.ap(m.map(S,function(b){return function($){return _.ap(b,$)}}),g)}}}vn.ap=o;function a(m){return function(_){return function(g){return m.ap(m.map(g,function(S){return function(){return S}}),_)}}}vn.apFirst=a;function u(m){return function(_){return function(g){return m.ap(m.map(g,function(){return function(S){return S}}),_)}}}vn.apSecond=u;function s(m){return function(_,g){return function(S){return m.ap(m.map(S,function(b){return function($){var T;return Object.assign({},b,(T={},T[_]=$,T))}}),g)}}}vn.apS=s;function c(m){return function(_){return{concat:function(g,S){return m.ap(m.map(g,function(b){return function($){return _.concat(b,$)}}),S)}}}}vn.getApplySemigroup=c;function l(m,_,g){return function(S){for(var b=Array(g.length+1),$=0;$<g.length;$++)b[$]=g[$];return b[g.length]=S,_===0?m.apply(null,b):l(m,_-1,b)}}var f={1:function(m){return[m]},2:function(m){return function(_){return[m,_]}},3:function(m){return function(_){return function(g){return[m,_,g]}}},4:function(m){return function(_){return function(g){return function(S){return[m,_,g,S]}}}},5:function(m){return function(_){return function(g){return function(S){return function(b){return[m,_,g,S,b]}}}}}};function d(m){return i.has.call(f,m)||(f[m]=l(r.tuple,m-1,[])),f[m]}function p(m){return function(){for(var _=[],g=0;g<arguments.length;g++)_[g]=arguments[g];for(var S=_.length,b=d(S),$=m.map(_[0],b),T=1;T<S;T++)$=m.ap($,_[T]);return $}}vn.sequenceT=p;function h(m){var _=m.length;switch(_){case 1:return function(g){var S;return S={},S[m[0]]=g,S};case 2:return function(g){return function(S){var b;return b={},b[m[0]]=g,b[m[1]]=S,b}};case 3:return function(g){return function(S){return function(b){var $;return $={},$[m[0]]=g,$[m[1]]=S,$[m[2]]=b,$}}};case 4:return function(g){return function(S){return function(b){return function($){var T;return T={},T[m[0]]=g,T[m[1]]=S,T[m[2]]=b,T[m[3]]=$,T}}}};case 5:return function(g){return function(S){return function(b){return function($){return function(T){var M;return M={},M[m[0]]=g,M[m[1]]=S,M[m[2]]=b,M[m[3]]=$,M[m[4]]=T,M}}}}};default:return l(function(){for(var g=[],S=0;S<arguments.length;S++)g[S]=arguments[S];for(var b={},$=0;$<_;$++)b[m[$]]=g[$];return b},_-1,[])}}function v(m){return function(_){for(var g=Object.keys(_),S=g.length,b=h(g),$=m.map(_[g[0]],b),T=1;T<S;T++)$=m.ap($,_[g[T]]);return $}}return vn.sequenceS=v,vn}var Ti={},RB;function KO(){if(RB)return Ti;RB=1,Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.getFunctorComposition=Ti.bindTo=Ti.flap=Ti.map=void 0;var e=Qe();function t(o,a){return function(u){return function(s){return o.map(s,function(c){return a.map(c,u)})}}}Ti.map=t;function n(o){return function(a){return function(u){return o.map(u,function(s){return s(a)})}}}Ti.flap=n;function r(o){return function(a){return function(u){return o.map(u,function(s){var c;return c={},c[a]=s,c})}}}Ti.bindTo=r;function i(o,a){var u=t(o,a);return{map:function(s,c){return(0,e.pipe)(s,u(c))}}}return Ti.getFunctorComposition=i,Ti}var MB;function kye(){if(MB)return Ns;MB=1,Object.defineProperty(Ns,"__esModule",{value:!0}),Ns.getApplicativeComposition=Ns.getApplicativeMonoid=void 0;var e=EB(),t=Qe(),n=KO();function r(o){var a=(0,e.getApplySemigroup)(o);return function(u){return{concat:a(u).concat,empty:o.of(u.empty)}}}Ns.getApplicativeMonoid=r;function i(o,a){var u=(0,n.getFunctorComposition)(o,a).map,s=(0,e.ap)(o,a);return{map:u,of:function(c){return o.of(a.of(c))},ap:function(c,l){return(0,t.pipe)(c,s(l))}}}return Ns.getApplicativeComposition=i,Ns}var Fs={},xB;function kB(){if(xB)return Fs;xB=1,Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.bind=Fs.chainFirst=void 0;function e(n){return function(r){return function(i){return n.chain(i,function(o){return n.map(r(o),function(){return o})})}}}Fs.chainFirst=e;function t(n){return function(r,i){return function(o){return n.chain(o,function(a){return n.map(i(a),function(u){var s;return Object.assign({},a,(s={},s[r]=u,s))})})}}}return Fs.bind=t,Fs}var zp={},AB;function Aye(){if(AB)return zp;AB=1,Object.defineProperty(zp,"__esModule",{value:!0}),zp.tailRec=void 0;var e=function(t,n){for(var r=n(t);r._tag==="Left";)r=n(r.left);return r.right};return zp.tailRec=e,zp}var Kt={},NB;function Nye(){if(NB)return Kt;NB=1;var e=he&&he.__createBinding||(Object.create?function(h,v,m,_){_===void 0&&(_=m);var g=Object.getOwnPropertyDescriptor(v,m);(!g||("get"in g?!v.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return v[m]}}),Object.defineProperty(h,_,g)}:function(h,v,m,_){_===void 0&&(_=m),h[_]=v[m]}),t=he&&he.__setModuleDefault||(Object.create?function(h,v){Object.defineProperty(h,"default",{enumerable:!0,value:v})}:function(h,v){h.default=v}),n=he&&he.__importStar||function(h){if(h&&h.__esModule)return h;var v={};if(h!=null)for(var m in h)m!=="default"&&Object.prototype.hasOwnProperty.call(h,m)&&e(v,h,m);return t(v,h),v};Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.filterOrElse=Kt.chainFirstEitherK=Kt.chainEitherK=Kt.fromEitherK=Kt.chainOptionK=Kt.fromOptionK=Kt.fromPredicate=Kt.fromOption=void 0;var r=kB(),i=Qe(),o=n(dy());function a(h){return function(v){return function(m){return h.fromEither(o.isNone(m)?o.left(v()):o.right(m.value))}}}Kt.fromOption=a;function u(h){return function(v,m){return function(_){return h.fromEither(v(_)?o.right(_):o.left(m(_)))}}}Kt.fromPredicate=u;function s(h){var v=a(h);return function(m){var _=v(m);return function(g){return(0,i.flow)(g,_)}}}Kt.fromOptionK=s;function c(h,v){var m=s(h);return function(_){var g=m(_);return function(S){return function(b){return v.chain(b,g(S))}}}}Kt.chainOptionK=c;function l(h){return function(v){return(0,i.flow)(v,h.fromEither)}}Kt.fromEitherK=l;function f(h,v){var m=l(h);return function(_){return function(g){return v.chain(g,m(_))}}}Kt.chainEitherK=f;function d(h,v){return(0,i.flow)(l(h),(0,r.chainFirst)(v))}Kt.chainFirstEitherK=d;function p(h,v){return function(m,_){return function(g){return v.chain(g,function(S){return h.fromEither(m(S)?o.right(S):o.left(_(S)))})}}}return Kt.filterOrElse=p,Kt}var VO={},FB;function Fye(){return FB||(FB=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.right=e.left=e.flap=e.Functor=e.Bifunctor=e.URI=e.bimap=e.mapLeft=e.map=e.separated=void 0;var t=Qe(),n=KO(),r=function(d,p){return{left:d,right:p}};e.separated=r;var i=function(d,p){return(0,t.pipe)(d,(0,e.map)(p))},o=function(d,p){return(0,t.pipe)(d,(0,e.mapLeft)(p))},a=function(d,p,h){return(0,t.pipe)(d,(0,e.bimap)(p,h))},u=function(d){return function(p){return(0,e.separated)((0,e.left)(p),d((0,e.right)(p)))}};e.map=u;var s=function(d){return function(p){return(0,e.separated)(d((0,e.left)(p)),(0,e.right)(p))}};e.mapLeft=s;var c=function(d,p){return function(h){return(0,e.separated)(d((0,e.left)(h)),p((0,e.right)(h)))}};e.bimap=c,e.URI="Separated",e.Bifunctor={URI:e.URI,mapLeft:o,bimap:a},e.Functor={URI:e.URI,map:i},e.flap=(0,n.flap)(e.Functor);var l=function(d){return d.left};e.left=l;var f=function(d){return d.right};e.right=f}(VO)),VO}var ia={},PB;function Pye(){if(PB)return ia;PB=1;var e=he&&he.__createBinding||(Object.create?function(u,s,c,l){l===void 0&&(l=c);var f=Object.getOwnPropertyDescriptor(s,c);(!f||("get"in f?!s.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return s[c]}}),Object.defineProperty(u,l,f)}:function(u,s,c,l){l===void 0&&(l=c),u[l]=s[c]}),t=he&&he.__setModuleDefault||(Object.create?function(u,s){Object.defineProperty(u,"default",{enumerable:!0,value:s})}:function(u,s){u.default=s}),n=he&&he.__importStar||function(u){if(u&&u.__esModule)return u;var s={};if(u!=null)for(var c in u)c!=="default"&&Object.prototype.hasOwnProperty.call(u,c)&&e(s,u,c);return t(s,u),s};Object.defineProperty(ia,"__esModule",{value:!0}),ia.filterE=ia.witherDefault=ia.wiltDefault=void 0;var r=n(dy());function i(u,s){return function(c){var l=u.traverse(c);return function(f,d){return c.map(l(f,d),s.separate)}}}ia.wiltDefault=i;function o(u,s){return function(c){var l=u.traverse(c);return function(f,d){return c.map(l(f,d),s.compact)}}}ia.witherDefault=o;function a(u){return function(s){var c=u.wither(s);return function(l){return function(f){return c(f,function(d){return s.map(l(d),function(p){return p?r.some(d):r.none})})}}}}return ia.filterE=a,ia}var WB;function Ln(){return WB||(WB=1,function(e){var t=he&&he.__createBinding||(Object.create?function(P,A,L,Pe){Pe===void 0&&(Pe=L);var W=Object.getOwnPropertyDescriptor(A,L);(!W||("get"in W?!A.__esModule:W.writable||W.configurable))&&(W={enumerable:!0,get:function(){return A[L]}}),Object.defineProperty(P,Pe,W)}:function(P,A,L,Pe){Pe===void 0&&(Pe=L),P[Pe]=A[L]}),n=he&&he.__setModuleDefault||(Object.create?function(P,A){Object.defineProperty(P,"default",{enumerable:!0,value:A})}:function(P,A){P.default=A}),r=he&&he.__importStar||function(P){if(P&&P.__esModule)return P;var A={};if(P!=null)for(var L in P)L!=="default"&&Object.prototype.hasOwnProperty.call(P,L)&&t(A,P,L);return n(A,P),A};Object.defineProperty(e,"__esModule",{value:!0}),e.fold=e.match=e.foldW=e.matchW=e.isRight=e.isLeft=e.fromOption=e.fromPredicate=e.FromEither=e.MonadThrow=e.throwError=e.ChainRec=e.Extend=e.extend=e.Alt=e.alt=e.altW=e.Bifunctor=e.mapLeft=e.bimap=e.Traversable=e.sequence=e.traverse=e.Foldable=e.reduceRight=e.foldMap=e.reduce=e.Monad=e.Chain=e.chain=e.chainW=e.Applicative=e.Apply=e.ap=e.apW=e.Pointed=e.of=e.Functor=e.map=e.getAltValidation=e.getApplicativeValidation=e.getWitherable=e.getFilterable=e.getCompactable=e.getSemigroup=e.getEq=e.getShow=e.URI=e.right=e.left=void 0,e.getValidation=e.getValidationMonoid=e.getValidationSemigroup=e.getApplyMonoid=e.getApplySemigroup=e.either=e.stringifyJSON=e.parseJSON=e.sequenceArray=e.traverseArray=e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex=e.traverseReadonlyNonEmptyArrayWithIndex=e.ApT=e.apSW=e.apS=e.bindW=e.bind=e.bindTo=e.Do=e.exists=e.elem=e.toError=e.toUnion=e.chainNullableK=e.fromNullableK=e.tryCatchK=e.tryCatch=e.fromNullable=e.orElse=e.orElseW=e.swap=e.filterOrElseW=e.filterOrElse=e.chainOptionK=e.fromOptionK=e.duplicate=e.flatten=e.flattenW=e.chainFirstW=e.chainFirst=e.apSecondW=e.apSecond=e.apFirstW=e.apFirst=e.flap=e.getOrElse=e.getOrElseW=void 0;var i=kye(),o=EB(),a=kB(),u=Aye(),s=Nye(),c=Qe(),l=KO(),f=r(dy()),d=Fye(),p=Pye();e.left=f.left,e.right=f.right;var h=function(P,A){return(0,c.pipe)(P,(0,e.map)(A))},v=function(P,A){return(0,c.pipe)(P,(0,e.ap)(A))},m=function(P,A){return(0,c.pipe)(P,(0,e.chain)(A))},_=function(P,A,L){return(0,c.pipe)(P,(0,e.reduce)(A,L))},g=function(P){return function(A,L){var Pe=(0,e.foldMap)(P);return(0,c.pipe)(A,Pe(L))}},S=function(P,A,L){return(0,c.pipe)(P,(0,e.reduceRight)(A,L))},b=function(P){var A=(0,e.traverse)(P);return function(L,Pe){return(0,c.pipe)(L,A(Pe))}},$=function(P,A,L){return(0,c.pipe)(P,(0,e.bimap)(A,L))},T=function(P,A){return(0,c.pipe)(P,(0,e.mapLeft)(A))},M=function(P,A){return(0,c.pipe)(P,(0,e.alt)(A))},R=function(P,A){return(0,c.pipe)(P,(0,e.extend)(A))},q=function(P,A){return(0,u.tailRec)(A(P),function(L){return(0,e.isLeft)(L)?(0,e.right)((0,e.left)(L.left)):(0,e.isLeft)(L.right)?(0,e.left)(A(L.right.left)):(0,e.right)((0,e.right)(L.right.right))})};e.URI="Either";var Y=function(P,A){return{show:function(L){return(0,e.isLeft)(L)?"left(".concat(P.show(L.left),")"):"right(".concat(A.show(L.right),")")}}};e.getShow=Y;var N=function(P,A){return{equals:function(L,Pe){return L===Pe||((0,e.isLeft)(L)?(0,e.isLeft)(Pe)&&P.equals(L.left,Pe.left):(0,e.isRight)(Pe)&&A.equals(L.right,Pe.right))}}};e.getEq=N;var Z=function(P){return{concat:function(A,L){return(0,e.isLeft)(L)?A:(0,e.isLeft)(A)?L:(0,e.right)(P.concat(A.right,L.right))}}};e.getSemigroup=Z;var ie=function(P){var A=(0,e.left)(P.empty);return{URI:e.URI,_E:void 0,compact:function(L){return(0,e.isLeft)(L)?L:L.right._tag==="None"?A:(0,e.right)(L.right.value)},separate:function(L){return(0,e.isLeft)(L)?(0,d.separated)(L,L):(0,e.isLeft)(L.right)?(0,d.separated)((0,e.right)(L.right.left),A):(0,d.separated)(A,(0,e.right)(L.right.right))}}};e.getCompactable=ie;var J=function(P){var A=(0,e.left)(P.empty),L=(0,e.getCompactable)(P),Pe=L.compact,W=L.separate,ae=function(ve,Ce){return(0,e.isLeft)(ve)||Ce(ve.right)?ve:A},ge=function(ve,Ce){return(0,e.isLeft)(ve)?(0,d.separated)(ve,ve):Ce(ve.right)?(0,d.separated)(A,(0,e.right)(ve.right)):(0,d.separated)((0,e.right)(ve.right),A)};return{URI:e.URI,_E:void 0,map:h,compact:Pe,separate:W,filter:ae,filterMap:function(ve,Ce){if((0,e.isLeft)(ve))return ve;var ct=Ce(ve.right);return ct._tag==="None"?A:(0,e.right)(ct.value)},partition:ge,partitionMap:function(ve,Ce){if((0,e.isLeft)(ve))return(0,d.separated)(ve,ve);var ct=Ce(ve.right);return(0,e.isLeft)(ct)?(0,d.separated)((0,e.right)(ct.left),A):(0,d.separated)(A,(0,e.right)(ct.right))}}};e.getFilterable=J;var ye=function(P){var A=(0,e.getFilterable)(P),L=(0,e.getCompactable)(P);return{URI:e.URI,_E:void 0,map:h,compact:A.compact,separate:A.separate,filter:A.filter,filterMap:A.filterMap,partition:A.partition,partitionMap:A.partitionMap,traverse:b,sequence:e.sequence,reduce:_,foldMap:g,reduceRight:S,wither:(0,p.witherDefault)(e.Traversable,L),wilt:(0,p.wiltDefault)(e.Traversable,L)}};e.getWitherable=ye;var we=function(P){return{URI:e.URI,_E:void 0,map:h,ap:function(A,L){return(0,e.isLeft)(A)?(0,e.isLeft)(L)?(0,e.left)(P.concat(A.left,L.left)):A:(0,e.isLeft)(L)?L:(0,e.right)(A.right(L.right))},of:e.of}};e.getApplicativeValidation=we;var x=function(P){return{URI:e.URI,_E:void 0,map:h,alt:function(A,L){if((0,e.isRight)(A))return A;var Pe=L();return(0,e.isLeft)(Pe)?(0,e.left)(P.concat(A.left,Pe.left)):Pe}}};e.getAltValidation=x;var k=function(P){return function(A){return(0,e.isLeft)(A)?A:(0,e.right)(P(A.right))}};e.map=k,e.Functor={URI:e.URI,map:h},e.of=e.right,e.Pointed={URI:e.URI,of:e.of};var C=function(P){return function(A){return(0,e.isLeft)(A)?A:(0,e.isLeft)(P)?P:(0,e.right)(A.right(P.right))}};e.apW=C,e.ap=e.apW,e.Apply={URI:e.URI,map:h,ap:v},e.Applicative={URI:e.URI,map:h,ap:v,of:e.of};var O=function(P){return function(A){return(0,e.isLeft)(A)?A:P(A.right)}};e.chainW=O,e.chain=e.chainW,e.Chain={URI:e.URI,map:h,ap:v,chain:m},e.Monad={URI:e.URI,map:h,ap:v,of:e.of,chain:m};var F=function(P,A){return function(L){return(0,e.isLeft)(L)?P:A(P,L.right)}};e.reduce=F;var j=function(P){return function(A){return function(L){return(0,e.isLeft)(L)?P.empty:A(L.right)}}};e.foldMap=j;var X=function(P,A){return function(L){return(0,e.isLeft)(L)?P:A(L.right,P)}};e.reduceRight=X,e.Foldable={URI:e.URI,reduce:_,foldMap:g,reduceRight:S};var te=function(P){return function(A){return function(L){return(0,e.isLeft)(L)?P.of((0,e.left)(L.left)):P.map(A(L.right),e.right)}}};e.traverse=te;var xe=function(P){return function(A){return(0,e.isLeft)(A)?P.of((0,e.left)(A.left)):P.map(A.right,e.right)}};e.sequence=xe,e.Traversable={URI:e.URI,map:h,reduce:_,foldMap:g,reduceRight:S,traverse:b,sequence:e.sequence};var ce=function(P,A){return function(L){return(0,e.isLeft)(L)?(0,e.left)(P(L.left)):(0,e.right)(A(L.right))}};e.bimap=ce;var Ne=function(P){return function(A){return(0,e.isLeft)(A)?(0,e.left)(P(A.left)):A}};e.mapLeft=Ne,e.Bifunctor={URI:e.URI,bimap:$,mapLeft:T};var ze=function(P){return function(A){return(0,e.isLeft)(A)?P():A}};e.altW=ze,e.alt=e.altW,e.Alt={URI:e.URI,map:h,alt:M};var He=function(P){return function(A){return(0,e.isLeft)(A)?A:(0,e.right)(P(A))}};e.extend=He,e.Extend={URI:e.URI,map:h,extend:R},e.ChainRec={URI:e.URI,map:h,ap:v,chain:m,chainRec:q},e.throwError=e.left,e.MonadThrow={URI:e.URI,map:h,ap:v,of:e.of,chain:m,throwError:e.throwError},e.FromEither={URI:e.URI,fromEither:c.identity},e.fromPredicate=(0,s.fromPredicate)(e.FromEither),e.fromOption=(0,s.fromOption)(e.FromEither),e.isLeft=f.isLeft,e.isRight=f.isRight;var it=function(P,A){return function(L){return(0,e.isLeft)(L)?P(L.left):A(L.right)}};e.matchW=it,e.foldW=e.matchW,e.match=e.matchW,e.fold=e.match;var Ft=function(P){return function(A){return(0,e.isLeft)(A)?P(A.left):A.right}};e.getOrElseW=Ft,e.getOrElse=e.getOrElseW,e.flap=(0,l.flap)(e.Functor),e.apFirst=(0,o.apFirst)(e.Apply),e.apFirstW=e.apFirst,e.apSecond=(0,o.apSecond)(e.Apply),e.apSecondW=e.apSecond,e.chainFirst=(0,a.chainFirst)(e.Chain),e.chainFirstW=e.chainFirst,e.flattenW=(0,e.chainW)(c.identity),e.flatten=e.flattenW,e.duplicate=(0,e.extend)(c.identity),e.fromOptionK=(0,s.fromOptionK)(e.FromEither),e.chainOptionK=(0,s.chainOptionK)(e.FromEither,e.Chain),e.filterOrElse=(0,s.filterOrElse)(e.FromEither,e.Chain),e.filterOrElseW=e.filterOrElse;var qt=function(P){return(0,e.isLeft)(P)?(0,e.right)(P.left):(0,e.left)(P.right)};e.swap=qt;var Ht=function(P){return function(A){return(0,e.isLeft)(A)?P(A.left):A}};e.orElseW=Ht,e.orElse=e.orElseW;var xn=function(P){return function(A){return A==null?(0,e.left)(P):(0,e.right)(A)}};e.fromNullable=xn;var Nr=function(P,A){try{return(0,e.right)(P())}catch(L){return(0,e.left)(A(L))}};e.tryCatch=Nr;var fr=function(P,A){return function(){for(var L=[],Pe=0;Pe<arguments.length;Pe++)L[Pe]=arguments[Pe];return(0,e.tryCatch)(function(){return P.apply(void 0,L)},A)}};e.tryCatchK=fr;var Q=function(P){var A=(0,e.fromNullable)(P);return function(L){return(0,c.flow)(L,A)}};e.fromNullableK=Q;var re=function(P){var A=(0,e.fromNullableK)(P);return function(L){return(0,e.chain)(A(L))}};e.chainNullableK=re,e.toUnion=(0,e.foldW)(c.identity,c.identity);function ke(P){return P instanceof Error?P:new Error(String(P))}e.toError=ke;function Ot(P){return function(A,L){if(L===void 0){var Pe=Ot(P);return function(W){return Pe(A,W)}}return(0,e.isLeft)(L)?!1:P.equals(A,L.right)}}e.elem=Ot;var ei=function(P){return function(A){return(0,e.isLeft)(A)?!1:P(A.right)}};e.exists=ei,e.Do=(0,e.of)(f.emptyRecord),e.bindTo=(0,l.bindTo)(e.Functor),e.bind=(0,a.bind)(e.Chain),e.bindW=e.bind,e.apS=(0,o.apS)(e.Apply),e.apSW=e.apS,e.ApT=(0,e.of)(f.emptyReadonlyArray);var qi=function(P){return function(A){var L=P(0,f.head(A));if((0,e.isLeft)(L))return L;for(var Pe=[L.right],W=1;W<A.length;W++){var ae=P(W,A[W]);if((0,e.isLeft)(ae))return ae;Pe.push(ae.right)}return(0,e.right)(Pe)}};e.traverseReadonlyNonEmptyArrayWithIndex=qi;var Ui=function(P){var A=(0,e.traverseReadonlyNonEmptyArrayWithIndex)(P);return function(L){return f.isNonEmpty(L)?A(L):e.ApT}};e.traverseReadonlyArrayWithIndex=Ui,e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex;var Oa=function(P){return(0,e.traverseReadonlyArrayWithIndex)(function(A,L){return P(L)})};e.traverseArray=Oa,e.sequenceArray=(0,e.traverseArray)(c.identity);function wa(P,A){return(0,e.tryCatch)(function(){return JSON.parse(P)},A)}e.parseJSON=wa;var Ca=function(P,A){return(0,e.tryCatch)(function(){var L=JSON.stringify(P);if(typeof L!="string")throw new Error("Converting unsupported structure to JSON");return L},A)};e.stringifyJSON=Ca,e.either={URI:e.URI,map:h,of:e.of,ap:v,chain:m,reduce:_,foldMap:g,reduceRight:S,traverse:b,sequence:e.sequence,bimap:$,mapLeft:T,alt:M,extend:R,chainRec:q,throwError:e.throwError},e.getApplySemigroup=(0,o.getApplySemigroup)(e.Apply),e.getApplyMonoid=(0,i.getApplicativeMonoid)(e.Applicative);var ti=function(P,A){return(0,o.getApplySemigroup)((0,e.getApplicativeValidation)(P))(A)};e.getValidationSemigroup=ti;var Pu=function(P,A){return(0,i.getApplicativeMonoid)((0,e.getApplicativeValidation)(P))(A)};e.getValidationMonoid=Pu;function Wf(P){var A=(0,e.getApplicativeValidation)(P).ap,L=(0,e.getAltValidation)(P).alt;return{URI:e.URI,_E:void 0,map:h,of:e.of,chain:m,bimap:$,mapLeft:T,reduce:_,foldMap:g,reduceRight:S,extend:R,traverse:b,sequence:e.sequence,chainRec:q,throwError:e.throwError,ap:A,alt:L}}e.getValidation=Wf}(BO)),BO}var et=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zl=globalThis&&globalThis.__assign||function(){return Zl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Zl.apply(this,arguments)},Wye=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},so=Tt,tt=function(e,t,n){return so([{value:e,context:t,message:n}])},Ee=Ye,Te=function(){function e(t,n,r,i){this.name=t,this.is=n,this.validate=r,this.encode=i,this.decode=this.decode.bind(this)}return e.prototype.pipe=function(t,n){var r=this;return n===void 0&&(n="pipe(".concat(this.name,", ").concat(t.name,")")),new e(n,t.is,function(i,o){var a=r.validate(i,o);return le(a)?a:t.validate(a.right,o)},this.encode===Ue&&t.encode===Ue?Ue:function(i){return r.encode(t.encode(i))})},e.prototype.asDecoder=function(){return this},e.prototype.asEncoder=function(){return this},e.prototype.decode=function(t){return this.validate(t,[{key:"",type:this,actual:t}])},e}(),Ue=function(e){return e};function jB(e){return e.displayName||e.name||"<function".concat(e.length,">")}function jye(e,t){return{key:e,type:t}}function Ii(e,t,n,r){for(var i=e.length,o=Array(i+1),a=0;a<i;a++)o[a]=e[a];return o[i]={key:t,type:n,actual:r},o}function oa(e,t){for(var n=t.length,r=0;r<n;r++)e.push(t[r])}var Ps=Object.prototype.hasOwnProperty;function HO(e){return Object.keys(e).map(function(t){return"".concat(t,": ").concat(e[t].name)}).join(", ")}function Kp(e){for(var t=0;t<e.length;t++)if(e[t].encode!==Ue)return!1;return!0}function LB(e){return"{ ".concat(HO(e)," }")}function DB(e){return"Partial<".concat(e,">")}function Lye(e,t,n,r){r===void 0&&(r="{ [K in ".concat(t.name,"]: ").concat(n.name," }"));var i=e.length;return new nw(r,function(o){return Dn.is(o)&&e.every(function(a){return n.is(o[a])})},function(o,a){var u=Dn.validate(o,a);if(le(u))return u;for(var s=u.right,c={},l=[],f=!1,d=0;d<i;d++){var p=e[d],h=s[p],v=n.validate(h,Ii(a,p,n,h));if(le(v))oa(l,v.left);else{var m=v.right;f=f||m!==h,c[p]=m}}return l.length>0?so(l):Ee(f||Object.keys(s).length!==i?c:s)},n.encode===Ue?Ue:function(o){for(var a={},u=0;u<i;u++){var s=e[u];a[s]=n.encode(o[s])}return a},t,n)}function GO(e){var t;if(KB(e)){var n=e.value;if(Oi.is(n))return t={},t[n]=null,t}else{if(Kye(e))return e.keys;if(HB(e)){var r=e.types.map(function(i){return GO(i)});return r.some(py.is)?void 0:Object.assign.apply(Object,Wye([{}],r,!1))}}}function Dye(e,t,n){return n===void 0&&(n="{ [K in ".concat(e.name,"]: ").concat(t.name," }")),new nw(n,function(r){return Dn.is(r)?Object.keys(r).every(function(i){return e.is(i)&&t.is(r[i])}):zB(t)&&Array.isArray(r)},function(r,i){if(Dn.is(r)){for(var o={},a=[],u=Object.keys(r),s=u.length,c=!1,l=0;l<s;l++){var f=u[l],d=r[f],p=e.validate(f,Ii(i,f,e,f));if(le(p))oa(a,p.left);else{var h=p.right;c=c||h!==f,f=h;var v=t.validate(d,Ii(i,f,t,d));if(le(v))oa(a,v.left);else{var m=v.right;c=c||m!==d,o[f]=m}}}return a.length>0?so(a):Ee(c?o:r)}return zB(t)&&Array.isArray(r)?Ee(r):tt(r,i)},e.encode===Ue&&t.encode===Ue?Ue:function(r){for(var i={},o=Object.keys(r),a=o.length,u=0;u<a;u++){var s=o[u];i[String(e.encode(s))]=t.encode(r[s])}return i},e,t)}function qB(e){return"("+e.map(function(t){return t.name}).join(" | ")+")"}function YO(e,t){for(var n=!0,r=!0,i=!Dn.is(e),o=0,a=t;o<a.length;o++){var u=a[o];u!==e&&(n=!1),Dn.is(u)&&(r=!1)}if(n)return e;if(r)return t[t.length-1];for(var s={},c=0,l=t;c<l.length;c++){var u=l[c];for(var f in u)(!Ps.call(s,f)||i||u[f]!==e[f])&&(s[f]=u[f])}return s}function JO(e){switch(e._tag){case"RefinementType":case"ReadonlyType":return JO(e.type);case"InterfaceType":case"StrictType":case"PartialType":return e.props;case"IntersectionType":return e.types.reduce(function(t,n){return Object.assign(t,JO(n))},{})}}function UB(e,t){for(var n=Object.getOwnPropertyNames(e),r=!1,i={},o=0;o<n.length;o++){var a=n[o];Ps.call(t,a)?i[a]=e[a]:r=!0}return r?i:e}function qye(e){return VB(e)?"{| ".concat(HO(e.props)," |}"):Vye(e)?DB("{| ".concat(HO(e.props)," |}")):"Exact<".concat(e.name,">")}function Uye(e){return e.length>0}var ar={};function BB(e,t){for(var n=[],r=0,i=e;r<i.length;r++){var o=i[r];t.indexOf(o)!==-1&&n.push(o)}return n}function Bye(e,t){if(e===ar)return t;if(t===ar)return e;var n=Object.assign({},e);for(var r in t)if(Ps.call(e,r)){var i=BB(e[r],t[r]);if(Uye(i))n[r]=i;else{n=ar;break}}else n[r]=t[r];return n}function zye(e,t){if(e===ar||t===ar)return ar;var n=ar;for(var r in e)if(Ps.call(t,r)){var i=BB(e[r],t[r]);i.length===0&&(n===ar&&(n={}),n[r]=e[r].concat(t[r]))}return n}function zB(e){return e._tag==="AnyType"}function KB(e){return e._tag==="LiteralType"}function Kye(e){return e._tag==="KeyofType"}function VB(e){return e._tag==="InterfaceType"}function Vye(e){return e._tag==="PartialType"}function Hye(e){return e._tag==="StrictType"}function Gye(e){return e._tag==="ExactType"}function Yye(e){return e._tag==="RefinementType"}function Jye(e){return e._tag==="IntersectionType"}function HB(e){return e._tag==="UnionType"}function Zye(e){return e._tag==="RecursiveType"}var ZO=[];function ou(e){if(ZO.indexOf(e)!==-1)return ar;if(VB(e)||Hye(e)){var t=ar;for(var n in e.props){var r=e.props[n];KB(r)&&(t===ar&&(t={}),t[n]=[r.value])}return t}else{if(Gye(e)||Yye(e))return ou(e.type);if(Jye(e))return e.types.reduce(function(o,a){return Bye(o,ou(a))},ar);if(HB(e))return e.types.slice(1).reduce(function(o,a){return zye(o,ou(a))},ou(e.types[0]));if(Zye(e)){ZO.push(e);var i=ou(e.type);return ZO.pop(),i}}return ar}function GB(e){var t=ou(e[0]),n=Object.keys(t),r=e.length,i=function(c){for(var l=t[c].slice(),f=[t[c]],d=1;d<r;d++){var p=e[d],h=ou(p),v=h[c];if(v===void 0)return"continue-keys";if(v.some(function(m){return l.indexOf(m)!==-1}))return"continue-keys";l.push.apply(l,v),f.push(v)}return{value:[c,f]}};e:for(var o=0,a=n;o<a.length;o++){var u=a[o],s=i(u);if(typeof s=="object")return s.value;switch(s){case"continue-keys":continue e}}}var YB=function(e){et(t,e);function t(){var n=e.call(this,"null",function(r){return r===null},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="NullType",n}return t}(Te),XO=new YB,JB=function(e){et(t,e);function t(){var n=e.call(this,"undefined",function(r){return r===void 0},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="UndefinedType",n}return t}(Te),py=new JB,ZB=function(e){et(t,e);function t(){var n=e.call(this,"void",py.is,py.validate,Ue)||this;return n._tag="VoidType",n}return t}(Te),XB=new ZB,QB=function(e){et(t,e);function t(){var n=e.call(this,"unknown",function(r){return!0},Ee,Ue)||this;return n._tag="UnknownType",n}return t}(Te),Xye=new QB,e2=function(e){et(t,e);function t(){var n=e.call(this,"string",function(r){return typeof r=="string"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="StringType",n}return t}(Te),Oi=new e2,t2=function(e){et(t,e);function t(){var n=e.call(this,"number",function(r){return typeof r=="number"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="NumberType",n}return t}(Te),Ws=new t2,n2=function(e){et(t,e);function t(){var n=e.call(this,"bigint",function(r){return typeof r=="bigint"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="BigIntType",n}return t}(Te),Qye=new n2,r2=function(e){et(t,e);function t(){var n=e.call(this,"boolean",function(r){return typeof r=="boolean"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="BooleanType",n}return t}(Te),hy=new r2,i2=function(e){et(t,e);function t(){var n=e.call(this,"UnknownArray",Array.isArray,function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="AnyArrayType",n}return t}(Te),Xl=new i2,o2=function(e){et(t,e);function t(){var n=e.call(this,"UnknownRecord",function(r){var i=Object.prototype.toString.call(r);return i==="[object Object]"||i==="[object Window]"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="AnyDictionaryType",n}return t}(Te),Dn=new o2,a2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.value=a,u._tag="LiteralType",u}return t}(Te);function Vp(e,t){t===void 0&&(t=JSON.stringify(e));var n=function(r){return r===e};return new a2(t,n,function(r,i){return n(r)?Ee(e):tt(r,i)},Ue,e)}var u2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.keys=a,u._tag="KeyofType",u}return t}(Te);function ebe(e,t){t===void 0&&(t=Object.keys(e).map(function(r){return JSON.stringify(r)}).join(" | "));var n=function(r){return Oi.is(r)&&Ps.call(e,r)};return new u2(t,n,function(r,i){return n(r)?Ee(r):tt(r,i)},Ue,e)}var s2=function(e){et(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o)||this;return s.type=a,s.predicate=u,s._tag="RefinementType",s}return t}(Te);function my(e,t,n){return ow(e,t,n)}var vy=my(Ws,function(e){return Number.isInteger(e)},"Int"),QO=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.runDefinition=a,u._tag="RecursiveType",u}return t}(Te);Object.defineProperty(QO.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});function ew(e,t){var n,r=function(){return n||(n=t(i),n.name=e),n},i=new QO(e,function(o){return r().is(o)},function(o,a){return r().validate(o,a)},function(o){return r().encode(o)},r);return i}var c2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ArrayType",u}return t}(Te);function gy(e,t){return t===void 0&&(t="Array<".concat(e.name,">")),new c2(t,function(n){return Xl.is(n)&&n.every(e.is)},function(n,r){var i=Xl.validate(n,r);if(le(i))return i;for(var o=i.right,a=o.length,u=o,s=[],c=0;c<a;c++){var l=o[c],f=e.validate(l,Ii(r,String(c),e,l));if(le(f))oa(s,f.left);else{var d=f.right;d!==l&&(u===o&&(u=o.slice()),u[c]=d)}}return s.length>0?so(s):Ee(u)},e.encode===Ue?Ue:function(n){return n.map(e.encode)},e)}var l2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="InterfaceType",u}return t}(Te);function tw(e,t){t===void 0&&(t=LB(e));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new l2(t,function(o){if(Dn.is(o)){for(var a=0;a<i;a++){var u=n[a],s=o[u];if(s===void 0&&!Ps.call(o,u)||!r[a].is(s))return!1}return!0}return!1},function(o,a){var u=Dn.validate(o,a);if(le(u))return u;for(var s=u.right,c=s,l=[],f=0;f<i;f++){var d=n[f],p=c[d],h=r[f],v=h.validate(p,Ii(a,d,h,p));if(le(v))oa(l,v.left);else{var m=v.right;(m!==p||m===void 0&&!Ps.call(c,d))&&(c===s&&(c=Zl({},s)),c[d]=m)}}return l.length>0?so(l):Ee(c)},Kp(r)?Ue:function(o){for(var a=Zl({},o),u=0;u<i;u++){var s=n[u],c=r[u].encode;c!==Ue&&(a[s]=c(o[s]))}return a},e)}var f2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="PartialType",u}return t}(Te);function tbe(e,t){t===void 0&&(t=DB(LB(e)));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new f2(t,function(o){if(Dn.is(o)){for(var a=0;a<i;a++){var u=n[a],s=o[u];if(s!==void 0&&!e[u].is(s))return!1}return!0}return!1},function(o,a){var u=Dn.validate(o,a);if(le(u))return u;for(var s=u.right,c=s,l=[],f=0;f<i;f++){var d=n[f],p=c[d],h=e[d],v=h.validate(p,Ii(a,d,h,p));if(le(v))p!==void 0&&oa(l,v.left);else{var m=v.right;m!==p&&(c===s&&(c=Zl({},s)),c[d]=m)}}return l.length>0?so(l):Ee(c)},Kp(r)?Ue:function(o){for(var a=Zl({},o),u=0;u<i;u++){var s=n[u],c=o[s];c!==void 0&&(a[s]=r[u].encode(c))}return a},e)}var nw=function(e){et(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o)||this;return s.domain=a,s.codomain=u,s._tag="DictionaryType",s}return t}(Te);function rw(e,t,n){var r=GO(e);return r?Lye(Object.keys(r),e,t,n):Dye(e,t,n)}var iw=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="UnionType",u}return t}(Te);function Hp(e,t){t===void 0&&(t=qB(e));var n=GB(e);if(n!==void 0&&e.length>0){var r=n[0],i=n[1],o=i.length,a=function(u){for(var s=0;s<o;s++)if(i[s].indexOf(u)!==-1)return s};return new yy(t,function(u){if(Dn.is(u)){var s=a(u[r]);return s!==void 0?e[s].is(u):!1}return!1},function(u,s){var c=Dn.validate(u,s);if(le(c))return c;var l=c.right,f=a(l[r]);if(f===void 0)return tt(u,s);var d=e[f];return d.validate(l,Ii(s,String(f),d,l))},Kp(e)?Ue:function(u){var s=a(u[r]);if(s===void 0)throw new Error("no codec found to encode value in union codec ".concat(t));return e[s].encode(u)},e,r)}else return new iw(t,function(u){return e.some(function(s){return s.is(u)})},function(u,s){for(var c=[],l=0;l<e.length;l++){var f=e[l],d=f.validate(u,Ii(s,String(l),f,u));if(le(d))oa(c,d.left);else return Ee(d.right)}return so(c)},Kp(e)?Ue:function(u){for(var s=0,c=e;s<c.length;s++){var l=c[s];if(l.is(u))return l.encode(u)}throw new Error("no codec found to encode value in union type ".concat(t))},e)}var d2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="IntersectionType",u}return t}(Te);function nbe(e,t){t===void 0&&(t="(".concat(e.map(function(r){return r.name}).join(" & "),")"));var n=e.length;return new d2(t,function(r){return e.every(function(i){return i.is(r)})},e.length===0?Ee:function(r,i){for(var o=[],a=[],u=0;u<n;u++){var s=e[u],c=s.validate(r,Ii(i,String(u),s,r));le(c)?oa(a,c.left):o.push(c.right)}return a.length>0?so(a):Ee(YO(r,o))},e.length===0?Ue:function(r){return YO(r,e.map(function(i){return i.encode(r)}))},e)}var p2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.types=a,u._tag="TupleType",u}return t}(Te);function rbe(e,t){t===void 0&&(t="[".concat(e.map(function(r){return r.name}).join(", "),"]"));var n=e.length;return new p2(t,function(r){return Xl.is(r)&&r.length===n&&e.every(function(i,o){return i.is(r[o])})},function(r,i){var o=Xl.validate(r,i);if(le(o))return o;for(var a=o.right,u=a.length>n?a.slice(0,n):a,s=[],c=0;c<n;c++){var l=a[c],f=e[c],d=f.validate(l,Ii(i,String(c),f,l));if(le(d))oa(s,d.left);else{var p=d.right;p!==l&&(u===a&&(u=a.slice()),u[c]=p)}}return s.length>0?so(s):Ee(u)},Kp(e)?Ue:function(r){return e.map(function(i,o){return i.encode(r[o])})},e)}var h2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyType",u}return t}(Te);function ibe(e,t){return t===void 0&&(t="Readonly<".concat(e.name,">")),new h2(t,e.is,e.validate,e.encode,e)}var m2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ReadonlyArrayType",u}return t}(Te);function v2(e,t){t===void 0&&(t="ReadonlyArray<".concat(e.name,">"));var n=gy(e);return new m2(t,n.is,n.validate,n.encode,e)}var Gp=function(e,t){return y2(tw(e),t)},g2=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.type=a,u._tag="ExactType",u}return t}(Te);function y2(e,t){t===void 0&&(t=qye(e));var n=JO(e);return new g2(t,e.is,function(r,i){var o=Dn.validate(r,i);if(le(o))return o;var a=e.validate(r,i);return le(a)?a:Ye(UB(a.right,n))},function(r){return e.encode(UB(r,n))},e)}var b2=function(e){et(t,e);function t(){var n=e.call(this,"Function",function(r){return typeof r=="function"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="FunctionType",n}return t}(Te),obe=new b2,yy=function(e){et(t,e);function t(n,r,i,o,a,u){var s=e.call(this,n,r,i,o,a)||this;return s.tag=u,s}return t}(iw),abe=function(e,t,n){n===void 0&&(n=qB(t));var r=Hp(t,n);return r instanceof yy?r:(console.warn("[io-ts] Cannot build a tagged union for ".concat(n,", returning a de-optimized union")),new yy(n,r.is,r.validate,r.encode,t,e))},ube=function(e,t){return{value:e,context:t}},_2=function(e){return[{key:"",type:e}]},S2=function(e){et(t,e);function t(){var n=e.call(this,"never",function(r){return!1},function(r,i){return tt(r,i)},function(){throw new Error("cannot encode never")})||this;return n._tag="NeverType",n}return t}(Te),sbe=new S2,$2=function(e){et(t,e);function t(){var n=e.call(this,"any",function(r){return!0},Ee,Ue)||this;return n._tag="AnyType",n}return t}(Te),cbe=new $2,lbe=Dn,T2=function(e){et(t,e);function t(){var n=e.call(this,"object",function(r){return r!==null&&typeof r=="object"},function(r,i){return n.is(r)?Ee(r):tt(r,i)},Ue)||this;return n._tag="ObjectType",n}return t}(Te),fbe=new T2;function ow(e,t,n){return n===void 0&&(n="(".concat(e.name," | ").concat(jB(t),")")),new s2(n,function(r){return e.is(r)&&t(r)},function(r,i){var o=e.validate(r,i);if(le(o))return o;var a=o.right;return t(a)?Ee(a):tt(a,i)},e.encode,e,t)}var dbe=ow(Ws,Number.isInteger,"Integer"),pbe=rw,hbe=function(e){et(t,e);function t(n,r,i,o,a){var u=e.call(this,n,r,i,o)||this;return u.props=a,u._tag="StrictType",u}return t}(Te);function mbe(e){return e}function vbe(e){return function(){return e}}const ee=Ic(Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:i2,AnyDictionaryType:o2,AnyType:$2,Array:Xl,ArrayType:c2,BigIntType:n2,BooleanType:r2,Dictionary:lbe,DictionaryType:nw,ExactType:g2,Function:obe,FunctionType:b2,Int:vy,Integer:dbe,InterfaceType:l2,IntersectionType:d2,KeyofType:u2,LiteralType:a2,NeverType:S2,NullType:YB,NumberType:t2,ObjectType:T2,PartialType:f2,ReadonlyArrayType:m2,ReadonlyType:h2,RecursiveType:QO,RefinementType:s2,StrictType:hbe,StringType:e2,TaggedUnionType:yy,TupleType:p2,Type:Te,UndefinedType:JB,UnionType:iw,UnknownArray:Xl,UnknownRecord:Dn,UnknownType:QB,VoidType:ZB,alias:vbe,any:cbe,appendContext:Ii,array:gy,bigint:Qye,boolean:hy,brand:my,clean:mbe,dictionary:pbe,emptyTags:ar,exact:y2,failure:tt,failures:so,getContextEntry:jye,getDefaultContext:_2,getDomainKeys:GO,getFunctionName:jB,getIndex:GB,getTags:ou,getValidationError:ube,identity:Ue,interface:tw,intersection:nbe,keyof:ebe,literal:Vp,mergeAll:YO,never:sbe,null:XO,nullType:XO,number:Ws,object:fbe,partial:tbe,readonly:ibe,readonlyArray:v2,record:rw,recursion:ew,refinement:ow,strict:Gp,string:Oi,success:Ee,taggedUnion:abe,tuple:rbe,type:tw,undefined:py,union:Hp,unknown:Xye,void:XB,voidType:XB},Symbol.toStringTag,{value:"Module"})));var aw={},Yp={},At={};const wi=Ic(XR);function I2(e,t,n){return n===void 0&&(n=e.name),new Te(n,e.is,e.validate,function(r){return t(e.encode(r))})}const gbe=Ic(Object.freeze(Object.defineProperty({__proto__:null,mapOutput:I2},Symbol.toStringTag,{value:"Module"})));var O2;function au(){if(O2)return At;O2=1,Object.defineProperty(At,"__esModule",{value:!0}),At.addType=At.isEmpty=At.objectToMap=At.grouped=At.formatDate=At.formatDateTime=At.filterDouble=At.refineType=At.nullable=void 0;const e=H,t=mt,n=wi,r=e.__importStar(ee),i=gbe;function o(h){return r.union([h,r.null,r.undefined])}At.nullable=o;function a(h,v,m){return new r.Type(v,h.is,(_,g)=>(0,n.pipe)(h.validate(_,g),t.either.chain(S=>m(S)?r.success(S):r.failure(_,g))),h.encode)}At.refineType=a;function u(h){if(h==="")return null;const v=Number(h);return Number.isNaN(v)?null:v}At.filterDouble=u;function s(h){return h.toISOString().replace(/\.\d{3}Z$/,"+0000")}At.formatDateTime=s;function c(h){return h.toISOString().replace(/T.*/,"")}At.formatDate=c;function l(h,v){return h.reduce((m,_,g)=>(g%v===0?m.push([_]):m[Math.floor(g/v)].push(_),m),new Array)}At.grouped=l;function f(h){return new Map(Object.entries(h))}At.objectToMap=f;function d(h){for(const v in h)return!1;return!0}At.isEmpty=d;function p(h,v){return(0,i.mapOutput)(h,m=>({...m,__TYPE__:v}))}return At.addType=p,At}var w2;function ybe(){if(w2)return Yp;w2=1,Object.defineProperty(Yp,"__esModule",{value:!0}),Yp.WidgetKey=void 0;const t=H.__importStar(ee),n=au(),r=new RegExp("^[^<>]+$");return Yp.WidgetKey=(0,n.refineType)(t.string,"WidgetKey",i=>i.length===0||r.test(i)),Yp}var C2;function Ql(){return C2||(C2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),H.__exportStar(ybe(),e)}(aw)),aw}var uw={},sw={},Ci={},cw={},lw={},fw={},by={};const aa=Ic(oF);var E2;function bbe(){if(E2)return by;E2=1,Object.defineProperty(by,"__esModule",{value:!0});const e=H,t=aa,n=wi,r=e.__importStar(ee);return by.default=new r.Type("dateFromString",i=>i instanceof Date,(i,o)=>(0,n.pipe)(r.string.validate(i,o),(0,t.chain)(a=>{const u=new Date(a);return isNaN(u.getTime())?r.failure(i,o):r.success(u)})),i=>i.toISOString()),by}var _y={},R2;function _be(){if(R2)return _y;R2=1,Object.defineProperty(_y,"__esModule",{value:!0});const e=H,t=aa,n=wi,r=e.__importStar(ee);return _y.default=new r.Type("dateFromStringOrNumber",i=>i instanceof Date,(i,o)=>(0,n.pipe)(r.union([r.number,r.string]).validate(i,o),(0,t.chain)(a=>{const u=new Date(a);return isNaN(u.getTime())?r.failure(i,o):r.success(u)})),i=>i),_y}var Sy={},M2;function Sbe(){if(M2)return Sy;M2=1,Object.defineProperty(Sy,"__esModule",{value:!0});const e=H,t=aa,n=wi,r=e.__importStar(ee);return Sy.default=new r.Type("dateFromTsMs",i=>i instanceof Date,(i,o)=>(0,n.pipe)(r.number.validate(i,o),(0,t.chain)(a=>{const u=new Date(a);return isNaN(u.getTime())?r.failure(i,o):r.success(u)})),i=>i.getTime()),Sy}var $y={},x2;function $be(){if(x2)return $y;x2=1,Object.defineProperty($y,"__esModule",{value:!0});const e=H,t=aa,n=wi,r=e.__importStar(ee);return $y.default=new r.Type("IntFromNumber",r.Int.is,(i,o)=>(0,n.pipe)(r.number.validate(i,o),(0,t.chain)(a=>r.Int.is(a)?r.success(a):r.success(Math.round(a)))),r.Int.encode),$y}var Ty={},k2;function Tbe(){if(k2)return Ty;k2=1,Object.defineProperty(Ty,"__esModule",{value:!0});const e=H,t=aa,n=wi,r=e.__importStar(ee),i=/^([0-9]+)px$/;return Ty.default=new r.Type("IntFromPixels",r.Int.is,(o,a)=>(0,n.pipe)(r.string.validate(o,a),(0,t.chain)(u=>{try{const s=u.match(i);if(!s)return r.failure(o,a);const c=parseInt(s[1]);return r.success(c)}catch{return r.failure(o,a)}})),String),Ty}var Iy={},A2;function Ibe(){if(A2)return Iy;A2=1,Object.defineProperty(Iy,"__esModule",{value:!0});const t=H.__importStar(ee),n=au();return Iy.default=(0,n.refineType)(t.string,"nonEmptyString",r=>r.trim().length>0),Iy}var Oy={},wy={},N2;function F2(){if(N2)return wy;N2=1,Object.defineProperty(wy,"__esModule",{value:!0});const t=H.__importStar(ee),n=au();return wy.default=(0,n.nullable)(t.string),wy}var P2;function Obe(){if(P2)return Oy;P2=1,Object.defineProperty(Oy,"__esModule",{value:!0});const e=H,t=aa,n=wi,r=ee,i=e.__importDefault(F2());return Oy.default=new r.Type("nonEmptyStringOrNull",o=>typeof o=="string"||o===null,(o,a)=>(0,n.pipe)(i.default.validate(o,a),(0,t.chain)(u=>typeof u=="string"&&u.length>0?(0,r.success)(u):(0,r.success)(null))),o=>o),Oy}var Cy={},W2;function wbe(){if(W2)return Cy;W2=1,Object.defineProperty(Cy,"__esModule",{value:!0});const t=H.__importStar(ee),n=au();return Cy.default=(0,n.nullable)(t.number),Cy}var Ey={},j2;function Cbe(){if(j2)return Ey;j2=1,Object.defineProperty(Ey,"__esModule",{value:!0});const e=H,t=aa,n=wi,r=e.__importStar(ee);return Ey.default=new r.Type("StringFromInt",r.string.is,(i,o)=>(0,n.pipe)(r.boolean.validate(i,o),(0,t.chain)(a=>r.success(a.toString()))),i=>i),Ey}var Ry={},L2;function Ebe(){if(L2)return Ry;L2=1,Object.defineProperty(Ry,"__esModule",{value:!0});const e=H,t=aa,n=wi,r=e.__importStar(ee);return Ry.default=new r.Type("StringFromInt",r.string.is,(i,o)=>(0,n.pipe)(r.number.validate(i,o),(0,t.chain)(a=>r.success(a.toString()))),i=>i),Ry}var D2;function vt(){return D2||(D2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StringOrNull=e.StringFromNumber=e.StringFromBoolean=e.NumberOrNull=e.NonEmptyStringOrNull=e.NonEmptyString=e.IntFromPixels=e.IntFromNumber=e.Function=e.DateFromTsMs=e.DateFromStringOrNumber=e.DateFromString=void 0;const t=H;var n=bbe();Object.defineProperty(e,"DateFromString",{enumerable:!0,get:function(){return t.__importDefault(n).default}});var r=_be();Object.defineProperty(e,"DateFromStringOrNumber",{enumerable:!0,get:function(){return t.__importDefault(r).default}});var i=Sbe();Object.defineProperty(e,"DateFromTsMs",{enumerable:!0,get:function(){return t.__importDefault(i).default}}),e.Function=t.__importStar(au());var o=$be();Object.defineProperty(e,"IntFromNumber",{enumerable:!0,get:function(){return t.__importDefault(o).default}});var a=Tbe();Object.defineProperty(e,"IntFromPixels",{enumerable:!0,get:function(){return t.__importDefault(a).default}});var u=Ibe();Object.defineProperty(e,"NonEmptyString",{enumerable:!0,get:function(){return t.__importDefault(u).default}});var s=Obe();Object.defineProperty(e,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return t.__importDefault(s).default}});var c=wbe();Object.defineProperty(e,"NumberOrNull",{enumerable:!0,get:function(){return t.__importDefault(c).default}});var l=Cbe();Object.defineProperty(e,"StringFromBoolean",{enumerable:!0,get:function(){return t.__importDefault(l).default}});var f=Ebe();Object.defineProperty(e,"StringFromNumber",{enumerable:!0,get:function(){return t.__importDefault(f).default}});var d=F2();Object.defineProperty(e,"StringOrNull",{enumerable:!0,get:function(){return t.__importDefault(d).default}})}(fw)),fw}var Jp={},dw={},q2;function U2(){return q2||(q2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanField=e.BooleanConfig=e.BooleanFieldType=void 0;const n=H.__importStar(ee),r=vt();e.BooleanFieldType="Boolean",e.BooleanConfig=n.exact(n.partial({label:r.StringOrNull,default_value:n.boolean,placeholder_true:n.string,placeholder_false:n.string})),e.BooleanField=n.exact(n.intersection([n.type({type:n.literal(e.BooleanFieldType)}),n.partial({config:e.BooleanConfig})]))}(dw)),dw}var pw={},B2;function z2(){return B2||(B2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Color=e.ColorConfig=e.ColorFieldType=void 0;const n=H.__importStar(ee),r=vt();e.ColorFieldType="Color",e.ColorConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string})),e.Color=n.exact(n.intersection([n.type({type:n.literal(e.ColorFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.ColorConfig})]))}(pw)),pw}var hw={},K2;function V2(){return K2||(K2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Date=e.DateConfig=e.DateFieldType=void 0;const n=H.__importStar(ee),r=vt();e.DateFieldType="Date",e.DateConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),e.Date=n.exact(n.intersection([n.type({type:n.literal(e.DateFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.DateConfig})]))}(hw)),hw}var mw={},H2;function G2(){return H2||(H2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Embed=e.EmbedConfig=e.EmbedFieldType=void 0;const n=H.__importStar(ee),r=vt();e.EmbedFieldType="Embed",e.EmbedConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,useAsTitle:n.boolean})),e.Embed=n.exact(n.intersection([n.type({type:n.literal(e.EmbedFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.EmbedConfig})]))}(mw)),mw}var vw={},Y2;function J2(){return Y2||(Y2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPoint=e.GeoPointConfig=e.GeoPointFieldType=void 0;const n=H.__importStar(ee),r=vt();e.GeoPointFieldType="GeoPoint",e.GeoPointConfig=n.exact(n.partial({label:r.StringOrNull})),e.GeoPoint=n.exact(n.intersection([n.type({type:n.literal(e.GeoPointFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.GeoPointConfig})]))}(vw)),vw}var gw={},My={},Zp={},Xp={},js={},Z2;function X2(){if(Z2)return js;Z2=1,Object.defineProperty(js,"__esModule",{value:!0}),js.pipe=js.pipeable=void 0;var e=Qe(),t=function(g){return typeof g.map=="function"},n=function(g){return typeof g.contramap=="function"},r=function(g){return typeof g.mapWithIndex=="function"},i=function(g){return typeof g.ap=="function"},o=function(g){return typeof g.chain=="function"},a=function(g){return typeof g.bimap=="function"},u=function(g){return typeof g.extend=="function"},s=function(g){return typeof g.reduce=="function"},c=function(g){return typeof g.reduceWithIndex=="function"},l=function(g){return typeof g.alt=="function"},f=function(g){return typeof g.compact=="function"},d=function(g){return typeof g.filter=="function"},p=function(g){return typeof g.filterWithIndex=="function"},h=function(g){return typeof g.promap=="function"},v=function(g){return typeof g.compose=="function"},m=function(g){return typeof g.throwError=="function"};function _(g){var S={};if(t(g)){var b=function(Q){return function(re){return g.map(re,Q)}};S.map=b}if(n(g)){var $=function(Q){return function(re){return g.contramap(re,Q)}};S.contramap=$}if(r(g)){var T=function(Q){return function(re){return g.mapWithIndex(re,Q)}};S.mapWithIndex=T}if(i(g)){var M=function(Q){return function(re){return g.ap(re,Q)}},R=function(Q){return function(re){return g.ap(g.map(re,function(ke){return function(){return ke}}),Q)}};S.ap=M,S.apFirst=R,S.apSecond=function(Q){return function(re){return g.ap(g.map(re,function(){return function(ke){return ke}}),Q)}}}if(o(g)){var q=function(Q){return function(re){return g.chain(re,Q)}},Y=function(Q){return function(re){return g.chain(re,function(ke){return g.map(Q(ke),function(){return ke})})}},N=function(Q){return g.chain(Q,e.identity)};S.chain=q,S.chainFirst=Y,S.flatten=N}if(a(g)){var Z=function(Q,re){return function(ke){return g.bimap(ke,Q,re)}},ie=function(Q){return function(re){return g.mapLeft(re,Q)}};S.bimap=Z,S.mapLeft=ie}if(u(g)){var J=function(Q){return function(re){return g.extend(re,Q)}},ye=function(Q){return g.extend(Q,e.identity)};S.extend=J,S.duplicate=ye}if(s(g)){var we=function(Q,re){return function(ke){return g.reduce(ke,Q,re)}},x=function(Q){var re=g.foldMap(Q);return function(ke){return function(Ot){return re(Ot,ke)}}},k=function(Q,re){return function(ke){return g.reduceRight(ke,Q,re)}};S.reduce=we,S.foldMap=x,S.reduceRight=k}if(c(g)){var C=function(Q,re){return function(ke){return g.reduceWithIndex(ke,Q,re)}},O=function(Q){var re=g.foldMapWithIndex(Q);return function(ke){return function(Ot){return re(Ot,ke)}}},F=function(Q,re){return function(ke){return g.reduceRightWithIndex(ke,Q,re)}};S.reduceWithIndex=C,S.foldMapWithIndex=O,S.reduceRightWithIndex=F}if(l(g)){var j=function(Q){return function(re){return g.alt(re,Q)}};S.alt=j}if(f(g)&&(S.compact=g.compact,S.separate=g.separate),d(g)){var X=function(Q){return function(re){return g.filter(re,Q)}},te=function(Q){return function(re){return g.filterMap(re,Q)}},xe=function(Q){return function(re){return g.partition(re,Q)}},ce=function(Q){return function(re){return g.partitionMap(re,Q)}};S.filter=X,S.filterMap=te,S.partition=xe,S.partitionMap=ce}if(p(g)){var Ne=function(Q){return function(re){return g.filterWithIndex(re,Q)}},ze=function(Q){return function(re){return g.filterMapWithIndex(re,Q)}},He=function(Q){return function(re){return g.partitionWithIndex(re,Q)}},it=function(Q){return function(re){return g.partitionMapWithIndex(re,Q)}};S.filterWithIndex=Ne,S.filterMapWithIndex=ze,S.partitionWithIndex=He,S.partitionMapWithIndex=it}if(h(g)){var Ft=function(Q,re){return function(ke){return g.promap(ke,Q,re)}};S.promap=Ft}if(v(g)){var qt=function(Q){return function(re){return g.compose(re,Q)}};S.compose=qt}if(m(g)){var Ht=function(Q){return function(re){return re._tag==="None"?g.throwError(Q()):g.of(re.value)}},xn=function(Q){return Q._tag==="Left"?g.throwError(Q.left):g.of(Q.right)},Nr=function(Q,re){return function(ke){return Q(ke)?g.of(ke):g.throwError(re(ke))}},fr=function(Q,re){return function(ke){return g.chain(ke,function(Ot){return Q(Ot)?g.of(Ot):g.throwError(re(Ot))})}};S.fromOption=Ht,S.fromEither=xn,S.fromPredicate=Nr,S.filterOrElse=fr}return S}return js.pipeable=_,js.pipe=e.pipe,js}var Q2;function yw(){if(Q2)return Xp;Q2=1;var e=he&&he.__createBinding||(Object.create?function(a,u,s,c){c===void 0&&(c=s),Object.defineProperty(a,c,{enumerable:!0,get:function(){return u[s]}})}:function(a,u,s,c){c===void 0&&(c=s),a[c]=u[s]}),t=he&&he.__setModuleDefault||(Object.create?function(a,u){Object.defineProperty(a,"default",{enumerable:!0,value:u})}:function(a,u){a.default=u}),n=he&&he.__importStar||function(a){if(a&&a.__esModule)return a;var u={};if(a!=null)for(var s in a)Object.hasOwnProperty.call(a,s)&&e(u,a,s);return t(u,a),u};Object.defineProperty(Xp,"__esModule",{value:!0}),Xp.NumberFromString=void 0;var r=n(ee),i=X2(),o=Ln();return Xp.NumberFromString=new r.Type("NumberFromString",r.number.is,function(a,u){return i.pipe(r.string.validate(a,u),o.chain(function(s){var c=+s;return isNaN(c)||s.trim()===""?r.failure(a,u):r.success(c)}))},String),Xp}var ez;function Rbe(){if(ez)return Zp;ez=1;var e=he&&he.__createBinding||(Object.create?function(u,s,c,l){l===void 0&&(l=c),Object.defineProperty(u,l,{enumerable:!0,get:function(){return s[c]}})}:function(u,s,c,l){l===void 0&&(l=c),u[l]=s[c]}),t=he&&he.__setModuleDefault||(Object.create?function(u,s){Object.defineProperty(u,"default",{enumerable:!0,value:s})}:function(u,s){u.default=s}),n=he&&he.__importStar||function(u){if(u&&u.__esModule)return u;var s={};if(u!=null)for(var c in u)Object.hasOwnProperty.call(u,c)&&e(s,u,c);return t(s,u),s};Object.defineProperty(Zp,"__esModule",{value:!0}),Zp.IntFromString=void 0;var r=n(ee),i=yw(),o=X2(),a=Ln();return Zp.IntFromString=new r.Type("IntFromString",r.Int.is,function(u,s){return o.pipe(i.NumberFromString.validate(u,s),a.chain(function(c){return r.Int.is(c)?r.success(c):r.failure(u,s)}))},i.NumberFromString.encode),Zp}var tz;function bw(){if(tz)return My;tz=1,Object.defineProperty(My,"__esModule",{value:!0});const e=H,t=Ln(),n=e.__importStar(ee),r=Rbe(),i=vt(),o=new n.Type("SideConstraints",u=>!u||typeof u=="number",(u,s)=>t.either.chain(n.union([n.literal("auto"),n.literal(""),n.Int,r.IntFromString,i.IntFromNumber,i.IntFromPixels,n.null]).validate(u,s),c=>c==="auto"||c===""?n.success(null):n.success(c)),u=>u),a=n.partial({width:o,height:o});return My.default=a,My}var nz;function rz(){return nz||(nz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Image=e.ImageConfig=e.Thumbnail=e.ImageFieldType=void 0;const t=H,n=t.__importStar(ee),r=vt(),i=t.__importDefault(bw());e.ImageFieldType="Image",e.Thumbnail=n.exact(n.intersection([n.type({name:n.string}),i.default])),e.ImageConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,constraint:i.default,thumbnails:n.readonlyArray(e.Thumbnail)})),e.Image=n.exact(n.intersection([n.type({type:n.literal(e.ImageFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.ImageConfig})]))}(gw)),gw}var _w={},iz;function oz(){return iz||(iz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationField=e.IntegrationFieldConfig=e.IntegrationFieldType=void 0;const n=H.__importStar(ee),r=vt();e.IntegrationFieldType="IntegrationFields",e.IntegrationFieldConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,catalog:n.string})),e.IntegrationField=n.exact(n.intersection([n.type({type:n.literal(e.IntegrationFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.IntegrationFieldConfig})]))}(_w)),_w}var Sw={},Qp={},eh={},th={},az;function Mbe(){if(az)return th;az=1,Object.defineProperty(th,"__esModule",{value:!0}),th.clone=void 0;function e(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n}return th.clone=e,th}var uz;function xbe(){if(uz)return eh;uz=1;var e=he&&he.__createBinding||(Object.create?function(a,u,s,c){c===void 0&&(c=s),Object.defineProperty(a,c,{enumerable:!0,get:function(){return u[s]}})}:function(a,u,s,c){c===void 0&&(c=s),a[c]=u[s]}),t=he&&he.__setModuleDefault||(Object.create?function(a,u){Object.defineProperty(a,"default",{enumerable:!0,value:u})}:function(a,u){a.default=u}),n=he&&he.__importStar||function(a){if(a&&a.__esModule)return a;var u={};if(a!=null)for(var s in a)Object.hasOwnProperty.call(a,s)&&e(u,a,s);return t(u,a),u};Object.defineProperty(eh,"__esModule",{value:!0}),eh.withValidate=void 0;var r=n(ee),i=Mbe();function o(a,u,s){s===void 0&&(s=a.name);var c=i.clone(a);return c.validate=u,c.decode=function(l){return u(l,r.getDefaultContext(c))},c.name=s,c}return eh.withValidate=o,eh}var sz;function $w(){if(sz)return Qp;sz=1;var e=he&&he.__createBinding||(Object.create?function(u,s,c,l){l===void 0&&(l=c),Object.defineProperty(u,l,{enumerable:!0,get:function(){return s[c]}})}:function(u,s,c,l){l===void 0&&(l=c),u[l]=s[c]}),t=he&&he.__setModuleDefault||(Object.create?function(u,s){Object.defineProperty(u,"default",{enumerable:!0,value:s})}:function(u,s){u.default=s}),n=he&&he.__importStar||function(u){if(u&&u.__esModule)return u;var s={};if(u!=null)for(var c in u)Object.hasOwnProperty.call(u,c)&&e(s,u,c);return t(s,u),s};Object.defineProperty(Qp,"__esModule",{value:!0}),Qp.withFallback=void 0;var r=n(ee),i=xbe(),o=Ln();function a(u,s,c){return c===void 0&&(c="withFallback("+u.name+")"),i.withValidate(u,function(l,f){return o.orElse(function(){return r.success(s)})(u.validate(l,f))},c)}return Qp.withFallback=a,Qp}var cz;function lz(){return cz||(cz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Link=e.LinkConfig=e.LinkFieldType=void 0;const t=H,n=Ln(),r=t.__importStar(ee),i=$w(),o=vt(),a=c=>{if(c instanceof Array&&c.reduce((f,d)=>f&&typeof d=="string",!0))return r.success(c)},u=c=>{if(typeof c=="string")return r.success([c])},s=new r.Type("MasksArrayString",c=>c instanceof Array,(c,l)=>n.either.chain(r.union([r.array(r.string),r.string]).validate(c,l),f=>a(f)||u(f)||r.failure(c,l)),c=>c);e.LinkFieldType="Link",e.LinkConfig=r.exact(r.partial({label:o.StringOrNull,useAsTitle:r.boolean,placeholder:r.string,select:(0,i.withFallback)(r.union([r.literal("media"),r.literal("document"),r.literal("web"),r.null]),null),customtypes:r.readonlyArray(r.string),masks:s,tags:s,allowTargetBlank:r.boolean})),e.Link=r.exact(r.intersection([r.type({type:r.literal(e.LinkFieldType)}),r.partial({fieldset:o.StringOrNull,config:e.LinkConfig})]))}(Sw)),Sw}var Tw={},fz;function dz(){return fz||(fz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Number=e.NumberConfig=e.NumberFieldType=void 0;const n=H.__importStar(ee),r=yw(),i=vt();e.NumberFieldType="Number",e.NumberConfig=n.exact(n.partial({label:i.StringOrNull,placeholder:n.string,min:n.union([n.number,r.NumberFromString]),max:n.union([n.number,r.NumberFromString]),step:n.union([n.number,r.NumberFromString])})),e.Number=n.exact(n.intersection([n.type({type:n.literal(e.NumberFieldType)}),n.partial({fieldset:i.StringOrNull,config:e.NumberConfig})]))}(Tw)),Tw}var Iw={},pz;function hz(){return pz||(pz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Range=e.RangeConfig=e.RangeFieldType=void 0;const n=H.__importStar(ee),r=yw(),i=vt();e.RangeFieldType="Range",e.RangeConfig=n.exact(n.partial({label:i.StringOrNull,placeholder:n.string,min:n.union([n.number,r.NumberFromString]),max:n.union([n.number,r.NumberFromString]),step:n.union([n.number,r.NumberFromString])})),e.Range=n.exact(n.intersection([n.type({type:n.literal(e.RangeFieldType)}),n.partial({fieldset:i.StringOrNull,config:e.RangeConfig})]))}(Iw)),Iw}var Ow={},mz;function vz(){return mz||(mz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichText=e.RichTextConfig=e.RichTextNodeTypeCodec=e.RichTextNodeType=e.DEFAULT_OPTION=e.RichTextFieldType=void 0;const t=H,n=mt,r=Ln(),i=Qe(),o=t.__importStar(ee),a=vt(),u=t.__importDefault(bw());e.RichTextFieldType="StructuredText",e.DEFAULT_OPTION="paragraph",e.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"},e.RichTextNodeTypeCodec=o.keyof({[e.RichTextNodeType.heading1]:null,[e.RichTextNodeType.heading2]:null,[e.RichTextNodeType.heading3]:null,[e.RichTextNodeType.heading4]:null,[e.RichTextNodeType.heading5]:null,[e.RichTextNodeType.heading6]:null,[e.RichTextNodeType.paragraph]:null,[e.RichTextNodeType.strong]:null,[e.RichTextNodeType.em]:null,[e.RichTextNodeType.preformatted]:null,[e.RichTextNodeType.hyperlink]:null,[e.RichTextNodeType.image]:null,[e.RichTextNodeType.embed]:null,[e.RichTextNodeType.list]:null,[e.RichTextNodeType.orderedList]:null,[e.RichTextNodeType.rtl]:null});const s=new o.Type("RichTextOptions",h=>typeof h=="string",h=>(0,i.pipe)(o.union([o.string,o.null]).decode(h),n.either.map(v=>{if(!v)return e.DEFAULT_OPTION;const _=v.split(",").map(g=>g.trim()).filter(g=>(0,r.getOrElseW)(()=>{})(e.RichTextNodeTypeCodec.decode(g)));return _.length?_.join(","):e.DEFAULT_OPTION})),h=>h),c=h=>{if(!h)return o.success([])},l=h=>{if(h instanceof Object){const v=h;if(!Object.entries(v).length)return o.success([]);if(v[""])return o.success(v[""].map(_=>_.name));const m=Object.entries(v).reduce((_,[,g])=>_.concat(g.map(S=>S.name)),[]).filter(Boolean);return o.success(m)}},f=h=>{if(h instanceof Array&&h.reduce((m,_)=>m&&typeof _=="string",!0))return o.success(h)},d=h=>{if(typeof h=="string")return o.success([h])},p=new o.Type("RichTextLabels",h=>h instanceof Array,(h,v)=>{const m=o.record(o.string,o.readonlyArray(o.record(o.literal("name"),o.string))),_=o.readonlyArray(o.string);return(0,i.pipe)(o.union([m,_,o.string,o.null]).decode(h),n.either.chain(g=>c(g)||f(g)||l(g)||d(g)||o.failure(h,v)))},h=>h);e.RichTextConfig=o.exact(o.partial({label:a.StringOrNull,placeholder:o.string,useAsTitle:o.boolean,single:s,multi:s,imageConstraint:u.default,labels:p,allowTargetBlank:o.boolean})),e.RichText=o.exact(o.intersection([o.type({type:o.literal(e.RichTextFieldType)}),o.partial({fieldset:a.StringOrNull,config:e.RichTextConfig})]))}(Ow)),Ow}var ww={},gz;function yz(){return gz||(gz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Select=e.SelectConfig=e.SelectFieldType=void 0;const n=H.__importStar(ee),r=vt();e.SelectFieldType="Select",e.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]))})),e.Select=n.exact(n.intersection([n.type({type:n.literal(e.SelectFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.SelectConfig})]))}(ww)),ww}var Cw={},bz;function _z(){return bz||(bz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Separator=e.SeparatorConfig=e.SeparatorFieldType=void 0;const n=H.__importStar(ee),r=vt();e.SeparatorFieldType="Separator",e.SeparatorConfig=n.exact(n.partial({label:r.StringOrNull})),e.Separator=n.exact(n.intersection([n.type({type:n.literal(e.SeparatorFieldType)}),n.partial({config:e.SeparatorConfig})]))}(Cw)),Cw}var Ew={},Sz;function $z(){return Sz||(Sz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Text=e.TextConfig=e.TextFieldType=void 0;const n=H.__importStar(ee),r=vt();e.TextFieldType="Text",e.TextConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),e.Text=n.exact(n.intersection([n.type({type:n.literal(e.TextFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.TextConfig})]))}(Ew)),Ew}var Rw={},Tz;function Iz(){return Tz||(Tz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.TimestampConfig=e.TimestampFieldType=void 0;const n=H.__importStar(ee),r=vt();e.TimestampFieldType="Timestamp",e.TimestampConfig=n.exact(n.partial({label:r.StringOrNull,placeholder:n.string,default:n.string})),e.Timestamp=n.exact(n.intersection([n.type({type:n.literal(e.TimestampFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.TimestampConfig})]))}(Rw)),Rw}var Oz;function ef(){if(Oz)return Jp;Oz=1,Object.defineProperty(Jp,"__esModule",{value:!0}),Jp.NestableWidget=void 0;const t=H.__importStar(ee),n=U2(),r=z2(),i=V2(),o=G2(),a=J2(),u=rz(),s=oz(),c=lz(),l=dz(),f=hz(),d=vz(),p=yz(),h=_z(),v=$z(),m=Iz();return Jp.NestableWidget=t.union([r.Color,n.BooleanField,o.Embed,a.GeoPoint,i.Date,l.Number,f.Range,d.RichText,p.Select,h.Separator,v.Text,m.Timestamp,c.Link,u.Image,s.IntegrationField]),Jp}var wz;function Mw(){return wz||(wz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Group=e.GroupConfig=e.GroupFieldType=void 0;const n=H.__importStar(ee),r=Ql(),i=vt(),o=ef();e.GroupFieldType="Group",e.GroupConfig=n.exact(n.partial({label:i.StringOrNull,repeat:n.boolean,fields:n.record(r.WidgetKey,o.NestableWidget)})),e.Group=n.exact(n.intersection([n.type({type:n.literal(e.GroupFieldType)}),n.partial({fieldset:i.StringOrNull,icon:n.string,description:n.string,config:e.GroupConfig})]))}(lw)),lw}var xw={},Cz;function kw(){return Cz||(Cz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(U2(),e),t.__exportStar(z2(),e),t.__exportStar(V2(),e),t.__exportStar(G2(),e),t.__exportStar(J2(),e),t.__exportStar(rz(),e),t.__exportStar(oz(),e),t.__exportStar(lz(),e),t.__exportStar(ef(),e),t.__exportStar(dz(),e),t.__exportStar(hz(),e),t.__exportStar(vz(),e),t.__exportStar(yz(),e),t.__exportStar(_z(),e),t.__exportStar($z(),e),t.__exportStar(Iz(),e)}(xw)),xw}var Aw={},Ez;function kbe(){return Ez||(Ez=1,function(e){var t=he&&he.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageConstraint=void 0;var n=bw();Object.defineProperty(e,"ImageConstraint",{enumerable:!0,get:function(){return t(n).default}})}(Aw)),Aw}var Nw={},Fw={},Rz;function Pw(){return Rz||(Rz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CompositeSlice=e.CompositeSliceConfig=e.CompositeSliceType=void 0;const n=H.__importStar(ee),r=Ql(),i=vt(),o=ef();e.CompositeSliceType="Slice",e.CompositeSliceConfig=n.exact(n.partial({label:i.StringOrNull})),e.CompositeSlice=n.exact(n.intersection([n.type({type:n.literal(e.CompositeSliceType)}),n.partial({fieldset:i.StringOrNull,description:n.string,icon:n.string,display:n.string,"non-repeat":n.record(r.WidgetKey,o.NestableWidget),repeat:n.record(r.WidgetKey,o.NestableWidget),config:e.CompositeSliceConfig})]))}(Fw)),Fw}var nh={},Mz;function xz(){if(Mz)return nh;Mz=1,Object.defineProperty(nh,"__esModule",{value:!0}),nh.LegacySlice=void 0;const t=H.__importStar(ee),n=Mw(),r=ef();return nh.LegacySlice=t.union([r.NestableWidget,n.Group]),nh}var Ww={},kz;function xy(){return kz||(kz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SharedSlice=e.SharedSliceType=e.Variation=void 0;const n=H.__importStar(ee),r=$w(),i=Ql(),o=ef(),a="https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format";e.Variation=n.exact(n.intersection([n.type({id:n.string,name:n.string,description:n.string,imageUrl:(0,r.withFallback)(n.string,a),docURL:n.string,version:n.string}),n.partial({display:n.string,primary:n.record(i.WidgetKey,o.NestableWidget),items:n.record(i.WidgetKey,o.NestableWidget)})])),e.SharedSliceType="SharedSlice",e.SharedSlice=n.exact(n.intersection([n.type({id:n.string,type:n.literal(e.SharedSliceType),name:n.string,variations:n.readonlyArray(e.Variation)}),n.partial({description:n.string})]))}(Ww)),Ww}var rh={},Az;function Nz(){if(Az)return rh;Az=1,Object.defineProperty(rh,"__esModule",{value:!0}),rh.SharedSliceRef=void 0;const t=H.__importStar(ee),n=xy();return rh.SharedSliceRef=t.exact(t.type({type:t.literal(n.SharedSliceType)})),rh}var jw={},Fz;function Abe(){return Fz||(Fz=1,Object.defineProperty(jw,"__esModule",{value:!0})),jw}var Lw={},Pz;function Wz(){return Pz||(Pz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Slices=e.DynamicSlices=e.StaticSlices=e.slicesReader=e.DynamicSlicesConfig=e.StaticSlicesConfig=e.slicesConfigReader=e.SlicesLabels=e.SlicesFieldType=e.LegacySlicesFieldType=void 0;const n=H.__importStar(ee),r=Ql(),i=vt(),o=Pw(),a=xz(),u=xy(),s=Nz();e.LegacySlicesFieldType="Choice",e.SlicesFieldType="Slices",e.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]);function c(d){return n.exact(n.partial({label:i.StringOrNull,labels:e.SlicesLabels,choices:n.record(r.WidgetKey,n.union([a.LegacySlice,o.CompositeSlice,d]))}))}e.slicesConfigReader=c,e.StaticSlicesConfig=c(u.SharedSlice),e.DynamicSlicesConfig=c(s.SharedSliceRef);const l={toStatic(d,p){const h=Object.entries(d.choices||{}).reduce((v,[m,_])=>{if(_.type==="SharedSlice"){const g=p.get(m);return g?{...v,[m]:g}:v}else return{...v,[m]:_}},{});return{...d,choices:h}}};function f(d){return n.exact(n.intersection([n.type({type:n.keyof({[e.SlicesFieldType]:null,[e.LegacySlicesFieldType]:null})}),n.partial({fieldset:i.StringOrNull,config:d})]))}e.slicesReader=f,e.StaticSlices=f(e.StaticSlicesConfig),e.DynamicSlices=f(e.DynamicSlicesConfig),e.Slices={toStatic(d,p){return d.config?{...d,config:l.toStatic(d.config,p)}:d}}}(Lw)),Lw}var ih={},jz;function Nbe(){if(jz)return ih;jz=1,Object.defineProperty(ih,"__esModule",{value:!0}),ih.SlicesTypes=void 0;const t=H.__importStar(ee),n=Pw(),r=xy();return ih.SlicesTypes=t.keyof({[n.CompositeSliceType]:null,[r.SharedSliceType]:null}),ih}var Lz;function Fbe(){return Lz||(Lz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(Pw(),e),t.__exportStar(xz(),e),t.__exportStar(xy(),e),t.__exportStar(Nz(),e),t.__exportStar(Abe(),e),t.__exportStar(Wz(),e),t.__exportStar(Nbe(),e)}(Nw)),Nw}var Dw={},Dz;function qz(){return Dz||(Dz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UID=e.UIDConfig=e.UIDFieldType=void 0;const n=H.__importStar(ee),r=vt();e.UIDFieldType="UID",e.UIDConfig=n.exact(n.partial({label:r.StringOrNull,useAsTitle:n.boolean,placeholder:n.string})),e.UID=n.exact(n.intersection([n.type({type:n.literal(e.UIDFieldType)}),n.partial({fieldset:r.StringOrNull,config:e.UIDConfig})]))}(Dw)),Dw}var Ir={},Uz;function Bz(){if(Uz)return Ir;Uz=1,Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.Widgets=Ir.FieldType=Ir.DynamicWidget=Ir.StaticWidget=Ir.widgetReader=void 0;const t=H.__importStar(ee),n=Mw(),r=kw(),i=ef(),o=Wz(),a=qz();function u(s){return t.union([a.UID,i.NestableWidget,n.Group,s])}return Ir.widgetReader=u,Ir.StaticWidget=u(o.StaticSlices),Ir.DynamicWidget=u(o.DynamicSlices),Ir.FieldType=t.keyof({[r.ColorFieldType]:null,[r.BooleanFieldType]:null,[r.NumberFieldType]:null,[r.EmbedFieldType]:null,[r.GeoPointFieldType]:null,[r.DateFieldType]:null,[r.RangeFieldType]:null,[r.RichTextFieldType]:null,[r.SelectFieldType]:null,[r.SeparatorFieldType]:null,[r.TextFieldType]:null,[r.TimestampFieldType]:null,[r.LinkFieldType]:null,[r.ImageFieldType]:null,[r.IntegrationFieldType]:null,[a.UIDFieldType]:null,[n.GroupFieldType]:null,[o.SlicesFieldType]:null,[o.LegacySlicesFieldType]:null}),Ir.Widgets={toStatic(s,c){switch(s.type){case"Choice":case"Slices":return o.Slices.toStatic(s,c);default:return s}}},Ir}var zz;function ua(){return zz||(zz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(Mw(),e),t.__exportStar(kw(),e),t.__exportStar(kbe(),e),t.__exportStar(Fbe(),e),t.__exportStar(qz(),e),t.__exportStar(Bz(),e)}(cw)),cw}var Kz;function tf(){if(Kz)return Ci;Kz=1,Object.defineProperty(Ci,"__esModule",{value:!0}),Ci.defaultCtx=Ci.getFieldCtx=Ci.LegacyContentCtx=Ci.FieldOrSliceType=void 0;const t=H.__importStar(ee),n=ua();Ci.FieldOrSliceType=t.union([n.FieldType,n.SlicesTypes]);let r=class{constructor(u,s,c){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=u,this.fieldPath=s||[],this.allTypes=c||new Map;const l=Array.of(this.fieldPath,[this.fieldKey]).flat().join(".");this.prefixedKey=l,this.keyOfType=`${l}_TYPE`,this.fieldType=this.allTypes.get(this.prefixedKey)}};Ci.LegacyContentCtx=r;function i(a,u,s){return new r(a,[...u.fieldPath,u.fieldKey,...s||[]],u.allTypes)}Ci.getFieldCtx=i;function o(a,u=new Map){return new r(a,[],u)}return Ci.defaultCtx=o,Ci}var Ls={},Vz;function Nt(){if(Vz)return Ls;Vz=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.hasContentType=Ls.hasFieldContentType=void 0;const e=Ln(),t=NC();function n(i){return r(i)&&i.__TYPE__===t.FieldContentType&&(i==null?void 0:i.type)!==void 0&&typeof i.type=="string"&&(0,e.isRight)(t.FieldType.decode(i.type))}Ls.hasFieldContentType=n;function r(i){return typeof i=="object"&&i!==null&&"__TYPE__"in i}return Ls.hasContentType=r,Ls}var qw={},Uw={},Hz;function Gz(){return Hz||(Hz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanContent=e.BooleanLegacy=e.isBooleanContent=e.BooleanContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=Nt();e.BooleanContentType="BooleanContent";const a=s=>(0,o.hasContentType)(s)&&s.__TYPE__===e.BooleanContentType;e.isBooleanContent=a;const u=s=>new i.Type("BooleanLegacy",e.isBooleanContent,c=>(0,r.pipe)(i.boolean.decode(c),n.either.map(l=>e.BooleanContent.encode({value:l,__TYPE__:e.BooleanContentType}))),c=>({content:c.value,types:{[s.keyOfType]:"Boolean"}}));e.BooleanLegacy=u,e.BooleanContent=i.strict({__TYPE__:i.literal(e.BooleanContentType),value:i.boolean})}(Uw)),Uw}var Bw={},Yz;function zw(){return Yz||(Yz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmbedContent=e.EmbedLegacy=e.EmbedContentLegacy=e.isEmbedContent=e.EmbedContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=vt(),a=Nt();e.EmbedContentType="EmbedContent";const u=c=>(0,a.hasContentType)(c)&&c.__TYPE__===e.EmbedContentType;e.isEmbedContent=u,e.EmbedContentLegacy=i.exact(i.intersection([i.type({embed_url:i.string,type:i.string}),i.partial({version:i.union([i.string,i.number,i.null]),title:o.StringOrNull,author_name:o.StringOrNull,author_url:o.StringOrNull,provider_name:o.StringOrNull,provider_url:o.StringOrNull,cache_age:i.union([i.string,i.number,i.null]),thumbnail_url:o.StringOrNull,thumbnail_width:o.NumberOrNull,thumbnail_height:o.NumberOrNull,html:o.StringOrNull})]));const s=c=>new i.Type("EmbedLegacy",e.isEmbedContent,l=>(0,r.pipe)(e.EmbedContentLegacy.decode(l),n.either.map(f=>({...f,all:l,__TYPE__:e.EmbedContentType}))),l=>({content:l.all,types:{[c.keyOfType]:"Embed"}}));e.EmbedLegacy=s,e.EmbedContent=i.intersection([e.EmbedContentLegacy,i.strict({__TYPE__:i.literal(e.EmbedContentType),all:i.unknown})])}(Bw)),Bw}var Kw={},Vw={},ky={},Jz;function Ds(){if(Jz)return ky;Jz=1,Object.defineProperty(ky,"__esModule",{value:!0});const e=H,t=aa,n=wi,r=e.__importStar(ee);function i(o){let a=0;for(;a<o.length&&o[a]<=" ";)a++;let u=o.length;for(;a<u&&o[u-1]<=" ";)u--;return o.substring(a,u)}return ky.default=new r.Type("TrimmedString",r.string.is,(o,a)=>(0,n.pipe)(r.string.validate(o,a),(0,t.chain)(u=>r.success(i(u)))),o=>o),ky}var oh={},Zz;function sa(){return Zz||(Zz=1,Object.defineProperty(oh,"__esModule",{value:!0}),oh.FieldContentType=void 0,oh.FieldContentType="FieldContent"),oh}var Xz;function Qz(){return Xz||(Xz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorContent=e.ColorLegacy=e.isColorContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=ua(),a=t.__importDefault(Ds()),u=Nt(),s=sa(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Color";e.isColorContent=c;const l=f=>new i.Type("ColorLegacy",e.isColorContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.ColorContent.encode({value:p,type:o.ColorFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.ColorFieldType}}));e.ColorLegacy=l,e.ColorContent=i.strict({type:i.literal(o.ColorFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Vw)),Vw}var Hw={},eK;function tK(){return eK||(eK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DateContent=e.DateLegacy=e.isDateContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=ua(),a=t.__importDefault(Ds()),u=Nt(),s=sa(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Date";e.isDateContent=c;const l=f=>new i.Type("DateLegacy",e.isDateContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.DateContent.encode({value:p,type:o.DateFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.DateFieldType}}));e.DateLegacy=l,e.DateContent=i.strict({type:i.literal(o.DateFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Hw)),Hw}var Gw={},nK;function rK(){return nK||(nK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NumberContent=e.NumberLegacy=e.isNumberContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=ua(),a=t.__importDefault(Ds()),u=Nt(),s=sa(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Number";e.isNumberContent=c;const l=f=>new i.Type("NumberLegacy",e.isNumberContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.NumberContent.encode({value:p,type:o.NumberFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.NumberFieldType}}));e.NumberLegacy=l,e.NumberContent=i.strict({type:i.literal(o.NumberFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Gw)),Gw}var Yw={},iK;function oK(){return iK||(iK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RangeContent=e.RangeLegacy=e.isRangeContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=ua(),a=t.__importDefault(Ds()),u=Nt(),s=sa(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Range";e.isRangeContent=c;const l=f=>new i.Type("RangeLegacy",e.isRangeContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.RangeContent.encode({value:p,type:o.RangeFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.RangeFieldType}}));e.RangeLegacy=l,e.RangeContent=i.strict({type:i.literal(o.RangeFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Yw)),Yw}var Jw={},aK;function uK(){return aK||(aK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectContent=e.SelectLegacy=e.isSelectContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=ua(),a=t.__importDefault(Ds()),u=Nt(),s=sa(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Select";e.isSelectContent=c;const l=f=>new i.Type("SelectLegacy",e.isSelectContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.SelectContent.encode({value:p,type:o.SelectFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.SelectFieldType}}));e.SelectLegacy=l,e.SelectContent=i.strict({type:i.literal(o.SelectFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Jw)),Jw}var Zw={},sK;function cK(){return sK||(sK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextContent=e.TextLegacy=e.isTextContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=ua(),a=t.__importDefault(Ds()),u=Nt(),s=sa(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Text";e.isTextContent=c;const l=f=>new i.Type("TextLegacy",e.isTextContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.TextContent.encode({value:p,type:o.TextFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.TextFieldType}}));e.TextLegacy=l,e.TextContent=i.strict({type:i.literal(o.TextFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Zw)),Zw}var Xw={},lK;function fK(){return lK||(lK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TimestampContent=e.TimestampLegacy=e.isTimestampContent=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=ua(),a=t.__importDefault(Ds()),u=Nt(),s=sa(),c=f=>(0,u.hasContentType)(f)&&f.__TYPE__===s.FieldContentType&&(0,u.hasFieldContentType)(f)&&f.type==="Timestamp";e.isTimestampContent=c;const l=f=>new i.Type("TimestampLegacy",e.isTimestampContent,d=>(0,r.pipe)(a.default.decode(d),n.either.map(p=>e.TimestampContent.encode({value:p,type:o.TimestampFieldType,__TYPE__:s.FieldContentType}))),d=>({content:d.value,types:{[f.keyOfType]:o.TimestampFieldType}}));e.TimestampLegacy=l,e.TimestampContent=i.strict({type:i.literal(o.TimestampFieldType),value:a.default,__TYPE__:i.literal(s.FieldContentType)})}(Xw)),Xw}var dK;function pK(){return dK||(dK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FieldContent=e.FieldType=void 0;const t=H,n=t.__importStar(ee),r=Qz(),i=tK(),o=rK(),a=oK(),u=uK(),s=cK(),c=fK();e.FieldType=n.keyof({Text:null,Date:null,Timestamp:null,Color:null,Number:null,Range:null,Select:null}),e.FieldContent=n.union([i.DateContent,r.ColorContent,o.NumberContent,a.RangeContent,u.SelectContent,s.TextContent,c.TimestampContent]),t.__exportStar(Qz(),e),t.__exportStar(sa(),e),t.__exportStar(tK(),e),t.__exportStar(rK(),e),t.__exportStar(oK(),e),t.__exportStar(uK(),e),t.__exportStar(cK(),e),t.__exportStar(fK(),e)}(Kw)),Kw}var Qw={},hK;function mK(){return hK||(hK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPointContent=e.GeoPointLegacy=e.isGeoPointContent=e.GeoPointContentType=void 0;const t=H,n=mt,r=wi,i=t.__importStar(ee),o=Nt();e.GeoPointContentType="GeoPointContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.GeoPointContentType;e.isGeoPointContent=a;const u=i.strict({position:i.strict({lat:i.number,lng:i.number})}),s=c=>new i.Type("GeoPointLegacy",e.isGeoPointContent,l=>(0,r.pipe)(u.decode(l),n.either.map(f=>e.GeoPointContent.encode({...f,__TYPE__:e.GeoPointContentType}))),l=>({content:{position:l.position},types:{[c.keyOfType]:"GeoPoint"}}));e.GeoPointLegacy=s,e.GeoPointContent=i.intersection([u,i.strict({__TYPE__:i.literal(e.GeoPointContentType)})])}(Qw)),Qw}var eC={},ca={},vK;function gK(){if(vK)return ca;vK=1,Object.defineProperty(ca,"__esModule",{value:!0}),ca.withOptionals=ca.isNotEmpty=ca.zipObjects=void 0;function e(r,i){return[...new Set(Object.keys(r||{}).concat(Object.keys(i||{})))].reduce((a,u)=>{const s=r==null?void 0:r[u],c=i==null?void 0:i[u];return{...a,[u]:{left:s,right:c}}},{})}ca.zipObjects=e;function t(r){return Boolean(Object.keys(r).length)}ca.isNotEmpty=t;function n(r,i){return{...r,...i.reduce((o,[a,u])=>u?{...o,[a]:u}:o,{})}}return ca.withOptionals=n,ca}var yK;function tC(){return yK||(yK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageContent=e.ImageLegacy=e.ImageContentView=e.isImageContent=e.ImageContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=gK(),a=vt(),u=Nt();e.ImageContentType="ImageContent";const s=d=>(0,u.hasContentType)(d)&&d.__TYPE__===e.ImageContentType;e.isImageContent=s;const c=i.exact(i.type({id:i.string,url:i.string,width:i.number,height:i.number}));e.ImageContentView=i.exact(i.intersection([i.type({origin:c,width:i.number,height:i.number,edit:i.type({zoom:i.number,crop:i.type({x:i.number,y:i.number}),background:i.string})}),i.partial({url:i.string,credits:a.NonEmptyStringOrNull,alt:a.NonEmptyStringOrNull,provider:a.StringOrNull})]));const l=i.intersection([e.ImageContentView,i.partial({thumbnails:i.record(i.string,e.ImageContentView)})]),f=d=>new i.Type("ImageLegacy",e.isImageContent,p=>(0,r.pipe)(l.decode(p),n.either.map(h=>e.ImageContent.encode({...h,__TYPE__:e.ImageContentType}))),p=>({content:(0,o.withOptionals)({edit:p.edit,height:p.height,origin:p.origin,width:p.width},[["alt",p.alt],["credits",p.credits],["provider",p.provider],["thumbnails",p.thumbnails],["url",p.url]]),types:{[d.keyOfType]:"Image"}}));e.ImageLegacy=f,e.ImageContent=i.intersection([l,i.strict({__TYPE__:i.literal(e.ImageContentType)})])}(eC)),eC}var nC={},bK;function _K(){return bK||(bK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationFieldContent=e.IntegrationFieldLegacy=e.isIntegrationFieldContent=e.IntegrationFieldContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=Nt();e.IntegrationFieldContentType="IntegrationFieldsContent";const a=s=>(0,o.hasContentType)(s)&&s.__TYPE__===e.IntegrationFieldContentType;e.isIntegrationFieldContent=a;const u=s=>new i.Type("IntegrationFieldLegacy",e.isIntegrationFieldContent,c=>(0,r.pipe)(i.string.decode(c),n.either.map(l=>e.IntegrationFieldContent.encode({value:l,__TYPE__:e.IntegrationFieldContentType}))),c=>({content:c.value,types:{[s.keyOfType]:"IntegrationFields"}}));e.IntegrationFieldLegacy=u,e.IntegrationFieldContent=i.strict({__TYPE__:i.literal(e.IntegrationFieldContentType),value:i.string})}(nC)),nC}var rC={},SK=my(Oi,function(e){return e.length>0},"NonEmptyString");function $K(e,t){t===void 0&&(t="NonEmptyArray<"+e.name+">");var n=gy(e);return new Te(t,function(r){return n.is(r)&&jt(r)},function(r,i){return de(n.validate(r,i),Lr(function(o){var a=bS(o);return Le(a)?tt(r,i):Ee(a.value)}))},function(r){return n.encode(r)})}function TK(e,t,n){n===void 0&&(n="Set<"+e.name+">");var r=gy(e),i=cq(t),o=aq(t);return new Te(n,function(a){return a instanceof Set&&sq(e.is)(a)},function(a,u){return de(r.validate(a,u),Lr(function(s){var c=o(s);return c.size!==s.length?tt(a,u):Ee(c)}))},function(a){return r.encode(i(a))})}function Pbe(e,t,n){return n===void 0&&(n="ReadonlySet<"+e.name+">"),TK(e,t,n)}function iC(e,t){return new Te(e,t,function(n,r){return t(n)?Ee(n):tt(n,r)},Ue)}var Wbe=function(e){return e instanceof Date},jbe=iC("Date",Wbe),Lbe=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},Dbe=function(e,t){return{get:e,reverseGet:t}},IK=function(e){return uu(e.get,V(e.reverseGet,Yn))},qbe=function(e){return qs(V(e.get,_t),e.reverseGet)},Ube=function(e){return la(V(e.get,_t),V(e.reverseGet,Yn))},Bbe=function(e){return nf(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.reverseGet(i)})}}})},uu=function(e,t){return{get:e,set:t}},oC=function(e){return la(V(e.get,_t),e.set)},zbe=function(e){return nf(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.set(i)(r)})}}})},OK=function(e){return function(t){return uu(function(n){return e.get(t.get(n))},function(n){return function(r){return t.set(e.set(n)(t.get(r)))(r)}})}},Kbe=function(e){return function(t){return qs(V(t.getOption,Rd(e.getOption)),V(e.reverseGet,t.reverseGet))}},Vbe=function(e){return function(t){return Us(aC(e))(oC(t))}},Hbe=function(){return uu(D,Yn)},Gbe=function(e){return function(t){return uu(function(n){return t.get(n)[e]},function(n){return function(r){var i,o=t.get(r);return n===o[e]?r:t.set(Object.assign({},o,(i={},i[e]=n,i)))(r)}})}},Ybe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return uu(function(r){for(var i=n.get(r),o={},a=0,u=e;a<u.length;a++){var s=u[a];o[s]=i[s]}return o},function(r){return function(i){for(var o=n.get(i),a=0,u=e;a<u.length;a++){var s=u[a];if(r[s]!==o[s])return n.set(Object.assign({},o,r))(i)}return i}})}},Jbe=function(e){return function(t){return uu(function(n){return t.get(n)[e]},function(n){return function(r){var i=t.get(r);if(n===i[e])return r;var o=i.slice();return o[e]=n,t.set(o)(r)}})}},Zbe=function(e){return function(t){return de(t,OK(b_e().at(e)))}},qs=function(e,t){return{getOption:e,reverseGet:t}},aC=function(e){return la(e.getOption,function(t){return CK(t)(e)})},wK=function(e){return nf(function(t){return function(n){return function(r){return de(e.getOption(r),ko(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return CK(o)(e)(r)})}))}}})},Xbe=function(e){return function(t){return function(n){return de(t.getOption(n),Yi(function(r){var i=e(r);return i===r?n:t.reverseGet(i)}))}}},Qbe=function(e){return function(t){var n=Xbe(e)(t);return function(r){return de(n(r),X$(function(){return r}))}}},CK=function(e){return Qbe(function(){return e})},e_e=function(e){return function(t){return Us(oC(e))(aC(t))}},t_e=function(){return qs(ns,D)},uC=function(e){return qs($v(e),D)},n_e=function(){return qs(D,_t)},r_e=function(){return qs(rl,Ye)},i_e=function(){return qs(function(e){return le(e)?_t(e.left):at},Tt)},la=function(e,t){return{getOption:e,set:t}},o_e=function(e){return nf(function(t){return function(n){return function(r){return de(e.getOption(r),ko(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return e.set(o)(r)})}))}}})},EK=function(e){return function(t){return function(n){return de(t.getOption(n),Yi(function(r){var i=e(r);return i===r?n:t.set(i)(n)}))}}},RK=function(e){return function(t){var n=EK(e)(t);return function(r){return de(n(r),X$(function(){return r}))}}},Us=function(e){return function(t){return la(V(t.getOption,Rd(e.getOption)),function(n){return RK(e.set(n))(t)})}},a_e=function(e){return function(t){return de(t,Us(m_e().index(e)))}},u_e=function(e){return function(t){return de(t,Us(v_e().index(e)))}},s_e=function(e){return function(t){return de(t,Us(g_e().index(e)))}},c_e=function(e){return la(ev(e),function(t){return function(n){return de(Qm(e)(n),ko(function(){return n},function(r){return dv(r,t,n)}))}})},MK=function(e,t,n){if(n[e]===t)return n;var r=Lbe([n[0]],n.slice(1),!0);return r[e]=t,r},l_e=function(e){return la(ev(e),function(t){return function(n){return de(Qm(e)(n),ko(function(){return n},function(r){return MK(r,t,n)}))}})},nf=function(e){return{modifyF:e}};function sC(e){return function(t){return nf(function(n){return function(r){return t.modifyF(n)(e.modifyF(n)(r))}})}}var f_e={URI:"Identity",map:function(e,t){return t(e)},of:D,ap:function(e,t){return e(t)}},d_e=function(e){return e.URI==="Identity"};function p_e(e){return function(){return nf(function(t){var n=d_e(t)?e.map:e.traverse(t);return function(r){return function(i){return n(i,r)}}})}}function h_e(e){return sC(p_e(e)())}var cC=function(e){return{index:e}},m_e=function(){return cC(function(e){return la(function(t){return Ju(e,t)},function(t){return function(n){return de(Ju(e,n),ko(function(){return n},function(){return dv(e,t,n)}))}})})},v_e=function(){return cC(function(e){return la(function(t){return Ju(e,t)},function(t){return function(n){return de(Ju(e,n),ko(function(){return n},function(){return MK(e,t,n)}))}})})},g_e=function(){return cC(function(e){return la(function(t){return ju(e,t)},function(t){return function(n){return n[e]===t||Le(ju(e,n))?n:cS(e,t)(n)}})})},y_e=function(e){return{at:e}};function b_e(){return y_e(function(e){return uu(function(t){return ju(e,t)},ko(function(){return Em(e)},function(t){return cS(e,t)}))})}var xK=Dbe,lC=IK,fC=qbe,dC=Ube,pC=Bbe,__e=function(e){return function(t){return xK(V(t.get,e.get),V(e.reverseGet,t.reverseGet))}},S_e=function(e){return xK(e.reverseGet,e.get)},$_e=function(e){return function(t){return function(n){return t.reverseGet(e(t.get(n)))}}},kK=uu,Ay=Hbe,su=oC,rf=zbe,Bs=OK,T_e=Bs,I_e=V(IK,Bs),zs=Vbe,hC=function(e){return V(su,Us(e))},O_e=function(e){return V(rf,sC(e))},AK=function(e){return function(t){return function(n){var r=t.get(n),i=e(r);return r===i?n:t.set(i)(n)}}};function w_e(e){return function(t){return function(n){return function(r){return de(n.get(r),t,function(i){return e.map(i,function(o){return n.set(o)(r)})})}}}}var C_e=function(e){return zs(t_e())(e)};function E_e(e){return zs(uC(e))}var NK=Gbe,FK=Ybe,R_e=Jbe,M_e=function(e){return V(su,a_e(e))},x_e=function(e){return V(su,u_e(e))},k_e=function(e){return V(su,s_e(e))},A_e=Zbe,N_e=zs(n_e()),F_e=zs(r_e()),P_e=zs(i_e());function W_e(e){return V(rf,h_e(e))}function j_e(e){return hC(c_e(e))}function L_e(e){return hC(l_e(e))}var D_e=function(e,t){return function(n){return PK(n,e,t)}},PK=function(e,t,n){return kK(V(e.get,t),V(n,e.set))},Ny="monocle-ts/Lens",q_e={URI:Ny,imap:PK},WK={URI:Ny,compose:function(e,t){return Bs(e)(t)}},U_e={URI:Ny,compose:WK.compose,id:Ay};const B_e=Object.freeze(Object.defineProperty({__proto__:null,Category:U_e,Invariant:q_e,Semigroupoid:WK,URI:Ny,asOptional:su,asTraversal:rf,atKey:A_e,component:R_e,compose:Bs,composeIso:I_e,composeLens:T_e,composeOptional:hC,composePrism:zs,composeTraversal:O_e,filter:E_e,findFirst:j_e,findFirstNonEmpty:L_e,fromNullable:C_e,id:Ay,imap:D_e,index:M_e,indexNonEmpty:x_e,key:k_e,left:P_e,lens:kK,modify:AK,modifyF:w_e,prop:NK,props:FK,right:F_e,some:N_e,traverse:W_e},Symbol.toStringTag,{value:"Module"}));var jK=o_e,Ks=Us,z_e=EK,K_e=RK,V_e=uC,mC=aC,vC=wK,gC=Kbe,H_e=e_e,fa=sC,LK=function(e){return function(t){return t.modifyF(f_e)(e)}},G_e=function(e){return LK(function(){return e})};function Y_e(e){return fa(wK(uC(e)))}var DK=function(e){return new UK(e.get,e.reverseGet)},of=function(e){return new yC(e.get,e.set)},ah=function(e){return new BK(e.getOption,e.reverseGet)},Vr=function(e){return new J_e(e.getOption,e.set)},Or=function(e){return new Z_e(e.modifyF)},qK=function(e,t,n){var r;return n===e[t]?e:Object.assign({},e,(r={},r[t]=n,r))},UK=function(){function e(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 e.prototype.reverse=function(){return DK(S_e(this))},e.prototype.modify=function(t){return $_e(t)(this)},e.prototype.asLens=function(){return of(lC(this))},e.prototype.asPrism=function(){return ah(fC(this))},e.prototype.asOptional=function(){return Vr(dC(this))},e.prototype.asTraversal=function(){return Or(pC(this))},e.prototype.asFold=function(){var t=this;return new af(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.asGetter=function(){var t=this;return new KK(function(n){return t.get(n)})},e.prototype.asSetter=function(){var t=this;return new uh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return DK(__e(t)(this))},e.prototype.composeIso=function(t){return this.compose(t)},e.prototype.composeLens=function(t){return of(de(this,lC,Bs(t)))},e.prototype.composePrism=function(t){return ah(de(this,fC,gC(t)))},e.prototype.composeOptional=function(t){return Vr(de(this,dC,Ks(t)))},e.prototype.composeTraversal=function(t){return Or(de(this,pC,fa(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeGetter=function(t){return this.asGetter().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e}(),yC=function(){function e(t,n){this.get=t,this.set=n,this._tag="Lens"}return e.fromPath=function(){var t=e.fromProp();return function(n){var r=t(n[0]);return n.slice(1).reduce(function(i,o){return i.compose(t(o))},r)}},e.fromProp=function(){return function(t){return of(de(Ay(),NK(t)))}},e.fromProps=function(){return function(t){return of(de(Ay(),FK.apply(B_e,t)))}},e.fromNullableProp=function(){return function(t,n){return new e(function(r){var i=ns(r[t]);return Le(i)?n:i.value},function(r){return function(i){return qK(i,t,r)}})}},e.prototype.modify=function(t){return AK(t)(this)},e.prototype.asOptional=function(){return Vr(su(this))},e.prototype.asTraversal=function(){return Or(rf(this))},e.prototype.asSetter=function(){var t=this;return new uh(function(n){return t.modify(n)})},e.prototype.asGetter=function(){var t=this;return new KK(function(n){return t.get(n)})},e.prototype.asFold=function(){var t=this;return new af(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){return of(Bs(t)(this))},e.prototype.composeLens=function(t){return this.compose(t)},e.prototype.composeGetter=function(t){return this.asGetter().compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeOptional=function(t){return Vr(de(this,su,Ks(t)))},e.prototype.composeTraversal=function(t){return Or(de(this,rf,fa(t)))},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return of(de(this,Bs(de(t,lC))))},e.prototype.composePrism=function(t){return Vr(zs(t)(this))},e}(),BK=function(){function e(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return e.fromPredicate=function(t){return ah(V_e(t))},e.some=function(){return zK},e.prototype.modify=function(t){var n=this;return function(r){var i=n.modifyOption(t)(r);return Le(i)?r:i.value}},e.prototype.modifyOption=function(t){var n=this;return function(r){return bN.map(n.getOption(r),function(i){var o=t(i);return o===i?r:n.reverseGet(o)})}},e.prototype.set=function(t){return this.modify(function(){return t})},e.prototype.asOptional=function(){return Vr(mC(this))},e.prototype.asTraversal=function(){return Or(vC(this))},e.prototype.asSetter=function(){var t=this;return new uh(function(n){return t.modify(n)})},e.prototype.asFold=function(){var t=this;return new af(function(n){return function(r){return function(i){var o=t.getOption(i);return Le(o)?n.empty:r(o.value)}}})},e.prototype.compose=function(t){return ah(gC(t)(this))},e.prototype.composePrism=function(t){return this.compose(t)},e.prototype.composeOptional=function(t){return Vr(de(this,mC,Ks(t)))},e.prototype.composeTraversal=function(t){return Or(de(this,vC,fa(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return ah(de(this,gC(de(t,fC))))},e.prototype.composeLens=function(t){return Vr(H_e(t)(this))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),zK=new BK(D,_t),J_e=function(){function e(t,n){this.getOption=t,this.set=n,this._tag="Optional"}return e.fromPath=function(){var t=e.fromNullableProp();return function(n){var r=t(n[0]);return n.slice(1).reduce(function(i,o){return i.compose(t(o))},r)}},e.fromNullableProp=function(){return function(t){return new e(function(n){return ns(n[t])},function(n){return function(r){return r[t]==null?r:qK(r,t,n)}})}},e.fromOptionProp=function(){var t=yC.fromProp();return function(n){return t(n).composePrism(zK)}},e.prototype.modify=function(t){return K_e(t)(this)},e.prototype.modifyOption=function(t){return z_e(t)(this)},e.prototype.asTraversal=function(){return Or(jK(this))},e.prototype.asFold=function(){var t=this;return new af(function(n){return function(r){return function(i){var o=t.getOption(i);return Le(o)?n.empty:r(o.value)}}})},e.prototype.asSetter=function(){var t=this;return new uh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return Vr(Ks(t)(this))},e.prototype.composeOptional=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return Or(de(this,jK,fa(t)))},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeLens=function(t){return Vr(de(this,Ks(de(t,su))))},e.prototype.composePrism=function(t){return Vr(de(this,Ks(de(t,mC))))},e.prototype.composeIso=function(t){return Vr(de(this,Ks(de(t,dC))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),Z_e=function(){function e(t){this.modifyF=t,this._tag="Traversal"}return e.prototype.modify=function(t){return LK(t)(this)},e.prototype.set=function(t){return G_e(t)(this)},e.prototype.filter=function(t){return Or(Y_e(t)(this))},e.prototype.asFold=function(){var t=this;return new af(function(n){return function(r){return t.modifyF($N(n))(function(i){return il(r(i))})}})},e.prototype.asSetter=function(){var t=this;return new uh(function(n){return t.modify(n)})},e.prototype.compose=function(t){return Or(fa(t)(this))},e.prototype.composeTraversal=function(t){return this.compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeOptional=function(t){return this.compose(t.asTraversal())},e.prototype.composeLens=function(t){return Or(de(this,fa(de(t,rf))))},e.prototype.composePrism=function(t){return Or(de(this,fa(de(t,vC))))},e.prototype.composeIso=function(t){return Or(de(this,fa(de(t,pC))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),KK=function(){function e(t){this.get=t,this._tag="Getter"}return e.prototype.asFold=function(){var t=this;return new af(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){var n=this;return new e(function(r){return t.get(n.get(r))})},e.prototype.composeGetter=function(t){return this.compose(t)},e.prototype.composeFold=function(t){return this.asFold().compose(t)},e.prototype.composeLens=function(t){return this.compose(t.asGetter())},e.prototype.composeIso=function(t){return this.compose(t.asGetter())},e.prototype.composeTraversal=function(t){return this.asFold().compose(t.asFold())},e.prototype.composeOptional=function(t){return this.asFold().compose(t.asFold())},e.prototype.composePrism=function(t){return this.asFold().compose(t.asFold())},e}(),af=function(){function e(t){this.foldMap=t,this._tag="Fold",this.getAll=t(M$())(ja),this.exist=t(YW),this.all=t(GW),this.foldMapFirst=t(_N())}return e.prototype.compose=function(t){var n=this;return new e(function(r){return function(i){return n.foldMap(r)(t.foldMap(r)(i))}})},e.prototype.composeFold=function(t){return this.compose(t)},e.prototype.composeGetter=function(t){return this.compose(t.asFold())},e.prototype.composeTraversal=function(t){return this.compose(t.asFold())},e.prototype.composeOptional=function(t){return this.compose(t.asFold())},e.prototype.composeLens=function(t){return this.compose(t.asFold())},e.prototype.composePrism=function(t){return this.compose(t.asFold())},e.prototype.composeIso=function(t){return this.compose(t.asFold())},e.prototype.find=function(t){return this.foldMapFirst($v(t))},e.prototype.headOption=function(t){return this.find(function(){return!0})(t)},e}(),uh=function(){function e(t){this.modify=t,this._tag="Setter"}return e.prototype.set=function(t){return this.modify(Yn(t))},e.prototype.compose=function(t){var n=this;return new e(function(r){return n.modify(t.modify(r))})},e.prototype.composeSetter=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return this.compose(t.asSetter())},e.prototype.composeOptional=function(t){return this.compose(t.asSetter())},e.prototype.composeLens=function(t){return this.compose(t.asSetter())},e.prototype.composePrism=function(t){return this.compose(t.asSetter())},e.prototype.composeIso=function(t){return this.compose(t.asSetter())},e}(),X_e=new UK(Oc,Oc);function Q_e(){return X_e}function eSe(e,t){t===void 0&&(t="fromNewtype("+e.name+")");var n=Q_e();return new Te(t,function(r){return e.is(r)},function(r,i){return de(e.validate(r,i),us(n.wrap))},function(r){return e.encode(n.unwrap(r))})}var tSe=Gp({_tag:Vp("None")}),nSe=Vp("Some");function VK(e,t){return t===void 0&&(t="Option<"+e.name+">"),Hp([tSe,Gp({_tag:nSe,value:e},"Some<"+e.name+">")],t)}function rSe(e,t){return t===void 0&&(t="Option<"+e.name+">"),new Te(t,VK(e).is,function(n,r){return n==null?Ee(at):de(e.validate(n,r),us(_t))},function(n){return Q$(de(n,Yi(e.encode)))})}var iSe=new Te("DateFromISOString",function(e){return e instanceof Date},function(e,t){return de(Oi.validate(e,t),Lr(function(n){var r=new Date(n);return isNaN(r.getTime())?tt(e,t):Ee(r)}))},function(e){return e.toISOString()});function oSe(e,t){return t===void 0&&(t="ReadonlyNonEmptyArray<"+e.name+">"),$K(e,t)}function HK(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}var aSe=new Te("DateFromNumber",function(e){return e instanceof Date},function(e,t){return de(Ws.validate(e,t),Lr(function(n){var r=new Date(n);return isNaN(r.getTime())?tt(e,t):Ee(r)}))},function(e){return e.getTime()});function Fy(e,t,n){n===void 0&&(n=e.name);var r=HK(e);return r.validate=t,r.decode=function(i){return t(i,_2(r))},r.name=n,r}function uSe(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),Fy(e,function(r,i){return ZN(function(){return Ee(t)})(e.validate(r,i))},n)}var sSe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,cSe=my(Oi,function(e){return sSe.test(e)},"UUID");function lSe(e,t,n){return n===void 0&&(n="fromNullable("+e.name+")"),Fy(e,function(r,i){return r==null?Ee(t):e.validate(r,i)},n)}var fSe=new Te("BooleanFromString",hy.is,function(e,t){return de(Oi.validate(e,t),Lr(function(n){return n==="true"?Ee(!0):n==="false"?Ee(!1):tt(e,t)}))},String);function dSe(e,t){return Fy(e,function(n,r){return Wd(function(){return[{value:n,context:r,message:t(n,r),actual:n}]})(e.validate(n,r))})}function GK(e){switch(e._tag){case"InterfaceType":return e.props;case"ExactType":return GK(e.type)}}var pSe=yC.fromProp();function hSe(e){var t={};for(var n in GK(e))t[n]=pSe(n);return t}var mSe=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},vSe=iC("RegExp",mSe),gSe=new Te("DateFromUnixTime",function(e){return e instanceof Date},function(e,t){return de(vy.validate(e,t),Lr(function(n){var r=new Date(n*1e3);return isNaN(r.getTime())?tt(e,t):Ee(r)}))},function(e){return Math.floor(e.getTime()/1e3)}),bC=new Te("NumberFromString",Ws.is,function(e,t){return de(Oi.validate(e,t),Lr(function(n){var r=+n;return isNaN(r)||n.trim()===""?tt(e,t):Ee(r)}))},String),ySe=new Te("IntFromString",vy.is,function(e,t){return de(bC.validate(e,t),Lr(function(n){return vy.is(n)?Ee(n):tt(e,t)}))},bC.encode),YK=ew("JsonArray",function(){return v2(Py)}),JK=ew("JsonRecord",function(){return rw(Oi,Py)}),Py=Hp([hy,Ws,Oi,XO,YK,JK],"Json"),bSe=new Te("JsonFromString",Py.is,function(e,t){try{return Ee(JSON.parse(e))}catch{return tt(e,t)}},function(e){return JSON.stringify(e)}),_Se=Vp("Left"),SSe=Vp("Right");function $Se(e,t,n){return n===void 0&&(n="Either<"+e.name+", "+t.name+">"),Hp([Gp({_tag:_Se,left:e},"Left<"+e.name+">"),Gp({_tag:SSe,right:t},"Right<"+e.name+">")],n)}var TSe=new Te("BigIntFromString",function(e){return typeof e=="bigint"},function(e,t){return de(Oi.validate(e,t),Lr(function(n){if(!SK.is(n.trim()))return tt(e,t);try{return Ee(BigInt(n))}catch{return tt(e,t)}}))},String);function ISe(e,t,n){return n===void 0&&(n=e.name),new Te(n,e.is,e.validate,t)}var OSe=new Te("BooleanFromNumber",hy.is,function(e,t){return de(Ws.validate(e,t),us(function(n){return n!==0}))},Number);const ZK=Ic(Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:TSe,BooleanFromNumber:OSe,BooleanFromString:fSe,DateFromISOString:iSe,DateFromNumber:aSe,DateFromUnixTime:gSe,IntFromString:ySe,Json:Py,JsonArray:YK,JsonFromString:bSe,JsonRecord:JK,NonEmptyString:SK,NumberFromString:bC,UUID:cSe,clone:HK,date:jbe,either:$Se,fromNewtype:eSe,fromNullable:lSe,fromRefinement:iC,getLenses:hSe,mapOutput:I2,nonEmptyArray:$K,option:VK,optionFromNullable:rSe,readonlyNonEmptyArray:oSe,readonlySetFromArray:Pbe,regexp:vSe,setFromArray:TK,withEncode:ISe,withFallback:uSe,withMessage:dSe,withValidate:Fy},Symbol.toStringTag,{value:"Module"})));var XK;function _C(){return XK||(XK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkContent=e.Link=e.LinkContentLegacy=e.LinkLegacy=e.isLinkContent=e.LinkContentType=e.ExternalLinkContent=e.ExternalLinkType=e.DocumentLinkContent=e.DocumentLinkType=e.FileLinkContent=e.FileLinkType=e.ImageLinkContent=e.ImageLinkType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=ZK,a=vt(),u=au(),s=Nt();e.ImageLinkType="ImageLink";const c=i.exact(i.intersection([i.type({id:i.string,url:i.string,height:i.string,width:i.string,size:i.string,name:i.string,kind:i.string}),i.partial({date:a.StringOrNull})])),l=new i.Type("ImageLink",S=>(0,s.hasContentType)(S)&&S.__TYPE__===e.ImageLinkType,S=>(0,r.pipe)(c.decode(S),n.either.map(b=>e.ImageLinkContent.encode({...b,__TYPE__:e.ImageLinkType}))),S=>c.encode(S));e.ImageLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ImageLinkType)}),c]),e.FileLinkType="FileLink";const f=i.exact(i.intersection([i.type({id:i.string,url:i.string,name:i.string,kind:i.string,size:(0,o.withFallback)(i.string,"0")}),i.partial({date:(0,u.nullable)(i.string)})])),d=new i.Type("FileLink",S=>(0,s.hasContentType)(S)&&S.__TYPE__===e.FileLinkType,S=>(0,r.pipe)(f.decode(S),n.either.map(b=>e.FileLinkContent.encode({...b,__TYPE__:e.FileLinkType}))),S=>f.encode(S));e.FileLinkContent=i.intersection([f,i.exact(i.intersection([i.type({__TYPE__:i.literal(e.FileLinkType)}),i.partial({size:(0,o.withFallback)(i.string,"0")})]))]),e.DocumentLinkType="DocumentLink";const p=i.strict({id:a.NonEmptyString}),h=new i.Type("DocumentLink",S=>(0,s.hasContentType)(S)&&S.__TYPE__===e.DocumentLinkType,S=>(0,r.pipe)(p.decode(S),n.either.map(b=>e.DocumentLinkContent.encode({...b,__TYPE__:e.DocumentLinkType}))),S=>p.encode(S));e.DocumentLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.DocumentLinkType)}),p]),e.ExternalLinkType="ExternalLink";const v=i.exact(i.intersection([i.type({url:i.string}),i.partial({kind:i.literal("web"),target:a.StringOrNull,preview:(0,u.nullable)(i.partial({title:i.string}))})])),m=new i.Type("ExternalLink",S=>(0,s.hasContentType)(S)&&S.__TYPE__===e.ExternalLinkType,S=>(0,r.pipe)(v.decode(S),n.either.map(b=>e.ExternalLinkContent.encode({...b,__TYPE__:e.ExternalLinkType}))),S=>v.encode(S));e.ExternalLinkContent=i.intersection([i.strict({__TYPE__:i.literal(e.ExternalLinkType)}),v]),e.LinkContentType="LinkContent";const _=S=>(0,s.hasContentType)(S)&&S.__TYPE__===e.LinkContentType;e.isLinkContent=_,e.LinkLegacy=i.union([l,d,h,m]);const g=S=>new i.Type("LinkLegacy",e.isLinkContent,b=>(0,r.pipe)(e.LinkLegacy.decode(b),n.either.map($=>e.LinkContent.encode({value:$,__TYPE__:e.LinkContentType}))),b=>({content:e.LinkLegacy.encode(b.value),types:{[S.keyOfType]:"Link"}}));e.LinkContentLegacy=g,e.Link=i.union([e.ImageLinkContent,e.FileLinkContent,e.DocumentLinkContent,e.ExternalLinkContent]),e.LinkContent=i.strict({__TYPE__:i.literal(e.LinkContentType),value:e.Link})}(rC)),rC}var da={},SC={},QK;function wSe(){return QK||(QK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyContent=e.EmptyLegacy=e.isEmptyContent=e.EmptyContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=Nt();e.EmptyContentType="EmptyContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.EmptyContentType;e.isEmptyContent=a;const u=i.union([i.null,i.type({value:i.null})]),s=c=>new i.Type("EmptyLegacy",e.isEmptyContent,l=>(0,r.pipe)(u.decode(l),n.either.map(()=>({type:c,__TYPE__:e.EmptyContentType}))),()=>null);e.EmptyLegacy=s,e.EmptyContent=i.strict({type:i.string,__TYPE__:i.literal(e.EmptyContentType)})}(SC)),SC}var $C={},TC={},eV;function tV(){return eV||(eV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Block=e.BlockLegacy=e.TextBlock=e.checkEmbedBlock=e.EmbedBlock=e.checkImageBlock=e.ImageBlock=e.ValidatedMetas=e.Span=e.Meta=void 0;const t=H,n=mt,r=Ln(),i=Qe(),o=t.__importStar(ee),a=kw(),u=vt(),s=au(),c=zw(),l=tC(),f=_C();e.Meta=o.exact(o.intersection([o.partial({data:o.unknown}),o.type({start:o.number,end:o.number,type:o.union([a.RichTextNodeTypeCodec,o.literal("label")])})])),e.Span=e.Meta;const d=b=>new o.Type("ValidatedMetas",$=>Array.isArray($)&&$.every(e.Meta.is),($,T)=>{if(Array.isArray($)){const M=$.reduce((R,q)=>{const Y=e.Meta.decode(q);if((0,r.isRight)(Y)){const N=Y.right;if(N.data&&N.type==="hyperlink"){const Z=b.decode(N.data);return(0,r.isLeft)(Z)?R:[...R,{...N,data:Z.right}]}else if(N.type!=="hyperlink")return[...R,N]}return R},[]).sort((R,q)=>R.start-q.start);return o.success(M)}else return o.failure($,T)},$=>$.reduce((T,M)=>{if(M.type==="hyperlink"&&M.data){const R=b.decode(M.data);return(0,r.isLeft)(R)?T:[...T,{...M,data:b.encode(R.right)}]}return[...T,e.Meta.encode(M)]},[]));e.ValidatedMetas=d,e.ImageBlock=o.exact(o.intersection([o.type({type:o.literal(a.RichTextNodeType.image),data:o.intersection([l.ImageContentView,o.partial({linkTo:(0,s.nullable)(f.Link)})])}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})]));function p(b){return b.type===a.RichTextNodeType.image}e.checkImageBlock=p;const h=o.exact(o.intersection([o.type({type:o.literal(a.RichTextNodeType.embed),data:o.unknown}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})])),v=new o.Type("EmbedBlockLegacy",b=>b.type==="embed",b=>(0,i.pipe)(h.decode(b),n.either.chain($=>n.either.map(T=>[$,T])(c.EmbedContentLegacy.decode($.data))),n.either.map(([$,T])=>e.EmbedBlock.encode({...$,data:{...T,__TYPE__:c.EmbedContentType,all:$.data}}))),b=>({...h.encode(b),data:c.EmbedContentLegacy.encode(b.data)}));e.EmbedBlock=o.exact(o.intersection([o.type({type:o.literal(a.RichTextNodeType.embed),data:c.EmbedContent}),o.partial({label:u.StringOrNull,direction:u.StringOrNull})]));function m(b){return b.type===a.RichTextNodeType.embed}e.checkEmbedBlock=m;const _=b=>o.exact(o.intersection([o.type({type:(0,s.refineType)(a.RichTextNodeTypeCodec,`string which isn't ${a.RichTextNodeType.image} ${a.RichTextNodeType.embed}`,$=>$!==a.RichTextNodeType.image&&$!==a.RichTextNodeType.embed),content:o.intersection([o.type({text:o.string}),o.partial({spans:(0,e.ValidatedMetas)(b)})])}),o.partial({label:o.string,direction:o.string})]));e.TextBlock=_(f.Link);const g=_(f.LinkLegacy),S=o.union([v,e.ImageBlock,g]);e.BlockLegacy=new o.Type("BlockLegacy",b=>v.is(b)||e.ImageBlock.is(b)||g.is(b),b=>S.decode(b),b=>e.ImageBlock.is(b)?e.ImageBlock.encode(b):e.EmbedBlock.is(b)?v.encode(b):g.encode(b)),e.Block=o.union([e.ImageBlock,e.EmbedBlock,e.TextBlock])}(TC)),TC}var nV;function rV(){return nV||(nV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichTextLegacy=e.RichTextContent=e.isRichTextContent=e.RichTextContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=Nt(),a=tV();e.RichTextContentType="StructuredTextContent";const u=l=>(0,o.hasContentType)(l)&&l.__TYPE__===e.RichTextContentType;e.isRichTextContent=u;const s=i.array(a.BlockLegacy);e.RichTextContent=i.strict({__TYPE__:i.literal(e.RichTextContentType),value:i.array(a.Block)}),t.__exportStar(tV(),e);const c=l=>new i.Type("RichTextLegacy",e.isRichTextContent,f=>(0,r.pipe)(s.decode(f),n.either.map(d=>e.RichTextContent.encode({value:d,__TYPE__:e.RichTextContentType}))),f=>({content:s.encode(f.value),types:{[l.keyOfType]:"StructuredText"}}));e.RichTextLegacy=c}($C)),$C}var IC={},iV;function oV(){return iV||(iV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SeparatorContent=e.SeparatorLegacy=e.isSeparatorContent=e.SeparatorContentType=void 0;const n=H.__importStar(ee),r=Nt();e.SeparatorContentType="SeparatorContent";const i=a=>(0,r.hasContentType)(a)&&a.__TYPE__===e.SeparatorContentType;e.isSeparatorContent=i;const o=a=>new n.Type("SeparatorLegacy",e.isSeparatorContent,()=>n.success(e.SeparatorContent.encode({__TYPE__:e.SeparatorContentType})),()=>({content:{},types:{[a.keyOfType]:"Separator"}}));e.SeparatorLegacy=o,e.SeparatorContent=n.strict({__TYPE__:n.literal(e.SeparatorContentType)})}(IC)),IC}var aV;function CSe(){if(aV)return da;aV=1,Object.defineProperty(da,"__esModule",{value:!0}),da.NestableLegacy=da.isNestableContent=da.NestableContent=void 0;const e=H,t=Ln(),n=e.__importStar(ee),r=wSe(),i=Gz(),o=zw(),a=pK(),u=sa(),s=mK(),c=tC(),l=_K(),f=_C(),d=rV(),p=oV();da.NestableContent=n.union([r.EmptyContent,i.BooleanContent,o.EmbedContent,a.TextContent,a.TimestampContent,a.SelectContent,a.RangeContent,a.NumberContent,a.DateContent,a.ColorContent,s.GeoPointContent,c.ImageContent,l.IntegrationFieldContent,f.LinkContent,d.RichTextContent,p.SeparatorContent]);const h=m=>(0,a.isTextContent)(m)||(0,a.isColorContent)(m)||(0,a.isDateContent)(m)||(0,a.isTimestampContent)(m)||(0,a.isNumberContent)(m)||(0,a.isRangeContent)(m)||(0,a.isSelectContent)(m)||(0,s.isGeoPointContent)(m)||(0,d.isRichTextContent)(m)||(0,i.isBooleanContent)(m)||(0,o.isEmbedContent)(m)||(0,c.isImageContent)(m)||(0,l.isIntegrationFieldContent)(m)||(0,f.isLinkContent)(m)||(0,p.isSeparatorContent)(m);da.isNestableContent=h;const v=m=>({decode(_){if(!m.fieldType)return;const g=(0,r.EmptyLegacy)(m.fieldType).decode(_);if((0,t.isRight)(g))return g;const S=(()=>{switch(m.fieldType){case"Text":return(0,a.TextLegacy)(m);case"Color":return(0,a.ColorLegacy)(m);case"Date":return(0,a.DateLegacy)(m);case"Timestamp":return(0,a.TimestampLegacy)(m);case"Number":return(0,a.NumberLegacy)(m);case"Range":return(0,a.RangeLegacy)(m);case"Select":return(0,a.SelectLegacy)(m);case"GeoPoint":return(0,s.GeoPointLegacy)(m);case"StructuredText":return(0,d.RichTextLegacy)(m);case"Boolean":return(0,i.BooleanLegacy)(m);case"Embed":return(0,o.EmbedLegacy)(m);case"Image":return(0,c.ImageLegacy)(m);case"IntegrationFields":return(0,l.IntegrationFieldLegacy)(m);case"Link":return(0,f.LinkContentLegacy)(m);case"Separator":return(0,p.SeparatorLegacy)(m);default:return}})();if(S)return S.decode(_)},encode(_){switch(_.__TYPE__){case u.FieldContentType:return _.type==="Text"?(0,a.TextLegacy)(m).encode(_):_.type==="Color"?(0,a.ColorLegacy)(m).encode(_):_.type==="Range"?(0,a.RangeLegacy)(m).encode(_):_.type==="Date"?(0,a.DateLegacy)(m).encode(_):_.type==="Number"?(0,a.NumberLegacy)(m).encode(_):_.type==="Timestamp"?(0,a.TimestampLegacy)(m).encode(_):_.type==="Select"?(0,a.SelectLegacy)(m).encode(_):void 0;case s.GeoPointContentType:return(0,s.GeoPointLegacy)(m).encode(_);case d.RichTextContentType:return(0,d.RichTextLegacy)(m).encode(_);case o.EmbedContentType:return(0,o.EmbedLegacy)(m).encode(_);case i.BooleanContentType:return(0,i.BooleanLegacy)(m).encode(_);case c.ImageContentType:return(0,c.ImageLegacy)(m).encode(_);case l.IntegrationFieldContentType:return(0,l.IntegrationFieldLegacy)(m).encode(_);case f.LinkContentType:return(0,f.LinkContentLegacy)(m).encode(_);case p.SeparatorContentType:return(0,p.SeparatorLegacy)(m).encode(_);default:return}}});return da.NestableLegacy=v,da}var uV;function Vs(){return uV||(uV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(Gz(),e),t.__exportStar(zw(),e),t.__exportStar(pK(),e),t.__exportStar(mK(),e),t.__exportStar(tC(),e),t.__exportStar(_K(),e),t.__exportStar(_C(),e),t.__exportStar(CSe(),e),t.__exportStar(rV(),e),t.__exportStar(oV(),e)}(qw)),qw}var sV;function Wy(){return sV||(sV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GroupContent=e.isGroupContent=e.GroupContentType=e.GroupLegacy=e.GroupItemLegacy=e.GroupItemContent=e.GroupItemContentType=void 0;const t=H,n=mt,r=Ln(),i=Qe(),o=t.__importStar(ee),a=tf(),u=Nt(),s=Vs();e.GroupItemContentType="GroupItemContent",e.GroupItemContent=o.strict({__TYPE__:o.literal(e.GroupItemContentType),value:o.array(o.tuple([o.string,s.NestableContent]))});const c=o.array(o.tuple([o.string,o.unknown])),l=p=>new o.Type("GroupItemLegacy",h=>(0,u.hasContentType)(h)&&h.__TYPE__===e.GroupItemContentType,h=>(0,i.pipe)(c.decode(h),n.either.map(m=>({value:m.reduce((g,[S,b])=>{const $=(0,a.getFieldCtx)(S,p),T=(0,s.NestableLegacy)($).decode(b);return!T||(0,r.isLeft)(T)?g:[...g,[S,T.right]]},[]),__TYPE__:e.GroupItemContentType}))),h=>h.value.reduce((v,[m,_])=>{const g=(0,a.getFieldCtx)(m,p),S=(0,s.NestableLegacy)(g).encode(_);return S?{content:[...v.content,[m,S.content]],types:{...v.types,...S.types}}:v},{content:[],types:{}}));e.GroupItemLegacy=l;const f=p=>{const h=o.array((0,e.GroupItemLegacy)(p));return new o.Type("GroupLegacy",e.isGroupContent,v=>(0,i.pipe)(h.decode(v),n.either.map(m=>({value:m,__TYPE__:e.GroupContentType}))),v=>{const m=h.encode(v.value);return{content:m.map(_=>_.content),types:m.reduce((_,g)=>({..._,...g.types}),{[p.keyOfType]:"Group"})}})};e.GroupLegacy=f,e.GroupContentType="GroupContentType";const d=p=>(0,u.hasContentType)(p)&&p.__TYPE__===e.GroupContentType;e.isGroupContent=d,e.GroupContent=o.strict({__TYPE__:o.literal(e.GroupContentType),value:o.array(e.GroupItemContent)})}(sw)),sw}var OC={},wC={},CC={},Hs={},cV;function lV(){if(cV)return Hs;cV=1,Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.RepeatableWidgets=Hs.RepeatableWidgetsLegacy=void 0;const t=H.__importStar(ee),n=Wy(),r=Vs(),i=u=>t.array((0,n.GroupItemLegacy)(u));Hs.RepeatableWidgetsLegacy=i;const o=t.tuple([t.string,r.NestableContent]),a=t.strict({__TYPE__:t.literal(n.GroupItemContentType),value:t.array(o)});return t.array(o),Hs.RepeatableWidgets=t.array(a),Hs}var fV;function EC(){return fV||(fV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CompositeSliceContent=e.CompositeSliceLegacy=e.isCompositeSliceContent=e.CompositeSliceContentType=void 0;const t=H,n=mt,r=Ln(),i=Qe(),o=t.__importStar(ee),a=tf(),u=Nt(),s=Vs(),c=lV();e.CompositeSliceContentType="CompositeSliceContent";const l=p=>(0,u.hasContentType)(p)&&p.__TYPE__===e.CompositeSliceContentType;e.isCompositeSliceContent=l;const f=o.exact(o.partial({repeat:o.array(o.unknown),"non-repeat":o.UnknownRecord})),d=p=>new o.Type("CompositeSliceLegacy",e.isCompositeSliceContent,h=>(0,i.pipe)(f.decode(h),n.either.map(v=>{const m=(()=>{const g=(0,a.getFieldCtx)("repeat",p),S=(0,c.RepeatableWidgetsLegacy)(g).decode(v.repeat);if(!(!S||(0,r.isLeft)(S)))return S.right})()||[];return{nonRepeat:Object.entries(v["non-repeat"]||{}).reduce((g,[S,b])=>{const $=(0,a.getFieldCtx)(S,p,["non-repeat"]);if(!$)return g;const T=(0,s.NestableLegacy)($).decode(b);return!T||(0,r.isLeft)(T)?g:{...g,[S]:T.right}},{}),repeat:m,__TYPE__:e.CompositeSliceContentType}})),h=>{const v=Object.entries(h.nonRepeat).reduce((_,[g,S])=>{const b=(0,a.getFieldCtx)(g,p,["non-repeat"]),$=(0,s.NestableLegacy)(b).encode(S);return $?{content:{..._.content,[g]:$.content},types:{..._.types,...$.types}}:_},{content:{},types:{}}),m=(()=>{const _=(0,a.getFieldCtx)("repeat",p);return(0,c.RepeatableWidgetsLegacy)(_).encode(h.repeat)})()||[];return{content:{"non-repeat":v.content,repeat:m.map(_=>_.content)},types:{[p.keyOfType]:"Slice",...v.types,...m.reduce((_,g)=>({..._,...g.types}),{})}}});e.CompositeSliceLegacy=d,e.CompositeSliceContent=o.strict({__TYPE__:o.literal(e.CompositeSliceContentType),nonRepeat:o.record(o.string,s.NestableContent),repeat:c.RepeatableWidgets})}(CC)),CC}var RC={},dV;function MC(){return dV||(dV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SharedSliceContent=e.SharedSliceLegacy=e.isSharedSliceContent=e.SharedSliceContentType=void 0;const t=H,n=mt,r=Ln(),i=Qe(),o=t.__importStar(ee),a=ZK,u=tf(),s=Nt(),c=Vs(),l=lV();e.SharedSliceContentType="SharedSliceContent";const f=h=>(0,s.hasContentType)(h)&&h.__TYPE__===e.SharedSliceContentType;e.isSharedSliceContent=f;const d=o.exact(o.type({variation:o.string,items:(0,a.withFallback)(o.array(o.unknown),[]),primary:(0,a.withFallback)(o.UnknownRecord,{})})),p=h=>new o.Type("SharedSliceLegacy",e.isSharedSliceContent,v=>(0,i.pipe)(d.decode(v),n.either.map(m=>{const _=(()=>{const S=(0,u.getFieldCtx)("items",h,["variations",m.variation]),b=(0,l.RepeatableWidgetsLegacy)(S).decode(m.items);if(!(!b||(0,r.isLeft)(b)))return b.right})()||[],g=Object.entries(m.primary).reduce((S,[b,$])=>{const T=(0,u.getFieldCtx)(b,h,["variations",m.variation,"primary"]),M=(0,c.NestableLegacy)(T).decode($);return!M||(0,r.isLeft)(M)?S:{...S,[b]:M.right}},{});return{variation:m.variation,primary:g,items:_,__TYPE__:e.SharedSliceContentType}})),v=>{const m=Object.entries(v.primary).reduce((g,[S,b])=>{const $=(0,u.getFieldCtx)(S,h,["variations",v.variation,"primary"]),T=(0,c.NestableLegacy)($).encode(b);return T?{content:{...g.content,[S]:T.content},types:{...g.types,...T.types}}:g},{content:{},types:{}}),_=(()=>{const g=(0,u.getFieldCtx)("items",h,["variations",v.variation]);return(0,l.RepeatableWidgetsLegacy)(g).encode(v.items)})()||[];return{content:{primary:m.content,items:_.map(g=>g.content),variation:v.variation},types:{[h.keyOfType]:"SharedSlice",...m.types,..._.reduce((g,S)=>({...g,...S.types}),{})}}});e.SharedSliceLegacy=p,e.SharedSliceContent=o.strict({__TYPE__:o.literal(e.SharedSliceContentType),variation:o.string,primary:o.record(o.string,c.NestableContent),items:l.RepeatableWidgets})}(RC)),RC}var pa={},pV;function xC(){if(pV)return pa;pV=1,Object.defineProperty(pa,"__esModule",{value:!0}),pa.SimpleSliceLegacy=pa.isSimpleSliceContent=pa.SimpleSliceContent=void 0;const t=H.__importStar(ee),n=Wy(),r=Vs();pa.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);const i=a=>(0,r.isNestableContent)(a)||(0,n.isGroupContent)(a);pa.isSimpleSliceContent=i;const o=a=>({decode:((0,r.NestableLegacy)(a)||(0,n.GroupLegacy)(a)).decode.bind(null),encode:u=>{switch(u.__TYPE__){case"GroupContentType":return(0,n.GroupLegacy)(a).encode(u);default:return(0,r.NestableLegacy)(a).encode(u)}}});return pa.SimpleSliceLegacy=o,pa}var hV;function mV(){return hV||(hV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SliceContent=e.SliceLegacy=void 0;const t=H,n=t.__importStar(ee),r=EC(),i=MC(),o=xC(),a=u=>({decode:s=>(()=>{switch(u.fieldType){case"Slice":return(0,r.CompositeSliceLegacy)(u);case"SharedSlice":return(0,i.SharedSliceLegacy)(u);default:return(0,o.SimpleSliceLegacy)(u)}})().decode(s),encode:s=>{switch(s.__TYPE__){case"SharedSliceContent":return(0,i.SharedSliceLegacy)(u).encode(s);case"CompositeSliceContent":return(0,r.CompositeSliceLegacy)(u).encode(s);default:return(0,o.SimpleSliceLegacy)(u).encode(s)}}});e.SliceLegacy=a,e.SliceContent=n.union([r.CompositeSliceContent,i.SharedSliceContent,o.SimpleSliceContent]),t.__exportStar(EC(),e),t.__exportStar(MC(),e),t.__exportStar(xC(),e)}(wC)),wC}var Gs={},vV;function gV(){if(vV)return Gs;vV=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.SlicesItemLegacy=Gs.SliceItemContent=void 0;const e=H,t=mt,n=Ln(),r=Qe(),i=e.__importStar(ee),o=au(),a=tf(),u=mV(),s=EC(),c=MC(),l=xC();Gs.SliceItemContent=i.type({key:i.string,name:i.string,maybeLabel:i.union([i.string,i.undefined]),widget:u.SliceContent});const f=i.exact(i.intersection([i.type({key:i.string,value:i.unknown}),i.partial({label:(0,o.nullable)(i.string)})])),d=p=>new i.Type("SlicesItemLegacy",h=>((0,c.isSharedSliceContent)(h.widget),(0,s.isCompositeSliceContent)(h.widget),(0,l.isSimpleSliceContent)(h.widget)),(h,v)=>(0,r.pipe)(f.decode(h),t.either.chain(m=>{var _;const g=m.key.indexOf("$"),S=m.key.substring(0,g>0?g:void 0),b=(0,a.getFieldCtx)(S,p),$=(0,u.SliceLegacy)(b).decode(m.value);return!$||(0,n.isLeft)($)?i.failure(h,v):i.success({key:m.key,name:S,maybeLabel:(_=m.label)!==null&&_!==void 0?_:void 0,widget:$.right})})),h=>{const v=(0,a.getFieldCtx)(h.name,p),m=(0,u.SliceLegacy)(v).encode(h.widget);return{content:{key:h.key,label:h.maybeLabel,value:(m==null?void 0:m.content)||{}},types:(m==null?void 0:m.types)||{}}});return Gs.SlicesItemLegacy=d,Gs}var kC={},yV;function ESe(){return yV||(yV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SlicesContent=e.SlicesLegacy=e.isSlicesContent=e.SlicesContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=Nt(),a=gV();e.SlicesContentType="SliceContentType";const u=c=>(0,o.hasContentType)(c)&&c.__TYPE__===e.SlicesContentType;e.isSlicesContent=u;const s=c=>{const l=i.array((0,a.SlicesItemLegacy)(c));return new i.Type("SlicesLegacy",e.isSlicesContent,f=>(0,r.pipe)(l.decode(f),n.either.map(d=>({__TYPE__:e.SlicesContentType,value:d}))),f=>{const d=l.encode(f.value);return{content:d.map(p=>p.content),types:d.reduce((p,h)=>({...p,...h.types}),{[c.keyOfType]:"Slices"})}})};e.SlicesLegacy=s,e.SlicesContent=i.type({__TYPE__:i.literal(e.SlicesContentType),value:i.array(a.SliceItemContent)})}(kC)),kC}var bV;function _V(){return bV||(bV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(mV(),e),t.__exportStar(gV(),e),t.__exportStar(ESe(),e)}(OC)),OC}var AC={},SV;function $V(){return SV||(SV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UIDContent=e.UIDLegacy=e.isUIDContent=e.UIDContentType=void 0;const t=H,n=mt,r=Qe(),i=t.__importStar(ee),o=Nt();e.UIDContentType="UIDContent";const a=s=>(0,o.hasContentType)(s)&&s.__TYPE__===e.UIDContentType;e.isUIDContent=a;const u=s=>new i.Type("UIDLegacy",e.isUIDContent,c=>(0,r.pipe)(i.string.decode(c),n.either.map(l=>e.UIDContent.encode({value:l,__TYPE__:e.UIDContentType}))),c=>({content:c.value,types:{[s.keyOfType]:"UID"}}));e.UIDLegacy=u,e.UIDContent=i.type({__TYPE__:i.literal(e.UIDContentType),value:i.string})}(AC)),AC}var ha={},TV;function RSe(){if(TV)return ha;TV=1,Object.defineProperty(ha,"__esModule",{value:!0}),ha.WidgetLegacy=ha.isWidgetContent=ha.WidgetContent=void 0;const t=H.__importStar(ee),n=Wy(),r=Vs(),i=_V(),o=$V();ha.WidgetContent=t.union([n.GroupContent,r.NestableContent,o.UIDContent,i.SlicesContent]);const a=s=>(0,n.isGroupContent)(s)||(0,r.isNestableContent)(s)||(0,o.isUIDContent)(s)||(0,i.isSlicesContent)(s);ha.isWidgetContent=a;const u=s=>({decode(c){if(!s.fieldType)return;const l=(()=>{switch(s.fieldType){case"UID":return(0,o.UIDLegacy)(s);case"Group":return(0,n.GroupLegacy)(s);case"Choice":case"Slices":return(0,i.SlicesLegacy)(s);default:return(0,r.NestableLegacy)(s)}})();if(l)return l.decode(c)},encode(c){switch(c.__TYPE__){case o.UIDContentType:return(0,o.UIDLegacy)(s).encode(c);case n.GroupContentType:return(0,n.GroupLegacy)(s).encode(c);case i.SlicesContentType:return(0,i.SlicesLegacy)(s).encode(c);default:return(0,r.NestableLegacy)(s).encode(c)}}});return ha.WidgetLegacy=u,ha}var IV;function NC(){return IV||(IV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(Wy(),e),t.__exportStar(Vs(),e),t.__exportStar(_V(),e),t.__exportStar($V(),e),t.__exportStar(RSe(),e)}(uw)),uw}var OV;function MSe(){if(OV)return Hu;OV=1,Object.defineProperty(Hu,"__esModule",{value:!0}),Hu.DocumentLegacy=Hu.Document=void 0;const e=H,t=mt,n=Ln(),r=Qe(),i=e.__importStar(ee),o=Ql(),a=NC(),u=tf();Hu.Document=i.record(o.WidgetKey,a.WidgetContent);const s=i.record(o.WidgetKey,i.unknown),c=p=>new i.Type("Document",h=>!!h&&typeof h=="object",h=>(0,r.pipe)(s.decode(h),t.either.map(v=>Object.entries(v).reduce((m,[_,g])=>{const S=(0,u.defaultCtx)(_,p),b=(0,a.WidgetLegacy)(S).decode(g);return!b||(0,n.isLeft)(b)?m:{...m,[_]:b.right}},{}))),h=>Object.entries(h).reduce((v,[m,_])=>{const g=(0,u.defaultCtx)(m,p),S=(0,a.WidgetLegacy)(g).encode(_);return S?{content:{...v.content,[m]:S.content},types:{...v.types,...S.types}}:v},{content:{},types:{}}));function l(p){const h=Object.entries(p),{types:v,widgets:m}=h.reduce((S,[b,$])=>{if(b.endsWith("_TYPE")){const T=u.FieldOrSliceType.decode($);if((0,n.isRight)(T))return{...S,types:S.types.set(b.substring(0,b.length-5),T.right)}}return!b.endsWith("_POSITION")&&!b.endsWith("_TYPE")?{...S,widgets:{...S.widgets,[b]:$}}:S},{types:new Map,widgets:{}}),_=p.slugs_INTERNAL||[],g=p.uid;return{widgets:m,types:v,uid:g,slugs:_}}function f(p){const h=(0,r.pipe)(i.record(o.WidgetKey,i.unknown).decode(p),t.either.chain(v=>{const{types:m,widgets:_}=l(v);return c(m).decode(_)}));return(0,n.isLeft)(h)?void 0:h.right}function d(p){const h=c().encode(p);return{...h.content,...h.types}}return Hu.DocumentLegacy={_codec:c,extractMetadata:l,parse:f,encode:d},Hu}(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(MSe(),e),t.__exportStar(NC(),e),t.__exportStar(tf(),e)})(ot);function wr(e){var t;return((t=e.config)==null?void 0:t.label)??(e.type==="Boolean"||e.type==="Separator"?void 0:e.fieldset)??e.type}const wV="...";function cu(e,t){var n,r,i;return e.type==="Boolean"?(t?(n=e.config)==null?void 0:n.placeholder_true:(r=e.config)==null?void 0:r.placeholder_false)??wV:e.type==="GeoPoint"?"TODO":((i=e.config)==null?void 0:i.placeholder)??wV}const xSe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var a;const o=(e==null?void 0:e.value)??((a=t.config)==null?void 0:a.default_value)??!1;return I.jsxs(E.Field,{children:[I.jsx(E.FieldIcon,{children:I.jsx(E.Icon,{name:"toggleOff"})}),I.jsx(E.FieldLabel,{htmlFor:n,children:wr(t)}),I.jsxs(E.FieldControl,{children:[I.jsx(E.Text,{children:cu(t,o)}),I.jsx(E.Switch,{checked:o,id:n,onCheckedChange:u=>{i||r(kSe(u))}})]})]})};function kSe(e){return{__TYPE__:"BooleanContent",value:e}}const ASe=e=>e===void 0?void 0:{__TYPE__:"FieldContent",type:"Color",value:e},NSe=({id:e,field:t,content:n,onContentChange:r})=>I.jsxs(E.Field,{children:[I.jsx(E.FieldIcon,{children:I.jsx(E.Icon,{name:"colorLens"})}),I.jsx(E.FieldLabel,{id:e,children:wr(t)}),I.jsx(E.FieldControl,{children:I.jsx(I.Fragment,{children:I.jsx(E.Box,{padding:{left:4},alignItems:"center",children:I.jsx(E.ColorInput,{onValueChange:i=>r(ASe(i)),value:n==null?void 0:n.value,"aria-labelledby":e,placeholder:cu(t)})})})})]}),FSe=e=>e===void 0?void 0:{__TYPE__:"FieldContent",type:"Date",value:e},PSe=({id:e,readOnly:t,field:n,content:r,onContentChange:i})=>I.jsxs(E.Field,{children:[I.jsx(E.FieldIcon,{children:I.jsx(E.Icon,{name:"dateRange"})}),I.jsx(E.FieldLabel,{id:e,children:wr(n)}),I.jsx(E.FieldControl,{children:I.jsx(I.Fragment,{children:I.jsx(E.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:I.jsx(E.DateInput,{mode:"date","aria-labelledby":e,readOnly:t,value:r==null?void 0:r.value,onValueChange:o=>i(FSe(o))})})})})]});var Je;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),a={};for(const u of o)a[u]=i[u];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Je||(Je={}));var FC;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(FC||(FC={}));const oe=Je.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),lu=e=>{switch(typeof e){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(e)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(e)?oe.array:e===null?oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?oe.promise:typeof Map<"u"&&e instanceof Map?oe.map:typeof Set<"u"&&e instanceof Set?oe.set:typeof Date<"u"&&e instanceof Date?oe.date:oe.object;default:return oe.unknown}},G=Je.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"]),WSe=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Ei extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const 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){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let u=r,s=0;for(;s<a.path.length;){const c=a.path[s];s===a.path.length-1?(u[c]=u[c]||{_errors:[]},u[c]._errors.push(n(a))):u[c]=u[c]||{_errors:[]},u=u[c],s++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Je.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const 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()}}Ei.create=e=>new Ei(e);const sh=(e,t)=>{let n;switch(e.code){case G.invalid_type:e.received===oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case G.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Je.jsonStringifyReplacer)}`;break;case G.unrecognized_keys:n=`Unrecognized key(s) in object: ${Je.joinValues(e.keys,", ")}`;break;case G.invalid_union:n="Invalid input";break;case G.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Je.joinValues(e.options)}`;break;case G.invalid_enum_value:n=`Invalid enum value. Expected ${Je.joinValues(e.options)}, received '${e.received}'`;break;case G.invalid_arguments:n="Invalid function arguments";break;case G.invalid_return_type:n="Invalid function return type";break;case G.invalid_date:n="Invalid date";break;case G.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Je.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case G.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case G.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case G.custom:n="Invalid input";break;case G.invalid_intersection_types:n="Intersection results could not be merged";break;case G.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case G.not_finite:n="Number must be finite";break;default:n=t.defaultError,Je.assertNever(e)}return{message:n}};let CV=sh;function jSe(e){CV=e}function jy(){return CV}const Ly=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let u="";const s=r.filter(c=>!!c).slice().reverse();for(const c of s)u=c(a,{data:t,defaultError:u}).message;return{...i,path:o,message:i.message||u}},LSe=[];function ue(e,t){const n=Ly({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,jy(),sh].filter(r=>!!r)});e.common.issues.push(n)}class Cn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return Oe;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return Cn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return Oe;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const Oe=Object.freeze({status:"aborted"}),EV=e=>({status:"dirty",value:e}),qn=e=>({status:"valid",value:e}),PC=e=>e.status==="aborted",WC=e=>e.status==="dirty",Dy=e=>e.status==="valid",qy=e=>typeof Promise<"u"&&e instanceof Promise;var me;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(me||(me={}));class co{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}}const RV=(e,t)=>{if(Dy(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ei(e.common.issues);return this._error=n,this._error}}};function Re(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,u)=>a.code!=="invalid_type"?{message:u.defaultError}:typeof u.data>"u"?{message:r??u.defaultError}:{message:n??u.defaultError},description:i}}class Ae{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 lu(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:lu(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Cn,ctx:{common:t.parent.common,data:t.data,parsedType:lu(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(qy(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:lu(t)},o=this._parseSync({data:t,path:i.path,parent:i});return RV(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:lu(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(qy(i)?i:Promise.resolve(i));return RV(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const a=t(i),u=()=>o.addIssue({code:G.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(s=>s?!0:(u(),!1)):a?!0:(u(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new xi({schema:this,typeName:_e.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return va.create(this,this._def)}nullable(){return Xs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Mi.create(this,this._def)}promise(){return lf.create(this,this._def)}or(t){return dh.create([this,t],this._def)}and(t){return ph.create(this,t,this._def)}transform(t){return new xi({...Re(this._def),schema:this,typeName:_e.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new yh({...Re(this._def),innerType:this,defaultValue:n,typeName:_e.ZodDefault})}brand(){return new xV({typeName:_e.ZodBranded,type:this,...Re(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Hy({...Re(this._def),innerType:this,catchValue:n,typeName:_e.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return bh.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const DSe=/^c[^\s-]{8,}$/i,qSe=/^[a-z][a-z0-9]*$/,USe=/[0-9A-HJKMNP-TV-Z]{26}/,BSe=/^([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,zSe=/^(([^<>()[\]\\.,;:\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,})+))$/,KSe=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,VSe=/^(((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}))$/,HSe=/^(([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})))$/,GSe=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function YSe(e,t){return!!((t==="v4"||!t)&&VSe.test(e)||(t==="v6"||!t)&&HSe.test(e))}class Ri extends Ae{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(i=>t.test(i),{validation:n,code:G.invalid_string,...me.errToObj(r)}),this.nonempty=t=>this.min(1,me.errToObj(t)),this.trim=()=>new Ri({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new Ri({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new Ri({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==oe.string){const o=this._getOrReturnCtx(t);return ue(o,{code:G.invalid_type,expected:oe.string,received:o.parsedType}),Oe}const r=new Cn;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:G.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:G.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,u=t.data.length<o.value;(a||u)&&(i=this._getOrReturnCtx(t,i),a?ue(i,{code:G.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&ue(i,{code:G.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")zSe.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"email",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")KSe.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"emoji",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")BSe.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"uuid",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")DSe.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"cuid",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")qSe.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"cuid2",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")USe.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"ulid",code:G.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),ue(i,{validation:"url",code:G.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"regex",code:G.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),ue(i,{code:G.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),ue(i,{code:G.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),ue(i,{code:G.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?GSe(o).test(t.data)||(i=this._getOrReturnCtx(t,i),ue(i,{code:G.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?YSe(t.data,o.version)||(i=this._getOrReturnCtx(t,i),ue(i,{validation:"ip",code:G.invalid_string,message:o.message}),r.dirty()):Je.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new Ri({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...me.errToObj(t)})}url(t){return this._addCheck({kind:"url",...me.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...me.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...me.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...me.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...me.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...me.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...me.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...me.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...me.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...me.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...me.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...me.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...me.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...me.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...me.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ri.create=e=>{var t;return new Ri({checks:[],typeName:_e.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Re(e)})};function JSe(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}class fu extends Ae{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)!==oe.number){const o=this._getOrReturnCtx(t);return ue(o,{code:G.invalid_type,expected:oe.number,received:o.parsedType}),Oe}let r;const i=new Cn;for(const o of this._def.checks)o.kind==="int"?Je.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ue(r,{code:G.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:G.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:G.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?JSe(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),ue(r,{code:G.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ue(r,{code:G.not_finite,message:o.message}),i.dirty()):Je.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,me.toString(n))}gt(t,n){return this.setLimit("min",t,!1,me.toString(n))}lte(t,n){return this.setLimit("max",t,!0,me.toString(n))}lt(t,n){return this.setLimit("max",t,!1,me.toString(n))}setLimit(t,n,r,i){return new fu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:me.toString(i)}]})}_addCheck(t){return new fu({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:me.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:me.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:me.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:me.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:me.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:me.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Je.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}fu.create=e=>new fu({checks:[],typeName:_e.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Re(e)});class du extends Ae{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)!==oe.bigint){const o=this._getOrReturnCtx(t);return ue(o,{code:G.invalid_type,expected:oe.bigint,received:o.parsedType}),Oe}let r;const i=new Cn;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:G.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:G.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ue(r,{code:G.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Je.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,me.toString(n))}gt(t,n){return this.setLimit("min",t,!1,me.toString(n))}lte(t,n){return this.setLimit("max",t,!0,me.toString(n))}lt(t,n){return this.setLimit("max",t,!1,me.toString(n))}setLimit(t,n,r,i){return new du({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:me.toString(i)}]})}_addCheck(t){return new du({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:me.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:me.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}du.create=e=>{var t;return new du({checks:[],typeName:_e.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Re(e)})};class ch extends Ae{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==oe.boolean){const r=this._getOrReturnCtx(t);return ue(r,{code:G.invalid_type,expected:oe.boolean,received:r.parsedType}),Oe}return qn(t.data)}}ch.create=e=>new ch({typeName:_e.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Re(e)});class Ys extends Ae{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==oe.date){const o=this._getOrReturnCtx(t);return ue(o,{code:G.invalid_type,expected:oe.date,received:o.parsedType}),Oe}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ue(o,{code:G.invalid_date}),Oe}const r=new Cn;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:G.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),ue(i,{code:G.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Je.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Ys({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:me.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:me.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Ys.create=e=>new Ys({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:_e.ZodDate,...Re(e)});class Uy extends Ae{_parse(t){if(this._getType(t)!==oe.symbol){const r=this._getOrReturnCtx(t);return ue(r,{code:G.invalid_type,expected:oe.symbol,received:r.parsedType}),Oe}return qn(t.data)}}Uy.create=e=>new Uy({typeName:_e.ZodSymbol,...Re(e)});class lh extends Ae{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return ue(r,{code:G.invalid_type,expected:oe.undefined,received:r.parsedType}),Oe}return qn(t.data)}}lh.create=e=>new lh({typeName:_e.ZodUndefined,...Re(e)});class fh extends Ae{_parse(t){if(this._getType(t)!==oe.null){const r=this._getOrReturnCtx(t);return ue(r,{code:G.invalid_type,expected:oe.null,received:r.parsedType}),Oe}return qn(t.data)}}fh.create=e=>new fh({typeName:_e.ZodNull,...Re(e)});class uf extends Ae{constructor(){super(...arguments),this._any=!0}_parse(t){return qn(t.data)}}uf.create=e=>new uf({typeName:_e.ZodAny,...Re(e)});class Js extends Ae{constructor(){super(...arguments),this._unknown=!0}_parse(t){return qn(t.data)}}Js.create=e=>new Js({typeName:_e.ZodUnknown,...Re(e)});class ma extends Ae{_parse(t){const n=this._getOrReturnCtx(t);return ue(n,{code:G.invalid_type,expected:oe.never,received:n.parsedType}),Oe}}ma.create=e=>new ma({typeName:_e.ZodNever,...Re(e)});class By extends Ae{_parse(t){if(this._getType(t)!==oe.undefined){const r=this._getOrReturnCtx(t);return ue(r,{code:G.invalid_type,expected:oe.void,received:r.parsedType}),Oe}return qn(t.data)}}By.create=e=>new By({typeName:_e.ZodVoid,...Re(e)});class Mi extends Ae{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==oe.array)return ue(n,{code:G.invalid_type,expected:oe.array,received:n.parsedType}),Oe;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,u=n.data.length<i.exactLength.value;(a||u)&&(ue(n,{code:a?G.too_big:G.too_small,minimum:u?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ue(n,{code:G.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ue(n,{code:G.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((a,u)=>i.type._parseAsync(new co(n,a,n.path,u)))).then(a=>Cn.mergeArray(r,a));const o=[...n.data].map((a,u)=>i.type._parseSync(new co(n,a,n.path,u)));return Cn.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Mi({...this._def,minLength:{value:t,message:me.toString(n)}})}max(t,n){return new Mi({...this._def,maxLength:{value:t,message:me.toString(n)}})}length(t,n){return new Mi({...this._def,exactLength:{value:t,message:me.toString(n)}})}nonempty(t){return this.min(1,t)}}Mi.create=(e,t)=>new Mi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:_e.ZodArray,...Re(t)});function sf(e){if(e instanceof St){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=va.create(sf(r))}return new St({...e._def,shape:()=>t})}else return e instanceof Mi?new Mi({...e._def,type:sf(e.element)}):e instanceof va?va.create(sf(e.unwrap())):e instanceof Xs?Xs.create(sf(e.unwrap())):e instanceof lo?lo.create(e.items.map(t=>sf(t))):e}class St extends Ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Je.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==oe.object){const c=this._getOrReturnCtx(t);return ue(c,{code:G.invalid_type,expected:oe.object,received:c.parsedType}),Oe}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof ma&&this._def.unknownKeys==="strip"))for(const c in i.data)a.includes(c)||u.push(c);const s=[];for(const c of a){const l=o[c],f=i.data[c];s.push({key:{status:"valid",value:c},value:l._parse(new co(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof ma){const c=this._def.unknownKeys;if(c==="passthrough")for(const l of u)s.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(c==="strict")u.length>0&&(ue(i,{code:G.unrecognized_keys,keys:u}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const l of u){const f=i.data[l];s.push({key:{status:"valid",value:l},value:c._parse(new co(i,f,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const l of s){const f=await l.key;c.push({key:f,value:await l.value,alwaysSet:l.alwaysSet})}return c}).then(c=>Cn.mergeObjectSync(r,c)):Cn.mergeObjectSync(r,s)}get shape(){return this._def.shape()}strict(t){return me.errToObj,new St({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,a,u;const s=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(u=me.errToObj(t).message)!==null&&u!==void 0?u:s}:{message:s}}}:{}})}strip(){return new St({...this._def,unknownKeys:"strip"})}passthrough(){return new St({...this._def,unknownKeys:"passthrough"})}extend(t){return new St({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new St({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:_e.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new St({...this._def,catchall:t})}pick(t){const n={};return Je.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new St({...this._def,shape:()=>n})}omit(t){const n={};return Je.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new St({...this._def,shape:()=>n})}deepPartial(){return sf(this)}partial(t){const n={};return Je.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new St({...this._def,shape:()=>n})}required(t){const n={};return Je.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof va;)o=o._def.innerType;n[r]=o}}),new St({...this._def,shape:()=>n})}keyof(){return MV(Je.objectKeys(this.shape))}}St.create=(e,t)=>new St({shape:()=>e,unknownKeys:"strip",catchall:ma.create(),typeName:_e.ZodObject,...Re(t)}),St.strictCreate=(e,t)=>new St({shape:()=>e,unknownKeys:"strict",catchall:ma.create(),typeName:_e.ZodObject,...Re(t)}),St.lazycreate=(e,t)=>new St({shape:e,unknownKeys:"strip",catchall:ma.create(),typeName:_e.ZodObject,...Re(t)});class dh extends Ae{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const u of o)if(u.result.status==="valid")return u.result;for(const u of o)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const a=o.map(u=>new Ei(u.ctx.common.issues));return ue(n,{code:G.invalid_union,unionErrors:a}),Oe}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const s of r){const c={...n,common:{...n.common,issues:[]},parent:null},l=s._parseSync({data:n.data,path:n.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const u=a.map(s=>new Ei(s));return ue(n,{code:G.invalid_union,unionErrors:u}),Oe}}get options(){return this._def.options}}dh.create=(e,t)=>new dh({options:e,typeName:_e.ZodUnion,...Re(t)});const zy=e=>e instanceof mh?zy(e.schema):e instanceof xi?zy(e.innerType()):e instanceof vh?[e.value]:e instanceof pu?e.options:e instanceof gh?Object.keys(e.enum):e instanceof yh?zy(e._def.innerType):e instanceof lh?[void 0]:e instanceof fh?[null]:null;class Ky extends Ae{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.object)return ue(n,{code:G.invalid_type,expected:oe.object,received:n.parsedType}),Oe;const 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}):(ue(n,{code:G.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Oe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const a=zy(o.shape[t]);if(!a)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const u of a){if(i.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);i.set(u,o)}}return new Ky({typeName:_e.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Re(r)})}}function jC(e,t){const n=lu(e),r=lu(t);if(e===t)return{valid:!0,data:e};if(n===oe.object&&r===oe.object){const i=Je.objectKeys(t),o=Je.objectKeys(e).filter(u=>i.indexOf(u)!==-1),a={...e,...t};for(const u of o){const s=jC(e[u],t[u]);if(!s.valid)return{valid:!1};a[u]=s.data}return{valid:!0,data:a}}else if(n===oe.array&&r===oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const a=e[o],u=t[o],s=jC(a,u);if(!s.valid)return{valid:!1};i.push(s.data)}return{valid:!0,data:i}}else return n===oe.date&&r===oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ph extends Ae{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(PC(o)||PC(a))return Oe;const u=jC(o.value,a.value);return u.valid?((WC(o)||WC(a))&&n.dirty(),{status:n.value,value:u.data}):(ue(r,{code:G.invalid_intersection_types}),Oe)};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(([o,a])=>i(o,a)):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}))}}ph.create=(e,t,n)=>new ph({left:e,right:t,typeName:_e.ZodIntersection,...Re(n)});class lo extends Ae{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.array)return ue(r,{code:G.invalid_type,expected:oe.array,received:r.parsedType}),Oe;if(r.data.length<this._def.items.length)return ue(r,{code:G.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Oe;!this._def.rest&&r.data.length>this._def.items.length&&(ue(r,{code:G.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,u)=>{const s=this._def.items[u]||this._def.rest;return s?s._parse(new co(r,a,r.path,u)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Cn.mergeArray(n,a)):Cn.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new lo({...this._def,rest:t})}}lo.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new lo({items:e,typeName:_e.ZodTuple,rest:null,...Re(t)})};class hh extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.object)return ue(r,{code:G.invalid_type,expected:oe.object,received:r.parsedType}),Oe;const i=[],o=this._def.keyType,a=this._def.valueType;for(const u in r.data)i.push({key:o._parse(new co(r,u,r.path,u)),value:a._parse(new co(r,r.data[u],r.path,u))});return r.common.async?Cn.mergeObjectAsync(n,i):Cn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Ae?new hh({keyType:t,valueType:n,typeName:_e.ZodRecord,...Re(r)}):new hh({keyType:Ri.create(),valueType:t,typeName:_e.ZodRecord,...Re(n)})}}class Vy extends Ae{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.map)return ue(r,{code:G.invalid_type,expected:oe.map,received:r.parsedType}),Oe;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([u,s],c)=>({key:i._parse(new co(r,u,r.path,[c,"key"])),value:o._parse(new co(r,s,r.path,[c,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const s of a){const c=await s.key,l=await s.value;if(c.status==="aborted"||l.status==="aborted")return Oe;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),u.set(c.value,l.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const s of a){const c=s.key,l=s.value;if(c.status==="aborted"||l.status==="aborted")return Oe;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),u.set(c.value,l.value)}return{status:n.value,value:u}}}}Vy.create=(e,t,n)=>new Vy({valueType:t,keyType:e,typeName:_e.ZodMap,...Re(n)});class Zs extends Ae{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.set)return ue(r,{code:G.invalid_type,expected:oe.set,received:r.parsedType}),Oe;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(ue(r,{code:G.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(ue(r,{code:G.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(s){const c=new Set;for(const l of s){if(l.status==="aborted")return Oe;l.status==="dirty"&&n.dirty(),c.add(l.value)}return{status:n.value,value:c}}const u=[...r.data.values()].map((s,c)=>o._parse(new co(r,s,r.path,c)));return r.common.async?Promise.all(u).then(s=>a(s)):a(u)}min(t,n){return new Zs({...this._def,minSize:{value:t,message:me.toString(n)}})}max(t,n){return new Zs({...this._def,maxSize:{value:t,message:me.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Zs.create=(e,t)=>new Zs({valueType:e,minSize:null,maxSize:null,typeName:_e.ZodSet,...Re(t)});class cf extends Ae{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.function)return ue(n,{code:G.invalid_type,expected:oe.function,received:n.parsedType}),Oe;function r(u,s){return Ly({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,jy(),sh].filter(c=>!!c),issueData:{code:G.invalid_arguments,argumentsError:s}})}function i(u,s){return Ly({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,jy(),sh].filter(c=>!!c),issueData:{code:G.invalid_return_type,returnTypeError:s}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof lf?qn(async(...u)=>{const s=new Ei([]),c=await this._def.args.parseAsync(u,o).catch(d=>{throw s.addIssue(r(u,d)),s}),l=await a(...c);return await this._def.returns._def.type.parseAsync(l,o).catch(d=>{throw s.addIssue(i(l,d)),s})}):qn((...u)=>{const s=this._def.args.safeParse(u,o);if(!s.success)throw new Ei([r(u,s.error)]);const c=a(...s.data),l=this._def.returns.safeParse(c,o);if(!l.success)throw new Ei([i(c,l.error)]);return l.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new cf({...this._def,args:lo.create(t).rest(Js.create())})}returns(t){return new cf({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new cf({args:t||lo.create([]).rest(Js.create()),returns:n||Js.create(),typeName:_e.ZodFunction,...Re(r)})}}class mh extends Ae{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}mh.create=(e,t)=>new mh({getter:e,typeName:_e.ZodLazy,...Re(t)});class vh extends Ae{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ue(n,{received:n.data,code:G.invalid_literal,expected:this._def.value}),Oe}return{status:"valid",value:t.data}}get value(){return this._def.value}}vh.create=(e,t)=>new vh({value:e,typeName:_e.ZodLiteral,...Re(t)});function MV(e,t){return new pu({values:e,typeName:_e.ZodEnum,...Re(t)})}class pu extends Ae{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ue(n,{expected:Je.joinValues(r),received:n.parsedType,code:G.invalid_type}),Oe}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return ue(n,{received:n.data,code:G.invalid_enum_value,options:r}),Oe}return qn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return pu.create(t)}exclude(t){return pu.create(this.options.filter(n=>!t.includes(n)))}}pu.create=MV;class gh extends Ae{_parse(t){const n=Je.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==oe.string&&r.parsedType!==oe.number){const i=Je.objectValues(n);return ue(r,{expected:Je.joinValues(i),received:r.parsedType,code:G.invalid_type}),Oe}if(n.indexOf(t.data)===-1){const i=Je.objectValues(n);return ue(r,{received:r.data,code:G.invalid_enum_value,options:i}),Oe}return qn(t.data)}get enum(){return this._def.values}}gh.create=(e,t)=>new gh({values:e,typeName:_e.ZodNativeEnum,...Re(t)});class lf extends Ae{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.promise&&n.common.async===!1)return ue(n,{code:G.invalid_type,expected:oe.promise,received:n.parsedType}),Oe;const r=n.parsedType===oe.promise?n.data:Promise.resolve(n.data);return qn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}lf.create=(e,t)=>new lf({type:e,typeName:_e.ZodPromise,...Re(t)});class xi extends Ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null;if(i.type==="preprocess"){const a=i.transform(r.data);return r.common.async?Promise.resolve(a).then(u=>this._def.schema._parseAsync({data:u,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}const o={addIssue:a=>{ue(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="refinement"){const a=u=>{const s=i.refinement(u,o);if(r.common.async)return Promise.resolve(s);if(s instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?Oe:(u.status==="dirty"&&n.dirty(),a(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?Oe:(u.status==="dirty"&&n.dirty(),a(u.value).then(()=>({status:n.value,value:u.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Dy(a))return a;const u=i.transform(a.value,o);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Dy(a)?Promise.resolve(i.transform(a.value,o)).then(u=>({status:n.value,value:u})):a);Je.assertNever(i)}}xi.create=(e,t,n)=>new xi({schema:e,typeName:_e.ZodEffects,effect:t,...Re(n)}),xi.createWithPreprocess=(e,t,n)=>new xi({schema:t,effect:{type:"preprocess",transform:e},typeName:_e.ZodEffects,...Re(n)});class va extends Ae{_parse(t){return this._getType(t)===oe.undefined?qn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}va.create=(e,t)=>new va({innerType:e,typeName:_e.ZodOptional,...Re(t)});class Xs extends Ae{_parse(t){return this._getType(t)===oe.null?qn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Xs.create=(e,t)=>new Xs({innerType:e,typeName:_e.ZodNullable,...Re(t)});class yh extends Ae{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}yh.create=(e,t)=>new yh({innerType:e,typeName:_e.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Re(t)});class Hy extends Ae{_parse(t){const{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 qy(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ei(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ei(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Hy.create=(e,t)=>new Hy({innerType:e,typeName:_e.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Re(t)});class Gy extends Ae{_parse(t){if(this._getType(t)!==oe.nan){const r=this._getOrReturnCtx(t);return ue(r,{code:G.invalid_type,expected:oe.nan,received:r.parsedType}),Oe}return{status:"valid",value:t.data}}}Gy.create=e=>new Gy({typeName:_e.ZodNaN,...Re(e)});const ZSe=Symbol("zod_brand");class xV extends Ae{_parse(t){const{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 bh extends Ae{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Oe:o.status==="dirty"?(n.dirty(),EV(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Oe:i.status==="dirty"?(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 bh({in:t,out:n,typeName:_e.ZodPipeline})}}const kV=(e,t={},n)=>e?uf.create().superRefine((r,i)=>{var o,a;if(!e(r)){const u=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,s=(a=(o=u.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,c=typeof u=="string"?{message:u}:u;i.addIssue({code:"custom",...c,fatal:s})}}):uf.create(),XSe={object:St.lazycreate};var _e;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"})(_e||(_e={}));const QSe=(e,t={message:`Input not instance of ${e.name}`})=>kV(n=>n instanceof e,t),_h=Ri.create,Yy=fu.create,e$e=Gy.create,t$e=du.create,AV=ch.create,n$e=Ys.create,r$e=Uy.create,i$e=lh.create,o$e=fh.create,a$e=uf.create,NV=Js.create,u$e=ma.create,s$e=By.create,FV=Mi.create,Jy=St.create,c$e=St.strictCreate,l$e=dh.create,f$e=Ky.create,d$e=ph.create,p$e=lo.create,h$e=hh.create,m$e=Vy.create,v$e=Zs.create,g$e=cf.create,y$e=mh.create,b$e=vh.create,_$e=pu.create,S$e=gh.create,$$e=lf.create,PV=xi.create,T$e=va.create,I$e=Xs.create,O$e=xi.createWithPreprocess,w$e=bh.create;var Un=Object.freeze({__proto__:null,defaultErrorMap:sh,setErrorMap:jSe,getErrorMap:jy,makeIssue:Ly,EMPTY_PATH:LSe,addIssueToContext:ue,ParseStatus:Cn,INVALID:Oe,DIRTY:EV,OK:qn,isAborted:PC,isDirty:WC,isValid:Dy,isAsync:qy,get util(){return Je},get objectUtil(){return FC},ZodParsedType:oe,getParsedType:lu,ZodType:Ae,ZodString:Ri,ZodNumber:fu,ZodBigInt:du,ZodBoolean:ch,ZodDate:Ys,ZodSymbol:Uy,ZodUndefined:lh,ZodNull:fh,ZodAny:uf,ZodUnknown:Js,ZodNever:ma,ZodVoid:By,ZodArray:Mi,ZodObject:St,ZodUnion:dh,ZodDiscriminatedUnion:Ky,ZodIntersection:ph,ZodTuple:lo,ZodRecord:hh,ZodMap:Vy,ZodSet:Zs,ZodFunction:cf,ZodLazy:mh,ZodLiteral:vh,ZodEnum:pu,ZodNativeEnum:gh,ZodPromise:lf,ZodEffects:xi,ZodTransformer:xi,ZodOptional:va,ZodNullable:Xs,ZodDefault:yh,ZodCatch:Hy,ZodNaN:Gy,BRAND:ZSe,ZodBranded:xV,ZodPipeline:bh,custom:kV,Schema:Ae,ZodSchema:Ae,late:XSe,get ZodFirstPartyTypeKind(){return _e},coerce:{string:e=>Ri.create({...e,coerce:!0}),number:e=>fu.create({...e,coerce:!0}),boolean:e=>ch.create({...e,coerce:!0}),bigint:e=>du.create({...e,coerce:!0}),date:e=>Ys.create({...e,coerce:!0})},any:a$e,array:FV,bigint:t$e,boolean:AV,date:n$e,discriminatedUnion:f$e,effect:PV,enum:_$e,function:g$e,instanceof:QSe,intersection:d$e,lazy:y$e,literal:b$e,map:m$e,nan:e$e,nativeEnum:S$e,never:u$e,null:o$e,nullable:I$e,number:Yy,object:Jy,oboolean:()=>AV().optional(),onumber:()=>Yy().optional(),optional:T$e,ostring:()=>_h().optional(),pipeline:w$e,preprocess:O$e,promise:$$e,record:h$e,set:v$e,strictObject:c$e,string:_h,symbol:r$e,transformer:PV,tuple:p$e,undefined:i$e,union:l$e,unknown:NV,void:s$e,NEVER:Oe,ZodIssueCode:G,quotelessJson:WSe,ZodError:Ei});function ga(e){return e!=null}async function WV(e,t){const{okType:n,errorType:r=R$e,signal:i,headers:o,body:a,timeout:u=1e4,...s}=t,c=new Headers(o);c.has("Content-Type")||c.set("Content-Type","application/json");const l=k$e();l&&c.set("Authorization",`Bearer ${l}`);const f=c.get("Content-Type")==="application/json"?JSON.stringify(a):a;let d=!1;try{const p=new AbortController,h=M$e([p.signal,i].filter(ga));setTimeout(()=>{d=!0,p.abort()},u);const v=await fetch(e,{...s,body:f,headers:c,signal:h}),{status:m}=v,_=v.clone(),g=await v.json().catch(S=>_.text());if(v.ok){const S=n.safeParse(g);return S.success?{ok:!0,body:S.data}:{ok:!1,error:"validation",status:m,cause:S.error}}else{const S=r.safeParse(g);return S.success?{ok:!1,error:"http",status:m,body:S.data}:{ok:!1,error:"validation",status:m,cause:S.error}}}catch(p){return x$e(p)?{ok:!1,error:d?"timeout":"abort"}:{ok:!1,error:"unknown",cause:p}}}const C$e=new Set(["http","abort","timeout","unknown","validation"]);function jV(e){return ga(e)&&!e.ok&&C$e.has(e.error)}function E$e(e){return jV(e)?e.error==="unknown"?!0:e.error!=="http"?!1:e.status===401||e.status===403:!1}const R$e=NV();function M$e(e){const t=new AbortController;function n(){t.abort();for(const r of e)r.removeEventListener("abort",n)}for(const r of e){if(r.aborted){n();break}r.addEventListener("abort",n)}return t.signal}function x$e(e){return e instanceof DOMException&&e.name==="AbortError"}let k$e=()=>"";function LV(e){const t=U.useRef(e);return U.useLayoutEffect(()=>{t.current=e}),U.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function DV(){const[e,t]=U.useState({});return U.useCallback(()=>t({}),[])}function qV(e,t,n){U.useEffect(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[n,t,e])}function A$e(e,t){F$e(e,t),N$e(e,t);const n=ya.get(e,t);if(!n){const r=e(...t);throw ya.set(e,t,{state:"fetching",promise:r}),UV(e,t,r).catch(i=>console.error(i)),r}if(n.state==="fetching")throw n.promise;if(n.ok)return n.body;throw n.error}function N$e(e,t){const n=DV(),r=LC(t);U.useEffect(()=>()=>{},[e,n,r])}function F$e(e,t){const n=DV();U.useEffect(()=>{const r=ya.getFetcherConfig(e).revalidationStrategy;if((r==null?void 0:r.type)==="never"||!(r!=null&&r.onFocus))return;function i(){if(document.visibilityState==="hidden")return;const o=ya.get(e,t);if(!o||o.state!=="fetched")return;const a=e(...t);o.ok?ya.set(e,t,{state:"revalidating",promise:a,ok:!0,body:o.body}):ya.set(e,t,{state:"revalidating",promise:a,ok:!1,error:o.error}),UV(e,t,a).then(n).catch(u=>console.error(u))}return document.addEventListener("visibilitychange",i),()=>document.removeEventListener("visibilitychange",i)})}function UV(e,t,n){return n.then(r=>ya.set(e,t,{state:"fetched",ok:!0,body:r})).catch(r=>ya.set(e,t,{state:"fetched",ok:!1,error:r}))}const ya=P$e(),BV=ya;function P$e(){const e=new Map,t=new Map,n={cacheCapacity:100,revalidationStrategy:{type:"swr",onFocus:!0}};function r(i){return e.get(i)??n}return{get(i,o){const a=LC(o),u=t.get(i);if(!u||!u.has(a))return;const s=u.get(a);return u.delete(a),s!==void 0&&u.set(a,s),s},set(i,o,a){let u=t.get(i);u||(u=new Map,t.set(i,u));const s=r(i),c=LC(o);u.size===s.cacheCapacity&&!u.has(c)&&u.delete(u.keys().next().value),u.set(c,a)},getFetcherConfig:r,registerFetcherConfig(i,o){e.set(i,o)},clear(...i){if(i.length>0)for(const o of i)t.delete(o);else t.clear()}}}function LC(e){return e.join(`
|
|
29
|
+
`)}function zV(e,t){const n=A$e(e,t);if(!n.ok)throw n;return n.body}function Zy(e){try{return new URL(e)}catch{return}}const W$e=({id:e,readOnly:t,field:n,content:r,onContentChange:i})=>{const[o,a]=U.useState((r==null?void 0:r.embed_url)??""),u=f=>{a(f),Zy(f)||i(void 0)},[s,c]=U.useState(o),l=U.useCallback(f=>U.startTransition(()=>c(f)),[]);return qV(o,300,l),I.jsxs(E.Field,{footer:I.jsx(j$e,{url:s,content:r,onContentChange:i}),children:[I.jsx(E.FieldIcon,{children:I.jsx(E.Icon,{name:"cloud"})}),I.jsx(E.FieldLabel,{htmlFor:e,children:wr(n)}),I.jsx(E.FieldControl,{children:I.jsx(E.TextInput,{id:e,readOnly:t,placeholder:cu(n),value:o,onValueChange:u,variant:Zy(o)?"link":"normal",endAdornment:I.jsx(E.Button,{startIcon:I.jsx(E.Icon,{name:"close"}),variant:"secondary",size:"small",disabled:!o,onClick:()=>u("")})})})]})},j$e=({url:e,content:t,onContentChange:n})=>Zy(e)?e===(t==null?void 0:t.embed_url)?I.jsx(DC,{content:t}):I.jsx(L$e,{url:e,onError:()=>n(void 0),children:I.jsx(U.Suspense,{fallback:t&&I.jsx(DC,{content:t}),children:I.jsx(D$e,{url:e,onContentChange:n})})}):null;class L$e extends U.Component{constructor(){super(...arguments);Bf(this,"state",{hasError:!1})}static getDerivedStateFromError(n){return{hasError:KV(n)}}componentDidUpdate(n){this.state.hasError&&this.props.url!==n.url&&(BV.clear(VV),this.setState({hasError:!1}))}componentDidCatch(n){KV(n)&&this.props.onError()}render(){return this.state.hasError?I.jsx(E.FieldFooter,{children:I.jsx(E.EmptyEmbed,{title:"There is no embed data available."})}):this.props.children}}const KV=e=>jV(e)&&!E$e(e),DC=({content:e})=>I.jsx(E.FieldFooter,{children:I.jsx(E.EmbedPreview,{...B$e({content:e})})}),D$e=({url:e,onContentChange:t})=>{const n=q$e({url:e,onContentChange:t});return I.jsx(DC,{content:n})},q$e=({url:e,onContentChange:t})=>{const{embeds:n}=fS(),r=zV(VV,[e,n.url]),i=LV(t);return U.useEffect(()=>i(r),[r,i]),r},VV=async(e,t)=>{const n=new URL(t);return n.search=new URLSearchParams({url:e}).toString(),WV(n.toString(),{okType:U$e({url:e})})},U$e=({url:e})=>Un.object({type:Un.string(),version:Un.string().or(Un.number()).nullish(),title:Un.string().nullish(),author_name:Un.string().nullish(),author_url:Un.string().nullish(),provider_name:Un.string().nullish(),provider_url:Un.string().nullish(),cache_age:Un.string().or(Un.number()).nullish(),thumbnail_url:Un.string().nullish(),thumbnail_width:Un.number().nullish(),thumbnail_height:Un.number().nullish(),html:Un.string().nullish()}).passthrough().transform(t=>{const n={embed_url:e};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}}}),B$e=({content:e})=>{let t="";switch(e.type){case"video":t=e.title??"";break;case"photo":t="View this post"+(e.provider_name?` on ${e.provider_name}`:"");break;default:t="Open"+(e.provider_name?` on ${e.provider_name}`:"")}return{url:e.embed_url,thumbnail:{url:e.thumbnail_url??"",aspectRatio:e.type==="video"?"16:9":"1:1"},provider:e.provider_name??"",author:e.author_name??"",subtitle:t}},Sh="__MAIN_THUMBNAIL__";function HV(e,t,n){const r=e.name===Sh?void 0:e.name;let i;return t?ga(n)?i=[n.width,n.height]:ga(e.width)||ga(e.height)?i=[e.width??void 0,e.height??void 0]:i=[t.origin.width,t.origin.height]:i=void 0,[r,i?`${i[0]??"auto"}x${i[1]??"auto"}px`:void 0]}function z$e(e){var t,n;return[{...(t=e.config)==null?void 0:t.constraint,name:Sh}].concat(((n=e.config)==null?void 0:n.thumbnails)??[])}function K$e(e,t){var a,u;const{__TYPE__:n,thumbnails:r,...i}=t,o=(u=(a=e.config)==null?void 0:a.thumbnails)==null?void 0:u.map(({name:s})=>r==null?void 0:r[s]);return[i,...o??[]]}function V$e(e,t,n,r){const i=r.length===0?void 0:r;return e===Sh?{...t,alt:i}:{...t,thumbnails:{...t.thumbnails,[e]:{...n,alt:i}}}}function GV(e,t){const{width:n,height:r}=t??{};return n&&r?[n,r]:n?[n,Math.round(e.height*(n/e.width))]:r?[Math.round(e.width*(r/e.height)),r]:[e.width,e.height]}function YV(e,t,n,r,i){const o=new URL(e);if(i){const{x:a,y:u,width:s,height:c}=t;o.searchParams.set("rect",[a,u,s,c].join(",")),o.searchParams.set("w",n.toString()),o.searchParams.set("h",r.toString())}return o.toString()}function JV(e){const t=new URL(e);return t.searchParams.delete("q"),t.searchParams.set("w","800"),t.searchParams.set("h","800"),t.searchParams.set("auto","compress,format"),t.searchParams.set("fit","max"),t.toString()}function H$e(e){const t=new URL(e);return t.searchParams.delete("q"),t.searchParams.delete("fm"),t.searchParams.set("w","300"),t.searchParams.set("auto","compress,format"),t.toString()}const ZV=({contentView:e,constraints:t,croppedImage:n})=>{const[r,i]=GV(e.origin,t),o=YV(e.origin.url,n,r,i,!0);return{...e,width:r,height:i,url:o,edit:{...e.edit,zoom:n.zoom,crop:{x:n.x,y:n.y}}}},G$e=({field:e,content:t,thumbnail:n,croppedImage:r})=>{var u,s,c,l;if(n===Sh){const f=ZV({contentView:t,constraints:(u=e.config)==null?void 0:u.constraint,croppedImage:r});return f.url===t.url?t:{...t,...f}}const i=(c=(s=e.config)==null?void 0:s.thumbnails)==null?void 0:c.find(f=>f.name===n),o=(l=t.thumbnails)==null?void 0:l[n];if(!i||!o)return t;const a=ZV({contentView:o,constraints:i,croppedImage:r});return a.url===o.url?t:{...t,thumbnails:{...t.thumbnails,[n]:a}}},Y$e=({initialSize:e,constraints:t})=>{const n=t!=null&&t.width&&(t!=null&&t.height)?t.width/t.height:e.width/e.height,[r,i]=e.width<e.height?[e.width,Math.round(e.width/n)]:[Math.round(e.height*n),e.height],o=Math.max(r/e.width,i/e.height,1);return{width:Math.round(r/o),height:Math.round(i/o)}},J$e=({contentView:e,constraints:t})=>{const n=Y$e({initialSize:e.origin,constraints:t}),r=e.edit.zoom??1,i=Math.round(n.width/r),o=Math.round(n.height/r);return{...e.edit.crop,width:i,height:o,zoom:r}},XV={x:0,y:0,width:0,height:0,zoom:1},Z$e=({selectedImage:{thumbnail:e,contentView:t}})=>e.width&&e.height?e.width/e.height:t?t.origin.width/t.origin.height:1,X$e=({trigger:e,initialImages:t,initialOption:n,onClose:r})=>{var T;const[i,o]=$e.useState({}),[a,u]=$e.useState({}),[s,c]=$e.useState(!1),[l,f]=$e.useState(!1),[d,p]=$e.useState(n),h=t[d],v=M=>{if(!h)return;const R=h.thumbnail.name,q=i[R]??XV;o({...i,[R]:{...q,zoom:M}})},m=M=>{if(!h)return;const R=h.thumbnail.name,q=i[R]??XV;o({...i,[R]:{...q,...M}})},_=M=>{if(!h)return;const R=h.thumbnail.name,q=a[R];u({...a,[R]:{...q,crop:M}})},g=M=>{if(!h)return;const R=h.thumbnail.name,q=a[R]??{};u({...a,[R]:{...q,aspectRatio:M}})},S=i[(h==null?void 0:h.thumbnail.name)??""],b=s?S??((h==null?void 0:h.contentView)&&J$e({contentView:h.contentView,constraints:h.thumbnail})):void 0,$=a[(h==null?void 0:h.thumbnail.name)??""];return I.jsxs(E.Dialog,{trigger:e,onAnimationEnd:()=>f(!0),open:s,onOpenChange:M=>{M?(p(n),o({}),u({})):(f(!1),r({option:d,croppedImages:i})),c(M)},children:[I.jsx(E.DialogHeader,{icon:"photo",title:"Image editor"}),I.jsx(E.DialogOptions,{value:String(d),onValueChange:M=>p(Number(M)),children:t.map((M,R)=>I.jsx(E.DialogOptionsItem,{value:String(R),icon:"photo",title:M.labels[0]??"Main",subtitle:M.labels[1]??""},M.thumbnail.name))}),h&&I.jsx(E.DialogContent,{children:l&&I.jsx(E.CropperControls,{image:((T=h.contentView)==null?void 0:T.origin.url)??"",crop:($==null?void 0:$.crop)??{x:0,y:0},onCropChange:_,zoom:(S==null?void 0:S.zoom)??1,onZoomChange:v,aspectRatio:Z$e({selectedImage:h,cropper:$}),onAspectRatioChange:g,initialCroppedArea:b,onCropAreaChange:m},h.thumbnail.name)})]})},Q$e=()=>I.jsx(E.Box,{padding:{inline:24},flexDirection:"column",height:"100%",children:I.jsx(E.Box,{backgroundColor:"grey3",borderRadius:4,alignItems:"center",justifyContent:"center",height:"100%",animation:"fadeIn",children:I.jsxs(E.BlankSlate,{children:[I.jsx(E.BlankSlateIcon,{name:"cloudUpload"}),I.jsx(E.BlankSlateDescription,{children:"Drop files here or"}),I.jsx(E.BlankSlateActions,{children:I.jsx(E.Button,{variant:"secondary",size:"large",children:"Upload media"})})]})})}),e0e=Jy({id:_h(),width:Yy(),height:Yy(),urls:Jy({full:_h(),small:_h().transform(H$e)})}),t0e=Jy({results:FV(e0e)}).transform(e=>e.results);function QV(e,t){const n=new URLSearchParams({page:"1",per_page:"30",query:t});return WV(`${e}/search/photos?${n.toString()}`,{okType:t0e})}BV.registerFetcherConfig(QV,{cacheCapacity:5,revalidationStrategy:{type:"never"}});function n0e(e,t){return zV(QV,[e,t])}const r0e=e=>{const{onMediaSelected:t}=e,[n,r]=U.useState(""),[i,o]=U.useState(n),[a,u]=U.useTransition(),s=U.useCallback(c=>u(()=>o(c)),[]);return qV(n,200,s),I.jsxs(I.Fragment,{children:[I.jsx(E.Box,{padding:{inline:24},flexDirection:"column",children:I.jsx(E.SearchInput,{value:n,placeholder:"Search on Unsplash.com",onValueChange:r})}),I.jsx(E.Box,{overflowY:"auto",flexDirection:"column",children:I.jsx(a0e,{children:I.jsx(E.ErrorBoundary,{errorImageSrc:E.dialogErrorImage,title:"Request failed",description:"An error occurred while searching for your image.",renderError:c=>I.jsx(E.Box,{height:"100%",flexDirection:"column",alignItems:"center",justifyContent:"center",children:c}),children:I.jsx(U.Suspense,{fallback:I.jsx(E.MasonrySkeleton,{}),children:I.jsx(i0e,{term:i,isUpdating:a,onMediaSelected:t})})})})})]})},i0e=e=>{const{term:t,isUpdating:n,onMediaSelected:r}=e,i=fS(),o=n0e(i.unsplash.url,t||"fruit"),a=o0e(n);return o.length?I.jsx(E.Masonry,{items:o,getItemInfo:u0e,style:a,children:u=>I.jsx(E.MasonryMedia,{url:u.urls.small,onClick:()=>r({id:u.id,url:u.urls.full,width:u.width,height:u.height})})}):I.jsxs(E.BlankSlate,{style:{marginTop:"auto",marginBottom:"auto",...a},children:[I.jsx(E.BlankSlateImage,{children:I.jsx("img",{src:E.dialogErrorImage,alt:"No results"})}),I.jsx(E.BlankSlateTitle,{size:"big",children:"Oh no ..."}),I.jsx(E.BlankSlateDescription,{children:"The search returned no result."})]})};function o0e(e){return{opacity:e?.4:1,transitionProperty:e?"opacity":"none",transitionDuration:E.tokens.transitionDuration[300],transitionTimingFunction:E.tokens.transitionTimingFunction.easeInOut}}const a0e=({children:e})=>I.jsx(E.ScrollArea,{style:{height:"100%",paddingInline:E.tokens.space[24],paddingTop:E.tokens.space[4]},children:e});function u0e(e){return{key:e.id,aspectRatio:e.width/e.height}}const e3=e=>{const{trigger:t,onMediaSelected:n}=e,[r,i]=U.useState(!1),[o,a]=U.useState("media"),u=s=>{if(s!=="media"&&s!=="unsplash")throw new Error(`Invalid option ${s}.`);a(s)};return I.jsxs(E.Dialog,{trigger:t,open:r,onOpenChange:i,children:[I.jsx(E.DialogHeader,{icon:"folder",title:"Add an image"}),I.jsxs(E.DialogOptions,{value:o,onValueChange:u,children:[I.jsx(E.DialogOptionsItem,{value:"media",title:"Media library",subtitle:"From Prismic",icon:"photo"}),I.jsx(E.DialogOptionsItem,{value:"unsplash",title:"Unsplash",subtitle:"Source of free images",icon:"unsplash"})]}),I.jsx(E.DialogContent,{children:I.jsx(s0e,{option:o,onMediaSelected:s=>{i(!1),n==null||n(s)}})})]})},s0e=e=>{const{option:t,onMediaSelected:n}=e;switch(t){case"media":return I.jsx(Q$e,{});case"unsplash":return I.jsx(r0e,{onMediaSelected:n})}};function c0e(e,t){const n={};for(const r in e)n[r]=t(e[r],r);return n}function l0e(e,t,n,r){var u,s,c,l,f,d;if(!n){const p=(u=t.config)==null?void 0:u.thumbnails,h=p&&Object.fromEntries(p.map(v=>[v.name,Xy(r,v)]));return{__TYPE__:"ImageContent",...Xy(r,(s=t.config)==null?void 0:s.constraint),thumbnails:h}}if(e===Sh){const p=Xy(r,(c=t.config)==null?void 0:c.constraint);return p.url===n.url?n:{...n,...p}}const i=(f=(l=t.config)==null?void 0:l.thumbnails)==null?void 0:f.find(p=>p.name===e);if(!i)return n;const o=(d=n.thumbnails)==null?void 0:d[e],a=Xy(r,i);return a.url===(o==null?void 0:o.url)?n:{...n,thumbnails:c0e(n.thumbnails??{},(p,h)=>h===e?a:p)}}function Xy(e,t){const{width:n,height:r,rect:i}=f0e(e,t),o=Boolean((t==null?void 0:t.width)||(t==null?void 0:t.height));return{url:YV(e.url,i,n,r,o),origin:{id:e.id,url:e.url,width:e.width,height:e.height},width:n,height:r,edit:{background:"transparent",zoom:1,crop:{x:i.x,y:i.y}}}}function f0e(e,t){const[n,r]=GV(e,t),i=Math.max(n/e.width,r/e.height),o=Math.round((e.width-n/i)/2),a=Math.round((e.height-r/i)/2),u=Math.round(n/i),s=Math.round(r/i);return{width:n,height:r,rect:{x:o,y:a,width:u,height:s}}}const d0e=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{const[o,a]=U.useState(0),[u,s]=U.useTransition(),c=p0e(t),l=c[o],f=e?K$e(t,e):void 0,d=f==null?void 0:f[o],p=wr(t),h=l?HV(l,e,d).filter(ga):[],v=e&&!i?"visible":"hidden";function m(b){if(!l)return;const $=l0e(l.name,t,e,b);$!==e&&s(()=>r($))}function _(b){s(()=>a(b))}const g=c.map((b,$)=>{const T=f==null?void 0:f[$];return{thumbnail:b,contentView:T,labels:HV(b,e,T)}}),S=({option:b,croppedImages:$})=>{if(a(b),!e)return;const T=Object.entries($).reduce((M,[R,q])=>G$e({field:t,content:M,thumbnail:R,croppedImage:q}),e);T!==e&&s(()=>r(T))};return I.jsxs(E.Card,{color:"grey2",variant:"dashed",children:[I.jsxs(E.CardHeader,{children:[I.jsxs(E.CardHeaderTitle,{children:[p,h.length&&I.jsx(E.Text,{color:"grey11",component:"span",children:` • ${h.join(" • ")}`})]}),I.jsxs(E.CardHeaderActions,{style:{visibility:v},children:[I.jsx(X$e,{trigger:I.jsx(E.Button,{startIcon:I.jsx(E.Icon,{name:"crop"}),children:"Crop & Resize"}),initialImages:g,initialOption:o,onClose:S}),I.jsx(e3,{trigger:I.jsx(E.Button,{startIcon:I.jsx(E.Icon,{name:"imageSearch"}),children:"Replace"}),onMediaSelected:m}),I.jsx(E.Button,{onClick:()=>{a(0),r(void 0)},startIcon:I.jsx(E.Icon,{name:"delete"}),children:"Clear"})]})]}),I.jsx(U.Suspense,{fallback:I.jsx("div",{style:{height:466}}),children:l&&e&&f?I.jsx(h0e,{allContentViews:f,content:e,contentView:d,id:n,onContentChange:r,onPageChange:_,page:o,readOnly:i,thumbnailName:l.name,isUpdating:u}):I.jsx(m0e,{onMediaSelected:m,readOnly:i,isUpdating:u})})]})};function p0e(e){return U.useMemo(()=>z$e(e),[e])}const h0e=e=>{const{allContentViews:t,content:n,contentView:r,id:i,onContentChange:o,onPageChange:a,page:u,readOnly:s,thumbnailName:c,isUpdating:l}=e;return I.jsxs(E.CardContent,{children:[I.jsx(E.Carousel,{getItemSource:v0e,items:t,onPageChange:a,page:u,style:{height:400},children:f=>(f==null?void 0:f.url)&&I.jsx(E.CarouselItem,{src:JV(f.url),alt:f.alt??void 0,isUpdating:l},`${c}_${f.url}`)}),I.jsxs(E.Field,{labelPosition:"side",children:[I.jsx(E.FieldLabel,{htmlFor:i,children:"Alt text"}),I.jsx(E.FieldControl,{children:I.jsx(E.TextInput,{id:i,onValueChange:f=>{r&&o(V$e(c,n,r,f))},placeholder:"Short description for the visually impaired",readOnly:s||!r,value:(r==null?void 0:r.alt)??""})})]})]})},m0e=({onMediaSelected:e,readOnly:t,isUpdating:n})=>I.jsx(E.CardContent,{children:I.jsx(E.Card,{color:"grey3",variant:"outlined",children:I.jsx(E.CardContent,{style:{paddingBlock:parseFloat(E.tokens.space[48])},children:I.jsxs(E.BlankSlate,{children:[I.jsx(E.BlankSlateIcon,{name:"cloudUpload"}),I.jsx(E.BlankSlateTitle,{children:n?"Preparing your image...":"You haven't selected an image"}),!t&&I.jsx(E.BlankSlateActions,{children:I.jsx(e3,{trigger:I.jsx(E.Button,{disabled:n,children:"Select image"}),onMediaSelected:e})})]})})})});function v0e(e){return e!=null&&e.url?JV(e.url):void 0}const g0e=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>I.jsxs(E.Field,{children:[I.jsx(E.FieldIcon,{children:I.jsx(E.Icon,{name:"notes"})}),I.jsx(E.FieldLabel,{htmlFor:n,children:wr(t)}),I.jsx(E.FieldControl,{children:I.jsx(E.TextArea,{id:n,onChange:o=>{r(y0e(o.target.value))},placeholder:cu(t),readOnly:i,value:(e==null?void 0:e.value)??""})})]});function y0e(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Text",value:e}}function b0e(e){return e.charAt(0).toUpperCase()+e.slice(1)}const _0e=e=>{const{hasLink:t,onUnlink:n}=e;return I.jsxs(I.Fragment,{children:[I.jsx(E.Select,{value:"web",variant:"secondary",size:"small",icon:"public",disabled:!0,children:I.jsx(E.SelectItem,{value:"web",icon:"public",children:"Link to web page"})}),I.jsx(E.Button,{startIcon:I.jsx(E.Icon,{name:"linkOff"}),variant:"secondary",size:"small",disabled:!t,onClick:n})]})},S0e=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var h,v;const[o,a]=U.useState(!1),[u,s]=U.useState(!1);if((h=t.config)!=null&&h.select&&((v=t.config)==null?void 0:v.select)!=="web")return null;const c=(e==null?void 0:e.value.__TYPE__)==="ExternalLink"?e.value:void 0,l=c==null?void 0:c.url,f=l?Zy(l):void 0,d=(o||u)&&Boolean(f),p=m=>r($0e(c,m));return I.jsx(E.LinkDescriptionPopover,{url:f,title:f?T0e(f):"",open:d,align:"start",sideOffset:-3,openDelay:100,closeDelay:200,onMouseOverChange:s,anchor:I.jsxs(E.Field,{onMouseOverChange:a,children:[I.jsx(E.FieldIcon,{children:I.jsx(E.Icon,{name:"link"})}),I.jsx(E.FieldLabel,{htmlFor:n,children:wr(t)}),I.jsx(E.FieldControl,{children:I.jsx(E.TextInput,{id:n,onValueChange:p,placeholder:cu(t),readOnly:i,value:l??"",variant:f?"link":"normal",onFocus:()=>a(!0),onBlur:()=>a(!1),endAdornment:I.jsx(_0e,{hasLink:Boolean(l),onUnlink:()=>p("")})})})]})})};function $0e(e,t){if(t)return e?{__TYPE__:"LinkContent",value:{...e,url:t}}:{__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:t}}}function T0e(e){return e.host.split(".").slice(0,-1).filter(t=>t!=="www").map(b0e).join("")}const I0e=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var u,s;const o=Number(e==null?void 0:e.value),a=Number.isFinite(o)?o:void 0;return I.jsxs(E.Field,{children:[I.jsx(E.FieldIcon,{children:I.jsx(E.Icon,{name:"pin"})}),I.jsx(E.FieldLabel,{htmlFor:n,children:wr(t)}),I.jsx(E.FieldControl,{children:I.jsx(E.NumberInput,{id:n,value:a,min:(u=t.config)==null?void 0:u.min,max:(s=t.config)==null?void 0:s.max,placeholder:cu(t),readOnly:i,onValueChange:c=>r(O0e(c))})})]})};function O0e(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(e)}}function gn(e){this.content=e}gn.prototype={constructor:gn,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new gn(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new gn(n)},addToStart:function(e,t){return new gn([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new gn(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new gn(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=gn.from(e),e.size?new gn(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=gn.from(e),e.size?new gn(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=gn.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},gn.from=function(e){if(e instanceof gn)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new gn(t)};function t3(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){let a=t3(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function n3(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let a=e.child(--i),u=t.child(--o),s=a.nodeSize;if(a==u){n-=s,r-=s;continue}if(!a.sameMarkup(u))return{a:n,b:r};if(a.isText&&a.text!=u.text){let c=0,l=Math.min(a.text.length,u.text.length);for(;c<l&&a.text[a.text.length-c-1]==u.text[u.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||u.content.size){let c=n3(a.content,u.content,n-1,r-1);if(c)return c}n-=s,r-=s}}class z{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let a=0,u=0;u<n;a++){let s=this.content[a],c=u+s.nodeSize;if(c>t&&r(s,i+u,o||null,a)!==!1&&s.content.size){let l=u+1;s.nodesBetween(Math.max(0,t-l),Math.min(s.content.size,n-l),r,i+l)}u=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",a=!0;return this.nodesBetween(t,n,(u,s)=>{u.isText?(o+=u.text.slice(Math.max(t,s)-s,n-s),a=!r):u.isLeaf?(i?o+=typeof i=="function"?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 z(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&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.isText?u=u.cut(Math.max(0,t-a),Math.min(u.text.length,n-a)):u=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 z(r,i)}cutByIndex(t,n){return t==n?z.empty:t==0&&n==this.content.length?this:new z(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 z(i,o)}addToStart(t){return new z([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new z(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 new 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 t3(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return n3(this,t,n,r)}findIndex(t,n=-1){if(t==0)return Qy(0,t);if(t==this.size)return Qy(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=t)return a==t||n>0?Qy(r+1,a):Qy(r,i);i=a}}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 z.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new z(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return z.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 z(n||t,r)}static from(t){if(!t)return z.empty;if(t instanceof z)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new z([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}z.empty=new z([],0);const qC={index:0,offset:0};function Qy(e,t){return qC.index=e,qC.offset=t,qC}function eb(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!eb(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!eb(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let rt=class LR{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&&eb(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 new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new 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(t){if(!t||Array.isArray(t)&&t.length==0)return LR.none;if(t instanceof LR)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};rt.none=[];class tb extends Error{}class se{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=i3(this.content,t+this.openStart,n);return r&&new se(r,this.openStart,this.openEnd)}removeBetween(t,n){return new se(r3(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 se.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new se(z.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 o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new se(t,r,i)}}se.empty=new se(z.empty,0,0);function r3(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:a,offset:u}=e.findIndex(n);if(i==t||o.isText){if(u!=n&&!e.child(a).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(r3(o.content,t-i-1,n-i-1)))}function i3(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),a=e.maybeChild(i);if(o==t||a.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=i3(a.content,t-o-1,n);return u&&e.replaceChild(i,a.copy(u))}function w0e(e,t,n){if(n.openStart>e.depth)throw new tb("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new tb("Inconsistent open depths");return o3(e,t,n,0)}function o3(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let a=o3(e,t,n,r+1);return o.copy(o.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let a=e.parent,u=a.content;return ec(a,u.cut(0,e.parentOffset).append(n.content).append(u.cut(t.parentOffset)))}else{let{start:a,end:u}=C0e(n,e);return ec(o,u3(e,a,u,t,r))}else return ec(o,nb(e,t,r))}function a3(e,t){if(!t.type.compatibleContent(e.type))throw new tb("Cannot join "+t.type.name+" onto "+e.type.name)}function UC(e,t,n){let r=e.node(n);return a3(r,t.node(n)),r}function Qs(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function $h(e,t,n,r){let i=(t||e).node(n),o=0,a=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Qs(e.nodeAfter,r),o++));for(let u=o;u<a;u++)Qs(i.child(u),r);t&&t.depth==n&&t.textOffset&&Qs(t.nodeBefore,r)}function ec(e,t){return e.type.checkContent(t),e.copy(t)}function u3(e,t,n,r,i){let o=e.depth>i&&UC(e,t,i+1),a=r.depth>i&&UC(n,r,i+1),u=[];return $h(null,e,i,u),o&&a&&t.index(i)==n.index(i)?(a3(o,a),Qs(ec(o,u3(e,t,n,r,i+1)),u)):(o&&Qs(ec(o,nb(e,t,i+1)),u),$h(t,n,i,u),a&&Qs(ec(a,nb(n,r,i+1)),u)),$h(r,null,i,u),new z(u)}function nb(e,t,n){let r=[];if($h(null,e,n,r),e.depth>n){let i=UC(e,t,n+1);Qs(ec(i,nb(e,t,n+1)),r)}return $h(t,null,n,r),new z(r)}function C0e(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)i=t.node(o).copy(z.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class Th{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?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[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].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):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-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(t.content.size==0)return rt.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let u=r;r=i,i=u}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}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++)r[o].type.spec.inclusive===!1&&(!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 rb(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 new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=t;;){let{index:u,offset:s}=a.content.findIndex(o),c=o-s;if(r.push(a,u,i+s),!c||(a=a.child(u),a.isText))break;o=c-1,i+=s+1}return new Th(n,r,o)}static resolveCached(t,n){for(let i=0;i<BC.length;i++){let o=BC[i];if(o.pos==n&&o.doc==t)return o}let r=BC[zC]=Th.resolve(t,n);return zC=(zC+1)%E0e,r}}let BC=[],zC=0,E0e=12;class rb{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)}}const R0e=Object.create(null);let tc=class DR{constructor(t,n,r,i=rt.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||z.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&&eb(this.attrs,n||t.defaultAttrs||R0e)&&rt.sameSet(this.marks,r||rt.none)}copy(t=null){return t==this.content?this:new DR(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new DR(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return se.empty;let i=this.resolve(t),o=this.resolve(n),a=r?0:i.sharedDepth(n),u=i.start(a),c=i.node(a).content.cut(i.pos-u,o.pos-u);return new se(c,i.depth-a,o.depth-a)}replace(t,n,r){return w0e(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),!n)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(t==0)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 Th.resolveCached(this,t)}resolveNoCache(t){return Th.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,o=>(r.isInSet(o.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()+")"),s3(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=z.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:!1}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=rt.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!rt.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.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(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=z.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}};tc.prototype.text=void 0;class ib extends tc{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):s3(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 ib(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new ib(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&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 s3(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class nc{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new M0e(t,n);if(r.next==null)return nc.empty;let i=c3(r);r.next&&r.err("Unexpected trailing text");let o=W0e(P0e(i));return j0e(o,r),o}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 this.next.length!=0&&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];function o(a,u){let s=a.matchFragment(t,r);if(s&&(!n||s.validEnd))return z.from(u.map(c=>c.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:l,next:f}=a.next[c];if(!(l.isText||l.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let d=o(f,u.concat(l));if(d)return d}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}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 a=0;a<o.next.length;a++){let{type:u,next:s}=o.next[a];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in n)&&(!i.type||s.validEnd)&&(r.push({match:u.contentMatch,type:u,via:i}),n[u.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+t.indexOf(r.next[a].next);return o}).join(`
|
|
30
|
+
`)}}nc.empty=new nc(!0);class M0e{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 new SyntaxError(t+" (in content expression '"+this.string+"')")}}function c3(e){let t=[];do t.push(x0e(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function x0e(e){let t=[];do t.push(k0e(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function k0e(e){let t=F0e(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=A0e(e,t);else break;return t}function l3(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function A0e(e,t){let n=l3(e),r=n;return e.eat(",")&&(e.next!="}"?r=l3(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function N0e(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let a=n[o];a.groups.indexOf(t)>-1&&i.push(a)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function F0e(e){if(e.eat("(")){let t=c3(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=N0e(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function P0e(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(a,u,s){let c={term:s,to:u};return t[a].push(c),c}function i(a,u){a.forEach(s=>s.to=u)}function o(a,u){if(a.type=="choice")return a.exprs.reduce((s,c)=>s.concat(o(c,u)),[]);if(a.type=="seq")for(let s=0;;s++){let c=o(a.exprs[s],u);if(s==a.exprs.length-1)return c;i(c,u=n())}else if(a.type=="star"){let s=n();return r(u,s),i(o(a.expr,s),s),[r(s)]}else if(a.type=="plus"){let s=n();return i(o(a.expr,u),s),i(o(a.expr,s),s),[r(s)]}else{if(a.type=="opt")return[r(u)].concat(o(a.expr,u));if(a.type=="range"){let s=u;for(let c=0;c<a.min;c++){let l=n();i(o(a.expr,s),l),s=l}if(a.max==-1)i(o(a.expr,s),s);else for(let c=a.min;c<a.max;c++){let l=n();r(s,l),i(o(a.expr,s),l),s=l}return[r(s)]}else{if(a.type=="name")return[r(u,void 0,a.value)];throw new Error("Unknown expr type")}}}}function f3(e,t){return t-e}function d3(e,t){let n=[];return r(t),n.sort(f3);function r(i){let o=e[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let a=0;a<o.length;a++){let{term:u,to:s}=o[a];!u&&n.indexOf(s)==-1&&r(s)}}}function W0e(e){let t=Object.create(null);return n(d3(e,0));function n(r){let i=[];r.forEach(a=>{e[a].forEach(({term:u,to:s})=>{if(!u)return;let c;for(let l=0;l<i.length;l++)i[l][0]==u&&(c=i[l][1]);d3(e,s).forEach(l=>{c||i.push([u,c=[]]),c.indexOf(l)==-1&&c.push(l)})})});let o=t[r.join(",")]=new nc(r.indexOf(e.length-1)>-1);for(let a=0;a<i.length;a++){let u=i[a][1].sort(f3);o.next.push({type:i[a][0],next:t[u.join(",")]||n(u)})}return o}}function j0e(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],o=!i.validEnd,a=[];for(let u=0;u<i.next.length;u++){let{type:s,next:c}=i.next[u];a.push(s.name),o&&!(s.isText||s.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function p3(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function h3(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let o=e[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function m3(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new L0e(e[n]);return t}let v3=class W6{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=m3(r.attrs),this.defaultAttrs=p3(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==nc.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:h3(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new tc(this,this.computeAttrs(t),z.from(n),rt.setFrom(r))}createChecked(t=null,n,r){return n=z.from(n),this.checkContent(n),new tc(this,this.computeAttrs(t),n,rt.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=z.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(z.empty,!0);return o?new tc(this,t,n.append(o),rt.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 new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)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:rt.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,a)=>r[o]=new W6(o,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class L0e{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class ob{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=m3(i.attrs),this.excluded=null;let o=p3(this.attrs);this.instance=o?new rt(this,o):null}create(t=null){return!t&&this.instance?this.instance:new rt(this,h3(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,a)=>r[o]=new ob(o,i++,n,a)),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 D0e{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=gn.from(t.nodes),n.marks=gn.from(t.marks||{}),this.nodes=v3.compile(this.spec.nodes,this),this.marks=ob.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",u=o.spec.marks;o.contentMatch=r[a]||(r[a]=nc.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=u=="_"?null:u?g3(this,u.split(" ")):u==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:g3(this,a.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(typeof t=="string")t=this.nodeType(t);else if(t instanceof v3){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new ib(r,r.defaultAttrs,t,rt.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return tc.fromJSON(this,t)}markFromJSON(t){return rt.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function g3(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],a=o;if(o)n.push(o);else for(let u in e.marks){let s=e.marks[u];(i=="_"||s.spec.group&&s.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=s)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class ff{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=t.nodes[r.node];return i.contentMatch.matchType(i)})}parse(t,n={}){let r=new S3(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new S3(this,n,!0);return r.addAll(t,n.from,n.to),se.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(B0e(t,o.tag)&&(o.namespace===void 0||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)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(!(u.indexOf(t)!=0||a.context&&!r.matchesContext(a.context)||u.length>t.length&&(u.charCodeAt(t.length)!=61||u.slice(t.length+1)!=n))){if(a.getAttrs){let s=a.getAttrs(n);if(s===!1)continue;a.attrs=s||void 0}return a}}}static schemaRules(t){let n=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let u=n[a];if((u.priority==null?50:u.priority)<o)break}n.splice(a,0,i)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=$3(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=$3(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new ff(t,ff.schemaRules(t)))}}const y3={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},q0e={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},b3={ol:!0,ul:!0},ab=1,ub=2,Ih=4;function _3(e,t,n){return t!=null?(t?ab:0)|(t==="full"?ub:0):e&&e.whitespace=="pre"?ab|ub:n&~Ih}class sb{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=rt.none,this.stashMarks=[],this.match=a||(u&Ih?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(z.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(!(this.options&ab)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=z.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(z.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}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):K0e(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&&!y3.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class S3{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=_3(null,n.preserveWhitespace,0)|(r?Ih:0);i?o=new sb(i.type,i.attrs,rt.none,rt.none,!0,n.topMatch||i.type.contentMatch,a):r?o=new sb(null,null,rt.none,rt.none,!0,null,a):o=new sb(t.schema.topNodeType,null,rt.none,rt.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(t.nodeType==3)this.addTextNode(t);else if(t.nodeType==1){let n=t.getAttribute("style");if(!n)this.addElement(t);else{let r=this.readStyles(z0e(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 u=0;u<i.length;u++)this.addPendingMark(i[u]);this.addElement(t);for(let u=0;u<i.length;u++)this.removePendingMark(i[u],a);for(let u=0;u<o.length;u++)this.addPendingMark(o[u])}}}addTextNode(t){let n=t.nodeValue,r=this.top;if(r.options&ub||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&ab)r.options&ub?n=n.replace(/\r\n?/g,`
|
|
31
|
+
`):n=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&&o.nodeName=="BR"||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;b3.hasOwnProperty(r)&&this.parser.normalizeLists&&U0e(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));if(o?o.ignore:q0e.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(y3.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,o.consuming===!1?i:void 0)}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
|
|
32
|
+
`))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=rt.none,r=rt.none;e:for(let i=0;i<t.length;i+=2)for(let o=void 0;;){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(u=>{a.clearMark(u)&&(r=u.addToSet(r))}):n=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(n),a.consuming===!1)o=a;else break}return[n,r]}addElementByRule(t,n,r){let i,o,a;n.node?(o=this.parser.schema.nodes[n.node],o.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(s=>this.insertNode(s));else{let s=t;typeof n.contentElement=="string"?s=t.querySelector(n.contentElement):typeof n.contentElement=="function"?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=r==null?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 i=0;i<n.length;i++)this.enterInner(n[i],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 n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));let r=n.activeMarks;for(let i=0;i<t.marks.length;i++)(!n.type||n.type.allowsMarkType(t.marks[i].type))&&(r=t.marks[i].addToSet(r));return n.content.push(t.mark(r)),!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=_3(t,i,o.options);o.options&Ih&&o.content.length==0&&(a|=Ih),this.nodes.push(new sb(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++)this.find[n].pos==null&&t.nodeType==1&&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++)this.find[i].pos==null&&t.nodeType==1&&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=(u,s)=>{for(;u>=0;u--){let c=n[u];if(c==""){if(u==n.length-1||u==0)continue;for(;s>=o;s--)if(a(u-1,s))return!0;return!1}else{let l=s>0||s==0&&i?this.nodes[s].type:r&&s>=o?r.node(s-o).type:null;if(!l||l.name!=c&&l.groups.indexOf(c)==-1)return!1;s--}}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 n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(t){let n=V0e(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 a=i.popFromStashMark(t);a&&i.type&&i.type.allowsMarkType(a.type)&&(i.activeMarks=a.addToSet(i.activeMarks))}if(i==n)break}}}function U0e(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&b3.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function B0e(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function z0e(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=t.exec(e);)r.push(n[1],n[2].trim());return r}function $3(e){let t={};for(let n in e)t[n]=e[n];return t}function K0e(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],a=u=>{o.push(u);for(let s=0;s<u.edgeCount;s++){let{type:c,next:l}=u.edge(s);if(c==t||o.indexOf(l)<0&&a(l))return!0}};if(a(i.contentMatch))return!0}}function V0e(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}class fo{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=KC(n).createDocumentFragment());let i=r,o=[];return t.forEach(a=>{if(o.length||a.marks.length){let u=0,s=0;for(;u<o.length&&s<a.marks.length;){let c=a.marks[s];if(!this.marks[c.type.name]){s++;continue}if(!c.eq(o[u][0])||c.type.spec.spanning===!1)break;u++,s++}for(;u<o.length;)i=o.pop()[1];for(;s<a.marks.length;){let c=a.marks[s++],l=this.serializeMark(c,a.isInline,n);l&&(o.push([c,i]),i.appendChild(l.dom),i=l.contentDOM||l.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=fo.renderSpec(KC(n),this.nodes[t.type.name](t));if(i){if(t.isLeaf)throw new 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&&fo.renderSpec(KC(r),i(t,n))}static renderSpec(t,n,r=null){if(typeof n=="string")return{dom:t.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,u=r?t.createElementNS(r,i):t.createElement(i),s=n[1],c=1;if(s&&typeof s=="object"&&s.nodeType==null&&!Array.isArray(s)){c=2;for(let l in s)if(s[l]!=null){let f=l.indexOf(" ");f>0?u.setAttributeNS(l.slice(0,f),l.slice(f+1),s[l]):u.setAttribute(l,s[l])}}for(let l=c;l<n.length;l++){let f=n[l];if(f===0){if(l<n.length-1||l>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:d,contentDOM:p}=fo.renderSpec(t,f,r);if(u.appendChild(d),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:u,contentDOM:a}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new fo(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=T3(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return T3(t.marks)}}function T3(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function KC(e){return e.document||window.document}const I3=65535,O3=Math.pow(2,16);function H0e(e,t){return e+t*O3}function w3(e){return e&I3}function G0e(e){return(e-(e&I3))/O3}const C3=1,E3=2,cb=4,R3=8;class VC{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&R3)>0}get deletedBefore(){return(this.delInfo&(C3|cb))>0}get deletedAfter(){return(this.delInfo&(E3|cb))>0}get deletedAcross(){return(this.delInfo&cb)>0}}class Hr{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Hr.empty)return Hr.empty}recover(t){let n=0,r=w3(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+G0e(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?i:0);if(s>t)break;let c=this.ranges[u+o],l=this.ranges[u+a],f=s+c;if(t<=f){let d=c?t==s?-1:t==f?1:n:n,p=s+i+(d<0?0:l);if(r)return p;let h=t==(n<0?s:f)?null:H0e(u/3,t-s),v=t==s?E3:t==f?C3:cb;return(n<0?t!=s:t!=f)&&(v|=R3),new VC(p,v,h)}i+=l-c}return r?t+i:new VC(t+i,0,null)}touches(t,n){let r=0,i=w3(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let s=this.ranges[u]-(this.inverted?r:0);if(s>t)break;let c=this.ranges[u+o],l=s+c;if(t<=l&&u==i*3)return!0;r+=this.ranges[u+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],u=a-(this.inverted?o:0),s=a+(this.inverted?0:o),c=this.ranges[i+n],l=this.ranges[i+r];t(u,u+c,s,s+l),o+=l-c}}invert(){return new Hr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Hr.empty:new Hr(t<0?[0,-t,0]:[0,0,t])}}Hr.empty=new Hr([]);class Oh{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 Oh(this.maps,this.mirror,t,n)}copy(){return new Oh(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),n!=null&&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],i!=null&&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(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new Oh;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],u=a.mapResult(t,n);if(u.recover!=null){let s=this.getMirror(o);if(s!=null&&s>o&&s<this.to){o=s,t=this.maps[s].recover(u.recover);continue}}i|=u.delInfo,t=u.pos}return r?t:new VC(t,i,null)}}const HC=Object.create(null);class ur{getMap(){return Hr.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=HC[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in HC)throw new RangeError("Duplicate use of step JSON ID "+t);return HC[t]=n,n.prototype.jsonID=t,n}}class Vt{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Vt(t,null)}static fail(t){return new Vt(null,t)}static fromReplace(t,n,r,i){try{return Vt.ok(t.replace(n,r,i))}catch(o){if(o instanceof tb)return Vt.fail(o.message);throw o}}}function GC(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(GC(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return z.fromArray(r)}class hu extends ur{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 se(GC(n.content,(a,u)=>!a.isAtom||!u.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return Vt.fromReplace(t,this.from,this.to,o)}invert(){return new po(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 hu(n.pos,r.pos,this.mark)}merge(t){return t instanceof hu&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new hu(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(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new hu(n.from,n.to,t.markFromJSON(n.mark))}}ur.jsonID("addMark",hu);class po extends ur{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 se(GC(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Vt.fromReplace(t,this.from,this.to,r)}invert(){return new hu(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 po(n.pos,r.pos,this.mark)}merge(t){return t instanceof po&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new po(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(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new po(n.from,n.to,t.markFromJSON(n.mark))}}ur.jsonID("removeMark",po);class mu extends ur{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Vt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Vt.fromReplace(t,this.pos,this.pos+1,new se(z.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 mu(this.pos,n.marks[i]);return new mu(this.pos,this.mark)}}return new df(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new mu(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new mu(n.pos,t.markFromJSON(n.mark))}}ur.jsonID("addNodeMark",mu);class df extends ur{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Vt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Vt.fromReplace(t,this.pos,this.pos+1,new se(z.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new mu(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new df(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new df(n.pos,t.markFromJSON(n.mark))}}ur.jsonID("removeNodeMark",df);class En extends ur{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&YC(t,this.from,this.to)?Vt.fail("Structure replace would overwrite content"):Vt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Hr([this.from,this.to-this.from,this.slice.size])}invert(t){return new En(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 En(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof En)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?se.empty:new se(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new En(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?se.empty:new se(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new En(t.from,this.to,n,this.structure)}else return null}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(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new En(n.from,n.to,se.fromJSON(t,n.slice),!!n.structure)}}ur.jsonID("replace",En);class tn extends ur{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&&(YC(t,this.from,this.gapFrom)||YC(t,this.gapTo,this.to)))return Vt.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Vt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Vt.fromReplace(t,this.from,this.to,r):Vt.fail("Content does not fit in gap")}getMap(){return new Hr([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 tn(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 tn(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(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new tn(n.from,n.to,n.gapFrom,n.gapTo,se.fromJSON(t,n.slice),n.insert,!!n.structure)}}ur.jsonID("replaceAround",tn);function YC(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function Y0e(e,t,n,r){let i=[],o=[],a,u;e.doc.nodesBetween(t,n,(s,c,l)=>{if(!s.isInline)return;let f=s.marks;if(!r.isInSet(f)&&l.type.allowsMarkType(r.type)){let d=Math.max(c,t),p=Math.min(c+s.nodeSize,n),h=r.addToSet(f);for(let v=0;v<f.length;v++)f[v].isInSet(h)||(a&&a.to==d&&a.mark.eq(f[v])?a.to=p:i.push(a=new po(d,p,f[v])));u&&u.to==d?u.to=p:o.push(u=new hu(d,p,r))}}),i.forEach(s=>e.step(s)),o.forEach(s=>e.step(s))}function J0e(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,(a,u)=>{if(!a.isInline)return;o++;let s=null;if(r instanceof ob){let c=a.marks,l;for(;l=r.isInSet(c);)(s||(s=[])).push(l),c=l.removeFromSet(c)}else r?r.isInSet(a.marks)&&(s=[r]):s=a.marks;if(s&&s.length){let c=Math.min(u+a.nodeSize,n);for(let l=0;l<s.length;l++){let f=s[l],d;for(let p=0;p<i.length;p++){let h=i[p];h.step==o-1&&f.eq(i[p].style)&&(d=h)}d?(d.to=c,d.step=o):i.push({style:f,from:Math.max(u,t),to:c,step:o})}}}),i.forEach(a=>e.step(new po(a.from,a.to,a.style)))}function Z0e(e,t,n,r=n.contentMatch){let i=e.doc.nodeAt(t),o=[],a=t+1;for(let u=0;u<i.childCount;u++){let s=i.child(u),c=a+s.nodeSize,l=r.matchType(s.type);if(!l)o.push(new En(a,c,se.empty));else{r=l;for(let f=0;f<s.marks.length;f++)n.allowsMarkType(s.marks[f].type)||e.step(new po(a,c,s.marks[f]))}a=c}if(!r.validEnd){let u=r.fillBefore(z.empty,!0);e.replace(a,a,new se(u,0,0))}for(let u=o.length-1;u>=0;u--)e.step(o[u])}function X0e(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function pf(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let i=e.$from.node(r),o=e.$from.index(r),a=e.$to.indexAfter(r);if(r<e.depth&&i.canReplace(o,a,n))return r;if(r==0||i.type.spec.isolating||!X0e(i,o,a))break}return null}function Q0e(e,t,n){let{$from:r,$to:i,depth:o}=t,a=r.before(o+1),u=i.after(o+1),s=a,c=u,l=z.empty,f=0;for(let h=o,v=!1;h>n;h--)v||r.index(h)>0?(v=!0,l=z.from(r.node(h).copy(l)),f++):s--;let d=z.empty,p=0;for(let h=o,v=!1;h>n;h--)v||i.after(h+1)<i.end(h)?(v=!0,d=z.from(i.node(h).copy(d)),p++):c++;e.step(new tn(s,c,a,u,new se(l.append(d),f,p),l.size-f,!0))}function JC(e,t,n=null,r=e){let i=eTe(e,t),o=i&&tTe(r,t);return o?i.map(M3).concat({type:t,attrs:n}).concat(o.map(M3)):null}function M3(e){return{type:e,attrs:null}}function eTe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let a=o.length?o[0]:t;return n.canReplaceWith(r,i,a)?o:null}function tTe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),a=t.contentMatch.findWrapping(o.type);if(!a)return null;let s=(a.length?a[a.length-1]:t).contentMatch;for(let c=r;s&&c<i;c++)s=s.matchType(n.child(c).type);return!s||!s.validEnd?null:a}function nTe(e,t,n){let r=z.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let u=n[a].type.contentMatch.matchFragment(r);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=z.from(n[a].type.create(n[a].attrs,r))}let i=t.start,o=t.end;e.step(new tn(i,o,i,o,new se(r,0,0),n.length,!0))}function rTe(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(a,u)=>{if(a.isTextblock&&!a.hasMarkup(r,i)&&iTe(e.doc,e.mapping.slice(o).map(u),r)){e.clearIncompatible(e.mapping.slice(o).map(u,1),r);let s=e.mapping.slice(o),c=s.map(u,1),l=s.map(u+a.nodeSize,1);return e.step(new tn(c,l,c+1,l-1,new se(z.from(r.create(i,null,a.marks)),0,0),1,!0)),!1}})}function iTe(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function oTe(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let a=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,a);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new tn(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new se(z.from(a),0,0),1,!0))}function hf(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,l=n-2;c>o;c--,l--){let f=i.node(c),d=i.index(c);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(d,f.childCount),h=r&&r[l]||f;if(h!=f&&(p=p.replaceChild(0,h.type.create(h.attrs))),!f.canReplace(d+1,f.childCount)||!h.type.validContent(p))return!1}let u=i.indexAfter(o),s=r&&r[0];return i.node(o).canReplaceWith(u,u,s?s.type:i.node(o+1).type)}function aTe(e,t,n=1,r){let i=e.doc.resolve(t),o=z.empty,a=z.empty;for(let u=i.depth,s=i.depth-n,c=n-1;u>s;u--,c--){o=z.from(i.node(u).copy(o));let l=r&&r[c];a=z.from(l?l.type.create(l.attrs,a):i.node(u).copy(a))}e.step(new En(t,t,new se(o.append(a),n,n),!0))}function vu(e,t){let n=e.resolve(t),r=n.index();return x3(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function x3(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function k3(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,a,u=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):n>0?(o=r.node(i+1),u++,a=r.node(i).maybeChild(u)):(o=r.node(i).maybeChild(u-1),a=r.node(i+1)),o&&!o.isTextblock&&x3(o,a)&&r.node(i).canReplace(u,u+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function uTe(e,t,n){let r=new En(t-n,t+n,se.empty,!0);e.step(r)}function sTe(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function cTe(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let a=r.depth;a>=0;a--){let u=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,s=r.index(a)+(u>0?1:0),c=r.node(a),l=!1;if(o==1)l=c.canReplace(s,s,i);else{let f=c.contentMatchAt(s).findWrapping(i.firstChild.type);l=f&&c.canReplaceWith(s,s,f[0])}if(l)return u==0?r.pos:u<0?r.before(a+1):r.after(a+1)}return null}function ZC(e,t,n=t,r=se.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return A3(i,o,r)?new En(t,n,r):new lTe(i,o,r).fit()}function A3(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class lTe{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=z.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 i=t.depth;i>0;i--)this.placed=z.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,a=r.depth,u=i.depth;for(;a&&u&&o.childCount==1;)o=o.firstChild.content,a--,u--;let s=new se(o,a,u);return t>-1?new tn(r.pos,t,this.$to.pos,this.$to.end(),s,n):s.size||r.pos!=this.$to.pos?new En(r.pos,i.pos,s):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 n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=XC(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let a=i.firstChild;for(let u=this.depth;u>=0;u--){let{type:s,match:c}=this.frontier[u],l,f=null;if(n==1&&(a?c.matchType(a.type)||(f=c.fillBefore(z.from(a),!1)):o&&s.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:u,parent:o,inject:f};if(n==2&&a&&(l=c.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:u,parent:o,wrap:l};if(o&&c.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=XC(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new se(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=XC(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new se(wh(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new se(wh(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 v=0;v<o.length;v++)this.openFrontierNode(o[v]);let a=this.unplaced,u=r?r.content:a.content,s=a.openStart-t,c=0,l=[],{match:f,type:d}=this.frontier[n];if(i){for(let v=0;v<i.childCount;v++)l.push(i.child(v));f=f.matchFragment(i)}let p=u.size+t-(a.content.size-a.openEnd);for(;c<u.childCount;){let v=u.child(c),m=f.matchType(v.type);if(!m)break;c++,(c>1||s==0||v.content.size)&&(f=m,l.push(N3(v.mark(d.allowedMarks(v.marks)),c==1?s:0,c==u.childCount?p:-1)))}let h=c==u.childCount;h||(p=-1),this.placed=Ch(this.placed,n,z.from(l)),this.frontier[n].match=f,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,m=u;v<p;v++){let _=m.lastChild;this.frontier.push({type:_.type,match:_.contentMatchAt(_.childCount)}),m=_.content}this.unplaced=h?t==0?se.empty:new se(wh(a.content,t-1,1),t-1,p<0?a.openEnd:t-1):new se(wh(a.content,t,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!QC(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=QC(t,n,i,r,o);if(a){for(let u=n-1;u>=0;u--){let{match:s,type:c}=this.frontier[u],l=QC(t,u,c,s,!0);if(!l||l.childCount)continue e}return{depth:n,fit:a,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Ch(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=Ch(this.placed,this.depth,z.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(z.empty,!0);n.childCount&&(this.placed=Ch(this.placed,this.frontier.length,n))}}function wh(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(wh(e.firstChild.content,t-1,n)))}function Ch(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Ch(e.lastChild.content,t-1,n)))}function XC(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function N3(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,N3(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(z.empty,!0)))),e.copy(r)}function QC(e,t,n,r,i){let o=e.node(t),a=i?e.indexAfter(t):e.index(t);if(a==o.childCount&&!n.compatibleContent(o.type))return null;let u=r.fillBefore(o.content,!0,a);return u&&!fTe(n,o.content,a)?u:null}function fTe(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function dTe(e){return e.spec.defining||e.spec.definingForContent}function pTe(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(A3(i,o,r))return e.step(new En(t,n,r));let a=P3(i,e.doc.resolve(n));a[a.length-1]==0&&a.pop();let u=-(i.depth+1);a.unshift(u);for(let d=i.depth,p=i.pos-1;d>0;d--,p--){let h=i.node(d).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;a.indexOf(d)>-1?u=d:i.before(d)==p&&a.splice(1,0,-d)}let s=a.indexOf(u),c=[],l=r.openStart;for(let d=r.content,p=0;;p++){let h=d.firstChild;if(c.push(h),p==r.openStart)break;d=h.content}for(let d=l-1;d>=0;d--){let p=c[d].type,h=dTe(p);if(h&&i.node(s).type!=p)l=d;else if(h||!p.isTextblock)break}for(let d=r.openStart;d>=0;d--){let p=(d+l+1)%(r.openStart+1),h=c[p];if(h)for(let v=0;v<a.length;v++){let m=a[(v+s)%a.length],_=!0;m<0&&(_=!1,m=-m);let g=i.node(m-1),S=i.index(m-1);if(g.canReplaceWith(S,S,h.type,h.marks))return e.replace(i.before(m),_?o.after(m):n,new se(F3(r.content,0,r.openStart,p),p,r.openEnd))}}let f=e.steps.length;for(let d=a.length-1;d>=0&&(e.replace(t,n,r),!(e.steps.length>f));d--){let p=a[d];p<0||(t=i.before(p),n=o.after(p))}}function F3(e,t,n,r,i){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(F3(o.content,t+1,n,r,o)))}if(t>r){let o=i.contentMatchAt(0),a=o.fillBefore(e).append(e);e=a.append(o.matchFragment(a).fillBefore(z.empty,!0))}return e}function hTe(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=sTe(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new se(z.from(r),0,0))}function mTe(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=P3(r,i);for(let a=0;a<o.length;a++){let u=o[a],s=a==o.length-1;if(s&&u==0||r.node(u).type.contentMatch.validEnd)return e.delete(r.start(u),i.end(u));if(u>0&&(s||r.node(u-1).canReplace(r.index(u-1),i.indexAfter(u-1))))return e.delete(r.before(u),i.after(u))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a)return e.delete(r.before(a),n);e.delete(t,n)}function P3(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let o=e.start(i);if(o<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(o==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==o-1)&&n.push(i)}return n}class mf extends ur{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 Vt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Vt.fromReplace(t,this.pos,this.pos+1,new se(z.from(i),0,n.isLeaf?0:1))}getMap(){return Hr.empty}invert(t){return new mf(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 mf(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new mf(n.pos,n.attr,n.value)}}ur.jsonID("attr",mf);let vf=class extends Error{};vf=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},vf.prototype=Object.create(Error.prototype),vf.prototype.constructor=vf,vf.prototype.name="TransformError";class vTe{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Oh}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new vf(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=se.empty){let i=ZC(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new se(z.from(r),0,0))}delete(t,n){return this.replace(t,n,se.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return pTe(this,t,n,r),this}replaceRangeWith(t,n,r){return hTe(this,t,n,r),this}deleteRange(t,n){return mTe(this,t,n),this}lift(t,n){return Q0e(this,t,n),this}join(t,n=1){return uTe(this,t,n),this}wrap(t,n){return nTe(this,t,n),this}setBlockType(t,n=t,r,i=null){return rTe(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return oTe(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new mf(t,n,r)),this}addNodeMark(t,n){return this.step(new mu(t,n)),this}removeNodeMark(t,n){if(!(n instanceof rt)){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n=n.isInSet(r.marks),!n)return this}return this.step(new df(t,n)),this}split(t,n=1,r){return aTe(this,t,n,r),this}addMark(t,n,r){return Y0e(this,t,n,r),this}removeMark(t,n,r){return J0e(this,t,n,r),this}clearIncompatible(t,n,r){return Z0e(this,t,n,r),this}}const eE=Object.create(null);class We{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new gTe(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=se.empty){let r=n.content.lastChild,i=null;for(let u=0;u<n.openEnd;u++)i=r,r=r.lastChild;let o=t.steps.length,a=this.ranges;for(let u=0;u<a.length;u++){let{$from:s,$to:c}=a[u],l=t.mapping.slice(o);t.replaceRange(l.map(s.pos),l.map(c.pos),u?se.empty:n),u==0&&L3(t,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:u}=i[o],s=t.mapping.slice(r),c=s.map(a.pos),l=s.map(u.pos);o?t.deleteRange(c,l):(t.replaceRangeWith(c,l,n),L3(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new Be(t):gf(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?gf(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):gf(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 ki(t.node(0))}static atStart(t){return gf(t,t,0,0,1)||new ki(t)}static atEnd(t){return gf(t,t,t.content.size,t.childCount,-1)||new ki(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=eE[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in eE)throw new RangeError("Duplicate use of selection JSON ID "+t);return eE[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Be.between(this.$anchor,this.$head).getBookmark()}}We.prototype.visible=!0;class gTe{constructor(t,n){this.$from=t,this.$to=n}}let W3=!1;function j3(e){!W3&&!e.parent.inlineContent&&(W3=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Be extends We{constructor(t,n=t){j3(t),j3(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 We.near(r);let i=t.resolve(n.map(this.anchor));return new Be(i.parent.inlineContent?i:r,r)}replace(t,n=se.empty){if(super.replace(t,n),n==se.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Be&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new lb(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Be(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=We.findFrom(n,r,!0)||We.findFrom(n,-r,!0);if(o)n=o.$head;else return We.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(We.findFrom(t,-r,!0)||We.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new Be(t,n)}}We.jsonID("text",Be);class lb{constructor(t,n){this.anchor=t,this.head=n}map(t){return new lb(t.map(this.anchor),t.map(this.head))}resolve(t){return Be.between(t.resolve(this.anchor),t.resolve(this.head))}}class Se extends We{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=t.resolve(i);return r?We.near(o):new Se(o)}content(){return new se(z.from(this.node),0,0)}eq(t){return t instanceof Se&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new tE(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Se(t.resolve(n.anchor))}static create(t,n){return new Se(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}Se.prototype.visible=!1,We.jsonID("node",Se);class tE{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new lb(r,r):new tE(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&Se.isSelectable(r)?new Se(n):We.near(n)}}class ki extends We{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=se.empty){if(n==se.empty){t.delete(0,t.doc.content.size);let r=We.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new ki(t)}map(t){return new ki(t)}eq(t){return t instanceof ki}getBookmark(){return yTe}}We.jsonID("all",ki);const yTe={map(){return this},resolve(e){return new ki(e)}};function gf(e,t,n,r,i,o=!1){if(t.inlineContent)return Be.create(e,n);for(let a=r-(i>0?0:1);i>0?a<t.childCount:a>=0;a+=i){let u=t.child(a);if(u.isAtom){if(!o&&Se.isSelectable(u))return Se.create(e,n-(i<0?u.nodeSize:0))}else{let s=gf(e,u,n+i,i<0?u.childCount:0,i,o);if(s)return s}n+=u.nodeSize*i}return null}function L3(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof En||i instanceof tn))return;let o=e.mapping.maps[r],a;o.forEach((u,s,c,l)=>{a==null&&(a=l)}),e.setSelection(We.near(e.doc.resolve(a),n))}const D3=1,fb=2,q3=4;class bTe extends vTe{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 new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|D3)&~fb,this.storedMarks=null,this}get selectionSet(){return(this.updated&D3)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=fb,this}ensureMarks(t){return rt.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(this.updated&fb)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~fb,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)||rt.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(r==null&&(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(We.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=q3,this}get scrolledIntoView(){return(this.updated&q3)>0}}function U3(e,t){return!t||!e?e:e.bind(t)}class Eh{constructor(t,n,r){this.name=t,this.init=U3(n.init,r),this.apply=U3(n.apply,r)}}const _Te=[new Eh("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Eh("selection",{init(e,t){return e.selection||We.atStart(t.doc)},apply(e){return e.selection}}),new Eh("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Eh("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class nE{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=_Te.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Eh(r.key,r.spec.state,r))})}}class yf{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),i=null;for(;;){let o=!1;for(let a=0;a<this.config.plugins.length;a++){let u=this.config.plugins[a];if(u.spec.appendTransaction){let s=i?i[a].n:0,c=i?i[a].state:this,l=s<n.length&&u.spec.appendTransaction.call(u,s?n.slice(s):n,c,r);if(l&&r.filterTransaction(l,a)){if(l.setMeta("appendedTransaction",t),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<a?{state:r,n:n.length}:{state:this,n:0})}n.push(l),r=r.applyInner(l),o=!0}i&&(i[a]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new yf(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 bTe(this)}static create(t){let n=new nE(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new yf(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 nE(this.schema,t.plugins),r=n.fields,i=new yf(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(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new 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 new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new nE(t.schema,t.plugins),o=new yf(i);return i.fields.forEach(a=>{if(a.name=="doc")o.doc=tc.fromJSON(t.schema,n.doc);else if(a.name=="selection")o.selection=We.fromJSON(o.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let u in r){let s=r[u],c=s.spec.state;if(s.key==a.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,u)){o[a.name]=c.fromJSON.call(s,t,n[u],o);return}}o[a.name]=a.init(t,o)}}),o}}function B3(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=B3(i,t,{})),n[r]=i}return n}class Gr{constructor(t){this.spec=t,this.props={},t.props&&B3(t.props,this,this.props),this.key=t.key?t.key.key:z3("plugin")}getState(t){return t[this.key]}}const rE=Object.create(null);function z3(e){return e in rE?e+"$"+ ++rE[e]:(rE[e]=0,e+"$")}class gu{constructor(t="key"){this.key=z3(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Cr=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Rh=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let K3=null;const ba=function(e,t,n){let r=K3||(K3=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},rc=function(e,t,n,r){return n&&(V3(e,t,n,r,-1)||V3(e,t,n,r,1))},STe=/^(img|br|input|textarea|hr)$/i;function V3(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:ho(e))){let o=e.parentNode;if(!o||o.nodeType!=1||TTe(e)||STe.test(e.nodeName)||e.contentEditable=="false")return!1;t=Cr(e)+(i<0?0:1),e=o}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.contentEditable=="false")return!1;t=i<0?ho(e):0}else return!1}}function ho(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function $Te(e,t,n){for(let r=t==0,i=t==ho(e);r||i;){if(e==n)return!0;let o=Cr(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,i=i&&o==ho(e)}}function TTe(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const db=function(e){return e.focusNode&&rc(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function ic(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function ITe(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}const yu=typeof navigator<"u"?navigator:null,H3=typeof document<"u"?document:null,bu=yu&&yu.userAgent||"",iE=/Edge\/(\d+)/.exec(bu),G3=/MSIE \d/.exec(bu),oE=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(bu),sr=!!(G3||oE||iE),_u=G3?document.documentMode:oE?+oE[1]:iE?+iE[1]:0,Ai=!sr&&/gecko\/(\d+)/i.test(bu);Ai&&+(/Firefox\/(\d+)/.exec(bu)||[0,0])[1];const aE=!sr&&/Chrome\/(\d+)/.exec(bu),Bn=!!aE,OTe=aE?+aE[1]:0,zn=!sr&&!!yu&&/Apple Computer/.test(yu.vendor),bf=zn&&(/Mobile\/\w+/.test(bu)||!!yu&&yu.maxTouchPoints>2),Yr=bf||(yu?/Mac/.test(yu.platform):!1),Ni=/Android \d/.test(bu),pb=!!H3&&"webkitFontSmoothing"in H3.documentElement.style,wTe=pb?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function CTe(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Su(e,t){return typeof e=="number"?e:e[t]}function ETe(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Y3(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let a=n||e.dom;a;a=Rh(a)){if(a.nodeType!=1)continue;let u=a,s=u==o.body,c=s?CTe(o):ETe(u),l=0,f=0;if(t.top<c.top+Su(r,"top")?f=-(c.top-t.top+Su(i,"top")):t.bottom>c.bottom-Su(r,"bottom")&&(f=t.bottom-c.bottom+Su(i,"bottom")),t.left<c.left+Su(r,"left")?l=-(c.left-t.left+Su(i,"left")):t.right>c.right-Su(r,"right")&&(l=t.right-c.right+Su(i,"right")),l||f)if(s)o.defaultView.scrollBy(l,f);else{let d=u.scrollLeft,p=u.scrollTop;f&&(u.scrollTop+=f),l&&(u.scrollLeft+=l);let h=u.scrollLeft-d,v=u.scrollTop-p;t={left:t.left-h,top:t.top-v,right:t.right-h,bottom:t.bottom-v}}if(s)break}}function RTe(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let o=(t.left+t.right)/2,a=n+1;a<Math.min(innerHeight,t.bottom);a+=5){let u=e.root.elementFromPoint(o,a);if(!u||u==e.dom||!e.dom.contains(u))continue;let s=u.getBoundingClientRect();if(s.top>=n-20){r=u,i=s.top;break}}return{refDOM:r,refTop:i,stack:J3(e.dom)}}function J3(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Rh(r));return t}function MTe({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Z3(n,r==0?0:r-t)}function Z3(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let _f=null;function xTe(e){if(e.setActive)return e.setActive();if(_f)return e.focus(_f);let t=J3(e);e.focus(_f==null?{get preventScroll(){return _f={preventScroll:!0},!0}}:void 0),_f||(_f=!1,Z3(t,0))}function X3(e,t){let n,r=2e8,i,o=0,a=t.top,u=t.top;for(let s=e.firstChild,c=0;s;s=s.nextSibling,c++){let l;if(s.nodeType==1)l=s.getClientRects();else if(s.nodeType==3)l=ba(s).getClientRects();else continue;for(let f=0;f<l.length;f++){let d=l[f];if(d.top<=a&&d.bottom>=u){a=Math.max(d.bottom,a),u=Math.min(d.top,u);let p=d.left>t.left?d.left-t.left:d.right<t.left?t.left-d.right:0;if(p<r){n=s,r=p,i=p&&n.nodeType==3?{left:d.right<t.left?d.right:d.left,top:t.top}:t,s.nodeType==1&&p&&(o=c+(t.left>=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(o=c+1)}}return n&&n.nodeType==3?kTe(n,i):!n||r&&n.nodeType==1?{node:e,offset:o}:X3(n,i)}function kTe(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let o=$u(r,1);if(o.top!=o.bottom&&uE(t,o))return{node:e,offset:i+(t.left>=(o.left+o.right)/2?1:0)}}return{node:e,offset:0}}function uE(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function ATe(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function NTe(e,t,n){let{node:r,offset:i}=X3(t,n),o=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();o=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}function FTe(e,t,n,r){let i=-1;for(let o=t;o!=e.dom;){let a=e.docView.nearestDesc(o,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)){let u=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&(u.left>r.left||u.top>r.top?i=a.posBefore:(u.right<r.left||u.bottom<r.top)&&(i=a.posAfter)),!a.contentDOM&&i<0)return(a.node.isBlock?r.top<(u.top+u.bottom)/2:r.left<(u.left+u.right)/2)?a.posBefore:a.posAfter}o=a.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function Q3(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let a=e.childNodes[o];if(a.nodeType==1){let u=a.getClientRects();for(let s=0;s<u.length;s++){let c=u[s];if(uE(t,c))return Q3(a,t,c)}}if((o=(o+1)%r)==i)break}return e}function PTe(e,t){let n=e.dom.ownerDocument,r,i=0;if(n.caretPositionFromPoint)try{let s=n.caretPositionFromPoint(t.left,t.top);s&&({offsetNode:r,offset:i}=s)}catch{}if(!r&&n.caretRangeFromPoint){let s=n.caretRangeFromPoint(t.left,t.top);s&&({startContainer:r,startOffset:i}=s)}let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),a;if(!o||!e.dom.contains(o.nodeType!=1?o.parentNode:o)){let s=e.dom.getBoundingClientRect();if(!uE(t,s)||(o=Q3(e.dom,t,s),!o))return null}if(zn)for(let s=o;r&&s;s=Rh(s))s.draggable&&(r=void 0);if(o=ATe(o,t),r){if(Ai&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let s=r.childNodes[i],c;s.nodeName=="IMG"&&(c=s.getBoundingClientRect()).right<=t.left&&c.bottom>t.top&&i++}r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=FTe(e,r,i,t))}a==null&&(a=NTe(e,o,t));let u=e.docView.nearestDesc(o,!0);return{pos:a,inside:u?u.posAtStart-u.border:-1}}function $u(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const WTe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function e4(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),a=pb||Ai;if(r.nodeType==3)if(a&&(WTe.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let s=$u(ba(r,i,i),n);if(Ai&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=$u(ba(r,i-1,i-1),-1);if(c.top==s.top){let l=$u(ba(r,i,i+1),-1);if(l.top!=s.top)return Mh(l,l.left<c.left)}}return s}else{let s=i,c=i,l=n<0?1:-1;return n<0&&!i?(c++,l=-1):n>=0&&i==r.nodeValue.length?(s--,l=1):n<0?s--:c++,Mh($u(ba(r,s,c),1),l<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==ho(r))){let s=r.childNodes[i-1];if(s.nodeType==1)return sE(s.getBoundingClientRect(),!1)}if(o==null&&i<ho(r)){let s=r.childNodes[i];if(s.nodeType==1)return sE(s.getBoundingClientRect(),!0)}return sE(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==ho(r))){let s=r.childNodes[i-1],c=s.nodeType==3?ba(s,ho(s)-(a?0:1)):s.nodeType==1&&(s.nodeName!="BR"||!s.nextSibling)?s:null;if(c)return Mh($u(c,1),!1)}if(o==null&&i<ho(r)){let s=r.childNodes[i];for(;s.pmViewDesc&&s.pmViewDesc.ignoreForCoords;)s=s.nextSibling;let c=s?s.nodeType==3?ba(s,0,a?0:1):s.nodeType==1?s:null:null;if(c)return Mh($u(c,-1),!0)}return Mh($u(r.nodeType==3?ba(r):r,-n),n>=0)}function Mh(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function sE(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function t4(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function jTe(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return t4(e,t,()=>{let{node:o}=e.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let u=e.docView.nearestDesc(o,!0);if(!u)break;if(u.node.isBlock){o=u.contentDOM||u.dom;break}o=u.dom.parentNode}let a=e4(e,i.pos,1);for(let u=o.firstChild;u;u=u.nextSibling){let s;if(u.nodeType==1)s=u.getClientRects();else if(u.nodeType==3)s=ba(u,0,u.nodeValue.length).getClientRects();else continue;for(let c=0;c<s.length;c++){let l=s[c];if(l.bottom>l.top+1&&(n=="up"?a.top-l.top>(l.bottom-a.top)*2:l.bottom-a.bottom>(a.bottom-l.top)*2))return!1}}return!0})}const LTe=/[\u0590-\u08ac]/;function DTe(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,a=i==r.parent.content.size,u=e.domSelection();return!LTe.test(r.parent.textContent)||!u.modify?n=="left"||n=="backward"?o:a:t4(e,t,()=>{let{focusNode:s,focusOffset:c,anchorNode:l,anchorOffset:f}=e.domSelectionRange(),d=u.caretBidiLevel;u.modify("move",n,"character");let p=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:h,focusOffset:v}=e.domSelectionRange(),m=h&&!p.contains(h.nodeType==1?h:h.parentNode)||s==h&&c==v;try{u.collapse(l,f),s&&(s!=l||c!=f)&&u.extend&&u.extend(s,c)}catch{}return d!=null&&(u.caretBidiLevel=d),m})}let n4=null,r4=null,i4=!1;function qTe(e,t,n){return n4==t&&r4==n?i4:(n4=t,r4=n,i4=n=="up"||n=="down"?jTe(e,t,n):DTe(e,t,n))}const Fi=0,o4=1,Sf=2,mo=3;class xh{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Fi,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(t.nodeType==1?t:t.parentNode))if(r<0){let o,a;if(t==this.contentDOM)o=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.previousSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(a)+a.size:this.posAtStart}else{let o,a;if(t==this.contentDOM)o=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.nextSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(a):this.posAtEnd}let i;if(t==this.dom&&this.contentDOM)i=n>Cr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==t.childNodes.length)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??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)&&!(a.nodeType==1?a.contains(t.nodeType==1?t:t.parentNode):a==t))r=!1;else return o}}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 s4){i=t-o;break}o=u}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof a4&&o.side>=0;r--);if(n<=0){let o,a=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,a=!1);return o&&n&&a&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?Cr(o.dom)+1:0}}else{let o,a=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,a=!1);return o&&a&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?Cr(o.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let a=r,u=0;;u++){let s=this.children[u],c=a+s.size;if(i==-1&&t<=c){let l=a+s.border;if(t>=l&&n<=c-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(t,n,l);t=a;for(let f=u;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=Cr(d.dom)+1;break}t-=d.size}i==-1&&(i=0)}if(i>-1&&(c>n||u==this.children.length-1)){n=c;for(let l=u+1;l<this.children.length;l++){let f=this.children[l];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=Cr(f.dom);break}n+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}a=c}return{node:this.contentDOM,from:t,to:n,fromOffset:i,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(n.nodeType!=1||r==n.childNodes.length)throw new 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 d=0,p=0;d<this.children.length;d++){let h=this.children[d],v=p+h.size;if(o>p&&a<v)return h.setSelection(t-p-h.border,n-p-h.border,r,i);p=v}let u=this.domFromPos(t,t?-1:1),s=n==t?u:this.domFromPos(n,n?-1:1),c=r.getSelection(),l=!1;if((Ai||zn)&&t==n){let{node:d,offset:p}=u;if(d.nodeType==3){if(l=!!(p&&d.nodeValue[p-1]==`
|
|
33
|
+
`),l&&p==d.nodeValue.length)for(let h=d,v;h;h=h.parentNode){if(v=h.nextSibling){v.nodeName=="BR"&&(u=s={node:v.parentNode,offset:Cr(v)+1});break}let m=h.pmViewDesc;if(m&&m.node&&m.node.isBlock)break}}else{let h=d.childNodes[p-1];l=h&&(h.nodeName=="BR"||h.contentEditable=="false")}}if(Ai&&c.focusNode&&c.focusNode!=s.node&&c.focusNode.nodeType==1){let d=c.focusNode.childNodes[c.focusOffset];d&&d.contentEditable=="false"&&(i=!0)}if(!(i||l&&zn)&&rc(u.node,u.offset,c.anchorNode,c.anchorOffset)&&rc(s.node,s.offset,c.focusNode,c.focusOffset))return;let f=!1;if((c.extend||t==n)&&!l){c.collapse(u.node,u.offset);try{t!=n&&c.extend(s.node,s.offset),f=!0}catch{}}if(!f){if(t>n){let p=u;u=s,s=p}let d=document.createRange();d.setEnd(s.node,s.offset),d.setStart(u.node,u.offset),c.removeAllRanges(),c.addRange(d)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}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?Sf:o4,t==u&&n==s&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=mo:o.markDirty(t-u,n-u);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Sf:mo}r=a}this.dirty=Sf}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?Sf:o4;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class a4 extends xh{constructor(t,n,r,i){let o,a=n.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(a.nodeType!=1){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 this.dirty==Fi&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||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 UTe extends xh{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 t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class oc extends xh{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=fo.renderSpec(document,n.type.spec.toDOM(n,r))),new oc(t,n,a.dom,a.contentDOM||a.dom)}parseRule(){return this.dirty&mo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(t){return this.dirty!=mo&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Fi){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Fi}}slice(t,n,r){let i=oc.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;n<a&&(o=fE(o,n,a,r)),t>0&&(o=fE(o,0,t,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}}class ac extends xh{constructor(t,n,r,i,o,a,u,s,c){super(t,[],o,a),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=u,a&&this.updateChildren(s,c)}static create(t,n,r,i,o,a){let u=o.nodeViews[n.type.name],s,c=u&&u(n,o,()=>{if(!s)return a;if(s.parent)return s.parent.posBeforeChild(s)},r,i),l=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(!l)l=document.createTextNode(n.text);else if(l.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else l||({dom:l,contentDOM:f}=fo.renderSpec(document,n.type.spec.toDOM(n)));!f&&!n.isText&&l.nodeName!="BR"&&(l.hasAttribute("contenteditable")||(l.contentEditable="false"),n.type.spec.draggable&&(l.draggable=!0));let d=l;return l=f4(l,r,n),c?s=new BTe(t,n,r,i,l,f||null,d,c,o,a+1):n.isText?new hb(t,n,r,i,l,d,o):new ac(t,n,r,i,l,f||null,d,o,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{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=()=>z.empty)}return t}matchesNode(t,n,r){return this.dirty==Fi&&t.eq(this.node)&&lE(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 KTe(this,a&&a.node,t);GTe(this.node,this.innerDeco,(c,l,f)=>{c.spec.marks?s.syncToMarks(c.spec.marks,r,t):c.type.side>=0&&!f&&s.syncToMarks(l==this.node.childCount?rt.none:this.node.child(l).marks,r,t),s.placeWidget(c,t,i)},(c,l,f,d)=>{s.syncToMarks(c.marks,r,t);let p;s.findNodeMatch(c,l,f,d)||u&&t.state.selection.from>i&&t.state.selection.to<i+c.nodeSize&&(p=s.findIndexWithChild(o.node))>-1&&s.updateNodeAt(c,l,f,p,t)||s.updateNextNode(c,l,f,t,d)||s.addNode(c,l,f,t,i),i+=c.nodeSize}),s.syncToMarks([],r,t),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==Sf)&&(a&&this.protectLocalComposition(t,a),c4(this.contentDOM,this.children,t),bf&&YTe(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof Be)||r<n||i>n+this.node.content.size)return null;let o=t.domSelectionRange(),a=JTe(o.focusNode,o.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){let u=a.nodeValue,s=ZTe(this.node.content,u,r-n,i-n);return s<0?null:{node:a,pos:s,text:u}}else return{node:a,pos:-1,text:""}}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 UTe(this,o,n,i);t.input.compositionNodes.push(a),this.children=fE(this.children,r,r+i.length,t,a)}update(t,n,r,i){return this.dirty==mo||!t.sameMarkup(this.node)?!1:(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=Fi}updateOuterDeco(t){if(lE(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=l4(this.dom,this.nodeDOM,cE(this.outerDeco,this.node,n),cE(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function u4(e,t,n,r,i){return f4(r,t,e),new ac(void 0,e,t,n,r,r,r,i,0)}class hb extends ac{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 this.dirty==mo||this.dirty!=Fi&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Fi||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=Fi,!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 t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let i=this.node.cut(t,n),o=document.createTextNode(i.text);return new hb(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=mo)}get domAtom(){return!1}}class s4 extends xh{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Fi&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class BTe extends ac{constructor(t,n,r,i,o,a,u,s,c,l){super(t,n,r,i,o,a,u,c,l),this.spec=s}update(t,n,r,i){if(this.dirty==mo)return!1;if(this.spec.update){let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,i)}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):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function c4(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let a=t[o],u=a.dom;if(u.parentNode==e){for(;u!=r;)r=d4(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(u,r);if(a instanceof oc){let s=r?r.previousSibling:e.lastChild;c4(a.contentDOM,a.children,n),r=s?s.nextSibling:e.firstChild}}for(;r;)r=d4(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const kh=function(e){e&&(this.nodeName=e)};kh.prototype=Object.create(null);const uc=[new kh];function cE(e,t,n){if(e.length==0)return uc;let r=n?uc[0]:new kh,i=[r];for(let o=0;o<e.length;o++){let a=e[o].type.attrs;if(a){a.nodeName&&i.push(r=new kh(a.nodeName));for(let u in a){let s=a[u];s!=null&&(n&&i.length==1&&i.push(r=new kh(t.isInline?"span":"div")),u=="class"?r.class=(r.class?r.class+" ":"")+s:u=="style"?r.style=(r.style?r.style+";":"")+s:u!="nodeName"&&(r[u]=s))}}}return i}function l4(e,t,n,r){if(n==uc&&r==uc)return t;let i=t;for(let o=0;o<r.length;o++){let a=r[o],u=n[o];if(o){let s;u&&u.nodeName==a.nodeName&&i!=e&&(s=i.parentNode)&&s.nodeName.toLowerCase()==a.nodeName||(s=document.createElement(a.nodeName),s.pmIsDeco=!0,s.appendChild(i),u=uc[0]),i=s}zTe(i,u||uc[0],a)}return i}function zTe(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&e.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&e.classList.add(i[o]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(t.style);)e.style.removeProperty(i[1])}n.style&&(e.style.cssText+=n.style)}}function f4(e,t,n){return l4(e,e,uc,cE(t,n,e.nodeType!=1))}function lE(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function d4(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class KTe{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=VTe(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])&&t[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=Fi,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<t.length;){this.stack.push(this.top,this.index+1);let u=-1;for(let s=this.index;s<Math.min(this.index+3,this.top.children.length);s++){let c=this.top.children[s];if(c.matchesMark(t[o])&&!this.isLocked(c.dom)){u=s;break}}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let s=oc.create(this.top,t[o],n,r);this.top.children.splice(this.index,0,s),this.top=s,this.changed=!0}this.index=0,o++}}findNodeMatch(t,n,r,i){let o=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(t,n,r))o=this.top.children.indexOf(a,this.index);else for(let u=this.index,s=Math.min(this.top.children.length,u+5);u<s;u++){let c=this.top.children[u];if(c.matchesNode(t,n,r)&&!this.preMatch.matched.has(c)){o=u;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,n,r,i,o){let a=this.top.children[i];return a.dirty==mo&&a.dom==a.contentDOM&&(a.dirty=Sf),a.update(t,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}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){for(let a=this.index;a<this.top.children.length;a++){let u=this.top.children[a];if(u instanceof ac){let s=this.preMatch.matched.get(u);if(s!=null&&s!=o)return!1;let c=u.dom;if(!(this.isLocked(c)&&!(t.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==t.text&&u.dirty!=mo&&lE(n,u.outerDeco)))&&u.update(t,n,r,i))return this.destroyBetween(this.index,a),u.dom!=c&&(this.changed=!0),this.index++,!0;break}}return!1}addNode(t,n,r,i,o){this.top.children.splice(this.index++,0,ac.create(this.top,t,n,r,i,o)),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 a4(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 oc;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof hb)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((zn||Bn)&&t&&t.dom.contentEditable=="false"&&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);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new s4(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||t.nodeType==1&&t.contains(this.lock.parentNode))}}function VTe(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,a=[];e:for(;i>0;){let u;for(;;)if(r){let c=n.children[r-1];if(c instanceof oc)n=c,r=c.children.length;else{u=c,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let s=u.node;if(s){if(s!=e.child(i-1))break;--i,o.set(u,i),a.push(u)}}return{index:i,matched:o,matches:a.reverse()}}function HTe(e,t){return e.type.side-t.type.side}function GTe(e,t,n,r){let i=t.locals(e),o=0;if(i.length==0){for(let c=0;c<e.childCount;c++){let l=e.child(c);r(l,i,t.forChild(o,l),c),o+=l.nodeSize}return}let a=0,u=[],s=null;for(let c=0;;){if(a<i.length&&i[a].to==o){let h=i[a++],v;for(;a<i.length&&i[a].to==o;)(v||(v=[h])).push(i[a++]);if(v){v.sort(HTe);for(let m=0;m<v.length;m++)n(v[m],c,!!s)}else n(h,c,!!s)}let l,f;if(s)f=-1,l=s,s=null;else if(c<e.childCount)f=c,l=e.child(c++);else break;for(let h=0;h<u.length;h++)u[h].to<=o&&u.splice(h--,1);for(;a<i.length&&i[a].from<=o&&i[a].to>o;)u.push(i[a++]);let d=o+l.nodeSize;if(l.isText){let h=d;a<i.length&&i[a].from<h&&(h=i[a].from);for(let v=0;v<u.length;v++)u[v].to<h&&(h=u[v].to);h<d&&(s=l.cut(h-o),l=l.cut(0,h-o),d=h,f=-1)}let p=l.isInline&&!l.isLeaf?u.filter(h=>!h.inline):u.slice();r(l,p,t.forChild(o,l),f),o=d}}function YTe(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function JTe(e,t){for(;;){if(e.nodeType==3)return e;if(e.nodeType==1&&t>0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=ho(e)}else if(e.nodeType==1&&t<e.childNodes.length)e=e.childNodes[t],t=0;else return null}}function ZTe(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let a=e.child(i++),u=o;if(o+=a.nodeSize,!a.isText)continue;let s=a.text;for(;i<e.childCount;){let c=e.child(i++);if(o+=c.nodeSize,!c.isText)break;s+=c.text}if(o>=n){let c=u<r?s.lastIndexOf(t,r-u-1):-1;if(c>=0&&c+t.length+u>=n)return u+c;if(n==r&&s.length>=r+t.length-u&&s.slice(r-u,r-u+t.length)==t)return r}}return-1}function fE(e,t,n,r,i){let o=[];for(let a=0,u=0;a<e.length;a++){let s=e[a],c=u,l=u+=s.size;c>=n||l<=t?o.push(s):(c<t&&o.push(s.slice(0,t-c,r)),i&&(o.push(i),i=void 0),l>n&&o.push(s.slice(n-c,s.size,r)))}return o}function dE(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&i.size==0,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let u=r.resolve(a),s,c;if(db(n)){for(s=u;i&&!i.node;)i=i.parent;let l=i.node;if(i&&l.isAtom&&Se.isSelectable(l)&&i.parent&&!(l.isInline&&$Te(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new Se(a==f?u:r.resolve(f))}}else{let l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null;s=r.resolve(l)}if(!c){let l=t=="pointer"||e.state.selection.head<u.pos&&!o?1:-1;c=hE(e,s,u,l)}return c}function p4(e){return e.editable?e.hasFocus():_4(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function _a(e,t=!1){let n=e.state.selection;if(g4(e,n),!!p4(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Bn){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&rc(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)QTe(e);else{let{anchor:r,head:i}=n,o,a;h4&&!(n instanceof Be)&&(n.$from.parent.inlineContent||(o=m4(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=m4(e,n.to))),e.docView.setSelection(r,i,e.root,t),h4&&(o&&v4(o),a&&v4(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&XTe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const h4=zn||Bn&&OTe<63;function m4(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(zn&&i&&i.contentEditable=="false")return pE(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return pE(i);if(o)return pE(o)}}function pE(e){return e.contentEditable="true",zn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function v4(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function XTe(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!p4(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function QTe(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,Cr(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&sr&&_u<=11&&(r.disabled=!0,r.disabled=!1)}function g4(e,t){if(t instanceof Se){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(y4(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else y4(e)}function y4(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function hE(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||Be.between(t,n,r)}function b4(e){return e.editable&&!e.hasFocus()?!1:_4(e)}function _4(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function eIe(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return rc(t.node,t.offset,n.anchorNode,n.anchorOffset)}function mE(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&We.findFrom(o,t)}function sc(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function S4(e,t,n){let r=e.state.selection;if(r instanceof Be){if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let i=mE(e.state,t);return i&&i instanceof Se?sc(e,i):!1}else if(!(Yr&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let u=t<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=e.docView.descAt(u))&&!a.contentDOM?Se.isSelectable(o)?sc(e,new Se(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):pb?sc(e,new Be(e.state.doc.resolve(t<0?u:u+o.nodeSize))):!1:!1}}else{if(r instanceof Se&&r.node.isInline)return sc(e,new Be(t>0?r.$to:r.$from));{let i=mE(e.state,t);return i?sc(e,i):!1}}}function mb(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Ah(e){let t=e.pmViewDesc;return t&&t.size==0&&(e.nextSibling||e.nodeName!="BR")}function vE(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,a=!1;for(Ai&&n.nodeType==1&&r<mb(n)&&Ah(n.childNodes[r])&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let u=n.childNodes[r-1];if(Ah(u))i=n,o=--r;else if(u.nodeType==3)n=u,r=n.nodeValue.length;else break}}else{if($4(n))break;{let u=n.previousSibling;for(;u&&Ah(u);)i=n.parentNode,o=Cr(u),u=u.previousSibling;if(u)n=u,r=mb(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?yE(e,n,r):i&&yE(e,i,o)}function gE(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=mb(n),o,a;for(;;)if(r<i){if(n.nodeType!=1)break;let u=n.childNodes[r];if(Ah(u))o=n,a=++r;else break}else{if($4(n))break;{let u=n.nextSibling;for(;u&&Ah(u);)o=u.parentNode,a=Cr(u)+1,u=u.nextSibling;if(u)n=u,r=0,i=mb(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&yE(e,o,a)}function $4(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function yE(e,t,n){let r=e.domSelection();if(db(r)){let o=document.createRange();o.setEnd(t,n),o.setStart(t,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&_a(e)},50)}function T4(e,t,n){let r=e.state.selection;if(r instanceof Be&&!r.empty||n.indexOf("s")>-1||Yr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let a=mE(e.state,t);if(a&&a instanceof Se)return sc(e,a)}if(!i.parent.inlineContent){let a=t<0?i:o,u=r instanceof ki?We.near(a,t):We.findFrom(a,t);return u?sc(e,u):!1}return!1}function I4(e,t){if(!(e.state.selection instanceof Be))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let a=e.state.tr;return t<0?a.delete(n.pos-o.nodeSize,n.pos):a.delete(n.pos,n.pos+o.nodeSize),e.dispatch(a),!0}return!1}function O4(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function tIe(e){if(!zn||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;O4(e,r,"true"),setTimeout(()=>O4(e,r,"false"),20)}return!1}function nIe(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function rIe(e,t){let n=t.keyCode,r=nIe(t);return n==8||Yr&&n==72&&r=="c"?I4(e,-1)||vE(e):n==46||Yr&&n==68&&r=="c"?I4(e,1)||gE(e):n==13||n==27?!0:n==37||Yr&&n==66&&r=="c"?S4(e,-1,r)||vE(e):n==39||Yr&&n==70&&r=="c"?S4(e,1,r)||gE(e):n==38||Yr&&n==80&&r=="c"?T4(e,-1,r)||vE(e):n==40||Yr&&n==78&&r=="c"?tIe(e)||T4(e,1,r)||gE(e):r==(Yr?"m":"c")&&(n==66||n==73||n==89||n==90)}function w4(e,t){e.someProp("transformCopied",p=>{t=p(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let a=e.someProp("clipboardSerializer")||fo.fromSchema(e.state.schema),u=N4(),s=u.createElement("div");s.appendChild(a.serializeFragment(r,{document:u}));let c=s.firstChild,l,f=0;for(;c&&c.nodeType==1&&(l=k4[c.nodeName.toLowerCase()]);){for(let p=l.length-1;p>=0;p--){let h=u.createElement(l[p]);for(;s.firstChild;)h.appendChild(s.firstChild);s.appendChild(h),f++}c=s.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=e.someProp("clipboardTextSerializer",p=>p(t,e))||t.content.textBetween(0,t.content.size,`
|
|
34
34
|
|
|
35
35
|
`);return{dom:s,text:d}}function C4(e,t,n,r,i){let o=i.parent.type.spec.code,a,u;if(!n&&!t)return null;let s=t&&(r||o||!n);if(s){if(e.someProp("transformPastedText",d=>{t=d(t,o||r,e)}),o)return t?new se(z.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
36
|
-
`))),0,0):se.empty;let f=e.someProp("clipboardTextParser",d=>d(t,i,r,e));if(f)u=f;else{let d=i.marks(),{schema:p}=e.state,h=fo.fromSchema(p);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(v=>{let m=a.appendChild(document.createElement("p"));v&&m.appendChild(h.serializeNode(p.text(v,d)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n,e)}),a=rIe(n),pb&&iIe(a);let c=a&&a.querySelector("[data-pm-slice]"),l=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(l&&l[3])for(let f=+l[3];f>0;f--){let d=a.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;a=d}if(u||(u=(e.someProp("clipboardParser")||e.someProp("domParser")||ff.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(s||l),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!tIe.test(d.parentNode.nodeName)?{ignore:!0}:null}})),l)u=oIe(x4(u,+l[1],+l[2]),l[4]);else if(u=se.maxOpen(nIe(u.content,i),!0),u.openStart||u.openEnd){let f=0,d=0;for(let p=u.content.firstChild;f<u.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=u.content.lastChild;d<u.openEnd&&!p.type.spec.isolating;d++,p=p.lastChild);u=x4(u,f,d)}return e.someProp("transformPasted",f=>{u=f(u,e)}),u}const tIe=/^(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 nIe(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,a=[];if(e.forEach(u=>{if(!a)return;let s=i.findWrapping(u.type),c;if(!s)return a=null;if(c=a.length&&o.length&&R4(s,o,u,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=M4(a[a.length-1],o.length));let l=E4(u,s);a.push(l),i=i.matchType(l.type),o=s}}),a)return z.from(a)}return e}function E4(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,z.from(e));return e}function R4(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=R4(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(z.from(E4(n,e,i+1))))}}function M4(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,M4(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(z.empty,!0);return e.copy(n.append(r))}function bE(e,t,n,r,i,o){let a=t<0?e.firstChild:e.lastChild,u=a.content;return i<r-1&&(u=bE(u,t,n,r,i+1,o)),i>=n&&(u=t<0?a.contentMatchAt(0).fillBefore(u,e.childCount>1||o<=i).append(u):u.append(a.contentMatchAt(a.childCount).fillBefore(z.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(u))}function x4(e,t,n){return t<e.openStart&&(e=new se(bE(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new se(bE(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const k4={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let A4=null;function N4(){return A4||(A4=document.implementation.createHTMLDocument("title"))}function rIe(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=N4().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&k4[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=e,i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function iIe(e){let t=e.querySelectorAll(Bn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function oIe(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:o,openEnd:a}=e;for(let u=r.length-2;u>=0;u-=2){let s=n.nodes[r[u]];if(!s||s.hasRequiredAttrs())break;i=z.from(s.create(r[u+1],i)),o++,a++}return new se(i,o,a)}const Kn={},Vn={},aIe={touchstart:!0,touchmove:!0};class uIe{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.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function sIe(e){for(let t in Kn){let n=Kn[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{lIe(e,r)&&!SE(e,r)&&(e.editable||!(r.type in Vn))&&n(e,r)},aIe[t]?{passive:!0}:void 0)}zn&&e.dom.addEventListener("input",()=>null),_E(e)}function $u(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function cIe(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function _E(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>SE(e,r))})}function SE(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function lIe(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function fIe(e,t){!SE(e,t)&&Kn[t.type]&&(e.editable||!(t.type in Vn))&&Kn[t.type](e,t)}Vn.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!P4(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Ni&&Bn&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),bf&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,ic(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||eIe(e,n)?n.preventDefault():$u(e,"key")},Vn.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},Vn.keypress=(e,t)=>{let n=t;if(P4(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Yr&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Be)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",o=>o(e,r.$from.pos,r.$to.pos,i))&&e.dispatch(e.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function vb(e){return{left:e.clientX,top:e.clientY}}function dIe(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function $E(e,t,n,r,i){if(r==-1)return!1;let o=e.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(e.someProp(t,u=>a>o.depth?u(e,n,o.nodeAfter,o.before(a),i,!0):u(e,n,o.node(a),o.before(a),i,!1)))return!0;return!1}function $f(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function pIe(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&Se.isSelectable(r)?($f(e,new Se(n),"pointer"),!0):!1}function hIe(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof Se&&(r=n.node);let o=e.state.doc.resolve(t);for(let a=o.depth+1;a>0;a--){let u=a>o.depth?o.nodeAfter:o.node(a);if(Se.isSelectable(u)){r&&n.$from.depth>0&&a>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(a);break}}return i!=null?($f(e,Se.create(e.state.doc,i),"pointer"),!0):!1}function mIe(e,t,n,r,i){return $E(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?hIe(e,n):pIe(e,n))}function vIe(e,t,n,r){return $E(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function gIe(e,t,n,r){return $E(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||yIe(e,n,r)}function yIe(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?($f(e,Be.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o),u=i.before(o);if(a.inlineContent)$f(e,Be.create(r,u+1,u+1+a.content.size),"pointer");else if(Se.isSelectable(a))$f(e,Se.create(r,u),"pointer");else continue;return!0}}function TE(e){return gb(e)}const F4=Yr?"metaKey":"ctrlKey";Kn.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=TE(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&dIe(n,e.input.lastClick)&&!n[F4]&&(e.input.lastClick.type=="singleClick"?o="doubleClick":e.input.lastClick.type=="doubleClick"&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let a=e.posAtCoords(vb(n));a&&(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new bIe(e,a,n,!!r)):(o=="doubleClick"?vIe:gIe)(e,a.pos,a.inside,n)?n.preventDefault():$u(e,"pointer"))};class bIe{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[F4],this.allowDefault=r.shiftKey;let o,a;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),a=n.inside;else{let l=t.state.doc.resolve(n.pos);o=l.parent,a=l.depth?l.before():0}const u=i?null:r.target,s=u?t.docView.nearestDesc(u,!0):null;this.target=s?s.dom:null;let{selection:c}=t.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof Se&&c.from<=a&&c.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ai&&!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)),$u(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(()=>_a(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(vb(t))),this.updateAllowDefault(t),this.allowDefault||!n?$u(this.view,"pointer"):mIe(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||zn&&this.mightDrag&&!this.mightDrag.node.isAtom||Bn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?($f(this.view,We.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):$u(this.view,"pointer")}move(t){this.updateAllowDefault(t),$u(this.view,"pointer"),t.buttons==0&&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)}}Kn.touchstart=e=>{e.input.lastTouch=Date.now(),TE(e),$u(e,"pointer")},Kn.touchmove=e=>{e.input.lastTouch=Date.now(),$u(e,"pointer")},Kn.contextmenu=e=>TE(e);function P4(e,t){return e.composing?!0:zn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const _Ie=Ni?5e3:-1;Vn.compositionstart=Vn.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||n.marks(),gb(e,!0),e.markCursor=null;else if(gb(e),Ai&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){e.domSelection().collapse(a,a.nodeValue.length);break}else i=a,o=-1}}e.input.composing=!0}W4(e,_Ie)},Vn.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,W4(e,20))};function W4(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>gb(e),t))}function L4(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=SIe());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function SIe(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function gb(e,t=!1){if(!(Ni&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),L4(e),t||e.docView&&e.docView.dirty){let n=dE(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}function $Ie(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const Tf=sr&&bu<15||bf&&TTe<604;Kn.copy=Vn.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=Tf?null:n.clipboardData,a=r.content(),{dom:u,text:s}=w4(e,a);o?(n.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",s)):$Ie(e,u),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function TIe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function IIe(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Nh(e,r.value,null,e.input.shiftKey,t):Nh(e,r.textContent,r.innerHTML,e.input.shiftKey,t)},50)}function Nh(e,t,n,r,i){let o=C4(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",s=>s(e,i,o||se.empty)))return!0;if(!o)return!1;let a=TIe(o),u=a?e.state.tr.replaceSelectionWith(a,e.input.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(u.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Vn.paste=(e,t)=>{let n=t;if(e.composing&&!Ni)return;let r=Tf?null:n.clipboardData;r&&Nh(e,r.getData("text/plain"),r.getData("text/html"),e.input.shiftKey,n)?n.preventDefault():IIe(e,n)};class OIe{constructor(t,n){this.slice=t,this.move=n}}const j4=Yr?"altKey":"ctrlKey";Kn.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(vb(n));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Se?i.to-1:i.to))){if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(Se.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&n.target.nodeType==1){let c=e.docView.nearestDesc(n.target,!0);c&&c.node.type.spec.draggable&&c!=e.docView&&e.dispatch(e.state.tr.setSelection(Se.create(e.state.doc,c.posBefore)))}}let a=e.state.selection.content(),{dom:u,text:s}=w4(e,a);n.dataTransfer.clearData(),n.dataTransfer.setData(Tf?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",Tf||n.dataTransfer.setData("text/plain",s),e.dragging=new OIe(a,!n[j4])},Kn.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Vn.dragover=Vn.dragenter=(e,t)=>t.preventDefault(),Vn.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(vb(n));if(!i)return;let o=e.state.doc.resolve(i.pos),a=r&&r.slice;a?e.someProp("transformPasted",h=>{a=h(a,e)}):a=C4(e,n.dataTransfer.getData(Tf?"Text":"text/plain"),Tf?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[j4]);if(e.someProp("handleDrop",h=>h(e,n,a||se.empty,u))){n.preventDefault();return}if(!a)return;n.preventDefault();let s=a?aTe(e.state.doc,o.pos,a):o.pos;s==null&&(s=o.pos);let c=e.state.tr;u&&c.deleteSelection();let l=c.mapping.map(s),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(f?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let p=c.doc.resolve(l);if(f&&Se.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new Se(p));else{let h=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((v,m,_,g)=>h=g),c.setSelection(hE(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},Kn.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&_a(e)},20))},Kn.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},Kn.beforeinput=(e,t)=>{if(Bn&&Ni&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",o=>o(e,ic(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in Vn)Kn[e]=Vn[e];function Fh(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class IE{constructor(t,n){this.toDOM=t,this.spec=n||cc,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 Cr(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof IE&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Fh(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Tu{constructor(t,n){this.attrs=t,this.spec=n||cc}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 Cr(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Tu&&Fh(this.attrs,t.attrs)&&Fh(this.spec,t.spec)}static is(t){return t.type instanceof Tu}destroy(){}}let wIe=class L6{constructor(t,n){this.attrs=t,this.spec=n||cc}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 Cr(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(t){return this==t||t instanceof L6&&Fh(this.attrs,t.attrs)&&Fh(this.spec,t.spec)}destroy(){}};class Cr{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Cr(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 Cr(t,t,new IE(n,r))}static inline(t,n,r,i){return new Cr(t,n,new Tu(r,i))}static node(t,n,r,i){return new Cr(t,n,new wIe(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Tu}}const If=[],cc={};class Dt{constructor(t,n){this.local=t.length?t:If,this.children=n.length?n:If}static create(t,n){return n.length?yb(n,t,0,cc):Rn}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 a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>t){let u=this.children[a]+1;this.children[a+2].findInner(t-u,n-u,r,i+u,o)}}map(t,n,r){return this==Rn||t.maps.length==0?this:this.mapInner(t,n,0,0,r||cc)}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?CIe(this.children,a||[],t,n,r,i,o):a?new Dt(a.sort(lc),If):Rn}add(t,n){return n.length?this==Rn?Dt.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((u,s)=>{let c=s+r,l;if(l=q4(n,u,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<s;)o+=3;i[o]==s?i[o+2]=i[o+2].addInner(u,l,c+1):i.splice(o,0,s,s+u.nodeSize,yb(l,u,c+1,cc)),o+=3}});let a=D4(o?U4(n):n,-r);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||a.splice(u--,1);return new Dt(a.length?this.local.concat(a).sort(lc):this.local,i||this.children)}remove(t){return t.length==0||this==Rn?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,f;l<t.length;l++)(f=t[l])&&f.from>u&&f.to<s&&(t[l]=null,(a||(a=[])).push(f));if(!a)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(a,u+1);c!=Rn?r[o+2]=c:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,a;o<t.length;o++)if(a=t[o])for(let u=0;u<i.length;u++)i[u].eq(a,n)&&(i==this.local&&(i=this.local.slice()),i.splice(u--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Dt(i,r):Rn}forChild(t,n){if(this==Rn)return this;if(n.isLeaf)return Dt.empty;let r,i;for(let u=0;u<this.children.length;u+=3)if(this.children[u]>=t){this.children[u]==t&&(r=this.children[u+2]);break}let o=t+1,a=o+n.content.size;for(let u=0;u<this.local.length;u++){let s=this.local[u];if(s.from<a&&s.to>o&&s.type instanceof Tu){let c=Math.max(o,s.from)-o,l=Math.min(a,s.to)-o;c<l&&(i||(i=[])).push(s.copy(c,l))}}if(i){let u=new Dt(i.sort(lc),If);return r?new Iu([u,r]):u}return r||Rn}eq(t){if(this==t)return!0;if(!(t instanceof Dt)||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 n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return OE(this.localsInner(t))}localsInner(t){if(this==Rn)return If;if(t.inlineContent||!this.local.some(Tu.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Tu||n.push(this.local[r]);return n}}Dt.empty=new Dt([],[]),Dt.removeOverlap=OE;const Rn=Dt.empty;class Iu{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,cc));return Iu.from(r)}forChild(t,n){if(n.isLeaf)return Dt.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=Rn&&(o instanceof Iu?r=r.concat(o.members):r.push(o))}return Iu.from(r)}eq(t){if(!(t instanceof Iu)||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)n=o;else{r&&(n=n.slice(),r=!1);for(let a=0;a<o.length;a++)n.push(o[a])}}return n?OE(r?n:n.sort(lc)):If}static from(t){switch(t.length){case 0:return Rn;case 1:return t[0];default:return new Iu(t.every(n=>n instanceof Dt)?t:t.reduce((n,r)=>n.concat(r instanceof Dt?r:r.members),[]))}}}function CIe(e,t,n,r,i,o,a){let u=e.slice();for(let c=0,l=o;c<n.maps.length;c++){let f=0;n.maps[c].forEach((d,p,h,v)=>{let m=v-h-(p-d);for(let _=0;_<u.length;_+=3){let g=u[_+1];if(g<0||d>g+l-f)continue;let S=u[_]+l-f;p>=S?u[_+1]=d<=S?-2:-1:h>=i&&m&&(u[_]+=m,u[_+1]+=m)}f+=m}),l=n.maps[c].map(l,-1)}let s=!1;for(let c=0;c<u.length;c+=3)if(u[c+1]<0){if(u[c+1]==-2){s=!0,u[c+1]=-1;continue}let l=n.map(e[c]+o),f=l-i;if(f<0||f>=r.content.size){s=!0;continue}let d=n.map(e[c+1]+o,-1),p=d-i,{index:h,offset:v}=r.content.findIndex(f),m=r.maybeChild(h);if(m&&v==f&&v+m.nodeSize==p){let _=u[c+2].mapInner(n,m,l+1,e[c]+o+1,a);_!=Rn?(u[c]=f,u[c+1]=p,u[c+2]=_):(u[c+1]=-2,s=!0)}else s=!0}if(s){let c=EIe(u,e,t,n,i,o,a),l=yb(c,r,0,a);t=l.local;for(let f=0;f<u.length;f+=3)u[f+1]<0&&(u.splice(f,3),f-=3);for(let f=0,d=0;f<l.children.length;f+=3){let p=l.children[f];for(;d<u.length&&u[d]<p;)d+=3;u.splice(d,0,l.children[f],l.children[f+1],l.children[f+2])}}return new Dt(t.sort(lc),u)}function D4(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Cr(i.from+t,i.to+t,i.type))}return n}function EIe(e,t,n,r,i,o,a){function u(s,c){for(let l=0;l<s.local.length;l++){let f=s.local[l].map(r,i,c);f?n.push(f):a.onRemove&&a.onRemove(s.local[l].spec)}for(let l=0;l<s.children.length;l+=3)u(s.children[l+2],s.children[l]+c+1)}for(let s=0;s<e.length;s+=3)e[s+1]==-1&&u(e[s+2],t[s]+o+1);return n}function q4(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o=0,a;o<e.length;o++)(a=e[o])&&a.from>n&&a.to<r&&((i||(i=[])).push(a),e[o]=null);return i}function U4(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function yb(e,t,n,r){let i=[],o=!1;t.forEach((u,s)=>{let c=q4(e,u,s+n);if(c){o=!0;let l=yb(c,u,n+s+1,r);l!=Rn&&i.push(s,s+u.nodeSize,l)}});let a=D4(o?U4(e):e,-n).sort(lc);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||(r.onRemove&&r.onRemove(a[u].spec),a.splice(u--,1));return a.length||i.length?new Dt(a,i):Rn}function lc(e,t){return e.from-t.from||e.to-t.to}function OE(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),B4(t,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),B4(t,i,r.copy(o.from,r.to)));break}}}return t}function B4(e,t,n){for(;t<e.length&&lc(n,e[t])>0;)t++;e.splice(t,0,n)}function wE(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=Rn&&t.push(r)}),e.cursorWrapper&&t.push(Dt.create(e.state.doc,[e.cursorWrapper.deco])),Iu.from(t)}const RIe={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},MIe=sr&&bu<=11;class xIe{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 kIe{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new xIe,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);sr&&bu<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),MIe&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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,RIe)),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(b4(this.view)){if(this.suppressingSelectionUpdates)return _a(this.view);if(sr&&bu<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&rc(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 o=t.focusNode;o;o=Rh(o))n.add(o);for(let o=t.anchorNode;o;o=Rh(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.observer?this.observer.takeRecords():[];this.queue.length&&(n=this.queue.concat(n),this.queue.length=0);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&b4(t)&&!this.ignoreSelectionChange(r),o=-1,a=-1,u=!1,s=[];if(t.editable)for(let l=0;l<n.length;l++){let f=this.registerMutation(n[l],s);f&&(o=o<0?f.from:Math.min(f.from,o),a=a<0?f.to:Math.max(f.to,a),f.typeOver&&(u=!0))}if(Ai&&s.length>1){let l=s.filter(f=>f.nodeName=="BR");if(l.length==2){let f=l[0],d=l[1];f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}}let c=null;o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&db(r)&&(c=dE(t))&&c.eq(We.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,_a(t),this.currentSelection.set(r),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,a),AIe(t)),this.handleDOMChange(o,a,u,s),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||_a(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let l=0;l<t.addedNodes.length;l++)n.push(t.addedNodes[l]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let i=t.previousSibling,o=t.nextSibling;if(sr&&bu<=11&&t.addedNodes.length)for(let l=0;l<t.addedNodes.length;l++){let{previousSibling:f,nextSibling:d}=t.addedNodes[l];(!f||Array.prototype.indexOf.call(t.addedNodes,f)<0)&&(i=f),(!d||Array.prototype.indexOf.call(t.addedNodes,d)<0)&&(o=d)}let a=i&&i.parentNode==t.target?wr(i)+1:0,u=r.localPosFromDOM(t.target,a,-1),s=o&&o.parentNode==t.target?wr(o):t.target.childNodes.length,c=r.localPosFromDOM(t.target,s,1);return{from:u,to:c}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}}}let z4=new WeakMap,K4=!1;function AIe(e){if(!z4.has(e)&&(z4.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Ai,K4)return;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."),K4=!0}}function NIe(e){let t;function n(s){s.preventDefault(),s.stopImmediatePropagation(),t=s.getTargetRanges()[0]}e.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",n,!0);let r=t.startContainer,i=t.startOffset,o=t.endContainer,a=t.endOffset,u=e.domAtPos(e.state.selection.anchor);return rc(u.node,u.offset,o,a)&&([r,i,o,a]=[o,a,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:a}}function FIe(e,t,n){let{node:r,fromOffset:i,toOffset:o,from:a,to:u}=e.docView.parseRange(t,n),s=e.domSelectionRange(),c,l=s.anchorNode;if(l&&e.dom.contains(l.nodeType==1?l:l.parentNode)&&(c=[{node:l,offset:s.anchorOffset}],db(s)||c.push({node:s.focusNode,offset:s.focusOffset})),Bn&&e.input.lastKeyCode===8)for(let m=o;m>i;m--){let _=r.childNodes[m-1],g=_.pmViewDesc;if(_.nodeName=="BR"&&!g){o=m;break}if(!g||g.size)break}let f=e.state.doc,d=e.someProp("domParser")||ff.fromSchema(e.state.schema),p=f.resolve(a),h=null,v=d.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:PIe,context:p});if(c&&c[0].pos!=null){let m=c[0].pos,_=c[1]&&c[1].pos;_==null&&(_=m),h={anchor:m+a,head:_+a}}return{doc:v,sel:h,from:a,to:u}}function PIe(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(zn&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||zn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}function WIe(e,t,n,r,i){if(t<0){let E=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,q=dE(e,E);if(q&&!e.state.selection.eq(q)){if(Bn&&Ni&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",N=>N(e,ic(13,"Enter"))))return;let Y=e.state.tr.setSelection(q);E=="pointer"?Y.setMeta("pointer",!0):E=="key"&&Y.scrollIntoView(),e.dispatch(Y)}return}let o=e.state.doc.resolve(t),a=o.sharedDepth(n);t=o.before(a+1),n=e.state.doc.resolve(n).after(a+1);let u=e.state.selection,s=FIe(e,t,n),c=e.state.doc,l=c.slice(s.from,s.to),f,d;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,d="end"):(f=e.state.selection.from,d="start"),e.input.lastKeyCode=null;let p=DIe(l.content,s.doc.content,s.from,f,d);if((bf&&e.input.lastIOSEnter>Date.now()-225||Ni)&&i.some(E=>E.nodeName=="DIV"||E.nodeName=="P"||E.nodeName=="LI")&&(!p||p.endA>=p.endB)&&e.someProp("handleKeyDown",E=>E(e,ic(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!p)if(r&&u instanceof Be&&!u.empty&&u.$head.sameParent(u.$anchor)&&!e.composing&&!(s.sel&&s.sel.anchor!=s.sel.head))p={start:u.from,endA:u.to,endB:u.to};else{if(s.sel){let E=V4(e,e.state.doc,s.sel);E&&!E.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(E))}return}if(Bn&&e.cursorWrapper&&s.sel&&s.sel.anchor==e.cursorWrapper.deco.from&&s.sel.head==s.sel.anchor){let E=p.endB-p.start;s.sel={anchor:s.sel.anchor+E,head:s.sel.anchor+E}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&p.start==p.endB&&e.state.selection instanceof Be&&(p.start>e.state.selection.from&&p.start<=e.state.selection.from+2&&e.state.selection.from>=s.from?p.start=e.state.selection.from:p.endA<e.state.selection.to&&p.endA>=e.state.selection.to-2&&e.state.selection.to<=s.to&&(p.endB+=e.state.selection.to-p.endA,p.endA=e.state.selection.to)),sr&&bu<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>s.from&&s.doc.textBetween(p.start-s.from-1,p.start-s.from+1)==" "&&(p.start--,p.endA--,p.endB--);let h=s.doc.resolveNoCache(p.start-s.from),v=s.doc.resolveNoCache(p.endB-s.from),m=c.resolve(p.start),_=h.sameParent(v)&&h.parent.inlineContent&&m.end()>=p.endA,g;if((bf&&e.input.lastIOSEnter>Date.now()-225&&(!_||i.some(E=>E.nodeName=="DIV"||E.nodeName=="P"))||!_&&h.pos<s.doc.content.size&&(g=We.findFrom(s.doc.resolve(h.pos+1),1,!0))&&g.head==v.pos)&&e.someProp("handleKeyDown",E=>E(e,ic(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>p.start&&jIe(c,p.start,p.endA,h,v)&&e.someProp("handleKeyDown",E=>E(e,ic(8,"Backspace")))){Ni&&Bn&&e.domObserver.suppressSelectionUpdates();return}Bn&&Ni&&p.endB==p.start&&(e.input.lastAndroidDelete=Date.now()),Ni&&!_&&h.start()!=v.start()&&v.parentOffset==0&&h.depth==v.depth&&s.sel&&s.sel.anchor==s.sel.head&&s.sel.head==p.endA&&(p.endB-=2,v=s.doc.resolveNoCache(p.endB-s.from),setTimeout(()=>{e.someProp("handleKeyDown",function(E){return E(e,ic(13,"Enter"))})},20));let S=p.start,b=p.endA,$,T,R;if(_){if(h.pos==v.pos)sr&&bu<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>_a(e),20)),$=e.state.tr.delete(S,b),T=c.resolve(p.start).marksAcross(c.resolve(p.endA));else if(p.endA==p.endB&&(R=LIe(h.parent.content.cut(h.parentOffset,v.parentOffset),m.parent.content.cut(m.parentOffset,p.endA-m.start()))))$=e.state.tr,R.type=="add"?$.addMark(S,b,R.mark):$.removeMark(S,b,R.mark);else if(h.parent.child(h.index()).isText&&h.index()==v.index()-(v.textOffset?0:1)){let E=h.parent.textBetween(h.parentOffset,v.parentOffset);if(e.someProp("handleTextInput",q=>q(e,S,b,E)))return;$=e.state.tr.insertText(E,S,b)}}if($||($=e.state.tr.replace(S,b,s.doc.slice(p.start-s.from,p.endB-s.from))),s.sel){let E=V4(e,$.doc,s.sel);E&&!(Bn&&Ni&&e.composing&&E.empty&&(p.start!=p.endB||e.input.lastAndroidDelete<Date.now()-100)&&(E.head==S||E.head==$.mapping.map(b)-1)||sr&&E.empty&&E.head==S)&&$.setSelection(E)}T&&$.ensureMarks(T),e.dispatch($.scrollIntoView())}function V4(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:hE(e,t.resolve(n.anchor),t.resolve(n.head))}function LIe(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,o=r,a,u,s;for(let l=0;l<r.length;l++)i=r[l].removeFromSet(i);for(let l=0;l<n.length;l++)o=n[l].removeFromSet(o);if(i.length==1&&o.length==0)u=i[0],a="add",s=l=>l.mark(u.addToSet(l.marks));else if(i.length==0&&o.length==1)u=o[0],a="remove",s=l=>l.mark(u.removeFromSet(l.marks));else return null;let c=[];for(let l=0;l<t.childCount;l++)c.push(s(t.child(l)));if(z.from(c).eq(e))return{mark:u,type:a}}function jIe(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||CE(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let a=e.resolve(CE(o,!0,!0));return!a.parent.isTextblock||a.pos>n||CE(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function CE(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let o=e.node(r).maybeChild(e.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function DIe(e,t,n,r,i){let o=e.findDiffStart(t,n);if(o==null)return null;let{a,b:u}=e.findDiffEnd(t,n+e.size,n+t.size);if(i=="end"){let s=Math.max(0,o-Math.min(a,u));r-=a+s-o}if(a<o&&e.size<t.size){let s=r<=o&&r>=a?o-r:0;o-=s,u=o+(u-a),a=o}else if(u<o){let s=r<=o&&r>=u?o-r:0;o-=s,a=o+(a-u),u=o}return{start:o,endA:a,endB:u}}class qIe{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 uIe,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Z4),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Y4(this),G4(this),this.nodeViews=J4(this),this.docView=u4(this.state.doc,H4(this),wE(this),this.dom,this),this.domObserver=new kIe(this,(r,i,o,a)=>WIe(this,r,i,o,a)),this.domObserver.start(),sIe(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&_E(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(Z4),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];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&&(L4(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 d=J4(this);BIe(d,this.nodeViews)&&(this.nodeViews=d,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&_E(this),this.editable=Y4(this),G4(this);let u=wE(this),s=H4(this),c=r.plugins!=t.plugins&&!r.doc.eq(t.doc)?"reset":t.scrollToSelection>r.scrollToSelection?"to selection":"preserve",l=i||!this.docView.matchesNode(t.doc,s,u);(l||!t.selection.eq(r.selection))&&(o=!0);let f=c=="preserve"&&o&&this.dom.style.overflowAnchor==null&&wTe(this);if(o){this.domObserver.stop();let d=l&&(sr||Bn)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&UIe(r.selection,t.selection);if(l){let p=Bn?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(t.doc,s,u,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=u4(t.doc,s,u,this.dom,this)),p&&!this.trackWrites&&(d=!0)}d||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&ZTe(this))?_a(this,d):(g4(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():f&&CTe(f)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Se){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Y3(this,n.getBoundingClientRect(),t)}else Y3(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){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}someProp(t,n){let r=this._props&&this._props[t],i;if(r!=null&&(i=n?n(r):r))return i;for(let a=0;a<this.directPlugins.length;a++){let u=this.directPlugins[a].props[t];if(u!=null&&(i=n?n(u):u))return i}let o=this.state.plugins;if(o)for(let a=0;a<o.length;a++){let u=o[a].props[t];if(u!=null&&(i=n?n(u):u))return i}}hasFocus(){if(sr){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(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&ETe(this.dom),_a(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}posAtCoords(t){return ATe(this,t)}coordsAtPos(t,n=1){return e4(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(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){return LTe(this,n||this.state,t)}pasteHTML(t,n){return Nh(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Nh(this,t,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(cIe(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],wE(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(t){return fIe(this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return zn&&this.root.nodeType===11&&STe(this.dom.ownerDocument)==this.dom?NIe(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function H4(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"&&(t.class+=" "+n[r]),r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),[Cr.node(0,e.state.doc.content.size,t)]}function G4(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Cr.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Y4(e){return!e.someProp("editable",t=>t(e.state)===!1)}function UIe(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function J4(e){let t=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(t,i)||(t[i]=r[i])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function BIe(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r}function Z4(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Ou={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:"'"},bb={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},X4=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),zIe=typeof navigator<"u"&&/Mac/.test(navigator.platform),KIe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),VIe=zIe||X4&&+X4[1]<57,yn=0;yn<10;yn++)Ou[48+yn]=Ou[96+yn]=String(yn);for(var yn=1;yn<=24;yn++)Ou[yn+111]="F"+yn;for(var yn=65;yn<=90;yn++)Ou[yn]=String.fromCharCode(yn+32),bb[yn]=String.fromCharCode(yn);for(var EE in Ou)bb.hasOwnProperty(EE)||(bb[EE]=Ou[EE]);function HIe(e){var t=VIe&&(e.ctrlKey||e.altKey||e.metaKey)||KIe&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?bb:Ou)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const GIe=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function YIe(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,o,a;for(let u=0;u<t.length-1;u++){let s=t[u];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))r=!0;else if(/^(c|ctrl|control)$/i.test(s))i=!0;else if(/^s(hift)?$/i.test(s))o=!0;else if(/^mod$/i.test(s))GIe?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+s)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),a&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function JIe(e){let t=Object.create(null);for(let n in e)t[YIe(n)]=e[n];return t}function RE(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function ZIe(e){return new Gr({props:{handleKeyDown:XIe(e)}})}function XIe(e){let t=JIe(e);return function(n,r){let i=HIe(r),o,a=t[RE(i,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let u=t[RE(i,r,!1)];if(u&&u(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=Ou[r.keyCode])&&o!=i){let u=t[RE(o,r)];if(u&&u(n.state,n.dispatch,n))return!0}}return!1}}const QIe=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function e1e(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const t1e=(e,t,n)=>{let r=e1e(e,n);if(!r)return!1;let i=Q4(r);if(!i){let a=r.blockRange(),u=a&&pf(a);return u==null?!1:(t&&t(e.tr.lift(a,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&n5(e,i,t))return!0;if(r.parent.content.size==0&&(Of(o,"end")||Se.isSelectable(o))){let a=ZC(e.doc,r.before(),r.after(),se.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(Of(o,"end")?We.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):Se.create(u.doc,i.pos-o.nodeSize)),t(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1};function Of(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const n1e=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=Q4(r)}let a=o&&o.nodeBefore;return!a||!Se.isSelectable(a)?!1:(t&&t(e.tr.setSelection(Se.create(e.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function Q4(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function r1e(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const i1e=(e,t,n)=>{let r=r1e(e,n);if(!r)return!1;let i=e5(r);if(!i)return!1;let o=i.nodeAfter;if(n5(e,i,t))return!0;if(r.parent.content.size==0&&(Of(o,"start")||Se.isSelectable(o))){let a=ZC(e.doc,r.before(),r.after(),se.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(Of(o,"start")?We.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):Se.create(u.doc,u.mapping.map(i.pos))),t(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},o1e=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=e5(r)}let a=o&&o.nodeAfter;return!a||!Se.isSelectable(a)?!1:(t&&t(e.tr.setSelection(Se.create(e.doc,o.pos)).scrollIntoView()),!0)};function e5(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const a1e=(e,t)=>{let n=e.selection,r=n instanceof Se,i;if(r){if(n.node.isTextblock||!mu(e.doc,n.from))return!1;i=n.from}else if(i=k3(e.doc,n.from,-1),i==null)return!1;if(t){let o=e.tr.join(i);r&&o.setSelection(Se.create(o.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},u1e=(e,t)=>{let n=e.selection,r;if(n instanceof Se){if(n.node.isTextblock||!mu(e.doc,n.to))return!1;r=n.to}else if(r=k3(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},s1e=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&pf(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},c1e=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
37
|
-
`).scrollIntoView()),!0)};function t5(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const l1e=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),a=t5(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(t){let u=n.after(),s=e.tr.replaceWith(u,u,a.createAndFill());s.setSelection(We.near(s.doc.resolve(u),1)),t(s.scrollIntoView())}return!0},f1e=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof ki||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=t5(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,u=e.tr.insert(a,o.createAndFill());u.setSelection(Be.create(u.doc,a+1)),t(u.scrollIntoView())}return!0},d1e=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(hf(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&pf(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},p1e=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(Se.create(e.doc,i))),!0)};function h1e(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||mu(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function n5(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(h1e(e,t,n))return!0;let u=t.parent.canReplace(t.index(),t.index()+1);if(u&&(o=(a=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(n){let f=t.pos+i.nodeSize,d=z.empty;for(let v=o.length-1;v>=0;v--)d=z.from(o[v].create(null,d));d=z.from(r.copy(d));let p=e.tr.step(new tn(t.pos-1,f,t.pos,f,new se(d,1,0),o.length,!0)),h=f+2*o.length;mu(p.doc,h)&&p.join(h),n(p.scrollIntoView())}return!0}let s=We.findFrom(t,1),c=s&&s.$from.blockRange(s.$to),l=c&&pf(c);if(l!=null&&l>=t.depth)return n&&n(e.tr.lift(c,l).scrollIntoView()),!0;if(u&&Of(i,"start",!0)&&Of(r,"end")){let f=r,d=[];for(;d.push(f),!f.isTextblock;)f=f.lastChild;let p=i,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(f.canReplace(f.childCount,f.childCount,p.content)){if(n){let v=z.empty;for(let _=d.length-1;_>=0;_--)v=z.from(d[_].copy(v));let m=e.tr.step(new tn(t.pos-d.length,t.pos+i.nodeSize,t.pos+h,t.pos+i.nodeSize-h,new se(v,d.length,0),0,!0));n(m.scrollIntoView())}return!0}}return!1}function r5(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(t.tr.setSelection(Be.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const m1e=r5(-1),v1e=r5(1);function g1e(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),u=a&&JC(a,e,t);return u?(r&&r(n.tr.wrap(a,u).scrollIntoView()),!0):!1}}function i5(e,t=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:a},$to:{pos:u}}=n.selection.ranges[o];n.doc.nodesBetween(a,u,(s,c)=>{if(i)return!1;if(!(!s.isTextblock||s.hasMarkup(e,t)))if(s.type==e)i=!0;else{let l=n.doc.resolve(c),f=l.index();i=l.parent.canReplaceWith(f,f+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:u},$to:{pos:s}}=n.selection.ranges[a];o.setBlockType(u,s,e,t)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function y1e(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),u=!1,s=a;if(!a)return!1;if(a.depth>=2&&i.node(a.depth-1).type.compatibleContent(e)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;let l=n.doc.resolve(a.start-2);s=new rb(l,l,a.depth),a.endIndex<a.parent.childCount&&(a=new rb(i,n.doc.resolve(o.end(a.depth)),a.depth)),u=!0}let c=JC(s,e,t,a);return c?(r&&r(b1e(n.tr,a,c,u,e).scrollIntoView()),!0):!1}}function b1e(e,t,n,r,i){let o=z.empty;for(let l=n.length-1;l>=0;l--)o=z.from(n[l].type.create(n[l].attrs,o));e.step(new tn(t.start-(r?2:0),t.end,t.start,t.end,new se(o,0,0),n.length,!0));let a=0;for(let l=0;l<n.length;l++)n[l].type==i&&(a=l+1);let u=n.length-a,s=t.start+n.length-(r?2:0),c=t.parent;for(let l=t.startIndex,f=t.endIndex,d=!0;l<f;l++,d=!1)!d&&hf(e.doc,s,u)&&(e.split(s,u),s+=2*u),s+=c.child(l).nodeSize;return e}function _1e(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==e);return o?n?r.node(o.depth-1).type==e?S1e(t,n,e,o):$1e(t,n,o):!0:!1}}function S1e(e,t,n,r){let i=e.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new tn(o-1,a,o,a,new se(z.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new rb(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const u=pf(r);if(u==null)return!1;i.lift(r,u);let s=i.mapping.map(o,-1)-1;return mu(i.doc,s)&&i.join(s),t(i.scrollIntoView()),!0}function $1e(e,t,n){let r=e.tr,i=n.parent;for(let p=n.end,h=n.endIndex-1,v=n.startIndex;h>v;h--)p-=i.child(h).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),a=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let u=n.startIndex==0,s=n.endIndex==i.childCount,c=o.node(-1),l=o.index(-1);if(!c.canReplace(l+(u?0:1),l+1,a.content.append(s?z.empty:z.from(i))))return!1;let f=o.pos,d=f+a.nodeSize;return r.step(new tn(f-(u?1:0),d+(s?1:0),f+1,d-1,new se((u?z.empty:z.from(i.copy(z.empty))).append(s?z.empty:z.from(i.copy(z.empty))),u?0:1,s?0:1),u?0:1)),t(r.scrollIntoView()),!0}function T1e(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==e);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let u=o.parent,s=u.child(a-1);if(s.type!=e)return!1;if(n){let c=s.lastChild&&s.lastChild.type==u.type,l=z.from(c?e.create():null),f=new se(z.from(e.create(null,z.from(u.type.create(null,l)))),c?3:1,0),d=o.start,p=o.end;n(t.tr.step(new tn(d-(c?3:1),p,d,p,f,1,!0)).scrollIntoView())}return!0}}function _b(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class Sb{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(){const{rawCommands:t,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([u,s])=>[u,(...l)=>{const f=s(...l)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,u=[],s=!!t,c=t||o.tr,l=()=>(!s&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(c),u.every(d=>d===!0)),f={...Object.fromEntries(Object.entries(r).map(([d,p])=>[d,(...v)=>{const m=this.buildProps(c,n),_=p(...v)(m);return u.push(_),f}])),run:l};return f}createCan(t){const{rawCommands:n,state:r}=this,i=!1,o=t||r.tr,a=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([s,c])=>[s,(...l)=>c(...l)({...a,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i;o.storedMarks&&t.setStoredMarks(o.storedMarks);const u={tr:t,editor:i,view:a,state:_b({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(([s,c])=>[s,(...l)=>c(...l)(u)]))}};return u}}class I1e{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){const r=this.callbacks[t];return r&&r.forEach(i=>i.apply(this,n)),this}off(t,n){const r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(i=>i!==n):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}function fe(e,t,n){return e.config[t]===void 0&&e.parent?fe(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?fe(e.parent,t,n):null}):e.config[t]}function $b(e){const t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),r=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function o5(e){const t=[],{nodeExtensions:n,markExtensions:r}=$b(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},s=fe(a,"addGlobalAttributes",u);if(!s)return;s().forEach(l=>{l.types.forEach(f=>{Object.entries(l.attributes).forEach(([d,p])=>{t.push({type:f,name:d,attribute:{...o,...p}})})})})}),i.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},s=fe(a,"addAttributes",u);if(!s)return;const c=s();Object.entries(c).forEach(([l,f])=>{const d={...o,...f};f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete d.default,t.push({type:a.name,name:l,attribute:d})})}),t}function nn(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function bn(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}i==="class"?r[i]=[r[i],o].join(" "):i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function ME(e,t){return t.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>bn(n,r),{})}function a5(e){return typeof e=="function"}function Fe(e,t=void 0,...n){return a5(e)?t?e.bind(t)(...n):e(...n):e}function O1e(e={}){return Object.keys(e).length===0&&e.constructor===Object}function w1e(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function u5(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const i=t.reduce((o,a)=>{const u=a.attribute.parseHTML?a.attribute.parseHTML(n):w1e(n.getAttribute(a.name));return u==null?o:{...o,[a.name]:u}},{});return{...r,...i}}}}function s5(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&O1e(n)?!1:n!=null))}function c5(e){var t;const n=o5(e),{nodeExtensions:r,markExtensions:i}=$b(e),o=(t=r.find(s=>fe(s,"topNode")))===null||t===void 0?void 0:t.name,a=Object.fromEntries(r.map(s=>{const c=n.filter(m=>m.type===s.name),l={name:s.name,options:s.options,storage:s.storage},f=e.reduce((m,_)=>{const g=fe(_,"extendNodeSchema",l);return{...m,...g?g(s):{}}},{}),d=s5({...f,content:Fe(fe(s,"content",l)),marks:Fe(fe(s,"marks",l)),group:Fe(fe(s,"group",l)),inline:Fe(fe(s,"inline",l)),atom:Fe(fe(s,"atom",l)),selectable:Fe(fe(s,"selectable",l)),draggable:Fe(fe(s,"draggable",l)),code:Fe(fe(s,"code",l)),defining:Fe(fe(s,"defining",l)),isolating:Fe(fe(s,"isolating",l)),attrs:Object.fromEntries(c.map(m=>{var _;return[m.name,{default:(_=m==null?void 0:m.attribute)===null||_===void 0?void 0:_.default}]}))}),p=Fe(fe(s,"parseHTML",l));p&&(d.parseDOM=p.map(m=>u5(m,c)));const h=fe(s,"renderHTML",l);h&&(d.toDOM=m=>h({node:m,HTMLAttributes:ME(m,c)}));const v=fe(s,"renderText",l);return v&&(d.toText=v),[s.name,d]})),u=Object.fromEntries(i.map(s=>{const c=n.filter(v=>v.type===s.name),l={name:s.name,options:s.options,storage:s.storage},f=e.reduce((v,m)=>{const _=fe(m,"extendMarkSchema",l);return{...v,..._?_(s):{}}},{}),d=s5({...f,inclusive:Fe(fe(s,"inclusive",l)),excludes:Fe(fe(s,"excludes",l)),group:Fe(fe(s,"group",l)),spanning:Fe(fe(s,"spanning",l)),code:Fe(fe(s,"code",l)),attrs:Object.fromEntries(c.map(v=>{var m;return[v.name,{default:(m=v==null?void 0:v.attribute)===null||m===void 0?void 0:m.default}]}))}),p=Fe(fe(s,"parseHTML",l));p&&(d.parseDOM=p.map(v=>u5(v,c)));const h=fe(s,"renderHTML",l);return h&&(d.toDOM=v=>h({mark:v,HTMLAttributes:ME(v,c)})),[s.name,d]}));return new W0e({topNode:o,nodes:a,marks:u})}function xE(e,t){return t.nodes[e]||t.marks[e]||null}function l5(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}const C1e=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,o,a,u)=>{var s,c;const l=((c=(s=i.type.spec).toText)===null||c===void 0?void 0:c.call(s,{node:i,pos:o,parent:a,index:u}))||i.textContent||"%leaf%";n+=l.slice(0,Math.max(0,r-o))}),n};function kE(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class AE{constructor(t){this.find=t.find,this.handler=t.handler}}const E1e=(e,t)=>{if(kE(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function NE(e){var t;const{editor:n,from:r,to:i,text:o,rules:a,plugin:u}=e,{view:s}=n;if(s.composing)return!1;const c=s.state.doc.resolve(r);if(c.parent.type.spec.code||!((t=c.nodeBefore||c.nodeAfter)===null||t===void 0)&&t.marks.find(d=>d.type.spec.code))return!1;let l=!1;const f=C1e(c)+o;return a.forEach(d=>{if(l)return;const p=E1e(f,d.find);if(!p)return;const h=s.state.tr,v=_b({state:s.state,transaction:h}),m={from:r-(p[0].length-o.length),to:i},{commands:_,chain:g,can:S}=new Sb({editor:n,state:v});d.handler({state:v,range:m,match:p,commands:_,chain:g,can:S})===null||!h.steps.length||(h.setMeta(u,{transform:h,from:r,to:i,text:o}),s.dispatch(h),l=!0)}),l}function R1e(e){const{editor:t,rules:n}=e,r=new Gr({state:{init(){return null},apply(i,o){const a=i.getMeta(r);return a||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,a,u){return NE({editor:t,from:o,to:a,text:u,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&NE({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?NE({editor:t,from:a.pos,to:a.pos,text:`
|
|
38
|
-
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function
|
|
36
|
+
`))),0,0):se.empty;let f=e.someProp("clipboardTextParser",d=>d(t,i,r,e));if(f)u=f;else{let d=i.marks(),{schema:p}=e.state,h=fo.fromSchema(p);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(v=>{let m=a.appendChild(document.createElement("p"));v&&m.appendChild(h.serializeNode(p.text(v,d)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n,e)}),a=aIe(n),pb&&uIe(a);let c=a&&a.querySelector("[data-pm-slice]"),l=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(l&&l[3])for(let f=+l[3];f>0;f--){let d=a.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;a=d}if(u||(u=(e.someProp("clipboardParser")||e.someProp("domParser")||ff.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(s||l),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!iIe.test(d.parentNode.nodeName)?{ignore:!0}:null}})),l)u=sIe(x4(u,+l[1],+l[2]),l[4]);else if(u=se.maxOpen(oIe(u.content,i),!0),u.openStart||u.openEnd){let f=0,d=0;for(let p=u.content.firstChild;f<u.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=u.content.lastChild;d<u.openEnd&&!p.type.spec.isolating;d++,p=p.lastChild);u=x4(u,f,d)}return e.someProp("transformPasted",f=>{u=f(u,e)}),u}const iIe=/^(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 oIe(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,a=[];if(e.forEach(u=>{if(!a)return;let s=i.findWrapping(u.type),c;if(!s)return a=null;if(c=a.length&&o.length&&R4(s,o,u,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=M4(a[a.length-1],o.length));let l=E4(u,s);a.push(l),i=i.matchType(l.type),o=s}}),a)return z.from(a)}return e}function E4(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,z.from(e));return e}function R4(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=R4(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(z.from(E4(n,e,i+1))))}}function M4(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,M4(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(z.empty,!0);return e.copy(n.append(r))}function bE(e,t,n,r,i,o){let a=t<0?e.firstChild:e.lastChild,u=a.content;return i<r-1&&(u=bE(u,t,n,r,i+1,o)),i>=n&&(u=t<0?a.contentMatchAt(0).fillBefore(u,e.childCount>1||o<=i).append(u):u.append(a.contentMatchAt(a.childCount).fillBefore(z.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(u))}function x4(e,t,n){return t<e.openStart&&(e=new se(bE(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new se(bE(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const k4={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let A4=null;function N4(){return A4||(A4=document.implementation.createHTMLDocument("title"))}function aIe(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=N4().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&k4[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=e,i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function uIe(e){let t=e.querySelectorAll(Bn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function sIe(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:o,openEnd:a}=e;for(let u=r.length-2;u>=0;u-=2){let s=n.nodes[r[u]];if(!s||s.hasRequiredAttrs())break;i=z.from(s.create(r[u+1],i)),o++,a++}return new se(i,o,a)}const Kn={},Vn={},cIe={touchstart:!0,touchmove:!0};class lIe{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.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function fIe(e){for(let t in Kn){let n=Kn[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{pIe(e,r)&&!SE(e,r)&&(e.editable||!(r.type in Vn))&&n(e,r)},cIe[t]?{passive:!0}:void 0)}zn&&e.dom.addEventListener("input",()=>null),_E(e)}function Tu(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function dIe(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function _E(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>SE(e,r))})}function SE(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function pIe(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function hIe(e,t){!SE(e,t)&&Kn[t.type]&&(e.editable||!(t.type in Vn))&&Kn[t.type](e,t)}Vn.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!P4(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Ni&&Bn&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),bf&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,ic(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||rIe(e,n)?n.preventDefault():Tu(e,"key")},Vn.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},Vn.keypress=(e,t)=>{let n=t;if(P4(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Yr&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Be)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",o=>o(e,r.$from.pos,r.$to.pos,i))&&e.dispatch(e.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function vb(e){return{left:e.clientX,top:e.clientY}}function mIe(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function $E(e,t,n,r,i){if(r==-1)return!1;let o=e.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(e.someProp(t,u=>a>o.depth?u(e,n,o.nodeAfter,o.before(a),i,!0):u(e,n,o.node(a),o.before(a),i,!1)))return!0;return!1}function $f(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function vIe(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&Se.isSelectable(r)?($f(e,new Se(n),"pointer"),!0):!1}function gIe(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof Se&&(r=n.node);let o=e.state.doc.resolve(t);for(let a=o.depth+1;a>0;a--){let u=a>o.depth?o.nodeAfter:o.node(a);if(Se.isSelectable(u)){r&&n.$from.depth>0&&a>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(a);break}}return i!=null?($f(e,Se.create(e.state.doc,i),"pointer"),!0):!1}function yIe(e,t,n,r,i){return $E(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?gIe(e,n):vIe(e,n))}function bIe(e,t,n,r){return $E(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function _Ie(e,t,n,r){return $E(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||SIe(e,n,r)}function SIe(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?($f(e,Be.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o),u=i.before(o);if(a.inlineContent)$f(e,Be.create(r,u+1,u+1+a.content.size),"pointer");else if(Se.isSelectable(a))$f(e,Se.create(r,u),"pointer");else continue;return!0}}function TE(e){return gb(e)}const F4=Yr?"metaKey":"ctrlKey";Kn.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=TE(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&mIe(n,e.input.lastClick)&&!n[F4]&&(e.input.lastClick.type=="singleClick"?o="doubleClick":e.input.lastClick.type=="doubleClick"&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let a=e.posAtCoords(vb(n));a&&(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new $Ie(e,a,n,!!r)):(o=="doubleClick"?bIe:_Ie)(e,a.pos,a.inside,n)?n.preventDefault():Tu(e,"pointer"))};class $Ie{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[F4],this.allowDefault=r.shiftKey;let o,a;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),a=n.inside;else{let l=t.state.doc.resolve(n.pos);o=l.parent,a=l.depth?l.before():0}const u=i?null:r.target,s=u?t.docView.nearestDesc(u,!0):null;this.target=s?s.dom:null;let{selection:c}=t.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof Se&&c.from<=a&&c.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ai&&!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)),Tu(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(()=>_a(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(vb(t))),this.updateAllowDefault(t),this.allowDefault||!n?Tu(this.view,"pointer"):yIe(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||zn&&this.mightDrag&&!this.mightDrag.node.isAtom||Bn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?($f(this.view,We.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):Tu(this.view,"pointer")}move(t){this.updateAllowDefault(t),Tu(this.view,"pointer"),t.buttons==0&&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)}}Kn.touchstart=e=>{e.input.lastTouch=Date.now(),TE(e),Tu(e,"pointer")},Kn.touchmove=e=>{e.input.lastTouch=Date.now(),Tu(e,"pointer")},Kn.contextmenu=e=>TE(e);function P4(e,t){return e.composing?!0:zn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const TIe=Ni?5e3:-1;Vn.compositionstart=Vn.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||n.marks(),gb(e,!0),e.markCursor=null;else if(gb(e),Ai&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){e.domSelection().collapse(a,a.nodeValue.length);break}else i=a,o=-1}}e.input.composing=!0}W4(e,TIe)},Vn.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,W4(e,20))};function W4(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>gb(e),t))}function j4(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=IIe());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function IIe(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function gb(e,t=!1){if(!(Ni&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),j4(e),t||e.docView&&e.docView.dirty){let n=dE(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}function OIe(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const Tf=sr&&_u<15||bf&&wTe<604;Kn.copy=Vn.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=Tf?null:n.clipboardData,a=r.content(),{dom:u,text:s}=w4(e,a);o?(n.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",s)):OIe(e,u),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function wIe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function CIe(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Nh(e,r.value,null,e.input.shiftKey,t):Nh(e,r.textContent,r.innerHTML,e.input.shiftKey,t)},50)}function Nh(e,t,n,r,i){let o=C4(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",s=>s(e,i,o||se.empty)))return!0;if(!o)return!1;let a=wIe(o),u=a?e.state.tr.replaceSelectionWith(a,e.input.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(u.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Vn.paste=(e,t)=>{let n=t;if(e.composing&&!Ni)return;let r=Tf?null:n.clipboardData;r&&Nh(e,r.getData("text/plain"),r.getData("text/html"),e.input.shiftKey,n)?n.preventDefault():CIe(e,n)};class EIe{constructor(t,n){this.slice=t,this.move=n}}const L4=Yr?"altKey":"ctrlKey";Kn.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(vb(n));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Se?i.to-1:i.to))){if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(Se.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&n.target.nodeType==1){let c=e.docView.nearestDesc(n.target,!0);c&&c.node.type.spec.draggable&&c!=e.docView&&e.dispatch(e.state.tr.setSelection(Se.create(e.state.doc,c.posBefore)))}}let a=e.state.selection.content(),{dom:u,text:s}=w4(e,a);n.dataTransfer.clearData(),n.dataTransfer.setData(Tf?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",Tf||n.dataTransfer.setData("text/plain",s),e.dragging=new EIe(a,!n[L4])},Kn.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Vn.dragover=Vn.dragenter=(e,t)=>t.preventDefault(),Vn.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(vb(n));if(!i)return;let o=e.state.doc.resolve(i.pos),a=r&&r.slice;a?e.someProp("transformPasted",h=>{a=h(a,e)}):a=C4(e,n.dataTransfer.getData(Tf?"Text":"text/plain"),Tf?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[L4]);if(e.someProp("handleDrop",h=>h(e,n,a||se.empty,u))){n.preventDefault();return}if(!a)return;n.preventDefault();let s=a?cTe(e.state.doc,o.pos,a):o.pos;s==null&&(s=o.pos);let c=e.state.tr;u&&c.deleteSelection();let l=c.mapping.map(s),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(f?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let p=c.doc.resolve(l);if(f&&Se.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new Se(p));else{let h=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((v,m,_,g)=>h=g),c.setSelection(hE(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},Kn.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&_a(e)},20))},Kn.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},Kn.beforeinput=(e,t)=>{if(Bn&&Ni&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",o=>o(e,ic(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in Vn)Kn[e]=Vn[e];function Fh(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class IE{constructor(t,n){this.toDOM=t,this.spec=n||cc,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 Er(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof IE&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Fh(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Iu{constructor(t,n){this.attrs=t,this.spec=n||cc}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 Er(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Iu&&Fh(this.attrs,t.attrs)&&Fh(this.spec,t.spec)}static is(t){return t.type instanceof Iu}destroy(){}}let RIe=class j6{constructor(t,n){this.attrs=t,this.spec=n||cc}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 Er(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(t){return this==t||t instanceof j6&&Fh(this.attrs,t.attrs)&&Fh(this.spec,t.spec)}destroy(){}};class Er{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Er(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 Er(t,t,new IE(n,r))}static inline(t,n,r,i){return new Er(t,n,new Iu(r,i))}static node(t,n,r,i){return new Er(t,n,new RIe(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Iu}}const If=[],cc={};class Dt{constructor(t,n){this.local=t.length?t:If,this.children=n.length?n:If}static create(t,n){return n.length?yb(n,t,0,cc):Rn}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 a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>t){let u=this.children[a]+1;this.children[a+2].findInner(t-u,n-u,r,i+u,o)}}map(t,n,r){return this==Rn||t.maps.length==0?this:this.mapInner(t,n,0,0,r||cc)}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?MIe(this.children,a||[],t,n,r,i,o):a?new Dt(a.sort(lc),If):Rn}add(t,n){return n.length?this==Rn?Dt.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((u,s)=>{let c=s+r,l;if(l=q4(n,u,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<s;)o+=3;i[o]==s?i[o+2]=i[o+2].addInner(u,l,c+1):i.splice(o,0,s,s+u.nodeSize,yb(l,u,c+1,cc)),o+=3}});let a=D4(o?U4(n):n,-r);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||a.splice(u--,1);return new Dt(a.length?this.local.concat(a).sort(lc):this.local,i||this.children)}remove(t){return t.length==0||this==Rn?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,f;l<t.length;l++)(f=t[l])&&f.from>u&&f.to<s&&(t[l]=null,(a||(a=[])).push(f));if(!a)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(a,u+1);c!=Rn?r[o+2]=c:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,a;o<t.length;o++)if(a=t[o])for(let u=0;u<i.length;u++)i[u].eq(a,n)&&(i==this.local&&(i=this.local.slice()),i.splice(u--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Dt(i,r):Rn}forChild(t,n){if(this==Rn)return this;if(n.isLeaf)return Dt.empty;let r,i;for(let u=0;u<this.children.length;u+=3)if(this.children[u]>=t){this.children[u]==t&&(r=this.children[u+2]);break}let o=t+1,a=o+n.content.size;for(let u=0;u<this.local.length;u++){let s=this.local[u];if(s.from<a&&s.to>o&&s.type instanceof Iu){let c=Math.max(o,s.from)-o,l=Math.min(a,s.to)-o;c<l&&(i||(i=[])).push(s.copy(c,l))}}if(i){let u=new Dt(i.sort(lc),If);return r?new Ou([u,r]):u}return r||Rn}eq(t){if(this==t)return!0;if(!(t instanceof Dt)||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 n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return OE(this.localsInner(t))}localsInner(t){if(this==Rn)return If;if(t.inlineContent||!this.local.some(Iu.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Iu||n.push(this.local[r]);return n}}Dt.empty=new Dt([],[]),Dt.removeOverlap=OE;const Rn=Dt.empty;class Ou{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,cc));return Ou.from(r)}forChild(t,n){if(n.isLeaf)return Dt.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=Rn&&(o instanceof Ou?r=r.concat(o.members):r.push(o))}return Ou.from(r)}eq(t){if(!(t instanceof Ou)||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)n=o;else{r&&(n=n.slice(),r=!1);for(let a=0;a<o.length;a++)n.push(o[a])}}return n?OE(r?n:n.sort(lc)):If}static from(t){switch(t.length){case 0:return Rn;case 1:return t[0];default:return new Ou(t.every(n=>n instanceof Dt)?t:t.reduce((n,r)=>n.concat(r instanceof Dt?r:r.members),[]))}}}function MIe(e,t,n,r,i,o,a){let u=e.slice();for(let c=0,l=o;c<n.maps.length;c++){let f=0;n.maps[c].forEach((d,p,h,v)=>{let m=v-h-(p-d);for(let _=0;_<u.length;_+=3){let g=u[_+1];if(g<0||d>g+l-f)continue;let S=u[_]+l-f;p>=S?u[_+1]=d<=S?-2:-1:h>=i&&m&&(u[_]+=m,u[_+1]+=m)}f+=m}),l=n.maps[c].map(l,-1)}let s=!1;for(let c=0;c<u.length;c+=3)if(u[c+1]<0){if(u[c+1]==-2){s=!0,u[c+1]=-1;continue}let l=n.map(e[c]+o),f=l-i;if(f<0||f>=r.content.size){s=!0;continue}let d=n.map(e[c+1]+o,-1),p=d-i,{index:h,offset:v}=r.content.findIndex(f),m=r.maybeChild(h);if(m&&v==f&&v+m.nodeSize==p){let _=u[c+2].mapInner(n,m,l+1,e[c]+o+1,a);_!=Rn?(u[c]=f,u[c+1]=p,u[c+2]=_):(u[c+1]=-2,s=!0)}else s=!0}if(s){let c=xIe(u,e,t,n,i,o,a),l=yb(c,r,0,a);t=l.local;for(let f=0;f<u.length;f+=3)u[f+1]<0&&(u.splice(f,3),f-=3);for(let f=0,d=0;f<l.children.length;f+=3){let p=l.children[f];for(;d<u.length&&u[d]<p;)d+=3;u.splice(d,0,l.children[f],l.children[f+1],l.children[f+2])}}return new Dt(t.sort(lc),u)}function D4(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Er(i.from+t,i.to+t,i.type))}return n}function xIe(e,t,n,r,i,o,a){function u(s,c){for(let l=0;l<s.local.length;l++){let f=s.local[l].map(r,i,c);f?n.push(f):a.onRemove&&a.onRemove(s.local[l].spec)}for(let l=0;l<s.children.length;l+=3)u(s.children[l+2],s.children[l]+c+1)}for(let s=0;s<e.length;s+=3)e[s+1]==-1&&u(e[s+2],t[s]+o+1);return n}function q4(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o=0,a;o<e.length;o++)(a=e[o])&&a.from>n&&a.to<r&&((i||(i=[])).push(a),e[o]=null);return i}function U4(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function yb(e,t,n,r){let i=[],o=!1;t.forEach((u,s)=>{let c=q4(e,u,s+n);if(c){o=!0;let l=yb(c,u,n+s+1,r);l!=Rn&&i.push(s,s+u.nodeSize,l)}});let a=D4(o?U4(e):e,-n).sort(lc);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||(r.onRemove&&r.onRemove(a[u].spec),a.splice(u--,1));return a.length||i.length?new Dt(a,i):Rn}function lc(e,t){return e.from-t.from||e.to-t.to}function OE(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),B4(t,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),B4(t,i,r.copy(o.from,r.to)));break}}}return t}function B4(e,t,n){for(;t<e.length&&lc(n,e[t])>0;)t++;e.splice(t,0,n)}function wE(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=Rn&&t.push(r)}),e.cursorWrapper&&t.push(Dt.create(e.state.doc,[e.cursorWrapper.deco])),Ou.from(t)}const kIe={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},AIe=sr&&_u<=11;class NIe{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 FIe{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new NIe,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);sr&&_u<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),AIe&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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,kIe)),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(b4(this.view)){if(this.suppressingSelectionUpdates)return _a(this.view);if(sr&&_u<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&rc(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 o=t.focusNode;o;o=Rh(o))n.add(o);for(let o=t.anchorNode;o;o=Rh(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.observer?this.observer.takeRecords():[];this.queue.length&&(n=this.queue.concat(n),this.queue.length=0);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&b4(t)&&!this.ignoreSelectionChange(r),o=-1,a=-1,u=!1,s=[];if(t.editable)for(let l=0;l<n.length;l++){let f=this.registerMutation(n[l],s);f&&(o=o<0?f.from:Math.min(f.from,o),a=a<0?f.to:Math.max(f.to,a),f.typeOver&&(u=!0))}if(Ai&&s.length>1){let l=s.filter(f=>f.nodeName=="BR");if(l.length==2){let f=l[0],d=l[1];f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}}let c=null;o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&db(r)&&(c=dE(t))&&c.eq(We.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,_a(t),this.currentSelection.set(r),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,a),PIe(t)),this.handleDOMChange(o,a,u,s),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||_a(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let l=0;l<t.addedNodes.length;l++)n.push(t.addedNodes[l]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let i=t.previousSibling,o=t.nextSibling;if(sr&&_u<=11&&t.addedNodes.length)for(let l=0;l<t.addedNodes.length;l++){let{previousSibling:f,nextSibling:d}=t.addedNodes[l];(!f||Array.prototype.indexOf.call(t.addedNodes,f)<0)&&(i=f),(!d||Array.prototype.indexOf.call(t.addedNodes,d)<0)&&(o=d)}let a=i&&i.parentNode==t.target?Cr(i)+1:0,u=r.localPosFromDOM(t.target,a,-1),s=o&&o.parentNode==t.target?Cr(o):t.target.childNodes.length,c=r.localPosFromDOM(t.target,s,1);return{from:u,to:c}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}}}let z4=new WeakMap,K4=!1;function PIe(e){if(!z4.has(e)&&(z4.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Ai,K4)return;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."),K4=!0}}function WIe(e){let t;function n(s){s.preventDefault(),s.stopImmediatePropagation(),t=s.getTargetRanges()[0]}e.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",n,!0);let r=t.startContainer,i=t.startOffset,o=t.endContainer,a=t.endOffset,u=e.domAtPos(e.state.selection.anchor);return rc(u.node,u.offset,o,a)&&([r,i,o,a]=[o,a,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:a}}function jIe(e,t,n){let{node:r,fromOffset:i,toOffset:o,from:a,to:u}=e.docView.parseRange(t,n),s=e.domSelectionRange(),c,l=s.anchorNode;if(l&&e.dom.contains(l.nodeType==1?l:l.parentNode)&&(c=[{node:l,offset:s.anchorOffset}],db(s)||c.push({node:s.focusNode,offset:s.focusOffset})),Bn&&e.input.lastKeyCode===8)for(let m=o;m>i;m--){let _=r.childNodes[m-1],g=_.pmViewDesc;if(_.nodeName=="BR"&&!g){o=m;break}if(!g||g.size)break}let f=e.state.doc,d=e.someProp("domParser")||ff.fromSchema(e.state.schema),p=f.resolve(a),h=null,v=d.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:LIe,context:p});if(c&&c[0].pos!=null){let m=c[0].pos,_=c[1]&&c[1].pos;_==null&&(_=m),h={anchor:m+a,head:_+a}}return{doc:v,sel:h,from:a,to:u}}function LIe(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(zn&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||zn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}function DIe(e,t,n,r,i){if(t<0){let R=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,q=dE(e,R);if(q&&!e.state.selection.eq(q)){if(Bn&&Ni&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",N=>N(e,ic(13,"Enter"))))return;let Y=e.state.tr.setSelection(q);R=="pointer"?Y.setMeta("pointer",!0):R=="key"&&Y.scrollIntoView(),e.dispatch(Y)}return}let o=e.state.doc.resolve(t),a=o.sharedDepth(n);t=o.before(a+1),n=e.state.doc.resolve(n).after(a+1);let u=e.state.selection,s=jIe(e,t,n),c=e.state.doc,l=c.slice(s.from,s.to),f,d;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,d="end"):(f=e.state.selection.from,d="start"),e.input.lastKeyCode=null;let p=BIe(l.content,s.doc.content,s.from,f,d);if((bf&&e.input.lastIOSEnter>Date.now()-225||Ni)&&i.some(R=>R.nodeName=="DIV"||R.nodeName=="P"||R.nodeName=="LI")&&(!p||p.endA>=p.endB)&&e.someProp("handleKeyDown",R=>R(e,ic(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!p)if(r&&u instanceof Be&&!u.empty&&u.$head.sameParent(u.$anchor)&&!e.composing&&!(s.sel&&s.sel.anchor!=s.sel.head))p={start:u.from,endA:u.to,endB:u.to};else{if(s.sel){let R=V4(e,e.state.doc,s.sel);R&&!R.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(R))}return}if(Bn&&e.cursorWrapper&&s.sel&&s.sel.anchor==e.cursorWrapper.deco.from&&s.sel.head==s.sel.anchor){let R=p.endB-p.start;s.sel={anchor:s.sel.anchor+R,head:s.sel.anchor+R}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&p.start==p.endB&&e.state.selection instanceof Be&&(p.start>e.state.selection.from&&p.start<=e.state.selection.from+2&&e.state.selection.from>=s.from?p.start=e.state.selection.from:p.endA<e.state.selection.to&&p.endA>=e.state.selection.to-2&&e.state.selection.to<=s.to&&(p.endB+=e.state.selection.to-p.endA,p.endA=e.state.selection.to)),sr&&_u<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>s.from&&s.doc.textBetween(p.start-s.from-1,p.start-s.from+1)==" "&&(p.start--,p.endA--,p.endB--);let h=s.doc.resolveNoCache(p.start-s.from),v=s.doc.resolveNoCache(p.endB-s.from),m=c.resolve(p.start),_=h.sameParent(v)&&h.parent.inlineContent&&m.end()>=p.endA,g;if((bf&&e.input.lastIOSEnter>Date.now()-225&&(!_||i.some(R=>R.nodeName=="DIV"||R.nodeName=="P"))||!_&&h.pos<s.doc.content.size&&(g=We.findFrom(s.doc.resolve(h.pos+1),1,!0))&&g.head==v.pos)&&e.someProp("handleKeyDown",R=>R(e,ic(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>p.start&&UIe(c,p.start,p.endA,h,v)&&e.someProp("handleKeyDown",R=>R(e,ic(8,"Backspace")))){Ni&&Bn&&e.domObserver.suppressSelectionUpdates();return}Bn&&Ni&&p.endB==p.start&&(e.input.lastAndroidDelete=Date.now()),Ni&&!_&&h.start()!=v.start()&&v.parentOffset==0&&h.depth==v.depth&&s.sel&&s.sel.anchor==s.sel.head&&s.sel.head==p.endA&&(p.endB-=2,v=s.doc.resolveNoCache(p.endB-s.from),setTimeout(()=>{e.someProp("handleKeyDown",function(R){return R(e,ic(13,"Enter"))})},20));let S=p.start,b=p.endA,$,T,M;if(_){if(h.pos==v.pos)sr&&_u<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>_a(e),20)),$=e.state.tr.delete(S,b),T=c.resolve(p.start).marksAcross(c.resolve(p.endA));else if(p.endA==p.endB&&(M=qIe(h.parent.content.cut(h.parentOffset,v.parentOffset),m.parent.content.cut(m.parentOffset,p.endA-m.start()))))$=e.state.tr,M.type=="add"?$.addMark(S,b,M.mark):$.removeMark(S,b,M.mark);else if(h.parent.child(h.index()).isText&&h.index()==v.index()-(v.textOffset?0:1)){let R=h.parent.textBetween(h.parentOffset,v.parentOffset);if(e.someProp("handleTextInput",q=>q(e,S,b,R)))return;$=e.state.tr.insertText(R,S,b)}}if($||($=e.state.tr.replace(S,b,s.doc.slice(p.start-s.from,p.endB-s.from))),s.sel){let R=V4(e,$.doc,s.sel);R&&!(Bn&&Ni&&e.composing&&R.empty&&(p.start!=p.endB||e.input.lastAndroidDelete<Date.now()-100)&&(R.head==S||R.head==$.mapping.map(b)-1)||sr&&R.empty&&R.head==S)&&$.setSelection(R)}T&&$.ensureMarks(T),e.dispatch($.scrollIntoView())}function V4(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:hE(e,t.resolve(n.anchor),t.resolve(n.head))}function qIe(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,o=r,a,u,s;for(let l=0;l<r.length;l++)i=r[l].removeFromSet(i);for(let l=0;l<n.length;l++)o=n[l].removeFromSet(o);if(i.length==1&&o.length==0)u=i[0],a="add",s=l=>l.mark(u.addToSet(l.marks));else if(i.length==0&&o.length==1)u=o[0],a="remove",s=l=>l.mark(u.removeFromSet(l.marks));else return null;let c=[];for(let l=0;l<t.childCount;l++)c.push(s(t.child(l)));if(z.from(c).eq(e))return{mark:u,type:a}}function UIe(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||CE(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let a=e.resolve(CE(o,!0,!0));return!a.parent.isTextblock||a.pos>n||CE(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function CE(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let o=e.node(r).maybeChild(e.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function BIe(e,t,n,r,i){let o=e.findDiffStart(t,n);if(o==null)return null;let{a,b:u}=e.findDiffEnd(t,n+e.size,n+t.size);if(i=="end"){let s=Math.max(0,o-Math.min(a,u));r-=a+s-o}if(a<o&&e.size<t.size){let s=r<=o&&r>=a?o-r:0;o-=s,u=o+(u-a),a=o}else if(u<o){let s=r<=o&&r>=u?o-r:0;o-=s,a=o+(a-u),u=o}return{start:o,endA:a,endB:u}}class zIe{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 lIe,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Z4),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Y4(this),G4(this),this.nodeViews=J4(this),this.docView=u4(this.state.doc,H4(this),wE(this),this.dom,this),this.domObserver=new FIe(this,(r,i,o,a)=>DIe(this,r,i,o,a)),this.domObserver.start(),fIe(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&_E(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(Z4),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];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&&(j4(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 d=J4(this);VIe(d,this.nodeViews)&&(this.nodeViews=d,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&_E(this),this.editable=Y4(this),G4(this);let u=wE(this),s=H4(this),c=r.plugins!=t.plugins&&!r.doc.eq(t.doc)?"reset":t.scrollToSelection>r.scrollToSelection?"to selection":"preserve",l=i||!this.docView.matchesNode(t.doc,s,u);(l||!t.selection.eq(r.selection))&&(o=!0);let f=c=="preserve"&&o&&this.dom.style.overflowAnchor==null&&RTe(this);if(o){this.domObserver.stop();let d=l&&(sr||Bn)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&KIe(r.selection,t.selection);if(l){let p=Bn?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(t.doc,s,u,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=u4(t.doc,s,u,this.dom,this)),p&&!this.trackWrites&&(d=!0)}d||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&eIe(this))?_a(this,d):(g4(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():f&&MTe(f)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Se){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Y3(this,n.getBoundingClientRect(),t)}else Y3(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){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}someProp(t,n){let r=this._props&&this._props[t],i;if(r!=null&&(i=n?n(r):r))return i;for(let a=0;a<this.directPlugins.length;a++){let u=this.directPlugins[a].props[t];if(u!=null&&(i=n?n(u):u))return i}let o=this.state.plugins;if(o)for(let a=0;a<o.length;a++){let u=o[a].props[t];if(u!=null&&(i=n?n(u):u))return i}}hasFocus(){if(sr){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(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&xTe(this.dom),_a(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}posAtCoords(t){return PTe(this,t)}coordsAtPos(t,n=1){return e4(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(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){return qTe(this,n||this.state,t)}pasteHTML(t,n){return Nh(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Nh(this,t,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(dIe(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],wE(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(t){return hIe(this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return zn&&this.root.nodeType===11&&ITe(this.dom.ownerDocument)==this.dom?WIe(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function H4(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"&&(t.class+=" "+n[r]),r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),[Er.node(0,e.state.doc.content.size,t)]}function G4(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Er.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Y4(e){return!e.someProp("editable",t=>t(e.state)===!1)}function KIe(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function J4(e){let t=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(t,i)||(t[i]=r[i])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function VIe(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r}function Z4(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var wu={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:"'"},bb={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},X4=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),HIe=typeof navigator<"u"&&/Mac/.test(navigator.platform),GIe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),YIe=HIe||X4&&+X4[1]<57,yn=0;yn<10;yn++)wu[48+yn]=wu[96+yn]=String(yn);for(var yn=1;yn<=24;yn++)wu[yn+111]="F"+yn;for(var yn=65;yn<=90;yn++)wu[yn]=String.fromCharCode(yn+32),bb[yn]=String.fromCharCode(yn);for(var EE in wu)bb.hasOwnProperty(EE)||(bb[EE]=wu[EE]);function JIe(e){var t=YIe&&(e.ctrlKey||e.altKey||e.metaKey)||GIe&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?bb:wu)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const ZIe=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function XIe(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,o,a;for(let u=0;u<t.length-1;u++){let s=t[u];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))r=!0;else if(/^(c|ctrl|control)$/i.test(s))i=!0;else if(/^s(hift)?$/i.test(s))o=!0;else if(/^mod$/i.test(s))ZIe?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+s)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),a&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function QIe(e){let t=Object.create(null);for(let n in e)t[XIe(n)]=e[n];return t}function RE(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function e1e(e){return new Gr({props:{handleKeyDown:t1e(e)}})}function t1e(e){let t=QIe(e);return function(n,r){let i=JIe(r),o,a=t[RE(i,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let u=t[RE(i,r,!1)];if(u&&u(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=wu[r.keyCode])&&o!=i){let u=t[RE(o,r)];if(u&&u(n.state,n.dispatch,n))return!0}}return!1}}const n1e=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function r1e(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const i1e=(e,t,n)=>{let r=r1e(e,n);if(!r)return!1;let i=Q4(r);if(!i){let a=r.blockRange(),u=a&&pf(a);return u==null?!1:(t&&t(e.tr.lift(a,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&n5(e,i,t))return!0;if(r.parent.content.size==0&&(Of(o,"end")||Se.isSelectable(o))){let a=ZC(e.doc,r.before(),r.after(),se.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(Of(o,"end")?We.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):Se.create(u.doc,i.pos-o.nodeSize)),t(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1};function Of(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const o1e=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=Q4(r)}let a=o&&o.nodeBefore;return!a||!Se.isSelectable(a)?!1:(t&&t(e.tr.setSelection(Se.create(e.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function Q4(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function a1e(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const u1e=(e,t,n)=>{let r=a1e(e,n);if(!r)return!1;let i=e5(r);if(!i)return!1;let o=i.nodeAfter;if(n5(e,i,t))return!0;if(r.parent.content.size==0&&(Of(o,"start")||Se.isSelectable(o))){let a=ZC(e.doc,r.before(),r.after(),se.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(Of(o,"start")?We.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):Se.create(u.doc,u.mapping.map(i.pos))),t(u.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},s1e=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=e5(r)}let a=o&&o.nodeAfter;return!a||!Se.isSelectable(a)?!1:(t&&t(e.tr.setSelection(Se.create(e.doc,o.pos)).scrollIntoView()),!0)};function e5(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const c1e=(e,t)=>{let n=e.selection,r=n instanceof Se,i;if(r){if(n.node.isTextblock||!vu(e.doc,n.from))return!1;i=n.from}else if(i=k3(e.doc,n.from,-1),i==null)return!1;if(t){let o=e.tr.join(i);r&&o.setSelection(Se.create(o.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},l1e=(e,t)=>{let n=e.selection,r;if(n instanceof Se){if(n.node.isTextblock||!vu(e.doc,n.to))return!1;r=n.to}else if(r=k3(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},f1e=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&pf(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},d1e=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
37
|
+
`).scrollIntoView()),!0)};function t5(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const p1e=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),a=t5(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(t){let u=n.after(),s=e.tr.replaceWith(u,u,a.createAndFill());s.setSelection(We.near(s.doc.resolve(u),1)),t(s.scrollIntoView())}return!0},h1e=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof ki||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=t5(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,u=e.tr.insert(a,o.createAndFill());u.setSelection(Be.create(u.doc,a+1)),t(u.scrollIntoView())}return!0},m1e=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(hf(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&pf(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},v1e=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(Se.create(e.doc,i))),!0)};function g1e(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||vu(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function n5(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(g1e(e,t,n))return!0;let u=t.parent.canReplace(t.index(),t.index()+1);if(u&&(o=(a=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(n){let f=t.pos+i.nodeSize,d=z.empty;for(let v=o.length-1;v>=0;v--)d=z.from(o[v].create(null,d));d=z.from(r.copy(d));let p=e.tr.step(new tn(t.pos-1,f,t.pos,f,new se(d,1,0),o.length,!0)),h=f+2*o.length;vu(p.doc,h)&&p.join(h),n(p.scrollIntoView())}return!0}let s=We.findFrom(t,1),c=s&&s.$from.blockRange(s.$to),l=c&&pf(c);if(l!=null&&l>=t.depth)return n&&n(e.tr.lift(c,l).scrollIntoView()),!0;if(u&&Of(i,"start",!0)&&Of(r,"end")){let f=r,d=[];for(;d.push(f),!f.isTextblock;)f=f.lastChild;let p=i,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(f.canReplace(f.childCount,f.childCount,p.content)){if(n){let v=z.empty;for(let _=d.length-1;_>=0;_--)v=z.from(d[_].copy(v));let m=e.tr.step(new tn(t.pos-d.length,t.pos+i.nodeSize,t.pos+h,t.pos+i.nodeSize-h,new se(v,d.length,0),0,!0));n(m.scrollIntoView())}return!0}}return!1}function r5(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(t.tr.setSelection(Be.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const y1e=r5(-1),b1e=r5(1);function _1e(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),u=a&&JC(a,e,t);return u?(r&&r(n.tr.wrap(a,u).scrollIntoView()),!0):!1}}function i5(e,t=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:a},$to:{pos:u}}=n.selection.ranges[o];n.doc.nodesBetween(a,u,(s,c)=>{if(i)return!1;if(!(!s.isTextblock||s.hasMarkup(e,t)))if(s.type==e)i=!0;else{let l=n.doc.resolve(c),f=l.index();i=l.parent.canReplaceWith(f,f+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:u},$to:{pos:s}}=n.selection.ranges[a];o.setBlockType(u,s,e,t)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function S1e(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),u=!1,s=a;if(!a)return!1;if(a.depth>=2&&i.node(a.depth-1).type.compatibleContent(e)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;let l=n.doc.resolve(a.start-2);s=new rb(l,l,a.depth),a.endIndex<a.parent.childCount&&(a=new rb(i,n.doc.resolve(o.end(a.depth)),a.depth)),u=!0}let c=JC(s,e,t,a);return c?(r&&r($1e(n.tr,a,c,u,e).scrollIntoView()),!0):!1}}function $1e(e,t,n,r,i){let o=z.empty;for(let l=n.length-1;l>=0;l--)o=z.from(n[l].type.create(n[l].attrs,o));e.step(new tn(t.start-(r?2:0),t.end,t.start,t.end,new se(o,0,0),n.length,!0));let a=0;for(let l=0;l<n.length;l++)n[l].type==i&&(a=l+1);let u=n.length-a,s=t.start+n.length-(r?2:0),c=t.parent;for(let l=t.startIndex,f=t.endIndex,d=!0;l<f;l++,d=!1)!d&&hf(e.doc,s,u)&&(e.split(s,u),s+=2*u),s+=c.child(l).nodeSize;return e}function T1e(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==e);return o?n?r.node(o.depth-1).type==e?I1e(t,n,e,o):O1e(t,n,o):!0:!1}}function I1e(e,t,n,r){let i=e.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new tn(o-1,a,o,a,new se(z.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new rb(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const u=pf(r);if(u==null)return!1;i.lift(r,u);let s=i.mapping.map(o,-1)-1;return vu(i.doc,s)&&i.join(s),t(i.scrollIntoView()),!0}function O1e(e,t,n){let r=e.tr,i=n.parent;for(let p=n.end,h=n.endIndex-1,v=n.startIndex;h>v;h--)p-=i.child(h).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),a=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let u=n.startIndex==0,s=n.endIndex==i.childCount,c=o.node(-1),l=o.index(-1);if(!c.canReplace(l+(u?0:1),l+1,a.content.append(s?z.empty:z.from(i))))return!1;let f=o.pos,d=f+a.nodeSize;return r.step(new tn(f-(u?1:0),d+(s?1:0),f+1,d-1,new se((u?z.empty:z.from(i.copy(z.empty))).append(s?z.empty:z.from(i.copy(z.empty))),u?0:1,s?0:1),u?0:1)),t(r.scrollIntoView()),!0}function w1e(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==e);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let u=o.parent,s=u.child(a-1);if(s.type!=e)return!1;if(n){let c=s.lastChild&&s.lastChild.type==u.type,l=z.from(c?e.create():null),f=new se(z.from(e.create(null,z.from(u.type.create(null,l)))),c?3:1,0),d=o.start,p=o.end;n(t.tr.step(new tn(d-(c?3:1),p,d,p,f,1,!0)).scrollIntoView())}return!0}}function _b(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class Sb{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(){const{rawCommands:t,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([u,s])=>[u,(...l)=>{const f=s(...l)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,u=[],s=!!t,c=t||o.tr,l=()=>(!s&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(c),u.every(d=>d===!0)),f={...Object.fromEntries(Object.entries(r).map(([d,p])=>[d,(...v)=>{const m=this.buildProps(c,n),_=p(...v)(m);return u.push(_),f}])),run:l};return f}createCan(t){const{rawCommands:n,state:r}=this,i=!1,o=t||r.tr,a=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([s,c])=>[s,(...l)=>c(...l)({...a,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i;o.storedMarks&&t.setStoredMarks(o.storedMarks);const u={tr:t,editor:i,view:a,state:_b({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(([s,c])=>[s,(...l)=>c(...l)(u)]))}};return u}}class C1e{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){const r=this.callbacks[t];return r&&r.forEach(i=>i.apply(this,n)),this}off(t,n){const r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(i=>i!==n):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}function fe(e,t,n){return e.config[t]===void 0&&e.parent?fe(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?fe(e.parent,t,n):null}):e.config[t]}function $b(e){const t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),r=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function o5(e){const t=[],{nodeExtensions:n,markExtensions:r}=$b(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},s=fe(a,"addGlobalAttributes",u);if(!s)return;s().forEach(l=>{l.types.forEach(f=>{Object.entries(l.attributes).forEach(([d,p])=>{t.push({type:f,name:d,attribute:{...o,...p}})})})})}),i.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},s=fe(a,"addAttributes",u);if(!s)return;const c=s();Object.entries(c).forEach(([l,f])=>{const d={...o,...f};f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete d.default,t.push({type:a.name,name:l,attribute:d})})}),t}function nn(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function bn(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}i==="class"?r[i]=[r[i],o].join(" "):i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function ME(e,t){return t.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>bn(n,r),{})}function a5(e){return typeof e=="function"}function Fe(e,t=void 0,...n){return a5(e)?t?e.bind(t)(...n):e(...n):e}function E1e(e={}){return Object.keys(e).length===0&&e.constructor===Object}function R1e(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function u5(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const i=t.reduce((o,a)=>{const u=a.attribute.parseHTML?a.attribute.parseHTML(n):R1e(n.getAttribute(a.name));return u==null?o:{...o,[a.name]:u}},{});return{...r,...i}}}}function s5(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&E1e(n)?!1:n!=null))}function c5(e){var t;const n=o5(e),{nodeExtensions:r,markExtensions:i}=$b(e),o=(t=r.find(s=>fe(s,"topNode")))===null||t===void 0?void 0:t.name,a=Object.fromEntries(r.map(s=>{const c=n.filter(m=>m.type===s.name),l={name:s.name,options:s.options,storage:s.storage},f=e.reduce((m,_)=>{const g=fe(_,"extendNodeSchema",l);return{...m,...g?g(s):{}}},{}),d=s5({...f,content:Fe(fe(s,"content",l)),marks:Fe(fe(s,"marks",l)),group:Fe(fe(s,"group",l)),inline:Fe(fe(s,"inline",l)),atom:Fe(fe(s,"atom",l)),selectable:Fe(fe(s,"selectable",l)),draggable:Fe(fe(s,"draggable",l)),code:Fe(fe(s,"code",l)),defining:Fe(fe(s,"defining",l)),isolating:Fe(fe(s,"isolating",l)),attrs:Object.fromEntries(c.map(m=>{var _;return[m.name,{default:(_=m==null?void 0:m.attribute)===null||_===void 0?void 0:_.default}]}))}),p=Fe(fe(s,"parseHTML",l));p&&(d.parseDOM=p.map(m=>u5(m,c)));const h=fe(s,"renderHTML",l);h&&(d.toDOM=m=>h({node:m,HTMLAttributes:ME(m,c)}));const v=fe(s,"renderText",l);return v&&(d.toText=v),[s.name,d]})),u=Object.fromEntries(i.map(s=>{const c=n.filter(v=>v.type===s.name),l={name:s.name,options:s.options,storage:s.storage},f=e.reduce((v,m)=>{const _=fe(m,"extendMarkSchema",l);return{...v,..._?_(s):{}}},{}),d=s5({...f,inclusive:Fe(fe(s,"inclusive",l)),excludes:Fe(fe(s,"excludes",l)),group:Fe(fe(s,"group",l)),spanning:Fe(fe(s,"spanning",l)),code:Fe(fe(s,"code",l)),attrs:Object.fromEntries(c.map(v=>{var m;return[v.name,{default:(m=v==null?void 0:v.attribute)===null||m===void 0?void 0:m.default}]}))}),p=Fe(fe(s,"parseHTML",l));p&&(d.parseDOM=p.map(v=>u5(v,c)));const h=fe(s,"renderHTML",l);return h&&(d.toDOM=v=>h({mark:v,HTMLAttributes:ME(v,c)})),[s.name,d]}));return new D0e({topNode:o,nodes:a,marks:u})}function xE(e,t){return t.nodes[e]||t.marks[e]||null}function l5(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}const M1e=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,o,a,u)=>{var s,c;const l=((c=(s=i.type.spec).toText)===null||c===void 0?void 0:c.call(s,{node:i,pos:o,parent:a,index:u}))||i.textContent||"%leaf%";n+=l.slice(0,Math.max(0,r-o))}),n};function kE(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class AE{constructor(t){this.find=t.find,this.handler=t.handler}}const x1e=(e,t)=>{if(kE(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function NE(e){var t;const{editor:n,from:r,to:i,text:o,rules:a,plugin:u}=e,{view:s}=n;if(s.composing)return!1;const c=s.state.doc.resolve(r);if(c.parent.type.spec.code||!((t=c.nodeBefore||c.nodeAfter)===null||t===void 0)&&t.marks.find(d=>d.type.spec.code))return!1;let l=!1;const f=M1e(c)+o;return a.forEach(d=>{if(l)return;const p=x1e(f,d.find);if(!p)return;const h=s.state.tr,v=_b({state:s.state,transaction:h}),m={from:r-(p[0].length-o.length),to:i},{commands:_,chain:g,can:S}=new Sb({editor:n,state:v});d.handler({state:v,range:m,match:p,commands:_,chain:g,can:S})===null||!h.steps.length||(h.setMeta(u,{transform:h,from:r,to:i,text:o}),s.dispatch(h),l=!0)}),l}function k1e(e){const{editor:t,rules:n}=e,r=new Gr({state:{init(){return null},apply(i,o){const a=i.getMeta(r);return a||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,a,u){return NE({editor:t,from:o,to:a,text:u,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&NE({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?NE({editor:t,from:a.pos,to:a.pos,text:`
|
|
38
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function A1e(e){return typeof e=="number"}class N1e{constructor(t){this.find=t.find,this.handler=t.handler}}const F1e=(e,t)=>{if(kE(t))return[...e.matchAll(t)];const n=t(e);return n?n.map(r=>{const i=[r.text];return i.index=r.index,i.input=e,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(r.replaceWith)),i}):[]};function P1e(e){const{editor:t,state:n,from:r,to:i,rule:o}=e,{commands:a,chain:u,can:s}=new Sb({editor:t,state:n}),c=[];return n.doc.nodesBetween(r,i,(f,d)=>{if(!f.isTextblock||f.type.spec.code)return;const p=Math.max(r,d),h=Math.min(i,d+f.content.size),v=f.textBetween(p-d,h-d,void 0,"");F1e(v,o.find).forEach(_=>{if(_.index===void 0)return;const g=p+_.index+1,S=g+_[0].length,b={from:n.tr.mapping.map(g),to:n.tr.mapping.map(S)},$=o.handler({state:n,range:b,match:_,commands:a,chain:u,can:s});c.push($)})}),c.every(f=>f!==null)}function W1e(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1;return n.map(u=>new Gr({view(s){const c=l=>{var f;r=!((f=s.dom.parentElement)===null||f===void 0)&&f.contains(l.target)?s.dom.parentElement:null};return window.addEventListener("dragstart",c),{destroy(){window.removeEventListener("dragstart",c)}}},props:{handleDOMEvents:{drop:s=>(o=r===s.dom.parentElement,!1),paste:(s,c)=>{var l;const f=(l=c.clipboardData)===null||l===void 0?void 0:l.getData("text/html");return i=!!(f!=null&&f.includes("data-pm-slice")),!1}}},appendTransaction:(s,c,l)=>{const f=s[0],d=f.getMeta("uiEvent")==="paste"&&!i,p=f.getMeta("uiEvent")==="drop"&&!o;if(!d&&!p)return;const h=c.doc.content.findDiffStart(l.doc.content),v=c.doc.content.findDiffEnd(l.doc.content);if(!A1e(h)||!v||h===v.b)return;const m=l.tr,_=_b({state:l,transaction:m});if(!(!P1e({editor:t,state:_,from:Math.max(h-1,0),to:v.b-1,rule:u})||!m.steps.length))return m}}))}function j1e(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return[...new Set(t)]}class fc{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=fc.resolve(t),this.schema=c5(this.extensions),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:xE(r.name,this.schema)};r.type==="mark"&&(!((i=Fe(fe(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const a=fe(r,"onBeforeCreate",o);a&&this.editor.on("beforeCreate",a);const u=fe(r,"onCreate",o);u&&this.editor.on("create",u);const s=fe(r,"onUpdate",o);s&&this.editor.on("update",s);const c=fe(r,"onSelectionUpdate",o);c&&this.editor.on("selectionUpdate",c);const l=fe(r,"onTransaction",o);l&&this.editor.on("transaction",l);const f=fe(r,"onFocus",o);f&&this.editor.on("focus",f);const d=fe(r,"onBlur",o);d&&this.editor.on("blur",d);const p=fe(r,"onDestroy",o);p&&this.editor.on("destroy",p)})}static resolve(t){const n=fc.sort(fc.flatten(t)),r=j1e(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=fe(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(t){return t.sort((r,i)=>{const o=fe(r,"priority")||100,a=fe(i,"priority")||100;return o>a?-1:o<a?1:0})}get commands(){return this.extensions.reduce((t,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:xE(n.name,this.schema)},i=fe(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){const{editor:t}=this,n=fc.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(a=>{const u={name:a.name,options:a.options,storage:a.storage,editor:t,type:xE(a.name,this.schema)},s=[],c=fe(a,"addKeyboardShortcuts",u);let l={};if(a.type==="mark"&&a.config.exitable&&(l.ArrowRight=()=>BE.handleExit({editor:t,mark:a})),c){const v=Object.fromEntries(Object.entries(c()).map(([m,_])=>[m,()=>_({editor:t})]));l={...l,...v}}const f=e1e(l);s.push(f);const d=fe(a,"addInputRules",u);l5(a,t.options.enableInputRules)&&d&&r.push(...d());const p=fe(a,"addPasteRules",u);l5(a,t.options.enablePasteRules)&&p&&i.push(...p());const h=fe(a,"addProseMirrorPlugins",u);if(h){const v=h();s.push(...v)}return s}).flat();return[k1e({editor:t,rules:r}),...W1e({editor:t,rules:i}),...o]}get attributes(){return o5(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=$b(this.extensions);return Object.fromEntries(n.filter(r=>!!fe(r,"addNodeView")).map(r=>{const i=this.attributes.filter(s=>s.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:t,type:nn(r.name,this.schema)},a=fe(r,"addNodeView",o);if(!a)return[];const u=(s,c,l,f)=>{const d=ME(s,i);return a()({editor:t,node:s,getPos:l,decorations:f,HTMLAttributes:d,extension:r})};return[r.name,u]}))}}function L1e(e){return Object.prototype.toString.call(e).slice(8,-1)}function FE(e){return L1e(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Tb(e,t){const n={...e};return FE(e)&&FE(t)&&Object.keys(t).forEach(r=>{FE(t[r])?r in e?n[r]=Tb(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})}),n}class Rr{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=Fe(fe(this,"addOptions",{name:this.name}))),this.storage=Fe(fe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Rr(t)}configure(t={}){const n=this.extend();return n.options=Tb(this.options,t),n.storage=Fe(fe(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Rr(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=Fe(fe(n,"addOptions",{name:n.name})),n.storage=Fe(fe(n,"addStorage",{name:n.name,options:n.options})),n}}function f5(e,t,n){const{from:r,to:i}=t,{blockSeparator:o=`
|
|
39
39
|
|
|
40
|
-
`,textSerializers:a={}}=n||{};let u="",s=!0;return e.nodesBetween(r,i,(c,l,f,d)=>{var p;const h=a==null?void 0:a[c.type.name];h?(c.isBlock&&!s&&(u+=o,s=!0),f&&(u+=h({node:c,pos:l,parent:f,index:d,range:t}))):c.isText?(u+=(p=c==null?void 0:c.text)===null||p===void 0?void 0:p.slice(Math.max(r,l)-l,i-l),s=!1):c.isBlock&&!s&&(u+=o,s=!0)}),u}function d5(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const W1e=Er.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Gr({key:new vu("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,a=Math.min(...o.map(l=>l.$from.pos)),u=Math.max(...o.map(l=>l.$to.pos)),s=d5(n);return f5(r,{from:a,to:u},{textSerializers:s})}}})]}}),L1e=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),j1e=(e=!1)=>({commands:t})=>t.setContent("",e),D1e=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:a})=>{e.doc.nodesBetween(o.pos,a.pos,(u,s)=>{if(u.type.isText)return;const{doc:c,mapping:l}=t,f=c.resolve(l.map(s)),d=c.resolve(l.map(s+u.nodeSize)),p=f.blockRange(d);if(!p)return;const h=pf(p);if(u.type.isTextblock){const{defaultType:v}=f.parent.contentMatchAt(f.index());t.setNodeMarkup(p.start,v)}(h||h===0)&&t.lift(p,h)})}),!0},q1e=e=>t=>e(t),U1e=()=>({state:e,dispatch:t})=>f1e(e,t),B1e=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){const u=i.before(o),s=i.after(o);e.delete(u,s).scrollIntoView()}return!0}return!1},z1e=e=>({tr:t,state:n,dispatch:r})=>{const i=nn(e,n.schema),o=t.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i){if(r){const s=o.before(a),c=o.after(a);t.delete(s,c).scrollIntoView()}return!0}return!1},K1e=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},V1e=()=>({state:e,dispatch:t})=>QIe(e,t),H1e=()=>({commands:e})=>e.keyboardShortcut("Enter"),G1e=()=>({state:e,dispatch:t})=>l1e(e,t);function Ib(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:kE(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function PE(e,t,n={}){return e.find(r=>r.type===t&&Ib(r.attrs,n))}function Y1e(e,t,n={}){return!!PE(e,t,n)}function WE(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&r.offset!==0&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const i=PE([...r.node.marks],t,n);if(!i)return;let o=r.index,a=e.start()+r.offset,u=o+1,s=a+r.node.nodeSize;for(PE([...r.node.marks],t,n);o>0&&i.isInSet(e.parent.child(o-1).marks);)o-=1,a-=e.parent.child(o).nodeSize;for(;u<e.parent.childCount&&Y1e([...e.parent.child(u).marks],t,n);)s+=e.parent.child(u).nodeSize,u+=1;return{from:a,to:s}}function wu(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const J1e=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=wu(e,r.schema),{doc:a,selection:u}=n,{$from:s,from:c,to:l}=u;if(i){const f=WE(s,o,t);if(f&&f.from<=c&&f.to>=l){const d=Be.create(a,f.from,f.to);n.setSelection(d)}}return!0},Z1e=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function LE(e){return e instanceof Be}function Sa(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function p5(e,t=null){if(!t)return null;const n=We.atStart(e),r=We.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?Be.create(e,Sa(0,i,o),Sa(e.content.size,i,o)):Be.create(e,Sa(t,i,o),Sa(t,i,o))}function jE(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const X1e=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const a=()=>{jE()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(o&&e===null&&!LE(n.state.selection))return a(),!0;const u=p5(i.doc,e)||n.state.selection,s=n.state.selection.eq(u);return o&&(s||i.setSelection(u),s&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},Q1e=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),eOe=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t);function h5(e){const t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,"text/html").body}function Ob(e,t,n){if(n={slice:!0,parseOptions:{},...n},typeof e=="object"&&e!==null)try{return Array.isArray(e)?z.fromArray(e.map(r=>t.nodeFromJSON(r))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Ob("",t,n)}if(typeof e=="string"){const r=ff.fromSchema(t);return n.slice?r.parseSlice(h5(e),n.parseOptions).content:r.parse(h5(e),n.parseOptions)}return Ob("",t,n)}function tOe(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof En||i instanceof tn))return;const o=e.mapping.maps[r];let a=0;o.forEach((u,s,c,l)=>{a===0&&(a=l)}),e.setSelection(We.near(e.doc.resolve(a),n))}const nOe=e=>e.toString().startsWith("<"),rOe=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const a=Ob(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(a.toString()==="<>")return!0;let{from:u,to:s}=typeof e=="number"?{from:e,to:e}:e,c=!0,l=!0;if((nOe(a)?a:[a]).forEach(d=>{d.check(),c=c?d.isText&&d.marks.length===0:!1,l=l?d.isBlock:!1}),u===s&&l){const{parent:d}=r.doc.resolve(u);d.isTextblock&&!d.type.spec.code&&!d.childCount&&(u-=1,s+=1)}c?r.insertText(t,u,s):r.replaceWith(u,s,a),n.updateSelection&&tOe(r,r.steps.length-1,-1)}return!0},iOe=()=>({state:e,dispatch:t})=>a1e(e,t),oOe=()=>({state:e,dispatch:t})=>u1e(e,t),aOe=()=>({state:e,dispatch:t})=>t1e(e,t),uOe=()=>({state:e,dispatch:t})=>i1e(e,t);function m5(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function sOe(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,i,o,a;for(let u=0;u<t.length-1;u+=1){const s=t[u];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))r=!0;else if(/^(c|ctrl|control)$/i.test(s))i=!0;else if(/^s(hift)?$/i.test(s))o=!0;else if(/^mod$/i.test(s))jE()||m5()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${s}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const cOe=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=sOe(e).split(/-(?!$)/),a=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),u=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),s=t.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,u))});return s==null||s.steps.forEach(c=>{const l=c.map(r.mapping);l&&i&&r.maybeStep(l)}),!0};function Ph(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,a=t?nn(t,e.schema):null,u=[];e.doc.nodesBetween(r,i,(f,d)=>{if(f.isText)return;const p=Math.max(r,d),h=Math.min(i,d+f.nodeSize);u.push({node:f,from:p,to:h})});const s=i-r,c=u.filter(f=>a?a.name===f.node.type.name:!0).filter(f=>Ib(f.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((f,d)=>f+d.to-d.from,0)>=s}const lOe=(e,t={})=>({state:n,dispatch:r})=>{const i=nn(e,n.schema);return Ph(n,i,t)?s1e(n,r):!1},fOe=()=>({state:e,dispatch:t})=>d1e(e,t),dOe=e=>({state:t,dispatch:n})=>{const r=nn(e,t.schema);return _1e(r)(t,n)},pOe=()=>({state:e,dispatch:t})=>c1e(e,t);function wb(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function v5(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}const hOe=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const u=wb(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(o=nn(e,r.schema)),u==="mark"&&(a=wu(e,r.schema)),i&&n.selection.ranges.forEach(s=>{r.doc.nodesBetween(s.$from.pos,s.$to.pos,(c,l)=>{o&&o===c.type&&n.setNodeMarkup(l,void 0,v5(c.attrs,t)),a&&c.marks.length&&c.marks.forEach(f=>{a===f.type&&n.addMark(l,l+c.nodeSize,a.create(v5(f.attrs,t)))})})}),!0):!1},mOe=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),vOe=()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),gOe=()=>({state:e,dispatch:t})=>n1e(e,t),yOe=()=>({state:e,dispatch:t})=>o1e(e,t),bOe=()=>({state:e,dispatch:t})=>p1e(e,t),_Oe=()=>({state:e,dispatch:t})=>v1e(e,t),SOe=()=>({state:e,dispatch:t})=>m1e(e,t);function g5(e,t,n={}){return Ob(e,t,{slice:!1,parseOptions:n})}const $Oe=(e,t=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,u=g5(e,i.schema,n);return o&&r.replaceWith(0,a.content.size,u).setMeta("preventUpdate",!t),!0};function TOe(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function IOe(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function DE(e){return t=>IOe(t.$from,e)}function OOe(e,t){const n=fo.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function wOe(e){const t=fc.resolve(e);return c5(t)}function COe(e,t){const n={from:0,to:e.content.size};return f5(e,n,t)}function y5(e,t){const n=wu(t,e.schema),{from:r,to:i,empty:o}=e.selection,a=[];o?(e.storedMarks&&a.push(...e.storedMarks),a.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,s=>{a.push(...s.marks)});const u=a.find(s=>s.type.name===n.name);return u?{...u.attrs}:{}}function EOe(e,t){const n=nn(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,u=>{o.push(u)});const a=o.reverse().find(u=>u.type.name===n.name);return a?{...a.attrs}:{}}function ROe(e,t){const n=wb(typeof t=="string"?t:t.name,e.schema);return n==="node"?EOe(e,t):n==="mark"?y5(e,t):{}}function b5(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e-1),a=WE(o,i.type);a&&r.push({mark:i,...a})}):n.nodesBetween(e,t,(i,o)=>{r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}function qE(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?wu(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Ib(f.attrs,n,{strict:!1}));let a=0;const u=[];if(i.forEach(({$from:f,$to:d})=>{const p=f.pos,h=d.pos;e.doc.nodesBetween(p,h,(v,m)=>{if(!v.isText&&!v.marks.length)return;const _=Math.max(p,m),g=Math.min(h,m+v.nodeSize),S=g-_;a+=S,u.push(...v.marks.map(b=>({mark:b,from:_,to:g})))})}),a===0)return!1;const s=u.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Ib(f.mark.attrs,n,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),c=u.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,d)=>f+d.to-d.from,0);return(s>0?s+c:s)>=a}function MOe(e,t,n={}){if(!t)return Ph(e,null,n)||qE(e,null,n);const r=wb(t,e.schema);return r==="node"?Ph(e,t,n):r==="mark"?qE(e,t,n):!1}function _5(e,t){const{nodeExtensions:n}=$b(t),r=n.find(a=>a.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Fe(fe(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function xOe(e){var t;const n=(t=e.type.createAndFill())===null||t===void 0?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function kOe(e){return e instanceof Se}function AOe(e,t,n){const i=e.state.doc.content.size,o=Sa(t,0,i),a=Sa(n,0,i),u=e.coordsAtPos(o),s=e.coordsAtPos(a,-1),c=Math.min(u.top,s.top),l=Math.max(u.bottom,s.bottom),f=Math.min(u.left,s.left),d=Math.max(u.right,s.right),p=d-f,h=l-c,_={top:c,bottom:l,left:f,right:d,width:p,height:h,x:f,y:c};return{..._,toJSON:()=>_}}function NOe(e,t,n){var r;const{selection:i}=t;let o=null;if(LE(i)&&(o=i.$cursor),o){const u=(r=e.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(u)||!u.some(s=>s.type.excludes(n))}const{ranges:a}=i;return a.some(({$from:u,$to:s})=>{let c=u.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(u.pos,s.pos,(l,f,d)=>{if(c)return!1;if(l.isInline){const p=!d||d.type.allowsMarkType(n),h=!!n.isInSet(l.marks)||!l.marks.some(v=>v.type.excludes(n));c=p&&h}return!c}),c})}const FOe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:a,ranges:u}=o,s=wu(e,r.schema);if(i)if(a){const c=y5(r,s);n.addStoredMark(s.create({...c,...t}))}else u.forEach(c=>{const l=c.$from.pos,f=c.$to.pos;r.doc.nodesBetween(l,f,(d,p)=>{const h=Math.max(p,l),v=Math.min(p+d.nodeSize,f);d.marks.find(_=>_.type===s)?d.marks.forEach(_=>{s===_.type&&n.addMark(h,v,s.create({..._.attrs,...t}))}):n.addMark(h,v,s.create(t))})});return NOe(r,n,s)},POe=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),WOe=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=nn(e,n.schema);return o.isTextblock?i().command(({commands:a})=>i5(o,t)(n)?!0:a.clearNodes()).command(({state:a})=>i5(o,t)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},LOe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=Sa(e,0,r.content.size),o=Se.create(r,i);t.setSelection(o)}return!0},jOe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,a=Be.atStart(r).from,u=Be.atEnd(r).to,s=Sa(i,a,u),c=Sa(o,a,u),l=Be.create(r,s,c);t.setSelection(l)}return!0},DOe=e=>({state:t,dispatch:n})=>{const r=nn(e,t.schema);return T1e(r)(t,n)};function Cb(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=e.find(o=>o.type===t&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function S5(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(i=>t==null?void 0:t.includes(i.type.name));e.tr.ensureMarks(r)}}const qOe=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:a}=t,{$from:u,$to:s}=o,c=i.extensionManager.attributes,l=Cb(c,u.node().type.name,u.node().attrs);if(o instanceof Se&&o.node.isBlock)return!u.parentOffset||!hf(a,u.pos)?!1:(r&&(e&&S5(n,i.extensionManager.splittableMarks),t.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;if(r){const f=s.parentOffset===s.parent.content.size;o instanceof Be&&t.deleteSelection();const d=u.depth===0?void 0:TOe(u.node(-1).contentMatchAt(u.indexAfter(-1)));let p=f&&d?[{type:d,attrs:l}]:void 0,h=hf(t.doc,t.mapping.map(u.pos),1,p);if(!p&&!h&&hf(t.doc,t.mapping.map(u.pos),1,d?[{type:d}]:void 0)&&(h=!0,p=d?[{type:d,attrs:l}]:void 0),h&&(t.split(t.mapping.map(u.pos),1,p),d&&!f&&!u.parentOffset&&u.parent.type!==d)){const v=t.mapping.map(u.before()),m=t.doc.resolve(v);u.node(-1).canReplaceWith(m.index(),m.index()+1,d)&&t.setNodeMarkup(t.mapping.map(u.before()),d)}e&&S5(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0},UOe=e=>({tr:t,state:n,dispatch:r,editor:i})=>{var o;const a=nn(e,n.schema),{$from:u,$to:s}=n.selection,c=n.selection.node;if(c&&c.isBlock||u.depth<2||!u.sameParent(s))return!1;const l=u.node(-1);if(l.type!==a)return!1;const f=i.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==a||u.index(-2)!==u.node(-2).childCount-1)return!1;if(r){let m=z.empty;const _=u.index(-1)?1:u.index(-2)?2:3;for(let R=u.depth-_;R>=u.depth-3;R-=1)m=z.from(u.node(R).copy(m));const g=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,S=Cb(f,u.node().type.name,u.node().attrs),b=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(S))||void 0;m=m.append(z.from(a.createAndFill(null,b)||void 0));const $=u.before(u.depth-(_-1));t.replace($,u.after(-g),new se(m,4-_,0));let T=-1;t.doc.nodesBetween($,t.doc.content.size,(R,E)=>{if(T>-1)return!1;R.isTextblock&&R.content.size===0&&(T=E+1)}),T>-1&&t.setSelection(Be.near(t.doc.resolve(T))),t.scrollIntoView()}return!0}const d=s.pos===u.end()?l.contentMatchAt(0).defaultType:null,p=Cb(f,l.type.name,l.attrs),h=Cb(f,u.node().type.name,u.node().attrs);t.delete(u.pos,s.pos);const v=d?[{type:a,attrs:p},{type:d,attrs:h}]:[{type:a,attrs:p}];return hf(t.doc,u.pos,2)?(r&&t.split(u.pos,2,v).scrollIntoView(),!0):!1},$5=(e,t)=>{const n=DE(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&mu(e.doc,n.pos)&&e.join(n.pos),!0},T5=(e,t)=>{const n=DE(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&mu(e.doc,r)&&e.join(r),!0};var BOe=Object.freeze({__proto__:null,blur:L1e,clearContent:j1e,clearNodes:D1e,command:q1e,createParagraphNear:U1e,deleteCurrentNode:B1e,deleteNode:z1e,deleteRange:K1e,deleteSelection:V1e,enter:H1e,exitCode:G1e,extendMarkRange:J1e,first:Z1e,focus:X1e,forEach:Q1e,insertContent:eOe,insertContentAt:rOe,joinUp:iOe,joinDown:oOe,joinBackward:aOe,joinForward:uOe,keyboardShortcut:cOe,lift:lOe,liftEmptyBlock:fOe,liftListItem:dOe,newlineInCode:pOe,resetAttributes:hOe,scrollIntoView:mOe,selectAll:vOe,selectNodeBackward:gOe,selectNodeForward:yOe,selectParentNode:bOe,selectTextblockEnd:_Oe,selectTextblockStart:SOe,setContent:$Oe,setMark:FOe,setMeta:POe,setNode:WOe,setNodeSelection:LOe,setTextSelection:jOe,sinkListItem:DOe,splitBlock:qOe,splitListItem:UOe,toggleList:(e,t)=>({editor:n,tr:r,state:i,dispatch:o,chain:a,commands:u,can:s})=>{const{extensions:c}=n.extensionManager,l=nn(e,i.schema),f=nn(t,i.schema),{selection:d}=i,{$from:p,$to:h}=d,v=p.blockRange(h);if(!v)return!1;const m=DE(_=>_5(_.type.name,c))(d);if(v.depth>=1&&m&&v.depth-m.depth<=1){if(m.node.type===l)return u.liftListItem(f);if(_5(m.node.type.name,c)&&l.validContent(m.node.content)&&o)return a().command(()=>(r.setNodeMarkup(m.pos,l),!0)).command(()=>$5(r,l)).command(()=>T5(r,l)).run()}return a().command(()=>s().wrapInList(l)?!0:u.clearNodes()).wrapInList(l).command(()=>$5(r,l)).command(()=>T5(r,l)).run()},toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,a=wu(e,r.schema);return qE(r,a,t)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,t)},toggleNode:(e,t,n={})=>({state:r,commands:i})=>{const o=nn(e,r.schema),a=nn(t,r.schema);return Ph(r,o,n)?i.setNode(a):i.setNode(o,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const i=nn(e,n.schema);return Ph(n,i,t)?r.lift(i):r.wrapIn(i,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const a=e.tr,u=o.transform;for(let s=u.steps.length-1;s>=0;s-=1)a.step(u.steps[s].invert(u.docs[s]));if(o.text){const s=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,e.schema.text(o.text,s))}else a.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(o=>{e.removeMark(o.$from.pos,o.$to.pos)}),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=t,{selection:u}=n,s=wu(e,r.schema),{$from:c,empty:l,ranges:f}=u;if(!i)return!0;if(l&&a){let{from:d,to:p}=u;const h=(o=c.marks().find(m=>m.type===s))===null||o===void 0?void 0:o.attrs,v=WE(c,s,h);v&&(d=v.from,p=v.to),n.removeMark(d,p,s)}else f.forEach(d=>{n.removeMark(d.$from.pos,d.$to.pos,s)});return n.removeStoredMark(s),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const u=wb(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(o=nn(e,r.schema)),u==="mark"&&(a=wu(e,r.schema)),i&&n.selection.ranges.forEach(s=>{const c=s.$from.pos,l=s.$to.pos;r.doc.nodesBetween(c,l,(f,d)=>{o&&o===f.type&&n.setNodeMarkup(d,void 0,{...f.attrs,...t}),a&&f.marks.length&&f.marks.forEach(p=>{if(a===p.type){const h=Math.max(d,c),v=Math.min(d+f.nodeSize,l);n.addMark(h,v,a.create({...p.attrs,...t}))}})})}),!0):!1},wrapIn:(e,t={})=>({state:n,dispatch:r})=>{const i=nn(e,n.schema);return g1e(i,t)(n,r)},wrapInList:(e,t={})=>({state:n,dispatch:r})=>{const i=nn(e,n.schema);return y1e(i,t)(n,r)}});const zOe=Er.create({name:"commands",addCommands(){return{...BOe}}}),KOe=Er.create({name:"editable",addProseMirrorPlugins(){return[new Gr({key:new vu("editable"),props:{editable:()=>this.editor.options.editable}})]}}),VOe=Er.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Gr({key:new vu("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),HOe=Er.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:u})=>{const{selection:s,doc:c}=u,{empty:l,$anchor:f}=s,{pos:d,parent:p}=f,h=We.atStart(c).from===d;return!l||!h||!p.type.isTextblock||p.textContent.length?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return jE()||m5()?o:i},addProseMirrorPlugins(){return[new Gr({key:new vu("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some(h=>h.docChanged)&&!t.doc.eq(n.doc)))return;const{empty:i,from:o,to:a}=t.selection,u=We.atStart(t.doc).from,s=We.atEnd(t.doc).to,c=o===u&&a===s,l=n.doc.textBetween(0,n.doc.content.size," "," ").length===0;if(i||!c||!l)return;const f=n.tr,d=_b({state:n,transaction:f}),{commands:p}=new Sb({editor:this.editor,state:d});if(p.clearNodes(),!!f.steps.length)return f}})]}}),GOe=Er.create({name:"tabindex",addProseMirrorPlugins(){return[new Gr({key:new vu("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var YOe=Object.freeze({__proto__:null,ClipboardTextSerializer:W1e,Commands:zOe,Editable:KOe,FocusEvents:VOe,Keymap:HOe,Tabindex:GOe});const JOe=`.ProseMirror {
|
|
40
|
+
`,textSerializers:a={}}=n||{};let u="",s=!0;return e.nodesBetween(r,i,(c,l,f,d)=>{var p;const h=a==null?void 0:a[c.type.name];h?(c.isBlock&&!s&&(u+=o,s=!0),f&&(u+=h({node:c,pos:l,parent:f,index:d,range:t}))):c.isText?(u+=(p=c==null?void 0:c.text)===null||p===void 0?void 0:p.slice(Math.max(r,l)-l,i-l),s=!1):c.isBlock&&!s&&(u+=o,s=!0)}),u}function d5(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const D1e=Rr.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Gr({key:new gu("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,a=Math.min(...o.map(l=>l.$from.pos)),u=Math.max(...o.map(l=>l.$to.pos)),s=d5(n);return f5(r,{from:a,to:u},{textSerializers:s})}}})]}}),q1e=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),U1e=(e=!1)=>({commands:t})=>t.setContent("",e),B1e=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:a})=>{e.doc.nodesBetween(o.pos,a.pos,(u,s)=>{if(u.type.isText)return;const{doc:c,mapping:l}=t,f=c.resolve(l.map(s)),d=c.resolve(l.map(s+u.nodeSize)),p=f.blockRange(d);if(!p)return;const h=pf(p);if(u.type.isTextblock){const{defaultType:v}=f.parent.contentMatchAt(f.index());t.setNodeMarkup(p.start,v)}(h||h===0)&&t.lift(p,h)})}),!0},z1e=e=>t=>e(t),K1e=()=>({state:e,dispatch:t})=>h1e(e,t),V1e=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){const u=i.before(o),s=i.after(o);e.delete(u,s).scrollIntoView()}return!0}return!1},H1e=e=>({tr:t,state:n,dispatch:r})=>{const i=nn(e,n.schema),o=t.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i){if(r){const s=o.before(a),c=o.after(a);t.delete(s,c).scrollIntoView()}return!0}return!1},G1e=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},Y1e=()=>({state:e,dispatch:t})=>n1e(e,t),J1e=()=>({commands:e})=>e.keyboardShortcut("Enter"),Z1e=()=>({state:e,dispatch:t})=>p1e(e,t);function Ib(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:kE(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function PE(e,t,n={}){return e.find(r=>r.type===t&&Ib(r.attrs,n))}function X1e(e,t,n={}){return!!PE(e,t,n)}function WE(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&r.offset!==0&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const i=PE([...r.node.marks],t,n);if(!i)return;let o=r.index,a=e.start()+r.offset,u=o+1,s=a+r.node.nodeSize;for(PE([...r.node.marks],t,n);o>0&&i.isInSet(e.parent.child(o-1).marks);)o-=1,a-=e.parent.child(o).nodeSize;for(;u<e.parent.childCount&&X1e([...e.parent.child(u).marks],t,n);)s+=e.parent.child(u).nodeSize,u+=1;return{from:a,to:s}}function Cu(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const Q1e=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Cu(e,r.schema),{doc:a,selection:u}=n,{$from:s,from:c,to:l}=u;if(i){const f=WE(s,o,t);if(f&&f.from<=c&&f.to>=l){const d=Be.create(a,f.from,f.to);n.setSelection(d)}}return!0},eOe=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function jE(e){return e instanceof Be}function Sa(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function p5(e,t=null){if(!t)return null;const n=We.atStart(e),r=We.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?Be.create(e,Sa(0,i,o),Sa(e.content.size,i,o)):Be.create(e,Sa(t,i,o),Sa(t,i,o))}function LE(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const tOe=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const a=()=>{LE()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(o&&e===null&&!jE(n.state.selection))return a(),!0;const u=p5(i.doc,e)||n.state.selection,s=n.state.selection.eq(u);return o&&(s||i.setSelection(u),s&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},nOe=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),rOe=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t);function h5(e){const t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,"text/html").body}function Ob(e,t,n){if(n={slice:!0,parseOptions:{},...n},typeof e=="object"&&e!==null)try{return Array.isArray(e)?z.fromArray(e.map(r=>t.nodeFromJSON(r))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Ob("",t,n)}if(typeof e=="string"){const r=ff.fromSchema(t);return n.slice?r.parseSlice(h5(e),n.parseOptions).content:r.parse(h5(e),n.parseOptions)}return Ob("",t,n)}function iOe(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof En||i instanceof tn))return;const o=e.mapping.maps[r];let a=0;o.forEach((u,s,c,l)=>{a===0&&(a=l)}),e.setSelection(We.near(e.doc.resolve(a),n))}const oOe=e=>e.toString().startsWith("<"),aOe=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const a=Ob(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(a.toString()==="<>")return!0;let{from:u,to:s}=typeof e=="number"?{from:e,to:e}:e,c=!0,l=!0;if((oOe(a)?a:[a]).forEach(d=>{d.check(),c=c?d.isText&&d.marks.length===0:!1,l=l?d.isBlock:!1}),u===s&&l){const{parent:d}=r.doc.resolve(u);d.isTextblock&&!d.type.spec.code&&!d.childCount&&(u-=1,s+=1)}c?r.insertText(t,u,s):r.replaceWith(u,s,a),n.updateSelection&&iOe(r,r.steps.length-1,-1)}return!0},uOe=()=>({state:e,dispatch:t})=>c1e(e,t),sOe=()=>({state:e,dispatch:t})=>l1e(e,t),cOe=()=>({state:e,dispatch:t})=>i1e(e,t),lOe=()=>({state:e,dispatch:t})=>u1e(e,t);function m5(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function fOe(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,i,o,a;for(let u=0;u<t.length-1;u+=1){const s=t[u];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))r=!0;else if(/^(c|ctrl|control)$/i.test(s))i=!0;else if(/^s(hift)?$/i.test(s))o=!0;else if(/^mod$/i.test(s))LE()||m5()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${s}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const dOe=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=fOe(e).split(/-(?!$)/),a=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),u=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),s=t.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,u))});return s==null||s.steps.forEach(c=>{const l=c.map(r.mapping);l&&i&&r.maybeStep(l)}),!0};function Ph(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,a=t?nn(t,e.schema):null,u=[];e.doc.nodesBetween(r,i,(f,d)=>{if(f.isText)return;const p=Math.max(r,d),h=Math.min(i,d+f.nodeSize);u.push({node:f,from:p,to:h})});const s=i-r,c=u.filter(f=>a?a.name===f.node.type.name:!0).filter(f=>Ib(f.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((f,d)=>f+d.to-d.from,0)>=s}const pOe=(e,t={})=>({state:n,dispatch:r})=>{const i=nn(e,n.schema);return Ph(n,i,t)?f1e(n,r):!1},hOe=()=>({state:e,dispatch:t})=>m1e(e,t),mOe=e=>({state:t,dispatch:n})=>{const r=nn(e,t.schema);return T1e(r)(t,n)},vOe=()=>({state:e,dispatch:t})=>d1e(e,t);function wb(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function v5(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}const gOe=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const u=wb(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(o=nn(e,r.schema)),u==="mark"&&(a=Cu(e,r.schema)),i&&n.selection.ranges.forEach(s=>{r.doc.nodesBetween(s.$from.pos,s.$to.pos,(c,l)=>{o&&o===c.type&&n.setNodeMarkup(l,void 0,v5(c.attrs,t)),a&&c.marks.length&&c.marks.forEach(f=>{a===f.type&&n.addMark(l,l+c.nodeSize,a.create(v5(f.attrs,t)))})})}),!0):!1},yOe=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),bOe=()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),_Oe=()=>({state:e,dispatch:t})=>o1e(e,t),SOe=()=>({state:e,dispatch:t})=>s1e(e,t),$Oe=()=>({state:e,dispatch:t})=>v1e(e,t),TOe=()=>({state:e,dispatch:t})=>b1e(e,t),IOe=()=>({state:e,dispatch:t})=>y1e(e,t);function g5(e,t,n={}){return Ob(e,t,{slice:!1,parseOptions:n})}const OOe=(e,t=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,u=g5(e,i.schema,n);return o&&r.replaceWith(0,a.content.size,u).setMeta("preventUpdate",!t),!0};function wOe(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function COe(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function DE(e){return t=>COe(t.$from,e)}function EOe(e,t){const n=fo.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function ROe(e){const t=fc.resolve(e);return c5(t)}function MOe(e,t){const n={from:0,to:e.content.size};return f5(e,n,t)}function y5(e,t){const n=Cu(t,e.schema),{from:r,to:i,empty:o}=e.selection,a=[];o?(e.storedMarks&&a.push(...e.storedMarks),a.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,s=>{a.push(...s.marks)});const u=a.find(s=>s.type.name===n.name);return u?{...u.attrs}:{}}function xOe(e,t){const n=nn(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,u=>{o.push(u)});const a=o.reverse().find(u=>u.type.name===n.name);return a?{...a.attrs}:{}}function kOe(e,t){const n=wb(typeof t=="string"?t:t.name,e.schema);return n==="node"?xOe(e,t):n==="mark"?y5(e,t):{}}function b5(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e-1),a=WE(o,i.type);a&&r.push({mark:i,...a})}):n.nodesBetween(e,t,(i,o)=>{r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}function qE(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Cu(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Ib(f.attrs,n,{strict:!1}));let a=0;const u=[];if(i.forEach(({$from:f,$to:d})=>{const p=f.pos,h=d.pos;e.doc.nodesBetween(p,h,(v,m)=>{if(!v.isText&&!v.marks.length)return;const _=Math.max(p,m),g=Math.min(h,m+v.nodeSize),S=g-_;a+=S,u.push(...v.marks.map(b=>({mark:b,from:_,to:g})))})}),a===0)return!1;const s=u.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Ib(f.mark.attrs,n,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),c=u.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,d)=>f+d.to-d.from,0);return(s>0?s+c:s)>=a}function AOe(e,t,n={}){if(!t)return Ph(e,null,n)||qE(e,null,n);const r=wb(t,e.schema);return r==="node"?Ph(e,t,n):r==="mark"?qE(e,t,n):!1}function _5(e,t){const{nodeExtensions:n}=$b(t),r=n.find(a=>a.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Fe(fe(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function NOe(e){var t;const n=(t=e.type.createAndFill())===null||t===void 0?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function FOe(e){return e instanceof Se}function POe(e,t,n){const i=e.state.doc.content.size,o=Sa(t,0,i),a=Sa(n,0,i),u=e.coordsAtPos(o),s=e.coordsAtPos(a,-1),c=Math.min(u.top,s.top),l=Math.max(u.bottom,s.bottom),f=Math.min(u.left,s.left),d=Math.max(u.right,s.right),p=d-f,h=l-c,_={top:c,bottom:l,left:f,right:d,width:p,height:h,x:f,y:c};return{..._,toJSON:()=>_}}function WOe(e,t,n){var r;const{selection:i}=t;let o=null;if(jE(i)&&(o=i.$cursor),o){const u=(r=e.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(u)||!u.some(s=>s.type.excludes(n))}const{ranges:a}=i;return a.some(({$from:u,$to:s})=>{let c=u.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(u.pos,s.pos,(l,f,d)=>{if(c)return!1;if(l.isInline){const p=!d||d.type.allowsMarkType(n),h=!!n.isInSet(l.marks)||!l.marks.some(v=>v.type.excludes(n));c=p&&h}return!c}),c})}const jOe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:a,ranges:u}=o,s=Cu(e,r.schema);if(i)if(a){const c=y5(r,s);n.addStoredMark(s.create({...c,...t}))}else u.forEach(c=>{const l=c.$from.pos,f=c.$to.pos;r.doc.nodesBetween(l,f,(d,p)=>{const h=Math.max(p,l),v=Math.min(p+d.nodeSize,f);d.marks.find(_=>_.type===s)?d.marks.forEach(_=>{s===_.type&&n.addMark(h,v,s.create({..._.attrs,...t}))}):n.addMark(h,v,s.create(t))})});return WOe(r,n,s)},LOe=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),DOe=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=nn(e,n.schema);return o.isTextblock?i().command(({commands:a})=>i5(o,t)(n)?!0:a.clearNodes()).command(({state:a})=>i5(o,t)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},qOe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=Sa(e,0,r.content.size),o=Se.create(r,i);t.setSelection(o)}return!0},UOe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,a=Be.atStart(r).from,u=Be.atEnd(r).to,s=Sa(i,a,u),c=Sa(o,a,u),l=Be.create(r,s,c);t.setSelection(l)}return!0},BOe=e=>({state:t,dispatch:n})=>{const r=nn(e,t.schema);return w1e(r)(t,n)};function Cb(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=e.find(o=>o.type===t&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function S5(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(i=>t==null?void 0:t.includes(i.type.name));e.tr.ensureMarks(r)}}const zOe=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:a}=t,{$from:u,$to:s}=o,c=i.extensionManager.attributes,l=Cb(c,u.node().type.name,u.node().attrs);if(o instanceof Se&&o.node.isBlock)return!u.parentOffset||!hf(a,u.pos)?!1:(r&&(e&&S5(n,i.extensionManager.splittableMarks),t.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;if(r){const f=s.parentOffset===s.parent.content.size;o instanceof Be&&t.deleteSelection();const d=u.depth===0?void 0:wOe(u.node(-1).contentMatchAt(u.indexAfter(-1)));let p=f&&d?[{type:d,attrs:l}]:void 0,h=hf(t.doc,t.mapping.map(u.pos),1,p);if(!p&&!h&&hf(t.doc,t.mapping.map(u.pos),1,d?[{type:d}]:void 0)&&(h=!0,p=d?[{type:d,attrs:l}]:void 0),h&&(t.split(t.mapping.map(u.pos),1,p),d&&!f&&!u.parentOffset&&u.parent.type!==d)){const v=t.mapping.map(u.before()),m=t.doc.resolve(v);u.node(-1).canReplaceWith(m.index(),m.index()+1,d)&&t.setNodeMarkup(t.mapping.map(u.before()),d)}e&&S5(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0},KOe=e=>({tr:t,state:n,dispatch:r,editor:i})=>{var o;const a=nn(e,n.schema),{$from:u,$to:s}=n.selection,c=n.selection.node;if(c&&c.isBlock||u.depth<2||!u.sameParent(s))return!1;const l=u.node(-1);if(l.type!==a)return!1;const f=i.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==a||u.index(-2)!==u.node(-2).childCount-1)return!1;if(r){let m=z.empty;const _=u.index(-1)?1:u.index(-2)?2:3;for(let M=u.depth-_;M>=u.depth-3;M-=1)m=z.from(u.node(M).copy(m));const g=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,S=Cb(f,u.node().type.name,u.node().attrs),b=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(S))||void 0;m=m.append(z.from(a.createAndFill(null,b)||void 0));const $=u.before(u.depth-(_-1));t.replace($,u.after(-g),new se(m,4-_,0));let T=-1;t.doc.nodesBetween($,t.doc.content.size,(M,R)=>{if(T>-1)return!1;M.isTextblock&&M.content.size===0&&(T=R+1)}),T>-1&&t.setSelection(Be.near(t.doc.resolve(T))),t.scrollIntoView()}return!0}const d=s.pos===u.end()?l.contentMatchAt(0).defaultType:null,p=Cb(f,l.type.name,l.attrs),h=Cb(f,u.node().type.name,u.node().attrs);t.delete(u.pos,s.pos);const v=d?[{type:a,attrs:p},{type:d,attrs:h}]:[{type:a,attrs:p}];return hf(t.doc,u.pos,2)?(r&&t.split(u.pos,2,v).scrollIntoView(),!0):!1},$5=(e,t)=>{const n=DE(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&vu(e.doc,n.pos)&&e.join(n.pos),!0},T5=(e,t)=>{const n=DE(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&vu(e.doc,r)&&e.join(r),!0};var VOe=Object.freeze({__proto__:null,blur:q1e,clearContent:U1e,clearNodes:B1e,command:z1e,createParagraphNear:K1e,deleteCurrentNode:V1e,deleteNode:H1e,deleteRange:G1e,deleteSelection:Y1e,enter:J1e,exitCode:Z1e,extendMarkRange:Q1e,first:eOe,focus:tOe,forEach:nOe,insertContent:rOe,insertContentAt:aOe,joinUp:uOe,joinDown:sOe,joinBackward:cOe,joinForward:lOe,keyboardShortcut:dOe,lift:pOe,liftEmptyBlock:hOe,liftListItem:mOe,newlineInCode:vOe,resetAttributes:gOe,scrollIntoView:yOe,selectAll:bOe,selectNodeBackward:_Oe,selectNodeForward:SOe,selectParentNode:$Oe,selectTextblockEnd:TOe,selectTextblockStart:IOe,setContent:OOe,setMark:jOe,setMeta:LOe,setNode:DOe,setNodeSelection:qOe,setTextSelection:UOe,sinkListItem:BOe,splitBlock:zOe,splitListItem:KOe,toggleList:(e,t)=>({editor:n,tr:r,state:i,dispatch:o,chain:a,commands:u,can:s})=>{const{extensions:c}=n.extensionManager,l=nn(e,i.schema),f=nn(t,i.schema),{selection:d}=i,{$from:p,$to:h}=d,v=p.blockRange(h);if(!v)return!1;const m=DE(_=>_5(_.type.name,c))(d);if(v.depth>=1&&m&&v.depth-m.depth<=1){if(m.node.type===l)return u.liftListItem(f);if(_5(m.node.type.name,c)&&l.validContent(m.node.content)&&o)return a().command(()=>(r.setNodeMarkup(m.pos,l),!0)).command(()=>$5(r,l)).command(()=>T5(r,l)).run()}return a().command(()=>s().wrapInList(l)?!0:u.clearNodes()).wrapInList(l).command(()=>$5(r,l)).command(()=>T5(r,l)).run()},toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,a=Cu(e,r.schema);return qE(r,a,t)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,t)},toggleNode:(e,t,n={})=>({state:r,commands:i})=>{const o=nn(e,r.schema),a=nn(t,r.schema);return Ph(r,o,n)?i.setNode(a):i.setNode(o,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const i=nn(e,n.schema);return Ph(n,i,t)?r.lift(i):r.wrapIn(i,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const a=e.tr,u=o.transform;for(let s=u.steps.length-1;s>=0;s-=1)a.step(u.steps[s].invert(u.docs[s]));if(o.text){const s=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,e.schema.text(o.text,s))}else a.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(o=>{e.removeMark(o.$from.pos,o.$to.pos)}),!0},unsetMark:(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=t,{selection:u}=n,s=Cu(e,r.schema),{$from:c,empty:l,ranges:f}=u;if(!i)return!0;if(l&&a){let{from:d,to:p}=u;const h=(o=c.marks().find(m=>m.type===s))===null||o===void 0?void 0:o.attrs,v=WE(c,s,h);v&&(d=v.from,p=v.to),n.removeMark(d,p,s)}else f.forEach(d=>{n.removeMark(d.$from.pos,d.$to.pos,s)});return n.removeStoredMark(s),!0},updateAttributes:(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const u=wb(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(o=nn(e,r.schema)),u==="mark"&&(a=Cu(e,r.schema)),i&&n.selection.ranges.forEach(s=>{const c=s.$from.pos,l=s.$to.pos;r.doc.nodesBetween(c,l,(f,d)=>{o&&o===f.type&&n.setNodeMarkup(d,void 0,{...f.attrs,...t}),a&&f.marks.length&&f.marks.forEach(p=>{if(a===p.type){const h=Math.max(d,c),v=Math.min(d+f.nodeSize,l);n.addMark(h,v,a.create({...p.attrs,...t}))}})})}),!0):!1},wrapIn:(e,t={})=>({state:n,dispatch:r})=>{const i=nn(e,n.schema);return _1e(i,t)(n,r)},wrapInList:(e,t={})=>({state:n,dispatch:r})=>{const i=nn(e,n.schema);return S1e(i,t)(n,r)}});const HOe=Rr.create({name:"commands",addCommands(){return{...VOe}}}),GOe=Rr.create({name:"editable",addProseMirrorPlugins(){return[new Gr({key:new gu("editable"),props:{editable:()=>this.editor.options.editable}})]}}),YOe=Rr.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Gr({key:new gu("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),JOe=Rr.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:u})=>{const{selection:s,doc:c}=u,{empty:l,$anchor:f}=s,{pos:d,parent:p}=f,h=We.atStart(c).from===d;return!l||!h||!p.type.isTextblock||p.textContent.length?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return LE()||m5()?o:i},addProseMirrorPlugins(){return[new Gr({key:new gu("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some(h=>h.docChanged)&&!t.doc.eq(n.doc)))return;const{empty:i,from:o,to:a}=t.selection,u=We.atStart(t.doc).from,s=We.atEnd(t.doc).to,c=o===u&&a===s,l=n.doc.textBetween(0,n.doc.content.size," "," ").length===0;if(i||!c||!l)return;const f=n.tr,d=_b({state:n,transaction:f}),{commands:p}=new Sb({editor:this.editor,state:d});if(p.clearNodes(),!!f.steps.length)return f}})]}}),ZOe=Rr.create({name:"tabindex",addProseMirrorPlugins(){return[new Gr({key:new gu("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var XOe=Object.freeze({__proto__:null,ClipboardTextSerializer:D1e,Commands:HOe,Editable:GOe,FocusEvents:YOe,Keymap:JOe,Tabindex:ZOe});const QOe=`.ProseMirror {
|
|
41
41
|
position: relative;
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -111,38 +111,38 @@ img.ProseMirror-separator {
|
|
|
111
111
|
|
|
112
112
|
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
113
113
|
opacity: 0
|
|
114
|
-
}`;function
|
|
114
|
+
}`;function ewe(e,t){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}let twe=class extends C1e{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=ewe(QOe,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){const r=a5(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;const n=typeof t=="string"?`${t}$`:t.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){const n=[...this.options.enableCoreExtensions?Object.values(XOe):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new fc(n,this)}createCommandManager(){this.commandManager=new Sb({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const t=g5(this.options.content,this.schema,this.options.parseOptions),n=p5(t,this.options.autofocus);this.view=new zIe(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:yf.create({doc:t,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(t){if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(a=>{var u;return(u=this.capturedTransaction)===null||u===void 0?void 0:u.step(a)});return}const 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});const 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 kOe(this.state,t)}isActive(t,n){const r=typeof t=="string"?t:null,i=typeof t=="string"?n:t;return AOe(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return EOe(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:n=`
|
|
115
115
|
|
|
116
|
-
`,textSerializers:r={}}=t||{};return COe(this.state.doc,{blockSeparator:n,textSerializers:{...r,...d5(this.schema)}})}get isEmpty(){return xOe(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!(!((t=this.view)===null||t===void 0)&&t.docView)}};function Eb(e){return new AE({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Fe(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,a=r[r.length-1],u=r[0];let s=n.to;if(a){const c=u.search(/\S/),l=n.from+u.indexOf(a),f=l+a.length;if(b5(n.from,n.to,t.doc).filter(p=>p.mark.type.excluded.find(v=>v===e.type&&v!==p.mark.type)).filter(p=>p.to>l).length)return null;f<n.to&&o.delete(f,n.to),l>n.from&&o.delete(n.from+c,l),s=n.from+c+a.length,o.addMark(n.from+c,s,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function UE(e){return new AE({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=Fe(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function I5(e){return new AE({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Fe(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),u=o.doc.resolve(n.from).blockRange(),s=u&&JC(u,e.type,i);if(!s)return null;o.wrap(u,s);const c=o.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&mu(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&o.join(n.from-1)}})}let BE=class qR{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=Fe(fe(this,"addOptions",{name:this.name}))),this.storage=Fe(fe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new qR(t)}configure(t={}){const n=this.extend();return n.options=Tb(this.options,t),n.storage=Fe(fe(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new qR(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=Fe(fe(n,"addOptions",{name:n.name})),n.storage=Fe(fe(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const s=a.find(c=>(c==null?void 0:c.type.name)===n.name);return s&&r.removeStoredMark(s),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}};class Jr{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=Fe(fe(this,"addOptions",{name:this.name}))),this.storage=Fe(fe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Jr(t)}configure(t={}){const n=this.extend();return n.options=Tb(this.options,t),n.storage=Fe(fe(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Jr(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=Fe(fe(n,"addOptions",{name:n.name})),n.storage=Fe(fe(n,"addStorage",{name:n.name,options:n.options})),n}}function Rb(e){return new x1e({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Fe(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,a=r[r.length-1],u=r[0];let s=n.to;if(a){const c=u.search(/\S/),l=n.from+u.indexOf(a),f=l+a.length;if(b5(n.from,n.to,t.doc).filter(p=>p.mark.type.excluded.find(v=>v===e.type&&v!==p.mark.type)).filter(p=>p.to>l).length)return null;f<n.to&&o.delete(f,n.to),l>n.from&&o.delete(n.from+c,l),s=n.from+c+a.length,o.addMark(n.from+c,s,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function QOe(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var cr="top",Zr="bottom",Xr="right",lr="left",Mb="auto",Wh=[cr,Zr,Xr,lr],wf="start",Lh="end",ewe="clippingParents",O5="viewport",jh="popper",twe="reference",w5=Wh.reduce(function(e,t){return e.concat([t+"-"+wf,t+"-"+Lh])},[]),C5=[].concat(Wh,[Mb]).reduce(function(e,t){return e.concat([t,t+"-"+wf,t+"-"+Lh])},[]),nwe="beforeRead",rwe="read",iwe="afterRead",owe="beforeMain",awe="main",uwe="afterMain",swe="beforeWrite",cwe="write",lwe="afterWrite",zE=[nwe,rwe,iwe,owe,awe,uwe,swe,cwe,lwe];function vo(e){return e?(e.nodeName||"").toLowerCase():null}function Qr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function dc(e){var t=Qr(e).Element;return e instanceof t||e instanceof Element}function Rr(e){var t=Qr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function KE(e){if(typeof ShadowRoot>"u")return!1;var t=Qr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function fwe(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!Rr(o)||!vo(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var u=i[a];u===!1?o.removeAttribute(a):o.setAttribute(a,u===!0?"":u)}))})}function dwe(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),u=a.reduce(function(s,c){return s[c]="",s},{});!Rr(i)||!vo(i)||(Object.assign(i.style,u),Object.keys(o).forEach(function(s){i.removeAttribute(s)}))})}}const E5={name:"applyStyles",enabled:!0,phase:"write",fn:fwe,effect:dwe,requires:["computeStyles"]};function Pi(e){return e.split("-")[0]}var pc=Math.max,xb=Math.min,Cf=Math.round;function VE(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function R5(){return!/^((?!chrome|android).)*safari/i.test(VE())}function Ef(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Rr(e)&&(i=e.offsetWidth>0&&Cf(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Cf(r.height)/e.offsetHeight||1);var a=dc(e)?Qr(e):window,u=a.visualViewport,s=!R5()&&n,c=(r.left+(s&&u?u.offsetLeft:0))/i,l=(r.top+(s&&u?u.offsetTop:0))/o,f=r.width/i,d=r.height/o;return{width:f,height:d,top:l,right:c+f,bottom:l+d,left:c,x:c,y:l}}function HE(e){var t=Ef(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function M5(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&KE(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Wi(e){return Qr(e).getComputedStyle(e)}function pwe(e){return["table","td","th"].indexOf(vo(e))>=0}function Cu(e){return((dc(e)?e.ownerDocument:e.document)||window.document).documentElement}function kb(e){return vo(e)==="html"?e:e.assignedSlot||e.parentNode||(KE(e)?e.host:null)||Cu(e)}function x5(e){return!Rr(e)||Wi(e).position==="fixed"?null:e.offsetParent}function hwe(e){var t=/firefox/i.test(VE()),n=/Trident/i.test(VE());if(n&&Rr(e)){var r=Wi(e);if(r.position==="fixed")return null}var i=kb(e);for(KE(i)&&(i=i.host);Rr(i)&&["html","body"].indexOf(vo(i))<0;){var o=Wi(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Dh(e){for(var t=Qr(e),n=x5(e);n&&pwe(n)&&Wi(n).position==="static";)n=x5(n);return n&&(vo(n)==="html"||vo(n)==="body"&&Wi(n).position==="static")?t:n||hwe(e)||t}function GE(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function qh(e,t,n){return pc(e,xb(t,n))}function mwe(e,t,n){var r=qh(e,t,n);return r>n?n:r}function k5(){return{top:0,right:0,bottom:0,left:0}}function A5(e){return Object.assign({},k5(),e)}function N5(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var vwe=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,A5(typeof t!="number"?t:N5(t,Wh))};function gwe(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,u=Pi(n.placement),s=GE(u),c=[lr,Xr].indexOf(u)>=0,l=c?"height":"width";if(!(!o||!a)){var f=vwe(i.padding,n),d=HE(o),p=s==="y"?cr:lr,h=s==="y"?Zr:Xr,v=n.rects.reference[l]+n.rects.reference[s]-a[s]-n.rects.popper[l],m=a[s]-n.rects.reference[s],_=Dh(o),g=_?s==="y"?_.clientHeight||0:_.clientWidth||0:0,S=v/2-m/2,b=f[p],$=g-d[l]-f[h],T=g/2-d[l]/2+S,R=qh(b,T,$),E=s;n.modifiersData[r]=(t={},t[E]=R,t.centerOffset=R-T,t)}}function ywe(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;if(i!=null&&!(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i))){if(process.env.NODE_ENV!=="production"&&(Rr(i)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" "))),!M5(t.elements.popper,i)){process.env.NODE_ENV!=="production"&&console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" "));return}t.elements.arrow=i}}const bwe={name:"arrow",enabled:!0,phase:"main",fn:gwe,effect:ywe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Rf(e){return e.split("-")[1]}var _we={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Swe(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:Cf(t*i)/i||0,y:Cf(n*i)/i||0}}function F5(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,u=e.position,s=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,f=e.isFixed,d=a.x,p=d===void 0?0:d,h=a.y,v=h===void 0?0:h,m=typeof l=="function"?l({x:p,y:v}):{x:p,y:v};p=m.x,v=m.y;var _=a.hasOwnProperty("x"),g=a.hasOwnProperty("y"),S=lr,b=cr,$=window;if(c){var T=Dh(n),R="clientHeight",E="clientWidth";if(T===Qr(n)&&(T=Cu(n),Wi(T).position!=="static"&&u==="absolute"&&(R="scrollHeight",E="scrollWidth")),T=T,i===cr||(i===lr||i===Xr)&&o===Lh){b=Zr;var q=f&&T===$&&$.visualViewport?$.visualViewport.height:T[R];v-=q-r.height,v*=s?1:-1}if(i===lr||(i===cr||i===Zr)&&o===Lh){S=Xr;var Y=f&&T===$&&$.visualViewport?$.visualViewport.width:T[E];p-=Y-r.width,p*=s?1:-1}}var N=Object.assign({position:u},c&&_we),Z=l===!0?Swe({x:p,y:v}):{x:p,y:v};if(p=Z.x,v=Z.y,s){var ie;return Object.assign({},N,(ie={},ie[b]=g?"0":"",ie[S]=_?"0":"",ie.transform=($.devicePixelRatio||1)<=1?"translate("+p+"px, "+v+"px)":"translate3d("+p+"px, "+v+"px, 0)",ie))}return Object.assign({},N,(t={},t[b]=g?v+"px":"",t[S]=_?p+"px":"",t.transform="",t))}function $we(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,u=n.roundOffsets,s=u===void 0?!0:u;if(process.env.NODE_ENV!=="production"){var c=Wi(t.elements.popper).transitionProperty||"";a&&["transform","top","right","bottom","left"].some(function(f){return c.indexOf(f)>=0})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',`
|
|
116
|
+
`,textSerializers:r={}}=t||{};return MOe(this.state.doc,{blockSeparator:n,textSerializers:{...r,...d5(this.schema)}})}get isEmpty(){return NOe(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!(!((t=this.view)===null||t===void 0)&&t.docView)}};function Eb(e){return new AE({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Fe(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,a=r[r.length-1],u=r[0];let s=n.to;if(a){const c=u.search(/\S/),l=n.from+u.indexOf(a),f=l+a.length;if(b5(n.from,n.to,t.doc).filter(p=>p.mark.type.excluded.find(v=>v===e.type&&v!==p.mark.type)).filter(p=>p.to>l).length)return null;f<n.to&&o.delete(f,n.to),l>n.from&&o.delete(n.from+c,l),s=n.from+c+a.length,o.addMark(n.from+c,s,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function UE(e){return new AE({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=Fe(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function I5(e){return new AE({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Fe(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),u=o.doc.resolve(n.from).blockRange(),s=u&&JC(u,e.type,i);if(!s)return null;o.wrap(u,s);const c=o.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&vu(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&o.join(n.from-1)}})}let BE=class qR{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=Fe(fe(this,"addOptions",{name:this.name}))),this.storage=Fe(fe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new qR(t)}configure(t={}){const n=this.extend();return n.options=Tb(this.options,t),n.storage=Fe(fe(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new qR(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=Fe(fe(n,"addOptions",{name:n.name})),n.storage=Fe(fe(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const s=a.find(c=>(c==null?void 0:c.type.name)===n.name);return s&&r.removeStoredMark(s),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}};class Jr{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=Fe(fe(this,"addOptions",{name:this.name}))),this.storage=Fe(fe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Jr(t)}configure(t={}){const n=this.extend();return n.options=Tb(this.options,t),n.storage=Fe(fe(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Jr(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=Fe(fe(n,"addOptions",{name:n.name})),n.storage=Fe(fe(n,"addStorage",{name:n.name,options:n.options})),n}}function Rb(e){return new N1e({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Fe(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,a=r[r.length-1],u=r[0];let s=n.to;if(a){const c=u.search(/\S/),l=n.from+u.indexOf(a),f=l+a.length;if(b5(n.from,n.to,t.doc).filter(p=>p.mark.type.excluded.find(v=>v===e.type&&v!==p.mark.type)).filter(p=>p.to>l).length)return null;f<n.to&&o.delete(f,n.to),l>n.from&&o.delete(n.from+c,l),s=n.from+c+a.length,o.addMark(n.from+c,s,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function nwe(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var cr="top",Zr="bottom",Xr="right",lr="left",Mb="auto",Wh=[cr,Zr,Xr,lr],wf="start",jh="end",rwe="clippingParents",O5="viewport",Lh="popper",iwe="reference",w5=Wh.reduce(function(e,t){return e.concat([t+"-"+wf,t+"-"+jh])},[]),C5=[].concat(Wh,[Mb]).reduce(function(e,t){return e.concat([t,t+"-"+wf,t+"-"+jh])},[]),owe="beforeRead",awe="read",uwe="afterRead",swe="beforeMain",cwe="main",lwe="afterMain",fwe="beforeWrite",dwe="write",pwe="afterWrite",zE=[owe,awe,uwe,swe,cwe,lwe,fwe,dwe,pwe];function vo(e){return e?(e.nodeName||"").toLowerCase():null}function Qr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function dc(e){var t=Qr(e).Element;return e instanceof t||e instanceof Element}function Mr(e){var t=Qr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function KE(e){if(typeof ShadowRoot>"u")return!1;var t=Qr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function hwe(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!Mr(o)||!vo(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var u=i[a];u===!1?o.removeAttribute(a):o.setAttribute(a,u===!0?"":u)}))})}function mwe(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),u=a.reduce(function(s,c){return s[c]="",s},{});!Mr(i)||!vo(i)||(Object.assign(i.style,u),Object.keys(o).forEach(function(s){i.removeAttribute(s)}))})}}const E5={name:"applyStyles",enabled:!0,phase:"write",fn:hwe,effect:mwe,requires:["computeStyles"]};function Pi(e){return e.split("-")[0]}var pc=Math.max,xb=Math.min,Cf=Math.round;function VE(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function R5(){return!/^((?!chrome|android).)*safari/i.test(VE())}function Ef(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Mr(e)&&(i=e.offsetWidth>0&&Cf(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Cf(r.height)/e.offsetHeight||1);var a=dc(e)?Qr(e):window,u=a.visualViewport,s=!R5()&&n,c=(r.left+(s&&u?u.offsetLeft:0))/i,l=(r.top+(s&&u?u.offsetTop:0))/o,f=r.width/i,d=r.height/o;return{width:f,height:d,top:l,right:c+f,bottom:l+d,left:c,x:c,y:l}}function HE(e){var t=Ef(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function M5(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&KE(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Wi(e){return Qr(e).getComputedStyle(e)}function vwe(e){return["table","td","th"].indexOf(vo(e))>=0}function Eu(e){return((dc(e)?e.ownerDocument:e.document)||window.document).documentElement}function kb(e){return vo(e)==="html"?e:e.assignedSlot||e.parentNode||(KE(e)?e.host:null)||Eu(e)}function x5(e){return!Mr(e)||Wi(e).position==="fixed"?null:e.offsetParent}function gwe(e){var t=/firefox/i.test(VE()),n=/Trident/i.test(VE());if(n&&Mr(e)){var r=Wi(e);if(r.position==="fixed")return null}var i=kb(e);for(KE(i)&&(i=i.host);Mr(i)&&["html","body"].indexOf(vo(i))<0;){var o=Wi(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Dh(e){for(var t=Qr(e),n=x5(e);n&&vwe(n)&&Wi(n).position==="static";)n=x5(n);return n&&(vo(n)==="html"||vo(n)==="body"&&Wi(n).position==="static")?t:n||gwe(e)||t}function GE(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function qh(e,t,n){return pc(e,xb(t,n))}function ywe(e,t,n){var r=qh(e,t,n);return r>n?n:r}function k5(){return{top:0,right:0,bottom:0,left:0}}function A5(e){return Object.assign({},k5(),e)}function N5(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var bwe=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,A5(typeof t!="number"?t:N5(t,Wh))};function _we(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,u=Pi(n.placement),s=GE(u),c=[lr,Xr].indexOf(u)>=0,l=c?"height":"width";if(!(!o||!a)){var f=bwe(i.padding,n),d=HE(o),p=s==="y"?cr:lr,h=s==="y"?Zr:Xr,v=n.rects.reference[l]+n.rects.reference[s]-a[s]-n.rects.popper[l],m=a[s]-n.rects.reference[s],_=Dh(o),g=_?s==="y"?_.clientHeight||0:_.clientWidth||0:0,S=v/2-m/2,b=f[p],$=g-d[l]-f[h],T=g/2-d[l]/2+S,M=qh(b,T,$),R=s;n.modifiersData[r]=(t={},t[R]=M,t.centerOffset=M-T,t)}}function Swe(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;if(i!=null&&!(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i))){if(process.env.NODE_ENV!=="production"&&(Mr(i)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" "))),!M5(t.elements.popper,i)){process.env.NODE_ENV!=="production"&&console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" "));return}t.elements.arrow=i}}const $we={name:"arrow",enabled:!0,phase:"main",fn:_we,effect:Swe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Rf(e){return e.split("-")[1]}var Twe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Iwe(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:Cf(t*i)/i||0,y:Cf(n*i)/i||0}}function F5(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,u=e.position,s=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,f=e.isFixed,d=a.x,p=d===void 0?0:d,h=a.y,v=h===void 0?0:h,m=typeof l=="function"?l({x:p,y:v}):{x:p,y:v};p=m.x,v=m.y;var _=a.hasOwnProperty("x"),g=a.hasOwnProperty("y"),S=lr,b=cr,$=window;if(c){var T=Dh(n),M="clientHeight",R="clientWidth";if(T===Qr(n)&&(T=Eu(n),Wi(T).position!=="static"&&u==="absolute"&&(M="scrollHeight",R="scrollWidth")),T=T,i===cr||(i===lr||i===Xr)&&o===jh){b=Zr;var q=f&&T===$&&$.visualViewport?$.visualViewport.height:T[M];v-=q-r.height,v*=s?1:-1}if(i===lr||(i===cr||i===Zr)&&o===jh){S=Xr;var Y=f&&T===$&&$.visualViewport?$.visualViewport.width:T[R];p-=Y-r.width,p*=s?1:-1}}var N=Object.assign({position:u},c&&Twe),Z=l===!0?Iwe({x:p,y:v}):{x:p,y:v};if(p=Z.x,v=Z.y,s){var ie;return Object.assign({},N,(ie={},ie[b]=g?"0":"",ie[S]=_?"0":"",ie.transform=($.devicePixelRatio||1)<=1?"translate("+p+"px, "+v+"px)":"translate3d("+p+"px, "+v+"px, 0)",ie))}return Object.assign({},N,(t={},t[b]=g?v+"px":"",t[S]=_?p+"px":"",t.transform="",t))}function Owe(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,u=n.roundOffsets,s=u===void 0?!0:u;if(process.env.NODE_ENV!=="production"){var c=Wi(t.elements.popper).transitionProperty||"";a&&["transform","top","right","bottom","left"].some(function(f){return c.indexOf(f)>=0})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',`
|
|
117
117
|
|
|
118
118
|
`,'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.",`
|
|
119
119
|
|
|
120
|
-
`,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var l={placement:Pi(t.placement),variation:Rf(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,F5(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:s})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,F5(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Twe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:$we,data:{}};var Ab={passive:!0};function Iwe(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,u=a===void 0?!0:a,s=Qr(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(l){l.addEventListener("scroll",n.update,Ab)}),u&&s.addEventListener("resize",n.update,Ab),function(){o&&c.forEach(function(l){l.removeEventListener("scroll",n.update,Ab)}),u&&s.removeEventListener("resize",n.update,Ab)}}const Owe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Iwe,data:{}};var wwe={left:"right",right:"left",bottom:"top",top:"bottom"};function Nb(e){return e.replace(/left|right|bottom|top/g,function(t){return wwe[t]})}var Cwe={start:"end",end:"start"};function P5(e){return e.replace(/start|end/g,function(t){return Cwe[t]})}function YE(e){var t=Qr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function JE(e){return Ef(Cu(e)).left+YE(e).scrollLeft}function Ewe(e,t){var n=Qr(e),r=Cu(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,u=0,s=0;if(i){o=i.width,a=i.height;var c=R5();(c||!c&&t==="fixed")&&(u=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:u+JE(e),y:s}}function Rwe(e){var t,n=Cu(e),r=YE(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=pc(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=pc(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+JE(e),s=-r.scrollTop;return Wi(i||n).direction==="rtl"&&(u+=pc(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:u,y:s}}function ZE(e){var t=Wi(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function W5(e){return["html","body","#document"].indexOf(vo(e))>=0?e.ownerDocument.body:Rr(e)&&ZE(e)?e:W5(kb(e))}function Uh(e,t){var n;t===void 0&&(t=[]);var r=W5(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Qr(r),a=i?[o].concat(o.visualViewport||[],ZE(r)?r:[]):r,u=t.concat(a);return i?u:u.concat(Uh(kb(a)))}function XE(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Mwe(e,t){var n=Ef(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function L5(e,t,n){return t===O5?XE(Ewe(e,n)):dc(t)?Mwe(t,n):XE(Rwe(Cu(e)))}function xwe(e){var t=Uh(kb(e)),n=["absolute","fixed"].indexOf(Wi(e).position)>=0,r=n&&Rr(e)?Dh(e):e;return dc(r)?t.filter(function(i){return dc(i)&&M5(i,r)&&vo(i)!=="body"}):[]}function kwe(e,t,n,r){var i=t==="clippingParents"?xwe(e):[].concat(t),o=[].concat(i,[n]),a=o[0],u=o.reduce(function(s,c){var l=L5(e,c,r);return s.top=pc(l.top,s.top),s.right=xb(l.right,s.right),s.bottom=xb(l.bottom,s.bottom),s.left=pc(l.left,s.left),s},L5(e,a,r));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function j5(e){var t=e.reference,n=e.element,r=e.placement,i=r?Pi(r):null,o=r?Rf(r):null,a=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,s;switch(i){case cr:s={x:a,y:t.y-n.height};break;case Zr:s={x:a,y:t.y+t.height};break;case Xr:s={x:t.x+t.width,y:u};break;case lr:s={x:t.x-n.width,y:u};break;default:s={x:t.x,y:t.y}}var c=i?GE(i):null;if(c!=null){var l=c==="y"?"height":"width";switch(o){case wf:s[c]=s[c]-(t[l]/2-n[l]/2);break;case Lh:s[c]=s[c]+(t[l]/2-n[l]/2);break}}return s}function Bh(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,u=n.boundary,s=u===void 0?ewe:u,c=n.rootBoundary,l=c===void 0?O5:c,f=n.elementContext,d=f===void 0?jh:f,p=n.altBoundary,h=p===void 0?!1:p,v=n.padding,m=v===void 0?0:v,_=A5(typeof m!="number"?m:N5(m,Wh)),g=d===jh?twe:jh,S=e.rects.popper,b=e.elements[h?g:d],$=kwe(dc(b)?b:b.contextElement||Cu(e.elements.popper),s,l,a),T=Ef(e.elements.reference),R=j5({reference:T,element:S,strategy:"absolute",placement:i}),E=XE(Object.assign({},S,R)),q=d===jh?E:T,Y={top:$.top-q.top+_.top,bottom:q.bottom-$.bottom+_.bottom,left:$.left-q.left+_.left,right:q.right-$.right+_.right},N=e.modifiersData.offset;if(d===jh&&N){var Z=N[i];Object.keys(Y).forEach(function(ie){var J=[Xr,Zr].indexOf(ie)>=0?1:-1,ye=[cr,Zr].indexOf(ie)>=0?"y":"x";Y[ie]+=Z[ye]*J})}return Y}function Awe(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,u=n.flipVariations,s=n.allowedAutoPlacements,c=s===void 0?C5:s,l=Rf(r),f=l?u?w5:w5.filter(function(h){return Rf(h)===l}):Wh,d=f.filter(function(h){return c.indexOf(h)>=0});d.length===0&&(d=f,process.env.NODE_ENV!=="production"&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var p=d.reduce(function(h,v){return h[v]=Bh(e,{placement:v,boundary:i,rootBoundary:o,padding:a})[Pi(v)],h},{});return Object.keys(p).sort(function(h,v){return p[h]-p[v]})}function Nwe(e){if(Pi(e)===Mb)return[];var t=Nb(e);return[P5(e),t,P5(t)]}function Fwe(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,u=a===void 0?!0:a,s=n.fallbackPlacements,c=n.padding,l=n.boundary,f=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,h=p===void 0?!0:p,v=n.allowedAutoPlacements,m=t.options.placement,_=Pi(m),g=_===m,S=s||(g||!h?[Nb(m)]:Nwe(m)),b=[m].concat(S).reduce(function(te,xe){return te.concat(Pi(xe)===Mb?Awe(t,{placement:xe,boundary:l,rootBoundary:f,padding:c,flipVariations:h,allowedAutoPlacements:v}):xe)},[]),$=t.rects.reference,T=t.rects.popper,R=new Map,E=!0,q=b[0],Y=0;Y<b.length;Y++){var N=b[Y],Z=Pi(N),ie=Rf(N)===wf,J=[cr,Zr].indexOf(Z)>=0,ye=J?"width":"height",we=Bh(t,{placement:N,boundary:l,rootBoundary:f,altBoundary:d,padding:c}),x=J?ie?Xr:lr:ie?Zr:cr;$[ye]>T[ye]&&(x=Nb(x));var k=Nb(x),C=[];if(o&&C.push(we[Z]<=0),u&&C.push(we[x]<=0,we[k]<=0),C.every(function(te){return te})){q=N,E=!1;break}R.set(N,C)}if(E)for(var O=h?3:1,F=function(xe){var ce=b.find(function(Ne){var ze=R.get(Ne);if(ze)return ze.slice(0,xe).every(function(He){return He})});if(ce)return q=ce,"break"},L=O;L>0;L--){var X=F(L);if(X==="break")break}t.placement!==q&&(t.modifiersData[r]._skip=!0,t.placement=q,t.reset=!0)}}const Pwe={name:"flip",enabled:!0,phase:"main",fn:Fwe,requiresIfExists:["offset"],data:{_skip:!1}};function D5(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function q5(e){return[cr,Xr,Zr,lr].some(function(t){return e[t]>=0})}function Wwe(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Bh(t,{elementContext:"reference"}),u=Bh(t,{altBoundary:!0}),s=D5(a,r),c=D5(u,i,o),l=q5(s),f=q5(c);t.modifiersData[n]={referenceClippingOffsets:s,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":f})}const Lwe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Wwe};function jwe(e,t,n){var r=Pi(e),i=[lr,cr].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],u=o[1];return a=a||0,u=(u||0)*i,[lr,Xr].indexOf(r)>=0?{x:u,y:a}:{x:a,y:u}}function Dwe(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=C5.reduce(function(l,f){return l[f]=jwe(f,t.rects,o),l},{}),u=a[t.placement],s=u.x,c=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=s,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}const qwe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Dwe};function Uwe(e){var t=e.state,n=e.name;t.modifiersData[n]=j5({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Bwe={name:"popperOffsets",enabled:!0,phase:"read",fn:Uwe,data:{}};function zwe(e){return e==="x"?"y":"x"}function Kwe(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,u=a===void 0?!1:a,s=n.boundary,c=n.rootBoundary,l=n.altBoundary,f=n.padding,d=n.tether,p=d===void 0?!0:d,h=n.tetherOffset,v=h===void 0?0:h,m=Bh(t,{boundary:s,rootBoundary:c,padding:f,altBoundary:l}),_=Pi(t.placement),g=Rf(t.placement),S=!g,b=GE(_),$=zwe(b),T=t.modifiersData.popperOffsets,R=t.rects.reference,E=t.rects.popper,q=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,Y=typeof q=="number"?{mainAxis:q,altAxis:q}:Object.assign({mainAxis:0,altAxis:0},q),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,Z={x:0,y:0};if(T){if(o){var ie,J=b==="y"?cr:lr,ye=b==="y"?Zr:Xr,we=b==="y"?"height":"width",x=T[b],k=x+m[J],C=x-m[ye],O=p?-E[we]/2:0,F=g===wf?R[we]:E[we],L=g===wf?-E[we]:-R[we],X=t.elements.arrow,te=p&&X?HE(X):{width:0,height:0},xe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:k5(),ce=xe[J],Ne=xe[ye],ze=qh(0,R[we],te[we]),He=S?R[we]/2-O-ze-ce-Y.mainAxis:F-ze-ce-Y.mainAxis,it=S?-R[we]/2+O+ze+Ne+Y.mainAxis:L+ze+Ne+Y.mainAxis,Ft=t.elements.arrow&&Dh(t.elements.arrow),qt=Ft?b==="y"?Ft.clientTop||0:Ft.clientLeft||0:0,Ht=(ie=N==null?void 0:N[b])!=null?ie:0,xn=x+He-Ht-qt,Ar=x+it-Ht,fr=qh(p?xb(k,xn):k,x,p?pc(C,Ar):C);T[b]=fr,Z[b]=fr-x}if(u){var Q,re=b==="x"?cr:lr,ke=b==="x"?Zr:Xr,Ot=T[$],ei=$==="y"?"height":"width",qi=Ot+m[re],Ui=Ot-m[ke],Oa=[cr,lr].indexOf(_)!==-1,wa=(Q=N==null?void 0:N[$])!=null?Q:0,Ca=Oa?qi:Ot-R[ei]-E[ei]-wa+Y.altAxis,ti=Oa?Ot+R[ei]+E[ei]-wa-Y.altAxis:Ui,Fu=p&&Oa?mwe(Ca,Ot,ti):qh(p?Ca:qi,Ot,p?ti:Ui);T[$]=Fu,Z[$]=Fu-Ot}t.modifiersData[r]=Z}}const Vwe={name:"preventOverflow",enabled:!0,phase:"main",fn:Kwe,requiresIfExists:["offset"]};function Hwe(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Gwe(e){return e===Qr(e)||!Rr(e)?YE(e):Hwe(e)}function Ywe(e){var t=e.getBoundingClientRect(),n=Cf(t.width)/e.offsetWidth||1,r=Cf(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Jwe(e,t,n){n===void 0&&(n=!1);var r=Rr(t),i=Rr(t)&&Ywe(t),o=Cu(t),a=Ef(e,i,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(r||!r&&!n)&&((vo(t)!=="body"||ZE(o))&&(u=Gwe(t)),Rr(t)?(s=Ef(t,!0),s.x+=t.clientLeft,s.y+=t.clientTop):o&&(s.x=JE(o))),{x:a.left+u.scrollLeft-s.x,y:a.top+u.scrollTop-s.y,width:a.width,height:a.height}}function Zwe(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(u){if(!n.has(u)){var s=t.get(u);s&&i(s)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function Xwe(e){var t=Zwe(e);return zE.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function Qwe(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Eu(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return[].concat(n).reduce(function(i,o){return i.replace(/%s/,o)},e)}var hc='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',eCe='Popper: modifier "%s" requires "%s", but "%s" modifier is not available',U5=["name","enabled","phase","fn","effect","requires","options"];function tCe(e){e.forEach(function(t){[].concat(Object.keys(t),U5).filter(function(n,r,i){return i.indexOf(n)===r}).forEach(function(n){switch(n){case"name":typeof t.name!="string"&&console.error(Eu(hc,String(t.name),'"name"','"string"','"'+String(t.name)+'"'));break;case"enabled":typeof t.enabled!="boolean"&&console.error(Eu(hc,t.name,'"enabled"','"boolean"','"'+String(t.enabled)+'"'));break;case"phase":zE.indexOf(t.phase)<0&&console.error(Eu(hc,t.name,'"phase"',"either "+zE.join(", "),'"'+String(t.phase)+'"'));break;case"fn":typeof t.fn!="function"&&console.error(Eu(hc,t.name,'"fn"','"function"','"'+String(t.fn)+'"'));break;case"effect":t.effect!=null&&typeof t.effect!="function"&&console.error(Eu(hc,t.name,'"effect"','"function"','"'+String(t.fn)+'"'));break;case"requires":t.requires!=null&&!Array.isArray(t.requires)&&console.error(Eu(hc,t.name,'"requires"','"array"','"'+String(t.requires)+'"'));break;case"requiresIfExists":Array.isArray(t.requiresIfExists)||console.error(Eu(hc,t.name,'"requiresIfExists"','"array"','"'+String(t.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+t.name+'" modifier, valid properties are '+U5.map(function(r){return'"'+r+'"'}).join(", ")+'; but "'+n+'" was provided.')}t.requires&&t.requires.forEach(function(r){e.find(function(i){return i.name===r})==null&&console.error(Eu(eCe,String(t.name),r,r))})})})}function nCe(e,t){var n=new Set;return e.filter(function(r){var i=t(r);if(!n.has(i))return n.add(i),!0})}function rCe(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var B5="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",iCe="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",z5={placement:"bottom",modifiers:[],strategy:"absolute"};function K5(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function oCe(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?z5:i;return function(u,s,c){c===void 0&&(c=o);var l={placement:"bottom",orderedModifiers:[],options:Object.assign({},z5,o),modifiersData:{},elements:{reference:u,popper:s},attributes:{},styles:{}},f=[],d=!1,p={state:l,setOptions:function(_){var g=typeof _=="function"?_(l.options):_;v(),l.options=Object.assign({},o,l.options,g),l.scrollParents={reference:dc(u)?Uh(u):u.contextElement?Uh(u.contextElement):[],popper:Uh(s)};var S=Xwe(rCe([].concat(r,l.options.modifiers)));if(l.orderedModifiers=S.filter(function(N){return N.enabled}),process.env.NODE_ENV!=="production"){var b=nCe([].concat(S,l.options.modifiers),function(N){var Z=N.name;return Z});if(tCe(b),Pi(l.options.placement)===Mb){var $=l.orderedModifiers.find(function(N){var Z=N.name;return Z==="flip"});$||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" "))}var T=Wi(s),R=T.marginTop,E=T.marginRight,q=T.marginBottom,Y=T.marginLeft;[R,E,q,Y].some(function(N){return parseFloat(N)})&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" "))}return h(),p.update()},forceUpdate:function(){if(!d){var _=l.elements,g=_.reference,S=_.popper;if(!K5(g,S)){process.env.NODE_ENV!=="production"&&console.error(B5);return}l.rects={reference:Jwe(g,Dh(S),l.options.strategy==="fixed"),popper:HE(S)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach(function(N){return l.modifiersData[N.name]=Object.assign({},N.data)});for(var b=0,$=0;$<l.orderedModifiers.length;$++){if(process.env.NODE_ENV!=="production"&&(b+=1,b>100)){console.error(iCe);break}if(l.reset===!0){l.reset=!1,$=-1;continue}var T=l.orderedModifiers[$],R=T.fn,E=T.options,q=E===void 0?{}:E,Y=T.name;typeof R=="function"&&(l=R({state:l,options:q,name:Y,instance:p})||l)}}},update:Qwe(function(){return new Promise(function(m){p.forceUpdate(),m(l)})}),destroy:function(){v(),d=!0}};if(!K5(u,s))return process.env.NODE_ENV!=="production"&&console.error(B5),p;p.setOptions(c).then(function(m){!d&&c.onFirstUpdate&&c.onFirstUpdate(m)});function h(){l.orderedModifiers.forEach(function(m){var _=m.name,g=m.options,S=g===void 0?{}:g,b=m.effect;if(typeof b=="function"){var $=b({state:l,name:_,instance:p,options:S}),T=function(){};f.push($||T)}})}function v(){f.forEach(function(m){return m()}),f=[]}return p}}var aCe=[Owe,Bwe,Twe,E5,qwe,Pwe,Vwe,bwe,Lwe],uCe=oCe({defaultModifiers:aCe}),sCe="tippy-box",V5="tippy-content",cCe="tippy-backdrop",H5="tippy-arrow",G5="tippy-svg-arrow",mc={passive:!0,capture:!0},Y5=function(){return document.body};function lCe(e,t){return{}.hasOwnProperty.call(e,t)}function QE(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function eR(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function J5(e,t){return typeof e=="function"?e.apply(void 0,t):e}function Z5(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function fCe(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function dCe(e){return e.split(/\s+/).filter(Boolean)}function Mf(e){return[].concat(e)}function X5(e,t){e.indexOf(t)===-1&&e.push(t)}function pCe(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function hCe(e){return e.split("-")[0]}function Fb(e){return[].slice.call(e)}function Q5(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function zh(){return document.createElement("div")}function Kh(e){return["Element","Fragment"].some(function(t){return eR(e,t)})}function mCe(e){return eR(e,"NodeList")}function vCe(e){return eR(e,"MouseEvent")}function gCe(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function yCe(e){return Kh(e)?[e]:mCe(e)?Fb(e):Array.isArray(e)?e:Fb(document.querySelectorAll(e))}function tR(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function eH(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function bCe(e){var t,n=Mf(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function _Ce(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,u=i.props,s=u.interactiveBorder,c=hCe(a.placement),l=a.modifiersData.offset;if(!l)return!0;var f=c==="bottom"?l.top.y:0,d=c==="top"?l.bottom.y:0,p=c==="right"?l.left.x:0,h=c==="left"?l.right.x:0,v=o.top-r+f>s,m=r-o.bottom-d>s,_=o.left-n+p>s,g=n-o.right-h>s;return v||m||_||g})}function nR(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function tH(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var go={isTouch:!1},nH=0;function SCe(){go.isTouch||(go.isTouch=!0,window.performance&&document.addEventListener("mousemove",rH))}function rH(){var e=performance.now();e-nH<20&&(go.isTouch=!1,document.removeEventListener("mousemove",rH)),nH=e}function $Ce(){var e=document.activeElement;if(gCe(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function TCe(){document.addEventListener("touchstart",SCe,mc),window.addEventListener("blur",$Ce)}var ICe=typeof window<"u"&&typeof document<"u",OCe=ICe?!!window.msCrypto:!1;function xf(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function iH(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function wCe(e){return iH(`
|
|
120
|
+
`,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var l={placement:Pi(t.placement),variation:Rf(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,F5(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:s})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,F5(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const wwe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Owe,data:{}};var Ab={passive:!0};function Cwe(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,u=a===void 0?!0:a,s=Qr(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(l){l.addEventListener("scroll",n.update,Ab)}),u&&s.addEventListener("resize",n.update,Ab),function(){o&&c.forEach(function(l){l.removeEventListener("scroll",n.update,Ab)}),u&&s.removeEventListener("resize",n.update,Ab)}}const Ewe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Cwe,data:{}};var Rwe={left:"right",right:"left",bottom:"top",top:"bottom"};function Nb(e){return e.replace(/left|right|bottom|top/g,function(t){return Rwe[t]})}var Mwe={start:"end",end:"start"};function P5(e){return e.replace(/start|end/g,function(t){return Mwe[t]})}function YE(e){var t=Qr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function JE(e){return Ef(Eu(e)).left+YE(e).scrollLeft}function xwe(e,t){var n=Qr(e),r=Eu(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,u=0,s=0;if(i){o=i.width,a=i.height;var c=R5();(c||!c&&t==="fixed")&&(u=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:u+JE(e),y:s}}function kwe(e){var t,n=Eu(e),r=YE(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=pc(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=pc(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+JE(e),s=-r.scrollTop;return Wi(i||n).direction==="rtl"&&(u+=pc(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:u,y:s}}function ZE(e){var t=Wi(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function W5(e){return["html","body","#document"].indexOf(vo(e))>=0?e.ownerDocument.body:Mr(e)&&ZE(e)?e:W5(kb(e))}function Uh(e,t){var n;t===void 0&&(t=[]);var r=W5(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Qr(r),a=i?[o].concat(o.visualViewport||[],ZE(r)?r:[]):r,u=t.concat(a);return i?u:u.concat(Uh(kb(a)))}function XE(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Awe(e,t){var n=Ef(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function j5(e,t,n){return t===O5?XE(xwe(e,n)):dc(t)?Awe(t,n):XE(kwe(Eu(e)))}function Nwe(e){var t=Uh(kb(e)),n=["absolute","fixed"].indexOf(Wi(e).position)>=0,r=n&&Mr(e)?Dh(e):e;return dc(r)?t.filter(function(i){return dc(i)&&M5(i,r)&&vo(i)!=="body"}):[]}function Fwe(e,t,n,r){var i=t==="clippingParents"?Nwe(e):[].concat(t),o=[].concat(i,[n]),a=o[0],u=o.reduce(function(s,c){var l=j5(e,c,r);return s.top=pc(l.top,s.top),s.right=xb(l.right,s.right),s.bottom=xb(l.bottom,s.bottom),s.left=pc(l.left,s.left),s},j5(e,a,r));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function L5(e){var t=e.reference,n=e.element,r=e.placement,i=r?Pi(r):null,o=r?Rf(r):null,a=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,s;switch(i){case cr:s={x:a,y:t.y-n.height};break;case Zr:s={x:a,y:t.y+t.height};break;case Xr:s={x:t.x+t.width,y:u};break;case lr:s={x:t.x-n.width,y:u};break;default:s={x:t.x,y:t.y}}var c=i?GE(i):null;if(c!=null){var l=c==="y"?"height":"width";switch(o){case wf:s[c]=s[c]-(t[l]/2-n[l]/2);break;case jh:s[c]=s[c]+(t[l]/2-n[l]/2);break}}return s}function Bh(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,u=n.boundary,s=u===void 0?rwe:u,c=n.rootBoundary,l=c===void 0?O5:c,f=n.elementContext,d=f===void 0?Lh:f,p=n.altBoundary,h=p===void 0?!1:p,v=n.padding,m=v===void 0?0:v,_=A5(typeof m!="number"?m:N5(m,Wh)),g=d===Lh?iwe:Lh,S=e.rects.popper,b=e.elements[h?g:d],$=Fwe(dc(b)?b:b.contextElement||Eu(e.elements.popper),s,l,a),T=Ef(e.elements.reference),M=L5({reference:T,element:S,strategy:"absolute",placement:i}),R=XE(Object.assign({},S,M)),q=d===Lh?R:T,Y={top:$.top-q.top+_.top,bottom:q.bottom-$.bottom+_.bottom,left:$.left-q.left+_.left,right:q.right-$.right+_.right},N=e.modifiersData.offset;if(d===Lh&&N){var Z=N[i];Object.keys(Y).forEach(function(ie){var J=[Xr,Zr].indexOf(ie)>=0?1:-1,ye=[cr,Zr].indexOf(ie)>=0?"y":"x";Y[ie]+=Z[ye]*J})}return Y}function Pwe(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,u=n.flipVariations,s=n.allowedAutoPlacements,c=s===void 0?C5:s,l=Rf(r),f=l?u?w5:w5.filter(function(h){return Rf(h)===l}):Wh,d=f.filter(function(h){return c.indexOf(h)>=0});d.length===0&&(d=f,process.env.NODE_ENV!=="production"&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var p=d.reduce(function(h,v){return h[v]=Bh(e,{placement:v,boundary:i,rootBoundary:o,padding:a})[Pi(v)],h},{});return Object.keys(p).sort(function(h,v){return p[h]-p[v]})}function Wwe(e){if(Pi(e)===Mb)return[];var t=Nb(e);return[P5(e),t,P5(t)]}function jwe(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,u=a===void 0?!0:a,s=n.fallbackPlacements,c=n.padding,l=n.boundary,f=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,h=p===void 0?!0:p,v=n.allowedAutoPlacements,m=t.options.placement,_=Pi(m),g=_===m,S=s||(g||!h?[Nb(m)]:Wwe(m)),b=[m].concat(S).reduce(function(te,xe){return te.concat(Pi(xe)===Mb?Pwe(t,{placement:xe,boundary:l,rootBoundary:f,padding:c,flipVariations:h,allowedAutoPlacements:v}):xe)},[]),$=t.rects.reference,T=t.rects.popper,M=new Map,R=!0,q=b[0],Y=0;Y<b.length;Y++){var N=b[Y],Z=Pi(N),ie=Rf(N)===wf,J=[cr,Zr].indexOf(Z)>=0,ye=J?"width":"height",we=Bh(t,{placement:N,boundary:l,rootBoundary:f,altBoundary:d,padding:c}),x=J?ie?Xr:lr:ie?Zr:cr;$[ye]>T[ye]&&(x=Nb(x));var k=Nb(x),C=[];if(o&&C.push(we[Z]<=0),u&&C.push(we[x]<=0,we[k]<=0),C.every(function(te){return te})){q=N,R=!1;break}M.set(N,C)}if(R)for(var O=h?3:1,F=function(xe){var ce=b.find(function(Ne){var ze=M.get(Ne);if(ze)return ze.slice(0,xe).every(function(He){return He})});if(ce)return q=ce,"break"},j=O;j>0;j--){var X=F(j);if(X==="break")break}t.placement!==q&&(t.modifiersData[r]._skip=!0,t.placement=q,t.reset=!0)}}const Lwe={name:"flip",enabled:!0,phase:"main",fn:jwe,requiresIfExists:["offset"],data:{_skip:!1}};function D5(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function q5(e){return[cr,Xr,Zr,lr].some(function(t){return e[t]>=0})}function Dwe(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Bh(t,{elementContext:"reference"}),u=Bh(t,{altBoundary:!0}),s=D5(a,r),c=D5(u,i,o),l=q5(s),f=q5(c);t.modifiersData[n]={referenceClippingOffsets:s,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":f})}const qwe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Dwe};function Uwe(e,t,n){var r=Pi(e),i=[lr,cr].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],u=o[1];return a=a||0,u=(u||0)*i,[lr,Xr].indexOf(r)>=0?{x:u,y:a}:{x:a,y:u}}function Bwe(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=C5.reduce(function(l,f){return l[f]=Uwe(f,t.rects,o),l},{}),u=a[t.placement],s=u.x,c=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=s,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}const zwe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Bwe};function Kwe(e){var t=e.state,n=e.name;t.modifiersData[n]=L5({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Vwe={name:"popperOffsets",enabled:!0,phase:"read",fn:Kwe,data:{}};function Hwe(e){return e==="x"?"y":"x"}function Gwe(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,u=a===void 0?!1:a,s=n.boundary,c=n.rootBoundary,l=n.altBoundary,f=n.padding,d=n.tether,p=d===void 0?!0:d,h=n.tetherOffset,v=h===void 0?0:h,m=Bh(t,{boundary:s,rootBoundary:c,padding:f,altBoundary:l}),_=Pi(t.placement),g=Rf(t.placement),S=!g,b=GE(_),$=Hwe(b),T=t.modifiersData.popperOffsets,M=t.rects.reference,R=t.rects.popper,q=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,Y=typeof q=="number"?{mainAxis:q,altAxis:q}:Object.assign({mainAxis:0,altAxis:0},q),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,Z={x:0,y:0};if(T){if(o){var ie,J=b==="y"?cr:lr,ye=b==="y"?Zr:Xr,we=b==="y"?"height":"width",x=T[b],k=x+m[J],C=x-m[ye],O=p?-R[we]/2:0,F=g===wf?M[we]:R[we],j=g===wf?-R[we]:-M[we],X=t.elements.arrow,te=p&&X?HE(X):{width:0,height:0},xe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:k5(),ce=xe[J],Ne=xe[ye],ze=qh(0,M[we],te[we]),He=S?M[we]/2-O-ze-ce-Y.mainAxis:F-ze-ce-Y.mainAxis,it=S?-M[we]/2+O+ze+Ne+Y.mainAxis:j+ze+Ne+Y.mainAxis,Ft=t.elements.arrow&&Dh(t.elements.arrow),qt=Ft?b==="y"?Ft.clientTop||0:Ft.clientLeft||0:0,Ht=(ie=N==null?void 0:N[b])!=null?ie:0,xn=x+He-Ht-qt,Nr=x+it-Ht,fr=qh(p?xb(k,xn):k,x,p?pc(C,Nr):C);T[b]=fr,Z[b]=fr-x}if(u){var Q,re=b==="x"?cr:lr,ke=b==="x"?Zr:Xr,Ot=T[$],ei=$==="y"?"height":"width",qi=Ot+m[re],Ui=Ot-m[ke],Oa=[cr,lr].indexOf(_)!==-1,wa=(Q=N==null?void 0:N[$])!=null?Q:0,Ca=Oa?qi:Ot-M[ei]-R[ei]-wa+Y.altAxis,ti=Oa?Ot+M[ei]+R[ei]-wa-Y.altAxis:Ui,Pu=p&&Oa?ywe(Ca,Ot,ti):qh(p?Ca:qi,Ot,p?ti:Ui);T[$]=Pu,Z[$]=Pu-Ot}t.modifiersData[r]=Z}}const Ywe={name:"preventOverflow",enabled:!0,phase:"main",fn:Gwe,requiresIfExists:["offset"]};function Jwe(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Zwe(e){return e===Qr(e)||!Mr(e)?YE(e):Jwe(e)}function Xwe(e){var t=e.getBoundingClientRect(),n=Cf(t.width)/e.offsetWidth||1,r=Cf(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Qwe(e,t,n){n===void 0&&(n=!1);var r=Mr(t),i=Mr(t)&&Xwe(t),o=Eu(t),a=Ef(e,i,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(r||!r&&!n)&&((vo(t)!=="body"||ZE(o))&&(u=Zwe(t)),Mr(t)?(s=Ef(t,!0),s.x+=t.clientLeft,s.y+=t.clientTop):o&&(s.x=JE(o))),{x:a.left+u.scrollLeft-s.x,y:a.top+u.scrollTop-s.y,width:a.width,height:a.height}}function eCe(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(u){if(!n.has(u)){var s=t.get(u);s&&i(s)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function tCe(e){var t=eCe(e);return zE.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function nCe(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Ru(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return[].concat(n).reduce(function(i,o){return i.replace(/%s/,o)},e)}var hc='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',rCe='Popper: modifier "%s" requires "%s", but "%s" modifier is not available',U5=["name","enabled","phase","fn","effect","requires","options"];function iCe(e){e.forEach(function(t){[].concat(Object.keys(t),U5).filter(function(n,r,i){return i.indexOf(n)===r}).forEach(function(n){switch(n){case"name":typeof t.name!="string"&&console.error(Ru(hc,String(t.name),'"name"','"string"','"'+String(t.name)+'"'));break;case"enabled":typeof t.enabled!="boolean"&&console.error(Ru(hc,t.name,'"enabled"','"boolean"','"'+String(t.enabled)+'"'));break;case"phase":zE.indexOf(t.phase)<0&&console.error(Ru(hc,t.name,'"phase"',"either "+zE.join(", "),'"'+String(t.phase)+'"'));break;case"fn":typeof t.fn!="function"&&console.error(Ru(hc,t.name,'"fn"','"function"','"'+String(t.fn)+'"'));break;case"effect":t.effect!=null&&typeof t.effect!="function"&&console.error(Ru(hc,t.name,'"effect"','"function"','"'+String(t.fn)+'"'));break;case"requires":t.requires!=null&&!Array.isArray(t.requires)&&console.error(Ru(hc,t.name,'"requires"','"array"','"'+String(t.requires)+'"'));break;case"requiresIfExists":Array.isArray(t.requiresIfExists)||console.error(Ru(hc,t.name,'"requiresIfExists"','"array"','"'+String(t.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+t.name+'" modifier, valid properties are '+U5.map(function(r){return'"'+r+'"'}).join(", ")+'; but "'+n+'" was provided.')}t.requires&&t.requires.forEach(function(r){e.find(function(i){return i.name===r})==null&&console.error(Ru(rCe,String(t.name),r,r))})})})}function oCe(e,t){var n=new Set;return e.filter(function(r){var i=t(r);if(!n.has(i))return n.add(i),!0})}function aCe(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var B5="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",uCe="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",z5={placement:"bottom",modifiers:[],strategy:"absolute"};function K5(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function sCe(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?z5:i;return function(u,s,c){c===void 0&&(c=o);var l={placement:"bottom",orderedModifiers:[],options:Object.assign({},z5,o),modifiersData:{},elements:{reference:u,popper:s},attributes:{},styles:{}},f=[],d=!1,p={state:l,setOptions:function(_){var g=typeof _=="function"?_(l.options):_;v(),l.options=Object.assign({},o,l.options,g),l.scrollParents={reference:dc(u)?Uh(u):u.contextElement?Uh(u.contextElement):[],popper:Uh(s)};var S=tCe(aCe([].concat(r,l.options.modifiers)));if(l.orderedModifiers=S.filter(function(N){return N.enabled}),process.env.NODE_ENV!=="production"){var b=oCe([].concat(S,l.options.modifiers),function(N){var Z=N.name;return Z});if(iCe(b),Pi(l.options.placement)===Mb){var $=l.orderedModifiers.find(function(N){var Z=N.name;return Z==="flip"});$||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" "))}var T=Wi(s),M=T.marginTop,R=T.marginRight,q=T.marginBottom,Y=T.marginLeft;[M,R,q,Y].some(function(N){return parseFloat(N)})&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" "))}return h(),p.update()},forceUpdate:function(){if(!d){var _=l.elements,g=_.reference,S=_.popper;if(!K5(g,S)){process.env.NODE_ENV!=="production"&&console.error(B5);return}l.rects={reference:Qwe(g,Dh(S),l.options.strategy==="fixed"),popper:HE(S)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach(function(N){return l.modifiersData[N.name]=Object.assign({},N.data)});for(var b=0,$=0;$<l.orderedModifiers.length;$++){if(process.env.NODE_ENV!=="production"&&(b+=1,b>100)){console.error(uCe);break}if(l.reset===!0){l.reset=!1,$=-1;continue}var T=l.orderedModifiers[$],M=T.fn,R=T.options,q=R===void 0?{}:R,Y=T.name;typeof M=="function"&&(l=M({state:l,options:q,name:Y,instance:p})||l)}}},update:nCe(function(){return new Promise(function(m){p.forceUpdate(),m(l)})}),destroy:function(){v(),d=!0}};if(!K5(u,s))return process.env.NODE_ENV!=="production"&&console.error(B5),p;p.setOptions(c).then(function(m){!d&&c.onFirstUpdate&&c.onFirstUpdate(m)});function h(){l.orderedModifiers.forEach(function(m){var _=m.name,g=m.options,S=g===void 0?{}:g,b=m.effect;if(typeof b=="function"){var $=b({state:l,name:_,instance:p,options:S}),T=function(){};f.push($||T)}})}function v(){f.forEach(function(m){return m()}),f=[]}return p}}var cCe=[Ewe,Vwe,wwe,E5,zwe,Lwe,Ywe,$we,qwe],lCe=sCe({defaultModifiers:cCe}),fCe="tippy-box",V5="tippy-content",dCe="tippy-backdrop",H5="tippy-arrow",G5="tippy-svg-arrow",mc={passive:!0,capture:!0},Y5=function(){return document.body};function pCe(e,t){return{}.hasOwnProperty.call(e,t)}function QE(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function eR(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function J5(e,t){return typeof e=="function"?e.apply(void 0,t):e}function Z5(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function hCe(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function mCe(e){return e.split(/\s+/).filter(Boolean)}function Mf(e){return[].concat(e)}function X5(e,t){e.indexOf(t)===-1&&e.push(t)}function vCe(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function gCe(e){return e.split("-")[0]}function Fb(e){return[].slice.call(e)}function Q5(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function zh(){return document.createElement("div")}function Kh(e){return["Element","Fragment"].some(function(t){return eR(e,t)})}function yCe(e){return eR(e,"NodeList")}function bCe(e){return eR(e,"MouseEvent")}function _Ce(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function SCe(e){return Kh(e)?[e]:yCe(e)?Fb(e):Array.isArray(e)?e:Fb(document.querySelectorAll(e))}function tR(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function eH(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function $Ce(e){var t,n=Mf(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function TCe(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,u=i.props,s=u.interactiveBorder,c=gCe(a.placement),l=a.modifiersData.offset;if(!l)return!0;var f=c==="bottom"?l.top.y:0,d=c==="top"?l.bottom.y:0,p=c==="right"?l.left.x:0,h=c==="left"?l.right.x:0,v=o.top-r+f>s,m=r-o.bottom-d>s,_=o.left-n+p>s,g=n-o.right-h>s;return v||m||_||g})}function nR(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function tH(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var go={isTouch:!1},nH=0;function ICe(){go.isTouch||(go.isTouch=!0,window.performance&&document.addEventListener("mousemove",rH))}function rH(){var e=performance.now();e-nH<20&&(go.isTouch=!1,document.removeEventListener("mousemove",rH)),nH=e}function OCe(){var e=document.activeElement;if(_Ce(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function wCe(){document.addEventListener("touchstart",ICe,mc),window.addEventListener("blur",OCe)}var CCe=typeof window<"u"&&typeof document<"u",ECe=CCe?!!window.msCrypto:!1;function xf(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function iH(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function RCe(e){return iH(`
|
|
121
121
|
%ctippy.js
|
|
122
122
|
|
|
123
123
|
%c`+iH(e)+`
|
|
124
124
|
|
|
125
125
|
%c👷 This is a development-only message. It will be removed in production.
|
|
126
|
-
`)}function oH(e){return[
|
|
126
|
+
`)}function oH(e){return[RCe(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var Vh;process.env.NODE_ENV!=="production"&&MCe();function MCe(){Vh=new Set}function $a(e,t){if(e&&!Vh.has(t)){var n;Vh.add(t),(n=console).warn.apply(n,oH(t))}}function rR(e,t){if(e&&!Vh.has(t)){var n;Vh.add(t),(n=console).error.apply(n,oH(t))}}function xCe(e){var t=!e,n=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;rR(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),rR(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var aH={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},kCe={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},xr=Object.assign({appendTo:Y5,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},aH,kCe),ACe=Object.keys(xr),NCe=function(t){process.env.NODE_ENV!=="production"&&cH(t,[]);var n=Object.keys(t);n.forEach(function(r){xr[r]=t[r]})};function uH(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,a=i.defaultValue;if(o){var u;r[o]=e[o]!==void 0?e[o]:(u=xr[o])!=null?u:a}return r},{});return Object.assign({},e,n)}function FCe(e,t){var n=t?Object.keys(uH(Object.assign({},xr,{plugins:t}))):ACe,r=n.reduce(function(i,o){var a=(e.getAttribute("data-tippy-"+o)||"").trim();if(!a)return i;if(o==="content")i[o]=a;else try{i[o]=JSON.parse(a)}catch{i[o]=a}return i},{});return r}function sH(e,t){var n=Object.assign({},t,{content:J5(t.content,[e])},t.ignoreAttributes?{}:FCe(e,t.plugins));return n.aria=Object.assign({},xr.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}function cH(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=Object.keys(e);n.forEach(function(r){var i=hCe(xr,Object.keys(aH)),o=!pCe(i,r);o&&(o=t.filter(function(a){return a.name===r}).length===0),$a(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
|
|
127
127
|
|
|
128
128
|
`,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
|
|
129
|
-
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var
|
|
129
|
+
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var PCe=function(){return"innerHTML"};function iR(e,t){e[PCe()]=t}function lH(e){var t=zh();return e===!0?t.className=H5:(t.className=G5,Kh(e)?t.appendChild(e):iR(t,e)),t}function fH(e,t){Kh(t.content)?(iR(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?iR(e,t.content):e.textContent=t.content)}function oR(e){var t=e.firstElementChild,n=Fb(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(V5)}),arrow:n.find(function(r){return r.classList.contains(H5)||r.classList.contains(G5)}),backdrop:n.find(function(r){return r.classList.contains(dCe)})}}function dH(e){var t=zh(),n=zh();n.className=fCe,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=zh();r.className=V5,r.setAttribute("data-state","hidden"),fH(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,a){var u=oR(t),s=u.box,c=u.content,l=u.arrow;a.theme?s.setAttribute("data-theme",a.theme):s.removeAttribute("data-theme"),typeof a.animation=="string"?s.setAttribute("data-animation",a.animation):s.removeAttribute("data-animation"),a.inertia?s.setAttribute("data-inertia",""):s.removeAttribute("data-inertia"),s.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?s.setAttribute("role",a.role):s.removeAttribute("role"),(o.content!==a.content||o.allowHTML!==a.allowHTML)&&fH(c,e.props),a.arrow?l?o.arrow!==a.arrow&&(s.removeChild(l),s.appendChild(lH(a.arrow))):s.appendChild(lH(a.arrow)):l&&s.removeChild(l)}return{popper:t,onUpdate:i}}dH.$$tippy=!0;var WCe=1,Pb=[],aR=[];function jCe(e,t){var n=sH(e,Object.assign({},xr,uH(Q5(t)))),r,i,o,a=!1,u=!1,s=!1,c=!1,l,f,d,p=[],h=Z5(xn,n.interactiveDebounce),v,m=WCe++,_=null,g=vCe(n.plugins),S={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:m,reference:e,popper:zh(),popperInstance:_,props:n,state:S,plugins:g,clearDelayTimeouts:Ca,setProps:ti,setContent:Pu,show:Wf,hide:P,hideWithInteractivity:A,enable:Oa,disable:wa,unmount:L,destroy:Pe};if(!n.render)return process.env.NODE_ENV!=="production"&&rR(!0,"render() function has not been supplied."),b;var $=n.render(b),T=$.popper,M=$.onUpdate;T.setAttribute("data-tippy-root",""),T.id="tippy-"+b.id,b.popper=T,e._tippy=b,T._tippy=b;var R=g.map(function(W){return W.fn(b)}),q=e.hasAttribute("aria-expanded");return Ft(),O(),x(),k("onCreate",[b]),n.showOnCreate&&qi(),T.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),T.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&J().addEventListener("mousemove",h)}),b;function Y(){var W=b.props.touch;return Array.isArray(W)?W:[W,0]}function N(){return Y()[0]==="hold"}function Z(){var W;return!!((W=b.props.render)!=null&&W.$$tippy)}function ie(){return v||e}function J(){var W=ie().parentNode;return W?$Ce(W):document}function ye(){return oR(T)}function we(W){return b.state.isMounted&&!b.state.isVisible||go.isTouch||l&&l.type==="focus"?0:QE(b.props.delay,W?0:1,xr.delay)}function x(W){W===void 0&&(W=!1),T.style.pointerEvents=b.props.interactive&&!W?"":"none",T.style.zIndex=""+b.props.zIndex}function k(W,ae,ge){if(ge===void 0&&(ge=!0),R.forEach(function(Ce){Ce[W]&&Ce[W].apply(Ce,ae)}),ge){var ve;(ve=b.props)[W].apply(ve,ae)}}function C(){var W=b.props.aria;if(W.content){var ae="aria-"+W.content,ge=T.id,ve=Mf(b.props.triggerTarget||e);ve.forEach(function(Ce){var ct=Ce.getAttribute(ae);if(b.state.isVisible)Ce.setAttribute(ae,ct?ct+" "+ge:ge);else{var Hn=ct&&ct.replace(ge,"").trim();Hn?Ce.setAttribute(ae,Hn):Ce.removeAttribute(ae)}})}}function O(){if(!(q||!b.props.aria.expanded)){var W=Mf(b.props.triggerTarget||e);W.forEach(function(ae){b.props.interactive?ae.setAttribute("aria-expanded",b.state.isVisible&&ae===ie()?"true":"false"):ae.removeAttribute("aria-expanded")})}}function F(){J().removeEventListener("mousemove",h),Pb=Pb.filter(function(W){return W!==h})}function j(W){if(!(go.isTouch&&(s||W.type==="mousedown"))){var ae=W.composedPath&&W.composedPath()[0]||W.target;if(!(b.props.interactive&&tH(T,ae))){if(Mf(b.props.triggerTarget||e).some(function(ge){return tH(ge,ae)})){if(go.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else k("onClickOutside",[b,W]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),u=!0,setTimeout(function(){u=!1}),b.state.isMounted||ce())}}}function X(){s=!0}function te(){s=!1}function xe(){var W=J();W.addEventListener("mousedown",j,!0),W.addEventListener("touchend",j,mc),W.addEventListener("touchstart",te,mc),W.addEventListener("touchmove",X,mc)}function ce(){var W=J();W.removeEventListener("mousedown",j,!0),W.removeEventListener("touchend",j,mc),W.removeEventListener("touchstart",te,mc),W.removeEventListener("touchmove",X,mc)}function Ne(W,ae){He(W,function(){!b.state.isVisible&&T.parentNode&&T.parentNode.contains(T)&&ae()})}function ze(W,ae){He(W,ae)}function He(W,ae){var ge=ye().box;function ve(Ce){Ce.target===ge&&(nR(ge,"remove",ve),ae())}if(W===0)return ae();nR(ge,"remove",f),nR(ge,"add",ve),f=ve}function it(W,ae,ge){ge===void 0&&(ge=!1);var ve=Mf(b.props.triggerTarget||e);ve.forEach(function(Ce){Ce.addEventListener(W,ae,ge),p.push({node:Ce,eventType:W,handler:ae,options:ge})})}function Ft(){N()&&(it("touchstart",Ht,{passive:!0}),it("touchend",Nr,{passive:!0})),mCe(b.props.trigger).forEach(function(W){if(W!=="manual")switch(it(W,Ht),W){case"mouseenter":it("mouseleave",Nr);break;case"focus":it(ECe?"focusout":"blur",fr);break;case"focusin":it("focusout",fr);break}})}function qt(){p.forEach(function(W){var ae=W.node,ge=W.eventType,ve=W.handler,Ce=W.options;ae.removeEventListener(ge,ve,Ce)}),p=[]}function Ht(W){var ae,ge=!1;if(!(!b.state.isEnabled||Q(W)||u)){var ve=((ae=l)==null?void 0:ae.type)==="focus";l=W,v=W.currentTarget,O(),!b.state.isVisible&&bCe(W)&&Pb.forEach(function(Ce){return Ce(W)}),W.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||a)&&b.props.hideOnClick!==!1&&b.state.isVisible?ge=!0:qi(W),W.type==="click"&&(a=!ge),ge&&!ve&&Ui(W)}}function xn(W){var ae=W.target,ge=ie().contains(ae)||T.contains(ae);if(!(W.type==="mousemove"&&ge)){var ve=ei().concat(T).map(function(Ce){var ct,Hn=Ce._tippy,Fr=(ct=Hn.popperInstance)==null?void 0:ct.state;return Fr?{popperRect:Ce.getBoundingClientRect(),popperState:Fr,props:n}:null}).filter(Boolean);TCe(ve,W)&&(F(),Ui(W))}}function Nr(W){var ae=Q(W)||b.props.trigger.indexOf("click")>=0&&a;if(!ae){if(b.props.interactive){b.hideWithInteractivity(W);return}Ui(W)}}function fr(W){b.props.trigger.indexOf("focusin")<0&&W.target!==ie()||b.props.interactive&&W.relatedTarget&&T.contains(W.relatedTarget)||Ui(W)}function Q(W){return go.isTouch?N()!==W.type.indexOf("touch")>=0:!1}function re(){ke();var W=b.props,ae=W.popperOptions,ge=W.placement,ve=W.offset,Ce=W.getReferenceClientRect,ct=W.moveTransition,Hn=Z()?oR(T).arrow:null,Fr=Ce?{getBoundingClientRect:Ce,contextElement:Ce.contextElement||ie()}:e,jf={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Df){var Ea=Df.state;if(Z()){var jR=ye(),qf=jR.box;["placement","reference-hidden","escaped"].forEach(function(Tc){Tc==="placement"?qf.setAttribute("data-placement",Ea.placement):Ea.attributes.popper["data-popper-"+Tc]?qf.setAttribute("data-"+Tc,""):qf.removeAttribute("data-"+Tc)}),Ea.attributes.popper={}}}},Bi=[{name:"offset",options:{offset:ve}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ct}},jf];Z()&&Hn&&Bi.push({name:"arrow",options:{element:Hn,padding:3}}),Bi.push.apply(Bi,(ae==null?void 0:ae.modifiers)||[]),b.popperInstance=lCe(Fr,T,Object.assign({},ae,{placement:ge,onFirstUpdate:d,modifiers:Bi}))}function ke(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Ot(){var W=b.props.appendTo,ae,ge=ie();b.props.interactive&&W===Y5||W==="parent"?ae=ge.parentNode:ae=J5(W,[ge]),ae.contains(T)||ae.appendChild(T),b.state.isMounted=!0,re(),process.env.NODE_ENV!=="production"&&$a(b.props.interactive&&W===xr.appendTo&&ge.nextElementSibling!==T,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
|
|
130
130
|
|
|
131
131
|
`,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
|
|
132
132
|
|
|
133
133
|
`,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
|
|
134
134
|
|
|
135
|
-
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function ei(){return Fb(T.querySelectorAll("[data-tippy-root]"))}function qi(W){b.clearDelayTimeouts(),W&&k("onTrigger",[b,W]),xe();var ae=we(!0),ge=Y(),ve=ge[0],Ce=ge[1];go.isTouch&&ve==="hold"&&Ce&&(ae=Ce),ae?r=setTimeout(function(){b.show()},ae):b.show()}function Ui(W){if(b.clearDelayTimeouts(),k("onUntrigger",[b,W]),!b.state.isVisible){ce();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(W.type)>=0&&a)){var ae=we(!1);ae?i=setTimeout(function(){b.state.isVisible&&b.hide()},ae):o=requestAnimationFrame(function(){b.hide()})}}function Oa(){b.state.isEnabled=!0}function wa(){b.hide(),b.state.isEnabled=!1}function Ca(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function ti(W){if(process.env.NODE_ENV!=="production"&&$a(b.state.isDestroyed,xf("setProps")),!b.state.isDestroyed){k("onBeforeUpdate",[b,W]),qt();var ae=b.props,ge=sH(e,Object.assign({},ae,Q5(W),{ignoreAttributes:!0}));b.props=ge,Ft(),ae.interactiveDebounce!==ge.interactiveDebounce&&(F(),h=Z5(xn,ge.interactiveDebounce)),ae.triggerTarget&&!ge.triggerTarget?Mf(ae.triggerTarget).forEach(function(ve){ve.removeAttribute("aria-expanded")}):ge.triggerTarget&&e.removeAttribute("aria-expanded"),O(),x(),
|
|
135
|
+
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function ei(){return Fb(T.querySelectorAll("[data-tippy-root]"))}function qi(W){b.clearDelayTimeouts(),W&&k("onTrigger",[b,W]),xe();var ae=we(!0),ge=Y(),ve=ge[0],Ce=ge[1];go.isTouch&&ve==="hold"&&Ce&&(ae=Ce),ae?r=setTimeout(function(){b.show()},ae):b.show()}function Ui(W){if(b.clearDelayTimeouts(),k("onUntrigger",[b,W]),!b.state.isVisible){ce();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(W.type)>=0&&a)){var ae=we(!1);ae?i=setTimeout(function(){b.state.isVisible&&b.hide()},ae):o=requestAnimationFrame(function(){b.hide()})}}function Oa(){b.state.isEnabled=!0}function wa(){b.hide(),b.state.isEnabled=!1}function Ca(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function ti(W){if(process.env.NODE_ENV!=="production"&&$a(b.state.isDestroyed,xf("setProps")),!b.state.isDestroyed){k("onBeforeUpdate",[b,W]),qt();var ae=b.props,ge=sH(e,Object.assign({},ae,Q5(W),{ignoreAttributes:!0}));b.props=ge,Ft(),ae.interactiveDebounce!==ge.interactiveDebounce&&(F(),h=Z5(xn,ge.interactiveDebounce)),ae.triggerTarget&&!ge.triggerTarget?Mf(ae.triggerTarget).forEach(function(ve){ve.removeAttribute("aria-expanded")}):ge.triggerTarget&&e.removeAttribute("aria-expanded"),O(),x(),M&&M(ae,ge),b.popperInstance&&(re(),ei().forEach(function(ve){requestAnimationFrame(ve._tippy.popperInstance.forceUpdate)})),k("onAfterUpdate",[b,W])}}function Pu(W){b.setProps({content:W})}function Wf(){process.env.NODE_ENV!=="production"&&$a(b.state.isDestroyed,xf("show"));var W=b.state.isVisible,ae=b.state.isDestroyed,ge=!b.state.isEnabled,ve=go.isTouch&&!b.props.touch,Ce=QE(b.props.duration,0,xr.duration);if(!(W||ae||ge||ve)&&!ie().hasAttribute("disabled")&&(k("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,Z()&&(T.style.visibility="visible"),x(),xe(),b.state.isMounted||(T.style.transition="none"),Z()){var ct=ye(),Hn=ct.box,Fr=ct.content;tR([Hn,Fr],0)}d=function(){var Bi;if(!(!b.state.isVisible||c)){if(c=!0,T.offsetHeight,T.style.transition=b.props.moveTransition,Z()&&b.props.animation){var Lf=ye(),Df=Lf.box,Ea=Lf.content;tR([Df,Ea],Ce),eH([Df,Ea],"visible")}C(),O(),X5(aR,b),(Bi=b.popperInstance)==null||Bi.forceUpdate(),k("onMount",[b]),b.props.animation&&Z()&&ze(Ce,function(){b.state.isShown=!0,k("onShown",[b])})}},Ot()}}function P(){process.env.NODE_ENV!=="production"&&$a(b.state.isDestroyed,xf("hide"));var W=!b.state.isVisible,ae=b.state.isDestroyed,ge=!b.state.isEnabled,ve=QE(b.props.duration,1,xr.duration);if(!(W||ae||ge)&&(k("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,c=!1,a=!1,Z()&&(T.style.visibility="hidden"),F(),ce(),x(!0),Z()){var Ce=ye(),ct=Ce.box,Hn=Ce.content;b.props.animation&&(tR([ct,Hn],ve),eH([ct,Hn],"hidden"))}C(),O(),b.props.animation?Z()&&Ne(ve,b.unmount):b.unmount()}}function A(W){process.env.NODE_ENV!=="production"&&$a(b.state.isDestroyed,xf("hideWithInteractivity")),J().addEventListener("mousemove",h),X5(Pb,h),h(W)}function L(){process.env.NODE_ENV!=="production"&&$a(b.state.isDestroyed,xf("unmount")),b.state.isVisible&&b.hide(),b.state.isMounted&&(ke(),ei().forEach(function(W){W._tippy.unmount()}),T.parentNode&&T.parentNode.removeChild(T),aR=aR.filter(function(W){return W!==b}),b.state.isMounted=!1,k("onHidden",[b]))}function Pe(){process.env.NODE_ENV!=="production"&&$a(b.state.isDestroyed,xf("destroy")),!b.state.isDestroyed&&(b.clearDelayTimeouts(),b.unmount(),qt(),delete e._tippy,b.state.isDestroyed=!0,k("onDestroy",[b]))}}function Hh(e,t){t===void 0&&(t={});var n=xr.plugins.concat(t.plugins||[]);process.env.NODE_ENV!=="production"&&(xCe(e),cH(t,n)),wCe();var r=Object.assign({},t,{plugins:n}),i=SCe(e);if(process.env.NODE_ENV!=="production"){var o=Kh(r.content),a=i.length>1;$a(o&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
|
|
136
136
|
|
|
137
137
|
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
|
138
138
|
|
|
139
139
|
`,`1) content: element.innerHTML
|
|
140
|
-
`,"2) content: () => element.cloneNode(true)"].join(" "))}var u=i.reduce(function(s,c){var l=c&&FCe(c,r);return l&&s.push(l),s},[]);return Kh(e)?u[0]:u}Hh.defaultProps=Mr,Hh.setDefaultProps=xCe,Hh.currentInput=go,Object.assign({},E5,{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)}}),Hh.setDefaultProps({render:dH});var Wb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function PCe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var pH=PCe,WCe=typeof Wb=="object"&&Wb&&Wb.Object===Object&&Wb,LCe=WCe,jCe=LCe,DCe=typeof self=="object"&&self&&self.Object===Object&&self,qCe=jCe||DCe||Function("return this")(),hH=qCe,UCe=hH,BCe=function(){return UCe.Date.now()},zCe=BCe,KCe=/\s/;function VCe(e){for(var t=e.length;t--&&KCe.test(e.charAt(t)););return t}var HCe=VCe,GCe=HCe,YCe=/^\s+/;function JCe(e){return e&&e.slice(0,GCe(e)+1).replace(YCe,"")}var ZCe=JCe,XCe=hH,QCe=XCe.Symbol,mH=QCe,vH=mH,gH=Object.prototype,eEe=gH.hasOwnProperty,tEe=gH.toString,Gh=vH?vH.toStringTag:void 0;function nEe(e){var t=eEe.call(e,Gh),n=e[Gh];try{e[Gh]=void 0;var r=!0}catch{}var i=tEe.call(e);return r&&(t?e[Gh]=n:delete e[Gh]),i}var rEe=nEe,iEe=Object.prototype,oEe=iEe.toString;function aEe(e){return oEe.call(e)}var uEe=aEe,yH=mH,sEe=rEe,cEe=uEe,lEe="[object Null]",fEe="[object Undefined]",bH=yH?yH.toStringTag:void 0;function dEe(e){return e==null?e===void 0?fEe:lEe:bH&&bH in Object(e)?sEe(e):cEe(e)}var pEe=dEe;function hEe(e){return e!=null&&typeof e=="object"}var mEe=hEe,vEe=pEe,gEe=mEe,yEe="[object Symbol]";function bEe(e){return typeof e=="symbol"||gEe(e)&&vEe(e)==yEe}var _Ee=bEe,SEe=ZCe,_H=pH,$Ee=_Ee,SH=0/0,TEe=/^[-+]0x[0-9a-f]+$/i,IEe=/^0b[01]+$/i,OEe=/^0o[0-7]+$/i,wEe=parseInt;function CEe(e){if(typeof e=="number")return e;if($Ee(e))return SH;if(_H(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=_H(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=SEe(e);var n=IEe.test(e);return n||OEe.test(e)?wEe(e.slice(2),n?2:8):TEe.test(e)?SH:+e}var EEe=CEe,REe=pH,uR=zCe,$H=EEe,MEe="Expected a function",xEe=Math.max,kEe=Math.min;function AEe(e,t,n){var r,i,o,a,u,s,c=0,l=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(MEe);t=$H(t)||0,REe(n)&&(l=!!n.leading,f="maxWait"in n,o=f?xEe($H(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d);function p(T){var R=r,E=i;return r=i=void 0,c=T,a=e.apply(E,R),a}function h(T){return c=T,u=setTimeout(_,t),l?p(T):a}function v(T){var R=T-s,E=T-c,q=t-R;return f?kEe(q,o-E):q}function m(T){var R=T-s,E=T-c;return s===void 0||R>=t||R<0||f&&E>=o}function _(){var T=uR();if(m(T))return g(T);u=setTimeout(_,v(T))}function g(T){return u=void 0,d&&r?p(T):(r=i=void 0,a)}function S(){u!==void 0&&clearTimeout(u),c=0,r=s=i=u=void 0}function b(){return u===void 0?a:g(uR())}function $(){var T=uR(),R=m(T);if(r=arguments,i=this,s=T,R){if(u===void 0)return h(s);if(f)return clearTimeout(u),u=setTimeout(_,t),p(s)}return u===void 0&&(u=setTimeout(_,t)),a}return $.cancel=S,$.flush=b,$}var NEe=AEe;class FEe{constructor({editor:t,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:u,state:s,from:c,to:l})=>{const{doc:f,selection:d}=s,{empty:p}=d,h=!f.textBetween(c,l).length&&LE(s.selection),v=this.element.contains(document.activeElement);return!(!(u.hasFocus()||v)||p||h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var s;if(this.preventHide){this.preventHide=!1;return}u!=null&&u.relatedTarget&&(!((s=this.element.parentNode)===null||s===void 0)&&s.contains(u.relatedTarget))||this.hide()},this.tippyBlurHandler=u=>{this.blurHandler({event:u})},this.updateHandler=(u,s)=>{var c,l,f;const{state:d,composing:p}=u,{doc:h,selection:v}=d,m=s&&s.doc.eq(h)&&s.selection.eq(v);if(p||m)return;this.createTooltip();const{ranges:_}=v,g=Math.min(..._.map($=>$.$from.pos)),S=Math.max(..._.map($=>$.$to.pos));if(!((c=this.shouldShow)===null||c===void 0?void 0:c.call(this,{editor:this.editor,view:u,state:d,oldState:s,from:g,to:S}))){this.hide();return}(l=this.tippy)===null||l===void 0||l.setProps({getReferenceClientRect:((f=this.tippyOptions)===null||f===void 0?void 0:f.getReferenceClientRect)||(()=>{if(kOe(d.selection)){const $=u.nodeDOM(g);if($)return $.getBoundingClientRect()}return AOe(u,g,S)})}),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(){const{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=Hh(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){const{state:r}=t,i=r.selection.$from.pos!==r.selection.$to.pos;this.updateDelay>0&&i?NEe(this.updateHandler,this.updateDelay)(t,n):this.updateHandler(t,n)}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t,n;!((t=this.tippy)===null||t===void 0)&&t.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||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)}}const TH=e=>new Gr({key:typeof e.pluginKey=="string"?new vu(e.pluginKey):e.pluginKey,view:t=>new FEe({view:t,...e})});Er.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[TH({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});const PEe=e=>{const[t,n]=U.useState(null);return U.useEffect(()=>{if(!t||e.editor.isDestroyed)return;const{pluginKey:r="bubbleMenu",editor:i,tippyOptions:o={},updateDelay:a,shouldShow:u=null}=e,s=TH({updateDelay:a,editor:i,element:t,pluginKey:r,shouldShow:u,tippyOptions:o});return i.registerPlugin(s),()=>i.unregisterPlugin(r)},[e.editor,t]),U.createElement("div",{ref:n,className:e.className,style:{visibility:"hidden"}},e.children)};class WEe extends XOe{constructor(){super(...arguments),this.contentComponent=null}}const LEe=({renderers:e})=>U.createElement(U.Fragment,null,Object.entries(e).map(([t,n])=>u_.createPortal(n.reactElement,n.element,t)));class jEe extends U.Component{constructor(t){super(t),this.editorContentRef=U.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:t}=this.props;if(t&&t.options.element){if(t.contentComponent)return;const 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?u_.flushSync(t):t()}setRenderer(t,n){this.maybeFlushSync(()=>{this.setState(({renderers:r})=>({renderers:{...r,[t]:n}}))})}removeRenderer(t){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>{const r={...n};return delete r[t],{renderers:r}})})}componentWillUnmount(){const{editor:t}=this.props;if(!t||(t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,...n}=this.props;return U.createElement(U.Fragment,null,U.createElement("div",{ref:this.editorContentRef,...n}),U.createElement(LEe,{renderers:this.state.renderers}))}}const DEe=U.memo(jEe),qEe=U.createContext({onDragStart:void 0}),UEe=()=>U.useContext(qEe);U.forwardRef((e,t)=>{const{onDragStart:n}=UEe(),r=e.as||"div";return U.createElement(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function BEe(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function zEe(e){var t;return typeof e=="object"&&((t=e.$$typeof)===null||t===void 0?void 0:t.toString())==="Symbol(react.forward_ref)"}class KEe{constructor(t,{editor:n,props:r={},as:i="div",className:o=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).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(" ")),this.render()}render(){var t,n;const r=this.component,i=this.props;(BEe(r)||zEe(r))&&(i.ref=o=>{this.ref=o}),this.reactElement=U.createElement(r,{...i}),(n=(t=this.editor)===null||t===void 0?void 0:t.contentComponent)===null||n===void 0||n.setRenderer(this.id,this)}updateProps(t={}){this.props={...this.props,...t},this.render()}destroy(){var t,n;(n=(t=this.editor)===null||t===void 0?void 0:t.contentComponent)===null||n===void 0||n.removeRenderer(this.id)}}function VEe(){const[,e]=U.useState(0);return()=>e(t=>t+1)}const HEe=(e={},t=[])=>{const[n,r]=U.useState(null),i=VEe();return U.useEffect(()=>{let o=!0;const a=new WEe(e);return r(a),a.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{o&&i()})})}),()=>{a.destroy(),o=!1}},t),n};var Ve={},_n={},Li={},IH;function OH(){if(IH)return Li;IH=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.Sections=Li.DynamicSection=Li.StaticSection=Li.sectionReader=void 0;const t=H.__importStar(ee),n=Ql(),r=Bz();function i(o){return t.record(n.WidgetKey,o)}return Li.sectionReader=i,Li.StaticSection=i(r.StaticWidget),Li.DynamicSection=i(r.DynamicWidget),Li.Sections={toStatic(o,a){return Object.entries(o).reduce((s,[c,l])=>({...s,[c]:r.Widgets.toStatic(l,a)}),{})}},Li}var wH;function GEe(){if(wH)return _n;wH=1,Object.defineProperty(_n,"__esModule",{value:!0}),_n.filterMissingSharedSlices=_n.collectWidgets=_n.validateSlices=_n.toStatic=_n.flattenWidgets=_n.CustomType=_n.StaticCustomType=void 0;const e=H,t=jn(),n=e.__importStar(ee),r=$w(),i=vt(),o=OH();class a extends Error{constructor(m){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=m,this.message=this._formatError(m)}_formatError(m){return`The following slices doesn't exists in your Prismic repository:
|
|
140
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var u=i.reduce(function(s,c){var l=c&&jCe(c,r);return l&&s.push(l),s},[]);return Kh(e)?u[0]:u}Hh.defaultProps=xr,Hh.setDefaultProps=NCe,Hh.currentInput=go,Object.assign({},E5,{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)}}),Hh.setDefaultProps({render:dH});var Wb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function LCe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var pH=LCe,DCe=typeof Wb=="object"&&Wb&&Wb.Object===Object&&Wb,qCe=DCe,UCe=qCe,BCe=typeof self=="object"&&self&&self.Object===Object&&self,zCe=UCe||BCe||Function("return this")(),hH=zCe,KCe=hH,VCe=function(){return KCe.Date.now()},HCe=VCe,GCe=/\s/;function YCe(e){for(var t=e.length;t--&&GCe.test(e.charAt(t)););return t}var JCe=YCe,ZCe=JCe,XCe=/^\s+/;function QCe(e){return e&&e.slice(0,ZCe(e)+1).replace(XCe,"")}var eEe=QCe,tEe=hH,nEe=tEe.Symbol,mH=nEe,vH=mH,gH=Object.prototype,rEe=gH.hasOwnProperty,iEe=gH.toString,Gh=vH?vH.toStringTag:void 0;function oEe(e){var t=rEe.call(e,Gh),n=e[Gh];try{e[Gh]=void 0;var r=!0}catch{}var i=iEe.call(e);return r&&(t?e[Gh]=n:delete e[Gh]),i}var aEe=oEe,uEe=Object.prototype,sEe=uEe.toString;function cEe(e){return sEe.call(e)}var lEe=cEe,yH=mH,fEe=aEe,dEe=lEe,pEe="[object Null]",hEe="[object Undefined]",bH=yH?yH.toStringTag:void 0;function mEe(e){return e==null?e===void 0?hEe:pEe:bH&&bH in Object(e)?fEe(e):dEe(e)}var vEe=mEe;function gEe(e){return e!=null&&typeof e=="object"}var yEe=gEe,bEe=vEe,_Ee=yEe,SEe="[object Symbol]";function $Ee(e){return typeof e=="symbol"||_Ee(e)&&bEe(e)==SEe}var TEe=$Ee,IEe=eEe,_H=pH,OEe=TEe,SH=0/0,wEe=/^[-+]0x[0-9a-f]+$/i,CEe=/^0b[01]+$/i,EEe=/^0o[0-7]+$/i,REe=parseInt;function MEe(e){if(typeof e=="number")return e;if(OEe(e))return SH;if(_H(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=_H(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=IEe(e);var n=CEe.test(e);return n||EEe.test(e)?REe(e.slice(2),n?2:8):wEe.test(e)?SH:+e}var xEe=MEe,kEe=pH,uR=HCe,$H=xEe,AEe="Expected a function",NEe=Math.max,FEe=Math.min;function PEe(e,t,n){var r,i,o,a,u,s,c=0,l=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(AEe);t=$H(t)||0,kEe(n)&&(l=!!n.leading,f="maxWait"in n,o=f?NEe($H(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d);function p(T){var M=r,R=i;return r=i=void 0,c=T,a=e.apply(R,M),a}function h(T){return c=T,u=setTimeout(_,t),l?p(T):a}function v(T){var M=T-s,R=T-c,q=t-M;return f?FEe(q,o-R):q}function m(T){var M=T-s,R=T-c;return s===void 0||M>=t||M<0||f&&R>=o}function _(){var T=uR();if(m(T))return g(T);u=setTimeout(_,v(T))}function g(T){return u=void 0,d&&r?p(T):(r=i=void 0,a)}function S(){u!==void 0&&clearTimeout(u),c=0,r=s=i=u=void 0}function b(){return u===void 0?a:g(uR())}function $(){var T=uR(),M=m(T);if(r=arguments,i=this,s=T,M){if(u===void 0)return h(s);if(f)return clearTimeout(u),u=setTimeout(_,t),p(s)}return u===void 0&&(u=setTimeout(_,t)),a}return $.cancel=S,$.flush=b,$}var WEe=PEe;class jEe{constructor({editor:t,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:u,state:s,from:c,to:l})=>{const{doc:f,selection:d}=s,{empty:p}=d,h=!f.textBetween(c,l).length&&jE(s.selection),v=this.element.contains(document.activeElement);return!(!(u.hasFocus()||v)||p||h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:u})=>{var s;if(this.preventHide){this.preventHide=!1;return}u!=null&&u.relatedTarget&&(!((s=this.element.parentNode)===null||s===void 0)&&s.contains(u.relatedTarget))||this.hide()},this.tippyBlurHandler=u=>{this.blurHandler({event:u})},this.updateHandler=(u,s)=>{var c,l,f;const{state:d,composing:p}=u,{doc:h,selection:v}=d,m=s&&s.doc.eq(h)&&s.selection.eq(v);if(p||m)return;this.createTooltip();const{ranges:_}=v,g=Math.min(..._.map($=>$.$from.pos)),S=Math.max(..._.map($=>$.$to.pos));if(!((c=this.shouldShow)===null||c===void 0?void 0:c.call(this,{editor:this.editor,view:u,state:d,oldState:s,from:g,to:S}))){this.hide();return}(l=this.tippy)===null||l===void 0||l.setProps({getReferenceClientRect:((f=this.tippyOptions)===null||f===void 0?void 0:f.getReferenceClientRect)||(()=>{if(FOe(d.selection)){const $=u.nodeDOM(g);if($)return $.getBoundingClientRect()}return POe(u,g,S)})}),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(){const{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=Hh(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){const{state:r}=t,i=r.selection.$from.pos!==r.selection.$to.pos;this.updateDelay>0&&i?WEe(this.updateHandler,this.updateDelay)(t,n):this.updateHandler(t,n)}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t,n;!((t=this.tippy)===null||t===void 0)&&t.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||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)}}const TH=e=>new Gr({key:typeof e.pluginKey=="string"?new gu(e.pluginKey):e.pluginKey,view:t=>new jEe({view:t,...e})});Rr.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[TH({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});const LEe=e=>{const[t,n]=U.useState(null);return U.useEffect(()=>{if(!t||e.editor.isDestroyed)return;const{pluginKey:r="bubbleMenu",editor:i,tippyOptions:o={},updateDelay:a,shouldShow:u=null}=e,s=TH({updateDelay:a,editor:i,element:t,pluginKey:r,shouldShow:u,tippyOptions:o});return i.registerPlugin(s),()=>i.unregisterPlugin(r)},[e.editor,t]),U.createElement("div",{ref:n,className:e.className,style:{visibility:"hidden"}},e.children)};class DEe extends twe{constructor(){super(...arguments),this.contentComponent=null}}const qEe=({renderers:e})=>U.createElement(U.Fragment,null,Object.entries(e).map(([t,n])=>u_.createPortal(n.reactElement,n.element,t)));class UEe extends U.Component{constructor(t){super(t),this.editorContentRef=U.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:t}=this.props;if(t&&t.options.element){if(t.contentComponent)return;const 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?u_.flushSync(t):t()}setRenderer(t,n){this.maybeFlushSync(()=>{this.setState(({renderers:r})=>({renderers:{...r,[t]:n}}))})}removeRenderer(t){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>{const r={...n};return delete r[t],{renderers:r}})})}componentWillUnmount(){const{editor:t}=this.props;if(!t||(t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,...n}=this.props;return U.createElement(U.Fragment,null,U.createElement("div",{ref:this.editorContentRef,...n}),U.createElement(qEe,{renderers:this.state.renderers}))}}const BEe=U.memo(UEe),zEe=U.createContext({onDragStart:void 0}),KEe=()=>U.useContext(zEe);U.forwardRef((e,t)=>{const{onDragStart:n}=KEe(),r=e.as||"div";return U.createElement(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function VEe(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function HEe(e){var t;return typeof e=="object"&&((t=e.$$typeof)===null||t===void 0?void 0:t.toString())==="Symbol(react.forward_ref)"}class GEe{constructor(t,{editor:n,props:r={},as:i="div",className:o=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).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(" ")),this.render()}render(){var t,n;const r=this.component,i=this.props;(VEe(r)||HEe(r))&&(i.ref=o=>{this.ref=o}),this.reactElement=U.createElement(r,{...i}),(n=(t=this.editor)===null||t===void 0?void 0:t.contentComponent)===null||n===void 0||n.setRenderer(this.id,this)}updateProps(t={}){this.props={...this.props,...t},this.render()}destroy(){var t,n;(n=(t=this.editor)===null||t===void 0?void 0:t.contentComponent)===null||n===void 0||n.removeRenderer(this.id)}}function YEe(){const[,e]=U.useState(0);return()=>e(t=>t+1)}const JEe=(e={},t=[])=>{const[n,r]=U.useState(null),i=YEe();return U.useEffect(()=>{let o=!0;const a=new DEe(e);return r(a),a.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{o&&i()})})}),()=>{a.destroy(),o=!1}},t),n};var Ve={},_n={},ji={},IH;function OH(){if(IH)return ji;IH=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.Sections=ji.DynamicSection=ji.StaticSection=ji.sectionReader=void 0;const t=H.__importStar(ee),n=Ql(),r=Bz();function i(o){return t.record(n.WidgetKey,o)}return ji.sectionReader=i,ji.StaticSection=i(r.StaticWidget),ji.DynamicSection=i(r.DynamicWidget),ji.Sections={toStatic(o,a){return Object.entries(o).reduce((s,[c,l])=>({...s,[c]:r.Widgets.toStatic(l,a)}),{})}},ji}var wH;function ZEe(){if(wH)return _n;wH=1,Object.defineProperty(_n,"__esModule",{value:!0}),_n.filterMissingSharedSlices=_n.collectWidgets=_n.validateSlices=_n.toStatic=_n.flattenWidgets=_n.CustomType=_n.StaticCustomType=void 0;const e=H,t=Ln(),n=e.__importStar(ee),r=$w(),i=vt(),o=OH();class a extends Error{constructor(m){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=m,this.message=this._formatError(m)}_formatError(m){return`The following slices doesn't exists in your Prismic repository:
|
|
141
141
|
${m.map(g=>` - ${g}`).join(`
|
|
142
142
|
`)}
|
|
143
|
-
`}}function u(v){return n.exact(n.intersection([n.type({id:n.string,label:i.StringOrNull,repeatable:(0,r.withFallback)(n.boolean,!0),json:n.record(n.string,v),status:(0,r.withFallback)(n.boolean,!0)}),n.partial({hash:n.string})]))}_n.StaticCustomType=u(o.StaticSection),_n.CustomType=u(o.DynamicSection);function s(v){return Object.entries(v.json).reduce((m,[,_])=>{const g=Object.entries(_);return m.concat(g)},[])}_n.flattenWidgets=s;function c(v){return s(v).filter(([,g])=>g.type==="Slices").reduce((g,[,S])=>{const b=Object.entries(S.config&&S.config.choices?S.config.choices:{}).filter(([,$])=>$.type==="SharedSlice").map(([$])=>$);return g.concat(b)},[])}function l(v){const m=c(v);return function(_){return m.map(_)}}function f(v,m){const _=Object.entries(v.json).reduce((g,[S,b])=>({...g,[S]:o.Sections.toStatic(b,m)}),{});return{...v,json:_}}_n.toStatic=f;function d(v,m){const _=l(v)(g=>{if(!m.get(g))return g}).filter(Boolean);return _.length>0?(0,t.left)(new a(_)):(0,t.right)(v)}_n.validateSlices=d;function p(v,m){const _=Object.entries(v.json).reduce((g,[S,b])=>{const $=Object.entries(b).reduce((T,[R
|
|
144
|
-
`},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:u}=r.extensionManager,s=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:l})=>{if(l&&s&&a){const f=s.filter(d=>u.includes(d.type.name));c.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),gc={isHardBreak(e){return e.type.name===WH.name},children:{reduce(e,t,n){let r=n;return e.forEach((i,o,a)=>{r=t(r,i,a)}),r},map(e,t){return this.reduce(e,(n,r)=>[...n,t(r)],[])},exists(e,t){return this.reduce(e,(n,r)=>n||t(r),!1)},filter(e,t){return this.reduce(e,(n,r)=>[...n,...t(r)?[r]:[]],[])}},marks:{reduce(e,t,n){let r=n;return e.marks.forEach((i,o)=>{r=t(r,i,o)}),r},map(e,t){return this.reduce(e,(n,r)=>[...n,t(r)],[])},filter(e,t){return this.reduce(e,(n,r)=>[...n,...t(r)?[r]:[]],[])}}};function
|
|
145
|
-
`,jH={fromPrismic(e){return function(t){var n;if(t===jb)return(n=e.nodes[Lb.name])==null?void 0:n.create({})}},toPrismic(e){if(e.type.name===Lb.name)return jb}},vR={isEmptyLine(e){return e.length===0},isFirst(e){return e===0}};function mRe(e,t){return function(n){const r=jH.fromPrismic(e)(jb);if(!r)return[n(t)];const i=t.split(jb);return i.length===1?t.length?[n(t)]:[r]:i.reduce((o,a,u)=>vR.isFirst(u)?vR.isEmptyLine(a)?o:[...o,n(a)]:vR.isEmptyLine(a)?[...o,r]:[...o,r,n(a)],[])}}const Db={name:Lb.name,component:Lb,converter:jH,splitTextToNodes:mRe},vRe=Er.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Gr({props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];if(!n)return null;const o=e.type.createAndFill(),a=(o==null?void 0:o.sameMarkup(e))&&o.content.findDiffStart(e.content)===null;return e.descendants((u,s)=>{const c=r>=s&&r<=s+u.nodeSize,l=!u.isLeaf&&!u.childCount;if((c||!this.options.showOnlyCurrent)&&l){const f=[this.options.emptyNodeClass];a&&f.push(this.options.emptyEditorClass);const d=Cr.node(s,s+u.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:u,pos:s,hasAnchor:c}):this.options.placeholder});i.push(d)}return this.options.includeChildren}),Dt.create(e,i)}}})]}}),gRe=e=>vRe.configure({includeChildren:!0,placeholder:({editor:t,hasAnchor:n,node:r})=>{const i=!gc.children.exists(t.state.doc,u=>u===r),o=(()=>{const u=t.isEditable,s=t.isFocused&&n,c=r.type.name!==Nu.name;return u&&(s||c||i)})(),a=(()=>{if(i)return Nf.placeholder;const u=e[r.type.name];return typeof u=="string"?u:u==null?void 0:u(r.attrs)})();return o&&a||""},showOnlyCurrent:!1,showOnlyWhenEditable:!1});function qb(e){return e.split("-")[1]}function DH(e){return e==="y"?"height":"width"}function Ru(e){return e.split("-")[0]}function Xh(e){return["top","bottom"].includes(Ru(e))?"x":"y"}function qH(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,u=Xh(t),s=DH(u),c=r[s]/2-i[s]/2,l=Ru(t),f=u==="x";let d;switch(l){case"top":d={x:o,y:r.y-i.height};break;case"bottom":d={x:o,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:a};break;case"left":d={x:r.x-i.width,y:a};break;default:d={x:r.x,y:r.y}}switch(qb(t)){case"start":d[u]-=c*(n&&f?-1:1);break;case"end":d[u]+=c*(n&&f?-1:1);break}return d}const yRe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,u=o.filter(Boolean),s=await(a.isRTL==null?void 0:a.isRTL(t));if(process.env.NODE_ENV!=="production"){if(a==null&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),u.filter(v=>{let{name:m}=v;return m==="autoPlacement"||m==="flip"}).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));(!e||!t)&&console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "))}let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:f}=qH(c,r,s),d=r,p={},h=0;for(let v=0;v<u.length;v++){const{name:m,fn:_}=u[v],{x:g,y:S,data:b,reset:$}=await _({x:l,y:f,initialPlacement:r,placement:d,strategy:i,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});if(l=g??l,f=S??f,p={...p,[m]:{...p[m],...b}},process.env.NODE_ENV!=="production"&&h>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),$&&h<=50){h++,typeof $=="object"&&($.placement&&(d=$.placement),$.rects&&(c=$.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):$.rects),{x:l,y:f}=qH(c,d,s)),v=-1;continue}}return{x:l,y:f,placement:d,strategy:i,middlewareData:p}};function bRe(e){return{top:0,right:0,bottom:0,left:0,...e}}function _Re(e){return typeof e!="number"?bRe(e):{top:e,right:e,bottom:e,left:e}}function gR(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function UH(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:u,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:l="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=t,h=_Re(p),m=u[d?f==="floating"?"reference":"floating":f],_=gR(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(m)))==null||n?m:m.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:c,rootBoundary:l,strategy:s})),g=f==="floating"?{...a.floating,x:r,y:i}:a.reference,S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),b=await(o.isElement==null?void 0:o.isElement(S))?await(o.getScale==null?void 0:o.getScale(S))||{x:1,y:1}:{x:1,y:1},$=gR(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:g,offsetParent:S,strategy:s}):g);return process.env.NODE_ENV,{top:(_.top-$.top+h.top)/b.y,bottom:($.bottom-_.bottom+h.bottom)/b.y,left:(_.left-$.left+h.left)/b.x,right:($.right-_.right+h.right)/b.x}}const SRe=Math.min,$Re=Math.max;function BH(e,t,n){return $Re(e,SRe(t,n))}const TRe={left:"right",right:"left",bottom:"top",top:"bottom"};function Ub(e){return e.replace(/left|right|bottom|top/g,t=>TRe[t])}function IRe(e,t,n){n===void 0&&(n=!1);const r=qb(e),i=Xh(e),o=DH(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Ub(a)),{main:a,cross:Ub(a)}}const ORe={start:"end",end:"start"};function yR(e){return e.replace(/start|end/g,t=>ORe[t])}function wRe(e){const t=Ub(e);return[yR(e),t,yR(t)]}function CRe(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:a;default:return[]}}function ERe(e,t,n,r){const i=qb(e);let o=CRe(Ru(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(yR)))),o}const RRe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:u,elements:s}=t,{mainAxis:c=!0,crossAxis:l=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...v}=e,m=Ru(r),_=Ru(a)===a,g=await(u.isRTL==null?void 0:u.isRTL(s.floating)),S=f||(_||!h?[Ub(a)]:wRe(a));!f&&p!=="none"&&S.push(...ERe(a,h,p,g));const b=[a,...S],$=await UH(t,v),T=[];let R=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&T.push($[m]),l){const{main:N,cross:Z}=IRe(r,o,g);T.push($[N],$[Z])}if(R=[...R,{placement:r,overflows:T}],!T.every(N=>N<=0)){var E,q;const N=(((E=i.flip)==null?void 0:E.index)||0)+1,Z=b[N];if(Z)return{data:{index:N,overflows:R},reset:{placement:Z}};let ie=(q=R.filter(J=>J.overflows[0]<=0).sort((J,ye)=>J.overflows[1]-ye.overflows[1])[0])==null?void 0:q.placement;if(!ie)switch(d){case"bestFit":{var Y;const J=(Y=R.map(ye=>[ye.placement,ye.overflows.filter(we=>we>0).reduce((we,x)=>we+x,0)]).sort((ye,we)=>ye[1]-we[1])[0])==null?void 0:Y[0];J&&(ie=J);break}case"initialPlacement":ie=a;break}if(r!==ie)return{reset:{placement:ie}}}return{}}}};async function MRe(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Ru(n),u=qb(n),s=Xh(n)==="x",c=["left","top"].includes(a)?-1:1,l=o&&s?-1:1,f=typeof t=="function"?t(e):t;let{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return u&&typeof h=="number"&&(p=u==="end"?h*-1:h),s?{x:p*l,y:d*c}:{x:d*c,y:p*l}}const xRe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await MRe(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function zH(e){return e==="x"?"y":"x"}const kRe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:u={fn:m=>{let{x:_,y:g}=m;return{x:_,y:g}}},...s}=e,c={x:n,y:r},l=await UH(t,s),f=Xh(Ru(i)),d=zH(f);let p=c[f],h=c[d];if(o){const m=f==="y"?"top":"left",_=f==="y"?"bottom":"right",g=p+l[m],S=p-l[_];p=BH(g,p,S)}if(a){const m=d==="y"?"top":"left",_=d==="y"?"bottom":"right",g=h+l[m],S=h-l[_];h=BH(g,h,S)}const v=u.fn({...t,[f]:p,[d]:h});return{...v,data:{x:v.x-n,y:v.y-r}}}}},ARe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:u=0,mainAxis:s=!0,crossAxis:c=!0}=e,l={x:n,y:r},f=Xh(i),d=zH(f);let p=l[f],h=l[d];const v=typeof u=="function"?u(t):u,m=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(s){const S=f==="y"?"height":"width",b=o.reference[f]-o.floating[S]+m.mainAxis,$=o.reference[f]+o.reference[S]-m.mainAxis;p<b?p=b:p>$&&(p=$)}if(c){var _,g;const S=f==="y"?"width":"height",b=["top","left"].includes(Ru(i)),$=o.reference[d]-o.floating[S]+(b&&((_=a.offset)==null?void 0:_[d])||0)+(b?0:m.crossAxis),T=o.reference[d]+o.reference[S]+(b?0:((g=a.offset)==null?void 0:g[d])||0)-(b?m.crossAxis:0);h<$?h=$:h>T&&(h=T)}return{[f]:p,[d]:h}}}};function xr(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yo(e){return xr(e).getComputedStyle(e)}const KH=Math.min,Qh=Math.max,Bb=Math.round;function VH(e){const t=yo(e);let n=parseFloat(t.width),r=parseFloat(t.height);const i=e.offsetWidth,o=e.offsetHeight,a=Bb(n)!==i||Bb(r)!==o;return a&&(n=i,r=o),{width:n,height:r,fallback:a}}function Mu(e){return GH(e)?(e.nodeName||"").toLowerCase():""}let zb;function HH(){if(zb)return zb;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(zb=e.brands.map(t=>t.brand+"/"+t.version).join(" "),zb):navigator.userAgent}function bo(e){return e instanceof xr(e).HTMLElement}function ji(e){return e instanceof xr(e).Element}function GH(e){return e instanceof xr(e).Node}function YH(e){if(typeof ShadowRoot>"u")return!1;const t=xr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Kb(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=yo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function NRe(e){return["table","td","th"].includes(Mu(e))}function bR(e){const t=/firefox/i.test(HH()),n=yo(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||(r?r!=="none":!1)||t&&n.willChange==="filter"||t&&(n.filter?n.filter!=="none":!1)||["transform","perspective"].some(i=>n.willChange.includes(i))||["paint","layout","strict","content"].some(i=>{const o=n.contain;return o!=null?o.includes(i):!1})}function _R(){return/^((?!chrome|android).)*safari/i.test(HH())}function SR(e){return["html","body","#document"].includes(Mu(e))}function JH(e){return ji(e)?e:e.contextElement}const ZH={x:1,y:1};function Ff(e){const t=JH(e);if(!bo(t))return ZH;const n=t.getBoundingClientRect(),{width:r,height:i,fallback:o}=VH(t);let a=(o?Bb(n.width):n.width)/r,u=(o?Bb(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}function yc(e,t,n,r){var i,o;t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),u=JH(e);let s=ZH;t&&(r?ji(r)&&(s=Ff(r)):s=Ff(e));const c=u?xr(u):window,l=_R()&&n;let f=(a.left+(l&&((i=c.visualViewport)==null?void 0:i.offsetLeft)||0))/s.x,d=(a.top+(l&&((o=c.visualViewport)==null?void 0:o.offsetTop)||0))/s.y,p=a.width/s.x,h=a.height/s.y;if(u){const v=xr(u),m=r&&ji(r)?xr(r):r;let _=v.frameElement;for(;_&&r&&m!==v;){const g=Ff(_),S=_.getBoundingClientRect(),b=getComputedStyle(_);S.x+=(_.clientLeft+parseFloat(b.paddingLeft))*g.x,S.y+=(_.clientTop+parseFloat(b.paddingTop))*g.y,f*=g.x,d*=g.y,p*=g.x,h*=g.y,f+=S.x,d+=S.y,_=xr(_).frameElement}}return{width:p,height:h,top:d,right:f+p,bottom:d+h,left:f,x:f,y:d}}function xu(e){return((GH(e)?e.ownerDocument:e.document)||window.document).documentElement}function Vb(e){return ji(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function FRe(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=bo(n),o=xu(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},u={x:1,y:1};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((Mu(n)!=="body"||Kb(o))&&(a=Vb(n)),bo(n))){const c=yc(n);u=Ff(n),s.x=c.x+n.clientLeft,s.y=c.y+n.clientTop}return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-a.scrollLeft*u.x+s.x,y:t.y*u.y-a.scrollTop*u.y+s.y}}function XH(e){return yc(xu(e)).left+Vb(e).scrollLeft}function PRe(e){const t=xu(e),n=Vb(e),r=e.ownerDocument.body,i=Qh(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Qh(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+XH(e);const u=-n.scrollTop;return yo(r).direction==="rtl"&&(a+=Qh(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:u}}function em(e){if(Mu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||YH(e)&&e.host||xu(e);return YH(t)?t.host:t}function QH(e){const t=em(e);return SR(t)?t.ownerDocument.body:bo(t)&&Kb(t)?t:QH(t)}function bc(e,t){var n;t===void 0&&(t=[]);const r=QH(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=xr(r);return i?t.concat(o,o.visualViewport||[],Kb(r)?r:[]):t.concat(r,bc(r))}function WRe(e,t){const n=xr(e),r=xu(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,u=0,s=0;if(i){o=i.width,a=i.height;const c=_R();(!c||c&&t==="fixed")&&(u=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:u,y:s}}function LRe(e,t){const n=yc(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=bo(e)?Ff(e):{x:1,y:1},a=e.clientWidth*o.x,u=e.clientHeight*o.y,s=i*o.x,c=r*o.y;return{width:a,height:u,x:s,y:c}}function e6(e,t,n){let r;if(t==="viewport")r=WRe(e,n);else if(t==="document")r=PRe(xu(e));else if(ji(t))r=LRe(t,n);else{const a={...t};if(_R()){var i,o;const u=xr(e);a.x-=((i=u.visualViewport)==null?void 0:i.offsetLeft)||0,a.y-=((o=u.visualViewport)==null?void 0:o.offsetTop)||0}r=a}return gR(r)}function jRe(e,t){const n=t.get(e);if(n)return n;let r=bc(e).filter(u=>ji(u)&&Mu(u)!=="body"),i=null;const o=yo(e).position==="fixed";let a=o?em(e):e;for(;ji(a)&&!SR(a);){const u=yo(a),s=bR(a);u.position==="fixed"?i=null:(o?!s&&!i:!s&&u.position==="static"&&!!i&&["absolute","fixed"].includes(i.position))?r=r.filter(f=>f!==a):i=u,a=em(a)}return t.set(e,r),r}function DRe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?jRe(t,this._c):[].concat(n),r],u=a[0],s=a.reduce((c,l)=>{const f=e6(t,l,i);return c.top=Qh(f.top,c.top),c.right=KH(f.right,c.right),c.bottom=KH(f.bottom,c.bottom),c.left=Qh(f.left,c.left),c},e6(t,u,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function qRe(e){return bo(e)?VH(e):e.getBoundingClientRect()}function t6(e,t){return!bo(e)||yo(e).position==="fixed"?null:t?t(e):e.offsetParent}function URe(e){let t=em(e);for(;bo(t)&&!SR(t);){if(bR(t))return t;t=em(t)}return null}function n6(e,t){const n=xr(e);let r=t6(e,t);for(;r&&NRe(r)&&yo(r).position==="static";)r=t6(r,t);return r&&(Mu(r)==="html"||Mu(r)==="body"&&yo(r).position==="static"&&!bR(r))?n:r||URe(e)||n}function BRe(e,t,n){const r=bo(t),i=xu(t),o=yc(e,!0,n==="fixed",t);let a={scrollLeft:0,scrollTop:0};const u={x:0,y:0};if(r||!r&&n!=="fixed")if((Mu(t)!=="body"||Kb(i))&&(a=Vb(t)),bo(t)){const s=yc(t,!0);u.x=s.x+t.clientLeft,u.y=s.y+t.clientTop}else i&&(u.x=XH(i));return{x:o.left+a.scrollLeft-u.x,y:o.top+a.scrollTop-u.y,width:o.width,height:o.height}}const zRe={getClippingRect:DRe,convertOffsetParentRelativeRectToViewportRelativeRect:FRe,isElement:ji,getDimensions:qRe,getOffsetParent:n6,getDocumentElement:xu,getScale:Ff,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||n6,o=this.getDimensions;return{reference:BRe(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>yo(e).direction==="rtl"};function KRe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:u=!1}=r,s=i&&!u,c=s||o?[...ji(e)?bc(e):e.contextElement?bc(e.contextElement):[],...bc(t)]:[];c.forEach(h=>{s&&h.addEventListener("scroll",n,{passive:!0}),o&&h.addEventListener("resize",n)});let l=null;if(a){let h=!0;l=new ResizeObserver(()=>{h||n(),h=!1}),ji(e)&&!u&&l.observe(e),!ji(e)&&e.contextElement&&!u&&l.observe(e.contextElement),l.observe(t)}let f,d=u?yc(e):null;u&&p();function p(){const h=yc(e);d&&(h.x!==d.x||h.y!==d.y||h.width!==d.width||h.height!==d.height)&&n(),d=h,f=requestAnimationFrame(p)}return n(),()=>{var h;c.forEach(v=>{s&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),(h=l)==null||h.disconnect(),l=null,u&&cancelAnimationFrame(f)}}const VRe=(e,t,n)=>{const r=new Map,i={platform:zRe,...n},o={...i.platform,_c:r};return yRe(e,t,{...i,platform:o})};var Hb=typeof document<"u"?U.useLayoutEffect:U.useEffect;function Gb(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Gb(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Gb(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function r6(e){const t=$e.useRef(e);return Hb(()=>{t.current=e}),t}function HRe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,whileElementsMounted:o,open:a}=e,[u,s]=$e.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[c,l]=$e.useState(r);Gb(c,r)||l(r);const f=$e.useRef(null),d=$e.useRef(null),p=$e.useRef(u),h=r6(o),v=r6(i),[m,_]=$e.useState(null),[g,S]=$e.useState(null),b=$e.useCallback(Y=>{f.current!==Y&&(f.current=Y,_(Y))},[]),$=$e.useCallback(Y=>{d.current!==Y&&(d.current=Y,S(Y))},[]),T=$e.useCallback(()=>{if(!f.current||!d.current)return;const Y={placement:t,strategy:n,middleware:c};v.current&&(Y.platform=v.current),VRe(f.current,d.current,Y).then(N=>{const Z={...N,isPositioned:!0};R.current&&!Gb(p.current,Z)&&(p.current=Z,j6.flushSync(()=>{s(Z)}))})},[c,t,n,v]);Hb(()=>{a===!1&&p.current.isPositioned&&(p.current.isPositioned=!1,s(Y=>({...Y,isPositioned:!1})))},[a]);const R=$e.useRef(!1);Hb(()=>(R.current=!0,()=>{R.current=!1}),[]),Hb(()=>{if(m&&g){if(h.current)return h.current(m,g,T);T()}},[m,g,T,h]);const E=$e.useMemo(()=>({reference:f,floating:d,setReference:b,setFloating:$}),[b,$]),q=$e.useMemo(()=>({reference:m,floating:g}),[m,g]);return $e.useMemo(()=>({...u,update:T,refs:E,elements:q,reference:b,floating:$}),[u,T,E,q,b,$])}var ku=typeof document<"u"?U.useLayoutEffect:U.useEffect;function GRe(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}let $R=!1,YRe=0;const i6=()=>"floating-ui-"+YRe++;function JRe(){const[e,t]=$e.useState(()=>$R?i6():void 0);return ku(()=>{e==null&&t(i6())},[]),$e.useEffect(()=>{$R||($R=!0)},[]),e}const o6=$e["useId".toString()],a6=o6??JRe,ZRe=$e.createContext(null),XRe=$e.createContext(null),u6=()=>{var e,t;return(e=(t=$e.useContext(ZRe))==null?void 0:t.id)!=null?e:null},TR=()=>$e.useContext(XRe);function IR(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function s6(e){var t;return(t=IR(e).defaultView)!=null?t:window}function Yb(e){return e?e instanceof s6(e).Element:!1}function QRe(e){return e?e instanceof s6(e).HTMLElement:!1}const c6=$e["useInsertionEffect".toString()];function OR(e){const t=$e.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return c6?c6(()=>{t.current=e}):t.current=e,$e.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function eMe(e){let{open:t=!1,onOpenChange:n,whileElementsMounted:r,placement:i,middleware:o,strategy:a,nodeId:u}=e===void 0?{}:e;const[s,c]=$e.useState(null),l=TR(),f=$e.useRef(null),d=$e.useRef({}),p=$e.useState(()=>GRe())[0],h=HRe({placement:i,middleware:o,strategy:a,whileElementsMounted:r}),v=OR(n),m=$e.useMemo(()=>({...h.refs,domReference:f}),[h.refs]),_=$e.useMemo(()=>({...h,refs:m,dataRef:d,nodeId:u,events:p,open:t,onOpenChange:v,_:{domReference:s}}),[h,u,p,t,v,m,s]);ku(()=>{const b=l==null?void 0:l.nodesRef.current.find($=>$.id===u);b&&(b.context=_)});const{reference:g}=h,S=$e.useCallback(b=>{(Yb(b)||b===null)&&(_.refs.domReference.current=b,c(b)),g(b)},[g,_.refs]);return $e.useMemo(()=>({...h,context:_,refs:m,reference:S}),[h,m,_,S])}function wR(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(a=>{let[u,s]=a;if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof s=="function"){var c;(c=r.get(u))==null||c.push(s),i[u]=function(){for(var l,f=arguments.length,d=new Array(f),p=0;p<f;p++)d[p]=arguments[p];(l=r.get(u))==null||l.forEach(h=>h(...d))}}}else i[u]=s}),i),{})}}const tMe=function(e){return e===void 0&&(e=[]),{getReferenceProps:t=>wR(t,e,"reference"),getFloatingProps:t=>wR(t,e,"floating"),getItemProps:t=>wR(t,e,"item")}};function CR(e,t){var n;let r=(n=e.filter(a=>{var u;return a.parentId===t&&((u=a.context)==null?void 0:u.open)}))!=null?n:[],i=r;for(;i.length;){var o;i=(o=e.filter(a=>{var u;return(u=i)==null?void 0:u.some(s=>{var c;return a.parentId===s.id&&((c=a.context)==null?void 0:c.open)})}))!=null?o:[],r=r.concat(i)}return r}function l6(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function nMe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Au(e){e.preventDefault(),e.stopPropagation()}function rMe(e){const t=U.useRef(e);return ku(()=>{t.current=e}),t}function f6(e){const t=U.useRef();return ku(()=>{t.current=e},[e]),t.current}const iMe=function(e,t){let{open:n}=e,{enabled:r=!0,role:i="dialog"}=t===void 0?{}:t;const o=a6(),a=a6(),u={id:o,role:i};return r?i==="tooltip"?{reference:{"aria-describedby":n?o:void 0},floating:u}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":i==="alertdialog"?"dialog":i,"aria-controls":n?o:void 0,...i==="listbox"&&{role:"combobox"},...i==="menu"&&{id:a}},floating:{...u,...i==="menu"&&{"aria-labelledby":a}}}:{}};function ER(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}const oMe=function(e,t){let{open:n,onOpenChange:r,refs:i,events:o,nodeId:a}=e,{enabled:u=!0,escapeKey:s=!0,outsidePointerDown:c=!0,referencePointerDown:l=!1,ancestorScroll:f=!1,bubbles:d=!0}=t===void 0?{}:t;const p=TR(),h=u6()!=null,v=$e.useRef(!1);return $e.useEffect(()=>{if(!n||!u)return;function m($){if($.key==="Escape"){if(!d&&p&&CR(p.nodesRef.current,a).length>0)return;o.emit("dismiss",{preventScroll:!1}),r(!1)}}function _($){const T=v.current;if(v.current=!1,T)return;const R=nMe($);if(Yb(R)&&i.floating.current){var E;const Y=(E=i.floating.current.ownerDocument.defaultView)!=null?E:window,N=R.scrollWidth>R.clientWidth,Z=R.scrollHeight>R.clientHeight;let ie=Z&&$.offsetX>R.clientWidth;if(Z&&Y.getComputedStyle(R).direction==="rtl"&&(ie=$.offsetX<=R.offsetWidth-R.clientWidth),ie||N&&$.offsetY>R.clientHeight)return}const q=p&&CR(p.nodesRef.current,a).some(Y=>{var N;return ER($,(N=Y.context)==null?void 0:N.refs.floating.current)});ER($,i.floating.current)||ER($,i.domReference.current)||q||!d&&p&&CR(p.nodesRef.current,a).length>0||(o.emit("dismiss",h?{preventScroll:!0}:!1),r(!1))}function g(){r(!1)}const S=IR(i.floating.current);s&&S.addEventListener("keydown",m),c&&S.addEventListener("pointerdown",_);const b=(f?[...Yb(i.reference.current)?bc(i.reference.current):[],...Yb(i.floating.current)?bc(i.floating.current):[]]:[]).filter($=>{var T;return $!==((T=S.defaultView)==null?void 0:T.visualViewport)});return b.forEach($=>$.addEventListener("scroll",g,{passive:!0})),()=>{s&&S.removeEventListener("keydown",m),c&&S.removeEventListener("pointerdown",_),b.forEach($=>$.removeEventListener("scroll",g))}},[s,c,o,p,a,n,r,f,u,d,i,h]),u?{reference:{onPointerDown(){l&&(o.emit("dismiss"),r(!1))}},floating:{onPointerDownCapture(){v.current=!0}}}:{}},RR="ArrowUp",Jb="ArrowDown",Pf="ArrowLeft",tm="ArrowRight";function Zb(e,t,n){return Math.floor(e/t)!==n}function nm(e,t){return t<0||t>=e.current.length}function Mn(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const a=e.current;let u=n;do{var s,c;u=u+(r?-o:o)}while(u>=0&&u<=a.length-1&&(i?i.includes(u):a[u]==null||(s=a[u])!=null&&s.hasAttribute("disabled")||((c=a[u])==null?void 0:c.getAttribute("aria-disabled"))==="true"));return u}function Xb(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function d6(e,t){return Xb(t,e===RR||e===Jb,e===Pf||e===tm)}function MR(e,t,n){return Xb(t,e===Jb,n?e===Pf:e===tm)||e==="Enter"||e==" "||e===""}function aMe(e,t,n){return Xb(t,n?e===Pf:e===tm,e===Jb)}function uMe(e,t,n){return Xb(t,n?e===tm:e===Pf,e===RR)}function xR(e,t){return Mn(e,{disabledIndices:t})}function p6(e,t){return Mn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const sMe=function(e,t){let{open:n,onOpenChange:r,refs:i}=e,{listRef:o,activeIndex:a,onNavigate:u=()=>{},enabled:s=!0,selectedIndex:c=null,allowEscape:l=!1,loop:f=!1,nested:d=!1,rtl:p=!1,virtual:h=!1,focusItemOnOpen:v="auto",focusItemOnHover:m=!0,openOnArrowKeyDown:_=!0,disabledIndices:g=void 0,orientation:S="vertical",cols:b=1}=t===void 0?{listRef:{current:[]},activeIndex:null,onNavigate:()=>{}}:t;process.env.NODE_ENV!=="production"&&(l&&(f||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),h||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),S==="vertical"&&b>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const $=u6(),T=TR(),R=f6(n),E=OR(u),q=OR(f6(u)),Y=$e.useRef(v),N=$e.useRef(c??-1),Z=$e.useRef(null),ie=rMe(g),J=$e.useRef(!1),ye=$e.useRef(-1),[we,x]=$e.useState(),k=$e.useCallback((O,F)=>{ye.current=requestAnimationFrame(()=>{if(h){var L;x((L=O.current[F.current])==null?void 0:L.id)}else{var X;(X=O.current[F.current])==null||X.focus({preventScroll:!0})}})},[h]);ku(()=>{s&&(!R&&n&&Y.current&&c!=null&&E(c),R&&!n&&(cancelAnimationFrame(ye.current),N.current=-1,q(null)))},[n,R,c,o,k,s,E,q]),ku(()=>{if(s&&n)if(a==null){if(c!=null)return;R&&(N.current=-1,k(o,N)),!R&&Y.current&&(Z.current!=null||Y.current===!0&&Z.current==null)&&(N.current=Z.current==null||MR(Z.current,S,p)||d?xR(o,ie.current):p6(o,ie.current),E(N.current),k(o,N))}else nm(o,a)||(N.current=a,k(o,N))},[n,R,a,c,d,o,E,k,s,l,S,p,h,ie]),ku(()=>{if(s&&!n&&R){var O,F;const L=T==null||(O=T.nodesRef.current.find(X=>X.id===$))==null||(F=O.context)==null?void 0:F.refs.floating.current;L&&!L.contains(l6(IR(L)))&&L.focus({preventScroll:!0})}},[s,n,R,T,$]),ku(()=>{Z.current=null});function C(O){if(J.current=!0,d&&uMe(O.key,S,p)){Au(O),r(!1),QRe(i.domReference.current)&&i.domReference.current.focus();return}const F=N.current,L=xR(o,g),X=p6(o,g);if(O.key==="Home"&&(N.current=L,E(N.current)),O.key==="End"&&(N.current=X,E(N.current)),b>1){const te=N.current;if(O.key===RR){if(Au(O),te===-1)N.current=X;else if(N.current=Mn(o,{startingIndex:te,amount:b,decrement:!0,disabledIndices:g}),f&&(te-b<L||N.current<0)){const xe=te%b,ce=X%b,Ne=X-(ce-xe);ce===xe?N.current=X:N.current=ce>xe?Ne:Ne-b}nm(o,N.current)&&(N.current=te),E(N.current)}if(O.key===Jb&&(Au(O),te===-1?N.current=L:(N.current=Mn(o,{startingIndex:te,amount:b,disabledIndices:g}),f&&te+b>X&&(N.current=Mn(o,{startingIndex:te%b-b,amount:b,disabledIndices:g}))),nm(o,N.current)&&(N.current=te),E(N.current)),S==="both"){const xe=Math.floor(te/b);O.key===tm&&(Au(O),te%b!==b-1?(N.current=Mn(o,{startingIndex:te,disabledIndices:g}),f&&Zb(N.current,b,xe)&&(N.current=Mn(o,{startingIndex:te-te%b-1,disabledIndices:g}))):f&&(N.current=Mn(o,{startingIndex:te-te%b-1,disabledIndices:g})),Zb(N.current,b,xe)&&(N.current=te)),O.key===Pf&&(Au(O),te%b!==0?(N.current=Mn(o,{startingIndex:te,disabledIndices:g,decrement:!0}),f&&Zb(N.current,b,xe)&&(N.current=Mn(o,{startingIndex:te+(b-te%b),decrement:!0,disabledIndices:g}))):f&&(N.current=Mn(o,{startingIndex:te+(b-te%b),decrement:!0,disabledIndices:g})),Zb(N.current,b,xe)&&(N.current=te));const ce=Math.floor(X/b)===xe;nm(o,N.current)&&(f&&ce?N.current=O.key===Pf?X:Mn(o,{startingIndex:te-te%b-1,disabledIndices:g}):N.current=te),E(N.current);return}}if(d6(O.key,S)){if(Au(O),n&&!h&&l6(O.currentTarget.ownerDocument)===O.currentTarget){N.current=MR(O.key,S,p)?L:X,E(N.current);return}MR(O.key,S,p)?f?N.current=F>=X?l&&F!==o.current.length?-1:L:Mn(o,{startingIndex:F,disabledIndices:g}):N.current=Math.min(X,Mn(o,{startingIndex:F,disabledIndices:g})):f?N.current=F<=L?l&&F!==-1?o.current.length:X:Mn(o,{startingIndex:F,decrement:!0,disabledIndices:g}):N.current=Math.max(L,Mn(o,{startingIndex:F,decrement:!0,disabledIndices:g})),nm(o,N.current)?E(null):E(N.current)}}return s?{reference:{...h&&n&&a!=null&&{"aria-activedescendant":we},onKeyDown(O){if(J.current=!0,h&&n)return C(O);if((O.key.indexOf("Arrow")===0||O.key==="Enter"||O.key===" "||O.key==="")&&(Z.current=O.key),d){aMe(O.key,S,p)&&(Au(O),n?(N.current=xR(o,g),E(N.current)):r(!0));return}d6(O.key,S)&&(c!=null&&(N.current=c),Au(O),!n&&_?r(!0):C(O),n&&E(N.current))}},floating:{"aria-orientation":S==="both"?void 0:S,...h&&a!=null&&{"aria-activedescendant":we},onKeyDown:C,onPointerMove(){J.current=!1}},item:{onFocus(O){let{currentTarget:F}=O;const L=o.current.indexOf(F);L!==-1&&E(L)},onClick:O=>{let{currentTarget:F}=O;return F.focus({preventScroll:!0})},...m&&{onMouseMove(O){let{currentTarget:F}=O;const L=F;if(L){const X=o.current.indexOf(L);X!==-1&&E(X)}},onPointerLeave(){if(!J.current&&(N.current=-1,k(o,N),E(null),!h)){var O;(O=i.floating.current)==null||O.focus({preventScroll:!0})}}}}}:{}};function cMe(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:a}=e,u=QOe(n),s=new RegExp(`\\s${u}$`),c=o?"^":"",l=r?new RegExp(`${c}${u}.*?(?=\\s${u}|$)`,"gm"):new RegExp(`${c}(?:^)?${u}[^\\s${u}]*`,"gm"),f=((t=a.nodeBefore)===null||t===void 0?void 0:t.isText)&&a.nodeBefore.text;if(!f)return null;const d=a.pos-f.length,p=Array.from(f.matchAll(l)).pop();if(!p||p.input===void 0||p.index===void 0)return null;const h=p.input.slice(Math.max(0,p.index-1),p.index),v=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(h);if(i!==null&&!v)return null;const m=d+p.index;let _=m+p[0].length;return r&&s.test(f.slice(_-1,_+1))&&(p[0]+=" ",_+=1),m<a.pos&&_>=a.pos?{range:{from:m,to:_},query:p[0].slice(n.length),text:p[0]}:null}const lMe=new vu("suggestion");function fMe({pluginKey:e=lMe,editor:t,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:a="span",decorationClass:u="suggestion",command:s=()=>null,items:c=()=>[],render:l=()=>({}),allow:f=()=>!0}){let d;const p=l==null?void 0:l(),h=new Gr({key:e,view(){return{update:async(v,m)=>{var _,g,S,b,$,T,R;const E=(_=this.key)===null||_===void 0?void 0:_.getState(m),q=(g=this.key)===null||g===void 0?void 0:g.getState(v.state),Y=E.active&&q.active&&E.range.from!==q.range.from,N=!E.active&&q.active,Z=E.active&&!q.active,ie=!N&&!Z&&E.query!==q.query,J=N||Y,ye=ie&&!Y,we=Z||Y;if(!J&&!ye&&!we)return;const x=we&&!J?E:q,k=v.dom.querySelector(`[data-decoration-id="${x.decorationId}"]`);d={editor:t,range:x.range,query:x.query,text:x.text,items:[],command:C=>{s({editor:t,range:x.range,props:C})},decorationNode:k,clientRect:k?()=>{var C;const{decorationId:O}=(C=this.key)===null||C===void 0?void 0:C.getState(t.state),F=v.dom.querySelector(`[data-decoration-id="${O}"]`);return(F==null?void 0:F.getBoundingClientRect())||null}:null},J&&((S=p==null?void 0:p.onBeforeStart)===null||S===void 0||S.call(p,d)),ye&&((b=p==null?void 0:p.onBeforeUpdate)===null||b===void 0||b.call(p,d)),(ye||J)&&(d.items=await c({editor:t,query:x.query})),we&&(($=p==null?void 0:p.onExit)===null||$===void 0||$.call(p,d)),ye&&((T=p==null?void 0:p.onUpdate)===null||T===void 0||T.call(p,d)),J&&((R=p==null?void 0:p.onStart)===null||R===void 0||R.call(p,d))},destroy:()=>{var v;d&&((v=p==null?void 0:p.onExit)===null||v===void 0||v.call(p,d))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(v,m,_,g){const{isEditable:S}=t,{composing:b}=t.view,{selection:$}=v,{empty:T,from:R}=$,E={...m};if(E.composing=b,S&&(T||t.view.composing)){(R<m.range.from||R>m.range.to)&&!b&&!m.composing&&(E.active=!1);const q=cMe({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:$.$from}),Y=`id_${Math.floor(Math.random()*4294967295)}`;q&&f({editor:t,state:g,range:q.range})?(E.active=!0,E.decorationId=m.decorationId?m.decorationId:Y,E.range=q.range,E.query=q.query,E.text=q.text):E.active=!1}else E.active=!1;return E.active||(E.decorationId=null,E.range={from:0,to:0},E.query=null,E.text=null),E}},props:{handleKeyDown(v,m){var _;const{active:g,range:S}=h.getState(v.state);return g&&((_=p==null?void 0:p.onKeyDown)===null||_===void 0?void 0:_.call(p,{view:v,event:m,range:S}))||!1},decorations(v){const{active:m,range:_,decorationId:g}=h.getState(v);return m?Dt.create(v.doc,[Cr.inline(_.from,_.to,{nodeName:a,class:u,"data-decoration-id":g})]):null}}});return h}function h6(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=h6(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function dMe(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=h6(e))&&(r&&(r+=" "),r+=t);return r}const pMe=Jr.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",bn(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),_o={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"},Qb=()=>(++Qb.i).toString();Qb.i=0;const hMe=e=>{const t=mMe(e),n=[];for(let r=0;r<t.length;r++)n.push(m6(t[r]));return{key:Qb(),children:n}},rm=(e,t=[])=>({key:Qb(),type:e.type,text:"text"in e?e.text:void 0,node:e,children:t}),kR=e=>rm({type:_o.span,text:e,spans:[]}),mMe=e=>{const t=e.slice(0);for(let n=0;n<t.length;n++){const r=t[n];if(r.type===_o.listItem||r.type===_o.oListItem){const i=[r];for(;t[n+1]&&t[n+1].type===r.type;)i.push(t[n+1]),t.splice(n,1);r.type===_o.listItem?t[n]={type:_o.list,items:i}:t[n]={type:_o.oList,items:i}}}return t},m6=e=>{if("text"in e)return rm(e,v6(e.spans,e));if("items"in e){const t=[];for(let n=0;n<e.items.length;n++)t.push(m6(e.items[n]));return rm(e,t)}return rm(e)},v6=(e,t,n)=>{if(!e.length)return[kR(t.text)];const r=e.slice(0);r.sort((o,a)=>o.start-a.start||a.end-o.end);const i=[];for(let o=0;o<r.length;o++){const a=r[o],u=n&&n.start||0,s=a.start-u,c=a.end-u,l=t.text.slice(s,c),f=[];for(let p=o;p<r.length;p++){const h=r[p];h!==a&&h.start>=a.start&&h.end<=a.end&&(f.push(h),r.splice(p,1),p--)}o===0&&s>0&&i.push(kR(t.text.slice(0,s)));const d={...a,text:l};i.push(rm(d,v6(f,{...t,text:l},a))),c<t.text.length&&i.push(kR(t.text.slice(c,r[o+1]?r[o+1].start-u:void 0)))}return i},vMe=(e,t)=>g6(hMe(e).children,t),g6=(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const i=e[r],o=t(i.type,i.node,i.text,g6(i.children,t),i.key);o!=null&&n.push(o)}return n};_o.listItem+"",_o.oListItem+"",_o.list+"",_o.oList+"";const gMe=Jr.create({name:"text",group:"inline"}),yMe={groupBy(e,t){return e.reduce((n,r)=>{const i=t(r),o=(n.get(i)||[]).concat(r);return n.set(i,o)},new Map)},sort(e){return[...e].sort((t,n)=>t.start-n.start)},mergeOverlap(e){const t=this.groupBy(e,r=>r.type),n=Array.from(t.entries()).map(([r,i])=>(this.sort(i).reduce((o,a)=>{if(!o.length)return[a];const u=o.length-1,s=o[u];return s.end>=a.start?[...o.slice(0,u),{...s,end:a.end}]:[...o,a]},[]),i)).reduce((r,i)=>[...r,...i],[]);return this.sort(n)}},y6={fromPrismic(e){return t=>{var n;return(n=PR.find(r=>r.richTextNodeTypes[0]===t.type))==null?void 0:n.converter.fromPrismic(e)(t)}},toPrismic(e,t,n){const[r,i]=(()=>{const o=PR.find(a=>e.type.name===a.name);if(!o)throw new Error(`Invalid mark extension '${e.type.name}'.`);return[o.richTextNodeTypes[0],o.converter.toPrismic(e)]})();return{type:r,start:t,end:n,...i?{data:i}:{}}}},b6=gMe.extend({name:"text"}),bMe={fromPrismic(e){return function(t,n,r=!1){const i={type:t,text:n.content.text,spans:n.content.spans||[]};return vMe([i],_Me(e,r))[0]}},toPrismic(e,t,n){const r=gc.children.reduce(e,(i,o)=>{const a=(()=>o.type.name===Db.name?Db.converter.toPrismic(o):o.textContent)(),u=a?i.text+a:i.text,s=i.text.length,c=u.length,l=(()=>o.marks.length?gc.marks.map(o,d=>y6.toPrismic(d,s,c)):void 0)();return{...i,text:u,spans:l?[...i.spans,...l]:i.spans}},{text:"",spans:[]});return{type:t,content:{text:r.text,spans:[...yMe.mergeOverlap(r.spans)].sort((i,o)=>i.type.localeCompare(o.type))},...n}}};function _Me(e,t=!1){return(n,r,i,o)=>{if(n==="span"&&i&&i.length)return t?[e.text(i)]:Db.splitTextToNodes(e,i)(a=>e.text(a));{const a=y6.fromPrismic(e)(r);return a?S$(o).map(s=>s.mark([...s.marks,a].sort((c,l)=>c.type.name.localeCompare(l.type.name)))):S$(o)}}}const _c={name:b6.name,component:b6,converter:bMe};var _6=(e=>(e.LeftToRight="ltr",e.RightToLeft="rtl",e))(_6||{});const Sc="text-direction",SMe=Ve.RichTextNodeType.rtl,$Me=Er.create({name:"textDirection",addOptions(){return{supportedExtensionNames:[]}},addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{[Sc]:{default:"ltr",parseHTML:e=>e.attributes.dir?"rtl":"ltr",renderHTML:e=>e[Sc]==="rtl"?{dir:"rtl"}:{dir:"ltr"}}}}]},addCommands(){return{setDirection:e=>({commands:t})=>{switch(e){case"rtl":return t.setRightToLeft();default:return t.setLeftToRight()}},toggleDirection:e=>({commands:t})=>{const n=e==="rtl"?"ltr":"rtl";return t.setDirection(n)},setRightToLeft:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.updateAttributes(t,{[Sc]:"rtl"})),setLeftToRight:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.resetAttributes(t,Sc))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),Ta={parseNodeAttrsDirection(e){switch(e[Sc]){case"rtl":return"rtl";default:return"ltr"}},fromPrismic(e){const t=(()=>{switch(e.direction){case"rtl":return"rtl";default:return"ltr"}})();return{[Sc]:t}},toPrismic(e){return{direction:this.parseNodeAttrsDirection(e.attrs)}}},e_=pMe.extend({name:"paragraph",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",bn(this.options.HTMLAttributes,e),0]}}),TMe={fromPrismic(e){return function(t){var r;const n=_c.converter.fromPrismic(e)(e_.name,t);return(r=e.nodes[e_.name])==null?void 0:r.create(Ta.fromPrismic(t),n)}},toPrismic(e){return _c.converter.toPrismic(e,Ve.RichTextNodeType.paragraph,Ta.toPrismic(e))}},Nu=new Af([Ve.RichTextNodeType.paragraph],e_.name,e_,TMe,"Type '/' for commands"),S6=["ArrowDown","ArrowUp","End","Home"],$6=["Enter"],IMe=["Escape",...S6,...$6],OMe=Er.create({name:"slash-commands",addOptions(){return{nodeTypes:[]}},addProseMirrorPlugins(){const e=o_(E6,this.options.nodeTypes);return e.length>1?[fMe({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow:({state:t})=>{const n=t.selection.$from;return n.parent.type.name===Nu.name&&n.depth===1},command:({editor:t,props:n,range:r})=>{n.runCommands(t,{deleteRange:r})},items:({query:t})=>{const n=t.toLocaleLowerCase().trim();return e.filter(r=>{var i,o;return((i=r.shortText)==null?void 0:i.toLocaleLowerCase().includes(n))||((o=r.text)==null?void 0:o.toLocaleLowerCase().includes(n))})},render:()=>{let t;return{onStart:n=>{t=new KEe(wMe,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate:n=>{t==null||t.updateProps(n)},onKeyDown:({event:n})=>{var r;return IMe.includes(n.key)&&((r=t==null?void 0:t.ref)==null?void 0:r.handleKeyDown(n))},onExit:()=>{t==null||t.destroy(),t==null||t.element.remove()}}}})]:[]}}),wMe=U.forwardRef(function({command:t,decorationNode:n,editor:r,items:i},o){const[a,u]=U.useState(!0),s=parseFloat(M.tokens.space[0]),{context:c,floating:l,reference:f,strategy:d,x:p,y:h}=eMe({middleware:[xRe(s),RRe(),kRe({limiter:ARe()})],onOpenChange:u,open:a,placement:"top-start",strategy:"fixed",whileElementsMounted:KRe});U.useLayoutEffect(()=>{f(n)},[f,n]),U.useEffect(()=>{let N;const Z=()=>{N=window.setTimeout(()=>{u(!0)})},ie=()=>{u(!1)};return r.on("focus",Z).on("blur",ie),()=>{r.off("focus",Z).off("blur",ie),clearTimeout(N)}},[r]);const[v,m]=U.useState(0),_=U.useRef([]),[g,S]=U.useState();i!==g&&(m(0),_.current=[],S(i));const{getFloatingProps:b,getItemProps:$,getReferenceProps:T}=tMe([oMe(c,{outsidePointerDown:!1}),sMe(c,{activeIndex:v,listRef:_,onNavigate:N=>{m(Z=>N??Z)},openOnArrowKeyDown:!1,virtual:!0}),iMe(c,{role:"menu"})]),E=T().onKeyDown;U.useImperativeHandle(o,()=>({handleKeyDown:N=>{if(a){if(S6.includes(N.key)&&E(N),$6.includes(N.key)){const Z=i[v];Z!==void 0&&t(Z)}return!0}else return!1}}),[v,t,i,E,a]);const q=p!==null&&h!==null,Y=U.useId();return a?I.jsxs("div",{...b(),className:M.dropdownMenuStyles.content,ref:l,style:{top:parseFloat(M.tokens.space[0]),left:parseFloat(M.tokens.space[0]),minWidth:256,position:d,transform:q?`translate3d(${Math.round(p)}px, ${Math.round(h)}px, 0)`:"translate3d(0, -200%, 0)"},children:[i.map((N,Z)=>U.createElement(T6,{...$({onClick:()=>{t(N)},onPointerDown:ie=>{ie.preventDefault()}}),"data-highlighted":Z===v?"":void 0,id:`${Y}[${Z}]`,key:N.nodeType,ref:ie=>{_.current[Z]=ie},shortcut:`/${N.shortText??""}`,startIcon:N.icon},N.text)),i.length===0?I.jsx(T6,{...$({onPointerDown:N=>{N.preventDefault()}}),disabled:!0,id:`${Y}[0]`,ref:N=>{_.current[0]=N},children:"No results"}):null]}):null}),T6=U.forwardRef(function({children:t,disabled:n,shortcut:r,startIcon:i,...o},a){return I.jsxs("div",{...o,...n?{"aria-disabled":!0,"data-disabled":!0}:{},className:M.dropdownMenuStyles.item,ref:a,role:"menuitem",children:[U.isValidElement(i)?U.cloneElement(i,{className:dMe(i.props.className,M.dropdownMenuStyles.itemStartIcon)}):null,I.jsx(M.Text,{className:M.dropdownMenuStyles.itemText,component:"span",children:t}),r?I.jsx(M.Text,{className:M.dropdownMenuStyles.itemShortcut,color:"inherit",component:"span",variant:"inherit",children:r}):null]})});function CMe(e,t){var o;const n=t.map(a=>a.richTextNodeTypes).flat(),r=y(t,li(a=>a.nodeType===kf.Text),cv({},(a,u)=>({...a,[u.name]:u.placeholder}))),i=n.includes(Ve.RichTextNodeType.orderedList)||n.includes(Ve.RichTextNodeType.list);return li(a=>a!==void 0)([mR.component(((o=e.config)==null?void 0:o.single)===void 0),_c.component,Db.component,gRe(r),i?Nf.component:void 0,OMe.configure({nodeTypes:n})])}const AR=uRe.extend({name:"bulletList",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",bn(this.options.HTMLAttributes,e),0]}}).configure({itemTypeName:"listItem"}),EMe={fromPrismic(e){return function(t){var r;const n=Nf.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[AR.name])==null?void 0:r.create(Ta.fromPrismic(t),n)}},toPrismic(e){return GS(gc.children.map(e,t=>li(n=>n!==void 0)(Nf.converter.toPrismic(t,Ve.RichTextNodeType.list))))}},t_=new dR([Ve.RichTextNodeType.list],AR.name,AR,EMe),RMe=/^```([a-z]+)?[\s\n]$/,MMe=/^~~~([a-z]+)?[\s\n]$/,n_=Jr.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,o=[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(a=>a.startsWith(n)).map(a=>a.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",bn(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`
|
|
143
|
+
`}}function u(v){return n.exact(n.intersection([n.type({id:n.string,label:i.StringOrNull,repeatable:(0,r.withFallback)(n.boolean,!0),json:n.record(n.string,v),status:(0,r.withFallback)(n.boolean,!0)}),n.partial({hash:n.string})]))}_n.StaticCustomType=u(o.StaticSection),_n.CustomType=u(o.DynamicSection);function s(v){return Object.entries(v.json).reduce((m,[,_])=>{const g=Object.entries(_);return m.concat(g)},[])}_n.flattenWidgets=s;function c(v){return s(v).filter(([,g])=>g.type==="Slices").reduce((g,[,S])=>{const b=Object.entries(S.config&&S.config.choices?S.config.choices:{}).filter(([,$])=>$.type==="SharedSlice").map(([$])=>$);return g.concat(b)},[])}function l(v){const m=c(v);return function(_){return m.map(_)}}function f(v,m){const _=Object.entries(v.json).reduce((g,[S,b])=>({...g,[S]:o.Sections.toStatic(b,m)}),{});return{...v,json:_}}_n.toStatic=f;function d(v,m){const _=l(v)(g=>{if(!m.get(g))return g}).filter(Boolean);return _.length>0?(0,t.left)(new a(_)):(0,t.right)(v)}_n.validateSlices=d;function p(v,m){const _=Object.entries(v.json).reduce((g,[S,b])=>{const $=Object.entries(b).reduce((T,[M,R])=>{const q=m(M,R);return q?{...T,[M]:q}:T},{});return{...g,[S]:$}},{});return{...v,json:_}}_n.collectWidgets=p;function h(v,m){return p(v,(_,g)=>{if(g.type==="Slices"){if(!g.config||!g.config.choices)return g;const S=Object.entries(g.config.choices).reduce(($,[T,M])=>M.type==="SharedSlice"&&!m.get(T)?$:{...$,[T]:M},{}),b={...g.config,choices:S};return{...g,config:b}}return g})}return _n.filterMissingSharedSlices=h,_n}var sR={},cR={},CH;function lR(){return CH||(CH=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiffOperation=void 0,function(t){t.Added="added",t.Removed="removed",t.Updated="updated"}(e.DiffOperation||(e.DiffOperation={}))}(cR)),cR}var Yh={},vc={},Jh={},EH;function XEe(){if(EH)return Jh;EH=1,Object.defineProperty(Jh,"__esModule",{value:!0}),Jh.toRecord=void 0;function e(t,n){return t.reduce((r,i)=>{const o=n(i);return{...r,[o]:i}},{})}return Jh.toRecord=e,Jh}var RH;function MH(){if(RH)return vc;RH=1,Object.defineProperty(vc,"__esModule",{value:!0}),vc.Objects=vc.Arrays=void 0;const e=H;return vc.Arrays=e.__importStar(XEe()),vc.Objects=e.__importStar(gK()),vc}var Zh={},xH;function kH(){if(xH)return Zh;xH=1,Object.defineProperty(Zh,"__esModule",{value:!0}),Zh.VariationComparator=void 0;const e=MH(),t=lR();function n(i,o){const a=e.Objects.zipObjects(i,o);return Object.entries(a).reduce((u,[s,c])=>s==="primary"||s==="items"||(c==null?void 0:c.left)===(c==null?void 0:c.right)?u:{...u,[s]:c==null?void 0:c.right},{})}function r(i,o){const a=e.Objects.zipObjects(i,o),u=Object.entries(a).reduce((s,[c,l])=>{if(JSON.stringify(l==null?void 0:l.left)===JSON.stringify(l==null?void 0:l.right))return s;const f=(()=>{if(!(!(l!=null&&l.left)&&!(l!=null&&l.right)))return l!=null&&l.left&&!l.right?{op:t.DiffOperation.Removed}:!(l!=null&&l.left)&&(l!=null&&l.right)?{op:t.DiffOperation.Added,value:l.right}:{op:t.DiffOperation.Updated,value:l.right}})();return f?{...s,[c]:f}:s},{});return e.Objects.isNotEmpty(u)?u:void 0}return Zh.VariationComparator={compare(i,o){if(i&&!o)return{op:t.DiffOperation.Removed};if(!i&&o)return{op:t.DiffOperation.Added,value:o};const a=n(i,o),u=r(i==null?void 0:i.primary,o==null?void 0:o.primary),s=r(i==null?void 0:i.items,o==null?void 0:o.items),c={...a,...u?{primary:u}:{},...s?{items:s}:{}};if(e.Objects.isNotEmpty(c))return{op:t.DiffOperation.Updated,value:c}}},Zh}var AH;function QEe(){if(AH)return Yh;AH=1,Object.defineProperty(Yh,"__esModule",{value:!0}),Yh.SliceComparator=void 0;const e=MH(),t=lR(),n=kH();function r(i,o){const a=e.Objects.zipObjects(i,o);return Object.entries(a).reduce((u,[s,c])=>s==="variations"||(c==null?void 0:c.left)===(c==null?void 0:c.right)?u:{...u,[s]:c==null?void 0:c.right},{})}return Yh.SliceComparator={compare(i,o){if(!i&&o)return{op:t.DiffOperation.Added,value:o};if(i&&!o)return{op:t.DiffOperation.Removed};const a=r(i,o),u=e.Objects.zipObjects(i&&e.Arrays.toRecord(i.variations,l=>l.id),o&&e.Arrays.toRecord(o.variations,l=>l.id)),s=Object.entries(u).reduce((l,[f,d])=>{if(!d)return l;const p=n.VariationComparator.compare(d.left,d.right);return p?{...l,[f]:p}:l},{}),c={...a,...e.Objects.isNotEmpty(s)?{variations:s}:{}};if(e.Objects.isNotEmpty(c))return{op:t.DiffOperation.Updated,value:c}}},Yh}var NH;function eRe(){return NH||(NH=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(lR(),e),t.__exportStar(QEe(),e),t.__exportStar(kH(),e)}(sR)),sR}(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(ZEe(),e),t.__exportStar(eRe(),e),t.__exportStar(OH(),e),t.__exportStar(ua(),e)})(Ve);const tRe=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,nRe=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,rRe=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,iRe=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,oRe=BE.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",bn(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Eb({find:tRe,type:this.type}),Eb({find:rRe,type:this.type})]},addPasteRules(){return[Rb({find:nRe,type:this.type}),Rb({find:iRe,type:this.type})]}});var fR=(e=>(e.Document="document",e.Mark="mark",e.Node="node",e))(fR||{}),kf=(e=>(e.Text="text",e.Embed="embed",e.Image="image",e))(kf||{});class aRe{constructor(t,n,r){Bf(this,"extType","document");this.name=t,this.component=n,this.converter=r}}class FH{constructor(t,n,r,i){Bf(this,"extType","mark");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}class Af{constructor(t,n,r,i,o,a=!1){Bf(this,"extType","node");Bf(this,"nodeType","text");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a}}class uRe extends Af{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class dR extends Af{constructor(t,n,r,i){super(t,n,r,i)}}const pR=oRe.extend({name:"bold"}),sRe={fromPrismic(e){return function(){var t;return(t=e.marks[pR.name])==null?void 0:t.create()}},toPrismic(){}},PH=new FH([Ve.RichTextNodeType.strong],pR.name,pR,sRe),cRe=/^\s*([-+*])\s$/,lRe=Jr.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",bn(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[I5({find:cRe,type:this.type})]}}),WH=Jr.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",bn(this.options.HTMLAttributes,e)]},renderText(){return`
|
|
144
|
+
`},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:u}=r.extensionManager,s=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:l})=>{if(l&&s&&a){const f=s.filter(d=>u.includes(d.type.name));c.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),gc={isHardBreak(e){return e.type.name===WH.name},children:{reduce(e,t,n){let r=n;return e.forEach((i,o,a)=>{r=t(r,i,a)}),r},map(e,t){return this.reduce(e,(n,r)=>[...n,t(r)],[])},exists(e,t){return this.reduce(e,(n,r)=>n||t(r),!1)},filter(e,t){return this.reduce(e,(n,r)=>[...n,...t(r)?[r]:[]],[])}},marks:{reduce(e,t,n){let r=n;return e.marks.forEach((i,o)=>{r=t(r,i,o)}),r},map(e,t){return this.reduce(e,(n,r)=>[...n,t(r)],[])},filter(e,t){return this.reduce(e,(n,r)=>[...n,...t(r)?[r]:[]],[])}}};function fRe(e){if(!e||!e.size)return{defaultTextConverter:void 0,extensions:C6()};const t=C6(e),n=Array.from(e.values()),r=(()=>{const a=li(c=>n.some(l=>c.richTextNodeTypes.includes(l)))(t),u=a.some(c=>c instanceof dR)?[Fu,...a]:a;return u.some(c=>c instanceof Af)?u:[w6,...u]})(),i=r.find(a=>a instanceof Af)||w6;function o(a){return u=>i.converter.fromPrismic(a)({...u,type:i.richTextNodeTypes[0]})}return{defaultTextConverter:o,extensions:r}}function dRe(e){if(!(e!=null&&e.single)&&!(e!=null&&e.multi))return;const t=y((e.single||e.multi||"").split(/\s*,\s*/),uv(n=>p0(()=>{})(Ve.RichTextNodeTypeCodec.decode(n))),li(ga));return new Set(t)}function pRe(e){const t=dRe(e);return fRe(t)}const hRe=Jr.create({name:"doc",topNode:!0,content:"block+"}),jH=Jr.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",bn(this.options.HTMLAttributes,e),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)}}}).extend({name:"listItem",content:"paragraph*",addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name)}}}),Nf={component:jH,converter:{fromPrismic(e){return function(t){var r;const n=Fu.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[jH.name])==null?void 0:r.create({},n)}},toPrismic(e,t){return gc.children.reduce(e,(n,r)=>{const i=Fu.converter.toPrismic(r),o=(()=>i instanceof Array?i.map(a=>({...a,type:t})):i?[{...i,type:t}]:[])();return[...n,...o]},[])}},placeholder:"List"};function mRe(e){return e.slice(1,e.length).reduce((t,n)=>t.copy(t.content.append(n.content)),e[0])}const hR="document",vRe=e=>hRe.extend({name:hR,content:e?"block+":"block"}),gRe=e=>({fromPrismic(t,n){function r(i){return function(o=void 0){return!o&&n&&ot.TextBlock.is(i)?n(i):o}}return function(i){var a;const o=i.value.reduce((u,s)=>{const c=e.find(h=>h.richTextNodeTypes.includes(s.type)),l=(()=>{if(c)switch(c.nodeType){case kf.Embed:return ot.EmbedBlock.is(s)&&c.converter.fromPrismic(t)(s);case kf.Text:return ot.TextBlock.is(s)&&c.converter.fromPrismic(t)(s);case kf.Image:return ot.ImageBlock.is(s)&&c.converter.fromPrismic(t)(s);default:return}})(),[f,d]=y(u,jS(u.length-1),([h,v])=>[h,WS(v)]),p=(()=>l?y(d,ko(()=>({merged:!1,node:l}),h=>l.type.name===h.type.name&&(l.type.name===t_.name||l.type.name===i_.name)?{merged:!0,node:mRe([h,l])}:{merged:!1,node:l}),({merged:h,node:v})=>({merged:h,node:r(s)(v)})):{merged:!1,node:r(s)()})();return p.node?[...p.merged?f:u,p.node]:u},[]);return(a=t.nodes[hR])==null?void 0:a.create({},o)}},toPrismic(t){return{__TYPE__:"StructuredTextContent",value:[...gc.children.reduce(t,(r,i)=>{const o=Object.values(e).find(u=>i.type.name===u.name),a=o==null?void 0:o.converter.toPrismic(i);return a||console.warn(`Cannot convert node of type '${i.type.name}'.`),a?[...r,...a instanceof Array?a:[a]]:r},[])]}}}),mR=new aRe(hR,vRe,gRe),jb=WH.extend({name:"hard_break"}),Lb=`
|
|
145
|
+
`,LH={fromPrismic(e){return function(t){var n;if(t===Lb)return(n=e.nodes[jb.name])==null?void 0:n.create({})}},toPrismic(e){if(e.type.name===jb.name)return Lb}},vR={isEmptyLine(e){return e.length===0},isFirst(e){return e===0}};function yRe(e,t){return function(n){const r=LH.fromPrismic(e)(Lb);if(!r)return[n(t)];const i=t.split(Lb);return i.length===1?t.length?[n(t)]:[r]:i.reduce((o,a,u)=>vR.isFirst(u)?vR.isEmptyLine(a)?o:[...o,n(a)]:vR.isEmptyLine(a)?[...o,r]:[...o,r,n(a)],[])}}const Db={name:jb.name,component:jb,converter:LH,splitTextToNodes:yRe},bRe=Rr.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Gr({props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];if(!n)return null;const o=e.type.createAndFill(),a=(o==null?void 0:o.sameMarkup(e))&&o.content.findDiffStart(e.content)===null;return e.descendants((u,s)=>{const c=r>=s&&r<=s+u.nodeSize,l=!u.isLeaf&&!u.childCount;if((c||!this.options.showOnlyCurrent)&&l){const f=[this.options.emptyNodeClass];a&&f.push(this.options.emptyEditorClass);const d=Er.node(s,s+u.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:u,pos:s,hasAnchor:c}):this.options.placeholder});i.push(d)}return this.options.includeChildren}),Dt.create(e,i)}}})]}}),_Re=e=>bRe.configure({includeChildren:!0,placeholder:({editor:t,hasAnchor:n,node:r})=>{const i=!gc.children.exists(t.state.doc,u=>u===r),o=(()=>{const u=t.isEditable,s=t.isFocused&&n,c=r.type.name!==Fu.name;return u&&(s||c||i)})(),a=(()=>{if(i)return Nf.placeholder;const u=e[r.type.name];return typeof u=="string"?u:u==null?void 0:u(r.attrs)})();return o&&a||""},showOnlyCurrent:!1,showOnlyWhenEditable:!1});function qb(e){return e.split("-")[1]}function DH(e){return e==="y"?"height":"width"}function Mu(e){return e.split("-")[0]}function Xh(e){return["top","bottom"].includes(Mu(e))?"x":"y"}function qH(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,u=Xh(t),s=DH(u),c=r[s]/2-i[s]/2,l=Mu(t),f=u==="x";let d;switch(l){case"top":d={x:o,y:r.y-i.height};break;case"bottom":d={x:o,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:a};break;case"left":d={x:r.x-i.width,y:a};break;default:d={x:r.x,y:r.y}}switch(qb(t)){case"start":d[u]-=c*(n&&f?-1:1);break;case"end":d[u]+=c*(n&&f?-1:1);break}return d}const SRe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,u=o.filter(Boolean),s=await(a.isRTL==null?void 0:a.isRTL(t));if(process.env.NODE_ENV!=="production"){if(a==null&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),u.filter(v=>{let{name:m}=v;return m==="autoPlacement"||m==="flip"}).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));(!e||!t)&&console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "))}let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:f}=qH(c,r,s),d=r,p={},h=0;for(let v=0;v<u.length;v++){const{name:m,fn:_}=u[v],{x:g,y:S,data:b,reset:$}=await _({x:l,y:f,initialPlacement:r,placement:d,strategy:i,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});if(l=g??l,f=S??f,p={...p,[m]:{...p[m],...b}},process.env.NODE_ENV!=="production"&&h>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),$&&h<=50){h++,typeof $=="object"&&($.placement&&(d=$.placement),$.rects&&(c=$.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):$.rects),{x:l,y:f}=qH(c,d,s)),v=-1;continue}}return{x:l,y:f,placement:d,strategy:i,middlewareData:p}};function $Re(e){return{top:0,right:0,bottom:0,left:0,...e}}function TRe(e){return typeof e!="number"?$Re(e):{top:e,right:e,bottom:e,left:e}}function gR(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function UH(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:u,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:l="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=t,h=TRe(p),m=u[d?f==="floating"?"reference":"floating":f],_=gR(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(m)))==null||n?m:m.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:c,rootBoundary:l,strategy:s})),g=f==="floating"?{...a.floating,x:r,y:i}:a.reference,S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),b=await(o.isElement==null?void 0:o.isElement(S))?await(o.getScale==null?void 0:o.getScale(S))||{x:1,y:1}:{x:1,y:1},$=gR(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:g,offsetParent:S,strategy:s}):g);return process.env.NODE_ENV,{top:(_.top-$.top+h.top)/b.y,bottom:($.bottom-_.bottom+h.bottom)/b.y,left:(_.left-$.left+h.left)/b.x,right:($.right-_.right+h.right)/b.x}}const IRe=Math.min,ORe=Math.max;function BH(e,t,n){return ORe(e,IRe(t,n))}const wRe={left:"right",right:"left",bottom:"top",top:"bottom"};function Ub(e){return e.replace(/left|right|bottom|top/g,t=>wRe[t])}function CRe(e,t,n){n===void 0&&(n=!1);const r=qb(e),i=Xh(e),o=DH(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Ub(a)),{main:a,cross:Ub(a)}}const ERe={start:"end",end:"start"};function yR(e){return e.replace(/start|end/g,t=>ERe[t])}function RRe(e){const t=Ub(e);return[yR(e),t,yR(t)]}function MRe(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:a;default:return[]}}function xRe(e,t,n,r){const i=qb(e);let o=MRe(Mu(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(yR)))),o}const kRe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:u,elements:s}=t,{mainAxis:c=!0,crossAxis:l=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...v}=e,m=Mu(r),_=Mu(a)===a,g=await(u.isRTL==null?void 0:u.isRTL(s.floating)),S=f||(_||!h?[Ub(a)]:RRe(a));!f&&p!=="none"&&S.push(...xRe(a,h,p,g));const b=[a,...S],$=await UH(t,v),T=[];let M=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&T.push($[m]),l){const{main:N,cross:Z}=CRe(r,o,g);T.push($[N],$[Z])}if(M=[...M,{placement:r,overflows:T}],!T.every(N=>N<=0)){var R,q;const N=(((R=i.flip)==null?void 0:R.index)||0)+1,Z=b[N];if(Z)return{data:{index:N,overflows:M},reset:{placement:Z}};let ie=(q=M.filter(J=>J.overflows[0]<=0).sort((J,ye)=>J.overflows[1]-ye.overflows[1])[0])==null?void 0:q.placement;if(!ie)switch(d){case"bestFit":{var Y;const J=(Y=M.map(ye=>[ye.placement,ye.overflows.filter(we=>we>0).reduce((we,x)=>we+x,0)]).sort((ye,we)=>ye[1]-we[1])[0])==null?void 0:Y[0];J&&(ie=J);break}case"initialPlacement":ie=a;break}if(r!==ie)return{reset:{placement:ie}}}return{}}}};async function ARe(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Mu(n),u=qb(n),s=Xh(n)==="x",c=["left","top"].includes(a)?-1:1,l=o&&s?-1:1,f=typeof t=="function"?t(e):t;let{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return u&&typeof h=="number"&&(p=u==="end"?h*-1:h),s?{x:p*l,y:d*c}:{x:d*c,y:p*l}}const NRe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await ARe(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function zH(e){return e==="x"?"y":"x"}const FRe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:u={fn:m=>{let{x:_,y:g}=m;return{x:_,y:g}}},...s}=e,c={x:n,y:r},l=await UH(t,s),f=Xh(Mu(i)),d=zH(f);let p=c[f],h=c[d];if(o){const m=f==="y"?"top":"left",_=f==="y"?"bottom":"right",g=p+l[m],S=p-l[_];p=BH(g,p,S)}if(a){const m=d==="y"?"top":"left",_=d==="y"?"bottom":"right",g=h+l[m],S=h-l[_];h=BH(g,h,S)}const v=u.fn({...t,[f]:p,[d]:h});return{...v,data:{x:v.x-n,y:v.y-r}}}}},PRe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:u=0,mainAxis:s=!0,crossAxis:c=!0}=e,l={x:n,y:r},f=Xh(i),d=zH(f);let p=l[f],h=l[d];const v=typeof u=="function"?u(t):u,m=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(s){const S=f==="y"?"height":"width",b=o.reference[f]-o.floating[S]+m.mainAxis,$=o.reference[f]+o.reference[S]-m.mainAxis;p<b?p=b:p>$&&(p=$)}if(c){var _,g;const S=f==="y"?"width":"height",b=["top","left"].includes(Mu(i)),$=o.reference[d]-o.floating[S]+(b&&((_=a.offset)==null?void 0:_[d])||0)+(b?0:m.crossAxis),T=o.reference[d]+o.reference[S]+(b?0:((g=a.offset)==null?void 0:g[d])||0)-(b?m.crossAxis:0);h<$?h=$:h>T&&(h=T)}return{[f]:p,[d]:h}}}};function kr(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yo(e){return kr(e).getComputedStyle(e)}const KH=Math.min,Qh=Math.max,Bb=Math.round;function VH(e){const t=yo(e);let n=parseFloat(t.width),r=parseFloat(t.height);const i=e.offsetWidth,o=e.offsetHeight,a=Bb(n)!==i||Bb(r)!==o;return a&&(n=i,r=o),{width:n,height:r,fallback:a}}function xu(e){return GH(e)?(e.nodeName||"").toLowerCase():""}let zb;function HH(){if(zb)return zb;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(zb=e.brands.map(t=>t.brand+"/"+t.version).join(" "),zb):navigator.userAgent}function bo(e){return e instanceof kr(e).HTMLElement}function Li(e){return e instanceof kr(e).Element}function GH(e){return e instanceof kr(e).Node}function YH(e){if(typeof ShadowRoot>"u")return!1;const t=kr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Kb(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=yo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function WRe(e){return["table","td","th"].includes(xu(e))}function bR(e){const t=/firefox/i.test(HH()),n=yo(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||(r?r!=="none":!1)||t&&n.willChange==="filter"||t&&(n.filter?n.filter!=="none":!1)||["transform","perspective"].some(i=>n.willChange.includes(i))||["paint","layout","strict","content"].some(i=>{const o=n.contain;return o!=null?o.includes(i):!1})}function _R(){return/^((?!chrome|android).)*safari/i.test(HH())}function SR(e){return["html","body","#document"].includes(xu(e))}function JH(e){return Li(e)?e:e.contextElement}const ZH={x:1,y:1};function Ff(e){const t=JH(e);if(!bo(t))return ZH;const n=t.getBoundingClientRect(),{width:r,height:i,fallback:o}=VH(t);let a=(o?Bb(n.width):n.width)/r,u=(o?Bb(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}function yc(e,t,n,r){var i,o;t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),u=JH(e);let s=ZH;t&&(r?Li(r)&&(s=Ff(r)):s=Ff(e));const c=u?kr(u):window,l=_R()&&n;let f=(a.left+(l&&((i=c.visualViewport)==null?void 0:i.offsetLeft)||0))/s.x,d=(a.top+(l&&((o=c.visualViewport)==null?void 0:o.offsetTop)||0))/s.y,p=a.width/s.x,h=a.height/s.y;if(u){const v=kr(u),m=r&&Li(r)?kr(r):r;let _=v.frameElement;for(;_&&r&&m!==v;){const g=Ff(_),S=_.getBoundingClientRect(),b=getComputedStyle(_);S.x+=(_.clientLeft+parseFloat(b.paddingLeft))*g.x,S.y+=(_.clientTop+parseFloat(b.paddingTop))*g.y,f*=g.x,d*=g.y,p*=g.x,h*=g.y,f+=S.x,d+=S.y,_=kr(_).frameElement}}return{width:p,height:h,top:d,right:f+p,bottom:d+h,left:f,x:f,y:d}}function ku(e){return((GH(e)?e.ownerDocument:e.document)||window.document).documentElement}function Vb(e){return Li(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function jRe(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=bo(n),o=ku(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},u={x:1,y:1};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((xu(n)!=="body"||Kb(o))&&(a=Vb(n)),bo(n))){const c=yc(n);u=Ff(n),s.x=c.x+n.clientLeft,s.y=c.y+n.clientTop}return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-a.scrollLeft*u.x+s.x,y:t.y*u.y-a.scrollTop*u.y+s.y}}function XH(e){return yc(ku(e)).left+Vb(e).scrollLeft}function LRe(e){const t=ku(e),n=Vb(e),r=e.ownerDocument.body,i=Qh(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Qh(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+XH(e);const u=-n.scrollTop;return yo(r).direction==="rtl"&&(a+=Qh(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:u}}function em(e){if(xu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||YH(e)&&e.host||ku(e);return YH(t)?t.host:t}function QH(e){const t=em(e);return SR(t)?t.ownerDocument.body:bo(t)&&Kb(t)?t:QH(t)}function bc(e,t){var n;t===void 0&&(t=[]);const r=QH(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=kr(r);return i?t.concat(o,o.visualViewport||[],Kb(r)?r:[]):t.concat(r,bc(r))}function DRe(e,t){const n=kr(e),r=ku(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,u=0,s=0;if(i){o=i.width,a=i.height;const c=_R();(!c||c&&t==="fixed")&&(u=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:u,y:s}}function qRe(e,t){const n=yc(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=bo(e)?Ff(e):{x:1,y:1},a=e.clientWidth*o.x,u=e.clientHeight*o.y,s=i*o.x,c=r*o.y;return{width:a,height:u,x:s,y:c}}function e6(e,t,n){let r;if(t==="viewport")r=DRe(e,n);else if(t==="document")r=LRe(ku(e));else if(Li(t))r=qRe(t,n);else{const a={...t};if(_R()){var i,o;const u=kr(e);a.x-=((i=u.visualViewport)==null?void 0:i.offsetLeft)||0,a.y-=((o=u.visualViewport)==null?void 0:o.offsetTop)||0}r=a}return gR(r)}function URe(e,t){const n=t.get(e);if(n)return n;let r=bc(e).filter(u=>Li(u)&&xu(u)!=="body"),i=null;const o=yo(e).position==="fixed";let a=o?em(e):e;for(;Li(a)&&!SR(a);){const u=yo(a),s=bR(a);u.position==="fixed"?i=null:(o?!s&&!i:!s&&u.position==="static"&&!!i&&["absolute","fixed"].includes(i.position))?r=r.filter(f=>f!==a):i=u,a=em(a)}return t.set(e,r),r}function BRe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?URe(t,this._c):[].concat(n),r],u=a[0],s=a.reduce((c,l)=>{const f=e6(t,l,i);return c.top=Qh(f.top,c.top),c.right=KH(f.right,c.right),c.bottom=KH(f.bottom,c.bottom),c.left=Qh(f.left,c.left),c},e6(t,u,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function zRe(e){return bo(e)?VH(e):e.getBoundingClientRect()}function t6(e,t){return!bo(e)||yo(e).position==="fixed"?null:t?t(e):e.offsetParent}function KRe(e){let t=em(e);for(;bo(t)&&!SR(t);){if(bR(t))return t;t=em(t)}return null}function n6(e,t){const n=kr(e);let r=t6(e,t);for(;r&&WRe(r)&&yo(r).position==="static";)r=t6(r,t);return r&&(xu(r)==="html"||xu(r)==="body"&&yo(r).position==="static"&&!bR(r))?n:r||KRe(e)||n}function VRe(e,t,n){const r=bo(t),i=ku(t),o=yc(e,!0,n==="fixed",t);let a={scrollLeft:0,scrollTop:0};const u={x:0,y:0};if(r||!r&&n!=="fixed")if((xu(t)!=="body"||Kb(i))&&(a=Vb(t)),bo(t)){const s=yc(t,!0);u.x=s.x+t.clientLeft,u.y=s.y+t.clientTop}else i&&(u.x=XH(i));return{x:o.left+a.scrollLeft-u.x,y:o.top+a.scrollTop-u.y,width:o.width,height:o.height}}const HRe={getClippingRect:BRe,convertOffsetParentRelativeRectToViewportRelativeRect:jRe,isElement:Li,getDimensions:zRe,getOffsetParent:n6,getDocumentElement:ku,getScale:Ff,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||n6,o=this.getDimensions;return{reference:VRe(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>yo(e).direction==="rtl"};function GRe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:u=!1}=r,s=i&&!u,c=s||o?[...Li(e)?bc(e):e.contextElement?bc(e.contextElement):[],...bc(t)]:[];c.forEach(h=>{s&&h.addEventListener("scroll",n,{passive:!0}),o&&h.addEventListener("resize",n)});let l=null;if(a){let h=!0;l=new ResizeObserver(()=>{h||n(),h=!1}),Li(e)&&!u&&l.observe(e),!Li(e)&&e.contextElement&&!u&&l.observe(e.contextElement),l.observe(t)}let f,d=u?yc(e):null;u&&p();function p(){const h=yc(e);d&&(h.x!==d.x||h.y!==d.y||h.width!==d.width||h.height!==d.height)&&n(),d=h,f=requestAnimationFrame(p)}return n(),()=>{var h;c.forEach(v=>{s&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),(h=l)==null||h.disconnect(),l=null,u&&cancelAnimationFrame(f)}}const YRe=(e,t,n)=>{const r=new Map,i={platform:HRe,...n},o={...i.platform,_c:r};return SRe(e,t,{...i,platform:o})};var Hb=typeof document<"u"?U.useLayoutEffect:U.useEffect;function Gb(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Gb(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Gb(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function r6(e){const t=$e.useRef(e);return Hb(()=>{t.current=e}),t}function JRe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,whileElementsMounted:o,open:a}=e,[u,s]=$e.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[c,l]=$e.useState(r);Gb(c,r)||l(r);const f=$e.useRef(null),d=$e.useRef(null),p=$e.useRef(u),h=r6(o),v=r6(i),[m,_]=$e.useState(null),[g,S]=$e.useState(null),b=$e.useCallback(Y=>{f.current!==Y&&(f.current=Y,_(Y))},[]),$=$e.useCallback(Y=>{d.current!==Y&&(d.current=Y,S(Y))},[]),T=$e.useCallback(()=>{if(!f.current||!d.current)return;const Y={placement:t,strategy:n,middleware:c};v.current&&(Y.platform=v.current),YRe(f.current,d.current,Y).then(N=>{const Z={...N,isPositioned:!0};M.current&&!Gb(p.current,Z)&&(p.current=Z,L6.flushSync(()=>{s(Z)}))})},[c,t,n,v]);Hb(()=>{a===!1&&p.current.isPositioned&&(p.current.isPositioned=!1,s(Y=>({...Y,isPositioned:!1})))},[a]);const M=$e.useRef(!1);Hb(()=>(M.current=!0,()=>{M.current=!1}),[]),Hb(()=>{if(m&&g){if(h.current)return h.current(m,g,T);T()}},[m,g,T,h]);const R=$e.useMemo(()=>({reference:f,floating:d,setReference:b,setFloating:$}),[b,$]),q=$e.useMemo(()=>({reference:m,floating:g}),[m,g]);return $e.useMemo(()=>({...u,update:T,refs:R,elements:q,reference:b,floating:$}),[u,T,R,q,b,$])}var Au=typeof document<"u"?U.useLayoutEffect:U.useEffect;function ZRe(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}let $R=!1,XRe=0;const i6=()=>"floating-ui-"+XRe++;function QRe(){const[e,t]=$e.useState(()=>$R?i6():void 0);return Au(()=>{e==null&&t(i6())},[]),$e.useEffect(()=>{$R||($R=!0)},[]),e}const o6=$e["useId".toString()],a6=o6??QRe,eMe=$e.createContext(null),tMe=$e.createContext(null),u6=()=>{var e,t;return(e=(t=$e.useContext(eMe))==null?void 0:t.id)!=null?e:null},TR=()=>$e.useContext(tMe);function IR(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function s6(e){var t;return(t=IR(e).defaultView)!=null?t:window}function Yb(e){return e?e instanceof s6(e).Element:!1}function nMe(e){return e?e instanceof s6(e).HTMLElement:!1}const c6=$e["useInsertionEffect".toString()];function OR(e){const t=$e.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return c6?c6(()=>{t.current=e}):t.current=e,$e.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function rMe(e){let{open:t=!1,onOpenChange:n,whileElementsMounted:r,placement:i,middleware:o,strategy:a,nodeId:u}=e===void 0?{}:e;const[s,c]=$e.useState(null),l=TR(),f=$e.useRef(null),d=$e.useRef({}),p=$e.useState(()=>ZRe())[0],h=JRe({placement:i,middleware:o,strategy:a,whileElementsMounted:r}),v=OR(n),m=$e.useMemo(()=>({...h.refs,domReference:f}),[h.refs]),_=$e.useMemo(()=>({...h,refs:m,dataRef:d,nodeId:u,events:p,open:t,onOpenChange:v,_:{domReference:s}}),[h,u,p,t,v,m,s]);Au(()=>{const b=l==null?void 0:l.nodesRef.current.find($=>$.id===u);b&&(b.context=_)});const{reference:g}=h,S=$e.useCallback(b=>{(Yb(b)||b===null)&&(_.refs.domReference.current=b,c(b)),g(b)},[g,_.refs]);return $e.useMemo(()=>({...h,context:_,refs:m,reference:S}),[h,m,_,S])}function wR(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(a=>{let[u,s]=a;if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof s=="function"){var c;(c=r.get(u))==null||c.push(s),i[u]=function(){for(var l,f=arguments.length,d=new Array(f),p=0;p<f;p++)d[p]=arguments[p];(l=r.get(u))==null||l.forEach(h=>h(...d))}}}else i[u]=s}),i),{})}}const iMe=function(e){return e===void 0&&(e=[]),{getReferenceProps:t=>wR(t,e,"reference"),getFloatingProps:t=>wR(t,e,"floating"),getItemProps:t=>wR(t,e,"item")}};function CR(e,t){var n;let r=(n=e.filter(a=>{var u;return a.parentId===t&&((u=a.context)==null?void 0:u.open)}))!=null?n:[],i=r;for(;i.length;){var o;i=(o=e.filter(a=>{var u;return(u=i)==null?void 0:u.some(s=>{var c;return a.parentId===s.id&&((c=a.context)==null?void 0:c.open)})}))!=null?o:[],r=r.concat(i)}return r}function l6(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function oMe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Nu(e){e.preventDefault(),e.stopPropagation()}function aMe(e){const t=U.useRef(e);return Au(()=>{t.current=e}),t}function f6(e){const t=U.useRef();return Au(()=>{t.current=e},[e]),t.current}const uMe=function(e,t){let{open:n}=e,{enabled:r=!0,role:i="dialog"}=t===void 0?{}:t;const o=a6(),a=a6(),u={id:o,role:i};return r?i==="tooltip"?{reference:{"aria-describedby":n?o:void 0},floating:u}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":i==="alertdialog"?"dialog":i,"aria-controls":n?o:void 0,...i==="listbox"&&{role:"combobox"},...i==="menu"&&{id:a}},floating:{...u,...i==="menu"&&{"aria-labelledby":a}}}:{}};function ER(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}const sMe=function(e,t){let{open:n,onOpenChange:r,refs:i,events:o,nodeId:a}=e,{enabled:u=!0,escapeKey:s=!0,outsidePointerDown:c=!0,referencePointerDown:l=!1,ancestorScroll:f=!1,bubbles:d=!0}=t===void 0?{}:t;const p=TR(),h=u6()!=null,v=$e.useRef(!1);return $e.useEffect(()=>{if(!n||!u)return;function m($){if($.key==="Escape"){if(!d&&p&&CR(p.nodesRef.current,a).length>0)return;o.emit("dismiss",{preventScroll:!1}),r(!1)}}function _($){const T=v.current;if(v.current=!1,T)return;const M=oMe($);if(Yb(M)&&i.floating.current){var R;const Y=(R=i.floating.current.ownerDocument.defaultView)!=null?R:window,N=M.scrollWidth>M.clientWidth,Z=M.scrollHeight>M.clientHeight;let ie=Z&&$.offsetX>M.clientWidth;if(Z&&Y.getComputedStyle(M).direction==="rtl"&&(ie=$.offsetX<=M.offsetWidth-M.clientWidth),ie||N&&$.offsetY>M.clientHeight)return}const q=p&&CR(p.nodesRef.current,a).some(Y=>{var N;return ER($,(N=Y.context)==null?void 0:N.refs.floating.current)});ER($,i.floating.current)||ER($,i.domReference.current)||q||!d&&p&&CR(p.nodesRef.current,a).length>0||(o.emit("dismiss",h?{preventScroll:!0}:!1),r(!1))}function g(){r(!1)}const S=IR(i.floating.current);s&&S.addEventListener("keydown",m),c&&S.addEventListener("pointerdown",_);const b=(f?[...Yb(i.reference.current)?bc(i.reference.current):[],...Yb(i.floating.current)?bc(i.floating.current):[]]:[]).filter($=>{var T;return $!==((T=S.defaultView)==null?void 0:T.visualViewport)});return b.forEach($=>$.addEventListener("scroll",g,{passive:!0})),()=>{s&&S.removeEventListener("keydown",m),c&&S.removeEventListener("pointerdown",_),b.forEach($=>$.removeEventListener("scroll",g))}},[s,c,o,p,a,n,r,f,u,d,i,h]),u?{reference:{onPointerDown(){l&&(o.emit("dismiss"),r(!1))}},floating:{onPointerDownCapture(){v.current=!0}}}:{}},RR="ArrowUp",Jb="ArrowDown",Pf="ArrowLeft",tm="ArrowRight";function Zb(e,t,n){return Math.floor(e/t)!==n}function nm(e,t){return t<0||t>=e.current.length}function Mn(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const a=e.current;let u=n;do{var s,c;u=u+(r?-o:o)}while(u>=0&&u<=a.length-1&&(i?i.includes(u):a[u]==null||(s=a[u])!=null&&s.hasAttribute("disabled")||((c=a[u])==null?void 0:c.getAttribute("aria-disabled"))==="true"));return u}function Xb(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function d6(e,t){return Xb(t,e===RR||e===Jb,e===Pf||e===tm)}function MR(e,t,n){return Xb(t,e===Jb,n?e===Pf:e===tm)||e==="Enter"||e==" "||e===""}function cMe(e,t,n){return Xb(t,n?e===Pf:e===tm,e===Jb)}function lMe(e,t,n){return Xb(t,n?e===tm:e===Pf,e===RR)}function xR(e,t){return Mn(e,{disabledIndices:t})}function p6(e,t){return Mn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const fMe=function(e,t){let{open:n,onOpenChange:r,refs:i}=e,{listRef:o,activeIndex:a,onNavigate:u=()=>{},enabled:s=!0,selectedIndex:c=null,allowEscape:l=!1,loop:f=!1,nested:d=!1,rtl:p=!1,virtual:h=!1,focusItemOnOpen:v="auto",focusItemOnHover:m=!0,openOnArrowKeyDown:_=!0,disabledIndices:g=void 0,orientation:S="vertical",cols:b=1}=t===void 0?{listRef:{current:[]},activeIndex:null,onNavigate:()=>{}}:t;process.env.NODE_ENV!=="production"&&(l&&(f||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),h||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),S==="vertical"&&b>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const $=u6(),T=TR(),M=f6(n),R=OR(u),q=OR(f6(u)),Y=$e.useRef(v),N=$e.useRef(c??-1),Z=$e.useRef(null),ie=aMe(g),J=$e.useRef(!1),ye=$e.useRef(-1),[we,x]=$e.useState(),k=$e.useCallback((O,F)=>{ye.current=requestAnimationFrame(()=>{if(h){var j;x((j=O.current[F.current])==null?void 0:j.id)}else{var X;(X=O.current[F.current])==null||X.focus({preventScroll:!0})}})},[h]);Au(()=>{s&&(!M&&n&&Y.current&&c!=null&&R(c),M&&!n&&(cancelAnimationFrame(ye.current),N.current=-1,q(null)))},[n,M,c,o,k,s,R,q]),Au(()=>{if(s&&n)if(a==null){if(c!=null)return;M&&(N.current=-1,k(o,N)),!M&&Y.current&&(Z.current!=null||Y.current===!0&&Z.current==null)&&(N.current=Z.current==null||MR(Z.current,S,p)||d?xR(o,ie.current):p6(o,ie.current),R(N.current),k(o,N))}else nm(o,a)||(N.current=a,k(o,N))},[n,M,a,c,d,o,R,k,s,l,S,p,h,ie]),Au(()=>{if(s&&!n&&M){var O,F;const j=T==null||(O=T.nodesRef.current.find(X=>X.id===$))==null||(F=O.context)==null?void 0:F.refs.floating.current;j&&!j.contains(l6(IR(j)))&&j.focus({preventScroll:!0})}},[s,n,M,T,$]),Au(()=>{Z.current=null});function C(O){if(J.current=!0,d&&lMe(O.key,S,p)){Nu(O),r(!1),nMe(i.domReference.current)&&i.domReference.current.focus();return}const F=N.current,j=xR(o,g),X=p6(o,g);if(O.key==="Home"&&(N.current=j,R(N.current)),O.key==="End"&&(N.current=X,R(N.current)),b>1){const te=N.current;if(O.key===RR){if(Nu(O),te===-1)N.current=X;else if(N.current=Mn(o,{startingIndex:te,amount:b,decrement:!0,disabledIndices:g}),f&&(te-b<j||N.current<0)){const xe=te%b,ce=X%b,Ne=X-(ce-xe);ce===xe?N.current=X:N.current=ce>xe?Ne:Ne-b}nm(o,N.current)&&(N.current=te),R(N.current)}if(O.key===Jb&&(Nu(O),te===-1?N.current=j:(N.current=Mn(o,{startingIndex:te,amount:b,disabledIndices:g}),f&&te+b>X&&(N.current=Mn(o,{startingIndex:te%b-b,amount:b,disabledIndices:g}))),nm(o,N.current)&&(N.current=te),R(N.current)),S==="both"){const xe=Math.floor(te/b);O.key===tm&&(Nu(O),te%b!==b-1?(N.current=Mn(o,{startingIndex:te,disabledIndices:g}),f&&Zb(N.current,b,xe)&&(N.current=Mn(o,{startingIndex:te-te%b-1,disabledIndices:g}))):f&&(N.current=Mn(o,{startingIndex:te-te%b-1,disabledIndices:g})),Zb(N.current,b,xe)&&(N.current=te)),O.key===Pf&&(Nu(O),te%b!==0?(N.current=Mn(o,{startingIndex:te,disabledIndices:g,decrement:!0}),f&&Zb(N.current,b,xe)&&(N.current=Mn(o,{startingIndex:te+(b-te%b),decrement:!0,disabledIndices:g}))):f&&(N.current=Mn(o,{startingIndex:te+(b-te%b),decrement:!0,disabledIndices:g})),Zb(N.current,b,xe)&&(N.current=te));const ce=Math.floor(X/b)===xe;nm(o,N.current)&&(f&&ce?N.current=O.key===Pf?X:Mn(o,{startingIndex:te-te%b-1,disabledIndices:g}):N.current=te),R(N.current);return}}if(d6(O.key,S)){if(Nu(O),n&&!h&&l6(O.currentTarget.ownerDocument)===O.currentTarget){N.current=MR(O.key,S,p)?j:X,R(N.current);return}MR(O.key,S,p)?f?N.current=F>=X?l&&F!==o.current.length?-1:j:Mn(o,{startingIndex:F,disabledIndices:g}):N.current=Math.min(X,Mn(o,{startingIndex:F,disabledIndices:g})):f?N.current=F<=j?l&&F!==-1?o.current.length:X:Mn(o,{startingIndex:F,decrement:!0,disabledIndices:g}):N.current=Math.max(j,Mn(o,{startingIndex:F,decrement:!0,disabledIndices:g})),nm(o,N.current)?R(null):R(N.current)}}return s?{reference:{...h&&n&&a!=null&&{"aria-activedescendant":we},onKeyDown(O){if(J.current=!0,h&&n)return C(O);if((O.key.indexOf("Arrow")===0||O.key==="Enter"||O.key===" "||O.key==="")&&(Z.current=O.key),d){cMe(O.key,S,p)&&(Nu(O),n?(N.current=xR(o,g),R(N.current)):r(!0));return}d6(O.key,S)&&(c!=null&&(N.current=c),Nu(O),!n&&_?r(!0):C(O),n&&R(N.current))}},floating:{"aria-orientation":S==="both"?void 0:S,...h&&a!=null&&{"aria-activedescendant":we},onKeyDown:C,onPointerMove(){J.current=!1}},item:{onFocus(O){let{currentTarget:F}=O;const j=o.current.indexOf(F);j!==-1&&R(j)},onClick:O=>{let{currentTarget:F}=O;return F.focus({preventScroll:!0})},...m&&{onMouseMove(O){let{currentTarget:F}=O;const j=F;if(j){const X=o.current.indexOf(j);X!==-1&&R(X)}},onPointerLeave(){if(!J.current&&(N.current=-1,k(o,N),R(null),!h)){var O;(O=i.floating.current)==null||O.focus({preventScroll:!0})}}}}}:{}};function dMe(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:a}=e,u=nwe(n),s=new RegExp(`\\s${u}$`),c=o?"^":"",l=r?new RegExp(`${c}${u}.*?(?=\\s${u}|$)`,"gm"):new RegExp(`${c}(?:^)?${u}[^\\s${u}]*`,"gm"),f=((t=a.nodeBefore)===null||t===void 0?void 0:t.isText)&&a.nodeBefore.text;if(!f)return null;const d=a.pos-f.length,p=Array.from(f.matchAll(l)).pop();if(!p||p.input===void 0||p.index===void 0)return null;const h=p.input.slice(Math.max(0,p.index-1),p.index),v=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(h);if(i!==null&&!v)return null;const m=d+p.index;let _=m+p[0].length;return r&&s.test(f.slice(_-1,_+1))&&(p[0]+=" ",_+=1),m<a.pos&&_>=a.pos?{range:{from:m,to:_},query:p[0].slice(n.length),text:p[0]}:null}const pMe=new gu("suggestion");function hMe({pluginKey:e=pMe,editor:t,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:a="span",decorationClass:u="suggestion",command:s=()=>null,items:c=()=>[],render:l=()=>({}),allow:f=()=>!0}){let d;const p=l==null?void 0:l(),h=new Gr({key:e,view(){return{update:async(v,m)=>{var _,g,S,b,$,T,M;const R=(_=this.key)===null||_===void 0?void 0:_.getState(m),q=(g=this.key)===null||g===void 0?void 0:g.getState(v.state),Y=R.active&&q.active&&R.range.from!==q.range.from,N=!R.active&&q.active,Z=R.active&&!q.active,ie=!N&&!Z&&R.query!==q.query,J=N||Y,ye=ie&&!Y,we=Z||Y;if(!J&&!ye&&!we)return;const x=we&&!J?R:q,k=v.dom.querySelector(`[data-decoration-id="${x.decorationId}"]`);d={editor:t,range:x.range,query:x.query,text:x.text,items:[],command:C=>{s({editor:t,range:x.range,props:C})},decorationNode:k,clientRect:k?()=>{var C;const{decorationId:O}=(C=this.key)===null||C===void 0?void 0:C.getState(t.state),F=v.dom.querySelector(`[data-decoration-id="${O}"]`);return(F==null?void 0:F.getBoundingClientRect())||null}:null},J&&((S=p==null?void 0:p.onBeforeStart)===null||S===void 0||S.call(p,d)),ye&&((b=p==null?void 0:p.onBeforeUpdate)===null||b===void 0||b.call(p,d)),(ye||J)&&(d.items=await c({editor:t,query:x.query})),we&&(($=p==null?void 0:p.onExit)===null||$===void 0||$.call(p,d)),ye&&((T=p==null?void 0:p.onUpdate)===null||T===void 0||T.call(p,d)),J&&((M=p==null?void 0:p.onStart)===null||M===void 0||M.call(p,d))},destroy:()=>{var v;d&&((v=p==null?void 0:p.onExit)===null||v===void 0||v.call(p,d))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(v,m,_,g){const{isEditable:S}=t,{composing:b}=t.view,{selection:$}=v,{empty:T,from:M}=$,R={...m};if(R.composing=b,S&&(T||t.view.composing)){(M<m.range.from||M>m.range.to)&&!b&&!m.composing&&(R.active=!1);const q=dMe({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:$.$from}),Y=`id_${Math.floor(Math.random()*4294967295)}`;q&&f({editor:t,state:g,range:q.range})?(R.active=!0,R.decorationId=m.decorationId?m.decorationId:Y,R.range=q.range,R.query=q.query,R.text=q.text):R.active=!1}else R.active=!1;return R.active||(R.decorationId=null,R.range={from:0,to:0},R.query=null,R.text=null),R}},props:{handleKeyDown(v,m){var _;const{active:g,range:S}=h.getState(v.state);return g&&((_=p==null?void 0:p.onKeyDown)===null||_===void 0?void 0:_.call(p,{view:v,event:m,range:S}))||!1},decorations(v){const{active:m,range:_,decorationId:g}=h.getState(v);return m?Dt.create(v.doc,[Er.inline(_.from,_.to,{nodeName:a,class:u,"data-decoration-id":g})]):null}}});return h}function h6(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=h6(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function mMe(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=h6(e))&&(r&&(r+=" "),r+=t);return r}const vMe=Jr.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",bn(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),_o={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"},Qb=()=>(++Qb.i).toString();Qb.i=0;const gMe=e=>{const t=yMe(e),n=[];for(let r=0;r<t.length;r++)n.push(m6(t[r]));return{key:Qb(),children:n}},rm=(e,t=[])=>({key:Qb(),type:e.type,text:"text"in e?e.text:void 0,node:e,children:t}),kR=e=>rm({type:_o.span,text:e,spans:[]}),yMe=e=>{const t=e.slice(0);for(let n=0;n<t.length;n++){const r=t[n];if(r.type===_o.listItem||r.type===_o.oListItem){const i=[r];for(;t[n+1]&&t[n+1].type===r.type;)i.push(t[n+1]),t.splice(n,1);r.type===_o.listItem?t[n]={type:_o.list,items:i}:t[n]={type:_o.oList,items:i}}}return t},m6=e=>{if("text"in e)return rm(e,v6(e.spans,e));if("items"in e){const t=[];for(let n=0;n<e.items.length;n++)t.push(m6(e.items[n]));return rm(e,t)}return rm(e)},v6=(e,t,n)=>{if(!e.length)return[kR(t.text)];const r=e.slice(0);r.sort((o,a)=>o.start-a.start||a.end-o.end);const i=[];for(let o=0;o<r.length;o++){const a=r[o],u=n&&n.start||0,s=a.start-u,c=a.end-u,l=t.text.slice(s,c),f=[];for(let p=o;p<r.length;p++){const h=r[p];h!==a&&h.start>=a.start&&h.end<=a.end&&(f.push(h),r.splice(p,1),p--)}o===0&&s>0&&i.push(kR(t.text.slice(0,s)));const d={...a,text:l};i.push(rm(d,v6(f,{...t,text:l},a))),c<t.text.length&&i.push(kR(t.text.slice(c,r[o+1]?r[o+1].start-u:void 0)))}return i},bMe=(e,t)=>g6(gMe(e).children,t),g6=(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const i=e[r],o=t(i.type,i.node,i.text,g6(i.children,t),i.key);o!=null&&n.push(o)}return n};_o.listItem+"",_o.oListItem+"",_o.list+"",_o.oList+"";const _Me=Jr.create({name:"text",group:"inline"}),SMe={groupBy(e,t){return e.reduce((n,r)=>{const i=t(r),o=(n.get(i)||[]).concat(r);return n.set(i,o)},new Map)},sort(e){return[...e].sort((t,n)=>t.start-n.start)},mergeOverlap(e){const t=this.groupBy(e,r=>r.type),n=Array.from(t.entries()).map(([r,i])=>(this.sort(i).reduce((o,a)=>{if(!o.length)return[a];const u=o.length-1,s=o[u];return s.end>=a.start?[...o.slice(0,u),{...s,end:a.end}]:[...o,a]},[]),i)).reduce((r,i)=>[...r,...i],[]);return this.sort(n)}},y6={fromPrismic(e){return t=>{var n;return(n=PR.find(r=>r.richTextNodeTypes[0]===t.type))==null?void 0:n.converter.fromPrismic(e)(t)}},toPrismic(e,t,n){const[r,i]=(()=>{const o=PR.find(a=>e.type.name===a.name);if(!o)throw new Error(`Invalid mark extension '${e.type.name}'.`);return[o.richTextNodeTypes[0],o.converter.toPrismic(e)]})();return{type:r,start:t,end:n,...i?{data:i}:{}}}},b6=_Me.extend({name:"text"}),$Me={fromPrismic(e){return function(t,n,r=!1){const i={type:t,text:n.content.text,spans:n.content.spans||[]};return bMe([i],TMe(e,r))[0]}},toPrismic(e,t,n){const r=gc.children.reduce(e,(i,o)=>{const a=(()=>o.type.name===Db.name?Db.converter.toPrismic(o):o.textContent)(),u=a?i.text+a:i.text,s=i.text.length,c=u.length,l=(()=>o.marks.length?gc.marks.map(o,d=>y6.toPrismic(d,s,c)):void 0)();return{...i,text:u,spans:l?[...i.spans,...l]:i.spans}},{text:"",spans:[]});return{type:t,content:{text:r.text,spans:[...SMe.mergeOverlap(r.spans)].sort((i,o)=>i.type.localeCompare(o.type))},...n}}};function TMe(e,t=!1){return(n,r,i,o)=>{if(n==="span"&&i&&i.length)return t?[e.text(i)]:Db.splitTextToNodes(e,i)(a=>e.text(a));{const a=y6.fromPrismic(e)(r);return a?S$(o).map(s=>s.mark([...s.marks,a].sort((c,l)=>c.type.name.localeCompare(l.type.name)))):S$(o)}}}const _c={name:b6.name,component:b6,converter:$Me};var _6=(e=>(e.LeftToRight="ltr",e.RightToLeft="rtl",e))(_6||{});const Sc="text-direction",IMe=Ve.RichTextNodeType.rtl,OMe=Rr.create({name:"textDirection",addOptions(){return{supportedExtensionNames:[]}},addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{[Sc]:{default:"ltr",parseHTML:e=>e.attributes.dir?"rtl":"ltr",renderHTML:e=>e[Sc]==="rtl"?{dir:"rtl"}:{dir:"ltr"}}}}]},addCommands(){return{setDirection:e=>({commands:t})=>{switch(e){case"rtl":return t.setRightToLeft();default:return t.setLeftToRight()}},toggleDirection:e=>({commands:t})=>{const n=e==="rtl"?"ltr":"rtl";return t.setDirection(n)},setRightToLeft:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.updateAttributes(t,{[Sc]:"rtl"})),setLeftToRight:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.resetAttributes(t,Sc))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),Ta={parseNodeAttrsDirection(e){switch(e[Sc]){case"rtl":return"rtl";default:return"ltr"}},fromPrismic(e){const t=(()=>{switch(e.direction){case"rtl":return"rtl";default:return"ltr"}})();return{[Sc]:t}},toPrismic(e){return{direction:this.parseNodeAttrsDirection(e.attrs)}}},e_=vMe.extend({name:"paragraph",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",bn(this.options.HTMLAttributes,e),0]}}),wMe={fromPrismic(e){return function(t){var r;const n=_c.converter.fromPrismic(e)(e_.name,t);return(r=e.nodes[e_.name])==null?void 0:r.create(Ta.fromPrismic(t),n)}},toPrismic(e){return _c.converter.toPrismic(e,Ve.RichTextNodeType.paragraph,Ta.toPrismic(e))}},Fu=new Af([Ve.RichTextNodeType.paragraph],e_.name,e_,wMe,"Type '/' for commands"),S6=["ArrowDown","ArrowUp","End","Home"],$6=["Enter"],CMe=["Escape",...S6,...$6],EMe=Rr.create({name:"slash-commands",addOptions(){return{nodeTypes:[]}},addProseMirrorPlugins(){const e=o_(E6,this.options.nodeTypes);return e.length>1?[hMe({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow:({state:t})=>{const n=t.selection.$from;return n.parent.type.name===Fu.name&&n.depth===1},command:({editor:t,props:n,range:r})=>{n.runCommands(t,{deleteRange:r})},items:({query:t})=>{const n=t.toLocaleLowerCase().trim();return e.filter(r=>{var i,o;return((i=r.shortText)==null?void 0:i.toLocaleLowerCase().includes(n))||((o=r.text)==null?void 0:o.toLocaleLowerCase().includes(n))})},render:()=>{let t;return{onStart:n=>{t=new GEe(RMe,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate:n=>{t==null||t.updateProps(n)},onKeyDown:({event:n})=>{var r;return CMe.includes(n.key)&&((r=t==null?void 0:t.ref)==null?void 0:r.handleKeyDown(n))},onExit:()=>{t==null||t.destroy(),t==null||t.element.remove()}}}})]:[]}}),RMe=U.forwardRef(function({command:t,decorationNode:n,editor:r,items:i},o){const[a,u]=U.useState(!0),s=parseFloat(E.tokens.space[0]),{context:c,floating:l,reference:f,strategy:d,x:p,y:h}=rMe({middleware:[NRe(s),kRe(),FRe({limiter:PRe()})],onOpenChange:u,open:a,placement:"top-start",strategy:"fixed",whileElementsMounted:GRe});U.useLayoutEffect(()=>{f(n)},[f,n]),U.useEffect(()=>{let N;const Z=()=>{N=window.setTimeout(()=>{u(!0)})},ie=()=>{u(!1)};return r.on("focus",Z).on("blur",ie),()=>{r.off("focus",Z).off("blur",ie),clearTimeout(N)}},[r]);const[v,m]=U.useState(0),_=U.useRef([]),[g,S]=U.useState();i!==g&&(m(0),_.current=[],S(i));const{getFloatingProps:b,getItemProps:$,getReferenceProps:T}=iMe([sMe(c,{outsidePointerDown:!1}),fMe(c,{activeIndex:v,listRef:_,onNavigate:N=>{m(Z=>N??Z)},openOnArrowKeyDown:!1,virtual:!0}),uMe(c,{role:"menu"})]),R=T().onKeyDown;U.useImperativeHandle(o,()=>({handleKeyDown:N=>{if(a){if(S6.includes(N.key)&&R(N),$6.includes(N.key)){const Z=i[v];Z!==void 0&&t(Z)}return!0}else return!1}}),[v,t,i,R,a]);const q=p!==null&&h!==null,Y=U.useId();return a?I.jsxs("div",{...b(),className:E.dropdownMenuStyles.content,ref:l,style:{top:parseFloat(E.tokens.space[0]),left:parseFloat(E.tokens.space[0]),minWidth:256,position:d,transform:q?`translate3d(${Math.round(p)}px, ${Math.round(h)}px, 0)`:"translate3d(0, -200%, 0)"},children:[i.map((N,Z)=>U.createElement(T6,{...$({onClick:()=>{t(N)},onPointerDown:ie=>{ie.preventDefault()}}),"data-highlighted":Z===v?"":void 0,id:`${Y}[${Z}]`,key:N.nodeType,ref:ie=>{_.current[Z]=ie},shortcut:`/${N.shortText??""}`,startIcon:N.icon},N.text)),i.length===0?I.jsx(T6,{...$({onPointerDown:N=>{N.preventDefault()}}),disabled:!0,id:`${Y}[0]`,ref:N=>{_.current[0]=N},children:"No results"}):null]}):null}),T6=U.forwardRef(function({children:t,disabled:n,shortcut:r,startIcon:i,...o},a){return I.jsxs("div",{...o,...n?{"aria-disabled":!0,"data-disabled":!0}:{},className:E.dropdownMenuStyles.item,ref:a,role:"menuitem",children:[U.isValidElement(i)?U.cloneElement(i,{className:mMe(i.props.className,E.dropdownMenuStyles.itemStartIcon)}):null,I.jsx(E.Text,{className:E.dropdownMenuStyles.itemText,component:"span",children:t}),r?I.jsx(E.Text,{className:E.dropdownMenuStyles.itemShortcut,color:"inherit",component:"span",variant:"inherit",children:r}):null]})});function MMe(e,t){var o;const n=t.map(a=>a.richTextNodeTypes).flat(),r=y(t,li(a=>a.nodeType===kf.Text),cv({},(a,u)=>({...a,[u.name]:u.placeholder}))),i=n.includes(Ve.RichTextNodeType.orderedList)||n.includes(Ve.RichTextNodeType.list);return li(a=>a!==void 0)([mR.component(((o=e.config)==null?void 0:o.single)===void 0),_c.component,Db.component,_Re(r),i?Nf.component:void 0,EMe.configure({nodeTypes:n})])}const AR=lRe.extend({name:"bulletList",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",bn(this.options.HTMLAttributes,e),0]}}).configure({itemTypeName:"listItem"}),xMe={fromPrismic(e){return function(t){var r;const n=Nf.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[AR.name])==null?void 0:r.create(Ta.fromPrismic(t),n)}},toPrismic(e){return GS(gc.children.map(e,t=>li(n=>n!==void 0)(Nf.converter.toPrismic(t,Ve.RichTextNodeType.list))))}},t_=new dR([Ve.RichTextNodeType.list],AR.name,AR,xMe),kMe=/^```([a-z]+)?[\s\n]$/,AMe=/^~~~([a-z]+)?[\s\n]$/,n_=Jr.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,o=[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(a=>a.startsWith(n)).map(a=>a.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",bn(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`
|
|
146
146
|
|
|
147
|
-
`);return!o||!a?!1:e.chain().command(({tr:u})=>(u.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const u=i.after();return u===void 0||r.nodeAt(u)?!1:e.commands.exitCode()}}},addInputRules(){return[UE({find:
|
|
148
|
-
`)),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}}).extend({name:"preformatted",addAttributes(){return{language:{default:null,parseHTML:e=>{var o;const{languageClassPrefix:t}=this.options,i=[...((o=e.firstElementChild)==null?void 0:o.classList)||[]].filter(a=>a.startsWith(t)).map(a=>a.replace(t,""))[0];return i||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){return["pre",bn(this.options.HTMLAttributes),["code",e,0]]}}).configure({exitOnTripleEnter:!1}),xMe={fromPrismic(e){return function(t){var r;const n=_c.converter.fromPrismic(e)(n_.name,t,!0);return(r=e.nodes[n_.name])==null?void 0:r.create(Ta.fromPrismic(t),n)}},toPrismic(e){return _c.converter.toPrismic(e,Ve.RichTextNodeType.preformatted,Ta.toPrismic(e))}},I6=new Af([Ve.RichTextNodeType.preformatted],n_.name,n_,xMe,"",!0),kMe=Jr.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,bn(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>UE({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),r_="heading",Ia={byLevel(e){switch(e){case 1:return Ve.RichTextNodeType.heading1;case 2:return Ve.RichTextNodeType.heading2;case 3:return Ve.RichTextNodeType.heading3;case 4:return Ve.RichTextNodeType.heading4;case 5:return Ve.RichTextNodeType.heading5;case 6:return Ve.RichTextNodeType.heading6}},default(e){return{fullName:this.byLevel(e),level:e}},fromPrismic(e,t=[1,2,3,4,5,6]){const n=new RegExp(`^heading([${t.join(",")}]){1}$`),r=e.match(n);if(!r||!r[1])return;const i=parseInt(r[1]);return{fullName:Ia.byLevel(i),level:i}},fromProsemirror(e,t){const n=e.level;if(t.includes(n))return{fullName:Ia.byLevel(n),level:n}}},AMe=e=>kMe.extend({name:r_,addAttributes(){return{level:{default:e[0]},label:{default:null}}},addOptions(){return{levels:[...e],HTMLAttributes:{}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`}))},renderHTML({node:t,HTMLAttributes:n}){const r=t.attrs.level,o={...t.attrs.label?{label:t.attrs.label}:{}};return[`h${r}`,bn(this.options.HTMLAttributes,n,o),0]}}),NMe=e=>{const t=e[0];return{fromPrismic(n){return function(r){var a;const i=_c.converter.fromPrismic(n)(r_,r),o=Ia.fromPrismic(r.type,e)||Ia.default(t);return(a=n.nodes[r_])==null?void 0:a.create({level:o.level,...Ta.fromPrismic(r)},i)}},toPrismic(n){const{fullName:r}=Ia.fromProsemirror(n.attrs,e)||Ia.default(t);return _c.converter.toPrismic(n,r,Ta.toPrismic(n))}}};function FMe(e){if(!e)return[1,2,3,4,5,6];if(!e.size)return;const t=Array.from(e.values()).reduce((n,r)=>{const i=Ia.fromPrismic(r);return i?[...n,i.level]:n},[]).sort((n,r)=>n-r);return y(Zf(t),Z$(()=>{}))}const $c={name:r_,build:e=>{const t=FMe(e);if(!t)return;const n=Zf(t.map(r=>Ia.byLevel(r)));if(!je(n))return new iRe(n.value,AMe(t),t,NMe(t),r=>{const i=Ia.fromProsemirror(r,t);return i&&`Heading ${i.level}`})}},PMe=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,WMe=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,LMe=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,jMe=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,NR=BE.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",bn(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Eb({find:PMe,type:this.type}),Eb({find:LMe,type:this.type})]},addPasteRules(){return[Rb({find:WMe,type:this.type}),Rb({find:jMe,type:this.type})]}}).extend({name:"em"}),DMe={fromPrismic(e){return function(){var t;return(t=e.marks[NR.name])==null?void 0:t.create()}},toPrismic(){}},O6=new FH([Ve.RichTextNodeType.em],NR.name,NR,DMe),qMe=/^(\d+)\.\s$/,FR=Jr.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",bn(this.options.HTMLAttributes,n),0]:["ol",bn(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[I5({find:qMe,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}).extend({name:"orderedList",addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",bn(this.options.HTMLAttributes,n),0]:["ol",bn(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}}).configure({itemTypeName:"listItem"}),UMe={fromPrismic(e){return function(t){var r;const n=Nf.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[FR.name])==null?void 0:r.create(Ta.fromPrismic(t),n)}},toPrismic(e){return GS(gc.children.map(e,t=>li(n=>n!==void 0)(Nf.converter.toPrismic(t,Ve.RichTextNodeType.orderedList))))}},i_=new dR([Ve.RichTextNodeType.orderedList],FR.name,FR,UMe),w6=Nu,BMe=e=>y([Nu,t_,i_,$c.build(e),I6],li(ga)),PR=[PH,O6],C6=e=>[...BMe(e),...PR],E6=[{nodeType:Ve.RichTextNodeType.paragraph,icon:I.jsx(M.Icon,{name:"textFields"}),isActive:e=>e.isActive(Nu.name)&&!e.isActive(t_.name)&&!e.isActive(i_.name),runCommands:kr((e,t)=>e.clearNodes().setDirection(Di(t))),shortText:"par",text:"Paragraph"},{nodeType:Ve.RichTextNodeType.heading1,icon:I.jsx(M.Icon,{name:"looks1"}),isActive:e=>e.isActive($c.name,{level:1}),runCommands:kr((e,t)=>e.setHeading({level:1}).setDirection(Di(t))),shortText:"h1",text:"Heading 1"},{nodeType:Ve.RichTextNodeType.heading2,icon:I.jsx(M.Icon,{name:"looks2"}),isActive:e=>e.isActive($c.name,{level:2}),runCommands:kr((e,t)=>e.setHeading({level:2}).setDirection(Di(t))),shortText:"h2",text:"Heading 2"},{nodeType:Ve.RichTextNodeType.heading3,icon:I.jsx(M.Icon,{name:"looks3"}),isActive:e=>e.isActive($c.name,{level:3}),runCommands:kr((e,t)=>e.setHeading({level:3}).setDirection(Di(t))),shortText:"h3",text:"Heading 3"},{nodeType:Ve.RichTextNodeType.heading4,icon:I.jsx(M.Icon,{name:"looks4"}),isActive:e=>e.isActive($c.name,{level:4}),runCommands:kr((e,t)=>e.setHeading({level:4}).setDirection(Di(t))),shortText:"h4",text:"Heading 4"},{nodeType:Ve.RichTextNodeType.heading5,icon:I.jsx(M.Icon,{name:"looks5"}),isActive:e=>e.isActive($c.name,{level:5}),runCommands:kr((e,t)=>e.setHeading({level:5}).setDirection(Di(t))),shortText:"h5",text:"Heading 5"},{nodeType:Ve.RichTextNodeType.heading6,icon:I.jsx(M.Icon,{name:"looks6"}),isActive:e=>e.isActive($c.name,{level:6}),runCommands:kr((e,t)=>e.setHeading({level:6}).setDirection(Di(t))),shortText:"h6",text:"Heading 6"},{nodeType:Ve.RichTextNodeType.list,icon:I.jsx(M.Icon,{name:"formatListBulleted"}),isActive:e=>e.isActive(t_.name),runCommands:kr((e,t)=>e.toggleBulletList().setDirection(Di(t))),shortText:"bull",text:"Bulleted list"},{nodeType:Ve.RichTextNodeType.orderedList,icon:I.jsx(M.Icon,{name:"formatListNumbered"}),isActive:e=>e.isActive(i_.name),runCommands:kr((e,t)=>e.toggleOrderedList().setDirection(Di(t))),shortText:"num",text:"Numbered list"},{nodeType:Ve.RichTextNodeType.preformatted,icon:I.jsx(M.Icon,{name:"dataObject"}),isActive:e=>e.isActive(I6.name),runCommands:kr((e,t)=>e.setCodeBlock().setDirection(Di(t))),shortText:"code",text:"Code"}],zMe=[{nodeType:Ve.RichTextNodeType.strong,icon:I.jsx(M.Icon,{name:"formatBold"}),isActive:e=>e.isActive(PH.name),runCommands:kr(e=>e.toggleBold())},{nodeType:Ve.RichTextNodeType.em,icon:I.jsx(M.Icon,{name:"formatItalic"}),isActive:e=>e.isActive(O6.name),runCommands:kr(e=>e.toggleItalic())}],KMe=[{nodeType:Ve.RichTextNodeType.rtl,icon:I.jsx(M.Icon,{name:"formatTextDirectionRToL"}),isActive:e=>e.isActive({[Sc]:_6.RightToLeft}),runCommands:kr((e,t)=>e.toggleDirection(Di(t)))}];function kr(e){return(t,n={})=>{let r=n.can===!0?t.can().chain():t.chain().focus();return n.deleteRange!==void 0&&(r=r.deleteRange(n.deleteRange)),e(r,t).run()}}function Di(e){const t=e.state.selection.$from.parent.attrs;return Ta.parseNodeAttrsDirection(t)}function o_(e,t){return e.filter(n=>t.includes(n.nodeType))}const VMe={duration:100,hideOnClick:!0,offset:[-48,parseFloat(M.tokens.space[8])],placement:"top-start",zIndex:parseFloat(M.tokens.zIndex.toolbar)},HMe=({editor:e,nodeTypes:t})=>{var a;const n=o_(E6,t),r=o_(zMe,t),i=o_(KMe,t),o=[n.length>1?I.jsx(M.ToolbarSelect,{onValueChange:u=>{var s;(s=n.find(c=>c.nodeType===u))==null||s.runCommands(e)},value:((a=n.find(u=>u.isActive(e)))==null?void 0:a.nodeType)??"",children:n.map(u=>I.jsx(M.ToolbarSelectItem,{value:u.nodeType,children:u.text},u.nodeType))},"node"):null,r.length>0?I.jsx(M.ToolbarToggleButtonGroup,{onValueChange:u=>{r.forEach(s=>{(s.isActive(e)&&!u.includes(s.nodeType)||!s.isActive(e)&&u.includes(s.nodeType))&&s.runCommands(e)})},type:"multiple",value:r.filter(u=>u.isActive(e)).map(u=>u.nodeType),children:r.map(u=>I.jsx(M.ToolbarToggleButtonGroupItem,{disabled:!u.runCommands(e,{can:!0}),startIcon:u.icon,value:u.nodeType},u.nodeType))},"mark"):null,i.length>0?I.jsx(U.Fragment,{children:i.map(u=>I.jsx(M.ToolbarToggleButton,{disabled:!u.runCommands(e,{can:!0}),onPressedChange:()=>{u.runCommands(e)},pressed:u.isActive(e),startIcon:u.icon},u.nodeType))},"extra"):null,n.length+r.length+i.length>1?I.jsx(M.ToolbarButton,{onClick:()=>{e.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:I.jsx(M.Icon,{name:"formatClear"})},"clear"):null].filter(ga).map((u,s)=>I.jsxs(U.Fragment,{children:[s===0?null:I.jsx(M.ToolbarSeparator,{}),u]},u.key));return o.length>0?I.jsx(PEe,{editor:e,tippyOptions:VMe,children:I.jsx(M.Toolbar,{children:o})}):null},GMe=e=>{var c;const{content:t,field:n,id:r,readOnly:i,config:o}=e,a=t&&mR.converter(o.nodeExtensions).fromPrismic(o.schema,(c=o.defaultTextConverter)==null?void 0:c.call(o,o.schema))(t),u=jV(e.onContentChange),s=HEe({...a?{content:a.toJSON()}:{},editable:!i,editorProps:{attributes:{class:M.contentEditableClass,id:r,tabIndex:"0"}},extensions:o.allComponents,injectCSS:!1,onUpdate({editor:l}){const f=mR.converter(o.nodeExtensions).toPrismic(l.state.doc);u(f)}},[r,i,u]);return I.jsxs(M.Field,{children:[I.jsx(M.FieldLabel,{htmlFor:r,children:Vr(n)}),I.jsx(M.FieldControl,{children:I.jsxs(I.Fragment,{children:[I.jsx(DEe,{editor:s,style:{flex:1}}),(s==null?void 0:s.isEditable)&&I.jsx(HMe,{editor:s,nodeTypes:o.names.concat(SMe)})]})})]})},YMe=e=>{const{field:t}=e,n=U.useMemo(()=>{const{extensions:r,defaultTextConverter:i}=lRe(t.config),o=li(f=>f.extType===fR.Node)(r),a=r.flatMap(f=>f.richTextNodeTypes),u=r.map(f=>f.component),s=[...CMe(t,o),$Me.configure({supportedExtensionNames:li(f=>f.extType===fR.Node&&f.nodeType===kf.Text&&!f.lockedFormat)(r).map(f=>f.name)}),...u],c=s.map(f=>f.name),l=wOe(s);return{allComponents:s,extensionsNames:c,defaultTextConverter:i,nodeExtensions:o,names:a,schema:l}},[t]);return I.jsx(GMe,{...e,config:n},n.extensionsNames.join("-"))},JMe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var s,c;const o=Gs(t),a=ZMe(t),u=(e==null?void 0:e.value)??a;return I.jsxs(M.Field,{children:[I.jsx(M.FieldIcon,{children:I.jsx(M.Icon,{name:"arrowDropDownCircle"})}),I.jsx(M.FieldLabel,{htmlFor:n,children:Vr(t)}),I.jsx(M.FieldControl,{children:I.jsxs(M.Select,{id:n,onValueChange:l=>{i||r(XMe(l))},placeholder:o,...u===void 0?{}:{value:u},children:[u===void 0||a!==void 0?null:I.jsx(M.SelectItem,{value:"",children:o}),(c=(s=t.config)==null?void 0:s.options)==null?void 0:c.map(l=>I.jsx(M.SelectItem,{value:l,children:l},l))]})})]},u)};function ZMe(e){var t,n;return((t=e.config)==null?void 0:t.default_value)===void 0||(n=e.config.options)==null?void 0:n[0]}function XMe(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Select",value:e}}const QMe=({id:e,readOnly:t,field:n,content:r,onContentChange:i})=>I.jsxs(M.Field,{children:[I.jsx(M.FieldIcon,{children:I.jsx(M.Icon,{name:"event"})}),I.jsx(M.FieldLabel,{id:e,children:Vr(n)}),I.jsx(M.FieldControl,{children:I.jsx(I.Fragment,{children:I.jsx(M.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:I.jsx(M.DateInput,{mode:"date-time","aria-labelledby":e,readOnly:t,value:r==null?void 0:r.value,onValueChange:o=>i(exe(o))})})})})]}),exe=e=>e===void 0?void 0:{__TYPE__:"FieldContent",type:"Timestamp",value:e},a_=({content:e,nestableWidget:t,...n})=>t.type==="Boolean"?I.jsx(xSe,{...n,field:t,content:ut.isBooleanContent(e)?e:void 0}):t.type==="Date"?I.jsx(PSe,{...n,field:t,content:ut.isDateContent(e)?e:void 0}):t.type==="Timestamp"?I.jsx(QMe,{...n,field:t,content:ut.isTimestampContent(e)?e:void 0}):t.type==="Image"?I.jsx(c0e,{...n,field:t,content:ut.isImageContent(e)?e:void 0}):t.type==="Link"?I.jsx(y0e,{...n,field:t,content:ut.isLinkContent(e)?e:void 0}):t.type==="Number"?I.jsx(S0e,{...n,field:t,content:ut.isNumberContent(e)?e:void 0}):t.type==="StructuredText"?I.jsx(YMe,{...n,field:t,content:ut.isRichTextContent(e)?e:void 0}):t.type==="Select"?I.jsx(JMe,{...n,field:t,content:ut.isSelectContent(e)?e:void 0}):t.type==="Text"?I.jsx(h0e,{...n,field:t,content:ut.isTextContent(e)?e:void 0}):t.type==="Embed"?I.jsx(W$e,{...n,field:t,content:ut.isEmbedContent(e)?e:void 0}):t.type==="Color"?I.jsx(NSe,{...n,field:t,content:ut.isColorContent(e)?e:void 0}):null,R6=({content:e,id:t,nonRepeatableZone:n,onContentChange:r,readOnly:i})=>{const o=U.useMemo(()=>Object.entries(n),[n]);return I.jsx(I.Fragment,{children:o.map(([a,u])=>{const s=e[a];return I.jsx(a_,{id:`${t}.${a}`,readOnly:i,nestableWidget:u,content:ut.isNestableContent(s)?s:void 0,onContentChange:c=>{r(txe(e,a,c))}},a)})})};function txe(e,t,n){return n===void 0?Em(t)(e):{...e,[t]:n}}function nxe(e,t){return e.filter((n,r)=>r!==t)}function rxe(e,t,n){const r=e.length;if(M6(t,r)||M6(n,r))return e;const i=[...e],o=i[t],a=i[n];return i[t]=a,i[n]=o,i}function M6(e,t){return e<0||e>=t}let ixe=0;function oxe(){return ixe++}const WR=({id:e,title:t,content:n,onContentChange:r,readOnly:i,repeatableZone:o})=>{const a=U.useMemo(()=>Object.entries(o),[o]),u=cxe(n),s=U.useRef(new Map);return Object.keys(o).length===0?null:(axe(s.current,u),I.jsx(M.Group,{title:"Repeatable zone"+(t?` • ${t}`:""),addItemButtonTitle:"Add item in group",items:u,getItemKey:c=>s.current.get(c)??"",onAddItem:()=>r(u.concat(x6())),children:(c,l)=>{const f=new Map(c.value);return I.jsx(M.GroupItem,{index:l,title:"Item",onMove:({index:d,offset:p})=>{r(rxe(u,d,d+p))},onDelete:({index:d})=>r(nxe(u,d)),children:a.map(([d,p])=>{const h=f.get(d);return I.jsx(a_,{content:ut.isNestableContent(h)?h:void 0,id:`${e}[${l}].${d}`,nestableWidget:p,onContentChange:v=>{const m=fxe(c,[d,v]),_=lxe(u,[l,m]);uxe(s.current,c,m),r(_)},readOnly:i},d)})})}}))};function axe(e,t){const n=new Set(t);t.forEach(r=>{e.has(r)||e.set(r,oxe())});for(const[r]of e)n.has(r)||e.delete(r)}function uxe(e,t,n){const r=e.get(t);r!==void 0&&e.set(n,r)}const sxe={__TYPE__:"GroupItemContent",value:[]};function cxe(e){return e??[sxe]}function lxe(e,t){const[n,r]=t;return r?e.map((i,o)=>o===n?r:i):e.filter((i,o)=>o!==n)}function fxe(e,t){const[n,r]=t,i=(()=>r?Array.from(new Map(e.value).set(n,r)):e.value.filter(([o])=>o!==n))();return x6(i)}const x6=(e=[])=>({__TYPE__:"GroupItemContent",value:e}),dxe=({compositeSlice:e,content:t,onContentChange:n,...r})=>I.jsxs(M.FieldSet,{children:[I.jsx(M.FieldSetLegend,{children:pxe(e)}),I.jsx(R6,{...r,nonRepeatableZone:e["non-repeat"]??{},content:t.nonRepeat,onContentChange:i=>{n({...t,nonRepeat:i})}}),I.jsx(WR,{...r,repeatableZone:e.repeat??{},content:t.repeat,onContentChange:i=>{n({...t,repeat:i})}})]});function pxe(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const k6=({group:e,content:t,onContentChange:n,...r})=>{var i;return I.jsx(WR,{...r,title:A6(e),repeatableZone:((i=e.config)==null?void 0:i.fields)??{},content:t==null?void 0:t.value,onContentChange:o=>{n({__TYPE__:"GroupContentType",value:o})}})};function A6(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const hxe=({content:e,legacySlice:t,...n})=>I.jsxs(M.FieldSet,{children:[I.jsx(M.FieldSetLegend,{children:t.type==="Group"?A6(t):Vr(t)}),t.type==="Group"?I.jsx(k6,{...n,group:t,content:ut.isGroupContent(e)?e:void 0}):I.jsx(a_,{...n,nestableWidget:t,content:ut.isNestableContent(e)?e:void 0,onContentChange:r=>{r&&n.onContentChange(r)}})]}),N6=({config:e,content:t,sliceKey:n,onContentChange:r,selected:i=!1,readOnly:o=!1,sharedSlice:a,...u})=>{const s=mxe(a,t.variation),c=U.useId();if(s===void 0)return null;const f={id:u.id??c,readOnly:o};return I.jsx(lS.Provider,{value:e,children:I.jsxs(M.FieldSet,{id:n,selected:i,children:[I.jsx(M.FieldSetLegend,{children:vxe(a,s)}),I.jsx(R6,{...f,nonRepeatableZone:s.primary??{},content:t.primary,onContentChange:d=>{r({...t,primary:d})}}),I.jsx(WR,{...f,repeatableZone:s.items??{},content:t.items,onContentChange:d=>{r({...t,items:d})}})]})})};function mxe(e,t){return U.useMemo(()=>e.variations.find(n=>n.id===t),[e,t])}function vxe(e,t){return[e.name,t.name].join(" • ")}const gxe=({selectionId:e,content:t,id:n,onContentChange:r,readOnly:i,sliceZone:o})=>{const a=fS();return I.jsx(I.Fragment,{children:t==null?void 0:t.value.map((u,s)=>{var p,h;const c=(h=(p=o.config)==null?void 0:p.choices)==null?void 0:h[u.name];if(c===void 0)return null;const l=e===u.key,f=u.widget,d={id:`${n}[${s}]`,key:u.key,sliceKey:u.key,onContentChange:v=>{const m={...u,widget:v},_=yxe(t,[s,m]);r(_)},readOnly:i};if(c.type==="SharedSlice")return ut.isSharedSliceContent(f)?I.jsx(N6,{...d,config:a,sharedSlice:c,content:f,selected:l}):null;if(c.type==="Slice")return ut.isCompositeSliceContent(f)?I.jsx(dxe,{...d,compositeSlice:c,content:f}):null;{const v={...d,legacySlice:c};return ut.isSimpleSliceContent(f)?I.jsx(hxe,{...v,content:f}):null}})})};function yxe(e,[t,n]){return{__TYPE__:"SliceContentType",value:e.value.map((r,i)=>i===t?n:r)}}const bxe=({content:e,id:t,onContentChange:n,readOnly:r,staticZone:i})=>{const o=U.useMemo(()=>Object.entries(i),[i]);return I.jsxs(M.FieldSet,{children:[I.jsx(M.FieldSetLegend,{children:"Static Zone"}),o.map(([a,u])=>{const s={id:`${t}.${a}`,onContentChange:l=>{const{[a]:f,...d}=e;n({...d,...l!==void 0&&{[a]:l}})},readOnly:r},c=e[a];return u.type==="UID"?null:u.type==="Group"?U.createElement(k6,{...s,content:ut.isGroupContent(c)?c:void 0,group:u,key:a}):U.createElement(a_,{...s,content:ut.isNestableContent(c)?c:void 0,key:a,nestableWidget:u})})]})},_xe=({id:e,readOnly:t,selection:n,section:r,content:i,onContentChange:o})=>{const[a,u]=$xe(r),[s,c]=Txe(i);return Ixe(n),I.jsxs(M.Box,{display:"flex",flexDirection:"column",children:[I.jsx(bxe,{id:e,readOnly:t,staticZone:a,content:s,onContentChange:l=>o({...c,...l})}),u.map(([l,f])=>{const d=c[l];return I.jsx(gxe,{id:`${e}.${l}`,readOnly:t,selectionId:n==null?void 0:n.id,sliceZone:f,content:d,onContentChange:p=>o({...s,...c,[l]:p})},l)})]})};function Sxe(e){return e.type==="Choice"||e.type==="Slices"}function $xe(e){return U.useMemo(()=>{const t=y(e,Dm(Sxe),p_(Cm));return[Hf(t),Gf(t)]},[e])}function Txe(e){return U.useMemo(()=>Object.entries(e).reduce(([t,n],[r,i])=>{const o=ut.isSlicesContent(i),a={[r]:i};return[{...t,...o?{}:a},{...n,...o?a:{}}]},[{},{}]),[e])}function Ixe(e){const{id:t,key:n,offset:r=0}=e??{};U.useLayoutEffect(()=>{if(!t)return;const i=setTimeout(()=>{const o=document.getElementById(t);if(!o)return;const a=o.getBoundingClientRect().y+window.scrollY;window.scrollTo({top:a-r,behavior:"smooth"})},100);return()=>clearTimeout(i)},[t,n,r])}const Oxe=({config:e,readOnly:t=!1,customType:n,sectionName:r,selection:i,content:o,onContentChange:a})=>{const u=U.useId();if(ui(n.json))return null;const s=wxe(n,r),[c,l]=Cxe(s,o);return I.jsx(lS.Provider,{value:e,children:I.jsx(_xe,{id:u,readOnly:t,selection:i,section:s,content:c,onContentChange:f=>a({...l,...f})})})};function wxe(e,t){const n=e.json[t];if(n===void 0)throw new Error(`Cannot find a section with name '${t}'.`);return n}function Cxe(e,t){return Object.entries(t).reduce(([n,r],[i,o])=>{const a=e[i]!==void 0,u={[i]:o};return[{...n,...a?u:{}},{...r,...a?{}:u}]},[{},{}])}Sn.DocumentEditor=Oxe,Sn.SharedSliceEditor=N6,Object.defineProperty(Sn,Symbol.toStringTag,{value:"Module"})});
|
|
147
|
+
`);return!o||!a?!1:e.chain().command(({tr:u})=>(u.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const u=i.after();return u===void 0||r.nodeAt(u)?!1:e.commands.exitCode()}}},addInputRules(){return[UE({find:kMe,type:this.type,getAttributes:e=>({language:e[1]})}),UE({find:AMe,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Gr({key:new gu("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:a}=e.state;return a.replaceSelectionWith(this.type.create({language:o})),a.setSelection(Be.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.insertText(n.replace(/\r\n?/g,`
|
|
148
|
+
`)),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}}).extend({name:"preformatted",addAttributes(){return{language:{default:null,parseHTML:e=>{var o;const{languageClassPrefix:t}=this.options,i=[...((o=e.firstElementChild)==null?void 0:o.classList)||[]].filter(a=>a.startsWith(t)).map(a=>a.replace(t,""))[0];return i||null},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){return["pre",bn(this.options.HTMLAttributes),["code",e,0]]}}).configure({exitOnTripleEnter:!1}),NMe={fromPrismic(e){return function(t){var r;const n=_c.converter.fromPrismic(e)(n_.name,t,!0);return(r=e.nodes[n_.name])==null?void 0:r.create(Ta.fromPrismic(t),n)}},toPrismic(e){return _c.converter.toPrismic(e,Ve.RichTextNodeType.preformatted,Ta.toPrismic(e))}},I6=new Af([Ve.RichTextNodeType.preformatted],n_.name,n_,NMe,"",!0),FMe=Jr.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,bn(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>UE({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),r_="heading",Ia={byLevel(e){switch(e){case 1:return Ve.RichTextNodeType.heading1;case 2:return Ve.RichTextNodeType.heading2;case 3:return Ve.RichTextNodeType.heading3;case 4:return Ve.RichTextNodeType.heading4;case 5:return Ve.RichTextNodeType.heading5;case 6:return Ve.RichTextNodeType.heading6}},default(e){return{fullName:this.byLevel(e),level:e}},fromPrismic(e,t=[1,2,3,4,5,6]){const n=new RegExp(`^heading([${t.join(",")}]){1}$`),r=e.match(n);if(!r||!r[1])return;const i=parseInt(r[1]);return{fullName:Ia.byLevel(i),level:i}},fromProsemirror(e,t){const n=e.level;if(t.includes(n))return{fullName:Ia.byLevel(n),level:n}}},PMe=e=>FMe.extend({name:r_,addAttributes(){return{level:{default:e[0]},label:{default:null}}},addOptions(){return{levels:[...e],HTMLAttributes:{}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`}))},renderHTML({node:t,HTMLAttributes:n}){const r=t.attrs.level,o={...t.attrs.label?{label:t.attrs.label}:{}};return[`h${r}`,bn(this.options.HTMLAttributes,n,o),0]}}),WMe=e=>{const t=e[0];return{fromPrismic(n){return function(r){var a;const i=_c.converter.fromPrismic(n)(r_,r),o=Ia.fromPrismic(r.type,e)||Ia.default(t);return(a=n.nodes[r_])==null?void 0:a.create({level:o.level,...Ta.fromPrismic(r)},i)}},toPrismic(n){const{fullName:r}=Ia.fromProsemirror(n.attrs,e)||Ia.default(t);return _c.converter.toPrismic(n,r,Ta.toPrismic(n))}}};function jMe(e){if(!e)return[1,2,3,4,5,6];if(!e.size)return;const t=Array.from(e.values()).reduce((n,r)=>{const i=Ia.fromPrismic(r);return i?[...n,i.level]:n},[]).sort((n,r)=>n-r);return y(Zf(t),Z$(()=>{}))}const $c={name:r_,build:e=>{const t=jMe(e);if(!t)return;const n=Zf(t.map(r=>Ia.byLevel(r)));if(!Le(n))return new uRe(n.value,PMe(t),t,WMe(t),r=>{const i=Ia.fromProsemirror(r,t);return i&&`Heading ${i.level}`})}},LMe=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,DMe=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,qMe=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,UMe=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,NR=BE.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",bn(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Eb({find:LMe,type:this.type}),Eb({find:qMe,type:this.type})]},addPasteRules(){return[Rb({find:DMe,type:this.type}),Rb({find:UMe,type:this.type})]}}).extend({name:"em"}),BMe={fromPrismic(e){return function(){var t;return(t=e.marks[NR.name])==null?void 0:t.create()}},toPrismic(){}},O6=new FH([Ve.RichTextNodeType.em],NR.name,NR,BMe),zMe=/^(\d+)\.\s$/,FR=Jr.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",bn(this.options.HTMLAttributes,n),0]:["ol",bn(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[I5({find:zMe,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]})]}}).extend({name:"orderedList",addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",bn(this.options.HTMLAttributes,n),0]:["ol",bn(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}}).configure({itemTypeName:"listItem"}),KMe={fromPrismic(e){return function(t){var r;const n=Nf.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[FR.name])==null?void 0:r.create(Ta.fromPrismic(t),n)}},toPrismic(e){return GS(gc.children.map(e,t=>li(n=>n!==void 0)(Nf.converter.toPrismic(t,Ve.RichTextNodeType.orderedList))))}},i_=new dR([Ve.RichTextNodeType.orderedList],FR.name,FR,KMe),w6=Fu,VMe=e=>y([Fu,t_,i_,$c.build(e),I6],li(ga)),PR=[PH,O6],C6=e=>[...VMe(e),...PR],E6=[{nodeType:Ve.RichTextNodeType.paragraph,icon:I.jsx(E.Icon,{name:"textFields"}),isActive:e=>e.isActive(Fu.name)&&!e.isActive(t_.name)&&!e.isActive(i_.name),runCommands:Ar((e,t)=>e.clearNodes().setDirection(Di(t))),shortText:"par",text:"Paragraph"},{nodeType:Ve.RichTextNodeType.heading1,icon:I.jsx(E.Icon,{name:"looks1"}),isActive:e=>e.isActive($c.name,{level:1}),runCommands:Ar((e,t)=>e.setHeading({level:1}).setDirection(Di(t))),shortText:"h1",text:"Heading 1"},{nodeType:Ve.RichTextNodeType.heading2,icon:I.jsx(E.Icon,{name:"looks2"}),isActive:e=>e.isActive($c.name,{level:2}),runCommands:Ar((e,t)=>e.setHeading({level:2}).setDirection(Di(t))),shortText:"h2",text:"Heading 2"},{nodeType:Ve.RichTextNodeType.heading3,icon:I.jsx(E.Icon,{name:"looks3"}),isActive:e=>e.isActive($c.name,{level:3}),runCommands:Ar((e,t)=>e.setHeading({level:3}).setDirection(Di(t))),shortText:"h3",text:"Heading 3"},{nodeType:Ve.RichTextNodeType.heading4,icon:I.jsx(E.Icon,{name:"looks4"}),isActive:e=>e.isActive($c.name,{level:4}),runCommands:Ar((e,t)=>e.setHeading({level:4}).setDirection(Di(t))),shortText:"h4",text:"Heading 4"},{nodeType:Ve.RichTextNodeType.heading5,icon:I.jsx(E.Icon,{name:"looks5"}),isActive:e=>e.isActive($c.name,{level:5}),runCommands:Ar((e,t)=>e.setHeading({level:5}).setDirection(Di(t))),shortText:"h5",text:"Heading 5"},{nodeType:Ve.RichTextNodeType.heading6,icon:I.jsx(E.Icon,{name:"looks6"}),isActive:e=>e.isActive($c.name,{level:6}),runCommands:Ar((e,t)=>e.setHeading({level:6}).setDirection(Di(t))),shortText:"h6",text:"Heading 6"},{nodeType:Ve.RichTextNodeType.list,icon:I.jsx(E.Icon,{name:"formatListBulleted"}),isActive:e=>e.isActive(t_.name),runCommands:Ar((e,t)=>e.toggleBulletList().setDirection(Di(t))),shortText:"bull",text:"Bulleted list"},{nodeType:Ve.RichTextNodeType.orderedList,icon:I.jsx(E.Icon,{name:"formatListNumbered"}),isActive:e=>e.isActive(i_.name),runCommands:Ar((e,t)=>e.toggleOrderedList().setDirection(Di(t))),shortText:"num",text:"Numbered list"},{nodeType:Ve.RichTextNodeType.preformatted,icon:I.jsx(E.Icon,{name:"dataObject"}),isActive:e=>e.isActive(I6.name),runCommands:Ar((e,t)=>e.setCodeBlock().setDirection(Di(t))),shortText:"code",text:"Code"}],HMe=[{nodeType:Ve.RichTextNodeType.strong,icon:I.jsx(E.Icon,{name:"formatBold"}),isActive:e=>e.isActive(PH.name),runCommands:Ar(e=>e.toggleBold())},{nodeType:Ve.RichTextNodeType.em,icon:I.jsx(E.Icon,{name:"formatItalic"}),isActive:e=>e.isActive(O6.name),runCommands:Ar(e=>e.toggleItalic())}],GMe=[{nodeType:Ve.RichTextNodeType.rtl,icon:I.jsx(E.Icon,{name:"formatTextDirectionRToL"}),isActive:e=>e.isActive({[Sc]:_6.RightToLeft}),runCommands:Ar((e,t)=>e.toggleDirection(Di(t)))}];function Ar(e){return(t,n={})=>{let r=n.can===!0?t.can().chain():t.chain().focus();return n.deleteRange!==void 0&&(r=r.deleteRange(n.deleteRange)),e(r,t).run()}}function Di(e){const t=e.state.selection.$from.parent.attrs;return Ta.parseNodeAttrsDirection(t)}function o_(e,t){return e.filter(n=>t.includes(n.nodeType))}const YMe={duration:100,hideOnClick:!0,offset:[-48,parseFloat(E.tokens.space[8])],placement:"top-start",zIndex:parseFloat(E.tokens.zIndex.toolbar)},JMe=({editor:e,nodeTypes:t})=>{var a;const n=o_(E6,t),r=o_(HMe,t),i=o_(GMe,t),o=[n.length>1?I.jsx(E.ToolbarSelect,{onValueChange:u=>{var s;(s=n.find(c=>c.nodeType===u))==null||s.runCommands(e)},value:((a=n.find(u=>u.isActive(e)))==null?void 0:a.nodeType)??"",children:n.map(u=>I.jsx(E.ToolbarSelectItem,{value:u.nodeType,children:u.text},u.nodeType))},"node"):null,r.length>0?I.jsx(E.ToolbarToggleButtonGroup,{onValueChange:u=>{r.forEach(s=>{(s.isActive(e)&&!u.includes(s.nodeType)||!s.isActive(e)&&u.includes(s.nodeType))&&s.runCommands(e)})},type:"multiple",value:r.filter(u=>u.isActive(e)).map(u=>u.nodeType),children:r.map(u=>I.jsx(E.ToolbarToggleButtonGroupItem,{disabled:!u.runCommands(e,{can:!0}),startIcon:u.icon,value:u.nodeType},u.nodeType))},"mark"):null,i.length>0?I.jsx(U.Fragment,{children:i.map(u=>I.jsx(E.ToolbarToggleButton,{disabled:!u.runCommands(e,{can:!0}),onPressedChange:()=>{u.runCommands(e)},pressed:u.isActive(e),startIcon:u.icon},u.nodeType))},"extra"):null,n.length+r.length+i.length>1?I.jsx(E.ToolbarButton,{onClick:()=>{e.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:I.jsx(E.Icon,{name:"formatClear"})},"clear"):null].filter(ga).map((u,s)=>I.jsxs(U.Fragment,{children:[s===0?null:I.jsx(E.ToolbarSeparator,{}),u]},u.key));return o.length>0?I.jsx(LEe,{editor:e,tippyOptions:YMe,children:I.jsx(E.Toolbar,{children:o})}):null},ZMe=e=>{var c;const{content:t,field:n,id:r,readOnly:i,config:o}=e,a=t&&mR.converter(o.nodeExtensions).fromPrismic(o.schema,(c=o.defaultTextConverter)==null?void 0:c.call(o,o.schema))(t),u=LV(e.onContentChange),s=JEe({...a?{content:a.toJSON()}:{},editable:!i,editorProps:{attributes:{class:E.contentEditableClass,id:r,tabIndex:"0"}},extensions:o.allComponents,injectCSS:!1,onUpdate({editor:l}){const f=mR.converter(o.nodeExtensions).toPrismic(l.state.doc);u(f)}},[r,i,u]);return I.jsxs(E.Field,{children:[I.jsx(E.FieldLabel,{htmlFor:r,children:wr(n)}),I.jsx(E.FieldControl,{children:I.jsxs(I.Fragment,{children:[I.jsx(BEe,{editor:s,style:{flex:1}}),(s==null?void 0:s.isEditable)&&I.jsx(JMe,{editor:s,nodeTypes:o.names.concat(IMe)})]})})]})},XMe=e=>{const{field:t}=e,n=U.useMemo(()=>{const{extensions:r,defaultTextConverter:i}=pRe(t.config),o=li(f=>f.extType===fR.Node)(r),a=r.flatMap(f=>f.richTextNodeTypes),u=r.map(f=>f.component),s=[...MMe(t,o),OMe.configure({supportedExtensionNames:li(f=>f.extType===fR.Node&&f.nodeType===kf.Text&&!f.lockedFormat)(r).map(f=>f.name)}),...u],c=s.map(f=>f.name),l=ROe(s);return{allComponents:s,extensionsNames:c,defaultTextConverter:i,nodeExtensions:o,names:a,schema:l}},[t]);return I.jsx(ZMe,{...e,config:n},n.extensionsNames.join("-"))},QMe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var s,c;const o=cu(t),a=exe(t),u=(e==null?void 0:e.value)??a;return I.jsxs(E.Field,{children:[I.jsx(E.FieldIcon,{children:I.jsx(E.Icon,{name:"arrowDropDownCircle"})}),I.jsx(E.FieldLabel,{htmlFor:n,children:wr(t)}),I.jsx(E.FieldControl,{children:I.jsxs(E.Select,{id:n,onValueChange:l=>{i||r(txe(l))},placeholder:o,...u===void 0?{}:{value:u},children:[u===void 0||a!==void 0?null:I.jsx(E.SelectItem,{value:"",children:o}),(c=(s=t.config)==null?void 0:s.options)==null?void 0:c.map(l=>I.jsx(E.SelectItem,{value:l,children:l},l))]})})]},u)};function exe(e){var t,n;return((t=e.config)==null?void 0:t.default_value)===void 0||(n=e.config.options)==null?void 0:n[0]}function txe(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Select",value:e}}const nxe=({id:e,readOnly:t,field:n,content:r,onContentChange:i})=>I.jsxs(E.Field,{children:[I.jsx(E.FieldIcon,{children:I.jsx(E.Icon,{name:"event"})}),I.jsx(E.FieldLabel,{id:e,children:wr(n)}),I.jsx(E.FieldControl,{children:I.jsx(I.Fragment,{children:I.jsx(E.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:I.jsx(E.DateInput,{mode:"date-time","aria-labelledby":e,readOnly:t,value:r==null?void 0:r.value,onValueChange:o=>i(rxe(o))})})})})]}),rxe=e=>e===void 0?void 0:{__TYPE__:"FieldContent",type:"Timestamp",value:e},a_=({content:e,nestableWidget:t,...n})=>t.type==="Boolean"?I.jsx(xSe,{...n,field:t,content:ot.isBooleanContent(e)?e:void 0}):t.type==="Date"?I.jsx(PSe,{...n,field:t,content:ot.isDateContent(e)?e:void 0}):t.type==="Timestamp"?I.jsx(nxe,{...n,field:t,content:ot.isTimestampContent(e)?e:void 0}):t.type==="Image"?I.jsx(d0e,{...n,field:t,content:ot.isImageContent(e)?e:void 0}):t.type==="Link"?I.jsx(S0e,{...n,field:t,content:ot.isLinkContent(e)?e:void 0}):t.type==="Number"?I.jsx(I0e,{...n,field:t,content:ot.isNumberContent(e)?e:void 0}):t.type==="StructuredText"?I.jsx(XMe,{...n,field:t,content:ot.isRichTextContent(e)?e:void 0}):t.type==="Select"?I.jsx(QMe,{...n,field:t,content:ot.isSelectContent(e)?e:void 0}):t.type==="Text"?I.jsx(g0e,{...n,field:t,content:ot.isTextContent(e)?e:void 0}):t.type==="Embed"?I.jsx(W$e,{...n,field:t,content:ot.isEmbedContent(e)?e:void 0}):t.type==="Color"?I.jsx(NSe,{...n,field:t,content:ot.isColorContent(e)?e:void 0}):null,R6=({content:e,id:t,nonRepeatableZone:n,onContentChange:r,readOnly:i})=>{const o=U.useMemo(()=>Object.entries(n),[n]);return I.jsx(I.Fragment,{children:o.map(([a,u])=>{const s=e[a];return I.jsx(a_,{id:`${t}.${a}`,readOnly:i,nestableWidget:u,content:ot.isNestableContent(s)?s:void 0,onContentChange:c=>{r(ixe(e,a,c))}},a)})})};function ixe(e,t,n){return n===void 0?Em(t)(e):{...e,[t]:n}}function oxe(e,t){return e.filter((n,r)=>r!==t)}function axe(e,t,n){const r=e.length;if(M6(t,r)||M6(n,r))return e;const i=[...e],o=i[t],a=i[n];return i[t]=a,i[n]=o,i}function M6(e,t){return e<0||e>=t}let uxe=0;function sxe(){return uxe++}const WR=({id:e,title:t,content:n,onContentChange:r,readOnly:i,repeatableZone:o})=>{const a=U.useMemo(()=>Object.entries(o),[o]),u=dxe(n),s=U.useRef(new Map);return Object.keys(o).length===0?null:(cxe(s.current,u),I.jsx(E.Group,{title:"Repeatable zone"+(t?` • ${t}`:""),addItemButtonTitle:"Add item in group",items:u,getItemKey:c=>s.current.get(c)??"",onAddItem:()=>r(u.concat(x6())),children:(c,l)=>{const f=new Map(c.value);return I.jsx(E.GroupItem,{index:l,title:"Item",onMove:({index:d,offset:p})=>{r(axe(u,d,d+p))},onDelete:({index:d})=>r(oxe(u,d)),children:a.map(([d,p])=>{const h=f.get(d);return I.jsx(a_,{content:ot.isNestableContent(h)?h:void 0,id:`${e}[${l}].${d}`,nestableWidget:p,onContentChange:v=>{const m=hxe(c,[d,v]),_=pxe(u,[l,m]);lxe(s.current,c,m),r(_)},readOnly:i},d)})})}}))};function cxe(e,t){const n=new Set(t);t.forEach(r=>{e.has(r)||e.set(r,sxe())});for(const[r]of e)n.has(r)||e.delete(r)}function lxe(e,t,n){const r=e.get(t);r!==void 0&&e.set(n,r)}const fxe={__TYPE__:"GroupItemContent",value:[]};function dxe(e){return e??[fxe]}function pxe(e,t){const[n,r]=t;return r?e.map((i,o)=>o===n?r:i):e.filter((i,o)=>o!==n)}function hxe(e,t){const[n,r]=t,i=(()=>r?Array.from(new Map(e.value).set(n,r)):e.value.filter(([o])=>o!==n))();return x6(i)}const x6=(e=[])=>({__TYPE__:"GroupItemContent",value:e}),mxe=({compositeSlice:e,content:t,onContentChange:n,...r})=>I.jsxs(E.FieldSet,{children:[I.jsx(E.FieldSetLegend,{children:vxe(e)}),I.jsx(R6,{...r,nonRepeatableZone:e["non-repeat"]??{},content:t.nonRepeat,onContentChange:i=>{n({...t,nonRepeat:i})}}),I.jsx(WR,{...r,repeatableZone:e.repeat??{},content:t.repeat,onContentChange:i=>{n({...t,repeat:i})}})]});function vxe(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const k6=({group:e,content:t,onContentChange:n,...r})=>{var i;return I.jsx(WR,{...r,title:A6(e),repeatableZone:((i=e.config)==null?void 0:i.fields)??{},content:t==null?void 0:t.value,onContentChange:o=>{n({__TYPE__:"GroupContentType",value:o})}})};function A6(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const gxe=({content:e,legacySlice:t,...n})=>I.jsxs(E.FieldSet,{children:[I.jsx(E.FieldSetLegend,{children:t.type==="Group"?A6(t):wr(t)}),t.type==="Group"?I.jsx(k6,{...n,group:t,content:ot.isGroupContent(e)?e:void 0}):I.jsx(a_,{...n,nestableWidget:t,content:ot.isNestableContent(e)?e:void 0,onContentChange:r=>{r&&n.onContentChange(r)}})]}),N6=({config:e,content:t,sliceKey:n,onContentChange:r,selected:i=!1,readOnly:o=!1,sharedSlice:a,...u})=>{const s=yxe(a,t.variation),c=U.useId();if(s===void 0)return null;const f={id:u.id??c,readOnly:o};return I.jsx(lS.Provider,{value:e,children:I.jsxs(E.FieldSet,{id:n,selected:i,children:[I.jsx(E.FieldSetLegend,{children:bxe(a,s)}),I.jsx(R6,{...f,nonRepeatableZone:s.primary??{},content:t.primary,onContentChange:d=>{r({...t,primary:d})}}),I.jsx(WR,{...f,repeatableZone:s.items??{},content:t.items,onContentChange:d=>{r({...t,items:d})}})]})})};function yxe(e,t){return U.useMemo(()=>e.variations.find(n=>n.id===t),[e,t])}function bxe(e,t){return[e.name,t.name].join(" • ")}const _xe=({selectionId:e,content:t,id:n,onContentChange:r,readOnly:i,sliceZone:o})=>{const a=fS();return I.jsx(I.Fragment,{children:t==null?void 0:t.value.map((u,s)=>{var p,h;const c=(h=(p=o.config)==null?void 0:p.choices)==null?void 0:h[u.name];if(c===void 0)return null;const l=e===u.key,f=u.widget,d={id:`${n}[${s}]`,key:u.key,sliceKey:u.key,onContentChange:v=>{const m={...u,widget:v},_=Sxe(t,[s,m]);r(_)},readOnly:i};if(c.type==="SharedSlice")return ot.isSharedSliceContent(f)?I.jsx(N6,{...d,config:a,sharedSlice:c,content:f,selected:l}):null;if(c.type==="Slice")return ot.isCompositeSliceContent(f)?I.jsx(mxe,{...d,compositeSlice:c,content:f}):null;{const v={...d,legacySlice:c};return ot.isSimpleSliceContent(f)?I.jsx(gxe,{...v,content:f}):null}})})};function Sxe(e,[t,n]){return{__TYPE__:"SliceContentType",value:e.value.map((r,i)=>i===t?n:r)}}const $xe=e=>{const n=e.replace(/ /g,"-").normalize("NFD").replace(/\p{M}/g,""),r=new RegExp("[^-_.\\w\\u0080-\\uFFFF]","g");return n.replace(r,"").replace(/[\u0300-\u036f]/g,"").toLowerCase()||""},Txe=e=>{const t=$xe(e);return t===""?void 0:{__TYPE__:"UIDContent",value:t}},Ixe=({id:e,field:t,content:n,onContentChange:r})=>I.jsxs(E.Field,{children:[I.jsx(E.FieldIcon,{children:I.jsx(E.Icon,{name:"tag"})}),I.jsx(E.FieldLabel,{htmlFor:e,children:wr(t)}),I.jsx(E.FieldControl,{children:I.jsx(E.TextInput,{id:e,variant:"success",placeholder:cu(t),value:(n==null?void 0:n.value)??"",onValueChange:i=>{r(Txe(i))},endAdornment:I.jsx(E.AnimatedElement,{animationDuration:150,children:!(n!=null&&n.value)&&I.jsx(E.Badge,{color:"tomato",children:"Required"})})})})]}),Oxe=({content:e,id:t,onContentChange:n,readOnly:r,staticZone:i})=>{const o=U.useMemo(()=>Object.entries(i),[i]);return I.jsxs(E.FieldSet,{children:[I.jsx(E.FieldSetLegend,{children:"Static Zone"}),o.map(([a,u])=>{const s={id:`${t}.${a}`,onContentChange:l=>{const{[a]:f,...d}=e;n({...d,...l!==void 0&&{[a]:l}})},readOnly:r},c=e[a];return u.type==="UID"?U.createElement(Ixe,{...s,content:ot.isUIDContent(c)?c:void 0,key:a,field:u}):u.type==="Group"?U.createElement(k6,{...s,content:ot.isGroupContent(c)?c:void 0,group:u,key:a}):U.createElement(a_,{...s,content:ot.isNestableContent(c)?c:void 0,key:a,nestableWidget:u})})]})},wxe=({id:e,readOnly:t,selection:n,section:r,content:i,onContentChange:o})=>{const[a,u]=Exe(r),[s,c]=Rxe(i);return Mxe(n),I.jsxs(E.Box,{display:"flex",flexDirection:"column",children:[I.jsx(Oxe,{id:e,readOnly:t,staticZone:a,content:s,onContentChange:l=>o({...c,...l})}),u.map(([l,f])=>{const d=c[l];return I.jsx(_xe,{id:`${e}.${l}`,readOnly:t,selectionId:n==null?void 0:n.id,sliceZone:f,content:d,onContentChange:p=>o({...s,...c,[l]:p})},l)})]})};function Cxe(e){return e.type==="Choice"||e.type==="Slices"}function Exe(e){return U.useMemo(()=>{const t=y(e,Dm(Cxe),p_(Cm));return[Hf(t),Gf(t)]},[e])}function Rxe(e){return U.useMemo(()=>Object.entries(e).reduce(([t,n],[r,i])=>{const o=ot.isSlicesContent(i),a={[r]:i};return[{...t,...o?{}:a},{...n,...o?a:{}}]},[{},{}]),[e])}function Mxe(e){const{id:t,key:n,offset:r=0}=e??{};U.useLayoutEffect(()=>{if(!t)return;const i=setTimeout(()=>{const o=document.getElementById(t);if(!o)return;const a=o.getBoundingClientRect().y+window.scrollY;window.scrollTo({top:a-r,behavior:"smooth"})},100);return()=>clearTimeout(i)},[t,n,r])}const xxe=({config:e,readOnly:t=!1,customType:n,sectionName:r,selection:i,content:o,onContentChange:a})=>{const u=U.useId();if(ui(n.json))return null;const s=kxe(n,r),[c,l]=Axe(s,o);return I.jsx(lS.Provider,{value:e,children:I.jsx(wxe,{id:u,readOnly:t,selection:i,section:s,content:c,onContentChange:f=>a({...l,...f})})})};function kxe(e,t){const n=e.json[t];if(n===void 0)throw new Error(`Cannot find a section with name '${t}'.`);return n}function Axe(e,t){return Object.entries(t).reduce(([n,r],[i,o])=>{const a=e[i]!==void 0,u={[i]:o};return[{...n,...a?u:{}},{...r,...a?{}:u}]},[{},{}])}Sn.DocumentEditor=xxe,Sn.SharedSliceEditor=N6,Object.defineProperty(Sn,Symbol.toStringTag,{value:"Module"})});
|