@prismicio/editor-fields 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DocumentEditor.d.ts +6 -6
- package/dist/GroupEditor.d.ts +2 -1
- package/dist/NestableWidgetSwitch.d.ts +1 -1
- package/dist/SectionEditor.d.ts +5 -5
- package/dist/fields/BooleanField.d.ts +1 -1
- package/dist/fields/DateField.d.ts +4 -4
- package/dist/{domain/fields/ImageField/CroppedImage.d.ts → fields/ImageField/CroppedDialog/croppedImage.d.ts} +3 -3
- package/dist/fields/ImageField/{CropperDialog.d.ts → CroppedDialog/index.d.ts} +3 -3
- package/dist/{domain/fields/ImageField/ExternalImage.d.ts → fields/ImageField/MediaPicker/externalImage.d.ts} +1 -2
- package/dist/fields/ImageField/MediaPicker/index.d.ts +8 -1
- package/dist/{domain/fields/ImageField/ImageField.d.ts → fields/ImageField/imageField.d.ts} +1 -2
- package/dist/fields/ImageField/index.d.ts +12 -1
- package/dist/fields/KeyTextField.d.ts +5 -5
- package/dist/fields/LinkField/index.d.ts +12 -1
- package/dist/fields/NumberField.d.ts +2 -2
- package/dist/fields/RichTextField/RichTextField.d.ts +1 -1
- package/dist/fields/RichTextField/coreExtensions/ListItem.d.ts +4 -4
- package/dist/fields/RichTextField/coreExtensions/Placeholder.d.ts +1 -1
- package/dist/fields/RichTextField/coreExtensions/Text.d.ts +1 -1
- package/dist/fields/RichTextField/coreExtensions/index.d.ts +1 -1
- package/dist/fields/RichTextField/extensions/Heading.d.ts +1 -1
- package/dist/fields/RichTextField/extensions/Link.d.ts +3 -2
- package/dist/fields/RichTextField/extensions/index.d.ts +1 -1
- package/dist/fields/RichTextField/globalExtensions/TextDirection.d.ts +1 -1
- package/dist/fields/RichTextField/models/EditorExtension.d.ts +2 -3
- package/dist/fields/RichTextField/models/MenuItems.d.ts +1 -1
- package/dist/fields/RichTextField/models/RichTextConfig.d.ts +1 -1
- package/dist/fields/RichTextField/models/Span.d.ts +2 -2
- package/dist/fields/SelectField.d.ts +2 -2
- package/dist/fields/utils.d.ts +6 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.es.js +30784 -28598
- package/dist/index.umd.js +39 -39
- package/dist/slices/CompositeSliceEditor.d.ts +3 -3
- package/dist/slices/LegacySliceEditor.d.ts +4 -4
- package/dist/slices/SharedSliceEditor.d.ts +1 -1
- package/dist/zones/NonRepeatableZoneEditor.d.ts +6 -4
- package/dist/zones/RepeatableZoneEditor.d.ts +4 -4
- package/dist/zones/SliceZoneEditor.d.ts +5 -5
- package/dist/zones/StaticZone.d.ts +4 -0
- package/dist/zones/StaticZoneEditor.d.ts +3 -3
- package/package.json +26 -29
- package/dist/domain/Document.d.ts +0 -8
- package/dist/domain/Field.d.ts +0 -6
- package/dist/domain/Group.d.ts +0 -7
- package/dist/domain/NestableWidget.d.ts +0 -11
- package/dist/domain/Section.d.ts +0 -10
- package/dist/domain/SharedSlices.d.ts +0 -3
- package/dist/domain/StaticWidget.d.ts +0 -7
- package/dist/domain/Widget.d.ts +0 -9
- package/dist/domain/slices/CompositeSlice.d.ts +0 -6
- package/dist/domain/slices/LegacySlice.d.ts +0 -2
- package/dist/domain/slices/SharedSlice.d.ts +0 -9
- package/dist/domain/zones/NonRepeatableZone.d.ts +0 -5
- package/dist/domain/zones/RepeatableZone.d.ts +0 -6
- package/dist/domain/zones/SliceZone.d.ts +0 -5
- package/dist/domain/zones/StaticZone.d.ts +0 -6
- package/dist/fields/ImageField/ImageField.d.ts +0 -12
- package/dist/fields/ImageField/MediaPicker/MediaPicker.d.ts +0 -8
- package/dist/fields/LinkField/LinkField.d.ts +0 -12
package/dist/index.umd.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
(function(ni,ie){typeof exports=="object"&&typeof module<"u"?ie(exports,require("react"),require("@prismicio/editor-ui"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@prismicio/editor-ui","react-dom"],ie):(ni=typeof globalThis<"u"?globalThis:ni||self,ie(ni.EditorFields={},ni.React,ni.EditorUi,ni.ReactDOM))})(this,function(ni,ie,A,Nm){"use strict";const CC=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function xC(e){if(e&&e.__esModule)return 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 Vc=CC(ie),ye=xC(ie),YH=CC(Nm),ZH=xC(Nm);var se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function La(e){var t=e.default;if(typeof t=="function"){var n=function(){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 kC={},K={exports:{}};(function(e){var t,n,r,i,o,a,u,s,c,l,f,d,p,h,v,y,b,w,F,g,T,I,W,E,J;(function(q){var x=typeof se=="object"?se:typeof self=="object"?self:typeof this=="object"?this:{};q(G(x,G(e.exports)));function G(O,R){return O!==x&&(typeof Object.create=="function"?Object.defineProperty(O,"__esModule",{value:!0}):O.__esModule=!0),function(k,L){return O[k]=R?R(k,L):L}}})(function(q){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,R){O.__proto__=R}||function(O,R){for(var k in R)Object.prototype.hasOwnProperty.call(R,k)&&(O[k]=R[k])};t=function(O,R){if(typeof R!="function"&&R!==null)throw new TypeError("Class extends value "+String(R)+" is not a constructor or null");x(O,R);function k(){this.constructor=O}O.prototype=R===null?Object.create(R):(k.prototype=R.prototype,new k)},n=Object.assign||function(O){for(var R,k=1,L=arguments.length;k<L;k++){R=arguments[k];for(var z in R)Object.prototype.hasOwnProperty.call(R,z)&&(O[z]=R[z])}return O},r=function(O,R){var k={};for(var L in O)Object.prototype.hasOwnProperty.call(O,L)&&R.indexOf(L)<0&&(k[L]=O[L]);if(O!=null&&typeof Object.getOwnPropertySymbols=="function")for(var z=0,L=Object.getOwnPropertySymbols(O);z<L.length;z++)R.indexOf(L[z])<0&&Object.prototype.propertyIsEnumerable.call(O,L[z])&&(k[L[z]]=O[L[z]]);return k},i=function(O,R,k,L){var z=arguments.length,j=z<3?R:L===null?L=Object.getOwnPropertyDescriptor(R,k):L,S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(O,R,k,L);else for(var $=O.length-1;$>=0;$--)(S=O[$])&&(j=(z<3?S(j):z>3?S(R,k,j):S(R,k))||j);return z>3&&j&&Object.defineProperty(R,k,j),j},o=function(O,R){return function(k,L){R(k,L,O)}},a=function(O,R){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(O,R)},u=function(O,R,k,L){function z(j){return j instanceof k?j:new k(function(S){S(j)})}return new(k||(k=Promise))(function(j,S){function $(ge){try{Z(L.next(ge))}catch(he){S(he)}}function U(ge){try{Z(L.throw(ge))}catch(he){S(he)}}function Z(ge){ge.done?j(ge.value):z(ge.value).then($,U)}Z((L=L.apply(O,R||[])).next())})},s=function(O,R){var k={label:0,sent:function(){if(j[0]&1)throw j[1];return j[1]},trys:[],ops:[]},L,z,j,S;return S={next:$(0),throw:$(1),return:$(2)},typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function $(Z){return function(ge){return U([Z,ge])}}function U(Z){if(L)throw new TypeError("Generator is already executing.");for(;k;)try{if(L=1,z&&(j=Z[0]&2?z.return:Z[0]?z.throw||((j=z.return)&&j.call(z),0):z.next)&&!(j=j.call(z,Z[1])).done)return j;switch(z=0,j&&(Z=[Z[0]&2,j.value]),Z[0]){case 0:case 1:j=Z;break;case 4:return k.label++,{value:Z[1],done:!1};case 5:k.label++,z=Z[1],Z=[0];continue;case 7:Z=k.ops.pop(),k.trys.pop();continue;default:if(j=k.trys,!(j=j.length>0&&j[j.length-1])&&(Z[0]===6||Z[0]===2)){k=0;continue}if(Z[0]===3&&(!j||Z[1]>j[0]&&Z[1]<j[3])){k.label=Z[1];break}if(Z[0]===6&&k.label<j[1]){k.label=j[1],j=Z;break}if(j&&k.label<j[2]){k.label=j[2],k.ops.push(Z);break}j[2]&&k.ops.pop(),k.trys.pop();continue}Z=R.call(O,k)}catch(ge){Z=[6,ge],z=0}finally{L=j=0}if(Z[0]&5)throw Z[1];return{value:Z[0]?Z[1]:void 0,done:!0}}},c=function(O,R){for(var k in O)k!=="default"&&!Object.prototype.hasOwnProperty.call(R,k)&&J(R,O,k)},J=Object.create?function(O,R,k,L){L===void 0&&(L=k);var z=Object.getOwnPropertyDescriptor(R,k);(!z||("get"in z?!R.__esModule:z.writable||z.configurable))&&(z={enumerable:!0,get:function(){return R[k]}}),Object.defineProperty(O,L,z)}:function(O,R,k,L){L===void 0&&(L=k),O[L]=R[k]},l=function(O){var R=typeof Symbol=="function"&&Symbol.iterator,k=R&&O[R],L=0;if(k)return k.call(O);if(O&&typeof O.length=="number")return{next:function(){return O&&L>=O.length&&(O=void 0),{value:O&&O[L++],done:!O}}};throw new TypeError(R?"Object is not iterable.":"Symbol.iterator is not defined.")},f=function(O,R){var k=typeof Symbol=="function"&&O[Symbol.iterator];if(!k)return O;var L=k.call(O),z,j=[],S;try{for(;(R===void 0||R-- >0)&&!(z=L.next()).done;)j.push(z.value)}catch($){S={error:$}}finally{try{z&&!z.done&&(k=L.return)&&k.call(L)}finally{if(S)throw S.error}}return j},d=function(){for(var O=[],R=0;R<arguments.length;R++)O=O.concat(f(arguments[R]));return O},p=function(){for(var O=0,R=0,k=arguments.length;R<k;R++)O+=arguments[R].length;for(var L=Array(O),z=0,R=0;R<k;R++)for(var j=arguments[R],S=0,$=j.length;S<$;S++,z++)L[z]=j[S];return L},h=function(O,R,k){if(k||arguments.length===2)for(var L=0,z=R.length,j;L<z;L++)(j||!(L in R))&&(j||(j=Array.prototype.slice.call(R,0,L)),j[L]=R[L]);return O.concat(j||Array.prototype.slice.call(R))},v=function(O){return this instanceof v?(this.v=O,this):new v(O)},y=function(O,R,k){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var L=k.apply(O,R||[]),z,j=[];return z={},S("next"),S("throw"),S("return"),z[Symbol.asyncIterator]=function(){return this},z;function S(Te){L[Te]&&(z[Te]=function(et){return new Promise(function(Ft,Jt){j.push([Te,et,Ft,Jt])>1||$(Te,et)})})}function $(Te,et){try{U(L[Te](et))}catch(Ft){he(j[0][3],Ft)}}function U(Te){Te.value instanceof v?Promise.resolve(Te.value.v).then(Z,ge):he(j[0][2],Te)}function Z(Te){$("next",Te)}function ge(Te){$("throw",Te)}function he(Te,et){Te(et),j.shift(),j.length&&$(j[0][0],j[0][1])}},b=function(O){var R,k;return R={},L("next"),L("throw",function(z){throw z}),L("return"),R[Symbol.iterator]=function(){return this},R;function L(z,j){R[z]=O[z]?function(S){return(k=!k)?{value:v(O[z](S)),done:z==="return"}:j?j(S):S}:j}},w=function(O){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var R=O[Symbol.asyncIterator],k;return R?R.call(O):(O=typeof l=="function"?l(O):O[Symbol.iterator](),k={},L("next"),L("throw"),L("return"),k[Symbol.asyncIterator]=function(){return this},k);function L(j){k[j]=O[j]&&function(S){return new Promise(function($,U){S=O[j](S),z($,U,S.done,S.value)})}}function z(j,S,$,U){Promise.resolve(U).then(function(Z){j({value:Z,done:$})},S)}},F=function(O,R){return Object.defineProperty?Object.defineProperty(O,"raw",{value:R}):O.raw=R,O};var G=Object.create?function(O,R){Object.defineProperty(O,"default",{enumerable:!0,value:R})}:function(O,R){O.default=R};g=function(O){if(O&&O.__esModule)return O;var R={};if(O!=null)for(var k in O)k!=="default"&&Object.prototype.hasOwnProperty.call(O,k)&&J(R,O,k);return G(R,O),R},T=function(O){return O&&O.__esModule?O:{default:O}},I=function(O,R,k,L){if(k==="a"&&!L)throw new TypeError("Private accessor was defined without a getter");if(typeof R=="function"?O!==R||!L:!R.has(O))throw new TypeError("Cannot read private member from an object whose class did not declare it");return k==="m"?L:k==="a"?L.call(O):L?L.value:R.get(O)},W=function(O,R,k,L,z){if(L==="m")throw new TypeError("Private method is not writable");if(L==="a"&&!z)throw new TypeError("Private accessor was defined without a setter");if(typeof R=="function"?O!==R||!z:!R.has(O))throw new TypeError("Cannot write private member to an object whose class did not declare it");return L==="a"?z.call(O,k):z?z.value=k:R.set(O,k),k},E=function(O,R){if(R===null||typeof R!="object"&&typeof R!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof O=="function"?R===O:O.has(R)},q("__extends",t),q("__assign",n),q("__rest",r),q("__decorate",i),q("__param",o),q("__metadata",a),q("__awaiter",u),q("__generator",s),q("__exportStar",c),q("__createBinding",J),q("__values",l),q("__read",f),q("__spread",d),q("__spreadArrays",p),q("__spreadArray",h),q("__await",v),q("__asyncGenerator",y),q("__asyncDelegator",b),q("__asyncValues",w),q("__makeTemplateObject",F),q("__importStar",g),q("__importDefault",T),q("__classPrivateFieldGet",I),q("__classPrivateFieldSet",W),q("__classPrivateFieldIn",E)})})(K);var pn={},$o={},Hc={},Gt={},ja={};(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(T){return function(){return{meet:function(I,W){return function(E){return T.meet(I(E),W(E))}},join:function(I,W){return function(E){return T.join(I(E),W(E))}},zero:function(){return T.zero},one:function(){return T.one},implies:function(I,W){return function(E){return T.implies(I(E),W(E))}},not:function(I){return function(W){return T.not(I(W))}}}}};e.getBooleanAlgebra=t;var n=function(T){return function(){return{concat:function(I,W){return function(E){return T.concat(I(E),W(E))}}}}};e.getSemigroup=n;var r=function(T){var I=(0,e.getSemigroup)(T);return function(){return{concat:I().concat,empty:function(){return T.empty}}}};e.getMonoid=r;var i=function(T){return{add:function(I,W){return function(E){return T.add(I(E),W(E))}},zero:function(){return T.zero},mul:function(I,W){return function(E){return T.mul(I(E),W(E))}},one:function(){return T.one}}};e.getSemiring=i;var o=function(T){var I=(0,e.getSemiring)(T);return{add:I.add,mul:I.mul,one:I.one,zero:I.zero,sub:function(W,E){return function(J){return T.sub(W(J),E(J))}}}};e.getRing=o;var a=function(T){return function(I){return I(T)}};e.apply=a;function u(T){return T}e.identity=u,e.unsafeCoerce=u;function s(T){return function(){return T}}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(T){return function(I,W){return T(W,I)}}e.flip=c;function l(T,I,W,E,J,q,x,G,O){switch(arguments.length){case 1:return T;case 2:return function(){return I(T.apply(this,arguments))};case 3:return function(){return W(I(T.apply(this,arguments)))};case 4:return function(){return E(W(I(T.apply(this,arguments))))};case 5:return function(){return J(E(W(I(T.apply(this,arguments)))))};case 6:return function(){return q(J(E(W(I(T.apply(this,arguments))))))};case 7:return function(){return x(q(J(E(W(I(T.apply(this,arguments)))))))};case 8:return function(){return G(x(q(J(E(W(I(T.apply(this,arguments))))))))};case 9:return function(){return O(G(x(q(J(E(W(I(T.apply(this,arguments)))))))))}}}e.flow=l;function f(){for(var T=[],I=0;I<arguments.length;I++)T[I]=arguments[I];return T}e.tuple=f;function d(T){return T+1}e.increment=d;function p(T){return T-1}e.decrement=p;function h(T){throw new Error("Called `absurd` function which should be uncallable")}e.absurd=h;function v(T){return function(I){return T.apply(void 0,I)}}e.tupled=v;function y(T){return function(){for(var I=[],W=0;W<arguments.length;W++)I[W]=arguments[W];return T(I)}}e.untupled=y;function b(T,I,W,E,J,q,x,G,O){switch(arguments.length){case 1:return T;case 2:return I(T);case 3:return W(I(T));case 4:return E(W(I(T)));case 5:return J(E(W(I(T))));case 6:return q(J(E(W(I(T)))));case 7:return x(q(J(E(W(I(T))))));case 8:return G(x(q(J(E(W(I(T)))))));case 9:return O(G(x(q(J(E(W(I(T))))))));default:{for(var R=arguments[0],k=1;k<arguments.length;k++)R=arguments[k](R);return R}}}e.pipe=b,e.hole=h;var w=function(T,I){return I};e.SK=w;function F(T){return function(I){return!T(I)}}e.not=F;var g=function(){return{concat:function(T,I){return l(T,I)},empty:u}};e.getEndomorphismMonoid=g})(ja);var Re={},XH=se&&se.__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))};Object.defineProperty(Re,"__esModule",{value:!0}),Re.fromReadonlyNonEmptyArray=Re.has=Re.emptyRecord=Re.emptyReadonlyArray=Re.tail=Re.head=Re.isNonEmpty=Re.singleton=Re.right=Re.left=Re.isRight=Re.isLeft=Re.some=Re.none=Re.isSome=Re.isNone=void 0;var QH=function(e){return e._tag==="None"};Re.isNone=QH;var e6=function(e){return e._tag==="Some"};Re.isSome=e6,Re.none={_tag:"None"};var t6=function(e){return{_tag:"Some",value:e}};Re.some=t6;var n6=function(e){return e._tag==="Left"};Re.isLeft=n6;var r6=function(e){return e._tag==="Right"};Re.isRight=r6;var i6=function(e){return{_tag:"Left",left:e}};Re.left=i6;var o6=function(e){return{_tag:"Right",right:e}};Re.right=o6;var a6=function(e){return[e]};Re.singleton=a6;var u6=function(e){return e.length>0};Re.isNonEmpty=u6;var s6=function(e){return e[0]};Re.head=s6;var c6=function(e){return e.slice(1)};Re.tail=c6,Re.emptyReadonlyArray=[],Re.emptyRecord={},Re.has=Object.prototype.hasOwnProperty;var l6=function(e){return XH([e[0]],e.slice(1),!0)};Re.fromReadonlyNonEmptyArray=l6;var f6=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),d6=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),p6=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&f6(t,e,n);return d6(t,e),t};Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.sequenceS=Gt.sequenceT=Gt.getApplySemigroup=Gt.apS=Gt.apSecond=Gt.apFirst=Gt.ap=void 0;var h6=ja,m6=p6(Re);function v6(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)}}}Gt.ap=v6;function g6(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}Gt.apFirst=g6;function y6(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}Gt.apSecond=y6;function b6(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)}}}Gt.apS=b6;function _6(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)}}}}Gt.getApplySemigroup=_6;function l$(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):l$(e,t-1,i)}}var f$={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 $6(e){return m6.has.call(f$,e)||(f$[e]=l$(h6.tuple,e-1,[])),f$[e]}function S6(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=$6(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}Gt.sequenceT=S6;function T6(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 l$(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 I6(e){return function(t){for(var n=Object.keys(t),r=n.length,i=T6(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}Gt.sequenceS=I6;var xr={};Object.defineProperty(xr,"__esModule",{value:!0}),xr.getFunctorComposition=xr.bindTo=xr.flap=xr.map=void 0;var O6=ja;function AC(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}xr.map=AC;function w6(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}xr.flap=w6;function E6(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}xr.bindTo=E6;function R6(e,t){var n=AC(e,t);return{map:function(r,i){return(0,O6.pipe)(r,n(i))}}}xr.getFunctorComposition=R6,Object.defineProperty(Hc,"__esModule",{value:!0}),Hc.getApplicativeComposition=Hc.getApplicativeMonoid=void 0;var WC=Gt,M6=ja,C6=xr;function x6(e){var t=(0,WC.getApplySemigroup)(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}Hc.getApplicativeMonoid=x6;function k6(e,t){var n=(0,C6.getFunctorComposition)(e,t).map,r=(0,WC.ap)(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return(0,M6.pipe)(i,r(o))}}}Hc.getApplicativeComposition=k6;var es={};Object.defineProperty(es,"__esModule",{value:!0}),es.bind=es.chainFirst=void 0;function A6(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}es.chainFirst=A6;function W6(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))})})}}}es.bind=W6;var Pm={};Object.defineProperty(Pm,"__esModule",{value:!0}),Pm.tailRec=void 0;var N6=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};Pm.tailRec=N6;var Dt={},P6=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),F6=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),D6=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&P6(t,e,n);return F6(t,e),t};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.filterOrElse=Dt.chainFirstEitherK=Dt.chainEitherK=Dt.fromEitherK=Dt.chainOptionK=Dt.fromOptionK=Dt.fromPredicate=Dt.fromOption=void 0;var L6=es,d$=ja,ts=D6(Re);function NC(e){return function(t){return function(n){return e.fromEither(ts.isNone(n)?ts.left(t()):ts.right(n.value))}}}Dt.fromOption=NC;function j6(e){return function(t,n){return function(r){return e.fromEither(t(r)?ts.right(r):ts.left(n(r)))}}}Dt.fromPredicate=j6;function PC(e){var t=NC(e);return function(n){var r=t(n);return function(i){return(0,d$.flow)(i,r)}}}Dt.fromOptionK=PC;function U6(e,t){var n=PC(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}Dt.chainOptionK=U6;function p$(e){return function(t){return(0,d$.flow)(t,e.fromEither)}}Dt.fromEitherK=p$;function B6(e,t){var n=p$(e);return function(r){return function(i){return t.chain(i,n(r))}}}Dt.chainEitherK=B6;function z6(e,t){return(0,d$.flow)(p$(e),(0,L6.chainFirst)(t))}Dt.chainFirstEitherK=z6;function q6(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?ts.right(o):ts.left(r(o)))})}}}Dt.filterOrElse=q6;var FC={};(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=ja,n=xr,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})(FC);var Ua={},K6=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),V6=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),H6=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&K6(t,e,n);return V6(t,e),t};Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.filterE=Ua.witherDefault=Ua.wiltDefault=void 0;var DC=H6(Re);function J6(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}Ua.wiltDefault=J6;function G6(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}Ua.witherDefault=G6;function Y6(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?DC.some(o):DC.none})})}}}}Ua.filterE=Y6,function(e){var t=se&&se.__createBinding||(Object.create?function(N,M,D,Me){Me===void 0&&(Me=D);var P=Object.getOwnPropertyDescriptor(M,D);(!P||("get"in P?!M.__esModule:P.writable||P.configurable))&&(P={enumerable:!0,get:function(){return M[D]}}),Object.defineProperty(N,Me,P)}:function(N,M,D,Me){Me===void 0&&(Me=D),N[Me]=M[D]}),n=se&&se.__setModuleDefault||(Object.create?function(N,M){Object.defineProperty(N,"default",{enumerable:!0,value:M})}:function(N,M){N.default=M}),r=se&&se.__importStar||function(N){if(N&&N.__esModule)return N;var M={};if(N!=null)for(var D in N)D!=="default"&&Object.prototype.hasOwnProperty.call(N,D)&&t(M,N,D);return n(M,N),M};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=Hc,o=Gt,a=es,u=Pm,s=Dt,c=ja,l=xr,f=r(Re),d=FC,p=Ua;e.left=f.left,e.right=f.right;var h=function(N,M){return(0,c.pipe)(N,(0,e.map)(M))},v=function(N,M){return(0,c.pipe)(N,(0,e.ap)(M))},y=function(N,M){return(0,c.pipe)(N,(0,e.chain)(M))},b=function(N,M,D){return(0,c.pipe)(N,(0,e.reduce)(M,D))},w=function(N){return function(M,D){var Me=(0,e.foldMap)(N);return(0,c.pipe)(M,Me(D))}},F=function(N,M,D){return(0,c.pipe)(N,(0,e.reduceRight)(M,D))},g=function(N){var M=(0,e.traverse)(N);return function(D,Me){return(0,c.pipe)(D,M(Me))}},T=function(N,M,D){return(0,c.pipe)(N,(0,e.bimap)(M,D))},I=function(N,M){return(0,c.pipe)(N,(0,e.mapLeft)(M))},W=function(N,M){return(0,c.pipe)(N,(0,e.alt)(M))},E=function(N,M){return(0,c.pipe)(N,(0,e.extend)(M))},J=function(N,M){return(0,u.tailRec)(M(N),function(D){return(0,e.isLeft)(D)?(0,e.right)((0,e.left)(D.left)):(0,e.isLeft)(D.right)?(0,e.left)(M(D.right.left)):(0,e.right)((0,e.right)(D.right.right))})};e.URI="Either";var q=function(N,M){return{show:function(D){return(0,e.isLeft)(D)?"left(".concat(N.show(D.left),")"):"right(".concat(M.show(D.right),")")}}};e.getShow=q;var x=function(N,M){return{equals:function(D,Me){return D===Me||((0,e.isLeft)(D)?(0,e.isLeft)(Me)&&N.equals(D.left,Me.left):(0,e.isRight)(Me)&&M.equals(D.right,Me.right))}}};e.getEq=x;var G=function(N){return{concat:function(M,D){return(0,e.isLeft)(D)?M:(0,e.isLeft)(M)?D:(0,e.right)(N.concat(M.right,D.right))}}};e.getSemigroup=G;var O=function(N){var M=(0,e.left)(N.empty);return{URI:e.URI,_E:void 0,compact:function(D){return(0,e.isLeft)(D)?D:D.right._tag==="None"?M:(0,e.right)(D.right.value)},separate:function(D){return(0,e.isLeft)(D)?(0,d.separated)(D,D):(0,e.isLeft)(D.right)?(0,d.separated)((0,e.right)(D.right.left),M):(0,d.separated)(M,(0,e.right)(D.right.right))}}};e.getCompactable=O;var R=function(N){var M=(0,e.left)(N.empty),D=(0,e.getCompactable)(N),Me=D.compact,P=D.separate,re=function(de,$e){return(0,e.isLeft)(de)||$e(de.right)?de:M},pe=function(de,$e){return(0,e.isLeft)(de)?(0,d.separated)(de,de):$e(de.right)?(0,d.separated)(M,(0,e.right)(de.right)):(0,d.separated)((0,e.right)(de.right),M)};return{URI:e.URI,_E:void 0,map:h,compact:Me,separate:P,filter:re,filterMap:function(de,$e){if((0,e.isLeft)(de))return de;var ot=$e(de.right);return ot._tag==="None"?M:(0,e.right)(ot.value)},partition:pe,partitionMap:function(de,$e){if((0,e.isLeft)(de))return(0,d.separated)(de,de);var ot=$e(de.right);return(0,e.isLeft)(ot)?(0,d.separated)((0,e.right)(ot.left),M):(0,d.separated)(M,(0,e.right)(ot.right))}}};e.getFilterable=R;var k=function(N){var M=(0,e.getFilterable)(N),D=(0,e.getCompactable)(N);return{URI:e.URI,_E:void 0,map:h,compact:M.compact,separate:M.separate,filter:M.filter,filterMap:M.filterMap,partition:M.partition,partitionMap:M.partitionMap,traverse:g,sequence:e.sequence,reduce:b,foldMap:w,reduceRight:F,wither:(0,p.witherDefault)(e.Traversable,D),wilt:(0,p.wiltDefault)(e.Traversable,D)}};e.getWitherable=k;var L=function(N){return{URI:e.URI,_E:void 0,map:h,ap:function(M,D){return(0,e.isLeft)(M)?(0,e.isLeft)(D)?(0,e.left)(N.concat(M.left,D.left)):M:(0,e.isLeft)(D)?D:(0,e.right)(M.right(D.right))},of:e.of}};e.getApplicativeValidation=L;var z=function(N){return{URI:e.URI,_E:void 0,map:h,alt:function(M,D){if((0,e.isRight)(M))return M;var Me=D();return(0,e.isLeft)(Me)?(0,e.left)(N.concat(M.left,Me.left)):Me}}};e.getAltValidation=z;var j=function(N){return function(M){return(0,e.isLeft)(M)?M:(0,e.right)(N(M.right))}};e.map=j,e.Functor={URI:e.URI,map:h},e.of=e.right,e.Pointed={URI:e.URI,of:e.of};var S=function(N){return function(M){return(0,e.isLeft)(M)?M:(0,e.isLeft)(N)?N:(0,e.right)(M.right(N.right))}};e.apW=S,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 $=function(N){return function(M){return(0,e.isLeft)(M)?M:N(M.right)}};e.chainW=$,e.chain=e.chainW,e.Chain={URI:e.URI,map:h,ap:v,chain:y},e.Monad={URI:e.URI,map:h,ap:v,of:e.of,chain:y};var U=function(N,M){return function(D){return(0,e.isLeft)(D)?N:M(N,D.right)}};e.reduce=U;var Z=function(N){return function(M){return function(D){return(0,e.isLeft)(D)?N.empty:M(D.right)}}};e.foldMap=Z;var ge=function(N,M){return function(D){return(0,e.isLeft)(D)?N:M(D.right,N)}};e.reduceRight=ge,e.Foldable={URI:e.URI,reduce:b,foldMap:w,reduceRight:F};var he=function(N){return function(M){return function(D){return(0,e.isLeft)(D)?N.of((0,e.left)(D.left)):N.map(M(D.right),e.right)}}};e.traverse=he;var Te=function(N){return function(M){return(0,e.isLeft)(M)?N.of((0,e.left)(M.left)):N.map(M.right,e.right)}};e.sequence=Te,e.Traversable={URI:e.URI,map:h,reduce:b,foldMap:w,reduceRight:F,traverse:g,sequence:e.sequence};var et=function(N,M){return function(D){return(0,e.isLeft)(D)?(0,e.left)(N(D.left)):(0,e.right)(M(D.right))}};e.bimap=et;var Ft=function(N){return function(M){return(0,e.isLeft)(M)?(0,e.left)(N(M.left)):M}};e.mapLeft=Ft,e.Bifunctor={URI:e.URI,bimap:T,mapLeft:I};var Jt=function(N){return function(M){return(0,e.isLeft)(M)?N():M}};e.altW=Jt,e.alt=e.altW,e.Alt={URI:e.URI,map:h,alt:W};var Zr=function(N){return function(M){return(0,e.isLeft)(M)?M:(0,e.right)(N(M))}};e.extend=Zr,e.Extend={URI:e.URI,map:h,extend:E},e.ChainRec={URI:e.URI,map:h,ap:v,chain:y,chainRec:J},e.throwError=e.left,e.MonadThrow={URI:e.URI,map:h,ap:v,of:e.of,chain:y,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 Nn=function(N,M){return function(D){return(0,e.isLeft)(D)?N(D.left):M(D.right)}};e.matchW=Nn,e.foldW=e.matchW,e.match=e.matchW,e.fold=e.match;var bo=function(N){return function(M){return(0,e.isLeft)(M)?N(M.left):M.right}};e.getOrElseW=bo,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 xa=function(N){return(0,e.isLeft)(N)?(0,e.right)(N.left):(0,e.left)(N.right)};e.swap=xa;var ka=function(N){return function(M){return(0,e.isLeft)(M)?N(M.left):M}};e.orElseW=ka,e.orElse=e.orElseW;var Xu=function(N){return function(M){return M==null?(0,e.left)(N):(0,e.right)(M)}};e.fromNullable=Xu;var Wi=function(N,M){try{return(0,e.right)(N())}catch(D){return(0,e.left)(M(D))}};e.tryCatch=Wi;var Xr=function(N,M){return function(){for(var D=[],Me=0;Me<arguments.length;Me++)D[Me]=arguments[Me];return(0,e.tryCatch)(function(){return N.apply(void 0,D)},M)}};e.tryCatchK=Xr;var _o=function(N){var M=(0,e.fromNullable)(N);return function(D){return(0,c.flow)(D,M)}};e.fromNullableK=_o;var Aa=function(N){var M=(0,e.fromNullableK)(N);return function(D){return(0,e.chain)(M(D))}};e.chainNullableK=Aa,e.toUnion=(0,e.foldW)(c.identity,c.identity);function Ni(N){return N instanceof Error?N:new Error(String(N))}e.toError=Ni;function ar(N){return function(M,D){if(D===void 0){var Me=ar(N);return function(P){return Me(M,P)}}return(0,e.isLeft)(D)?!1:N.equals(M,D.right)}}e.elem=ar;var Qr=function(N){return function(M){return(0,e.isLeft)(M)?!1:N(M.right)}};e.exists=Qr,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 Pi=function(N){return function(M){var D=N(0,f.head(M));if((0,e.isLeft)(D))return D;for(var Me=[D.right],P=1;P<M.length;P++){var re=N(P,M[P]);if((0,e.isLeft)(re))return re;Me.push(re.right)}return(0,e.right)(Me)}};e.traverseReadonlyNonEmptyArrayWithIndex=Pi;var Fi=function(N){var M=(0,e.traverseReadonlyNonEmptyArrayWithIndex)(N);return function(D){return f.isNonEmpty(D)?M(D):e.ApT}};e.traverseReadonlyArrayWithIndex=Fi,e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex;var Wa=function(N){return(0,e.traverseReadonlyArrayWithIndex)(function(M,D){return N(D)})};e.traverseArray=Wa,e.sequenceArray=(0,e.traverseArray)(c.identity);function Na(N,M){return(0,e.tryCatch)(function(){return JSON.parse(N)},M)}e.parseJSON=Na;var Pa=function(N,M){return(0,e.tryCatch)(function(){var D=JSON.stringify(N);if(typeof D!="string")throw new Error("Converting unsupported structure to JSON");return D},M)};e.stringifyJSON=Pa,e.either={URI:e.URI,map:h,of:e.of,ap:v,chain:y,reduce:b,foldMap:w,reduceRight:F,traverse:g,sequence:e.sequence,bimap:T,mapLeft:I,alt:W,extend:E,chainRec:J,throwError:e.throwError},e.getApplySemigroup=(0,o.getApplySemigroup)(e.Apply),e.getApplyMonoid=(0,i.getApplicativeMonoid)(e.Applicative);var ei=function(N,M){return(0,o.getApplySemigroup)((0,e.getApplicativeValidation)(N))(M)};e.getValidationSemigroup=ei;var Qu=function(N,M){return(0,i.getApplicativeMonoid)((0,e.getApplicativeValidation)(N))(M)};e.getValidationMonoid=Qu;function Sd(N){var M=(0,e.getApplicativeValidation)(N).ap,D=(0,e.getAltValidation)(N).alt;return{URI:e.URI,_E:void 0,map:h,of:e.of,chain:y,bimap:T,mapLeft:I,reduce:b,foldMap:w,reduceRight:F,extend:E,traverse:g,sequence:e.sequence,chainRec:J,throwError:e.throwError,ap:M,alt:D}}e.getValidation=Sd}($o);var LC=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))}}}}},h$=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},jC=function(e){var t=h$(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}},m$=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}}},UC=function(e){var t=m$(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))}}}},Z6=function(e){return function(t){return t(e)}};function B(e){return e}var Jc=B;function Dn(e){return function(){return e}}var v$=Dn(!0),BC=Dn(!1),zC=Dn(null),g$=Dn(void 0),X6=g$;function Q6(e){return function(t,n){return e(n,t)}}function X(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 qC(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e}function eJ(e){return e+1}function tJ(e){return e-1}function KC(e){throw new Error("Called `absurd` function which should be uncallable")}function nJ(e){return function(t){return e.apply(void 0,t)}}function rJ(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(t)}}function m(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 iJ=KC,Ln=function(e,t){return t};function oJ(e){return function(t){return!e(t)}}var aJ=function(){return{concat:function(e,t){return X(e,t)},empty:B}};const VC=Object.freeze(Object.defineProperty({__proto__:null,getBooleanAlgebra:LC,getSemigroup:h$,getMonoid:jC,getSemiring:m$,getRing:UC,apply:Z6,identity:B,unsafeCoerce:Jc,constant:Dn,constTrue:v$,constFalse:BC,constNull:zC,constUndefined:g$,constVoid:X6,flip:Q6,flow:X,tuple:qC,increment:eJ,decrement:tJ,absurd:KC,tupled:nJ,untupled:rJ,pipe:m,hole:iJ,SK:Ln,not:oJ,getEndomorphismMonoid:aJ},Symbol.toStringTag,{value:"Module"}));var uJ=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))},Ct=function(e){return e._tag==="None"},mt=function(e){return e._tag==="Some"},me={_tag:"None"},le=function(e){return{_tag:"Some",value:e}},Lt=function(e){return e._tag==="Left"},y$=function(e){return e._tag==="Right"},So=function(e){return{_tag:"Left",left:e}},Ba=function(e){return{_tag:"Right",right:e}},Rd=function(e){return[e]},dt=function(e){return e.length>0},ur=function(e){return e[0]},Gc=function(e){return e.slice(1)},Yt=[],jt={},at=Object.prototype.hasOwnProperty,Fm=function(e){return uJ([e[0]],e.slice(1),!0)};function To(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 St(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}function Tt(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}function It(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 Ut(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 b$(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):b$(e,t-1,i)}}var _$={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 sJ(e){return at.call(_$,e)||(_$[e]=b$(qC,e-1,[])),_$[e]}function cJ(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=sJ(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}function lJ(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 b$(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 fJ(e){return function(t){for(var n=Object.keys(t),r=n.length,i=lJ(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}const dJ=Object.freeze(Object.defineProperty({__proto__:null,ap:To,apFirst:St,apSecond:Tt,apS:It,getApplySemigroup:Ut,sequenceT:cJ,sequenceS:fJ},Symbol.toStringTag,{value:"Module"}));function Yc(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function De(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}function Ot(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}function Zc(e,t){var n=Yc(e,t);return{map:function(r,i){return m(r,n(i))}}}const pJ=Object.freeze(Object.defineProperty({__proto__:null,map:Yc,flap:De,bindTo:Ot,getFunctorComposition:Zc},Symbol.toStringTag,{value:"Module"}));function kr(e){var t=Ut(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function HC(e,t){var n=Zc(e,t).map,r=To(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return m(i,r(o))}}}const hJ=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeMonoid:kr,getApplicativeComposition:HC},Symbol.toStringTag,{value:"Module"}));function ut(e){return function(t){return function(n){return e.chain(n,function(r){return e.map(t(r),function(){return r})})}}}function wt(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 mJ=Object.freeze(Object.defineProperty({__proto__:null,chainFirst:ut,bind:wt},Symbol.toStringTag,{value:"Module"}));var $$=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};const vJ=Object.freeze(Object.defineProperty({__proto__:null,tailRec:$$},Symbol.toStringTag,{value:"Module"}));function Li(e){return function(t){return function(n){return e.fromEither(Ct(n)?So(t()):Ba(n.value))}}}function za(e){return function(t,n){return function(r){return e.fromEither(t(r)?Ba(r):So(n(r)))}}}function ji(e){var t=Li(e);return function(n){var r=t(n);return function(i){return X(i,r)}}}function ns(e,t){var n=ji(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}function sr(e){return function(t){return X(t,e.fromEither)}}function Io(e,t){var n=sr(e);return function(r){return function(i){return t.chain(i,n(r))}}}function Oo(e,t){return X(sr(e),ut(t))}function rs(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Ba(o):So(r(o)))})}}}const gJ=Object.freeze(Object.defineProperty({__proto__:null,fromOption:Li,fromPredicate:za,fromOptionK:ji,chainOptionK:ns,fromEitherK:sr,chainEitherK:Io,chainFirstEitherK:Oo,filterOrElse:rs},Symbol.toStringTag,{value:"Module"}));var Oe=function(e,t){return{left:e,right:t}},yJ=function(e,t){return m(e,S$(t))},bJ=function(e,t){return m(e,JC(t))},_J=function(e,t,n){return m(e,GC(t,n))},S$=function(e){return function(t){return Oe(Md(t),e(Cd(t)))}},JC=function(e){return function(t){return Oe(e(Md(t)),Cd(t))}},GC=function(e,t){return function(n){return Oe(e(Md(n)),t(Cd(n)))}},T$="Separated",$J={URI:T$,mapLeft:bJ,bimap:_J},YC={URI:T$,map:yJ},SJ=De(YC),Md=function(e){return e.left},Cd=function(e){return e.right};const TJ=Object.freeze(Object.defineProperty({__proto__:null,separated:Oe,map:S$,mapLeft:JC,bimap:GC,URI:T$,Bifunctor:$J,Functor:YC,flap:SJ,left:Md,right:Cd},Symbol.toStringTag,{value:"Module"}));function ri(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}function ii(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}function I$(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?le(o):me})})}}}}const IJ=Object.freeze(Object.defineProperty({__proto__:null,wiltDefault:ri,witherDefault:ii,filterE:I$},Symbol.toStringTag,{value:"Module"}));var bt=So,Be=Ba,hn=function(e,t){return m(e,us(t))},is=function(e,t){return m(e,ex(t))},Xc=function(e,t){return m(e,Ar(t))},xd=function(e,t,n){return m(e,nx(t,n))},kd=function(e){return function(t,n){var r=rx(e);return m(t,r(n))}},Ad=function(e,t,n){return m(e,ix(t,n))},Dm=function(e){var t=ox(e);return function(n,r){return m(n,t(r))}},O$=function(e,t,n){return m(e,x$(t,n))},w$=function(e,t){return m(e,Fd(t))},ZC=function(e,t){return m(e,ux(t))},E$=function(e,t){return m(e,k$(t))},R$=function(e,t){return $$(t(e),function(n){return oe(n)?Be(bt(n.left)):oe(n.right)?bt(t(n.right.left)):Be(Be(n.right.right))})},_t="Either",OJ=function(e,t){return{show:function(n){return oe(n)?"left(".concat(e.show(n.left),")"):"right(".concat(t.show(n.right),")")}}},wJ=function(e,t){return{equals:function(n,r){return n===r||(oe(n)?oe(r)&&e.equals(n.left,r.left):A$(r)&&t.equals(n.right,r.right))}}},Wd=function(e){return{concat:function(t,n){return oe(n)?t:oe(t)?n:Be(e.concat(t.right,n.right))}}},as=function(e){var t=bt(e.empty);return{URI:_t,_E:void 0,compact:function(n){return oe(n)?n:n.right._tag==="None"?t:Be(n.right.value)},separate:function(n){return oe(n)?Oe(n,n):oe(n.right)?Oe(Be(n.right.left),t):Oe(t,Be(n.right.right))}}},Qc=function(e){var t=bt(e.empty),n=as(e),r=n.compact,i=n.separate,o=function(u,s){return oe(u)||s(u.right)?u:t},a=function(u,s){return oe(u)?Oe(u,u):s(u.right)?Oe(t,Be(u.right)):Oe(Be(u.right),t)};return{URI:_t,_E:void 0,map:hn,compact:r,separate:i,filter:o,filterMap:function(u,s){if(oe(u))return u;var c=s(u.right);return c._tag==="None"?t:Be(c.value)},partition:a,partitionMap:function(u,s){if(oe(u))return Oe(u,u);var c=s(u.right);return oe(c)?Oe(Be(c.left),t):Oe(t,Be(c.right))}}},EJ=function(e){var t=Qc(e),n=as(e);return{URI:_t,_E:void 0,map:hn,compact:t.compact,separate:t.separate,filter:t.filter,filterMap:t.filterMap,partition:t.partition,partitionMap:t.partitionMap,traverse:Dm,sequence:Pd,reduce:xd,foldMap:kd,reduceRight:Ad,wither:ii(C$,n),wilt:ri(C$,n)}},qa=function(e){return{URI:_t,_E:void 0,map:hn,ap:function(t,n){return oe(t)?oe(n)?bt(e.concat(t.left,n.left)):t:oe(n)?n:Be(t.right(n.right))},of:Ui}},XC=function(e){return{URI:_t,_E:void 0,map:hn,alt:function(t,n){if(A$(t))return t;var r=n();return oe(r)?bt(e.concat(t.left,r.left)):r}}},us=function(e){return function(t){return oe(t)?t:Be(e(t.right))}},Ka={URI:_t,map:hn},Ui=Be,RJ={URI:_t,of:Ui},QC=function(e){return function(t){return oe(t)?t:oe(e)?e:Be(t.right(e.right))}},ex=QC,el={URI:_t,map:hn,ap:is},tx={URI:_t,map:hn,ap:is,of:Ui},M$=function(e){return function(t){return oe(t)?t:e(t.right)}},Ar=M$,Nd={URI:_t,map:hn,ap:is,chain:Xc},MJ={URI:_t,map:hn,ap:is,of:Ui,chain:Xc},nx=function(e,t){return function(n){return oe(n)?e:t(e,n.right)}},rx=function(e){return function(t){return function(n){return oe(n)?e.empty:t(n.right)}}},ix=function(e,t){return function(n){return oe(n)?e:t(n.right,e)}},CJ={URI:_t,reduce:xd,foldMap:kd,reduceRight:Ad},ox=function(e){return function(t){return function(n){return oe(n)?e.of(bt(n.left)):e.map(t(n.right),Be)}}},Pd=function(e){return function(t){return oe(t)?e.of(bt(t.left)):e.map(t.right,Be)}},C$={URI:_t,map:hn,reduce:xd,foldMap:kd,reduceRight:Ad,traverse:Dm,sequence:Pd},x$=function(e,t){return function(n){return oe(n)?bt(e(n.left)):Be(t(n.right))}},Fd=function(e){return function(t){return oe(t)?bt(e(t.left)):t}},xJ={URI:_t,bimap:O$,mapLeft:w$},ax=function(e){return function(t){return oe(t)?e():t}},ux=ax,kJ={URI:_t,map:hn,alt:ZC},k$=function(e){return function(t){return oe(t)?t:Be(e(t))}},AJ={URI:_t,map:hn,extend:E$},WJ={URI:_t,map:hn,ap:is,chain:Xc,chainRec:R$},Lm=bt,NJ={URI:_t,map:hn,ap:is,of:Ui,chain:Xc,throwError:Lm},tl={URI:_t,fromEither:B},PJ=za(tl),sx=Li(tl),oe=Lt,A$=y$,W$=function(e,t){return function(n){return oe(n)?e(n.left):t(n.right)}},cx=W$,Va=W$,N$=Va,P$=function(e){return function(t){return oe(t)?e(t.left):t.right}},FJ=P$,DJ=De(Ka),lx=St(el),LJ=lx,fx=Tt(el),jJ=fx,dx=ut(Nd),UJ=dx,px=M$(B),BJ=px,zJ=k$(B),qJ=ji(tl),KJ=ns(tl,Nd),hx=rs(tl,Nd),VJ=hx,mx=function(e){return oe(e)?Be(e.left):bt(e.right)},vx=function(e){return function(t){return oe(t)?e(t.left):t}},gx=vx,F$=function(e){return function(t){return t==null?bt(e):Be(t)}},ss=function(e,t){try{return Be(e())}catch(n){return bt(t(n))}},HJ=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)}},yx=function(e){var t=F$(e);return function(n){return X(n,t)}},JJ=function(e){var t=yx(e);return function(n){return Ar(t(n))}},bx=cx(B,B);function GJ(e){return e instanceof Error?e:new Error(String(e))}function _x(e){return function(t,n){if(n===void 0){var r=_x(e);return function(i){return r(t,i)}}return oe(n)?!1:e.equals(t,n.right)}}var YJ=function(e){return function(t){return oe(t)?!1:e(t.right)}},ZJ=Ui(jt),XJ=Ot(Ka),$x=wt(Nd),QJ=$x,Sx=It(el),eG=Sx,Tx=Ui(Yt),Dd=function(e){return function(t){var n=e(0,ur(t));if(oe(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i]);if(oe(o))return o;r.push(o.right)}return Be(r)}},D$=function(e){var t=Dd(e);return function(n){return dt(n)?t(n):Tx}},tG=D$,Ix=function(e){return D$(function(t,n){return e(n)})},nG=Ix(B);function rG(e,t){return ss(function(){return JSON.parse(e)},t)}var iG=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)},oG={URI:_t,map:hn,of:Ui,ap:is,chain:Xc,reduce:xd,foldMap:kd,reduceRight:Ad,traverse:Dm,sequence:Pd,bimap:O$,mapLeft:w$,alt:ZC,extend:E$,chainRec:R$,throwError:Lm},aG=Ut(el),uG=kr(tx),sG=function(e,t){return Ut(qa(e))(t)},cG=function(e,t){return kr(qa(e))(t)};function lG(e){var t=qa(e).ap,n=XC(e).alt;return{URI:_t,_E:void 0,map:hn,of:Ui,chain:Xc,bimap:O$,mapLeft:w$,reduce:xd,foldMap:kd,reduceRight:Ad,extend:E$,traverse:Dm,sequence:Pd,chainRec:R$,throwError:Lm,ap:t,alt:n}}const Ox=Object.freeze(Object.defineProperty({__proto__:null,left:bt,right:Be,URI:_t,getShow:OJ,getEq:wJ,getSemigroup:Wd,getCompactable:as,getFilterable:Qc,getWitherable:EJ,getApplicativeValidation:qa,getAltValidation:XC,map:us,Functor:Ka,of:Ui,Pointed:RJ,apW:QC,ap:ex,Apply:el,Applicative:tx,chainW:M$,chain:Ar,Chain:Nd,Monad:MJ,reduce:nx,foldMap:rx,reduceRight:ix,Foldable:CJ,traverse:ox,sequence:Pd,Traversable:C$,bimap:x$,mapLeft:Fd,Bifunctor:xJ,altW:ax,alt:ux,Alt:kJ,extend:k$,Extend:AJ,ChainRec:WJ,throwError:Lm,MonadThrow:NJ,FromEither:tl,fromPredicate:PJ,fromOption:sx,isLeft:oe,isRight:A$,matchW:W$,foldW:cx,match:Va,fold:N$,getOrElseW:P$,getOrElse:FJ,flap:DJ,apFirst:lx,apFirstW:LJ,apSecond:fx,apSecondW:jJ,chainFirst:dx,chainFirstW:UJ,flattenW:px,flatten:BJ,duplicate:zJ,fromOptionK:qJ,chainOptionK:KJ,filterOrElse:hx,filterOrElseW:VJ,swap:mx,orElseW:vx,orElse:gx,fromNullable:F$,tryCatch:ss,tryCatchK:HJ,fromNullableK:yx,chainNullableK:JJ,toUnion:bx,toError:GJ,elem:_x,exists:YJ,Do:ZJ,bindTo:XJ,bind:$x,bindW:QJ,apS:Sx,apSW:eG,ApT:Tx,traverseReadonlyNonEmptyArrayWithIndex:Dd,traverseReadonlyArrayWithIndex:D$,traverseArrayWithIndex:tG,traverseArray:Ix,sequenceArray:nG,parseJSON:rG,stringifyJSON:iG,either:oG,getApplySemigroup:aG,getApplyMonoid:uG,getValidationSemigroup:sG,getValidationMonoid:cG,getValidation:lG},Symbol.toStringTag,{value:"Module"}));var Je=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)}}(),nl=globalThis&&globalThis.__assign||function(){return nl=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},nl.apply(this,arguments)},fG=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))},Bi=bt,Ze=function(e,t,n){return Bi([{value:e,context:t,message:n}])},Ie=Be,be=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 oe(a)?a:t.validate(a.right,o)},this.encode===We&&t.encode===We?We: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}(),We=function(e){return e};function wx(e){return e.displayName||e.name||"<function".concat(e.length,">")}function dG(e,t){return{key:e,type:t}}function oi(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 wo(e,t){for(var n=t.length,r=0;r<n;r++)e.push(t[r])}var cs=Object.prototype.hasOwnProperty;function L$(e){return Object.keys(e).map(function(t){return"".concat(t,": ").concat(e[t].name)}).join(", ")}function Ld(e){for(var t=0;t<e.length;t++)if(e[t].encode!==We)return!1;return!0}function Ex(e){return"{ ".concat(L$(e)," }")}function Rx(e){return"Partial<".concat(e,">")}function pG(e,t,n,r){r===void 0&&(r="{ [K in ".concat(t.name,"]: ").concat(n.name," }"));var i=e.length;return new J$(r,function(o){return Sn.is(o)&&e.every(function(a){return n.is(o[a])})},function(o,a){var u=Sn.validate(o,a);if(oe(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,oi(a,p,n,h));if(oe(v))wo(l,v.left);else{var y=v.right;f=f||y!==h,c[p]=y}}return l.length>0?Bi(l):Ie(f||Object.keys(s).length!==i?c:s)},n.encode===We?We: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 j$(e){var t;if(Ax(e)){var n=e.value;if(ai.is(n))return t={},t[n]=null,t}else{if(bG(e))return e.keys;if(Nx(e)){var r=e.types.map(function(i){return j$(i)});return r.some(jm.is)?void 0:Object.assign.apply(Object,fG([{}],r,!1))}}}function hG(e,t,n){return n===void 0&&(n="{ [K in ".concat(e.name,"]: ").concat(t.name," }")),new J$(n,function(r){return Sn.is(r)?Object.keys(r).every(function(i){return e.is(i)&&t.is(r[i])}):kx(t)&&Array.isArray(r)},function(r,i){if(Sn.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,oi(i,f,e,f));if(oe(p))wo(a,p.left);else{var h=p.right;c=c||h!==f,f=h;var v=t.validate(d,oi(i,f,t,d));if(oe(v))wo(a,v.left);else{var y=v.right;c=c||y!==d,o[f]=y}}}return a.length>0?Bi(a):Ie(c?o:r)}return kx(t)&&Array.isArray(r)?Ie(r):Ze(r,i)},e.encode===We&&t.encode===We?We: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 Mx(e){return"("+e.map(function(t){return t.name}).join(" | ")+")"}function U$(e,t){for(var n=!0,r=!0,i=!Sn.is(e),o=0,a=t;o<a.length;o++){var u=a[o];u!==e&&(n=!1),Sn.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)(!cs.call(s,f)||i||u[f]!==e[f])&&(s[f]=u[f])}return s}function B$(e){switch(e._tag){case"RefinementType":case"ReadonlyType":return B$(e.type);case"InterfaceType":case"StrictType":case"PartialType":return e.props;case"IntersectionType":return e.types.reduce(function(t,n){return Object.assign(t,B$(n))},{})}}function Cx(e,t){for(var n=Object.getOwnPropertyNames(e),r=!1,i={},o=0;o<n.length;o++){var a=n[o];cs.call(t,a)?i[a]=e[a]:r=!0}return r?i:e}function mG(e){return Wx(e)?"{| ".concat(L$(e.props)," |}"):_G(e)?Rx("{| ".concat(L$(e.props)," |}")):"Exact<".concat(e.name,">")}function vG(e){return e.length>0}var jn={};function xx(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 gG(e,t){if(e===jn)return t;if(t===jn)return e;var n=Object.assign({},e);for(var r in t)if(cs.call(e,r)){var i=xx(e[r],t[r]);if(vG(i))n[r]=i;else{n=jn;break}}else n[r]=t[r];return n}function yG(e,t){if(e===jn||t===jn)return jn;var n=jn;for(var r in e)if(cs.call(t,r)){var i=xx(e[r],t[r]);i.length===0&&(n===jn&&(n={}),n[r]=e[r].concat(t[r]))}return n}function kx(e){return e._tag==="AnyType"}function Ax(e){return e._tag==="LiteralType"}function bG(e){return e._tag==="KeyofType"}function Wx(e){return e._tag==="InterfaceType"}function _G(e){return e._tag==="PartialType"}function $G(e){return e._tag==="StrictType"}function SG(e){return e._tag==="ExactType"}function TG(e){return e._tag==="RefinementType"}function IG(e){return e._tag==="IntersectionType"}function Nx(e){return e._tag==="UnionType"}function OG(e){return e._tag==="RecursiveType"}var z$=[];function Ha(e){if(z$.indexOf(e)!==-1)return jn;if(Wx(e)||$G(e)){var t=jn;for(var n in e.props){var r=e.props[n];Ax(r)&&(t===jn&&(t={}),t[n]=[r.value])}return t}else{if(SG(e)||TG(e))return Ha(e.type);if(IG(e))return e.types.reduce(function(o,a){return gG(o,Ha(a))},jn);if(Nx(e))return e.types.slice(1).reduce(function(o,a){return yG(o,Ha(a))},Ha(e.types[0]));if(OG(e)){z$.push(e);var i=Ha(e.type);return z$.pop(),i}}return jn}function Px(e){var t=Ha(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=Ha(p),v=h[c];if(v===void 0)return"continue-keys";if(v.some(function(y){return l.indexOf(y)!==-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 Fx=function(e){Je(t,e);function t(){var n=e.call(this,"null",function(r){return r===null},function(r,i){return n.is(r)?Ie(r):Ze(r,i)},We)||this;return n._tag="NullType",n}return t}(be),q$=new Fx,Dx=function(e){Je(t,e);function t(){var n=e.call(this,"undefined",function(r){return r===void 0},function(r,i){return n.is(r)?Ie(r):Ze(r,i)},We)||this;return n._tag="UndefinedType",n}return t}(be),jm=new Dx,Lx=function(e){Je(t,e);function t(){var n=e.call(this,"void",jm.is,jm.validate,We)||this;return n._tag="VoidType",n}return t}(be),jx=new Lx,Ux=function(e){Je(t,e);function t(){var n=e.call(this,"unknown",function(r){return!0},Ie,We)||this;return n._tag="UnknownType",n}return t}(be),wG=new Ux,Bx=function(e){Je(t,e);function t(){var n=e.call(this,"string",function(r){return typeof r=="string"},function(r,i){return n.is(r)?Ie(r):Ze(r,i)},We)||this;return n._tag="StringType",n}return t}(be),ai=new Bx,zx=function(e){Je(t,e);function t(){var n=e.call(this,"number",function(r){return typeof r=="number"},function(r,i){return n.is(r)?Ie(r):Ze(r,i)},We)||this;return n._tag="NumberType",n}return t}(be),ls=new zx,qx=function(e){Je(t,e);function t(){var n=e.call(this,"bigint",function(r){return typeof r=="bigint"},function(r,i){return n.is(r)?Ie(r):Ze(r,i)},We)||this;return n._tag="BigIntType",n}return t}(be),EG=new qx,Kx=function(e){Je(t,e);function t(){var n=e.call(this,"boolean",function(r){return typeof r=="boolean"},function(r,i){return n.is(r)?Ie(r):Ze(r,i)},We)||this;return n._tag="BooleanType",n}return t}(be),Um=new Kx,Vx=function(e){Je(t,e);function t(){var n=e.call(this,"UnknownArray",Array.isArray,function(r,i){return n.is(r)?Ie(r):Ze(r,i)},We)||this;return n._tag="AnyArrayType",n}return t}(be),rl=new Vx,Hx=function(e){Je(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)?Ie(r):Ze(r,i)},We)||this;return n._tag="AnyDictionaryType",n}return t}(be),Sn=new Hx,Jx=function(e){Je(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}(be);function jd(e,t){t===void 0&&(t=JSON.stringify(e));var n=function(r){return r===e};return new Jx(t,n,function(r,i){return n(r)?Ie(e):Ze(r,i)},We,e)}var Gx=function(e){Je(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}(be);function RG(e,t){t===void 0&&(t=Object.keys(e).map(function(r){return JSON.stringify(r)}).join(" | "));var n=function(r){return ai.is(r)&&cs.call(e,r)};return new Gx(t,n,function(r,i){return n(r)?Ie(r):Ze(r,i)},We,e)}var Yx=function(e){Je(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}(be);function Bm(e,t,n){return Z$(e,t,n)}var zm=Bm(ls,function(e){return Number.isInteger(e)},"Int"),K$=function(e){Je(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}(be);Object.defineProperty(K$.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});function V$(e,t){var n,r=function(){return n||(n=t(i),n.name=e),n},i=new K$(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 Zx=function(e){Je(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}(be);function qm(e,t){return t===void 0&&(t="Array<".concat(e.name,">")),new Zx(t,function(n){return rl.is(n)&&n.every(e.is)},function(n,r){var i=rl.validate(n,r);if(oe(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,oi(r,String(c),e,l));if(oe(f))wo(s,f.left);else{var d=f.right;d!==l&&(u===o&&(u=o.slice()),u[c]=d)}}return s.length>0?Bi(s):Ie(u)},e.encode===We?We:function(n){return n.map(e.encode)},e)}var Xx=function(e){Je(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}(be);function H$(e,t){t===void 0&&(t=Ex(e));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new Xx(t,function(o){if(Sn.is(o)){for(var a=0;a<i;a++){var u=n[a],s=o[u];if(s===void 0&&!cs.call(o,u)||!r[a].is(s))return!1}return!0}return!1},function(o,a){var u=Sn.validate(o,a);if(oe(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,oi(a,d,h,p));if(oe(v))wo(l,v.left);else{var y=v.right;(y!==p||y===void 0&&!cs.call(c,d))&&(c===s&&(c=nl({},s)),c[d]=y)}}return l.length>0?Bi(l):Ie(c)},Ld(r)?We:function(o){for(var a=nl({},o),u=0;u<i;u++){var s=n[u],c=r[u].encode;c!==We&&(a[s]=c(o[s]))}return a},e)}var Qx=function(e){Je(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}(be);function MG(e,t){t===void 0&&(t=Rx(Ex(e)));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new Qx(t,function(o){if(Sn.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=Sn.validate(o,a);if(oe(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,oi(a,d,h,p));if(oe(v))p!==void 0&&wo(l,v.left);else{var y=v.right;y!==p&&(c===s&&(c=nl({},s)),c[d]=y)}}return l.length>0?Bi(l):Ie(c)},Ld(r)?We:function(o){for(var a=nl({},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 J$=function(e){Je(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}(be);function G$(e,t,n){var r=j$(e);return r?pG(Object.keys(r),e,t,n):hG(e,t,n)}var Y$=function(e){Je(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}(be);function Ud(e,t){t===void 0&&(t=Mx(e));var n=Px(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 Km(t,function(u){if(Sn.is(u)){var s=a(u[r]);return s!==void 0?e[s].is(u):!1}return!1},function(u,s){var c=Sn.validate(u,s);if(oe(c))return c;var l=c.right,f=a(l[r]);if(f===void 0)return Ze(u,s);var d=e[f];return d.validate(l,oi(s,String(f),d,l))},Ld(e)?We: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 Y$(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,oi(s,String(l),f,u));if(oe(d))wo(c,d.left);else return Ie(d.right)}return Bi(c)},Ld(e)?We: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 ek=function(e){Je(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}(be);function CG(e,t){t===void 0&&(t="(".concat(e.map(function(r){return r.name}).join(" & "),")"));var n=e.length;return new ek(t,function(r){return e.every(function(i){return i.is(r)})},e.length===0?Ie:function(r,i){for(var o=[],a=[],u=0;u<n;u++){var s=e[u],c=s.validate(r,oi(i,String(u),s,r));oe(c)?wo(a,c.left):o.push(c.right)}return a.length>0?Bi(a):Ie(U$(r,o))},e.length===0?We:function(r){return U$(r,e.map(function(i){return i.encode(r)}))},e)}var tk=function(e){Je(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}(be);function xG(e,t){t===void 0&&(t="[".concat(e.map(function(r){return r.name}).join(", "),"]"));var n=e.length;return new tk(t,function(r){return rl.is(r)&&r.length===n&&e.every(function(i,o){return i.is(r[o])})},function(r,i){var o=rl.validate(r,i);if(oe(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,oi(i,String(c),f,l));if(oe(d))wo(s,d.left);else{var p=d.right;p!==l&&(u===a&&(u=a.slice()),u[c]=p)}}return s.length>0?Bi(s):Ie(u)},Ld(e)?We:function(r){return e.map(function(i,o){return i.encode(r[o])})},e)}var nk=function(e){Je(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}(be);function kG(e,t){return t===void 0&&(t="Readonly<".concat(e.name,">")),new nk(t,e.is,e.validate,e.encode,e)}var rk=function(e){Je(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}(be);function ik(e,t){t===void 0&&(t="ReadonlyArray<".concat(e.name,">"));var n=qm(e);return new rk(t,n.is,n.validate,n.encode,e)}var Bd=function(e,t){return ak(H$(e),t)},ok=function(e){Je(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}(be);function ak(e,t){t===void 0&&(t=mG(e));var n=B$(e);return new ok(t,e.is,function(r,i){var o=Sn.validate(r,i);if(oe(o))return o;var a=e.validate(r,i);return oe(a)?a:Be(Cx(a.right,n))},function(r){return e.encode(Cx(r,n))},e)}var uk=function(e){Je(t,e);function t(){var n=e.call(this,"Function",function(r){return typeof r=="function"},function(r,i){return n.is(r)?Ie(r):Ze(r,i)},We)||this;return n._tag="FunctionType",n}return t}(be),AG=new uk,Km=function(e){Je(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}(Y$),WG=function(e,t,n){n===void 0&&(n=Mx(t));var r=Ud(t,n);return r instanceof Km?r:(console.warn("[io-ts] Cannot build a tagged union for ".concat(n,", returning a de-optimized union")),new Km(n,r.is,r.validate,r.encode,t,e))},NG=function(e,t){return{value:e,context:t}},sk=function(e){return[{key:"",type:e}]},ck=function(e){Je(t,e);function t(){var n=e.call(this,"never",function(r){return!1},function(r,i){return Ze(r,i)},function(){throw new Error("cannot encode never")})||this;return n._tag="NeverType",n}return t}(be),PG=new ck,lk=function(e){Je(t,e);function t(){var n=e.call(this,"any",function(r){return!0},Ie,We)||this;return n._tag="AnyType",n}return t}(be),FG=new lk,DG=Sn,fk=function(e){Je(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)?Ie(r):Ze(r,i)},We)||this;return n._tag="ObjectType",n}return t}(be),LG=new fk;function Z$(e,t,n){return n===void 0&&(n="(".concat(e.name," | ").concat(wx(t),")")),new Yx(n,function(r){return e.is(r)&&t(r)},function(r,i){var o=e.validate(r,i);if(oe(o))return o;var a=o.right;return t(a)?Ie(a):Ze(a,i)},e.encode,e,t)}var jG=Z$(ls,Number.isInteger,"Integer"),UG=G$,BG=function(e){Je(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}(be);function zG(e){return e}function qG(e){return function(){return e}}const Q=La(Object.freeze(Object.defineProperty({__proto__:null,failures:Bi,failure:Ze,success:Ie,Type:be,identity:We,getFunctionName:wx,getContextEntry:dG,appendContext:oi,getDomainKeys:j$,mergeAll:U$,emptyTags:jn,getTags:Ha,getIndex:Px,NullType:Fx,nullType:q$,UndefinedType:Dx,VoidType:Lx,voidType:jx,UnknownType:Ux,unknown:wG,StringType:Bx,string:ai,NumberType:zx,number:ls,BigIntType:qx,bigint:EG,BooleanType:Kx,boolean:Um,AnyArrayType:Vx,UnknownArray:rl,AnyDictionaryType:Hx,UnknownRecord:Sn,null:q$,undefined:jm,void:jx,LiteralType:Jx,literal:jd,KeyofType:Gx,keyof:RG,RefinementType:Yx,brand:Bm,Int:zm,RecursiveType:K$,recursion:V$,ArrayType:Zx,array:qm,InterfaceType:Xx,type:H$,PartialType:Qx,partial:MG,DictionaryType:J$,record:G$,UnionType:Y$,union:Ud,IntersectionType:ek,intersection:CG,TupleType:tk,tuple:xG,ReadonlyType:nk,readonly:kG,ReadonlyArrayType:rk,readonlyArray:ik,strict:Bd,ExactType:ok,exact:ak,FunctionType:uk,Function:AG,TaggedUnionType:Km,taggedUnion:WG,Array:rl,interface:H$,getValidationError:NG,getDefaultContext:sk,NeverType:ck,never:PG,AnyType:lk,any:FG,Dictionary:DG,ObjectType:fk,object:LG,refinement:Z$,Integer:jG,dictionary:UG,StrictType:BG,clean:zG,alias:qG},Symbol.toStringTag,{value:"Module"})));var il={},Vm={},Hm={};Object.defineProperty(Hm,"__esModule",{value:!0}),Hm.clone=void 0;function KG(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}Hm.clone=KG;var VG=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),HG=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),JG=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&VG(t,e,n);return HG(t,e),t};Object.defineProperty(Vm,"__esModule",{value:!0}),Vm.withValidate=void 0;var GG=JG(Q),YG=Hm;function ZG(e,t,n){n===void 0&&(n=e.name);var r=YG.clone(e);return r.validate=t,r.decode=function(i){return t(i,GG.getDefaultContext(r))},r.name=n,r}Vm.withValidate=ZG;var XG=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),QG=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),e7=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&XG(t,e,n);return QG(t,e),t};Object.defineProperty(il,"__esModule",{value:!0}),il.withFallback=void 0;var t7=e7(Q),n7=Vm,r7=$o;function i7(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),n7.withValidate(e,function(r,i){return r7.orElse(function(){return t7.success(t)})(e.validate(r,i))},n)}il.withFallback=i7;var Xe={},X$={};const mn=La(Ox),Un=La(VC);Object.defineProperty(X$,"__esModule",{value:!0});const o7=K.exports,a7=mn,u7=Un,Jm=(0,o7.__importStar)(Q);X$.default=new Jm.Type("dateFromString",e=>e instanceof Date,(e,t)=>(0,u7.pipe)(Jm.string.validate(e,t),(0,a7.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?Jm.failure(e,t):Jm.success(r)})),e=>e.toISOString());var Q$={};Object.defineProperty(Q$,"__esModule",{value:!0});const s7=K.exports,c7=mn,l7=Un,ol=(0,s7.__importStar)(Q);Q$.default=new ol.Type("dateFromStringOrNumber",e=>e instanceof Date,(e,t)=>(0,l7.pipe)(ol.union([ol.number,ol.string]).validate(e,t),(0,c7.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?ol.failure(e,t):ol.success(r)})),e=>e);var eS={};Object.defineProperty(eS,"__esModule",{value:!0});const f7=K.exports,d7=mn,p7=Un,Gm=(0,f7.__importStar)(Q);eS.default=new Gm.Type("dateFromTsMs",e=>e instanceof Date,(e,t)=>(0,p7.pipe)(Gm.number.validate(e,t),(0,d7.chain)(n=>{const r=new Date(n);return isNaN(r.getTime())?Gm.failure(e,t):Gm.success(r)})),e=>e.getTime());var je={};function dk(e){return function(t){return function(n){return n.reduce(function(r,i){return e.alt(r,function(){return i})},t)}}}const h7=Object.freeze(Object.defineProperty({__proto__:null,altAll:dk},Symbol.toStringTag,{value:"Module"}));function m7(e){return dk(e)(e.zero())}const v7=Object.freeze(Object.defineProperty({__proto__:null,altAll:m7},Symbol.toStringTag,{value:"Module"}));var Wr=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},pk=function(e){return Wr(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},hk=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Wr(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},g7=function(e,t){return m(e,mk(t))},mk=function(e){return function(t){return Wr(function(n,r){return t.equals(e(n),e(r))})}},vk="Eq",al={equals:function(e,t){return e===t}},y7={equals:function(){return!0}},gk=function(){return{concat:function(e,t){return Wr(function(n,r){return e.equals(n,r)&&t.equals(n,r)})}}},b7=function(){return{concat:gk().concat,empty:y7}},yk={URI:vk,contramap:g7},_7=hk,$7=pk,S7=al.equals,T7=yk,I7=al,O7=al,w7=al,E7={equals:function(e,t){return e.valueOf()===t.valueOf()}};const R7=Object.freeze(Object.defineProperty({__proto__:null,fromEquals:Wr,struct:pk,tuple:hk,contramap:mk,URI:vk,eqStrict:al,getSemigroup:gk,getMonoid:b7,Contravariant:yk,getTupleEq:_7,getStructEq:$7,strictEqual:S7,eq:T7,eqBoolean:I7,eqString:O7,eqNumber:w7,eqDate:E7},Symbol.toStringTag,{value:"Module"}));var bk=function(e){return function(t,n){return t===n||e(t,n)===0}},fs=function(e){return{equals:bk(e),compare:function(t,n){return t===n?0:e(t,n)}}},_k=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fs(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])})},tS=function(e){return fs(function(t,n){return e.compare(n,t)})},M7=function(e,t){return m(e,Ym(t))},Ym=function(e){return function(t){return fs(function(n,r){return t.compare(e(n),e(r))})}},$k="Ord",Sk=function(){return{concat:function(e,t){return fs(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},nS=function(){return{concat:Sk().concat,empty:fs(function(){return 0})}},Tk={URI:$k,contramap:M7},C7={equals:v$,compare:Dn(0)},x7=function(e){return function(t){return function(n){return n===t||e.compare(n,t)===0}}},Ik=function(e){return function(t,n){return e.compare(t,n)===-1}},Ok=function(e){return function(t,n){return e.compare(t,n)===1}},k7=function(e){return function(t,n){return e.compare(t,n)!==1}},A7=function(e){return function(t,n){return e.compare(t,n)!==-1}},Zm=function(e){return function(t,n){return t===n||e.compare(t,n)<1?t:n}},Xm=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}},wk=function(e){var t=Zm(e),n=Xm(e);return function(r,i){return function(o){return n(t(o,i),r)}}},W7=function(e){var t=Ik(e),n=Ok(e);return function(r,i){return function(o){return!(t(o,r)||n(o,i))}}},N7=_k,P7=tS,F7=Tk;function D7(e,t){return e<t?-1:e>t?1:0}var rS={equals:al.equals,compare:D7},L7=rS,j7=rS,Qm=rS,U7=m(Qm,Ym(function(e){return e.valueOf()}));const B7=Object.freeze(Object.defineProperty({__proto__:null,equalsDefault:bk,fromCompare:fs,tuple:_k,reverse:tS,contramap:Ym,URI:$k,getSemigroup:Sk,getMonoid:nS,Contravariant:Tk,trivial:C7,equals:x7,lt:Ik,gt:Ok,leq:k7,geq:A7,min:Zm,max:Xm,clamp:wk,between:W7,getTupleOrd:N7,getDualOrd:P7,ord:F7,ordBoolean:L7,ordString:j7,ordNumber:Qm,ordDate:U7},Symbol.toStringTag,{value:"Module"}));var Ek=function(e){return{concat:function(t,n){return e.concat(n,t)}}},z7=function(e){return function(t){return{concat:function(n,r){return e(n)?t.concat(n,r):r}}}},q7=function(e){return function(t){return{concat:function(n,r){return e(r)?t.concat(n,r):n}}}},K7=function(e){return function(t){return{concat:function(n,r){return t.concat(e(n),e(r))}}}},Rk=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}};const V7=Object.freeze(Object.defineProperty({__proto__:null,reverse:Ek,filterFirst:z7,filterSecond:q7,endo:K7,concatAll:Rk},Symbol.toStringTag,{value:"Module"}));var ev=function(e){return{concat:Zm(e)}},tv=function(e){return{concat:Xm(e)}},iS=function(e){return{concat:function(){return e}}},oS=Ek,aS=function(e){return{concat:function(t,n){var r={};for(var i in e)at.call(e,i)&&(r[i]=e[i].concat(t[i],n[i]));return r}}},uS=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])})}}},Mk=function(e){return function(t){return{concat:function(n,r){return t.concat(n,t.concat(e,r))}}}},sS=function(){return{concat:B}},nv=function(){return{concat:function(e,t){return t}}},cS=Rk,Ck=iS(void 0),H7=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},J7=nv,G7=sS,Y7=uS,Z7=aS,X7=oS,Q7=tv,e8=ev,t8=Mk;function n8(e){var t=cS(e);return function(n,r){return r===void 0?t(n):t(n)(r)}}var xk={concat:function(e,t){return e&&t}},kk={concat:function(e,t){return e||t}},r8=h$,Ak={concat:function(e,t){return e+t}},Wk={concat:function(e,t){return e+t}},Nk={concat:function(e,t){return e*t}};const Pk=Object.freeze(Object.defineProperty({__proto__:null,min:ev,max:tv,constant:iS,reverse:oS,struct:aS,tuple:uS,intercalate:Mk,first:sS,last:nv,concatAll:cS,semigroupVoid:Ck,getObjectSemigroup:H7,getLastSemigroup:J7,getFirstSemigroup:G7,getTupleSemigroup:Y7,getStructSemigroup:Z7,getDualSemigroup:X7,getJoinSemigroup:Q7,getMeetSemigroup:e8,getIntercalateSemigroup:t8,fold:n8,semigroupAll:xk,semigroupAny:kk,getFunctionSemigroup:r8,semigroupString:Ak,semigroupSum:Wk,semigroupProduct:Nk},Symbol.toStringTag,{value:"Module"}));var zd=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))},qd=Yt,zi=dt,rv=function(e,t){return e<0||e>=t.length},lS=function(e){return function(t){return zd([e],t,!0)}},ul=lS,fS=function(e){return function(t){return zd(zd([],t,!0),[e],!1)}},iv=fS,ov=function(e,t,n){if(zi(n)){var r=Fm(n);return r.splice(e,0,t),r}return[t]},dS=function(e,t,n){if(n[e]===t)return n;var r=Fm(n);return r[e]=t,r},pS=function(e){return function(t){if(t.length===1)return t;for(var n=[In(t)],r=si(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}},Fk=function(e){if(zi(e)){var t=nS();return vS(e.reduce(t.concat,t.empty))}return B},hS=function(e){var t=pS(e);return function(n){return function(r){return t(m(r,Vd(n)))}}},mS=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(rv(Math.abs(r),t)||r===0)return t;if(r<0){var i=sv(-r)(t),o=i[0],a=i[1];return m(a,Vd(o))}else return mS(r-n)(t)}},Kd=function(e){return zi(e)?le(e):me},av=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}},i8=function(e){return av(function(){return e})},Dk=function(e,t){return e<=t?av(function(n){return e+n})(t-e+1):[e]},Lk=function(e){return[In(e),si(e)]},jk=function(e){return[sl(e),Ga(e)]},o8=function(e){return Kd(e.slice())};function Uk(e){return function(t){return t.concat(e)}}function Vd(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var a8=function(e){return e.length===1?e:zd([Ga(e)],e.slice(0,-1).reverse(),!0)};function Bk(e){return function(t){var n=t.length;if(n===0)return qd;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 u8=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);at.call(n,a)?n[a].push(o):n[a]=[o]}return n}},vS=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},s8=function(e,t){return zk(e,function(){return t})},zk=function(e,t){return function(n){return rv(e,n)?me:le(dS(e,t(n[e]),n))}},qk=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 Kk(e,t){return t===void 0?function(n){return Kk(n,e)}:qk(e,t,function(n,r){return[n,r]})}var c8=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]},uv=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},gS=function(e){return function(t){var n=si(t);return zi(n)?m(n,uv(e),ul(In(t))):t}},Vk=function(e){return function(t){for(var n=Fm(e(0,In(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},yS=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}},sv=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[t,qd]:[m(t.slice(1,n),ul(In(t))),t.slice(n)]}},Hk=function(e){return yS(sv(e))},ui=function(e,t){return m(e,wS(t))},bS=function(e,t){return m(e,ES(t))},Hd=function(e,t){return m(e,Qk(t))},_S=function(e,t){return m(e,cv(t))},Jk=function(e,t){return m(e,OS(t))},Jd=function(e,t,n){return m(e,RS(t,n))},Gd=function(e){var t=MS(e);return function(n,r){return m(n,t(r))}},Yd=function(e,t,n){return m(e,CS(t,n))},$S=function(e){var t=eA(e);return function(n,r){return m(n,t(r))}},Gk=function(e,t){return m(e,Xk(t))},SS=function(e,t,n){return m(e,lv(t,n))},TS=function(e){var t=xS(e);return function(n,r){return m(n,t(r))}},IS=function(e,t,n){return m(e,fv(t,n))},Yk=function(e){var t=pv(e);return function(n,r){return m(n,t(r))}},Ja=Rd,Zk=function(e){return function(t){return m(t,Uk(e()))}},Xk=Zk,Qk=function(e){return cv(function(t){return m(e,wS(t))})},cv=function(e){return Vk(function(t,n){return e(n)})},OS=function(e){return function(t){for(var n=si(t),r=[e(t)];zi(n);)r.push(e(n)),n=si(n);return r}},l8=OS(B),f8=cv(B),wS=function(e){return ES(function(t,n){return e(n)})},ES=function(e){return function(t){for(var n=[e(0,In(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},RS=function(e,t){return lv(e,function(n,r,i){return t(r,i)})},MS=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]))}}},CS=function(e,t){return fv(e,function(n,r,i){return t(r,i)})},lv=function(e,t){return function(n){return n.reduce(function(r,i,o){return t(o,r,i)},e)}},xS=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]))}}},fv=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},eA=function(e){var t=pv(e);return function(n){return t(function(r,i){return n(i)})}},dv=function(e){return pv(e)(Ln)},pv=function(e){return function(t){return function(n){for(var r=e.map(t(0,In(n)),Ja),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return m(o,iv(a))}}),t(i,n[i]));return r}}},hv=ur,Tn="ReadonlyNonEmptyArray",tA=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},d8=function(){return{concat:Vd}},nA=function(e){return Wr(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},p8=function(e){var t=hS(e);return{concat:function(n,r){return t(r)(n)}}},kS={URI:Tn,map:ui},h8=De(kS),m8={URI:Tn,of:Ja},v8={URI:Tn,map:ui,mapWithIndex:bS},mv={URI:Tn,map:ui,ap:Hd},g8=St(mv),y8=Tt(mv),b8={URI:Tn,map:ui,ap:Hd,of:Ja},AS={URI:Tn,map:ui,ap:Hd,chain:_S},_8=ut(AS),$8={URI:Tn,map:ui,ap:Hd,of:Ja,chain:_S},S8={URI:Tn,reduce:Jd,foldMap:Gd,reduceRight:Yd},T8={URI:Tn,reduce:Jd,foldMap:Gd,reduceRight:Yd,reduceWithIndex:SS,foldMapWithIndex:TS,reduceRightWithIndex:IS},I8={URI:Tn,map:ui,reduce:Jd,foldMap:Gd,reduceRight:Yd,traverse:$S,sequence:dv},O8={URI:Tn,map:ui,mapWithIndex:bS,reduce:Jd,foldMap:Gd,reduceRight:Yd,traverse:$S,sequence:dv,reduceWithIndex:SS,foldMapWithIndex:TS,reduceRightWithIndex:IS,traverseWithIndex:Yk},w8={URI:Tn,map:ui,alt:Gk},E8={URI:Tn,map:ui,extend:Jk,extract:hv},R8=Ja(jt),M8=Ot(kS),C8=wt(AS),x8=It(mv),In=hv,si=Gc,Ga=function(e){return e[e.length-1]},sl=function(e){return e.slice(0,-1)},rA=function(e){var t=ev(e);return function(n){return n.reduce(t.concat)}},iA=function(e){var t=tv(e);return function(n){return n.reduce(t.concat)}},vv=function(e){return function(t){return t.reduce(e.concat)}},k8=function(e){return function(t){return e(In(t),si(t))}},A8=function(e){return function(t){return e(sl(t),Ga(t))}},oA=function(e){return function(t){return zd([e(In(t))],si(t),!0)}},W8=function(e){return oA(function(){return e})},aA=function(e){return function(t){return m(sl(t),iv(e(Ga(t))))}},N8=function(e){return aA(function(){return e})},WS=function(e){var t=vv(e);return function(n){return X(gS(n),t)}};function P8(e){var t=vS(e),n=Bk(e);return function(r){return zi(r)?n(t(r)):qd}}function F8(e){return uA(function(t,n){return e(n)})}var uA=function(e){return function(t){return Kd(t.filter(function(n,r){return e(r,n)}))}},D8=Lk,L8=jk;function sA(e,t){return t===void 0?ul(e):m(t,ul(e))}var cA=function(e,t){return m(e,Vd([t]))},j8=function(e,t){return function(n){return e<0||e>n.length?me:le(ov(e,t,n))}},U8=uv,B8=vv,z8={URI:Tn,of:Ja,map:ui,mapWithIndex:bS,ap:Hd,chain:_S,extend:Jk,extract:hv,reduce:Jd,foldMap:Gd,reduceRight:Yd,traverse:$S,sequence:dv,reduceWithIndex:SS,foldMapWithIndex:TS,reduceRightWithIndex:IS,traverseWithIndex:Yk,alt:Gk};const q8=Object.freeze(Object.defineProperty({__proto__:null,empty:qd,isNonEmpty:zi,isOutOfBound:rv,prependW:lS,prepend:ul,appendW:fS,append:iv,unsafeInsertAt:ov,unsafeUpdateAt:dS,uniq:pS,sortBy:Fk,union:hS,rotate:mS,fromReadonlyArray:Kd,makeBy:av,replicate:i8,range:Dk,unprepend:Lk,unappend:jk,fromArray:o8,concatW:Uk,concat:Vd,reverse:a8,group:Bk,groupBy:u8,sort:vS,updateAt:s8,modifyAt:zk,zipWith:qk,zip:Kk,unzip:c8,prependAll:uv,intersperse:gS,chainWithIndex:Vk,chop:yS,splitAt:sv,chunksOf:Hk,of:Ja,altW:Zk,alt:Xk,ap:Qk,chain:cv,extend:OS,duplicate:l8,flatten:f8,map:wS,mapWithIndex:ES,reduce:RS,foldMap:MS,reduceRight:CS,reduceWithIndex:lv,foldMapWithIndex:xS,reduceRightWithIndex:fv,traverse:eA,sequence:dv,traverseWithIndex:pv,extract:hv,URI:Tn,getShow:tA,getSemigroup:d8,getEq:nA,getUnionSemigroup:p8,Functor:kS,flap:h8,Pointed:m8,FunctorWithIndex:v8,Apply:mv,apFirst:g8,apSecond:y8,Applicative:b8,Chain:AS,chainFirst:_8,Monad:$8,Foldable:S8,FoldableWithIndex:T8,Traversable:I8,TraversableWithIndex:O8,Alt:w8,Comonad:E8,Do:R8,bindTo:M8,bind:C8,apS:x8,head:In,tail:si,last:Ga,init:sl,min:rA,max:iA,concatAll:vv,matchLeft:k8,matchRight:A8,modifyHead:oA,updateHead:W8,modifyLast:aA,updateLast:N8,intercalate:WS,groupSort:P8,filter:F8,filterWithIndex:uA,uncons:D8,unsnoc:L8,cons:sA,snoc:cA,insertAt:j8,prependToAll:U8,fold:B8,readonlyNonEmptyArray:z8},Symbol.toStringTag,{value:"Module"}));var Zd=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},gv=function(e,t){return e<0||e>=t.length},NS=function(e){return function(t){return Zd([e],t,!0)}},cl=NS,PS=function(e){return function(t){return Zd(Zd([],t,!0),[e],!1)}},Xd=PS,FS=function(e,t,n){if(Eo(n)){var r=Qd(n);return r.splice(e,0,t),r}return[t]},DS=function(e,t,n){var r=Qd(n);return r[e]=t,r},LS=function(e){return function(t){if(t.length===1)return ll(t);for(var n=[Nr(t)],r=li(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}},lA=function(e){if(Eo(e)){var t=nS();return zS(e.reduce(t.concat,t.empty))}return ll},jS=function(e){var t=LS(e);return function(n){return function(r){return t(m(r,bv(n)))}}},US=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(gv(Math.abs(r),t)||r===0)return ll(t);if(r<0){var i=$v(-r)(t),o=i[0],a=i[1];return m(a,bv(o))}else return US(r-n)(t)}},Qd=Fm,BS=function(e){return Eo(e)?le(e):me},yv=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}},K8=function(e){return yv(function(){return e})},fA=function(e,t){return e<=t?yv(function(n){return e+n})(t-e+1):[e]},dA=function(e){return[Nr(e),li(e)]},pA=function(e){return[dl(e),fl(e)]};function hA(e){return function(t){return t.concat(e)}}function bv(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var V8=function(e){return Zd([fl(e)],e.slice(0,-1).reverse(),!0)};function mA(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 H8=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);at.call(n,a)?n[a].push(o):n[a]=[o]}return n}},zS=function(e){return function(t){return t.slice().sort(e.compare)}},J8=function(e,t){return function(n){return e<0||e>n.length?me:le(FS(e,t,n))}},G8=function(e,t){return vA(e,function(){return t})},vA=function(e,t){return function(n){return gv(e,n)?me:le(DS(e,t(n[e]),n))}},ll=Qd,Ya=function(e){return[e]},gA=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 yA(e,t){return t===void 0?function(n){return yA(n,e)}:gA(e,t,function(n,r){return[n,r]})}var Y8=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]},_v=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},bA=function(e){return function(t){var n=li(t);return Eo(n)?m(n,_v(e),cl(Nr(t))):ll(t)}},_A=xS,$A=MS,SA=function(e){return function(t){for(var n=Qd(e(0,Nr(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},qS=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}},$v=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[ll(t),[]]:[m(t.slice(1,n),cl(Nr(t))),t.slice(n)]}},TA=function(e){return qS($v(e))},ci=function(e,t){return m(e,XS(t))},KS=function(e,t){return m(e,QS(t))},ep=function(e,t){return m(e,MA(t))},VS=function(e,t){return m(e,Sv(t))},IA=function(e,t){return m(e,ZS(t))},tp=function(e,t,n){return m(e,CA(t,n))},np=function(e){var t=$A(e);return function(n,r){return m(n,t(r))}},rp=function(e,t,n){return m(e,kA(t,n))},HS=function(e){var t=WA(e);return function(n,r){return m(n,t(r))}},OA=function(e,t){return m(e,RA(t))},JS=function(e,t,n){return m(e,xA(t,n))},GS=function(e){var t=_A(e);return function(n,r){return m(n,t(r))}},YS=function(e,t,n){return m(e,AA(t,n))},wA=function(e){var t=Iv(e);return function(n,r){return m(n,t(r))}},EA=function(e){return function(t){return m(t,hA(e()))}},RA=EA,MA=function(e){return Sv(function(t){return m(e,XS(t))})},Sv=function(e){return SA(function(t,n){return e(n)})},ZS=function(e){return function(t){for(var n=li(t),r=[e(t)];Eo(n);)r.push(e(n)),n=li(n);return r}},Z8=ZS(B),X8=Sv(B),XS=function(e){return QS(function(t,n){return e(n)})},QS=function(e){return function(t){for(var n=[e(0,Nr(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},CA=RS,xA=lv,kA=CS,AA=fv,WA=function(e){var t=Iv(e);return function(n){return t(function(r,i){return n(i)})}},Tv=function(e){return Iv(e)(function(t,n){return n})},Iv=function(e){return function(t){return function(n){for(var r=e.map(t(0,Nr(n)),Ya),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return m(o,Xd(a))}}),t(i,n[i]));return r}}},e0=In,On="NonEmptyArray",Q8=tA,eY=function(){return{concat:bv}},tY=nA,nY=function(e){var t=jS(e);return{concat:function(n,r){return t(r)(n)}}},t0={URI:On,map:ci},rY=De(t0),iY={URI:On,of:Ya},oY={URI:On,map:ci,mapWithIndex:KS},Ov={URI:On,map:ci,ap:ep},aY=St(Ov),uY=Tt(Ov),sY={URI:On,map:ci,ap:ep,of:Ya},n0={URI:On,map:ci,ap:ep,chain:VS},cY=ut(n0),lY={URI:On,map:ci,ap:ep,of:Ya,chain:VS},fY={URI:On,reduce:tp,foldMap:np,reduceRight:rp},dY={URI:On,reduce:tp,foldMap:np,reduceRight:rp,reduceWithIndex:JS,foldMapWithIndex:GS,reduceRightWithIndex:YS},pY={URI:On,map:ci,reduce:tp,foldMap:np,reduceRight:rp,traverse:HS,sequence:Tv},hY={URI:On,map:ci,mapWithIndex:KS,reduce:tp,foldMap:np,reduceRight:rp,traverse:HS,sequence:Tv,reduceWithIndex:JS,foldMapWithIndex:GS,reduceRightWithIndex:YS,traverseWithIndex:wA},mY={URI:On,map:ci,alt:OA},vY={URI:On,map:ci,extend:IA,extract:e0},gY=Ya(jt),yY=Ot(t0),bY=wt(n0),_Y=It(Ov),Nr=In,li=function(e){return e.slice(1)},fl=Ga,dl=function(e){return e.slice(0,-1)},$Y=rA,SY=iA,TY=function(e){return function(t){return t.reduce(e.concat)}},IY=function(e){return function(t){return e(Nr(t),li(t))}},OY=function(e){return function(t){return e(dl(t),fl(t))}},NA=function(e){return function(t){return Zd([e(Nr(t))],li(t),!0)}},wY=function(e){return NA(function(){return e})},PA=function(e){return function(t){return m(dl(t),Xd(e(fl(t))))}},EY=function(e){return PA(function(){return e})},RY=WS;function MY(e){var t=zS(e),n=mA(e);return function(r){return Eo(r)?n(t(r)):[]}}function CY(e){return FA(function(t,n){return e(n)})}var FA=function(e){return function(t){return BS(t.filter(function(n,r){return e(r,n)}))}},xY=dA,kY=pA;function DA(e,t){return t===void 0?cl(e):m(t,cl(e))}var LA=function(e,t){return m(e,Xd(t))},AY=_v,WY=vv,NY={URI:On,of:Ya,map:ci,mapWithIndex:KS,ap:ep,chain:VS,extend:IA,extract:e0,reduce:tp,foldMap:np,reduceRight:rp,traverse:HS,sequence:Tv,reduceWithIndex:JS,foldMapWithIndex:GS,reduceRightWithIndex:YS,traverseWithIndex:wA,alt:OA};const PY=Object.freeze(Object.defineProperty({__proto__:null,isNonEmpty:Eo,isOutOfBound:gv,prependW:NS,prepend:cl,appendW:PS,append:Xd,unsafeInsertAt:FS,unsafeUpdateAt:DS,uniq:LS,sortBy:lA,union:jS,rotate:US,fromReadonlyNonEmptyArray:Qd,fromArray:BS,makeBy:yv,replicate:K8,range:fA,unprepend:dA,unappend:pA,concatW:hA,concat:bv,reverse:V8,group:mA,groupBy:H8,sort:zS,insertAt:J8,updateAt:G8,modifyAt:vA,copy:ll,of:Ya,zipWith:gA,zip:yA,unzip:Y8,prependAll:_v,intersperse:bA,foldMapWithIndex:_A,foldMap:$A,chainWithIndex:SA,chop:qS,splitAt:$v,chunksOf:TA,altW:EA,alt:RA,ap:MA,chain:Sv,extend:ZS,duplicate:Z8,flatten:X8,map:XS,mapWithIndex:QS,reduce:CA,reduceWithIndex:xA,reduceRight:kA,reduceRightWithIndex:AA,traverse:WA,sequence:Tv,traverseWithIndex:Iv,extract:e0,URI:On,getShow:Q8,getSemigroup:eY,getEq:tY,getUnionSemigroup:nY,Functor:t0,flap:rY,Pointed:iY,FunctorWithIndex:oY,Apply:Ov,apFirst:aY,apSecond:uY,Applicative:sY,Chain:n0,chainFirst:cY,Monad:lY,Foldable:fY,FoldableWithIndex:dY,Traversable:pY,TraversableWithIndex:hY,Alt:mY,Comonad:vY,Do:gY,bindTo:yY,bind:bY,apS:_Y,head:Nr,tail:li,last:fl,init:dl,min:$Y,max:SY,concatAll:TY,matchLeft:IY,matchRight:OY,modifyHead:NA,updateHead:wY,modifyLast:PA,updateLast:EY,intercalate:RY,groupSort:MY,filter:CY,filterWithIndex:FA,uncons:xY,unsnoc:kY,cons:DA,snoc:LA,prependToAll:AY,fold:WY,nonEmptyArray:NY},Symbol.toStringTag,{value:"Module"}));var FY=function(e){return typeof e=="number"},r0={equals:function(e,t){return e===t}},wv={equals:r0.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},DY={equals:r0.equals,compare:wv.compare,top:1/0,bottom:-1/0},LY={show:function(e){return JSON.stringify(e)}},jA={concat:function(e,t){return e-t}},i0={concat:function(e,t){return e+t}},o0={concat:function(e,t){return e*t}},jY={concat:i0.concat,empty:0},UY={concat:o0.concat,empty:1},BY={add:i0.concat,zero:0,mul:o0.concat,one:1,sub:jA.concat,degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const zY=Object.freeze(Object.defineProperty({__proto__:null,isNumber:FY,Eq:r0,Ord:wv,Bounded:DY,Show:LY,MagmaSub:jA,SemigroupSum:i0,SemigroupProduct:o0,MonoidSum:jY,MonoidProduct:UY,Field:BY},Symbol.toStringTag,{value:"Module"}));function pl(e,t){return function(n){return n?t.of(void 0):e.zero()}}const qY=Object.freeze(Object.defineProperty({__proto__:null,guard:pl},Symbol.toStringTag,{value:"Module"}));var KY=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))},qi=function(e){return e.length===0},Et=zi,VY=ul,HY=lS,Ev=iv,JY=fS,UA=function(e,t){return e<=0?$t:av(t)(e)},GY=function(e,t){return UA(e,function(){return t})};function YY(e){return function(t){return e(t)?[t]:$t}}var BA=function(e){return Ct(e)?$t:[e.value]},zA=function(e){return Lt(e)?$t:[e.right]},qA=function(e,t){return function(n){return Et(n)?t(n):e()}},KA=qA,VA=function(e,t){return function(n){return Et(n)?t(In(n),si(n)):e()}},HA=VA,ZY=HA,JA=function(e,t){return function(n){return Et(n)?t(sl(n),Ga(n)):e()}},GA=JA,XY=GA,YA=function(e){return function(t){if(qi(t))return $t;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},QY=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}},e9=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}},t9=function(e){return e.length},hl=rv;function ds(e,t){return t===void 0?function(n){return ds(e,n)}:hl(e,t)?me:le(t[e])}var ZA=function(e){return Et(e)?le(In(e)):me},a0=function(e){return Et(e)?le(Ga(e)):me},n9=function(e){return Et(e)?le(si(e)):me},r9=function(e){return Et(e)?le(sl(e)):me},i9=function(e){return function(t){return hl(e,t)?t:e===0?$t:t.slice(0,e)}},o9=function(e){return function(t){return hl(e,t)?t:e===0?$t:t.slice(-e)}};function a9(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 XA=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function u9(e){return function(t){var n=u0(XA(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var s9=function(e){return function(t){return e<=0||qi(t)?t:e>=t.length?$t:t.slice(e,t.length)}},c9=function(e){return function(t){return e<=0||qi(t)?t:e>=t.length?$t:t.slice(0,t.length-e)}};function l9(e){return function(t){var n=XA(t,e);return n===0?t:n===t.length?$t:t.slice(n)}}var Rv=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return le(n);return me}};function Mv(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return le(t[n]);return me}}var QA=function(e){return function(t){for(var n=0;n<t.length;n++){var r=e(t[n]);if(mt(r))return r}return me}};function eW(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return le(t[n]);return me}}var tW=function(e){return function(t){for(var n=t.length-1;n>=0;n--){var r=e(t[n]);if(mt(r))return r}return me}},nW=function(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return le(n);return me}},f9=function(e,t){return function(n){return e<0||e>n.length?me:le(ov(e,t,n))}},d9=function(e,t){return rW(e,function(){return t})},p9=function(e){return function(t){return hl(e,t)?me:le(xW(e,t))}},rW=function(e,t){return function(n){return hl(e,n)?me:le(Uv(e,t(n[e]),n))}},h9=function(e){return e.length<=1?e:e.slice().reverse()},m9=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},v9=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},g9=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}},iW=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 oW(e,t){return t===void 0?function(n){return oW(n,e)}:iW(e,t,function(n,r){return[n,r]})}var y9=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]},aW=function(e){var t=uv(e);return function(n){return Et(n)?t(n):n}},b9=function(e){var t=gS(e);return function(n){return Et(n)?t(n):n}},_9=function(e){var t=mS(e);return function(n){return Et(n)?t(n):n}};function ip(e){return function(t,n){if(n===void 0){var r=ip(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 $9=function(e){var t=pS(e);return function(n){return Et(n)?t(n):n}},S9=function(e){var t=Fk(e);return function(n){return Et(n)?t(n):n}},T9=function(e){var t=yS(e);return function(n){return Et(n)?t(n):$t}},u0=function(e){return function(t){return e>=1&&Et(t)?sv(e)(t):qi(t)?[t,$t]:[$t,t]}},I9=function(e){var t=Hk(e);return function(n){return Et(n)?t(n):$t}},O9=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return BA(e.apply(void 0,t))}};function w9(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return Et(o)?m(In(o),ap(function(a){return r(m(i,Ev(a)),si(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:$t};return r($t,e)}var uW=function(e){return function(t){return qi(t)?e:qi(e)?t:t.concat(e)}},E9=uW;function s0(e){var t=hS(e);return function(n,r){if(r===void 0){var i=s0(e);return function(o){return i(o,n)}}return Et(n)&&Et(r)?t(r)(n):Et(n)?n:r}}function c0(e){var t=ip(e);return function(n,r){if(r===void 0){var i=c0(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function l0(e){var t=ip(e);return function(n,r){if(r===void 0){var i=l0(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var Zt=function(e,t){return m(e,Pv(t))},Cv=function(e,t){return m(e,gW(t))},Za=function(e,t){return m(e,vW(t))},op=function(e,t){return m(e,ap(t))},xv=function(e,t){return m(e,fi(t))},kv=function(e,t){return m(e,b0(t))},Av=function(e,t){return m(e,yW(t))},Wv=function(e,t){return m(e,bW(t))},sW=function(e,t){return m(e,_0(t))},cW=function(e,t){return m(e,$0(t))},f0=function(e,t){return m(e,mW(t))},ps=function(e,t,n){return m(e,Dv(t,n))},ml=function(e){var t=T0(e);return function(n,r){return m(n,t(r))}},vl=function(e,t,n){return m(e,I0(t,n))},d0=function(e,t,n){return m(e,up(t,n))},p0=function(e){var t=Fv(e);return function(n,r){return m(n,t(r))}},h0=function(e,t,n){return m(e,Lv(t,n))},lW=function(e,t){return m(e,y0(t))},fW=function(e,t){return m(e,_W(t))},dW=function(e,t){return m(e,S0(t))},Nv=function(e){var t=$W(e);return function(n,r){return m(n,t(r))}},pW=function(e){var t=O0(e);return function(n,r){return m(n,t(r))}},m0=function(e,t){return m(e,x0(t))},v0=function(e,t){return m(e,k0(t))},hs=Ja,gl=function(){return $t},hW=function(e){return function(t){return t.concat(e())}},mW=hW,vW=function(e){return ap(function(t){return m(e,Pv(t))})},ap=function(e){return function(t){return m(t,YA(function(n,r){return e(r)}))}},g0=ap(B),Pv=function(e){return function(t){return t.map(function(n){return e(n)})}},gW=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},yl=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 Oe(t,n)},fi=function(e){return function(t){return t.filter(e)}},y0=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);mt(i)&&n.push(i.value)}return n}},b0=function(e){return y0(function(t,n){return e(n)})},bl=b0(B),yW=function(e){return _0(function(t,n){return e(n)})},_0=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 Oe(n,r)}},bW=function(e){return $0(function(t,n){return e(n)})},$0=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 Oe(n,r)}},_W=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},S0=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},R9=S0(B),Fv=function(e){return function(t){return function(n){return n.reduce(function(r,i,o){return e.concat(r,t(o,i))},e.empty)}}},Dv=function(e,t){return up(e,function(n,r,i){return t(r,i)})},T0=function(e){var t=Fv(e);return function(n){return t(function(r,i){return n(i)})}},up=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}},I0=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)}},$W=function(e){var t=O0(e);return function(n){return t(function(r,i){return n(i)})}},sp=function(e){return function(t){return ps(t,e.of(gl()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return m(i,Ev(o))}}),r)})}},O0=function(e){return function(t){return up(e.of(gl()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return m(o,Ev(a))}}),t(n,i))})}},M9=function(e){var t=A0(e);return function(n){return function(r){return t(r,n)}}},C9=function(e){var t=W0(e);return function(n){return function(r){return t(r,n)}}},w0=function(e,t){for(var n=[],r=e;;){var i=t(r);if(mt(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},st="ReadonlyArray",SW=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},TW=function(){return{concat:function(e,t){return qi(e)?t:qi(t)?e:e.concat(t)}}},x9=function(){return{concat:TW().concat,empty:$t}},IW=function(e){return Wr(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},OW=function(e){return fs(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 wv.compare(r,i)})},wW=function(e){var t=s0(e);return{concat:function(n,r){return t(r)(n)}}},k9=function(e){return{concat:wW(e).concat,empty:$t}},A9=function(e){var t=c0(e);return{concat:function(n,r){return t(r)(n)}}},W9=function(e){var t=l0(e);return{concat:function(n,r){return t(r)(n)}}},E0={URI:st,map:Zt},N9=De(E0),EW={URI:st,of:hs},P9={URI:st,map:Zt,mapWithIndex:Cv},jv={URI:st,map:Zt,ap:Za},F9=St(jv),D9=Tt(jv),L9={URI:st,map:Zt,ap:Za,of:hs},R0={URI:st,map:Zt,ap:Za,chain:op},j9={URI:st,map:Zt,ap:Za,of:hs,chain:op},U9=ut(R0),B9={URI:st,unfold:w0},z9={URI:st,map:Zt,alt:f0},RW={URI:st,zero:gl},q9=pl(RW,EW),K9={URI:st,map:Zt,ap:Za,of:hs,alt:f0,zero:gl},V9={URI:st,map:Zt,extend:dW},M0={URI:st,compact:bl,separate:yl},H9={URI:st,map:Zt,compact:bl,separate:yl,filter:xv,filterMap:kv,partition:Av,partitionMap:Wv},J9={URI:st,map:Zt,mapWithIndex:Cv,compact:bl,separate:yl,filter:xv,filterMap:kv,partition:Av,partitionMap:Wv,partitionMapWithIndex:cW,partitionWithIndex:sW,filterMapWithIndex:lW,filterWithIndex:fW},G9={URI:st,reduce:ps,foldMap:ml,reduceRight:vl},Y9={URI:st,reduce:ps,foldMap:ml,reduceRight:vl,reduceWithIndex:d0,foldMapWithIndex:p0,reduceRightWithIndex:h0},C0={URI:st,map:Zt,reduce:ps,foldMap:ml,reduceRight:vl,traverse:Nv,sequence:sp},Z9={URI:st,map:Zt,mapWithIndex:Cv,reduce:ps,foldMap:ml,reduceRight:vl,reduceWithIndex:d0,foldMapWithIndex:p0,reduceRightWithIndex:h0,traverse:Nv,sequence:sp,traverseWithIndex:pW},x0=function(e){return function(t){for(var n=KY([],e(t),!0),r=[];n.length>0;){var i=n.shift();Lt(i)?n.unshift.apply(n,e(i.left)):r.push(i.right)}return r}},X9={URI:st,map:Zt,ap:Za,chain:op,chainRec:m0},k0=function(e){return function(t){var n=e(t),r=[],i=[];function o(c){Lt(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}},Q9={URI:st,map:Zt,ap:Za,chain:op,chainRec:v0},A0=ii(C0,M0),W0=ri(C0,M0),MW={URI:st,map:Zt,compact:bl,separate:yl,filter:xv,filterMap:kv,partition:Av,partitionMap:Wv,reduce:ps,foldMap:ml,reduceRight:vl,traverse:Nv,sequence:sp,wither:A0,wilt:W0},eZ=I$(MW),CW={URI:st,fromEither:zA},tZ=sr(CW),nZ=ov,Uv=function(e,t,n){return Et(n)?dS(e,t,n):n},xW=function(e,t){var n=t.slice();return n.splice(e,1),n},rZ=function(e){return e.slice()},iZ=function(e){return qi(e)?$t:e.slice()},$t=qd;function kW(e){return function(t){return t.every(e)}}var AW=function(e){return function(t){return t.some(e)}},oZ=AW,WW=function(e){var t=WS(e);return function(n){return KA(function(){return e.empty},t(n))}},aZ=hs(jt),uZ=Ot(E0),sZ=wt(R0),cZ=It(jv),lZ=Dk,fZ=sA,dZ=cA,pZ=aW,hZ={URI:st,compact:bl,separate:yl,map:Zt,ap:Za,of:hs,chain:op,filter:xv,filterMap:kv,partition:Av,partitionMap:Wv,mapWithIndex:Cv,partitionMapWithIndex:cW,partitionWithIndex:sW,filterMapWithIndex:lW,filterWithIndex:fW,alt:f0,zero:gl,unfold:w0,reduce:ps,foldMap:ml,reduceRight:vl,traverse:Nv,sequence:sp,reduceWithIndex:d0,foldMapWithIndex:p0,reduceRightWithIndex:h0,traverseWithIndex:pW,extend:dW,wither:A0,wilt:W0};const mZ=Object.freeze(Object.defineProperty({__proto__:null,isEmpty:qi,isNonEmpty:Et,prepend:VY,prependW:HY,append:Ev,appendW:JY,makeBy:UA,replicate:GY,fromPredicate:YY,fromOption:BA,fromEither:zA,matchW:qA,match:KA,matchLeftW:VA,matchLeft:HA,foldLeft:ZY,matchRightW:JA,matchRight:GA,foldRight:XY,chainWithIndex:YA,scanLeft:QY,scanRight:e9,size:t9,isOutOfBound:hl,lookup:ds,head:ZA,last:a0,tail:n9,init:r9,takeLeft:i9,takeRight:o9,takeLeftWhile:a9,spanLeft:u9,dropLeft:s9,dropRight:c9,dropLeftWhile:l9,findIndex:Rv,findFirst:Mv,findFirstMap:QA,findLast:eW,findLastMap:tW,findLastIndex:nW,insertAt:f9,updateAt:d9,deleteAt:p9,modifyAt:rW,reverse:h9,rights:m9,lefts:v9,sort:g9,zipWith:iW,zip:oW,unzip:y9,prependAll:aW,intersperse:b9,rotate:_9,elem:ip,uniq:$9,sortBy:S9,chop:T9,splitAt:u0,chunksOf:I9,fromOptionK:O9,comprehension:w9,concatW:uW,concat:E9,union:s0,intersection:c0,difference:l0,_chainRecDepthFirst:m0,_chainRecBreadthFirst:v0,of:hs,zero:gl,altW:hW,alt:mW,ap:vW,chain:ap,flatten:g0,map:Pv,mapWithIndex:gW,separate:yl,filter:fi,filterMapWithIndex:y0,filterMap:b0,compact:bl,partition:yW,partitionWithIndex:_0,partitionMap:bW,partitionMapWithIndex:$0,filterWithIndex:_W,extend:S0,duplicate:R9,foldMapWithIndex:Fv,reduce:Dv,foldMap:T0,reduceWithIndex:up,reduceRight:I0,reduceRightWithIndex:Lv,traverse:$W,sequence:sp,traverseWithIndex:O0,wither:M9,wilt:C9,unfold:w0,URI:st,getShow:SW,getSemigroup:TW,getMonoid:x9,getEq:IW,getOrd:OW,getUnionSemigroup:wW,getUnionMonoid:k9,getIntersectionSemigroup:A9,getDifferenceMagma:W9,Functor:E0,flap:N9,Pointed:EW,FunctorWithIndex:P9,Apply:jv,apFirst:F9,apSecond:D9,Applicative:L9,Chain:R0,Monad:j9,chainFirst:U9,Unfoldable:B9,Alt:z9,Zero:RW,guard:q9,Alternative:K9,Extend:V9,Compactable:M0,Filterable:H9,FilterableWithIndex:J9,Foldable:G9,FoldableWithIndex:Y9,Traversable:C0,TraversableWithIndex:Z9,chainRecDepthFirst:x0,ChainRecDepthFirst:X9,chainRecBreadthFirst:k0,ChainRecBreadthFirst:Q9,Witherable:MW,filterE:eZ,FromEither:CW,fromEitherK:tZ,unsafeInsertAt:nZ,unsafeUpdateAt:Uv,unsafeDeleteAt:xW,toArray:rZ,fromArray:iZ,empty:$t,every:kW,some:AW,exists:oZ,intercalate:WW,Do:aZ,bindTo:uZ,bind:sZ,apS:cZ,range:lZ,cons:fZ,snoc:dZ,prependToAll:pZ,readonlyArray:hZ},Symbol.toStringTag,{value:"Module"}));var Xa=function(e){return e.length===0},xt=Eo,vZ=cl,gZ=NS,Bv=Xd,yZ=PS,NW=function(e,t){return e<=0?[]:yv(t)(e)},bZ=function(e,t){return NW(e,function(){return t})};function _Z(e){return function(t){return e(t)?[t]:[]}}var PW=function(e){return Ct(e)?[]:[e.value]},FW=function(e){return Lt(e)?[]:[e.right]},DW=function(e,t){return function(n){return xt(n)?t(n):e()}},$Z=DW,LW=function(e,t){return function(n){return xt(n)?t(Nr(n),li(n)):e()}},jW=LW,SZ=jW,UW=function(e,t){return function(n){return xt(n)?t(dl(n),fl(n)):e()}},BW=UW,TZ=BW,zW=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},IZ=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}},OZ=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}},wZ=function(e){return e.length},cp=gv,EZ=ds,RZ=ZA,MZ=a0,CZ=function(e){return xt(e)?le(li(e)):me},xZ=function(e){return xt(e)?le(dl(e)):me},kZ=function(e){return function(t){return cp(e,t)?vn(t):t.slice(0,e)}},AZ=function(e){return function(t){return cp(e,t)?vn(t):e===0?[]:t.slice(-e)}};function WZ(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 qW=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function NZ(e){return function(t){var n=GW(qW(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var PZ=function(e){return function(t){return e<=0||Xa(t)?vn(t):e>=t.length?[]:t.slice(e,t.length)}},FZ=function(e){return function(t){return e<=0||Xa(t)?vn(t):e>=t.length?[]:t.slice(0,t.length-e)}};function DZ(e){return function(t){return t.slice(qW(t,e))}}var LZ=Rv;function jZ(e){return Mv(e)}var UZ=QA;function BZ(e){return eW(e)}var zZ=tW,qZ=nW,vn=function(e){return e.slice()},KZ=function(e,t){return function(n){return e<0||e>n.length?me:le(IN(e,t,n))}},VZ=function(e,t){return KW(e,function(){return t})},HZ=function(e){return function(t){return cp(e,t)?me:le(wN(e,t))}},KW=function(e,t){return function(n){return cp(e,n)?me:le(ON(e,t(n[e]),n))}},JZ=function(e){return Xa(e)?[]:e.slice().reverse()},GZ=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},YZ=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},ZZ=function(e){return function(t){return t.length<=1?vn(t):t.slice().sort(e.compare)}},VW=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 HW(e,t){return t===void 0?function(n){return HW(n,e)}:VW(e,t,function(n,r){return[n,r]})}var XZ=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]},JW=function(e){var t=_v(e);return function(n){return xt(n)?t(n):[]}},QZ=function(e){var t=bA(e);return function(n){return xt(n)?t(n):vn(n)}},eX=function(e){var t=US(e);return function(n){return xt(n)?t(n):vn(n)}},N0=ip,tX=function(e){var t=LS(e);return function(n){return xt(n)?t(n):vn(n)}},nX=function(e){var t=lA(e);return function(n){return xt(n)?t(n):vn(n)}},rX=function(e){var t=qS(e);return function(n){return xt(n)?t(n):[]}},GW=function(e){return function(t){return e>=1&&xt(t)?$v(e)(t):Xa(t)?[vn(t),[]]:[[],vn(t)]}},iX=function(e){var t=TA(e);return function(n){return xt(n)?t(n):[]}},oX=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return PW(e.apply(void 0,t))}};function aX(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return xt(o)?m(Nr(o),fp(function(a){return r(m(i,Bv(a)),li(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:[]};return r([],e)}var YW=function(e){return function(t){return Xa(t)?vn(e):Xa(e)?vn(t):t.concat(e)}},uX=YW;function P0(e){var t=jS(e);return function(n,r){if(r===void 0){var i=P0(e);return function(o){return i(o,n)}}return xt(n)&&xt(r)?t(r)(n):xt(n)?vn(n):vn(r)}}function F0(e){var t=N0(e);return function(n,r){if(r===void 0){var i=F0(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function D0(e){var t=N0(e);return function(n,r){if(r===void 0){var i=D0(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var Xt=function(e,t){return m(e,z0(t))},zv=function(e,t){return m(e,iN(t))},Qa=function(e,t){return m(e,rN(t))},lp=function(e,t){return m(e,fp(t))},qv=function(e,t){return m(e,oN(t))},Kv=function(e,t){return m(e,V0(t))},Vv=function(e,t){return m(e,aN(t))},Hv=function(e,t){return m(e,uN(t))},ZW=function(e,t){return m(e,H0(t))},XW=function(e,t){return m(e,J0(t))},L0=function(e,t){return m(e,cN(t))},ms=function(e,t,n){return m(e,pN(t,n))},_l=function(e){var t=fN(e);return function(n,r){return m(n,t(r))}},$l=function(e,t,n){return m(e,hN(t,n))},j0=function(e,t,n){return m(e,Y0(t,n))},U0=function(e){var t=dN(e);return function(n,r){return m(n,t(r))}},B0=function(e,t,n){return m(e,mN(t,n))},QW=function(e,t){return m(e,K0(t))},eN=function(e,t){return m(e,lN(t))},tN=function(e,t){return m(e,G0(t))},Jv=function(e){var t=Gv(e);return function(n,r){return m(n,t(r))}},nN=function(e){var t=Z0(e);return function(n,r){return m(n,t(r))}},sX=m0,cX=v0,eu=Ya,Sl=function(){return[]},z0=function(e){return function(t){return t.map(function(n){return e(n)})}},rN=function(e){return fp(function(t){return m(e,z0(t))})},fp=function(e){return function(t){return m(t,zW(function(n,r){return e(r)}))}},q0=fp(B),iN=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},K0=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);mt(i)&&n.push(i.value)}return n}},V0=function(e){return K0(function(t,n){return e(n)})},Tl=V0(B),Il=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 Oe(t,n)},oN=function(e){return function(t){return t.filter(e)}},aN=function(e){return H0(function(t,n){return e(n)})},H0=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 Oe(n,r)}},uN=function(e){return J0(function(t,n){return e(n)})},J0=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 Oe(n,r)}},sN=function(e){return function(t){return t.concat(e())}},cN=sN,lN=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},G0=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},lX=G0(B),fN=T0,dN=Fv,pN=Dv,Y0=up,hN=I0,mN=Lv,Gv=function(e){var t=Z0(e);return function(n){return t(function(r,i){return n(i)})}},dp=function(e){return function(t){return ms(t,e.of(Sl()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return m(i,Bv(o))}}),r)})}},Z0=function(e){return function(t){return Y0(e.of(Sl()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return m(o,Bv(a))}}),t(n,i))})}},fX=function(e){var t=iT(e);return function(n){return function(r){return t(r,n)}}},dX=function(e){var t=oT(e);return function(n){return function(r){return t(r,n)}}},X0=function(e,t){for(var n=[],r=e;;){var i=t(r);if(mt(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},ct="Array",pX=SW,vN=function(){return{concat:function(e,t){return e.concat(t)}}},Q0=function(){return{concat:vN().concat,empty:[]}},gN=IW,hX=OW,yN=function(e){var t=P0(e);return{concat:function(n,r){return t(r)(n)}}},mX=function(e){return{concat:yN(e).concat,empty:[]}},vX=function(e){var t=F0(e);return{concat:function(n,r){return t(r)(n)}}},gX=function(e){var t=D0(e);return{concat:function(n,r){return t(r)(n)}}},eT={URI:ct,map:Xt},yX=De(eT),bN={URI:ct,of:eu},bX={URI:ct,map:Xt,mapWithIndex:zv},Yv={URI:ct,map:Xt,ap:Qa},_X=St(Yv),$X=Tt(Yv),SX={URI:ct,map:Xt,ap:Qa,of:eu},tT={URI:ct,map:Xt,ap:Qa,chain:lp},TX=ut(tT),IX={URI:ct,map:Xt,ap:Qa,of:eu,chain:lp},OX={URI:ct,unfold:X0},wX={URI:ct,map:Xt,alt:L0},_N={URI:ct,zero:Sl},EX=pl(_N,bN),RX={URI:ct,map:Xt,ap:Qa,of:eu,alt:L0,zero:Sl},MX={URI:ct,map:Xt,extend:tN},nT={URI:ct,compact:Tl,separate:Il},CX={URI:ct,map:Xt,compact:Tl,separate:Il,filter:qv,filterMap:Kv,partition:Vv,partitionMap:Hv},xX={URI:ct,map:Xt,mapWithIndex:zv,compact:Tl,separate:Il,filter:qv,filterMap:Kv,partition:Vv,partitionMap:Hv,partitionMapWithIndex:XW,partitionWithIndex:ZW,filterMapWithIndex:QW,filterWithIndex:eN},$N={URI:ct,reduce:ms,foldMap:_l,reduceRight:$l},kX={URI:ct,reduce:ms,foldMap:_l,reduceRight:$l,reduceWithIndex:j0,foldMapWithIndex:U0,reduceRightWithIndex:B0},rT={URI:ct,map:Xt,reduce:ms,foldMap:_l,reduceRight:$l,traverse:Jv,sequence:dp},AX={URI:ct,map:Xt,mapWithIndex:zv,reduce:ms,foldMap:_l,reduceRight:$l,reduceWithIndex:j0,foldMapWithIndex:U0,reduceRightWithIndex:B0,traverse:Jv,sequence:dp,traverseWithIndex:nN},iT=ii(rT,nT),oT=ri(rT,nT),SN={URI:ct,map:Xt,compact:Tl,separate:Il,filter:qv,filterMap:Kv,partition:Vv,partitionMap:Hv,reduce:ms,foldMap:_l,reduceRight:$l,traverse:Jv,sequence:dp,wither:iT,wilt:oT},WX=x0,NX={URI:ct,map:Xt,ap:Qa,chain:lp,chainRec:sX},PX=k0,FX={URI:ct,map:Xt,ap:Qa,chain:lp,chainRec:cX},DX=I$(SN),TN={URI:ct,fromEither:FW},LX=sr(TN),IN=FS,ON=function(e,t,n){return xt(n)?DS(e,t,n):[]},wN=function(e,t){var n=t.slice();return n.splice(e,1),n},jX=kW,EN=function(e){return function(t){return t.some(e)}},UX=EN,BX=WW,zX=eu(jt),qX=Ot(eT),KX=wt(tT),VX=It(Yv),HX=fA,JX=[],GX=DA,YX=LA,ZX=JW,XX={URI:ct,compact:Tl,separate:Il,map:Xt,ap:Qa,of:eu,chain:lp,filter:qv,filterMap:Kv,partition:Vv,partitionMap:Hv,mapWithIndex:zv,partitionMapWithIndex:XW,partitionWithIndex:ZW,filterMapWithIndex:QW,filterWithIndex:eN,alt:L0,zero:Sl,unfold:X0,reduce:ms,foldMap:_l,reduceRight:$l,traverse:Jv,sequence:dp,reduceWithIndex:j0,foldMapWithIndex:U0,reduceRightWithIndex:B0,traverseWithIndex:nN,extend:tN,wither:iT,wilt:oT};const RN=Object.freeze(Object.defineProperty({__proto__:null,isEmpty:Xa,isNonEmpty:xt,prepend:vZ,prependW:gZ,append:Bv,appendW:yZ,makeBy:NW,replicate:bZ,fromPredicate:_Z,fromOption:PW,fromEither:FW,matchW:DW,match:$Z,matchLeftW:LW,matchLeft:jW,foldLeft:SZ,matchRightW:UW,matchRight:BW,foldRight:TZ,chainWithIndex:zW,scanLeft:IZ,scanRight:OZ,size:wZ,isOutOfBound:cp,lookup:EZ,head:RZ,last:MZ,tail:CZ,init:xZ,takeLeft:kZ,takeRight:AZ,takeLeftWhile:WZ,spanLeft:NZ,dropLeft:PZ,dropRight:FZ,dropLeftWhile:DZ,findIndex:LZ,findFirst:jZ,findFirstMap:UZ,findLast:BZ,findLastMap:zZ,findLastIndex:qZ,copy:vn,insertAt:KZ,updateAt:VZ,deleteAt:HZ,modifyAt:KW,reverse:JZ,rights:GZ,lefts:YZ,sort:ZZ,zipWith:VW,zip:HW,unzip:XZ,prependAll:JW,intersperse:QZ,rotate:eX,elem:N0,uniq:tX,sortBy:nX,chop:rX,splitAt:GW,chunksOf:iX,fromOptionK:oX,comprehension:aX,concatW:YW,concat:uX,union:P0,intersection:F0,difference:D0,of:eu,zero:Sl,map:z0,ap:rN,chain:fp,flatten:q0,mapWithIndex:iN,filterMapWithIndex:K0,filterMap:V0,compact:Tl,separate:Il,filter:oN,partition:aN,partitionWithIndex:H0,partitionMap:uN,partitionMapWithIndex:J0,altW:sN,alt:cN,filterWithIndex:lN,extend:G0,duplicate:lX,foldMap:fN,foldMapWithIndex:dN,reduce:pN,reduceWithIndex:Y0,reduceRight:hN,reduceRightWithIndex:mN,traverse:Gv,sequence:dp,traverseWithIndex:Z0,wither:fX,wilt:dX,unfold:X0,URI:ct,getShow:pX,getSemigroup:vN,getMonoid:Q0,getEq:gN,getOrd:hX,getUnionSemigroup:yN,getUnionMonoid:mX,getIntersectionSemigroup:vX,getDifferenceMagma:gX,Functor:eT,flap:yX,Pointed:bN,FunctorWithIndex:bX,Apply:Yv,apFirst:_X,apSecond:$X,Applicative:SX,Chain:tT,chainFirst:TX,Monad:IX,Unfoldable:OX,Alt:wX,Zero:_N,guard:EX,Alternative:RX,Extend:MX,Compactable:nT,Filterable:CX,FilterableWithIndex:xX,Foldable:$N,FoldableWithIndex:kX,Traversable:rT,TraversableWithIndex:AX,Witherable:SN,chainRecDepthFirst:WX,ChainRecDepthFirst:NX,chainRecBreadthFirst:PX,ChainRecBreadthFirst:FX,filterE:DX,FromEither:TN,fromEitherK:LX,unsafeInsertAt:IN,unsafeUpdateAt:ON,unsafeDeleteAt:wN,every:jX,some:EN,exists:UX,intercalate:BX,Do:zX,bindTo:qX,bind:KX,apS:VX,range:HX,empty:JX,cons:GX,snoc:YX,prependToAll:ZX,array:XX},Symbol.toStringTag,{value:"Module"})),QX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var eQ=function(e){return typeof e=="boolean"},MN=function(e,t){return function(n){return n?t():e()}},CN=MN,xN=CN,tQ=xN,kN={equals:function(e,t){return e===t}},nQ={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}},AN={concat:function(e,t){return e&&t}},WN={concat:function(e,t){return e||t}},rQ={concat:AN.concat,empty:!0},iQ={concat:WN.concat,empty:!1},oQ={equals:kN.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},aQ={show:function(e){return JSON.stringify(e)}};const uQ=Object.freeze(Object.defineProperty({__proto__:null,isBoolean:eQ,matchW:MN,foldW:CN,match:xN,fold:tQ,Eq:kN,BooleanAlgebra:nQ,SemigroupAll:AN,SemigroupAny:WN,MonoidAll:rQ,MonoidAny:iQ,Ord:oQ,Show:aQ},Symbol.toStringTag,{value:"Module"}));var NN=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}},sQ={meet:function(){},join:function(){},zero:void 0,one:void 0,implies:function(){},not:function(){}},cQ=NN,lQ={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}},fQ=LC;const dQ=Object.freeze(Object.defineProperty({__proto__:null,reverse:NN,booleanAlgebraVoid:sQ,getDualBooleanAlgebra:cQ,booleanAlgebraBoolean:lQ,getFunctionBooleanAlgebra:fQ},Symbol.toStringTag,{value:"Module"}));var pQ=function(e){return wk(e)(e.bottom,e.top)},hQ=function(e){var t=tS(e);return{equals:t.equals,compare:t.compare,top:e.bottom,bottom:e.top}},mQ={equals:Qm.equals,compare:Qm.compare,top:1/0,bottom:-1/0};const vQ=Object.freeze(Object.defineProperty({__proto__:null,clamp:pQ,reverse:hQ,boundedNumber:mQ},Symbol.toStringTag,{value:"Module"}));function PN(e){return{meet:Zm(e),join:Xm(e)}}const gQ=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:PN},Symbol.toStringTag,{value:"Module"}));function yQ(e){var t=PN(e);return function(n,r){return{join:t.join,meet:t.meet,zero:n,one:r}}}const bQ=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:yQ},Symbol.toStringTag,{value:"Module"})),_Q=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),$Q=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),SQ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),TQ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function aT(e,t){return function(n,r){return t.compose(e.right(r),e.left(n))}}function FN(e,t){var n=aT(e,t);return function(r,i){return t.compose(e.promap(t.id(),function(o){return o._tag==="Left"?o.left:o.right},B),n(r,i))}}function IQ(e){return aT(e,e)}function OQ(e){return FN(e,e)}const wQ=Object.freeze(Object.defineProperty({__proto__:null,split:aT,fanIn:FN,splitChoice:IQ,fanin:OQ},Symbol.toStringTag,{value:"Module"})),EQ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var RQ=function(e,t){return m(e,DN(t))},DN=function(e){return function(t){return X(e,t)}},LN="Predicate",jN=function(){return{concat:function(e,t){return m(e,BN(t))}}},MQ=function(){return{concat:jN().concat,empty:BC}},UN=function(){return{concat:function(e,t){return m(e,zN(t))}}},CQ=function(){return{concat:UN().concat,empty:v$}},xQ={URI:LN,contramap:RQ},pp=function(e){return function(t){return!e(t)}},BN=function(e){return function(t){return function(n){return t(n)||e(n)}}},zN=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const kQ=Object.freeze(Object.defineProperty({__proto__:null,contramap:DN,URI:LN,getSemigroupAny:jN,getMonoidAny:MQ,getSemigroupAll:UN,getMonoidAll:CQ,Contravariant:xQ,not:pp,or:BN,and:zN},Symbol.toStringTag,{value:"Module"}));var tt=me,vt=le;function Zv(e){return function(t){return e(t)?vt(t):tt}}var Xv=function(e){return e._tag==="Right"?tt:vt(e.left)},hp=function(e){return e._tag==="Left"?tt:vt(e.right)},cr=function(e,t){return m(e,Ki(t))},vs=function(e,t){return m(e,HN(t))},Qv=function(e,t){return m(e,vp(t))},eg=function(e,t,n){return m(e,GN(t,n))},tg=function(e){var t=YN(e);return function(n,r){return m(n,t(r))}},ng=function(e,t,n){return m(e,ZN(t,n))},uT=function(e){var t=oP(e);return function(n,r){return m(n,t(r))}},sT=function(e,t){return m(e,QN(t))},mp=function(e,t){return m(e,tP(t))},cT=function(e,t){return m(e,nP(t))},qN=function(e,t){return m(e,pT(t))},lT=function(e,t){return m(e,rP(t))},fT=function(e,t){return m(e,iP(t))},Wt="Option",AQ=function(e){return{show:function(t){return Ne(t)?"none":"some(".concat(e.show(t.value),")")}}},KN=function(e){return{equals:function(t,n){return t===n||(Ne(t)?Ne(n):Ne(n)?!1:e.equals(t.value,n.value))}}},WQ=function(e){return{equals:KN(e).equals,compare:function(t,n){return t===n?0:ag(t)?ag(n)?e.compare(t.value,n.value):1:-1}}},dT=function(e){return{concat:function(t,n){return Ne(t)?n:Ne(n)?t:vt(e.concat(t.value,n.value))},empty:tt}},Ki=function(e){return function(t){return Ne(t)?tt:vt(e(t.value))}},Ol={URI:Wt,map:cr},Ro=vt,VN={URI:Wt,of:Ro},HN=function(e){return function(t){return Ne(t)||Ne(e)?tt:vt(t.value(e.value))}},wl={URI:Wt,map:cr,ap:vs},JN={URI:Wt,map:cr,ap:vs,of:Ro},vp=function(e){return function(t){return Ne(t)?tt:e(t.value)}},gp={URI:Wt,map:cr,ap:vs,chain:Qv},NQ={URI:Wt,map:cr,ap:vs,of:Ro,chain:Qv},GN=function(e,t){return function(n){return Ne(n)?e:t(e,n.value)}},YN=function(e){return function(t){return function(n){return Ne(n)?e.empty:t(n.value)}}},ZN=function(e,t){return function(n){return Ne(n)?e:t(n.value,e)}},PQ={URI:Wt,reduce:eg,foldMap:tg,reduceRight:ng},XN=function(e){return function(t){return Ne(t)?e():t}},QN=XN,FQ={URI:Wt,map:cr,alt:sT},rg=function(){return tt},eP={URI:Wt,zero:rg},DQ=pl(eP,VN),LQ={URI:Wt,map:cr,ap:vs,of:Ro,alt:sT,zero:rg},pT=function(e){return function(t){return Ne(t)?tt:vt(e(t))}},jQ={URI:Wt,map:cr,extend:qN},El=vp(B),UQ=Oe(tt,tt),Rl=function(e){return Ne(e)?UQ:Oe(Xv(e.value),hp(e.value))},gs={URI:Wt,compact:El,separate:Rl},tP=function(e){return function(t){return Ne(t)?tt:e(t.value)?t:tt}},nP=function(e){return function(t){return Ne(t)?tt:e(t.value)}},rP=function(e){return function(t){return Oe(mp(t,pp(e)),mp(t,e))}},iP=function(e){return X(Ki(e),Rl)},Mo={URI:Wt,map:cr,compact:El,separate:Rl,filter:mp,filterMap:cT,partition:lT,partitionMap:fT},oP=function(e){return function(t){return function(n){return Ne(n)?e.of(tt):e.map(t(n.value),vt)}}},ig=function(e){return function(t){return Ne(t)?e.of(tt):e.map(t.value,vt)}},hT={URI:Wt,map:cr,reduce:eg,foldMap:tg,reduceRight:ng,traverse:uT,sequence:ig},mT=ii(hT,gs),vT=ri(hT,gs),BQ=function(e){var t=mT(e);return function(n){return function(r){return t(r,n)}}},zQ=function(e){var t=vT(e);return function(n){return function(r){return t(r,n)}}},qQ={URI:Wt,map:cr,reduce:eg,foldMap:tg,reduceRight:ng,traverse:uT,sequence:ig,compact:El,separate:Rl,filter:mp,filterMap:cT,partition:lT,partitionMap:fT,wither:mT,wilt:vT},gT=function(){return tt},KQ={URI:Wt,map:cr,ap:vs,of:Ro,chain:Qv,throwError:gT},Ml=hp,og={URI:Wt,fromEither:Ml},ag=mt,Ne=function(e){return e._tag==="None"},yT=function(e,t){return function(n){return Ne(n)?e():t(n.value)}},VQ=yT,Co=yT,xo=Co,bT=function(e){return function(t){return Ne(t)?e():t.value}},_T=bT,HQ=De(Ol),JQ=St(wl),GQ=Tt(wl),YQ=El,ZQ=ut(gp),XQ=pT(B),QQ=sr(og),eee=Io(og,gp),tee=Oo(og,gp),ys=function(e){return e==null?tt:vt(e)},aP=function(e){try{return vt(e())}catch{return tt}},nee=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return aP(function(){return e.apply(void 0,t)})}},ree=function(e){return X(e,ys)},uP=function(e){return function(t){return Ne(t)?tt:ys(e(t.value))}},$T=Co(zC,B),sP=Co(g$,B);function cP(e){return function(t,n){if(n===void 0){var r=cP(e);return function(i){return r(t,i)}}return Ne(n)?!1:e.equals(t,n.value)}}var iee=function(e){return function(t){return Ne(t)?!1:e(t.value)}},oee=Ro(jt),aee=Ot(Ol),uee=wt(gp),see=It(wl),lP=Ro(Yt),ug=function(e){return function(t){var n=e(0,ur(t));if(Ne(n))return tt;for(var r=[n.value],i=1;i<t.length;i++){var o=e(i,t[i]);if(Ne(o))return tt;r.push(o.value)}return vt(r)}},ST=function(e){var t=ug(e);return function(n){return dt(n)?t(n):lP}},cee=ST,fP=function(e){return ST(function(t,n){return e(n)})},lee=fP(B);function fee(e){return function(t){return ag(e(t))}}var dee=uP,dP={URI:Wt,map:cr,of:Ro,ap:vs,chain:Qv,reduce:eg,foldMap:tg,reduceRight:ng,traverse:uT,sequence:ig,zero:rg,alt:sT,extend:qN,compact:El,separate:Rl,filter:mp,filterMap:cT,partition:lT,partitionMap:fT,wither:mT,wilt:vT,throwError:gT},pee=Ut(wl),hee=kr(JN),pP=function(){return dT(sS())},mee=function(){return dT(nv())};const hP=Object.freeze(Object.defineProperty({__proto__:null,none:tt,some:vt,fromPredicate:Zv,getLeft:Xv,getRight:hp,URI:Wt,getShow:AQ,getEq:KN,getOrd:WQ,getMonoid:dT,map:Ki,Functor:Ol,of:Ro,Pointed:VN,ap:HN,Apply:wl,Applicative:JN,chain:vp,Chain:gp,Monad:NQ,reduce:GN,foldMap:YN,reduceRight:ZN,Foldable:PQ,altW:XN,alt:QN,Alt:FQ,zero:rg,Zero:eP,guard:DQ,Alternative:LQ,extend:pT,Extend:jQ,compact:El,separate:Rl,Compactable:gs,filter:tP,filterMap:nP,partition:rP,partitionMap:iP,Filterable:Mo,traverse:oP,sequence:ig,Traversable:hT,wither:BQ,wilt:zQ,Witherable:qQ,throwError:gT,MonadThrow:KQ,fromEither:Ml,FromEither:og,isSome:ag,isNone:Ne,matchW:yT,foldW:VQ,match:Co,fold:xo,getOrElseW:bT,getOrElse:_T,flap:HQ,apFirst:JQ,apSecond:GQ,flatten:YQ,chainFirst:ZQ,duplicate:XQ,fromEitherK:QQ,chainEitherK:eee,chainFirstEitherK:tee,fromNullable:ys,tryCatch:aP,tryCatchK:nee,fromNullableK:ree,chainNullableK:uP,toNullable:$T,toUndefined:sP,elem:cP,exists:iee,Do:oee,bindTo:aee,bind:uee,apS:see,ApT:lP,traverseReadonlyNonEmptyArrayWithIndex:ug,traverseReadonlyArrayWithIndex:ST,traverseArrayWithIndex:cee,traverseArray:fP,sequenceArray:lee,getRefinement:fee,mapNullable:dee,option:dP,getApplySemigroup:pee,getApplyMonoid:hee,getFirstMonoid:pP,getLastMonoid:mee},Symbol.toStringTag,{value:"Module"}));function Vi(e,t){return function(n){return e.map(n,t.compact)}}function ko(e,t,n){var r=Vi(e,t),i=Yc(e,n);return function(o){return Oe(r(m(o,i(Xv))),r(m(o,i(hp))))}}function vee(e,t){var n=Zc(e,t).map;return{map:n,compact:Vi(e,t),separate:ko(e,t,t)}}const gee=Object.freeze(Object.defineProperty({__proto__:null,compact:Vi,separate:ko,getCompactableComposition:vee},Symbol.toStringTag,{value:"Module"}));var yee=function(e){return function(){return console.log(e)}},bee=function(e){return function(){return console.warn(e)}},_ee=function(e){return function(){return console.error(e)}},$ee=function(e){return function(){return console.info(e)}};const See=Object.freeze(Object.defineProperty({__proto__:null,log:yee,warn:bee,error:_ee,info:$ee},Symbol.toStringTag,{value:"Module"}));var Cl=Jc;function Tee(e){return{show:function(t){return"make(".concat(e.show(t),")")}}}var Iee=B,Oee=B,wee=B,Eee=B,Ree=B,Mee=B,Cee=B,xee=B,kee=B;function mP(e){return{URI:bs,_E:void 0,map:TT,ap:function(t,n){return Cl(e.concat(t,n))}}}function vP(e){var t=mP(e);return{URI:bs,_E:void 0,map:t.map,ap:t.ap,of:function(){return Cl(e.empty)}}}var gP=function(e,t){return m(e,_P())},TT=function(e,t){return m(e,$P())},yP=function(e,t,n){return m(e,SP(t))},bP=function(e,t){return m(e,TP(t))},_P=function(){return Jc},$P=function(){return Jc},SP=function(e){return function(t){return Cl(e(t))}},TP=function(e){return function(t){return Cl(e(t))}},bs="Const",IP={URI:bs,map:TT},Aee=De(IP),Wee={URI:bs,contramap:gP},Nee={URI:bs,bimap:yP,mapLeft:bP},Pee={URI:bs,map:TT,contramap:gP,bimap:yP,mapLeft:bP};const Fee=Object.freeze(Object.defineProperty({__proto__:null,make:Cl,getShow:Tee,getEq:Iee,getOrd:Oee,getBounded:wee,getSemigroup:Eee,getMonoid:Ree,getSemiring:Mee,getRing:Cee,getHeytingAlgebra:xee,getBooleanAlgebra:kee,getApply:mP,getApplicative:vP,contramap:_P,map:$P,bimap:SP,mapLeft:TP,URI:bs,Functor:IP,flap:Aee,Contravariant:Wee,Bifunctor:Nee,const_:Pee},Symbol.toStringTag,{value:"Module"})),Dee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Lee={equals:function(e,t){return e.valueOf()===t.valueOf()}},jee={equals:function(e,t){return e.getDate()===t.getDate()}},Uee={equals:function(e,t){return e.getMonth()===t.getMonth()}},Bee={equals:function(e,t){return e.getFullYear()===t.getFullYear()}},zee=m(wv,Ym(function(e){return e.valueOf()})),qee=function(){return new Date},Kee=function(){return new Date().getTime()};const Vee=Object.freeze(Object.defineProperty({__proto__:null,Eq:Lee,eqDate:jee,eqMonth:Uee,eqYear:Bee,Ord:zee,create:qee,now:Kee},Symbol.toStringTag,{value:"Module"}));function _s(e){return X(Be,e.of)}function xl(e){return X(bt,e.of)}function kl(e){return function(t){return e.map(t,Be)}}function Al(e){return function(t){return e.map(t,bt)}}function sg(e){return function(t){return X(F$(t),e.of)}}function cg(e){var t=sg(e);return function(n){var r=t(n);return function(i){return X(i,r)}}}function IT(e){var t=$s(e),n=cg(e);return function(r){var i=n(r);return function(o){return t(i(o))}}}function Wl(e){return Yc(e,Ka)}function Nl(e){return To(e,el)}function $s(e){return function(t){return function(n){return e.chain(n,function(r){return oe(r)?e.of(r):t(r.right)})}}}function Pl(e){return function(t){return function(n){return e.chain(n,function(r){return oe(r)?t():e.of(r)})}}}function Fl(e){return function(t,n){return function(r){return e.map(r,x$(t,n))}}}function Dl(e){return function(t){return function(n){return e.map(n,Fd(t))}}}function yp(e,t){return function(n){return function(r){return e.chain(r,Va(function(i){return e.map(n(),Fd(function(o){return t.concat(i,o)}))},_s(e)))}}}function bp(e){return function(t,n){return function(r){return e.map(r,Va(t,n))}}}function Ll(e){return function(t,n){return function(r){return e.chain(r,Va(t,n))}}}function jl(e){return function(t){return function(n){return e.chain(n,Va(t,e.of))}}}function Ss(e){return function(t){return function(n){return e.chain(n,function(r){return oe(r)?t(r.left):e.of(r)})}}}function _p(e){var t=Ss(e);return function(n){return t(function(r){return e.map(n(r),function(i){return oe(i)?i:bt(r)})})}}function $p(e){return function(t){return function(n){return e.chain(n,Va(function(r){return e.map(t(r),bt)},function(r){return e.of(Be(r))}))}}}function Ul(e){return function(t){return e.map(t,mx)}}function Sp(e){return function(t){return e.map(t,bx)}}function Hee(e){var t=Nl(e),n=Wl(e),r=$s(e),i=Pl(e),o=Fl(e),a=Dl(e),u=Ll(e),s=jl(e),c=Ss(e);return{map:function(l,f){return m(l,n(f))},ap:function(l,f){return m(l,t(f))},of:_s(e),chain:function(l,f){return m(l,r(f))},alt:function(l,f){return m(l,i(f))},bimap:function(l,f,d){return m(l,o(f,d))},mapLeft:function(l,f){return m(l,a(f))},fold:function(l,f,d){return m(l,u(f,d))},getOrElse:function(l,f){return m(l,s(f))},orElse:function(l,f){return m(l,c(f))},swap:Ul(e),rightM:kl(e),leftM:Al(e),left:xl(e)}}const Jee=Object.freeze(Object.defineProperty({__proto__:null,right:_s,left:xl,rightF:kl,leftF:Al,fromNullable:sg,fromNullableK:cg,chainNullableK:IT,map:Wl,ap:Nl,chain:$s,alt:Pl,bimap:Fl,mapLeft:Dl,altValidation:yp,match:bp,matchE:Ll,getOrElse:jl,orElse:Ss,orElseFirst:_p,orLeft:$p,swap:Ul,toUnion:Sp,getEitherM:Hee},Symbol.toStringTag,{value:"Module"}));var Gee="Endomorphism",OP=function(){return{concat:function(e,t){return X(e,t)}}},wP=function(){return{concat:OP().concat,empty:B}};const Yee=Object.freeze(Object.defineProperty({__proto__:null,URI:Gee,getSemigroup:OP,getMonoid:wP},Symbol.toStringTag,{value:"Module"})),Zee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function EP(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 Xee(e,t){var n=t.zero,r=EP(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 Qee={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 ete=Object.freeze(Object.defineProperty({__proto__:null,gcd:EP,lcm:Xee,fieldNumber:Qee},Symbol.toStringTag,{value:"Module"}));function Ao(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filter(i,n)})}}}function Wo(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filterMap(i,n)})}}}function tu(e,t){var n=Ao(e,t);return function(r){var i=n(pp(r)),o=n(r);return function(a){return Oe(i(a),o(a))}}}function nu(e,t){var n=Wo(e,t);return function(r){return function(i){return Oe(m(i,n(function(o){return Xv(r(o))})),m(i,n(function(o){return hp(r(o))})))}}}function tte(e,t){var n=Zc(e,t).map,r=Vi(e,t),i=ko(e,t,t),o=Ao(e,t),a=Wo(e,t),u=tu(e,t),s=nu(e,t);return{map:n,compact:r,separate:i,filter:function(c,l){return m(c,o(l))},filterMap:function(c,l){return m(c,a(l))},partition:function(c,l){return m(c,u(l))},partitionMap:function(c,l){return m(c,s(l))}}}const nte=Object.freeze(Object.defineProperty({__proto__:null,filter:Ao,filterMap:Wo,partition:tu,partitionMap:nu,getFilterableComposition:tte},Symbol.toStringTag,{value:"Module"})),rte=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function RP(e,t){return function(n,r){return function(i){return e.reduce(i,n,function(o,a){return t.reduce(a,o,r)})}}}function MP(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 CP(e,t){return function(n,r){return function(i){return e.reduceRight(i,n,function(o,a){return t.reduceRight(o,a,r)})}}}function ite(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 ote(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 xP(e){return function(t){return e.reduce(t,[],function(n,r){return n.push(r),n})}}function ate(e,t){var n=function(i,o){return e.ap(e.map(i,Dn),o)},r=e.of(void 0);return function(i,o){return t.reduce(i,r,function(a,u){return n(a,o(u))})}}function ute(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 ste=xP;function OT(e,t){var n=RP(e,t),r=MP(e,t),i=CP(e,t);return{reduce:function(o,a,u){return m(o,n(a,u))},foldMap:function(o){var a=r(o);return function(u,s){return m(u,a(s))}},reduceRight:function(o,a,u){return m(o,i(a,u))}}}const cte=Object.freeze(Object.defineProperty({__proto__:null,reduce:RP,foldMap:MP,reduceRight:CP,reduceM:ite,intercalate:ote,toReadonlyArray:xP,traverse_:ate,foldM:ute,toArray:ste,getFoldableComposition:OT},Symbol.toStringTag,{value:"Module"}));function kP(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 AP(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 WP(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 lte(e,t){var n=OT(e,t),r=kP(e,t),i=AP(e,t),o=WP(e,t);return{reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,reduceWithIndex:function(a,u,s){return m(a,r(u,s))},foldMapWithIndex:function(a){var u=i(a);return function(s,c){return m(s,u(c))}},reduceRightWithIndex:function(a,u,s){return m(a,o(u,s))}}}const fte=Object.freeze(Object.defineProperty({__proto__:null,reduceWithIndex:kP,foldMapWithIndex:AP,reduceRightWithIndex:WP,getFoldableWithIndexComposition:lte},Symbol.toStringTag,{value:"Module"}));function Hi(e){return function(t){return X(t,e.fromIO)}}function No(e,t){return function(n){var r=X(n,e.fromIO);return function(i){return t.chain(i,r)}}}function Po(e,t){var n=ut(t);return function(r){return n(X(r,e.fromIO))}}const dte=Object.freeze(Object.defineProperty({__proto__:null,fromIOK:Hi,chainIOK:No,chainFirstIOK:Po},Symbol.toStringTag,{value:"Module"}));var NP=function(){return B},pte=B,Tp=function(e){return function(t){return function(n){return t(e(n))}}},Ip=function(e){return function(t){return e(t)(t)}},hte=Ip,Fo=function(e,t){return m(e,Ts(t))},Op=function(e,t){return m(e,DP(t))},wT=function(e,t){return m(e,LP(t))},PP=function(e,t){return m(e,UP(t))},lg=function(e,t,n){return m(e,BP(t,n))},Ts=function(e){return function(t){return function(n){return e(t(n))}}},FP=function(e){return function(t){return function(n){return t(n)(e(n))}}},DP=FP,Ji=Dn,ET=function(e){return function(t){return function(n){return e(t(n))(n)}}},LP=ET,jP=ET(B),mte=jP,UP=function(e){return function(t){return X(e,t)}},BP=function(e,t){return function(n){return function(r){return t(n(e(r)))}}},RT=function(){return B},MT=function(e){return function(t){var n=t[0],r=t[1];return[e(n),r]}},CT=function(e){return function(t){var n=t[0],r=t[1];return[n,e(r)]}},xT=function(e){return N$(function(t){return So(e(t))},Be)},kT=function(e){return N$(bt,function(t){return Ba(e(t))})},Pr="Reader",Qt={URI:Pr,map:Fo},vte=De(Qt),AT={URI:Pr,of:Ji},Do={URI:Pr,map:Fo,ap:Op},zP=St(Do),gte=zP,qP=Tt(Do),yte=qP,KP={URI:Pr,map:Fo,ap:Op,of:Ji},WT={URI:Pr,map:Fo,ap:Op,chain:wT},Lo={URI:Pr,map:Fo,of:Ji,ap:Op,chain:wT},VP=ut(WT),bte=VP,_te={URI:Pr,map:Fo,promap:lg},$te={URI:Pr,compose:PP,id:RT},Ste={URI:Pr,map:Fo,promap:lg,first:MT,second:CT},Tte={URI:Pr,map:Fo,promap:lg,left:xT,right:kT},Ite=Ot(Qt),HP=wt(WT),Ote=HP,wte=Ji(jt),JP=It(Do),Ete=JP,GP=Ji(Yt),Is=function(e){return function(t){return function(n){for(var r=[e(0,ur(t))(n)],i=1;i<t.length;i++)r.push(e(i,t[i])(n));return r}}},NT=function(e){var t=Is(e);return function(n){return dt(n)?t(n):GP}},Rte=NT,YP=function(e){return NT(function(t,n){return e(n)})},Mte=YP(B),Cte={URI:Pr,map:Fo,of:Ji,ap:Op,chain:wT,promap:lg,compose:PP,id:RT,first:MT,second:CT,left:xT,right:kT},xte=Ut(Do),kte=kr(KP);const Ate=Object.freeze(Object.defineProperty({__proto__:null,ask:NP,asks:pte,local:Tp,asksReaderW:Ip,asksReader:hte,map:Ts,apW:FP,ap:DP,of:Ji,chainW:ET,chain:LP,flattenW:jP,flatten:mte,compose:UP,promap:BP,id:RT,first:MT,second:CT,left:xT,right:kT,URI:Pr,Functor:Qt,flap:vte,Pointed:AT,Apply:Do,apFirst:zP,apFirstW:gte,apSecond:qP,apSecondW:yte,Applicative:KP,Chain:WT,Monad:Lo,chainFirst:VP,chainFirstW:bte,Profunctor:_te,Category:$te,Strong:Ste,Choice:Tte,bindTo:Ite,bind:HP,bindW:Ote,Do:wte,apS:JP,apSW:Ete,ApT:GP,traverseReadonlyNonEmptyArrayWithIndex:Is,traverseReadonlyArrayWithIndex:NT,traverseArrayWithIndex:Rte,traverseArray:YP,sequenceArray:Mte,reader:Cte,getSemigroup:xte,getMonoid:kte},Symbol.toStringTag,{value:"Module"}));function wp(e){return function(){return e.fromReader(NP())}}function Ep(e){return e.fromReader}function Os(e){return function(t){return X(t,e.fromReader)}}function Rp(e,t){var n=Os(e);return function(r){return function(i){return t.chain(i,n(r))}}}function Mp(e,t){return X(Os(e),ut(t))}const Wte=Object.freeze(Object.defineProperty({__proto__:null,ask:wp,asks:Ep,fromReaderK:Os,chainReaderK:Rp,chainFirstReaderK:Mp},Symbol.toStringTag,{value:"Module"}));var ZP=function(){return function(e){return[e,e]}},XP=function(e){return function(){return[void 0,e]}},QP=function(e){return function(t){return[void 0,e(t)]}},eF=function(e){return function(t){return[e(t),t]}},Cp=function(e,t){return m(e,nF(t))},fg=function(e,t){return m(e,rF(t))},tF=function(e,t){return m(e,PT(t))},nF=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return[e(i),o]}}},rF=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]}}},xp=function(e){return function(t){return[e,t]}},PT=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return e(i)(o)}}},Nte=PT(B),ru="State",FT={URI:ru,map:Cp},Pte=De(FT),Fte={URI:ru,of:xp},dg={URI:ru,map:Cp,ap:fg},Dte=St(dg),Lte=Tt(dg),jte={URI:ru,map:Cp,ap:fg,of:xp},DT={URI:ru,map:Cp,ap:fg,chain:tF},iF={URI:ru,map:Cp,ap:fg,of:xp,chain:tF},Ute=ut(DT),Bte={URI:ru,fromState:B},zte=function(e){return function(t){return t(e)[0]}},qte=function(e){return function(t){return t(e)[1]}},Kte=Ot(FT),Vte=wt(DT),Hte=It(dg),oF=function(e){return function(t){return function(n){for(var r=e(0,ur(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]}}},LT=function(e){var t=oF(e);return function(n){return dt(n)?t(n):xp(Yt)}},Jte=LT,aF=function(e){return LT(function(t,n){return e(n)})},Gte=aF(B),Yte=function(e,t){return e(t)[0]},Zte=function(e,t){return e(t)[1]},Xte=iF;const Qte=Object.freeze(Object.defineProperty({__proto__:null,get:ZP,put:XP,modify:QP,gets:eF,map:nF,ap:rF,of:xp,chain:PT,flatten:Nte,URI:ru,Functor:FT,flap:Pte,Pointed:Fte,Apply:dg,apFirst:Dte,apSecond:Lte,Applicative:jte,Chain:DT,Monad:iF,chainFirst:Ute,FromState:Bte,evaluate:zte,execute:qte,bindTo:Kte,bind:Vte,apS:Hte,traverseReadonlyNonEmptyArrayWithIndex:oF,traverseReadonlyArrayWithIndex:LT,traverseArrayWithIndex:Jte,traverseArray:aF,sequenceArray:Gte,evalState:Yte,execState:Zte,state:Xte},Symbol.toStringTag,{value:"Module"}));function uF(e){return function(){return e.fromState(ZP())}}function sF(e){return function(t){return e.fromState(XP(t))}}function cF(e){return X(QP,e.fromState)}function lF(e){return X(eF,e.fromState)}function jT(e){return function(t){return X(t,e.fromState)}}function fF(e,t){var n=jT(e);return function(r){return function(i){return t.chain(i,n(r))}}}const ene=Object.freeze(Object.defineProperty({__proto__:null,get:uF,put:sF,modify:cF,gets:lF,fromStateK:jT,chainStateK:fF},Symbol.toStringTag,{value:"Module"}));function ws(e){return function(t){return X(t,e.fromTask)}}function Bl(e,t){return function(n){var r=X(n,e.fromTask);return function(i){return t.chain(i,r)}}}function zl(e,t){var n=ut(t);return function(r){return n(X(r,e.fromTask))}}const tne=Object.freeze(Object.defineProperty({__proto__:null,fromTaskK:ws,chainTaskK:Bl,chainFirstTaskK:zl},Symbol.toStringTag,{value:"Module"}));function dF(e){return function(t){return X(t,e.fromThese)}}const nne=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:dF},Symbol.toStringTag,{value:"Module"}));function pF(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 rne(e,t){var n=Zc(e,t).map,r=pF(e,t);return{map:n,mapWithIndex:function(i,o){return m(i,r(o))}}}const ine=Object.freeze(Object.defineProperty({__proto__:null,mapWithIndex:pF,getFunctorWithIndexComposition:rne},Symbol.toStringTag,{value:"Module"})),one=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),ane=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),une=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Gi=function(e,t){return m(e,yF(t))},ql=function(e,t){return m(e,bF(t))},pg=function(e,t){return m(e,qT(t))},UT=function(e,t,n){return m(e,_F(t,n))},BT=function(e){return function(t,n){return m(t,$F()(n))}},zT=function(e,t,n){return m(e,SF(t,n))},hF=function(e,t){return m(e,OF())},mF=function(e,t){return m(e,KT(t))},vF=function(e){var t=TF(e);return function(n,r){return m(n,t(r))}},gF=$$,yF=function(e){return function(t){return e(t)}},bF=function(e){return function(t){return t(e)}},Kl=B,qT=function(e){return function(t){return e(t)}},KT=function(e){return function(t){return e(t)}},VT=B,sne=KT(B),cne=qT(B),_F=function(e,t){return function(n){return t(e,n)}},$F=function(){return function(e){return function(t){return e(t)}}},SF=function(e,t){return function(n){return t(n,e)}},TF=function(e){return function(t){return function(n){return e.map(t(n),B)}}},HT=function(e){return function(t){return e.map(t,B)}},IF=function(){return B},OF=IF,lr="Identity",lne=B,fne=B,JT={URI:lr,map:Gi},dne=De(JT),pne={URI:lr,of:Kl},hg={URI:lr,map:Gi,ap:ql},hne=St(hg),mne=Tt(hg),vne={URI:lr,map:Gi,ap:ql,of:Kl},GT={URI:lr,map:Gi,ap:ql,chain:pg},gne={URI:lr,map:Gi,ap:ql,of:Kl,chain:pg},yne=ut(GT),bne={URI:lr,reduce:UT,foldMap:BT,reduceRight:zT},_ne={URI:lr,map:Gi,reduce:UT,foldMap:BT,reduceRight:zT,traverse:vF,sequence:HT},$ne={URI:lr,map:Gi,alt:hF},Sne={URI:lr,map:Gi,extend:mF,extract:VT},Tne={URI:lr,map:Gi,ap:ql,chain:pg,chainRec:gF},Ine=Kl(jt),One=Ot(JT),wne=wt(GT),Ene=It(hg),Rne={URI:lr,map:Gi,ap:ql,of:Kl,chain:pg,reduce:UT,foldMap:BT,reduceRight:zT,traverse:vF,sequence:HT,alt:hF,extract:VT,extend:mF,chainRec:gF};const Mne=Object.freeze(Object.defineProperty({__proto__:null,map:yF,ap:bF,of:Kl,chain:qT,extend:KT,extract:VT,duplicate:sne,flatten:cne,reduce:_F,foldMap:$F,reduceRight:SF,traverse:TF,sequence:HT,altW:IF,alt:OF,URI:lr,getShow:lne,getEq:fne,Functor:JT,flap:dne,Pointed:pne,Apply:hg,apFirst:hne,apSecond:mne,Applicative:vne,Chain:GT,Monad:gne,chainFirst:yne,Foldable:bne,Traversable:_ne,Alt:$ne,Comonad:Sne,ChainRec:Tne,Do:Ine,bindTo:One,bind:wne,apS:Ene,identity:Rne},Symbol.toStringTag,{value:"Module"})),Cne=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var jo=function(e,t){return function(){return t(e())}},iu=function(e,t){return function(){return e()(t())}},Vl=function(e,t){return function(){return t(e())()}},wF=function(e,t){return function(){for(var n=t(e)();n._tag==="Left";)n=t(n.left)();return n.right}},Yi=function(e){return function(t){return jo(t,e)}},xne=function(e){return function(t){return iu(t,e)}},di=Dn,YT=function(e){return function(t){return Vl(t,e)}},kne=YT(B),pi="IO",it={URI:pi,map:jo},Ane=De(it),Zi={URI:pi,of:di},Uo={URI:pi,map:jo,ap:iu},Wne=St(Uo),Nne=Tt(Uo),EF={URI:pi,map:jo,ap:iu,of:di},mg={URI:pi,map:jo,ap:iu,chain:Vl},Bn={URI:pi,map:jo,ap:iu,of:di,chain:Vl},Pne=ut(mg),ZT=B,Fne={URI:pi,map:jo,ap:iu,of:di,chain:Vl,fromIO:ZT},Dne={URI:pi,map:jo,ap:iu,chain:Vl,chainRec:wF},Lne={URI:pi,fromIO:B},jne=di(jt),Une=Ot(it),Bne=wt(mg),zne=It(Uo),RF=di(Yt),vg=function(e){return function(t){return function(){for(var n=[e(0,ur(t))()],r=1;r<t.length;r++)n.push(e(r,t[r])());return n}}},XT=function(e){var t=vg(e);return function(n){return dt(n)?t(n):RF}},qne=XT,MF=function(e){return XT(function(t,n){return e(n)})},Kne=MF(B),Vne={URI:pi,map:jo,of:di,ap:iu,chain:Vl,fromIO:ZT,chainRec:wF},Hne=Ut(Uo),Jne=kr(EF);const Gne=Object.freeze(Object.defineProperty({__proto__:null,map:Yi,ap:xne,of:di,chain:YT,flatten:kne,URI:pi,Functor:it,flap:Ane,Pointed:Zi,Apply:Uo,apFirst:Wne,apSecond:Nne,Applicative:EF,Chain:mg,Monad:Bn,chainFirst:Pne,fromIO:ZT,MonadIO:Fne,ChainRec:Dne,FromIO:Lne,Do:jne,bindTo:Une,bind:Bne,apS:zne,ApT:RF,traverseReadonlyNonEmptyArrayWithIndex:vg,traverseReadonlyArrayWithIndex:XT,traverseArrayWithIndex:qne,traverseArray:MF,sequenceArray:Kne,io:Vne,getSemigroup:Hne,getMonoid:Jne},Symbol.toStringTag,{value:"Module"}));var CF=xl(Zi),xF=_s(Zi),kF=kl(it),Yne=Al(it),AF=di,kp=kF,WF=bp(it),Zne=WF,QT=Ll(Bn),Xne=QT,NF=QT,Qne=NF,PF=jl(Bn),ere=PF,FF=function(e,t){return function(){return ss(e,t)}},tre=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return FF(function(){return e.apply(void 0,n)},t)}},nre=Sp(it),DF=Ss(Bn),rre=DF,eI=_p(Bn),ire=eI,ore=function(e){return eI(GF(e))},are=$p(Bn),ure=Ul(it),zn=function(e,t){return m(e,rI(t))},Es=function(e,t){return m(e,iI(t))},sre=function(e,t){return m(e,gg(function(n){return m(t,rI(n))}))},Hl=function(e,t){return m(e,gg(t))},tI=function(e,t,n){return m(e,jF(t,n))},nI=function(e,t){return m(e,UF(t))},LF=function(e,t){return m(e,oI(t))},rI=Wl(it),jF=Fl(it),UF=Dl(it),iI=Nl(Uo),cre=iI,Fr=xF,gg=$s(Bn),yg=gg,BF=yg(B),lre=BF,oI=Pl(Bn),fre=oI,bg=CF,kt="IOEither";function zF(e){var t=To(Uo,qa(e));return{URI:kt,_E:void 0,map:zn,ap:function(n,r){return m(n,t(r))},of:Fr}}function qF(e){var t=yp(Bn,e);return{URI:kt,_E:void 0,map:zn,alt:function(n,r){return m(n,t(r))}}}var KF=function(e){var t=as(e);return{URI:kt,_E:void 0,compact:Vi(it,t),separate:ko(it,t,Ka)}};function dre(e){var t=Qc(e),n=KF(e),r=Ao(it,t),i=Wo(it,t),o=tu(it,t),a=nu(it,t);return{URI:kt,_E:void 0,map:zn,compact:n.compact,separate:n.separate,filter:function(u,s){return m(u,r(s))},filterMap:function(u,s){return m(u,i(s))},partition:function(u,s){return m(u,o(s))},partitionMap:function(u,s){return m(u,a(s))}}}var aI={URI:kt,map:zn},pre=De(aI),hre={URI:kt,of:Fr},mre={URI:kt,bimap:tI,mapLeft:nI},Ap={URI:kt,map:zn,ap:Es},VF=St(Ap),vre=VF,HF=Tt(Ap),gre=HF,uI={URI:kt,map:zn,ap:Es,of:Fr},yre={URI:kt,map:zn,ap:sre,of:Fr},Bo={URI:kt,map:zn,ap:Es,chain:Hl},bre={URI:kt,map:zn,ap:Es,of:Fr,chain:Hl},JF=ut(Bo),_re=JF,$re={URI:kt,map:zn,alt:LF},Sre={URI:kt,map:zn,ap:Es,of:Fr,chain:Hl,fromIO:kp},Tre={URI:kt,map:zn,ap:Es,of:Fr,chain:Hl,throwError:bg},_g={URI:kt,fromIO:kp},GF=Hi(_g),Ire=No(_g,Bo),Ore=Po(_g,Bo),zo={URI:kt,fromEither:AF},wre=Li(zo),Ere=ji(zo),Rre=ns(zo,Bo),YF=Io(zo,Bo),Mre=YF,ZF=Oo(zo,Bo),Cre=ZF,xre=za(zo),XF=rs(zo,Bo),kre=XF,Are=sr(zo),Wre=function(e,t,n){return QF(e,t,n)},QF=function(e,t,n){return m(e,yg(function(r){return m(t(r),YT(function(i){return m(n(r,i),yg(function(){return di(i)}))}))}))},Nre=Fr(jt),Pre=Ot(aI),eD=wt(Bo),Fre=eD,tD=It(Ap),Dre=tD,sI=Fr(Yt),nD=function(e){return X(vg(e),Yi(Dd(Ln)))},cI=function(e){var t=nD(e);return function(n){return dt(n)?t(n):sI}},rD=function(e){return function(t){return function(){var n=e(0,ur(t))();if(Lt(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i])();if(Lt(o))return o;r.push(o.right)}return Ba(r)}}},lI=function(e){var t=rD(e);return function(n){return dt(n)?t(n):sI}},Lre=cI,iD=function(e){return cI(function(t,n){return e(n)})},jre=iD(B),Ure=lI,oD=function(e){return lI(function(t,n){return e(n)})},Bre=oD(B),zre=uI,qre={URI:kt,bimap:tI,mapLeft:nI,map:zn,of:Fr,ap:Es,chain:Hl,alt:LF,fromIO:kp,throwError:bg},Kre=Ut(Ap),Vre=kr(uI),Hre=function(e){return Ut(Uo)(Wd(e))};function Jre(e){var t=zF(e),n=qF(e);return{URI:kt,_E:void 0,map:zn,ap:t.ap,of:Fr,chain:Hl,bimap:tI,mapLeft:nI,alt:n.alt,fromIO:kp,throwError:bg}}const Gre=Object.freeze(Object.defineProperty({__proto__:null,left:CF,right:xF,rightIO:kF,leftIO:Yne,fromEither:AF,fromIO:kp,match:WF,matchW:Zne,matchE:QT,fold:Xne,matchEW:NF,foldW:Qne,getOrElse:PF,getOrElseW:ere,tryCatch:FF,tryCatchK:tre,toUnion:nre,orElse:DF,orElseW:rre,orElseFirst:eI,orElseFirstW:ire,orElseFirstIOK:ore,orLeft:are,swap:ure,map:rI,bimap:jF,mapLeft:UF,ap:iI,apW:cre,of:Fr,chain:gg,chainW:yg,flattenW:BF,flatten:lre,alt:oI,altW:fre,throwError:bg,URI:kt,getApplicativeIOValidation:zF,getAltIOValidation:qF,getCompactable:KF,getFilterable:dre,Functor:aI,flap:pre,Pointed:hre,Bifunctor:mre,ApplyPar:Ap,apFirst:VF,apFirstW:vre,apSecond:HF,apSecondW:gre,ApplicativePar:uI,ApplicativeSeq:yre,Chain:Bo,Monad:bre,chainFirst:JF,chainFirstW:_re,Alt:$re,MonadIO:Sre,MonadThrow:Tre,FromIO:_g,fromIOK:GF,chainIOK:Ire,chainFirstIOK:Ore,FromEither:zo,fromOption:wre,fromOptionK:Ere,chainOptionK:Rre,chainEitherK:YF,chainEitherKW:Mre,chainFirstEitherK:ZF,chainFirstEitherKW:Cre,fromPredicate:xre,filterOrElse:XF,filterOrElseW:kre,fromEitherK:Are,bracket:Wre,bracketW:QF,Do:Nre,bindTo:Pre,bind:eD,bindW:Fre,apS:tD,apSW:Dre,ApT:sI,traverseReadonlyNonEmptyArrayWithIndex:nD,traverseReadonlyArrayWithIndex:cI,traverseReadonlyNonEmptyArrayWithIndexSeq:rD,traverseReadonlyArrayWithIndexSeq:lI,traverseArrayWithIndex:Lre,traverseArray:iD,sequenceArray:jre,traverseSeqArrayWithIndex:Ure,traverseSeqArray:oD,sequenceSeqArray:Bre,Applicative:zre,ioEither:qre,getApplySemigroup:Kre,getApplyMonoid:Vre,getSemigroup:Hre,getIOValidation:Jre},Symbol.toStringTag,{value:"Module"}));function Wp(e){return X(vt,e.of)}function Np(e){return Dn(e.of(tt))}function $g(e){return function(t){return e.map(t,vt)}}function Sg(e){return X(ys,e.of)}function Tg(e){var t=Sg(e);return function(n){return X(n,t)}}function fI(e){var t=Jl(e),n=Tg(e);return function(r){return t(n(r))}}function Ig(e){return function(t){return X(t,e.of)}}function dI(e){var t=Jl(e),n=Ig(e);return function(r){return t(n(r))}}function pI(e){return function(t){return function(n){return e.of(Zv(t)(n))}}}function hI(e){return X(Ml,e.of)}function mI(e){return function(t,n){return function(r){return e.map(r,Co(t,n))}}}function Og(e){return function(t,n){return function(r){return e.chain(r,Co(t,n))}}}function wg(e){return function(t){return function(n){return e.chain(n,Co(t,e.of))}}}function Eg(e){return Yc(e,Ol)}function Rg(e){return To(e,wl)}function Jl(e){var t=Np(e);return function(n){return function(r){return e.chain(r,Co(function(){return t()},n))}}}function Mg(e){var t=Wp(e);return function(n){return function(r){return e.chain(r,Co(n,t))}}}function Yre(e){var t=Rg(e),n=Eg(e),r=Jl(e),i=Mg(e),o=Og(e),a=wg(e),u=Np(e);return{map:function(s,c){return m(s,n(c))},ap:function(s,c){return m(s,t(c))},of:Wp(e),chain:function(s,c){return m(s,r(c))},alt:function(s,c){return m(s,i(c))},fold:function(s,c,l){return m(s,o(c,l))},getOrElse:function(s,c){return m(s,a(c))},fromM:$g(e),none:function(){return u()}}}const Zre=Object.freeze(Object.defineProperty({__proto__:null,some:Wp,zero:Np,fromF:$g,fromNullable:Sg,fromNullableK:Tg,chainNullableK:fI,fromOptionK:Ig,chainOptionK:dI,fromPredicate:pI,fromEither:hI,match:mI,matchE:Og,getOrElse:wg,map:Eg,ap:Rg,chain:Jl,alt:Mg,getOptionM:Yre},Symbol.toStringTag,{value:"Module"}));var aD=Wp(Zi),Xre=pI(Zi),Qre=di,uD=hI(Zi),vI=$g(it),eie=Yi(Ml),sD=mI(it),tie=sD,gI=Og(mg),nie=gI,rie=gI,cD=wg(Bn),iie=cD,oie=Yi(sP),aie=Yi($T),uie=Sg(Zi),sie=Tg(Zi),cie=fI(Bn),lie=Ig(Zi),fie=dI(Bn),lD=Eg(it),fD=Rg(Uo),ou=aD,yI=Jl(Bn),die=yI(B),bI=Mg(Bn),pie=bI,Cg=Np(Zi),hie=Cg(),_I=Vi(it,gs),$I=ko(it,gs,Ol),dD=Ao(it,Mo),pD=Wo(it,Mo),hD=tu(it,Mo),mD=nu(it,Mo),qo=function(e,t){return m(e,lD(t))},Gl=function(e,t){return m(e,fD(t))},SI=function(e,t){return m(e,yI(t))},vD=function(e,t){return m(e,bI(t))},mie=function(e,t){return m(e,dD(t))},vie=function(e,t){return m(e,pD(t))},gie=function(e,t){return m(e,hD(t))},yie=function(e,t){return m(e,mD(t))},qn="IOOption",TI={URI:qn,map:qo},bie=De(TI),gD={URI:qn,of:ou},xg={URI:qn,map:qo,ap:Gl},_ie=St(xg),$ie=Tt(xg),Sie={URI:qn,map:qo,ap:Gl,of:ou},Rs={URI:qn,map:qo,ap:Gl,chain:SI},Tie=ut(Rs),Iie={URI:qn,map:qo,alt:vD},yD={URI:qn,zero:Cg},Oie=pl(yD,gD),wie={URI:qn,map:qo,ap:Gl,of:ou,alt:vD,zero:Cg},Eie={URI:qn,map:qo,ap:Gl,of:ou,chain:SI},Rie={URI:qn,map:qo,ap:Gl,of:ou,chain:SI,fromIO:vI},Mie={URI:qn,compact:_I,separate:$I},Cie={URI:qn,map:qo,compact:_I,separate:$I,filter:mie,filterMap:vie,partition:gie,partitionMap:yie},kg={URI:qn,fromIO:vI},xie=Hi(kg),kie=No(kg,Rs),Aie=Po(kg,Rs),Ag={URI:qn,fromEither:uD},Wie=sr(Ag),Nie=Io(Ag,Rs),Pie=Oo(Ag,Rs),Fie=ou(jt),Die=Ot(TI),Lie=wt(Rs),jie=It(xg),bD=ou(Yt),_D=function(e){return X(vg(e),Yi(ug(Ln)))},Uie=function(e){var t=_D(e);return function(n){return dt(n)?t(n):bD}};const Bie=Object.freeze(Object.defineProperty({__proto__:null,some:aD,fromPredicate:Xre,fromOption:Qre,fromEither:uD,fromIO:vI,fromIOEither:eie,match:sD,matchW:tie,matchE:gI,fold:nie,matchEW:rie,getOrElse:cD,getOrElseW:iie,toUndefined:oie,toNullable:aie,fromNullable:uie,fromNullableK:sie,chainNullableK:cie,fromOptionK:lie,chainOptionK:fie,map:lD,ap:fD,of:ou,chain:yI,flatten:die,alt:bI,altW:pie,zero:Cg,none:hie,compact:_I,separate:$I,filter:dD,filterMap:pD,partition:hD,partitionMap:mD,Functor:TI,flap:bie,Pointed:gD,Apply:xg,apFirst:_ie,apSecond:$ie,Applicative:Sie,Chain:Rs,chainFirst:Tie,Alt:Iie,Zero:yD,guard:Oie,Alternative:wie,Monad:Eie,MonadIO:Rie,Compactable:Mie,Filterable:Cie,FromIO:kg,fromIOK:xie,chainIOK:kie,chainFirstIOK:Aie,FromEither:Ag,fromEitherK:Wie,chainEitherK:Nie,chainFirstEitherK:Pie,Do:Fie,bindTo:Die,bind:Lie,apS:jie,ApT:bD,traverseReadonlyNonEmptyArrayWithIndex:_D,traverseReadonlyArrayWithIndex:Uie},Symbol.toStringTag,{value:"Module"}));var $D=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 zie(e){return function(){return new $D(e)}}const qie=Object.freeze(Object.defineProperty({__proto__:null,IORef:$D,newIORef:zie},Symbol.toStringTag,{value:"Module"})),Kie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Vie=function(e){return ss(function(){return JSON.parse(e)},B)},Hie=function(e){return ss(function(){var t=JSON.stringify(e);if(typeof t!="string")throw new Error("Converting unsupported structure to JSON");return t},B)};const Jie=Object.freeze(Object.defineProperty({__proto__:null,parse:Vie,stringify:Hie},Symbol.toStringTag,{value:"Module"})),Gie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Yie=function(e){return new Map(e)};function Zie(e){return new Map(e)}function SD(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 TD=function(e){return e.size},Xi=function(e){return e.size===0};function Wg(e){var t=Ms(e);return function(n,r){if(r===void 0){var i=Wg(e);return function(o){return i(n,o)}}return mt(t(n,r))}}function II(e){return function(t,n){if(n===void 0){var r=II(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 Yl=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},Xie=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function ID(e){var t=Yl(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 OD=function(e){return ID(e)(function(t,n){return[t,n]})};function Qie(e,t){var n=OD(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?le([i[a],a+1]):me})}}var wD=function(e){var t=Ko(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(Ct(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}}},ED=function(e){var t=Ko(e);return function(n){return function(r){var i=t(n,r);if(mt(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},eoe=function(e){var t=RD(e);return function(n,r){return t(n,function(){return r})}},RD=function(e){var t=Ko(e);return function(n,r){return function(i){var o=t(n,i);if(Ct(o))return me;var a=o.value,u=a[0],s=a[1],c=r(s);if(c===s)return le(i);var l=new Map(i);return l.set(u,c),le(l)}}};function toe(e){var t=Ms(e),n=ED(e);return function(r){var i=n(r);return function(o){return m(t(r,o),Ki(function(a){return[a,i(o)]}))}}}function Ko(e){return function(t,n){if(n===void 0){var r=Ko(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 le([u,s])}return me}}function Ms(e){var t=Ko(e);return function(n,r){if(r===void 0){var i=Ms(e);return function(o){return i(n,o)}}return m(t(n,r),Ki(function(o){o[0];var a=o[1];return a}))}}function Ng(e,t){var n=Ko(e);return function(r,i){if(i===void 0){var o=Ng(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(Ct(f)||!e.equals(c,f.value[0])||!t.equals(l,f.value[1]))return!1}return!0}}var Pg=new Map;function MD(e,t){var n=Ng(e,t);return Wr(function(r,i){return n(r,i)&&n(i,r)})}function noe(e,t){var n=Ko(e);return{concat:function(r,i){if(Xi(r))return i;if(Xi(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);mt(f)?o.set(f.value[0],t.concat(f.value[1],l)):o.set(c,l)}return o},empty:Pg}}var roe=function(e,t){return new Map([[e,t]])};function ioe(e,t,n){return function(r){var i=Ko(e);return n.reduce(r,new Map,function(o,a){var u=a[0],s=a[1],c=i(u,o);return mt(c)?o.set(c.value[0],t.concat(c.value[1],s)):o.set(u,s),o})}}var Zl=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},CD=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);Lt(c)?n.set(u,c.left):r.set(u,c.right)}return Oe(n,r)}};function xD(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 Oe(n,r)}}var kD=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);mt(s)&&n.set(a,s.value)}return n}};function AD(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 Vo=function(e,t){return Zl(e,function(n,r){return t(r)})},Pp=function(e,t){return WD(e,function(n,r){return t(r)})},Fp=function(e,t){return ND(e,function(n,r){return t(r)})},Dp=function(e,t){return PD(e,function(n,r){return t(r)})},Lp=function(e,t){return FD(e,function(n,r){return t(r)})},WD=function(e,t){return m(e,AD(t))},ND=function(e,t){return m(e,kD(t))},PD=function(e,t){return m(e,xD(t))},FD=function(e,t){return m(e,CD(t))},Xl=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];mt(a)&&t.set(o,a.value)}return t},ooe=function(e){return function(t){return Pp(t,e)}},aoe=function(e){return function(t){return Fp(t,e)}},uoe=function(e){return function(t){return Vo(t,e)}},soe=function(e){return function(t){return Zl(t,e)}},coe=function(e){return function(t){return Dp(t,e)}},loe=function(e){return function(t){return Lp(t,e)}},Ql=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];Lt(u)?t.set(a,u.left):n.set(a,u.right)}return Oe(t,n)},Dr="ReadonlyMap",DD=function(e,t){var n=xI(e,t);return{concat:function(r,i){return n(i)(r)}}},foe=function(e,t){return{concat:DD(e,t).concat,empty:Pg}},doe=function(e,t){var n=kI(e,t);return{concat:function(r,i){return n(i)(r)}}},poe=function(e){return function(){var t=AI(e);return{concat:function(n,r){return t(r)(n)}}}};function hoe(){return{URI:Dr,_E:void 0,map:Vo,mapWithIndex:Zl,compact:Xl,separate:Ql,filter:Pp,filterMap:Fp,partition:Dp,partitionMap:Lp,partitionMapWithIndex:FD,partitionWithIndex:PD,filterMapWithIndex:ND,filterWithIndex:WD}}var LD={URI:Dr,map:Vo},moe=De(LD),voe=function(){return{URI:Dr,_E:void 0,map:Vo,mapWithIndex:Zl}},OI={URI:Dr,compact:Xl,separate:Ql},goe={URI:Dr,map:Vo,compact:Xl,separate:Ql,filter:Pp,filterMap:Fp,partition:Dp,partitionMap:Lp},wI=function(e){var t=Dg(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},EI=function(e){var t=Lg(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}},RI=function(e){var t=jg(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},Fg=function(e){var t=wI(e),n=EI(e),r=RI(e);return{URI:Dr,_E:void 0,reduce:function(i,o,a){return m(i,t(o,a))},foldMap:function(i){var o=n(i);return function(a,u){return m(a,o(u))}},reduceRight:function(i,o,a){return m(i,r(o,a))}}},Dg=function(e){var t=Yl(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}}},Lg=function(e){var t=Yl(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}}}},jg=function(e){var t=Yl(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}}},MI=function(e){var t=Fg(e),n=Dg(e),r=Lg(e),i=jg(e);return{URI:Dr,_E:void 0,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:function(o,a,u){return m(o,n(a,u))},foldMapWithIndex:function(o){var a=r(o);return function(u,s){return m(u,a(s))}},reduceRightWithIndex:function(o,a,u){return m(o,i(a,u))}}},yoe=function(e){var t=CI(e),n=Fg(e);return{URI:Dr,_E:void 0,map:Vo,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:t.traverse,sequence:t.sequence}},CI=function(e){var t=MI(e),n=Yl(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],y=u.get(v);c=a.ap(a.map(c,function(b){return function(w){return b.set(v,w)}}),s(v,y))},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,Ln)}};return{URI:Dr,_E:void 0,map:Vo,mapWithIndex:Zl,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 boe(e){var t=CI(e);return{URI:Dr,_E:void 0,map:Vo,compact:Xl,separate:Ql,filter:Pp,filterMap:Fp,partition:Dp,partitionMap:Lp,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:Zl,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:ri(t,OI),wither:ii(t,OI)}}var xI=function(e,t){var n=Ms(e);return function(r){return function(i){if(Xi(i))return r;if(Xi(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);mt(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);Ct(f)&&o.set(c,l)}return o}}},kI=function(e,t){var n=Ms(e);return function(r){return function(i){if(Xi(i)||Xi(r))return Pg;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);mt(f)&&o.set(c,t.concat(l,f.value))}return o}}},AI=function(e){var t=Wg(e);return function(n){return function(r){if(Xi(r))return n;if(Xi(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}}},_oe=wD,$oe={URI:Dr,map:Vo,compact:Xl,separate:Ql,filter:Pp,filterMap:Fp,partition:Dp,partitionMap:Lp};const Soe=Object.freeze(Object.defineProperty({__proto__:null,fromMap:Yie,toMap:Zie,getShow:SD,size:TD,isEmpty:Xi,member:Wg,elem:II,keys:Yl,values:Xie,collect:ID,toReadonlyArray:OD,toUnfoldable:Qie,upsertAt:wD,deleteAt:ED,updateAt:eoe,modifyAt:RD,pop:toe,lookupWithKey:Ko,lookup:Ms,isSubmap:Ng,empty:Pg,getEq:MD,getMonoid:noe,singleton:roe,fromFoldable:ioe,partitionMapWithIndex:CD,partitionWithIndex:xD,filterMapWithIndex:kD,filterWithIndex:AD,compact:Xl,filter:ooe,filterMap:aoe,map:uoe,mapWithIndex:soe,partition:coe,partitionMap:loe,separate:Ql,URI:Dr,getUnionSemigroup:DD,getUnionMonoid:foe,getIntersectionSemigroup:doe,getDifferenceMagma:poe,getFilterableWithIndex:hoe,Functor:LD,flap:moe,getFunctorWithIndex:voe,Compactable:OI,Filterable:goe,reduce:wI,foldMap:EI,reduceRight:RI,getFoldable:Fg,reduceWithIndex:Dg,foldMapWithIndex:Lg,reduceRightWithIndex:jg,getFoldableWithIndex:MI,getTraversable:yoe,getTraversableWithIndex:CI,getWitherable:boe,union:xI,intersection:kI,difference:AI,insertAt:_oe,readonlyMap:$oe},Symbol.toStringTag,{value:"Module"}));var ef=globalThis&&globalThis.__assign||function(){return ef=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},ef.apply(this,arguments)},Toe=SD,Ioe=TD,Ho=Xi,Ooe=Wg,woe=II,WI=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},Eoe=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function jD(e){var t=WI(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 UD(e){return jD(e)(function(t,n){return[t,n]})}function Roe(e,t){var n=UD(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?le([i[a],a+1]):me})}}var BD=function(e){var t=Cs(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(Ct(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}}},zD=function(e){var t=Cs(e);return function(n){return function(r){var i=t(n,r);if(mt(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},Moe=function(e){var t=qD(e);return function(n,r){return t(n,function(){return r})}},qD=function(e){var t=Cs(e);return function(n,r){return function(i){var o=t(n,i);if(Ct(o))return me;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),le(a)}}};function Coe(e){var t=KD(e),n=zD(e);return function(r){var i=n(r);return function(o){return m(t(r,o),Ki(function(a){return[a,i(o)]}))}}}function Cs(e){return function(t,n){if(n===void 0){var r=Cs(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 le([u,s])}return me}}var KD=Ms,xoe=Ng,koe=MD;function Aoe(e,t){var n=Cs(e);return{concat:function(r,i){if(Ho(r))return i;if(Ho(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);mt(f)?o.set(f.value[0],t.concat(f.value[1],l)):o.set(c,l)}return o},empty:new Map}}var Woe=function(e,t){return new Map([[e,t]])};function Noe(e,t,n){return function(r){var i=Cs(e);return n.reduce(r,new Map,function(o,a){var u=a[0],s=a[1],c=i(u,o);return mt(c)?o.set(c.value[0],t.concat(c.value[1],s)):o.set(u,s),o})}}var jp=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},VD=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);Lt(c)?n.set(u,c.left):r.set(u,c.right)}return Oe(n,r)}};function HD(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 Oe(n,r)}}var JD=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);mt(s)&&n.set(a,s.value)}return n}};function GD(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 tf=function(e,t){return jp(e,function(n,r){return t(r)})},Ug=function(e,t){return YD(e,function(n,r){return t(r)})},Bg=function(e,t){return ZD(e,function(n,r){return t(r)})},zg=function(e,t){return XD(e,function(n,r){return t(r)})},qg=function(e,t){return QD(e,function(n,r){return t(r)})},YD=function(e,t){return m(e,GD(t))},ZD=function(e,t){return m(e,JD(t))},XD=function(e,t){return m(e,HD(t))},QD=function(e,t){return m(e,VD(t))},Up=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];mt(a)&&t.set(o,a.value)}return t},Poe=function(e){return function(t){return Ug(t,e)}},Foe=function(e){return function(t){return Bg(t,e)}},Doe=function(e){return function(t){return tf(t,e)}},Loe=function(e){return function(t){return jp(t,e)}},joe=function(e){return function(t){return zg(t,e)}},Uoe=function(e){return function(t){return qg(t,e)}},Bp=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];Lt(u)?t.set(a,u.left):n.set(a,u.right)}return Oe(t,n)},Jo="Map",eL=function(e,t){var n=oL(e,t);return{concat:function(r,i){return n(i)(r)}}},Boe=function(e,t){return{concat:eL(e,t).concat,empty:new Map}},zoe=function(e,t){var n=aL(e,t);return{concat:function(r,i){return n(i)(r)}}},qoe=function(e){return function(){var t=uL(e);return{concat:function(n,r){return t(r)(n)}}}};function Koe(){return{URI:Jo,_E:void 0,map:tf,mapWithIndex:jp,compact:Up,separate:Bp,filter:Ug,filterMap:Bg,partition:zg,partitionMap:qg,partitionMapWithIndex:QD,partitionWithIndex:XD,filterMapWithIndex:ZD,filterWithIndex:YD}}function Voe(e){var t=nL(e);return{URI:Jo,_E:void 0,map:tf,compact:Up,separate:Bp,filter:Ug,filterMap:Bg,partition:zg,partitionMap:qg,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:jp,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:ri(t,NI),wither:ii(t,NI)}}var Hoe=wI,Joe=EI,Goe=RI,Yoe=function(e){return ef(ef({},Fg(e)),{URI:Jo})},Zoe=Dg,Xoe=Lg,Qoe=jg,tL=function(e){return ef(ef({},MI(e)),{URI:Jo})},nL=function(e){var t=tL(e),n=WI(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],y=u.get(v);c=a.ap(a.map(c,function(b){return function(w){return b.set(v,w)}}),s(v,y))},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:Jo,_E:void 0,map:tf,mapWithIndex:jp,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:i,sequence:o,traverseWithIndex:r}},rL={URI:Jo,map:tf},eae=De(rL),NI={URI:Jo,compact:Up,separate:Bp},iL={URI:Jo,map:tf,compact:Up,separate:Bp,filter:Ug,filterMap:Bg,partition:zg,partitionMap:qg},Kg=function(e){return new Map(e)},oL=function(e,t){var n=xI(e,t);return function(r){return function(i){return Ho(i)?Kg(r):Ho(r)?Kg(i):n(r)(i)}}},aL=function(e,t){var n=kI(e,t);return function(r){return function(i){return Ho(i)||Ho(r)?new Map:n(r)(i)}}},uL=function(e){var t=AI(e);return function(n){return function(r){return Ho(r)?Kg(n):Ho(n)?Kg(r):t(n)(r)}}},tae=new Map,nae=BD,rae=iL;const iae=Object.freeze(Object.defineProperty({__proto__:null,getShow:Toe,size:Ioe,isEmpty:Ho,member:Ooe,elem:woe,keys:WI,values:Eoe,collect:jD,toArray:UD,toUnfoldable:Roe,upsertAt:BD,deleteAt:zD,updateAt:Moe,modifyAt:qD,pop:Coe,lookupWithKey:Cs,lookup:KD,isSubmap:xoe,getEq:koe,getMonoid:Aoe,singleton:Woe,fromFoldable:Noe,partitionMapWithIndex:VD,partitionWithIndex:HD,filterMapWithIndex:JD,filterWithIndex:GD,compact:Up,filter:Poe,filterMap:Foe,map:Doe,mapWithIndex:Loe,partition:joe,partitionMap:Uoe,separate:Bp,URI:Jo,getUnionSemigroup:eL,getUnionMonoid:Boe,getIntersectionSemigroup:zoe,getDifferenceMagma:qoe,getFilterableWithIndex:Koe,getWitherable:Voe,reduce:Hoe,foldMap:Joe,reduceRight:Goe,getFoldable:Yoe,reduceWithIndex:Zoe,foldMapWithIndex:Xoe,reduceRightWithIndex:Qoe,getFoldableWithIndex:tL,getTraversableWithIndex:nL,Functor:rL,flap:eae,Compactable:NI,Filterable:iL,union:oL,intersection:aL,difference:uL,empty:tae,insertAt:nae,map_:rae},Symbol.toStringTag,{value:"Module"})),oae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),aae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),uae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),sae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),cae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var sL=function(e){return{concat:ev(e).concat,empty:e.top}},cL=function(e){return{concat:tv(e).concat,empty:e.bottom}},PI=function(e){return{concat:oS(e).concat,empty:e.empty}},lL=function(e){var t={};for(var n in e)at.call(e,n)&&(t[n]=e[n].empty);return{concat:aS(e).concat,empty:t}},fL=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:uS.apply(Pk,e).concat,empty:e.map(function(n){return n.empty})}},dL=function(e){return cS(e)(e.empty)},lae={concat:Ck.concat,empty:void 0},fae=fL,dae=lL,pae=PI,hae=cL,mae=sL,vae=dL,pL={concat:xk.concat,empty:!0},hL={concat:kk.concat,empty:!1},gae=jC,yae=function(){return PI(wP())},bae={concat:Ak.concat,empty:""},_ae={concat:Wk.concat,empty:0},$ae={concat:Nk.concat,empty:1};const Sae=Object.freeze(Object.defineProperty({__proto__:null,min:sL,max:cL,reverse:PI,struct:lL,tuple:fL,concatAll:dL,monoidVoid:lae,getTupleMonoid:fae,getStructMonoid:dae,getDualMonoid:pae,getJoinMonoid:hae,getMeetMonoid:mae,fold:vae,monoidAll:pL,monoidAny:hL,getFunctionMonoid:gae,getEndomorphismMonoid:yae,monoidString:bae,monoidSum:_ae,monoidProduct:$ae},Symbol.toStringTag,{value:"Module"})),Tae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var mL=function(e,t,n){return function(r){return r===-1?e():r===0?t():n()}},Iae=mL,vL=function(e){return e===-1?1:e===1?-1:0},gL={equals:function(e,t){return e===t}},FI={concat:function(e,t){return e!==0?e:t}},yL={concat:FI.concat,empty:0},Oae=function(e){return e<=-1?-1:e>=1?1:0},wae=vL,Eae=FI,Rae=gL,Mae=yL;const Cae=Object.freeze(Object.defineProperty({__proto__:null,matchW:mL,match:Iae,reverse:vL,Eq:gL,Semigroup:FI,Monoid:yL,sign:Oae,invert:wae,semigroupOrdering:Eae,eqOrdering:Rae,monoidOrdering:Mae},Symbol.toStringTag,{value:"Module"}));var xae=function(e){return typeof e.map=="function"},kae=function(e){return typeof e.contramap=="function"},Aae=function(e){return typeof e.mapWithIndex=="function"},Wae=function(e){return typeof e.ap=="function"},Nae=function(e){return typeof e.chain=="function"},Pae=function(e){return typeof e.bimap=="function"},Fae=function(e){return typeof e.extend=="function"},Dae=function(e){return typeof e.reduce=="function"},Lae=function(e){return typeof e.reduceWithIndex=="function"},jae=function(e){return typeof e.alt=="function"},Uae=function(e){return typeof e.compact=="function"},Bae=function(e){return typeof e.filter=="function"},zae=function(e){return typeof e.filterWithIndex=="function"},qae=function(e){return typeof e.promap=="function"},Kae=function(e){return typeof e.compose=="function"},Vae=function(e){return typeof e.throwError=="function"};function Hae(e){var t={};if(xae(e)){var n=function(S){return function($){return e.map($,S)}};t.map=n}if(kae(e)){var r=function(S){return function($){return e.contramap($,S)}};t.contramap=r}if(Aae(e)){var i=function(S){return function($){return e.mapWithIndex($,S)}};t.mapWithIndex=i}if(Wae(e)){var o=function(S){return function($){return e.ap($,S)}},a=function(S){return function($){return e.ap(e.map($,function(U){return function(){return U}}),S)}};t.ap=o,t.apFirst=a,t.apSecond=function(S){return function($){return e.ap(e.map($,function(){return function(U){return U}}),S)}}}if(Nae(e)){var u=function(S){return function($){return e.chain($,S)}},s=function(S){return function($){return e.chain($,function(U){return e.map(S(U),function(){return U})})}},c=function(S){return e.chain(S,B)};t.chain=u,t.chainFirst=s,t.flatten=c}if(Pae(e)){var l=function(S,$){return function(U){return e.bimap(U,S,$)}},f=function(S){return function($){return e.mapLeft($,S)}};t.bimap=l,t.mapLeft=f}if(Fae(e)){var d=function(S){return function($){return e.extend($,S)}},p=function(S){return e.extend(S,B)};t.extend=d,t.duplicate=p}if(Dae(e)){var h=function(S,$){return function(U){return e.reduce(U,S,$)}},v=function(S){var $=e.foldMap(S);return function(U){return function(Z){return $(Z,U)}}},y=function(S,$){return function(U){return e.reduceRight(U,S,$)}};t.reduce=h,t.foldMap=v,t.reduceRight=y}if(Lae(e)){var b=function(S,$){return function(U){return e.reduceWithIndex(U,S,$)}},w=function(S){var $=e.foldMapWithIndex(S);return function(U){return function(Z){return $(Z,U)}}},F=function(S,$){return function(U){return e.reduceRightWithIndex(U,S,$)}};t.reduceWithIndex=b,t.foldMapWithIndex=w,t.reduceRightWithIndex=F}if(jae(e)){var g=function(S){return function($){return e.alt($,S)}};t.alt=g}if(Uae(e)&&(t.compact=e.compact,t.separate=e.separate),Bae(e)){var T=function(S){return function($){return e.filter($,S)}},I=function(S){return function($){return e.filterMap($,S)}},W=function(S){return function($){return e.partition($,S)}},E=function(S){return function($){return e.partitionMap($,S)}};t.filter=T,t.filterMap=I,t.partition=W,t.partitionMap=E}if(zae(e)){var J=function(S){return function($){return e.filterWithIndex($,S)}},q=function(S){return function($){return e.filterMapWithIndex($,S)}},x=function(S){return function($){return e.partitionWithIndex($,S)}},G=function(S){return function($){return e.partitionMapWithIndex($,S)}};t.filterWithIndex=J,t.filterMapWithIndex=q,t.partitionWithIndex=x,t.partitionMapWithIndex=G}if(qae(e)){var O=function(S,$){return function(U){return e.promap(U,S,$)}};t.promap=O}if(Kae(e)){var R=function(S){return function($){return e.compose($,S)}};t.compose=R}if(Vae(e)){var k=function(S){return function($){return $._tag==="None"?e.throwError(S()):e.of($.value)}},L=function(S){return S._tag==="Left"?e.throwError(S.left):e.of(S.right)},z=function(S,$){return function(U){return S(U)?e.of(U):e.throwError($(U))}},j=function(S,$){return function(U){return e.chain(U,function(Z){return S(Z)?e.of(Z):e.throwError($(Z))})}};t.fromOption=k,t.fromEither=L,t.fromPredicate=z,t.filterOrElse=j}return t}var ce=m;const Jae=Object.freeze(Object.defineProperty({__proto__:null,pipeable:Hae,pipe:ce},Symbol.toStringTag,{value:"Module"})),Gae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Yae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Vg=function(){return Math.random()};function bL(e,t){return m(Vg,Yi(function(n){return Math.floor((t-e+1)*n+e)}))}function Zae(e,t){return m(Vg,Yi(function(n){return(t-e)*n+e}))}var Xae=m(Vg,Yi(function(e){return e<.5})),Qae=function(e){return m(bL(0,e.length-1),Yi(function(t){return e[t]}))};const eue=Object.freeze(Object.defineProperty({__proto__:null,random:Vg,randomInt:bL,randomRange:Zae,randomBool:Xae,randomElem:Qae},Symbol.toStringTag,{value:"Module"}));var DI=xl(AT),_L=_s(AT),$L=kl(Qt),tue=Al(Qt),SL=Ji,TL=$L,IL=bp(Qt),nue=IL,LI=Ll(Lo),rue=LI,OL=LI,iue=OL,wL=jl(Lo),oue=wL,aue=Sp(Qt),uue=Tp,EL=Ip,sue=EL,RL=Ss(Lo),cue=RL,ML=_p(Lo),lue=ML,fue=$p(Lo),due=Ul(Qt),Lr=function(e,t){return m(e,xL(t))},jI=function(e,t,n){return m(e,kL(t,n))},UI=function(e,t){return m(e,AL(t))},nf=function(e,t){return m(e,BI(t))},zp=function(e,t){return m(e,zI(t))},CL=function(e,t){return m(e,qI(t))},xL=Wl(Qt),kL=Fl(Qt),AL=Dl(Qt),BI=Nl(Do),pue=BI,Qi=_L,zI=$s(Lo),WL=zI,NL=WL(B),hue=NL,qI=Pl(Lo),mue=qI,KI=DI,Bt="ReaderEither",PL=function(e){var t=as(e);return{URI:Bt,_E:void 0,compact:Vi(Qt,t),separate:ko(Qt,t,Ka)}};function vue(e){var t=Qc(e),n=PL(e),r=Ao(Qt,t),i=Wo(Qt,t),o=tu(Qt,t),a=nu(Qt,t);return{URI:Bt,_E:void 0,map:Lr,compact:n.compact,separate:n.separate,filter:function(u,s){return m(u,r(s))},filterMap:function(u,s){return m(u,i(s))},partition:function(u,s){return m(u,o(s))},partitionMap:function(u,s){return m(u,a(s))}}}function FL(e){var t=To(Do,qa(e));return{URI:Bt,_E:void 0,map:Lr,ap:function(n,r){return m(n,t(r))},of:Qi}}function DL(e){var t=yp(Lo,e);return{URI:Bt,_E:void 0,map:Lr,alt:function(n,r){return m(n,t(r))}}}var VI={URI:Bt,map:Lr},gue=De(VI),yue={URI:Bt,of:Qi},qp={URI:Bt,map:Lr,ap:nf},LL=St(qp),bue=LL,jL=Tt(qp),_ue=jL,UL={URI:Bt,map:Lr,ap:nf,of:Qi},Go={URI:Bt,map:Lr,ap:nf,chain:zp},$ue={URI:Bt,map:Lr,ap:nf,of:Qi,chain:zp},BL=ut(Go),Sue=BL,Tue={URI:Bt,bimap:jI,mapLeft:UI},Iue={URI:Bt,map:Lr,alt:CL},rf={URI:Bt,fromReader:TL},Oue=wp(rf),wue=Ep(rf),Eue=Os(rf),zL=Rp(rf,Go),Rue=zL,qL=Mp(rf,Go),Mue=qL,Cue={URI:Bt,map:Lr,ap:nf,of:Qi,chain:zp,throwError:KI},Yo={URI:Bt,fromEither:SL},xue=Li(Yo),kue=ji(Yo),Aue=ns(Yo,Go),KL=Io(Yo,Go),Wue=KL,VL=Oo(Yo,Go),Nue=VL,Pue=za(Yo),HL=rs(Yo,Go),Fue=HL,Due=sr(Yo),Lue=Qi(jt),jue=Ot(VI),JL=wt(Go),Uue=JL,GL=It(qp),Bue=GL,YL=Qi(Yt),ZL=function(e){return X(Is(e),Ts(Dd(Ln)))},HI=function(e){var t=ZL(e);return function(n){return dt(n)?t(n):YL}},zue=HI,XL=function(e){return HI(function(t,n){return e(n)})},que=XL(B),Kue={URI:Bt,bimap:jI,mapLeft:UI,map:Lr,of:Qi,ap:nf,chain:zp,alt:CL,throwError:DI},Vue=Ut(qp),Hue=kr(UL),Jue=function(e){return Ut(Do)(Wd(e))};function Gue(e){var t=FL(e),n=DL(e);return{URI:Bt,_E:void 0,map:Lr,ap:t.ap,of:Qi,chain:zp,bimap:jI,mapLeft:UI,alt:n.alt,throwError:KI}}const Yue=Object.freeze(Object.defineProperty({__proto__:null,left:DI,right:_L,rightReader:$L,leftReader:tue,fromEither:SL,fromReader:TL,match:IL,matchW:nue,matchE:LI,fold:rue,matchEW:OL,foldW:iue,getOrElse:wL,getOrElseW:oue,toUnion:aue,local:uue,asksReaderEitherW:EL,asksReaderEither:sue,orElse:RL,orElseW:cue,orElseFirst:ML,orElseFirstW:lue,orLeft:fue,swap:due,map:xL,bimap:kL,mapLeft:AL,ap:BI,apW:pue,of:Qi,chain:zI,chainW:WL,flattenW:NL,flatten:hue,alt:qI,altW:mue,throwError:KI,URI:Bt,getCompactable:PL,getFilterable:vue,getApplicativeReaderValidation:FL,getAltReaderValidation:DL,Functor:VI,flap:gue,Pointed:yue,Apply:qp,apFirst:LL,apFirstW:bue,apSecond:jL,apSecondW:_ue,Applicative:UL,Chain:Go,Monad:$ue,chainFirst:BL,chainFirstW:Sue,Bifunctor:Tue,Alt:Iue,FromReader:rf,ask:Oue,asks:wue,fromReaderK:Eue,chainReaderK:zL,chainReaderKW:Rue,chainFirstReaderK:qL,chainFirstReaderKW:Mue,MonadThrow:Cue,FromEither:Yo,fromOption:xue,fromOptionK:kue,chainOptionK:Aue,chainEitherK:KL,chainEitherKW:Wue,chainFirstEitherK:VL,chainFirstEitherKW:Nue,fromPredicate:Pue,filterOrElse:HL,filterOrElseW:Fue,fromEitherK:Due,Do:Lue,bindTo:jue,bind:JL,bindW:Uue,apS:GL,apSW:Bue,ApT:YL,traverseReadonlyNonEmptyArrayWithIndex:ZL,traverseReadonlyArrayWithIndex:HI,traverseArrayWithIndex:zue,traverseArray:XL,sequenceArray:que,readerEither:Kue,getApplySemigroup:Vue,getApplyMonoid:Hue,getSemigroup:Jue,getReaderValidation:Gue},Symbol.toStringTag,{value:"Module"}));function JI(e){return function(t){return function(){return e.of(t)}}}function GI(e){return function(t){return function(n){return function(r){return e.map(n(r),t)}}}}function YI(e){return function(t){return function(n){return function(r){return e.ap(n(r),t(r))}}}}function ZI(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){return t(i)(r)})}}}}function XI(e){return function(t){return X(t,e.of)}}function Zue(e){return function(t){return X(t,e)}}function Xue(e){var t=YI(e),n=GI(e),r=ZI(e);return{map:function(i,o){return m(i,n(o))},ap:function(i,o){return m(i,t(o))},of:JI(e),chain:function(i,o){return m(i,r(o))},ask:function(){return e.of},asks:function(i){return X(i,e.of)},local:function(i,o){return function(a){return i(o(a))}},fromReader:XI(e),fromM:function(i){return function(){return i}}}}const Que=Object.freeze(Object.defineProperty({__proto__:null,of:JI,map:GI,ap:YI,chain:ZI,fromReader:XI,fromNaturalTransformation:Zue,getReaderM:Xue},Symbol.toStringTag,{value:"Module"}));var wn=function(e){return function(){return Promise.resolve().then(e)}};function ese(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var hi=function(e,t){return m(e,au(t))},xs=function(e,t){return m(e,QL(t))},QI=function(e,t){return m(e,Kp(function(n){return m(t,au(n))}))},of=function(e,t){return m(e,Kp(t))},au=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},QL=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)})}}},gn=function(e){return function(){return Promise.resolve(e)}},Kp=function(e){return function(t){return function(){return Promise.resolve().then(t).then(function(n){return e(n)()})}}},tse=Kp(B),En="Task";function nse(){return{concat:function(e,t){return function(){return Promise.race([Promise.resolve().then(e),Promise.resolve().then(t)])}},empty:tj}}var Pe={URI:En,map:hi},rse=De(Pe),en={URI:En,of:gn},ks={URI:En,map:hi,ap:xs},ise=St(ks),ose=Tt(ks),Vp={URI:En,map:hi,ap:xs,of:gn},Hg={URI:En,map:hi,ap:QI},ej={URI:En,map:hi,ap:QI,of:gn},af={URI:En,map:hi,ap:xs,chain:of},zt={URI:En,map:hi,of:gn,ap:xs,chain:of},ase={URI:En,map:hi,of:gn,ap:xs,chain:of,fromIO:wn},Hp=B,use={URI:En,map:hi,of:gn,ap:xs,chain:of,fromIO:wn,fromTask:Hp},sse=ut(af),Jg={URI:En,fromIO:wn},cse=Hi(Jg),lse=No(Jg,af),fse=Po(Jg,af),dse={URI:En,fromIO:wn,fromTask:Hp},tj=function(){return new Promise(function(e){})},pse=gn(jt),hse=Ot(Pe),mse=wt(af),vse=It(ks),eO=gn(Yt),uf=function(e){return function(t){return function(){return Promise.all(t.map(function(n,r){return Promise.resolve().then(function(){return e(r,n)()})}))}}},tO=function(e){var t=uf(e);return function(n){return dt(n)?t(n):eO}},nO=function(e){return function(t){return function(){return Gc(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,ur(t))).then(Rd))}}},rO=function(e){var t=nO(e);return function(n){return dt(n)?t(n):eO}},gse=tO,nj=function(e){return tO(function(t,n){return e(n)})},yse=nj(B),bse=rO,rj=function(e){return rO(function(t,n){return e(n)})},_se=rj(B),$se={URI:En,map:hi,of:gn,ap:xs,chain:of,fromIO:wn,fromTask:Hp},Sse={URI:En,map:hi,of:gn,ap:QI,chain:of,fromIO:wn,fromTask:Hp},Tse=Ut(Hg),Ise=kr(ej);const Ose=Object.freeze(Object.defineProperty({__proto__:null,fromIO:wn,delay:ese,map:au,ap:QL,of:gn,chain:Kp,flatten:tse,URI:En,getRaceMonoid:nse,Functor:Pe,flap:rse,Pointed:en,ApplyPar:ks,apFirst:ise,apSecond:ose,ApplicativePar:Vp,ApplySeq:Hg,ApplicativeSeq:ej,Chain:af,Monad:zt,MonadIO:ase,fromTask:Hp,MonadTask:use,chainFirst:sse,FromIO:Jg,fromIOK:cse,chainIOK:lse,chainFirstIOK:fse,FromTask:dse,never:tj,Do:pse,bindTo:hse,bind:mse,apS:vse,ApT:eO,traverseReadonlyNonEmptyArrayWithIndex:uf,traverseReadonlyArrayWithIndex:tO,traverseReadonlyNonEmptyArrayWithIndexSeq:nO,traverseReadonlyArrayWithIndexSeq:rO,traverseArrayWithIndex:gse,traverseArray:nj,sequenceArray:yse,traverseSeqArrayWithIndex:bse,traverseSeqArray:rj,sequenceSeqArray:_se,task:$se,taskSeq:Sse,getSemigroup:Tse,getMonoid:Ise},Symbol.toStringTag,{value:"Module"}));var ij=XI(en),sf=Ji,As=X(wn,sf),wse=Tp,oj=Ip,Ese=oj,mi=function(e,t){return m(e,oO(t))},Ws=function(e,t){return m(e,aO(t))},iO=function(e,t){return m(e,Gg(function(n){return m(t,oO(n))}))},cf=function(e,t){return m(e,Gg(t))},oO=GI(Pe),aO=YI(ks),Rse=aO,jr=JI(en),Gg=ZI(zt),aj=Gg,uj=aj(B),Mse=uj,yn="ReaderTask",tn={URI:yn,map:mi},Cse=De(tn),Jp={URI:yn,of:jr},Gp={URI:yn,map:mi,ap:Ws},xse=St(Gp),kse=Tt(Gp),Ase={URI:yn,map:mi,ap:Ws,of:jr},uO={URI:yn,map:mi,ap:iO},sj={URI:yn,map:mi,ap:iO,of:jr},eo={URI:yn,map:mi,ap:Ws,chain:cf},Zo={URI:yn,map:mi,of:jr,ap:Ws,chain:cf},Wse={URI:yn,map:mi,of:jr,ap:Ws,chain:cf,fromIO:As},Nse={URI:yn,map:mi,of:jr,ap:Ws,chain:cf,fromIO:As,fromTask:sf},cj=ut(eo),Pse=cj,Yg={URI:yn,fromIO:As},Fse=Hi(Yg),Dse=No(Yg,eo),Lse=Po(Yg,eo),lf={URI:yn,fromReader:ij},jse=wp(lf),Use=Ep(lf),Bse=Os(lf),lj=Rp(lf,eo),zse=lj,fj=Mp(lf,eo),qse=fj,Zg={URI:yn,fromIO:As,fromTask:sf},Kse=ws(Zg),Vse=Bl(Zg,eo),Hse=zl(Zg,eo),Jse=jr(jt),Gse=Ot(tn),dj=wt(eo),Yse=dj,pj=It(Gp),Zse=pj,sO=jr(Yt),hj=function(e){return X(Is(e),Ts(uf(Ln)))},cO=function(e){var t=hj(e);return function(n){return dt(n)?t(n):sO}},mj=function(e){return X(Is(e),Ts(nO(Ln)))},lO=function(e){var t=mj(e);return function(n){return dt(n)?t(n):sO}},Xse=cO,vj=function(e){return cO(function(t,n){return e(n)})},Qse=vj(B),ece=lO,gj=function(e){return lO(function(t,n){return e(n)})},tce=gj(B),nce={URI:yn,map:mi,of:jr,ap:Ws,chain:cf,fromIO:As,fromTask:sf},rce={URI:yn,map:mi,of:jr,ap:iO,chain:cf,fromIO:As,fromTask:sf},ice=Ut(uO),oce=kr(sj);function ace(e,t){return e(t)()}const uce=Object.freeze(Object.defineProperty({__proto__:null,fromReader:ij,fromTask:sf,fromIO:As,local:wse,asksReaderTaskW:oj,asksReaderTask:Ese,map:oO,ap:aO,apW:Rse,of:jr,chain:Gg,chainW:aj,flattenW:uj,flatten:Mse,URI:yn,Functor:tn,flap:Cse,Pointed:Jp,ApplyPar:Gp,apFirst:xse,apSecond:kse,ApplicativePar:Ase,ApplySeq:uO,ApplicativeSeq:sj,Chain:eo,Monad:Zo,MonadIO:Wse,MonadTask:Nse,chainFirst:cj,chainFirstW:Pse,FromIO:Yg,fromIOK:Fse,chainIOK:Dse,chainFirstIOK:Lse,FromReader:lf,ask:jse,asks:Use,fromReaderK:Bse,chainReaderK:lj,chainReaderKW:zse,chainFirstReaderK:fj,chainFirstReaderKW:qse,FromTask:Zg,fromTaskK:Kse,chainTaskK:Vse,chainFirstTaskK:Hse,Do:Jse,bindTo:Gse,bind:dj,bindW:Yse,apS:pj,apSW:Zse,ApT:sO,traverseReadonlyNonEmptyArrayWithIndex:hj,traverseReadonlyArrayWithIndex:cO,traverseReadonlyNonEmptyArrayWithIndexSeq:mj,traverseReadonlyArrayWithIndexSeq:lO,traverseArrayWithIndex:Xse,traverseArray:vj,sequenceArray:Qse,traverseSeqArrayWithIndex:ece,traverseSeqArray:gj,sequenceSeqArray:tce,readerTask:nce,readerTaskSeq:rce,getSemigroup:ice,getMonoid:oce,run:ace},Symbol.toStringTag,{value:"Module"}));var sce=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())})},cce=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}}},fO=xl(en),dO=_s(en),Xg=kl(Pe),pO=Al(Pe),hO=X(wn,Xg),yj=X(wn,pO),uu=hO,ff=Xg,mO=gn,vO=wn,bj=function(e){return au(sx(e))},_j=bp(Pe),lce=_j,gO=Ll(zt),fce=gO,$j=gO,dce=$j,Sj=jl(zt),pce=Sj,Tj=function(e,t){return function(){return sce(void 0,void 0,void 0,function(){var n;return cce(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(Ba)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,So(t(n))];case 3:return[2]}})})}},hce=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Tj(function(){return e.apply(void 0,n)},t)}},mce=Sp(Pe),vce=sg(en),gce=cg(en),yce=IT(zt),Ij=Ss(zt),bce=Ij,Qg=_p(zt),_ce=Qg,$ce=function(e){return Qg(Bj(e))},Sce=function(e){return Qg(zj(e))},Tce=$p(zt),Ice=Ul(Pe),Oj=function(e){var t=bj(e);return function(n){return X(n,t)}},wj=function(e){return function(t){return function(n){return m(n,Yp(Oj(e)(t)))}}},Oce=wj,Ej=function(e){return X(e,vO)},Rj=function(e){return Zp(Ej(e))},wce=Rj,nn=function(e,t){return m(e,_O(t))},su=function(e,t){return m(e,$O(t))},yO=function(e,t){return m(e,Yp(function(n){return m(t,_O(n))}))},cu=function(e,t){return m(e,Yp(t))},ey=function(e,t,n){return m(e,Mj(t,n))},ty=function(e,t){return m(e,Cj(t))},bO=function(e,t){return m(e,SO(t))},_O=Wl(Pe),Mj=Fl(Pe),Cj=Dl(Pe),$O=Nl(ks),Ece=$O,Yp=$s(zt),Zp=Yp,xj=Zp(B),Rce=xj,SO=Pl(zt),Mce=SO,Kn=dO,Xp=fO,pt="TaskEither";function TO(e,t){var n=To(e,qa(t));return{URI:pt,_E:void 0,map:nn,ap:function(r,i){return m(r,n(i))},of:Kn}}function kj(e){var t=yp(zt,e);return{URI:pt,_E:void 0,map:nn,alt:function(n,r){return m(n,t(r))}}}var Aj=function(e){var t=as(e);return{URI:pt,_E:void 0,compact:Vi(Pe,t),separate:ko(Pe,t,Ka)}};function Cce(e){var t=Qc(e),n=Aj(e),r=Ao(Pe,t),i=Wo(Pe,t),o=tu(Pe,t),a=nu(Pe,t);return{URI:pt,_E:void 0,map:nn,compact:n.compact,separate:n.separate,filter:function(u,s){return m(u,r(s))},filterMap:function(u,s){return m(u,i(s))},partition:function(u,s){return m(u,o(s))},partitionMap:function(u,s){return m(u,a(s))}}}var IO={URI:pt,map:nn},xce=De(IO),kce={URI:pt,of:Kn},ny={URI:pt,map:nn,ap:su},Wj=St(ny),Ace=Wj,Nj=Tt(ny),Wce=Nj,Nce={URI:pt,map:nn,ap:su,of:Kn},Pj={URI:pt,map:nn,ap:yO},Fj={URI:pt,map:nn,ap:yO,of:Kn},vi={URI:pt,map:nn,ap:su,chain:cu},Pce={URI:pt,map:nn,ap:su,chain:cu,of:Kn},Fce={URI:pt,map:nn,ap:su,chain:cu,of:Kn,fromIO:uu},Dce={URI:pt,map:nn,ap:su,chain:cu,of:Kn,fromIO:uu,fromTask:ff},Lce={URI:pt,map:nn,ap:su,chain:cu,of:Kn,throwError:Xp},Dj=ut(vi),jce=Dj,Uce={URI:pt,bimap:ey,mapLeft:ty},Bce={URI:pt,map:nn,alt:bO},Xo={URI:pt,fromEither:mO},zce=Li(Xo),qce=ji(Xo),Kce=ns(Xo,vi),Lj=Io(Xo,vi),Vce=Lj,jj=Oo(Xo,vi),Hce=jj,Jce=za(Xo),Uj=rs(Xo,vi),Gce=Uj,Yce=sr(Xo),ry={URI:pt,fromIO:uu},Bj=Hi(ry),Zce=No(ry,vi),Xce=Po(ry,vi),iy={URI:pt,fromIO:uu,fromTask:ff},zj=ws(iy),Qce=Bl(iy,vi),ele=zl(iy,vi);function tle(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(Ba(o))};e.apply(null,t.concat(r))})}}}var nle=function(e,t,n){return OO(e,t,n)},OO=function(e,t,n){return m(e,Zp(function(r){return m(t(r),Kp(function(i){return m(n(r,i),Zp(function(){return gn(i)}))}))}))},rle=Kn(jt),ile=Ot(IO),qj=wt(vi),ole=qj,Kj=It(ny),ale=Kj,wO=Kn(Yt),EO=function(e){return X(uf(e),au(Dd(Ln)))},RO=function(e){var t=EO(e);return function(n){return dt(n)?t(n):wO}},MO=function(e){return function(t){return function(){return Gc(t).reduce(function(n,r,i){return n.then(function(o){return Lt(o)?n:e(i+1,r)().then(function(a){return Lt(a)?a:(o.right.push(a.right),o)})})},e(0,ur(t))().then(us(Rd)))}}},CO=function(e){var t=MO(e);return function(n){return dt(n)?t(n):wO}},ule=RO,Vj=function(e){return RO(function(t,n){return e(n)})},sle=Vj(B),cle=CO,Hj=function(e){return CO(function(t,n){return e(n)})},lle=Hj(B),fle={URI:pt,bimap:ey,mapLeft:ty,map:nn,of:Kn,ap:su,chain:cu,alt:bO,fromIO:uu,fromTask:ff,throwError:Xp},dle={URI:pt,bimap:ey,mapLeft:ty,map:nn,of:Kn,ap:yO,chain:cu,alt:bO,fromIO:uu,fromTask:ff,throwError:Xp},ple=Ut(Pj),hle=kr(Fj),mle=function(e){return Ut(Hg)(Wd(e))};function vle(e){var t=TO(Vp,e),n=kj(e);return{URI:pt,_E:void 0,map:nn,ap:t.ap,of:Kn,chain:cu,bimap:ey,mapLeft:ty,alt:n.alt,fromIO:uu,fromTask:ff,throwError:Xp}}const gle=Object.freeze(Object.defineProperty({__proto__:null,left:fO,right:dO,rightTask:Xg,leftTask:pO,rightIO:hO,leftIO:yj,fromIO:uu,fromTask:ff,fromEither:mO,fromIOEither:vO,fromTaskOption:bj,match:_j,matchW:lce,matchE:gO,fold:fce,matchEW:$j,foldW:dce,getOrElse:Sj,getOrElseW:pce,tryCatch:Tj,tryCatchK:hce,toUnion:mce,fromNullable:vce,fromNullableK:gce,chainNullableK:yce,orElse:Ij,orElseW:bce,orElseFirst:Qg,orElseFirstW:_ce,orElseFirstIOK:$ce,orElseFirstTaskK:Sce,orLeft:Tce,swap:Ice,fromTaskOptionK:Oj,chainTaskOptionKW:wj,chainTaskOptionK:Oce,fromIOEitherK:Ej,chainIOEitherKW:Rj,chainIOEitherK:wce,map:_O,bimap:Mj,mapLeft:Cj,ap:$O,apW:Ece,chain:Yp,chainW:Zp,flattenW:xj,flatten:Rce,alt:SO,altW:Mce,of:Kn,throwError:Xp,URI:pt,getApplicativeTaskValidation:TO,getAltTaskValidation:kj,getCompactable:Aj,getFilterable:Cce,Functor:IO,flap:xce,Pointed:kce,ApplyPar:ny,apFirst:Wj,apFirstW:Ace,apSecond:Nj,apSecondW:Wce,ApplicativePar:Nce,ApplySeq:Pj,ApplicativeSeq:Fj,Chain:vi,Monad:Pce,MonadIO:Fce,MonadTask:Dce,MonadThrow:Lce,chainFirst:Dj,chainFirstW:jce,Bifunctor:Uce,Alt:Bce,FromEither:Xo,fromOption:zce,fromOptionK:qce,chainOptionK:Kce,chainEitherK:Lj,chainEitherKW:Vce,chainFirstEitherK:jj,chainFirstEitherKW:Hce,fromPredicate:Jce,filterOrElse:Uj,filterOrElseW:Gce,fromEitherK:Yce,FromIO:ry,fromIOK:Bj,chainIOK:Zce,chainFirstIOK:Xce,FromTask:iy,fromTaskK:zj,chainTaskK:Qce,chainFirstTaskK:ele,taskify:tle,bracket:nle,bracketW:OO,Do:rle,bindTo:ile,bind:qj,bindW:ole,apS:Kj,apSW:ale,ApT:wO,traverseReadonlyNonEmptyArrayWithIndex:EO,traverseReadonlyArrayWithIndex:RO,traverseReadonlyNonEmptyArrayWithIndexSeq:MO,traverseReadonlyArrayWithIndexSeq:CO,traverseArrayWithIndex:ule,traverseArray:Vj,sequenceArray:sle,traverseSeqArrayWithIndex:cle,traverseSeqArray:Hj,sequenceSeqArray:lle,taskEither:fle,taskEitherSeq:dle,getApplySemigroup:ple,getApplyMonoid:hle,getSemigroup:mle,getTaskValidation:vle},Symbol.toStringTag,{value:"Module"}));var lu=Ji,oy=xl(Jp),xO=_s(Jp),kO=X(Xg,lu),Jj=X(pO,lu),AO=function(e){return X(e,dO)},Gj=function(e){return X(e,fO)},Yj=kl(tn),yle=Al(tn),WO=X(hO,lu),Zj=X(yj,lu),Xj=jr,Qj=AO,fu=WO,df=kO,NO=X(vO,lu),PO=function(e){return X(e,mO)},eU=bp(tn),ble=eU,FO=Ll(eo),_le=FO,tU=FO,$le=tU,nU=jl(Zo),Sle=nU,Tle=Sp(tn),Ile=sg(Jp),Ole=cg(Jp),wle=IT(Zo),Ele=Tp,rU=Ip,Rle=rU,iU=Ss(Zo),Mle=iU,oU=_p(Zo),Cle=oU,xle=$p(Zo),kle=Ul(tn),aU=function(e){return X(e,NO)},uU=function(e){return pf(aU(e))},Ale=uU,DO=function(e){return X(e,lu)},sU=function(e){return pf(DO(e))},Wle=sU,cU=function(e){return fy(DO(e))},Nle=cU,LO=function(e){return X(e,PO)},lU=function(e){return pf(LO(e))},Ple=lU,fU=function(e){return fy(LO(e))},Fle=fU,rn=function(e,t){return m(e,Qp(t))},du=function(e,t){return m(e,qO(t))},jO=function(e,t){return m(e,sy(function(n){return m(t,Qp(n))}))},pu=function(e,t){return m(e,sy(t))},UO=function(e,t){return m(e,cy(t))},ay=function(e,t,n){return m(e,BO(t,n))},uy=function(e,t){return m(e,zO(t))},Qp=Wl(tn),BO=Fl(tn),zO=Dl(tn),qO=Nl(Gp),Dle=qO,Vn=xO,sy=$s(Zo),pf=sy,dU=pf(B),Lle=dU,cy=Pl(Zo),pU=cy,eh=oy,lt="ReaderTaskEither",hU=function(e){var t=as(e);return{URI:lt,_E:void 0,compact:Vi(tn,t),separate:ko(tn,t,Ka)}};function jle(e){var t=Qc(e),n=hU(e),r=Ao(tn,t),i=Wo(tn,t),o=tu(tn,t),a=nu(tn,t);return{URI:lt,_E:void 0,map:rn,compact:n.compact,separate:n.separate,filter:function(u,s){return m(u,r(s))},filterMap:function(u,s){return m(u,i(s))},partition:function(u,s){return m(u,o(s))},partitionMap:function(u,s){return m(u,a(s))}}}function mU(e,t){var n=To(Do,TO(e,t));return{URI:lt,_E:void 0,map:rn,ap:function(r,i){return m(r,n(i))},of:Vn}}function vU(e){var t=yp(Zo,e);return{URI:lt,_E:void 0,map:rn,alt:function(n,r){return m(n,t(r))}}}var Ns={URI:lt,map:rn},Ule=De(Ns),KO={URI:lt,of:Vn},ly={URI:lt,map:rn,ap:du},gU=St(ly),Ble=gU,yU=Tt(ly),zle=yU,qle={URI:lt,map:rn,ap:du,of:Vn},bU={URI:lt,map:rn,ap:jO},_U={URI:lt,map:rn,ap:jO,of:Vn},Rn={URI:lt,map:rn,ap:du,chain:pu},Kle={URI:lt,map:rn,ap:du,chain:pu,of:Vn},Vle={URI:lt,map:rn,ap:du,chain:pu,of:Vn,fromIO:fu},Hle={URI:lt,map:rn,ap:du,chain:pu,of:Vn,fromIO:fu,fromTask:df},Jle={URI:lt,map:rn,ap:du,chain:pu,of:Vn,throwError:eh},$U=ut(Rn),fy=$U,Gle={URI:lt,bimap:ay,mapLeft:uy},Yle={URI:lt,map:rn,alt:UO},hf={URI:lt,fromReader:Qj},Zle=wp(hf),Xle=Ep(hf),Qle=Os(hf),SU=Rp(hf,Rn),efe=SU,TU=Mp(hf,Rn),tfe=TU,VO=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Yj(e.apply(void 0,t))}},IU=function(e){return pf(VO(e))},nfe=IU,OU=function(e){return fy(VO(e))},rfe=OU,Qo={URI:lt,fromEither:Xj},ife=Li(Qo),ofe=ji(Qo),afe=ns(Qo,Rn),wU=Io(Qo,Rn),ufe=wU,EU=Oo(Qo,Rn),sfe=EU,cfe=za(Qo),RU=rs(Qo,Rn),lfe=RU,ffe=sr(Qo),dy={URI:lt,fromIO:fu},dfe=Hi(dy),pfe=No(dy,Rn),hfe=Po(dy,Rn),py={URI:lt,fromIO:fu,fromTask:df},mfe=ws(py),vfe=Bl(py,Rn),gfe=zl(py,Rn);function yfe(e,t,n){return MU(e,t,n)}function MU(e,t,n){return function(r){return OO(e(r),function(i){return t(i)(r)},function(i,o){return n(i,o)(r)})}}var bfe=Vn(jt),_fe=Ot(Ns),CU=wt(Rn),$fe=CU,xU=It(ly),Sfe=xU,HO=Vn(Yt),kU=function(e){return X(Is(e),Ts(EO(Ln)))},JO=function(e){var t=kU(e);return function(n){return dt(n)?t(n):HO}},AU=function(e){return X(Is(e),Ts(MO(Ln)))},GO=function(e){var t=AU(e);return function(n){return dt(n)?t(n):HO}},Tfe=JO,WU=function(e){return JO(function(t,n){return e(n)})},Ife=WU(B),Ofe=GO,NU=function(e){return GO(function(t,n){return e(n)})},wfe=NU(B),Efe={URI:lt,map:rn,of:Vn,ap:du,chain:pu,alt:UO,bimap:ay,mapLeft:uy,fromIO:fu,fromTask:df,throwError:eh},Rfe={URI:lt,map:rn,of:Vn,ap:jO,chain:pu,alt:UO,bimap:ay,mapLeft:uy,fromIO:fu,fromTask:df,throwError:eh},Mfe=Ut(bU),Cfe=kr(_U),xfe=function(e){return Ut(uO)(Wd(e))};function kfe(e){var t=mU(Vp,e),n=vU(e);return{URI:lt,_E:void 0,map:rn,of:Vn,chain:pu,bimap:ay,mapLeft:uy,ap:t.ap,alt:n.alt,fromIO:fu,fromTask:df,throwError:eh}}function Afe(e,t){return e(t)()}const Wfe=Object.freeze(Object.defineProperty({__proto__:null,fromTaskEither:lu,left:oy,right:xO,rightTask:kO,leftTask:Jj,rightReader:AO,leftReader:Gj,rightReaderTask:Yj,leftReaderTask:yle,rightIO:WO,leftIO:Zj,fromEither:Xj,fromReader:Qj,fromIO:fu,fromTask:df,fromIOEither:NO,fromReaderEither:PO,match:eU,matchW:ble,matchE:FO,fold:_le,matchEW:tU,foldW:$le,getOrElse:nU,getOrElseW:Sle,toUnion:Tle,fromNullable:Ile,fromNullableK:Ole,chainNullableK:wle,local:Ele,asksReaderTaskEitherW:rU,asksReaderTaskEither:Rle,orElse:iU,orElseW:Mle,orElseFirst:oU,orElseFirstW:Cle,orLeft:xle,swap:kle,fromIOEitherK:aU,chainIOEitherKW:uU,chainIOEitherK:Ale,fromTaskEitherK:DO,chainTaskEitherKW:sU,chainTaskEitherK:Wle,chainFirstTaskEitherKW:cU,chainFirstTaskEitherK:Nle,fromReaderEitherK:LO,chainReaderEitherKW:lU,chainReaderEitherK:Ple,chainFirstReaderEitherKW:fU,chainFirstReaderEitherK:Fle,map:Qp,bimap:BO,mapLeft:zO,ap:qO,apW:Dle,of:Vn,chain:sy,chainW:pf,flattenW:dU,flatten:Lle,alt:cy,altW:pU,throwError:eh,URI:lt,getCompactable:hU,getFilterable:jle,getApplicativeReaderTaskValidation:mU,getAltReaderTaskValidation:vU,Functor:Ns,flap:Ule,Pointed:KO,ApplyPar:ly,apFirst:gU,apFirstW:Ble,apSecond:yU,apSecondW:zle,ApplicativePar:qle,ApplySeq:bU,ApplicativeSeq:_U,Chain:Rn,Monad:Kle,MonadIO:Vle,MonadTask:Hle,MonadThrow:Jle,chainFirst:$U,chainFirstW:fy,Bifunctor:Gle,Alt:Yle,FromReader:hf,ask:Zle,asks:Xle,fromReaderK:Qle,chainReaderK:SU,chainReaderKW:efe,chainFirstReaderK:TU,chainFirstReaderKW:tfe,fromReaderTaskK:VO,chainReaderTaskKW:IU,chainReaderTaskK:nfe,chainFirstReaderTaskKW:OU,chainFirstReaderTaskK:rfe,FromEither:Qo,fromOption:ife,fromOptionK:ofe,chainOptionK:afe,chainEitherK:wU,chainEitherKW:ufe,chainFirstEitherK:EU,chainFirstEitherKW:sfe,fromPredicate:cfe,filterOrElse:RU,filterOrElseW:lfe,fromEitherK:ffe,FromIO:dy,fromIOK:dfe,chainIOK:pfe,chainFirstIOK:hfe,FromTask:py,fromTaskK:mfe,chainTaskK:vfe,chainFirstTaskK:gfe,bracket:yfe,bracketW:MU,Do:bfe,bindTo:_fe,bind:CU,bindW:$fe,apS:xU,apSW:Sfe,ApT:HO,traverseReadonlyNonEmptyArrayWithIndex:kU,traverseReadonlyArrayWithIndex:JO,traverseReadonlyNonEmptyArrayWithIndexSeq:AU,traverseReadonlyArrayWithIndexSeq:GO,traverseArrayWithIndex:Tfe,traverseArray:WU,sequenceArray:Ife,traverseSeqArrayWithIndex:Ofe,traverseSeqArray:NU,sequenceSeqArray:wfe,readerTaskEither:Efe,readerTaskEitherSeq:Rfe,getApplySemigroup:Mfe,getApplyMonoid:Cfe,getSemigroup:xfe,getReaderTaskValidation:kfe,run:Afe},Symbol.toStringTag,{value:"Module"}));var PU={equals:function(e,t){return e===t}},FU={concat:function(e,t){return e+t}},DU="",Nfe={concat:FU.concat,empty:DU},Y={equals:PU.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},Pfe={show:function(e){return JSON.stringify(e)}},Ffe=function(e){return typeof e=="string"},Dfe=function(e){return e.toUpperCase()},Lfe=function(e){return e.toLowerCase()},jfe=function(e,t){return function(n){return n.replace(e,t)}},Ufe=function(e){return e.trim()},Bfe=function(e){return e.trimLeft()},zfe=function(e){return e.trimRight()},qfe=function(e,t){return function(n){return n.slice(e,t)}},Kfe=function(e){return e.length===0},Vfe=function(e){return e.length},Hfe=function(e){return function(t){var n=t.split(e);return zi(n)?n:[t]}},Jfe=function(e,t){return function(n){return n.includes(e,t)}},Gfe=function(e,t){return function(n){return n.startsWith(e,t)}},Yfe=function(e,t){return function(n){return n.endsWith(e,t)}};const Zfe=Object.freeze(Object.defineProperty({__proto__:null,Eq:PU,Semigroup:FU,empty:DU,Monoid:Nfe,Ord:Y,Show:Pfe,isString:Ffe,toUpperCase:Dfe,toLowerCase:Lfe,replace:jfe,trim:Ufe,trimLeft:Bfe,trimRight:zfe,slice:qfe,isEmpty:Kfe,size:Vfe,split:Hfe,includes:Jfe,startsWith:Gfe,endsWith:Yfe},Symbol.toStringTag,{value:"Module"}));var Xfe=function(e){return Object.assign({},e)},Qfe=function(e){return Object.assign({},e)},LU=function(e){return Object.keys(e).length},gi=function(e){for(var t in e)if(at.call(e,t))return!1;return!0},mf=function(e){return function(t){return Object.keys(t).sort(e.compare)}},ede=mf(Y);function hy(e){if(typeof e=="function")return hy(Y)(e);var t=mf(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 th=hy(Y)(function(e,t){return[e,t]});function tde(e){return function(t){var n=th(t),r=n.length;return e.unfold(0,function(i){return i<r?le([n[i],i+1]):me})}}var YO=function(e,t){return function(n){if(at.call(n,e)&&n[e]===t)return n;var r=Object.assign({},n);return r[e]=t,r}},ea=function(e,t){return at.call(t,e)};function my(e){return function(t){if(!at.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var nde=function(e,t){return function(n){if(!ea(e,n))return me;if(n[e]===t)return le(n);var r=Object.assign({},n);return r[e]=t,le(r)}},rde=function(e,t){return function(n){if(!ea(e,n))return me;var r=t(n[e]);if(r===n[e])return le(n);var i=Object.assign({},n);return i[e]=r,le(i)}};function ide(e){var t=my(e);return function(n){var r=Ps(e,n);return Ct(r)?me:le([r.value,t(n)])}}function vy(e){return function(t,n){if(n===void 0){var r=vy(e);return function(o){return r(o,t)}}for(var i in t)if(!at.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function Ps(e,t){return t===void 0?function(n){return Ps(e,n)}:at.call(t,e)?le(t[e]):me}var nh={};function gy(e){return function(t){var n={};for(var r in t)at.call(t,r)&&(n[r]=e(r,t[r]));return n}}function ZO(e){return gy(function(t,n){return e(n)})}function vf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return vf(Y).apply(void 0,e);var n=mf(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 gf(e){if("compare"in e){var t=mf(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 gf(Y)(e)}function yf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return yf(Y).apply(void 0,e);var n=mf(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 jU=function(e,t){var n;return n={},n[e]=t,n};function UU(e){var t=ih(Y)(e);return function(n){return function(r){return t(r,n)}}}function yy(e){var t=to(Y)(e);return function(n){return function(r){return t(r,n)}}}function bf(e){return rh(Y)(e)}var ode=function(e){var t=yy(e);return function(n){return function(r){return e.map(m(r,t(n)),ta)}}},ade=function(e){var t=yy(e);return function(n){return function(r){return e.map(m(r,t(n)),na)}}};function by(e){return function(t){var n={},r={};for(var i in t)if(at.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 Oe(n,r)}}function _y(e){return function(t){var n={},r={};for(var i in t)if(at.call(t,i)){var o=t[i];e(i,o)?r[i]=o:n[i]=o}return Oe(n,r)}}function $y(e){return function(t){var n={};for(var r in t)if(at.call(t,r)){var i=e(r,t[r]);mt(i)&&(n[r]=i.value)}return n}}function _f(e){return function(t){var n={},r=!1;for(var i in t)if(at.call(t,i)){var o=t[i];e(i,o)?n[i]=o:r=!0}return r?n:t}}function BU(e,t){var n=XO(e,t);return function(r){return n(r,B)}}function XO(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]=at.call(i,u)?e.concat(i[u],s):s,i})}}var ude=th,sde=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 zU(e){return function(t){for(var n in t)if(!e(t[n]))return!1;return!0}}function qU(e){return function(t){for(var n in t)if(e(t[n]))return!0;return!1}}function QO(e){return function(t,n){if(n===void 0){var r=QO(e);return function(o){return r(t,o)}}for(var i in n)if(e.equals(n[i],t))return!0;return!1}}var e1=function(e){return function(t){return function(n){if(gi(n))return t;if(gi(t))return n;var r={};for(var i in n)ea(i,t)?r[i]=e.concat(n[i],t[i]):r[i]=n[i];for(var i in t)ea(i,r)||(r[i]=t[i]);return r}}},t1=function(e){return function(t){return function(n){if(gi(n)||gi(t))return nh;var r={};for(var i in n)ea(i,t)&&(r[i]=e.concat(n[i],t[i]));return r}}},n1=function(e){return function(t){if(gi(t))return e;if(gi(e))return t;var n={};for(var r in t)ea(r,e)||(n[r]=t[r]);for(var r in e)ea(r,t)||(n[r]=e[r]);return n}},fr=function(e,t){return m(e,ZO(t))},Fs=function(e,t){return m(e,gy(t))},dr=function(e){var t=oh(e);return function(n,r,i){return m(n,t(r,i))}},pr=function(e){return function(t){var n=ah(e)(t);return function(r,i){return m(r,n(i))}}},hr=function(e){var t=uh(e);return function(n,r,i){return m(n,t(r,i))}},Ds=function(e,t){return m(e,wy(t))},Ls=function(e,t){return m(e,r1(t))},js=function(e,t){return m(e,Ey(t))},Us=function(e,t){return m(e,i1(t))},Bs=function(e){var t=vf(e);return function(n,r,i){return m(n,t(r,i))}},zs=function(e){var t=gf(e);return function(n){var r=t(n);return function(i,o){return m(i,r(o))}}},qs=function(e){var t=yf(e);return function(n,r,i){return m(n,t(r,i))}},Sy=function(e,t){return m(e,by(t))},Ty=function(e,t){return m(e,_y(t))},Iy=function(e,t){return m(e,$y(t))},Oy=function(e,t){return m(e,_f(t))},to=function(e){var t=ih(e);return function(n){var r=t(n);return function(i,o){return r(i,X(Ln,o))}}},rh=function(e){var t=to(e);return function(n){var r=t(n);return function(i){return r(i,B)}}},ih=function(e){return function(t){var n=mf(e);return function(r,i){var o=n(r);if(o.length===0)return t.of(nh);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}}},wy=function(e){return _f(function(t,n){return e(n)})},r1=function(e){return $y(function(t,n){return e(n)})},Ey=function(e){return _y(function(t,n){return e(n)})},i1=function(e){return by(function(t,n){return e(n)})};function oh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=vf(e[0]);return function(r,i){return n(r,function(o,a,u){return i(a,u)})}}return oh(Y).apply(void 0,e)}function ah(e){if("compare"in e){var t=gf(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}}return ah(Y)(e)}function uh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=yf(e[0]);return function(r,i){return n(r,function(o,a,u){return i(a,u)})}}return uh(Y).apply(void 0,e)}var ta=function(e){var t={};for(var n in e)if(at.call(e,n)){var r=e[n];mt(r)&&(t[n]=r.value)}return t},na=function(e){var t={},n={};for(var r in e)if(at.call(e,r)){var i=e[r];Lt(i)?t[r]=i.left:n[r]=i.right}return Oe(t,n)},on="ReadonlyRecord";function Ry(e){return"compare"in e?function(t){return{show:function(n){var r=hy(e)(function(i,o){return"".concat(JSON.stringify(i),": ").concat(t.show(o))})(n).join(", ");return r===""?"{}":"{ ".concat(r," }")}}}:Ry(Y)(e)}function KU(e){var t=vy(e);return Wr(function(n,r){return t(n)(r)&&t(r)(n)})}function VU(e){return{concat:function(t,n){if(gi(t))return n;if(gi(n))return t;var r=Object.assign({},t);for(var i in n)at.call(n,i)&&(r[i]=at.call(t,i)?e.concat(t[i],n[i]):n[i]);return r},empty:nh}}var HU={URI:on,map:fr},cde=De(HU),lde={URI:on,map:fr,mapWithIndex:Fs},fde=function(e){return{URI:on,reduce:dr(e),foldMap:pr(e),reduceRight:hr(e)}},dde=function(e){return{URI:on,reduce:dr(e),foldMap:pr(e),reduceRight:hr(e),reduceWithIndex:Bs(e),foldMapWithIndex:zs(e),reduceRightWithIndex:qs(e)}},sh={URI:on,compact:ta,separate:na},pde={URI:on,map:fr,compact:ta,separate:na,filter:Ds,filterMap:Ls,partition:js,partitionMap:Us},hde={URI:on,map:fr,mapWithIndex:Fs,compact:ta,separate:na,filter:Ds,filterMap:Ls,partition:js,partitionMap:Us,filterMapWithIndex:Iy,filterWithIndex:Oy,partitionMapWithIndex:Sy,partitionWithIndex:Ty},JU=function(e){return{URI:on,map:fr,reduce:dr(e),foldMap:pr(e),reduceRight:hr(e),traverse:to(e),sequence:rh(e)}},mde=function(e){return{URI:on,map:fr,mapWithIndex:Fs,reduce:dr(e),foldMap:pr(e),reduceRight:hr(e),reduceWithIndex:Bs(e),foldMapWithIndex:zs(e),reduceRightWithIndex:qs(e),traverse:to(e),sequence:rh(e),traverseWithIndex:ih(e)}},vde=function(e){var t=JU(e);return{URI:on,map:fr,reduce:dr(e),foldMap:pr(e),reduceRight:hr(e),traverse:t.traverse,sequence:t.sequence,compact:ta,separate:na,filter:Ds,filterMap:Ls,partition:js,partitionMap:Us,wither:ii(t,sh),wilt:ri(t,sh)}},GU=function(e){var t=e1(e);return{concat:function(n,r){return t(r)(n)}}},gde=function(e){return{concat:GU(e).concat,empty:nh}},yde=function(e){var t=t1(e);return{concat:function(n,r){return t(r)(n)}}},bde=function(){return{concat:function(e,t){return n1(t)(e)}}},_de={URI:on,reduce:dr(Y),foldMap:pr(Y),reduceRight:hr(Y)},$de={URI:on,reduce:dr(Y),foldMap:pr(Y),reduceRight:hr(Y),reduceWithIndex:Bs(Y),foldMapWithIndex:zs(Y),reduceRightWithIndex:qs(Y)},o1={URI:on,map:fr,reduce:dr(Y),foldMap:pr(Y),reduceRight:hr(Y),traverse:to(Y),sequence:bf},Sde={URI:on,map:fr,mapWithIndex:Fs,reduce:dr(Y),foldMap:pr(Y),reduceRight:hr(Y),reduceWithIndex:Bs(Y),foldMapWithIndex:zs(Y),reduceRightWithIndex:qs(Y),traverse:to(Y),sequence:bf,traverseWithIndex:ih(Y)},YU=ii(o1,sh),ZU=ri(o1,sh),Tde={URI:on,map:fr,reduce:dr(Y),foldMap:pr(Y),reduceRight:hr(Y),traverse:to(Y),sequence:bf,compact:ta,separate:na,filter:Ds,filterMap:Ls,partition:js,partitionMap:Us,wither:YU,wilt:ZU},a1=YO;function XU(e,t){return at.call(t===void 0?this:t,e)}var Ide={URI:on,map:fr,reduce:dr(Y),foldMap:pr(Y),reduceRight:hr(Y),traverse:to(Y),sequence:bf,compact:ta,separate:na,filter:Ds,filterMap:Ls,partition:js,partitionMap:Us,mapWithIndex:Fs,reduceWithIndex:Bs(Y),foldMapWithIndex:zs(Y),reduceRightWithIndex:qs(Y),filterMapWithIndex:Iy,filterWithIndex:Oy,partitionMapWithIndex:Sy,partitionWithIndex:Ty,traverseWithIndex:ih(Y),wither:YU,wilt:ZU};const Ode=Object.freeze(Object.defineProperty({__proto__:null,fromRecord:Xfe,toRecord:Qfe,size:LU,isEmpty:gi,keys:ede,collect:hy,toReadonlyArray:th,toUnfoldable:tde,upsertAt:YO,has:ea,deleteAt:my,updateAt:nde,modifyAt:rde,pop:ide,isSubrecord:vy,lookup:Ps,empty:nh,mapWithIndex:gy,map:ZO,reduceWithIndex:vf,foldMapWithIndex:gf,reduceRightWithIndex:yf,singleton:jU,traverseWithIndex:UU,traverse:yy,sequence:bf,wither:ode,wilt:ade,partitionMapWithIndex:by,partitionWithIndex:_y,filterMapWithIndex:$y,filterWithIndex:_f,fromFoldable:BU,fromFoldableMap:XO,toEntries:ude,fromEntries:sde,every:zU,some:qU,elem:QO,union:e1,intersection:t1,difference:n1,_map:fr,_mapWithIndex:Fs,_reduce:dr,_foldMap:pr,_reduceRight:hr,_filter:Ds,_filterMap:Ls,_partition:js,_partitionMap:Us,_reduceWithIndex:Bs,_foldMapWithIndex:zs,_reduceRightWithIndex:qs,_partitionMapWithIndex:Sy,_partitionWithIndex:Ty,_filterMapWithIndex:Iy,_filterWithIndex:Oy,_traverse:to,_sequence:rh,filter:wy,filterMap:r1,partition:Ey,partitionMap:i1,reduce:oh,foldMap:ah,reduceRight:uh,compact:ta,separate:na,URI:on,getShow:Ry,getEq:KU,getMonoid:VU,Functor:HU,flap:cde,FunctorWithIndex:lde,getFoldable:fde,getFoldableWithIndex:dde,Compactable:sh,Filterable:pde,FilterableWithIndex:hde,getTraversable:JU,getTraversableWithIndex:mde,getWitherable:vde,getUnionSemigroup:GU,getUnionMonoid:gde,getIntersectionSemigroup:yde,getDifferenceMagma:bde,Foldable:_de,FoldableWithIndex:$de,Traversable:o1,TraversableWithIndex:Sde,Witherable:Tde,insertAt:a1,hasOwnProperty:XU,readonlyRecord:Ide},Symbol.toStringTag,{value:"Module"}));var wde=function(e){return new Set(e)},Ede=function(e){return new Set([e])},QU=function(e){return function(t){for(var n=t.length,r=new Set,i=an(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}};function Rde(e){return new Set(e)}function Mde(e){var t=an(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 Cde(e){var t=an(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 u1(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 xde(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 Oe(o,i)}}function s1(e){var t=an(e);return function(n,r){if(r===void 0){var i=s1(e);return function(a){return i(n,a)}}if(ch(n))return r;if(ch(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function c1(e){var t=an(e);return function(n,r){if(r===void 0){var i=c1(e);return function(a){return i(a,n)}}if(ch(n)||ch(r))return f1;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function kde(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,u=new Set,s=an(e),c=an(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 Oe(a,u)}}}function l1(e){var t=an(e);return function(n,r){if(r===void 0){var i=l1(e);return function(o){return i(o,n)}}return u1(function(o){return!t(o,r)})(n)}}function eB(e){var t=My(e);return function(n,r){return function(i){return t(i).reduce(r,n)}}}function tB(e,t){var n=My(e);return function(r){return function(i){return n(i).reduce(function(o,a){return t.concat(o,r(a))},t.empty)}}}var nB=function(e){var t=My(e);return function(n,r){return function(i){return t(i).reduceRight(function(o,a){return r(a,o)},n)}}};function rB(e){var t=an(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var iB=function(e){return function(t){return function(n){return u1(function(r){return!e.equals(t,r)})(n)}}},Ade=function(e){var t=an(e),n=iB(e),r=rB(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},Wde=function(e){return oB(e)(B)};function Nde(e,t){return function(n){var r=an(e),i=an(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}}),Oe(o,a)}}function oB(e){var t=an(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 f1=new Set,ch=function(e){return e.size===0},Pde=function(e){return e.size},d1=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 p1(e){return pp(d1(pp(e)))}function lh(e){var t=an(e);return function(n,r){if(r===void 0){var i=lh(e);return function(o){return i(o,n)}}return p1(function(o){return t(o,r)})(n)}}function an(e){return function(t,n){if(n===void 0){var r=an(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 My=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},Fde="ReadonlySet";function aB(e){return{show:function(t){var n=[];return t.forEach(function(r){n.push(e.show(r))}),"new Set([".concat(n.sort().join(", "),"])")}}}function uB(e){var t=lh(e);return Wr(function(n,r){return t(n,r)&&t(r,n)})}var sB=function(e){return{concat:s1(e)}},Dde=function(e){return{concat:sB(e).concat,empty:f1}},Lde=function(e){return{concat:c1(e)}},jde=function(e){return{concat:l1(e)}},Ude=QU;const Bde=Object.freeze(Object.defineProperty({__proto__:null,fromSet:wde,singleton:Ede,fromReadonlyArray:QU,toSet:Rde,map:Mde,chain:Cde,filter:u1,partition:xde,union:s1,intersection:c1,partitionMap:kde,difference:l1,reduce:eB,foldMap:tB,reduceRight:nB,insert:rB,remove:iB,toggle:Ade,compact:Wde,separate:Nde,filterMap:oB,empty:f1,isEmpty:ch,size:Pde,some:d1,every:p1,isSubset:lh,elem:an,toReadonlyArray:My,URI:Fde,getShow:aB,getEq:uB,getUnionSemigroup:sB,getUnionMonoid:Dde,getIntersectionSemigroup:Lde,getDifferenceMagma:jde,fromArray:Ude},Symbol.toStringTag,{value:"Module"}));function qt(e){return e[0]}function bn(e){return e[1]}var zde=function(e){return[bn(e),qt(e)]};function h1(e){return{URI:mr,_E:void 0,map:fh,ap:function(t,n){return[qt(t)(qt(n)),e.concat(bn(t),bn(n))]}}}var cB=function(e){return function(t){return[t,e.empty]}};function qde(e){var t=h1(e);return{URI:mr,_E:void 0,map:t.map,ap:t.ap,of:cB(e)}}function m1(e){var t=h1(e);return{URI:mr,_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(bn(n),a)]}}}function Kde(e){var t=m1(e);return{URI:mr,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:cB(e)}}function Vde(e){var t=function(r,i){for(var o=i(r),a=e.empty,u=qt(o);u._tag==="Left";)a=e.concat(a,bn(o)),o=i(u.left),u=qt(o);return[u.right,e.concat(a,bn(o))]},n=m1(e);return{URI:mr,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var lB=function(e,t){return m(e,vB(t))},fh=function(e,t){return m(e,b1(t))},fB=function(e,t,n){return m(e,mB(t,n))},dB=function(e,t){return m(e,_1(t))},pB=function(e,t){return m(e,$1(t))},v1=function(e,t,n){return m(e,S1(t,n))},g1=function(e){var t=T1();return function(n,r){return m(n,t(r))}},y1=function(e,t,n){return m(e,I1(t,n))},hB=function(e){var t=gB(e);return function(n,r){return m(n,t(r))}},mB=function(e,t){return function(n){return[t(qt(n)),e(bn(n))]}},b1=function(e){return function(t){return[e(qt(t)),bn(t)]}},_1=function(e){return function(t){return[qt(t),e(bn(t))]}},vB=function(e){return function(t){return[qt(t),bn(e)]}},$1=function(e){return function(t){return[e(t),bn(t)]}},Cy=qt,Hde=$1(B),S1=function(e,t){return function(n){return t(e,qt(n))}},T1=function(){return function(e){return function(t){return e(qt(t))}}},I1=function(e,t){return function(n){return t(qt(n),e)}},gB=function(e){return function(t){return function(n){return e.map(t(qt(n)),function(r){return[r,bn(n)]})}}},O1=function(e){return function(t){return e.map(qt(t),function(n){return[n,bn(t)]})}},mr="ReadonlyTuple",yB={URI:mr,map:fh},Jde=De(yB),Gde={URI:mr,bimap:fB,mapLeft:dB},Yde={URI:mr,compose:lB},Zde={URI:mr,map:fh,extend:pB,extract:Cy},Xde={URI:mr,reduce:v1,foldMap:g1,reduceRight:y1},Qde={URI:mr,map:fh,reduce:v1,foldMap:g1,reduceRight:y1,traverse:hB,sequence:O1},epe=b1,tpe=_1,npe={URI:mr,compose:lB,map:fh,bimap:fB,mapLeft:dB,extract:Cy,extend:pB,reduce:v1,foldMap:g1,reduceRight:y1,traverse:hB,sequence:O1};const rpe=Object.freeze(Object.defineProperty({__proto__:null,fst:qt,snd:bn,swap:zde,getApply:h1,getApplicative:qde,getChain:m1,getMonad:Kde,getChainRec:Vde,bimap:mB,mapFst:b1,mapSnd:_1,compose:vB,extend:$1,extract:Cy,duplicate:Hde,reduce:S1,foldMap:T1,reduceRight:I1,traverse:gB,sequence:O1,URI:mr,Functor:yB,flap:Jde,Bifunctor:Gde,Semigroupoid:Yde,Comonad:Zde,Foldable:Xde,Traversable:Qde,map:epe,mapLeft:tpe,readonlyTuple:npe},Symbol.toStringTag,{value:"Module"}));var $f=globalThis&&globalThis.__assign||function(){return $f=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},$f.apply(this,arguments)},ipe=LU,Ks=gi,w1=function(e){return function(t){return Object.keys(t).sort(e.compare)}},ope=w1(Y);function E1(e){if(typeof e=="function")return E1(Y)(e);var t=w1(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 R1=E1(Y)(function(e,t){return[e,t]});function ape(e){return function(t){var n=R1(t),r=n.length;return e.unfold(0,function(i){return i<r?le([n[i],i+1]):me})}}var bB=YO,_B=ea;function $B(e){return function(t){if(!at.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var upe=function(e,t){return SB(e,function(){return t})},SB=function(e,t){return function(n){if(!_B(e,n))return me;var r=Object.assign({},n);return r[e]=t(n[e]),le(r)}};function spe(e){var t=$B(e);return function(n){var r=TB(e,n);return Ct(r)?me:le([r.value,t(n)])}}var cpe=vy,TB=Ps,lpe=gy,fpe=ZO;function dpe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?vf(e[0]):vf(Y).apply(void 0,e)}function ppe(e){return"compare"in e?gf(e):gf(Y)(e)}function hpe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?yf(e[0]):yf(Y).apply(void 0,e)}var mpe=jU;function vpe(e){return UU(e)}function M1(e){return yy(e)}function dh(e){return bf(e)}var gpe=function(e){var t=M1(e);return function(n){return function(r){return e.map(m(r,t(n)),hu)}}},ype=function(e){var t=M1(e);return function(n){return function(r){return e.map(m(r,t(n)),mu)}}},bpe=by;function _pe(e){return _y(e)}var $pe=$y;function Spe(e){return _f(e)}function IB(e,t){return BU(e,t)}var Tpe=R1,Ipe=function(e){return IB(nv(),$N)(e)};function Ope(e,t){return XO(e,t)}var wpe=zU,Epe=qU,Rpe=QO,OB=function(e){var t=e1(e);return function(n){return function(r){return Ks(r)?$f({},n):Ks(n)?$f({},r):t(n)(r)}}},wB=function(e){return function(t){return function(n){return Ks(n)||Ks(t)?{}:t1(e)(t)(n)}}},EB=function(e){return function(t){return Ks(t)?$f({},e):Ks(e)?$f({},t):n1(e)(t)}},yi=fr,ph=Fs,bi=dr,_i=pr,$i=hr,hh=Ds,mh=Ls,vh=js,gh=Us,yh=Bs,bh=zs,_h=qs,RB=Sy,MB=Ty,CB=Iy,xB=Oy,Sf=to,kB=rh,C1=function(e){return function(t){var n=w1(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}}},Mpe=wy,Cpe=r1,xpe=Ey,kpe=i1;function Ape(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?oh(e[0]):oh(Y).apply(void 0,e)}function Wpe(e){return"compare"in e?ah(e):ah(Y)(e)}function Npe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?uh(e[0]):uh(Y).apply(void 0,e)}var hu=ta,mu=na,un="Record";function Ppe(e){return"compare"in e?Ry(e):Ry(Y)(e)}var Fpe=KU,Dpe=VU,AB={URI:un,map:yi},Lpe=De(AB),jpe={URI:un,map:yi,mapWithIndex:ph},Upe=function(e){return{URI:un,reduce:bi(e),foldMap:_i(e),reduceRight:$i(e)}},Bpe=function(e){return{URI:un,reduce:bi(e),foldMap:_i(e),reduceRight:$i(e),reduceWithIndex:yh(e),foldMapWithIndex:bh(e),reduceRightWithIndex:_h(e)}},$h={URI:un,compact:hu,separate:mu},zpe={URI:un,map:yi,compact:hu,separate:mu,filter:hh,filterMap:mh,partition:vh,partitionMap:gh},qpe={URI:un,map:yi,mapWithIndex:ph,compact:hu,separate:mu,filter:hh,filterMap:mh,partition:vh,partitionMap:gh,filterMapWithIndex:CB,filterWithIndex:xB,partitionMapWithIndex:RB,partitionWithIndex:MB},WB=function(e){return{URI:un,map:yi,reduce:bi(e),foldMap:_i(e),reduceRight:$i(e),traverse:Sf(e),sequence:kB(e)}},Kpe=function(e){return{URI:un,map:yi,mapWithIndex:ph,reduce:bi(e),foldMap:_i(e),reduceRight:$i(e),reduceWithIndex:yh(e),foldMapWithIndex:bh(e),reduceRightWithIndex:_h(e),traverse:Sf(e),sequence:kB(e),traverseWithIndex:C1(e)}},Vpe=function(e){var t=WB(e);return{URI:un,map:yi,reduce:bi(e),foldMap:_i(e),reduceRight:$i(e),traverse:t.traverse,sequence:t.sequence,compact:hu,separate:mu,filter:hh,filterMap:mh,partition:vh,partitionMap:gh,wither:ii(t,$h),wilt:ri(t,$h)}},NB=function(e){var t=OB(e);return{concat:function(n,r){return t(r)(n)}}},Hpe=function(e){return{concat:NB(e).concat,empty:{}}},Jpe=function(e){var t=wB(e);return{concat:function(n,r){return t(r)(n)}}},Gpe=function(){return{concat:function(e,t){return EB(t)(e)}}},Ype={URI:un,reduce:bi(Y),foldMap:_i(Y),reduceRight:$i(Y)},Zpe={URI:un,reduce:bi(Y),foldMap:_i(Y),reduceRight:$i(Y),reduceWithIndex:yh(Y),foldMapWithIndex:bh(Y),reduceRightWithIndex:_h(Y)},x1={URI:un,map:yi,reduce:bi(Y),foldMap:_i(Y),reduceRight:$i(Y),traverse:Sf(Y),sequence:dh},Xpe={URI:un,map:yi,mapWithIndex:ph,reduce:bi(Y),foldMap:_i(Y),reduceRight:$i(Y),reduceWithIndex:yh(Y),foldMapWithIndex:bh(Y),reduceRightWithIndex:_h(Y),traverse:Sf(Y),sequence:dh,traverseWithIndex:C1(Y)},PB=ii(x1,$h),FB=ri(x1,$h),Qpe={URI:un,map:yi,reduce:bi(Y),foldMap:_i(Y),reduceRight:$i(Y),traverse:Sf(Y),sequence:dh,compact:hu,separate:mu,filter:hh,filterMap:mh,partition:vh,partitionMap:gh,wither:PB,wilt:FB},ehe={},the=bB,nhe=XU,rhe={URI:un,map:yi,reduce:bi(Y),foldMap:_i(Y),reduceRight:$i(Y),traverse:Sf(Y),sequence:dh,compact:hu,separate:mu,filter:hh,filterMap:mh,partition:vh,partitionMap:gh,mapWithIndex:ph,reduceWithIndex:yh(Y),foldMapWithIndex:bh(Y),reduceRightWithIndex:_h(Y),filterMapWithIndex:CB,filterWithIndex:xB,partitionMapWithIndex:RB,partitionWithIndex:MB,traverseWithIndex:C1(Y),wither:PB,wilt:FB};const ihe=Object.freeze(Object.defineProperty({__proto__:null,size:ipe,isEmpty:Ks,keys:ope,collect:E1,toArray:R1,toUnfoldable:ape,upsertAt:bB,has:_B,deleteAt:$B,updateAt:upe,modifyAt:SB,pop:spe,isSubrecord:cpe,lookup:TB,mapWithIndex:lpe,map:fpe,reduceWithIndex:dpe,foldMapWithIndex:ppe,reduceRightWithIndex:hpe,singleton:mpe,traverseWithIndex:vpe,traverse:M1,sequence:dh,wither:gpe,wilt:ype,partitionMapWithIndex:bpe,partitionWithIndex:_pe,filterMapWithIndex:$pe,filterWithIndex:Spe,fromFoldable:IB,toEntries:Tpe,fromEntries:Ipe,fromFoldableMap:Ope,every:wpe,some:Epe,elem:Rpe,union:OB,intersection:wB,difference:EB,filter:Mpe,filterMap:Cpe,partition:xpe,partitionMap:kpe,reduce:Ape,foldMap:Wpe,reduceRight:Npe,compact:hu,separate:mu,URI:un,getShow:Ppe,getEq:Fpe,getMonoid:Dpe,Functor:AB,flap:Lpe,FunctorWithIndex:jpe,getFoldable:Upe,getFoldableWithIndex:Bpe,Compactable:$h,Filterable:zpe,FilterableWithIndex:qpe,getTraversable:WB,getTraversableWithIndex:Kpe,getWitherable:Vpe,getUnionSemigroup:NB,getUnionMonoid:Hpe,getIntersectionSemigroup:Jpe,getDifferenceMagma:Gpe,Foldable:Ype,FoldableWithIndex:Zpe,Traversable:x1,TraversableWithIndex:Xpe,Witherable:Qpe,empty:ehe,insertAt:the,hasOwnProperty:nhe,record:rhe},Symbol.toStringTag,{value:"Module"}));var ohe=function(e){return function(t){return mt(e(t))}},ahe=function(e){return function(t){return y$(e(t))}},uhe=function(){return function(e){return!0}},she=function(e){return function(t){return!e(t)}},che=function(e){return function(t){return function(n){return t(n)||e(n)}}},lhe=function(e){return function(t){return function(n){return t(n)&&e(n)}}},fhe=function(){return function(e){return!1}},dhe=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const phe=Object.freeze(Object.defineProperty({__proto__:null,fromOptionK:ohe,fromEitherK:ahe,id:uhe,not:she,or:che,and:lhe,zero:fhe,compose:dhe},Symbol.toStringTag,{value:"Module"}));var DB=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])})}}},hhe=function(e){return function(t){return e.sub(e.zero,t)}},mhe=DB,vhe=UC;const ghe=Object.freeze(Object.defineProperty({__proto__:null,tuple:DB,negate:hhe,getTupleRing:mhe,getFunctionRing:vhe},Symbol.toStringTag,{value:"Module"})),yhe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var bhe=m$;const _he=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:bhe},Symbol.toStringTag,{value:"Module"}));var $he=aB,She=uB;function The(e){var t=Hn(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 Ihe(e){var t=Hn(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 k1(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 Ohe(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 Oe(o,i)}}function A1(e){var t=Hn(e);return function(n,r){if(r===void 0){var i=A1(e);return function(a){return i(n,a)}}if(Sh(n))return r;if(Sh(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function W1(e){var t=Hn(e);return function(n,r){if(r===void 0){var i=W1(e);return function(a){return i(a,n)}}if(Sh(n)||Sh(r))return new Set;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function whe(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,u=new Set,s=Hn(e),c=Hn(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 Oe(a,u)}}}function N1(e){var t=Hn(e);return function(n,r){if(r===void 0){var i=N1(e);return function(o){return i(o,n)}}return k1(function(o){return!t(o,r)})(n)}}var LB=function(e){return{concat:A1(e)}},Ehe=function(e){return{concat:LB(e).concat,empty:new Set}},Rhe=function(e){return{concat:W1(e)}},Mhe=function(e){return{concat:N1(e)}},Che=eB,xhe=tB,khe=nB,Ahe=function(e){return new Set([e])};function jB(e){var t=Hn(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var UB=function(e){return function(t){return function(n){return k1(function(r){return!e.equals(t,r)})(n)}}},Whe=function(e){var t=Hn(e),n=UB(e),r=jB(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},BB=function(e){return function(t){for(var n=t.length,r=new Set,i=Hn(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}},Nhe=function(e){return zB(e)(B)};function Phe(e,t){return function(n){var r=Hn(e),i=Hn(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}}),Oe(o,a)}}function zB(e){var t=Hn(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 Fhe=new Set,Sh=function(e){return e.size===0},Dhe=function(e){return e.size},Lhe=d1,qB=p1,jhe=lh,Hn=an,KB=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},Uhe=lh;const Bhe=Object.freeze(Object.defineProperty({__proto__:null,getShow:$he,getEq:She,map:The,chain:Ihe,filter:k1,partition:Ohe,union:A1,intersection:W1,partitionMap:whe,difference:N1,getUnionSemigroup:LB,getUnionMonoid:Ehe,getIntersectionSemigroup:Rhe,getDifferenceMagma:Mhe,reduce:Che,foldMap:xhe,reduceRight:khe,singleton:Ahe,insert:jB,remove:UB,toggle:Whe,fromArray:BB,compact:Nhe,separate:Phe,filterMap:zB,empty:Fhe,isEmpty:Sh,size:Dhe,some:Lhe,every:qB,isSubset:jhe,elem:Hn,toArray:KB,subset:Uhe},Symbol.toStringTag,{value:"Module"}));var VB=function(e){return{show:function(t){var n="{";for(var r in e)at.call(e,r)&&(n+=" ".concat(r,": ").concat(e[r].show(t[r]),","));return n.length>1&&(n=n.slice(0,-1)+" "),n+="}",n}}},HB=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(", "),"]")}}},zhe=HB,qhe=VB,Khe={show:function(e){return JSON.stringify(e)}},Vhe={show:function(e){return JSON.stringify(e)}},Hhe={show:function(e){return JSON.stringify(e)}};const Jhe=Object.freeze(Object.defineProperty({__proto__:null,struct:VB,tuple:HB,getTupleShow:zhe,getStructShow:qhe,showBoolean:Khe,showString:Vhe,showNumber:Hhe},Symbol.toStringTag,{value:"Module"}));function P1(e){return function(t){return function(n){return e.of([t,n])}}}function F1(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 D1(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 L1(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 j1(e){return function(t){return function(n){return e.of(t(n))}}}function U1(e){return function(t){return function(n){return e.map(t,function(r){return[r,n]})}}}function B1(e){return function(t){return function(n){return e.map(n(t),function(r){var i=r[0];return i})}}}function z1(e){return function(t){return function(n){return e.map(n(t),bn)}}}function Ghe(e){var t=D1(e),n=F1(e),r=L1(e),i=B1(e),o=z1(e);return{map:function(a,u){return m(a,n(u))},ap:function(a,u){return m(a,t(u))},of:P1(e),chain:function(a,u){return m(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:j1(e),fromM:U1(e),evalState:function(a,u){return m(a,i(u))},execState:function(a,u){return m(a,o(u))}}}const Yhe=Object.freeze(Object.defineProperty({__proto__:null,of:P1,map:F1,ap:D1,chain:L1,fromState:j1,fromF:U1,evaluate:B1,execute:z1,getStateM:Ghe},Symbol.toStringTag,{value:"Module"}));var q1=function(e){return function(){return oy(e)}},K1=P1(KO);function JB(e){return Si(kO(e))}function Zhe(e){return Si(Jj(e))}function GB(e){return Si(AO(e))}function Xhe(e){return Si(Gj(e))}function YB(e){return Si(WO(e))}function Qhe(e){return Si(Zj(e))}var eme=function(e){return X(e,xO)},tme=function(e){return function(t){return oy(e(t)[0])}},ZB=Va(function(e){return q1(e)},K1),XB=GB,Vs=YB,Th=JB,QB=j1(KO),ez=function(e){return Si(lu(e))},tz=function(e){return Si(NO(e))},nme=function(e){return Si(PO(e))},Si=U1(Ns),rme=function(e){return function(t){return X(t,Tp(e))}},nz=function(e){return function(t){return function(n){return e(n)(t)(n)}}},ime=nz,rz=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return tz(e.apply(void 0,t))}},iz=function(e){return function(t){return m(t,Ih(rz(e)))}},ome=iz,oz=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return ez(e.apply(void 0,t))}},az=function(e){return function(t){return m(t,Ih(oz(e)))}},ame=az,uz=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Si(e.apply(void 0,t))}},sz=function(e){return function(t){return m(t,Ih(uz(e)))}},ume=sz,Ti=function(e,t){return m(e,cz(t))},ra=function(e,t){return m(e,H1(t))},Hs=function(e,t){return m(e,J1(t))},V1=function(e,t){return function(n){return m(e(n),cy(function(){return t()(n)}))}},xy=function(e,t,n){return function(r){return m(e(r),BO(t,function(i){var o=i[0],a=i[1];return[n(o),a]}))}},ky=function(e,t){return function(n){return m(e(n),zO(t))}},cz=F1(Ns),sme=function(e,t){return function(n){return xy(n,e,t)}},cme=function(e){return function(t){return ky(t,e)}},H1=D1(Rn),lme=H1,no=K1,J1=L1(Rn),Ih=J1,lz=Ih(B),fme=lz,fz=function(e){return function(t){return function(n){return m(t(n),pU(function(){return e()(n)}))}}},dme=fz,Ay=q1,Nt="StateReaderTaskEither",G1={URI:Nt,map:Ti},pme=De(G1),hme={URI:Nt,of:no},Wy={URI:Nt,map:Ti,ap:ra},dz=St(Wy),mme=dz,pz=Tt(Wy),vme=pz,gme={URI:Nt,map:Ti,ap:ra,of:no},Jn={URI:Nt,map:Ti,ap:ra,chain:Hs},Js={URI:Nt,fromState:QB},yme=uF(Js),bme=sF(Js),_me=cF(Js),$me=lF(Js),Sme=jT(Js),Tme=fF(Js,Jn),Ime={URI:Nt,map:Ti,ap:ra,of:no,chain:Hs},Ome={URI:Nt,map:Ti,ap:ra,of:no,chain:Hs,fromIO:Vs},wme={URI:Nt,map:Ti,ap:ra,of:no,chain:Hs,fromIO:Vs,fromTask:Th},Eme={URI:Nt,map:Ti,ap:ra,of:no,chain:Hs,throwError:Ay},hz=ut(Jn),Rme=hz,Mme={URI:Nt,bimap:xy,mapLeft:ky},Cme={URI:Nt,map:Ti,alt:V1},Tf={URI:Nt,fromReader:XB},xme=wp(Tf),kme=Ep(Tf),Ame=Os(Tf),mz=Rp(Tf,Jn),Wme=mz,vz=Mp(Tf,Jn),Nme=vz,ia={URI:Nt,fromEither:ZB},Pme=Li(ia),Fme=ji(ia),Dme=ns(ia,Jn),gz=Io(ia,Jn),Lme=gz,yz=Oo(ia,Jn),jme=yz,Ume=za(ia),bz=rs(ia,Jn),Bme=bz,zme=sr(ia),Ny={URI:Nt,fromIO:Vs},qme=Hi(Ny),Kme=No(Ny,Jn),Vme=Po(Ny,Jn),Py={URI:Nt,fromIO:Vs,fromTask:Th},Hme=ws(Py),Jme=Bl(Py,Jn),Gme=zl(Py,Jn),Yme=B1(Ns),Zme=z1(Ns),Xme=Ot(G1),_z=wt(Jn),Qme=_z,$z=It(Wy),eve=$z,Sz=function(e){return function(t){return function(n){return function(r){return function(){return Gc(t).reduce(function(i,o,a){return i.then(function(u){return Lt(u)?i:e(a+1,o)(u.right[1])(r)().then(function(s){if(Lt(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,ur(t))(n)(r)().then(us(function(i){var o=i[0],a=i[1];return[[o],a]})))}}}}},Y1=function(e){var t=Sz(e);return function(n){return dt(n)?t(n):no(Yt)}},tve=Y1,Tz=function(e){return Y1(function(t,n){return e(n)})},nve=Tz(B),rve={URI:Nt,map:Ti,of:no,ap:ra,chain:Hs,bimap:xy,mapLeft:ky,alt:V1,fromIO:Vs,fromTask:Th,throwError:Ay},ive={URI:Nt,map:Ti,of:no,ap:ra,chain:Hs,bimap:xy,mapLeft:ky,alt:V1,fromIO:Vs,fromTask:Th,throwError:Ay},ove=function(e,t){return m(e(t),Qp(function(n){var r=n[0];return r}))},ave=function(e,t){return m(e(t),Qp(function(n){n[0];var r=n[1];return r}))};function uve(e,t,n){return e(t)(n)()}const sve=Object.freeze(Object.defineProperty({__proto__:null,left:q1,right:K1,rightTask:JB,leftTask:Zhe,rightReader:GB,leftReader:Xhe,rightIO:YB,leftIO:Qhe,rightState:eme,leftState:tme,fromEither:ZB,fromReader:XB,fromIO:Vs,fromTask:Th,fromState:QB,fromTaskEither:ez,fromIOEither:tz,fromReaderEither:nme,fromReaderTaskEither:Si,local:rme,asksStateReaderTaskEitherW:nz,asksStateReaderTaskEither:ime,fromIOEitherK:rz,chainIOEitherKW:iz,chainIOEitherK:ome,fromTaskEitherK:oz,chainTaskEitherKW:az,chainTaskEitherK:ame,fromReaderTaskEitherK:uz,chainReaderTaskEitherKW:sz,chainReaderTaskEitherK:ume,map:cz,bimap:sme,mapLeft:cme,ap:H1,apW:lme,of:no,chain:J1,chainW:Ih,flattenW:lz,flatten:fme,altW:fz,alt:dme,throwError:Ay,URI:Nt,Functor:G1,flap:pme,Pointed:hme,Apply:Wy,apFirst:dz,apFirstW:mme,apSecond:pz,apSecondW:vme,Applicative:gme,Chain:Jn,FromState:Js,get:yme,put:bme,modify:_me,gets:$me,fromStateK:Sme,chainStateK:Tme,Monad:Ime,MonadIO:Ome,MonadTask:wme,MonadThrow:Eme,chainFirst:hz,chainFirstW:Rme,Bifunctor:Mme,Alt:Cme,FromReader:Tf,ask:xme,asks:kme,fromReaderK:Ame,chainReaderK:mz,chainReaderKW:Wme,chainFirstReaderK:vz,chainFirstReaderKW:Nme,FromEither:ia,fromOption:Pme,fromOptionK:Fme,chainOptionK:Dme,chainEitherK:gz,chainEitherKW:Lme,chainFirstEitherK:yz,chainFirstEitherKW:jme,fromPredicate:Ume,filterOrElse:bz,filterOrElseW:Bme,fromEitherK:zme,FromIO:Ny,fromIOK:qme,chainIOK:Kme,chainFirstIOK:Vme,FromTask:Py,fromTaskK:Hme,chainTaskK:Jme,chainFirstTaskK:Gme,evaluate:Yme,execute:Zme,bindTo:Xme,bind:_z,bindW:Qme,apS:$z,apSW:eve,traverseReadonlyNonEmptyArrayWithIndex:Sz,traverseReadonlyArrayWithIndex:Y1,traverseArrayWithIndex:tve,traverseArray:Tz,sequenceArray:nve,stateReaderTaskEither:rve,stateReaderTaskEitherSeq:ive,evalState:ove,execState:ave,run:uve},Symbol.toStringTag,{value:"Module"}));function cve(e){return function(t){return{peek:t.peek,pos:e}}}function lve(e){return function(t){return{peek:t.peek,pos:e(t.pos)}}}function fve(e){return function(t){return t.peek(e(t.pos))}}function dve(e){return function(t){return function(n){return e.map(t(n.pos),function(r){return n.peek(r)})}}}var Iz=function(e,t){return m(e,wz(t))},pve=function(e,t){return m(e,Z1(t))},Z1=function(e){return function(t){return{peek:function(n){return e({peek:t.peek,pos:n})},pos:t.pos}}},Oz=function(e){return e.peek(e.pos)},hve=Z1(B),wz=function(e){return function(t){return{peek:function(n){return e(t.peek(n))},pos:t.pos}}},X1="Store",Ez={URI:X1,map:Iz},mve=De(Ez),Rz={URI:X1,map:Iz,extend:pve,extract:Oz},vve=Rz;const gve=Object.freeze(Object.defineProperty({__proto__:null,seek:cve,seeks:lve,peeks:fve,experiment:dve,extend:Z1,extract:Oz,duplicate:hve,map:wz,URI:X1,Functor:Ez,flap:mve,Comonad:Rz,store:vve},Symbol.toStringTag,{value:"Module"}));function Q1(e,t){return function(n,r){return t.compose(e.second(r),e.first(n))}}function Mz(e,t){var n=Q1(e,t);return function(r,i){return t.compose(n(r,i),e.promap(t.id(),B,function(o){return[o,o]}))}}function yve(e){return Q1(e,e)}function bve(e){return Mz(e,e)}const _ve=Object.freeze(Object.defineProperty({__proto__:null,split:Q1,fanOut:Mz,splitStrong:yve,fanout:bve},Symbol.toStringTag,{value:"Module"}));var $ve=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},Sve=function(e){return function(t){var n={};for(var r in t)at.call(t,r)&&(n[r]=e[r](t[r]));return n}};const Tve=Object.freeze(Object.defineProperty({__proto__:null,getAssignSemigroup:$ve,evolve:Sve},Symbol.toStringTag,{value:"Module"}));var Ive=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())})},Ove=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}}},Cz=Wp(en),wve=pI(en),Eve=gn,xz=hI(en),Oh=function(e){return Fy(wn(e))},Fy=$g(Pe),Rve=au(Ml),kz=mI(Pe),Mve=kz,ew=Og(af),Cve=ew,Az=ew,xve=Az,Wz=wg(zt),kve=Wz,Ave=Sg(en),Nz=function(e){return function(){return Ive(void 0,void 0,void 0,function(){return Ove(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e().then(le)];case 1:return[2,t.sent()];case 2:return t.sent(),[2,me];case 3:return[2]}})})}},Wve=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Nz(function(){return e.apply(void 0,t)})}},Nve=Tg(en),Pve=fI(zt),Fve=Ig(en),Dve=dI(zt),tw=Eg(Pe),Pz=Rg(ks),ro=Cz,Dy=Jl(zt),Lve=Dy(B),nw=Mg(zt),jve=nw,Ly=Np(en),Uve=Ly(),rw=Vi(Pe,gs),iw=ko(Pe,gs,Ol),Fz=Ao(Pe,Mo),Dz=Wo(Pe,Mo),Lz=tu(Pe,Mo),jz=nu(Pe,Mo),Ur=function(e,t){return m(e,tw(t))},Gs=function(e,t){return m(e,Pz(t))},jy=function(e,t){return m(e,Dy(t))},Uz=function(e,t){return m(e,nw(t))},Bve=function(e,t){return m(e,Fz(t))},zve=function(e,t){return m(e,Dz(t))},qve=function(e,t){return m(e,Lz(t))},Kve=function(e,t){return m(e,jz(t))},Kt="TaskOption",ow={URI:Kt,map:Ur},Vve=De(ow),Bz={URI:Kt,of:ro},Uy={URI:Kt,map:Ur,ap:Gs},Hve=St(Uy),Jve=Tt(Uy),Gve={URI:Kt,map:Ur,ap:Gs,of:ro},zz=function(e,t){return m(e,Dy(function(n){return m(t,tw(n))}))},Yve={URI:Kt,map:Ur,ap:zz},Zve={URI:Kt,map:Ur,ap:zz,of:ro},oa={URI:Kt,map:Ur,ap:Gs,chain:jy},Xve=ut(oa),Qve={URI:Kt,map:Ur,alt:Uz},qz={URI:Kt,zero:Ly},ege=pl(qz,Bz),tge={URI:Kt,map:Ur,ap:Gs,of:ro,alt:Uz,zero:Ly},nge={URI:Kt,map:Ur,ap:Gs,of:ro,chain:jy},rge={URI:Kt,map:Ur,ap:Gs,of:ro,chain:jy,fromIO:Oh},ige={URI:Kt,map:Ur,ap:Gs,of:ro,chain:jy,fromIO:Oh,fromTask:Fy},oge={URI:Kt,compact:rw,separate:iw},age={URI:Kt,map:Ur,compact:rw,separate:iw,filter:Bve,filterMap:zve,partition:qve,partitionMap:Kve},By={URI:Kt,fromIO:Oh},uge=Hi(By),sge=No(By,oa),cge=Po(By,oa),zy={URI:Kt,fromEither:xz},lge=sr(zy),fge=Io(zy,oa),dge=Oo(zy,oa),qy={URI:Kt,fromIO:Oh,fromTask:Fy},pge=ws(qy),hge=Bl(qy,oa),mge=zl(qy,oa),vge=ro(jt),gge=Ot(ow),yge=wt(oa),bge=It(Uy),aw=ro(Yt),Kz=function(e){return X(uf(e),au(ug(Ln)))},uw=function(e){var t=Kz(e);return function(n){return dt(n)?t(n):aw}},Vz=function(e){return function(t){return function(){return Gc(t).reduce(function(n,r,i){return n.then(function(o){return Ct(o)?n:e(i+1,r)().then(function(a){return Ct(a)?a:(o.value.push(a.value),o)})})},e(0,ur(t))().then(Ki(Rd)))}}},sw=function(e){var t=Vz(e);return function(n){return dt(n)?t(n):aw}},_ge=uw,Hz=function(e){return uw(function(t,n){return e(n)})},$ge=Hz(B),Sge=sw,Jz=function(e){return sw(function(t,n){return e(n)})},Tge=Jz(B);const Ige=Object.freeze(Object.defineProperty({__proto__:null,some:Cz,fromPredicate:wve,fromOption:Eve,fromEither:xz,fromIO:Oh,fromTask:Fy,fromTaskEither:Rve,match:kz,matchW:Mve,matchE:ew,fold:Cve,matchEW:Az,foldW:xve,getOrElse:Wz,getOrElseW:kve,fromNullable:Ave,tryCatch:Nz,tryCatchK:Wve,fromNullableK:Nve,chainNullableK:Pve,fromOptionK:Fve,chainOptionK:Dve,map:tw,ap:Pz,of:ro,chain:Dy,flatten:Lve,alt:nw,altW:jve,zero:Ly,none:Uve,compact:rw,separate:iw,filter:Fz,filterMap:Dz,partition:Lz,partitionMap:jz,Functor:ow,flap:Vve,Pointed:Bz,ApplyPar:Uy,apFirst:Hve,apSecond:Jve,ApplicativePar:Gve,ApplySeq:Yve,ApplicativeSeq:Zve,Chain:oa,chainFirst:Xve,Alt:Qve,Zero:qz,guard:ege,Alternative:tge,Monad:nge,MonadIO:rge,MonadTask:ige,Compactable:oge,Filterable:age,FromIO:By,fromIOK:uge,chainIOK:sge,chainFirstIOK:cge,FromEither:zy,fromEitherK:lge,chainEitherK:fge,chainFirstEitherK:dge,FromTask:qy,fromTaskK:pge,chainTaskK:hge,chainFirstTaskK:mge,Do:vge,bindTo:gge,bind:yge,apS:bge,ApT:aw,traverseReadonlyNonEmptyArrayWithIndex:Kz,traverseReadonlyArrayWithIndex:uw,traverseReadonlyNonEmptyArrayWithIndexSeq:Vz,traverseReadonlyArrayWithIndexSeq:sw,traverseArrayWithIndex:_ge,traverseArray:Hz,sequenceArray:$ge,traverseSeqArrayWithIndex:Sge,traverseSeqArray:Jz,sequenceSeqArray:Tge},Symbol.toStringTag,{value:"Module"}));var Ve=function(e){return e._tag==="Left"},Rt=function(e){return e._tag==="Right"};function Ys(e){return e._tag==="Both"}function sn(e){return{_tag:"Left",left:e}}function Gn(e){return{_tag:"Right",right:e}}function Qe(e,t){return{_tag:"Both",left:e,right:t}}var cw=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)}}},Oge=cw,vu=cw,wge=vu,Gz=vu(Gn,sn,function(e,t){return Qe(t,e)});function Ege(e,t){return{show:vu(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 Rge(e,t){return Wr(function(n,r){return Ve(n)?Ve(r)&&e.equals(n.left,r.left):Rt(n)?Rt(r)&&t.equals(n.right,r.right):Ys(r)&&e.equals(n.left,r.left)&&t.equals(n.right,r.right)})}function Yz(e,t){return{concat:function(n,r){return Ve(n)?Ve(r)?sn(e.concat(n.left,r.left)):Rt(r)?Qe(n.left,r.right):Qe(e.concat(n.left,r.left),r.right):Rt(n)?Ve(r)?Qe(r.left,n.right):Rt(r)?Gn(t.concat(n.right,r.right)):Qe(r.left,t.concat(n.right,r.right)):Ve(r)?Qe(e.concat(n.left,r.left),n.right):Rt(r)?Qe(n.left,t.concat(n.right,r.right)):Qe(e.concat(n.left,r.left),t.concat(n.right,r.right))}}}var Ky=function(e){return{URI:vr,_E:void 0,map:Zs,ap:function(t,n){return Ve(t)?Ve(n)?sn(e.concat(t.left,n.left)):Rt(n)?sn(t.left):sn(e.concat(t.left,n.left)):Rt(t)?Ve(n)?sn(n.left):Rt(n)?Gn(t.right(n.right)):Qe(n.left,t.right(n.right)):Ve(n)?sn(e.concat(t.left,n.left)):Rt(n)?Qe(t.left,t.right(n.right)):Qe(e.concat(t.left,n.left),t.right(n.right))}}};function Mge(e){var t=Ky(e);return{URI:vr,_E:void 0,map:Zs,ap:t.ap,of:wh}}function Zz(e){var t=Ky(e),n=function(r,i){if(Ve(r))return r;if(Rt(r))return i(r.right);var o=i(r.right);return Ve(o)?sn(e.concat(r.left,o.left)):Rt(o)?Qe(r.left,o.right):Qe(e.concat(r.left,o.left),o.right)};return{URI:vr,_E:void 0,map:Zs,ap:t.ap,chain:n}}function Cge(e){var t=Zz(e);return{URI:vr,_E:void 0,map:Zs,of:wh,ap:t.ap,chain:t.chain,throwError:sn}}function xge(e){return Ve(e)?le(e.left):Rt(e)?me:le(e.left)}function kge(e){return Ve(e)?me:(Rt(e),le(e.right))}function Age(e){return function(t){return Ct(t)?sn(e):Qe(e,t.value)}}function Wge(e){return function(t){return Ct(t)?Gn(e):Qe(t.value,e)}}function Nge(e){return Ve(e)?le(e.left):me}function Pge(e){return Rt(e)?le(e.right):me}var Fge=function(e,t){return Ct(e)?Ct(t)?me:le(Gn(t.value)):Ct(t)?le(sn(e.value)):le(Qe(e.value,t.value))},Zs=function(e,t){return m(e,mw(t))},Xz=function(e,t,n){return m(e,pw(t,n))},Qz=function(e,t){return m(e,hw(t))},lw=function(e,t,n){return m(e,t2(t,n))},fw=function(e){var t=n2(e);return function(n,r){return m(n,t(r))}},dw=function(e,t,n){return m(e,r2(t,n))},e2=function(e){var t=i2(e);return function(n,r){return m(n,t(r))}},pw=function(e,t){return function(n){return Ve(n)?sn(e(n.left)):Rt(n)?Gn(t(n.right)):Qe(e(n.left),t(n.right))}},hw=function(e){return function(t){return Ve(t)?sn(e(t.left)):Ys(t)?Qe(e(t.left),t.right):t}},mw=function(e){return function(t){return Ve(t)?t:Rt(t)?Gn(e(t.right)):Qe(t.left,e(t.right))}},t2=function(e,t){return function(n){return Ve(n)?e:t(e,n.right)}},n2=function(e){return function(t){return function(n){return Ve(n)?e.empty:t(n.right)}}},r2=function(e,t){return function(n){return Ve(n)?e:t(n.right,e)}},i2=function(e){return function(t){return function(n){return Ve(n)?e.of(n):Rt(n)?e.map(t(n.right),Gn):e.map(t(n.right),function(r){return Qe(n.left,r)})}}},vw=function(e){return function(t){return Ve(t)?e.of(t):Rt(t)?e.map(t.right,Gn):e.map(t.right,function(n){return Qe(t.left,n)})}},wh=Gn,vr="These",gw={URI:vr,map:Zs},Dge=De(gw),Lge={URI:vr,of:wh},jge={URI:vr,bimap:Xz,mapLeft:Qz},Uge={URI:vr,fromThese:B},Bge={URI:vr,reduce:lw,foldMap:fw,reduceRight:dw},zge={URI:vr,map:Zs,reduce:lw,foldMap:fw,reduceRight:dw,traverse:e2,sequence:vw},yw={URI:vr,fromEither:B},qge=Li(yw),Kge=ji(yw),Vge=function(e){return function(t){return function(n){return Ve(n)?!1:e.equals(t,n.right)}}},Hge=function(e){return function(t){return Ve(t)?!1:e(t.right)}},bw=function(e,t){return function(n){return Ve(n)?[n.left,t()]:Rt(n)?[e(),n.right]:[n.left,n.right]}},Jge=function(e,t){return bw(function(){return e},function(){return t})},o2=wh(Yt),_w=function(e){return function(t){return function(n){var r=me,i=t(0,ur(n));if(Ve(i))return i;Ys(i)&&(r=le(i.left));for(var o=[i.right],a=1;a<n.length;a++){var u=t(a,n[a]);if(Ve(u))return u;Ys(u)&&(r=Ct(r)?le(u.left):le(e.concat(r.value,u.left))),o.push(u.right)}return Ct(r)?Gn(o):Qe(r.value,o)}}},Gge=function(e){return function(t){var n=_w(e)(t);return function(r){return dt(r)?n(r):o2}}},Yge={URI:vr,map:Zs,bimap:Xz,mapLeft:Qz,reduce:lw,foldMap:fw,reduceRight:dw,traverse:e2,sequence:vw};const Zge=Object.freeze(Object.defineProperty({__proto__:null,isLeft:Ve,isRight:Rt,isBoth:Ys,left:sn,right:Gn,both:Qe,matchW:cw,foldW:Oge,match:vu,fold:wge,swap:Gz,getShow:Ege,getEq:Rge,getSemigroup:Yz,getApply:Ky,getApplicative:Mge,getChain:Zz,getMonad:Cge,getLeft:xge,getRight:kge,leftOrBoth:Age,rightOrBoth:Wge,getLeftOnly:Nge,getRightOnly:Pge,fromOptions:Fge,bimap:pw,mapLeft:hw,map:mw,reduce:t2,foldMap:n2,reduceRight:r2,traverse:i2,sequence:vw,of:wh,URI:vr,Functor:gw,flap:Dge,Pointed:Lge,Bifunctor:jge,FromThese:Uge,Foldable:Bge,Traversable:zge,FromEither:yw,fromOption:qge,fromOptionK:Kge,elem:Vge,exists:Hge,toTuple2:bw,toTuple:Jge,ApT:o2,traverseReadonlyNonEmptyArrayWithIndex:_w,traverseReadonlyArrayWithIndex:Gge,these:Yge},Symbol.toStringTag,{value:"Module"}));function Vy(e){return X(Gn,e.of)}function Hy(e){return X(sn,e.of)}function $w(e){return X(Qe,e.of)}function Sw(e){return function(t){return e.map(t,Gn)}}function Tw(e){return function(t){return e.map(t,sn)}}function Iw(e){return Yc(e,gw)}function Ow(e,t){return To(e,Ky(t))}function ww(e,t){var n=Hy(e);return function(r){return function(i){return e.chain(i,vu(n,r,function(o,a){return e.map(r(a),vu(function(u){return sn(t.concat(o,u))},function(u){return Qe(o,u)},function(u,s){return Qe(t.concat(o,u),s)}))}))}}}function Ew(e){return function(t,n){return function(r){return e.map(r,pw(t,n))}}}function Rw(e){return function(t){return function(n){return e.map(n,hw(t))}}}function a2(e){return function(t,n,r){return function(i){return e.map(i,vu(t,n,r))}}}function Mw(e){return function(t,n,r){return function(i){return e.chain(i,vu(t,n,r))}}}function Cw(e){return function(t){return e.map(t,Gz)}}function xw(e){return function(t,n){return function(r){return e.map(r,bw(t,n))}}}function Xge(e){var t=Iw(e),n=Ew(e),r=Rw(e),i=Mw(e),o=xw(e),a=Vy(e),u=function(s,c){return m(s,t(c))};return{map:u,bimap:function(s,c,l){return m(s,n(c,l))},mapLeft:function(s,c){return m(s,r(c))},fold:function(s,c,l,f){return m(s,i(c,l,f))},swap:Cw(e),rightM:Sw(e),leftM:Tw(e),left:Hy(e),right:Vy(e),both:$w(e),toTuple:function(s,c,l){return m(s,o(function(){return c},function(){return l}))},getMonad:function(s){var c=Ow(e,s),l=ww(e,s);return{_E:void 0,map:u,of:a,ap:function(f,d){return m(f,c(d))},chain:function(f,d){return m(f,l(d))}}}}}const Qge=Object.freeze(Object.defineProperty({__proto__:null,right:Vy,left:Hy,both:$w,rightF:Sw,leftF:Tw,map:Iw,ap:Ow,chain:ww,bimap:Ew,mapLeft:Rw,match:a2,matchE:Mw,swap:Cw,toTuple2:xw,getTheseM:Xge},Symbol.toStringTag,{value:"Module"}));var eye=Hy(en),u2=Vy(en),tye=$w(en),kw=Sw(Pe),s2=Tw(Pe),c2=X(wn,kw),nye=X(wn,s2),l2=gn,f2=gn,Jy=c2,rye=wn,Aw=kw,d2=a2(Pe),iye=d2,p2=Mw(zt),h2=p2,m2=h2,oye=m2,aye=Cw(Pe),Xs=function(e,t){return m(e,v2(t))},Ww=function(e,t,n){return m(e,g2(t,n))},Nw=function(e,t){return m(e,y2(t))},v2=Iw(Pe),g2=Ew(Pe),y2=Rw(Pe),Eh=u2,Mn="TaskThese",Pw=function(e,t){var n=Ow(e,t);return{URI:Mn,_E:void 0,map:Xs,ap:function(r,i){return m(r,n(i))}}};function b2(e,t){var n=Pw(e,t).ap;return{URI:Mn,_E:void 0,map:Xs,ap:n,of:Eh}}function _2(e){var t=Pw(Vp,e),n=ww(zt,e);return{URI:Mn,_E:void 0,map:Xs,ap:t.ap,chain:function(r,i){return m(r,n(i))}}}function uye(e){var t=b2(Vp,e),n=_2(e);return{URI:Mn,_E:void 0,map:Xs,ap:t.ap,of:Eh,chain:n.chain,fromIO:Jy,fromTask:Aw}}var $2={URI:Mn,map:Xs},sye=De($2),cye={URI:Mn,of:Eh},lye={URI:Mn,bimap:Ww,mapLeft:Nw},Gy={URI:Mn,fromEither:l2},fye=Li(Gy),dye=ji(Gy),pye=za(Gy),S2={URI:Mn,fromThese:f2},hye=dF(S2),T2={URI:Mn,fromIO:Jy},mye=Hi(T2),I2={URI:Mn,fromIO:Jy,fromTask:Aw},vye=ws(I2),O2=xw(Pe),Fw=Eh(Yt),w2=function(e){var t=_w(e);return function(n){return X(uf(n),au(t(Ln)))}},gye=function(e){return function(t){var n=w2(e)(t);return function(r){return dt(r)?n(r):Fw}}},E2=function(e){return function(t){return function(n){return function(){return Gc(n).reduce(function(r,i,o){return r.then(function(a){return Ve(a)?r:t(o+1,i)().then(function(u){if(Ve(u))return u;if(Ys(u)){var s=a.right;return s.push(u.right),Ys(a)?Qe(e.concat(a.left,u.left),s):Qe(u.left,s)}return a.right.push(u.right),a})})},t(0,ur(n))().then(mw(Rd)))}}}},yye=function(e){return function(t){var n=E2(e)(t);return function(r){return dt(r)?n(r):Fw}}},bye={URI:Mn,map:Xs},_ye={URI:Mn,bimap:Ww,mapLeft:Nw},$ye=function(e,t){return O2(function(){return e},function(){return t})},Sye={URI:Mn,map:Xs,bimap:Ww,mapLeft:Nw},Tye=function(e,t){return Ut(Hg)(Yz(e,t))};const Iye=Object.freeze(Object.defineProperty({__proto__:null,left:eye,right:u2,both:tye,rightTask:kw,leftTask:s2,rightIO:c2,leftIO:nye,fromEither:l2,fromThese:f2,fromIO:Jy,fromIOEither:rye,fromTask:Aw,match:d2,matchW:iye,matchE:p2,fold:h2,matchEW:m2,foldW:oye,swap:aye,map:v2,bimap:g2,mapLeft:y2,of:Eh,URI:Mn,getApply:Pw,getApplicative:b2,getChain:_2,getMonad:uye,Functor:$2,flap:sye,Pointed:cye,Bifunctor:lye,FromEither:Gy,fromOption:fye,fromOptionK:dye,fromPredicate:pye,FromThese:S2,fromTheseK:hye,FromIO:T2,fromIOK:mye,FromTask:I2,fromTaskK:vye,toTuple2:O2,ApT:Fw,traverseReadonlyNonEmptyArrayWithIndex:w2,traverseReadonlyArrayWithIndex:gye,traverseReadonlyNonEmptyArrayWithIndexSeq:E2,traverseReadonlyArrayWithIndexSeq:yye,functorTaskThese:bye,bifunctorTaskThese:_ye,toTuple:$ye,taskThese:Sye,getSemigroup:Tye},Symbol.toStringTag,{value:"Module"}));function Oye(e,t){return function(n){return n(t(n(e.empty)))}}function wye(e){return function(t){return[e(t),t]}}function Eye(e){return function(t){return function(n){return[t(n),e(n)]}}}function Rye(e){return function(t){return function(n){return t(e(n))}}}function Mye(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:Dw,_E:void 0,map:R2,extend:t,extract:n}}var R2=function(e,t){return m(e,M2(t))},M2=function(e){return function(t){return function(n){return e(t(n))}}},Dw="Traced",Lw={URI:Dw,map:R2},Cye=De(Lw),xye=Lw;const kye=Object.freeze(Object.defineProperty({__proto__:null,tracks:Oye,listen:wye,listens:Eye,censor:Rye,getComonad:Mye,map:M2,URI:Dw,Functor:Lw,flap:Cye,traced:xye},Symbol.toStringTag,{value:"Module"}));function C2(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 x2(e,t){return function(n){var r=e.sequence(n),i=t.sequence(n);return function(o){return r(e.map(o,i))}}}function Aye(e,t){var n=Zc(e,t).map,r=OT(e,t),i=C2(e,t),o=x2(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 m(s,u(c))}},sequence:function(a){var u=o(a);return function(s){return m(s,u)}}}}const Wye=Object.freeze(Object.defineProperty({__proto__:null,traverse:C2,sequence:x2,getTraversableComposition:Aye},Symbol.toStringTag,{value:"Module"})),Nye=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function k2(e,t){return t===void 0&&(t=[]),{value:e,forest:t}}function Pye(e){var t=function(n){return Xa(n.forest)?"make(".concat(e.show(n.value),")"):"make(".concat(e.show(n.value),", [").concat(n.forest.map(t).join(", "),"])")};return{show:t}}function Fye(e){var t,n=Wr(function(r,i){return e.equals(r.value,i.value)&&t.equals(r.forest,i.forest)});return t=gN(n),n}var A2=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?"\u2514":"\u251C")+"\u2500 "+i.value,n+=A2(e+(r>1&&!a?"\u2502 ":" "),i.forest)}return n};function W2(e){return A2(`
|
|
2
|
-
`,e)}function Dye(e){return e.value+W2(e.forest)}function N2(e,t){var n=t(e),r=n[0],i=n[1];return{value:r,forest:P2(i,t)}}function P2(e,t){return e.map(function(n){return N2(n,t)})}function F2(e){var t=D2(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 D2(e){var t=Gv(e);return function(n,r){return m(n,t(function(i){return F2(e)(i,r)}))}}function Lye(e){var t=function(n){return e(n.value,n.forest.map(t))};return t}var gu=function(e,t){return m(e,Zy(t))},If=function(e,t){return m(e,Rh(function(n){return m(t,Zy(n))}))},jw=function(e,t){return m(e,Rh(t))},Uw=function(e,t,n){return m(e,Xy(t,n))},Bw=function(e){var t=U2(e);return function(n,r){return m(n,t(r))}},zw=function(e,t,n){return m(e,qw(t,n))},L2=function(e,t){return m(e,Yy(t))},j2=function(e){var t=Vw(e);return function(n,r){return m(n,t(r))}},jye=function(e){return function(t){return If(t,e)}},Rh=function(e){return function(t){var n=e(t.value),r=n.value,i=n.forest,o=Q0().concat;return{value:r,forest:o(i,t.forest.map(Rh(e)))}}},Yy=function(e){return function(t){return{value:e(t),forest:t.forest.map(Yy(e))}}},Uye=Yy(B),Bye=Rh(B),Zy=function(e){return function(t){return{value:e(t.value),forest:t.forest.map(Zy(e))}}},Xy=function(e,t){return function(n){for(var r=t(e,n.value),i=n.forest.length,o=0;o<i;o++)r=m(n.forest[o],Xy(r,t));return r}},U2=function(e){return function(t){return Xy(e.empty,function(n,r){return e.concat(n,t(r))})}},qw=function(e,t){return function(n){for(var r=e,i=n.forest.length,o=i-1;o>=0;o--)r=m(n.forest[o],qw(r,t));return t(n.value,r)}},Kw=function(e){return e.value},Vw=function(e){var t=Gv(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}}}),m(i.forest,t(n(r))))}};return n},Hw=function(e){return Vw(e)(B)},Of=function(e){return k2(e)},Ii="Tree",Jw={URI:Ii,map:gu},zye=De(Jw),qye={URI:Ii,of:Of},Qy={URI:Ii,map:gu,ap:If},Kye=St(Qy),Vye=Tt(Qy),Hye={URI:Ii,map:gu,ap:If,of:Of},Gw={URI:Ii,map:gu,ap:If,chain:jw},Jye={URI:Ii,map:gu,ap:If,of:Of,chain:jw},Gye=ut(Gw),Yye={URI:Ii,reduce:Uw,foldMap:Bw,reduceRight:zw},Zye={URI:Ii,map:gu,reduce:Uw,foldMap:Bw,reduceRight:zw,traverse:j2,sequence:Hw},Xye={URI:Ii,map:gu,extend:L2,extract:Kw},Qye=Of(jt),ebe=Ot(Jw),tbe=wt(Gw),nbe=It(Qy);function rbe(e){var t=function(n,r){return e.equals(n,r.value)||r.forest.some(function(i){return t(n,i)})};return t}var B2=function(e){return function(t){return e(t.value)||t.forest.some(B2(e))}},ibe={URI:Ii,map:gu,of:Of,ap:If,chain:jw,reduce:Uw,foldMap:Bw,reduceRight:zw,traverse:j2,sequence:Hw,extract:Kw,extend:L2};const obe=Object.freeze(Object.defineProperty({__proto__:null,make:k2,getShow:Pye,getEq:Fye,drawForest:W2,drawTree:Dye,unfoldTree:N2,unfoldForest:P2,unfoldTreeM:F2,unfoldForestM:D2,fold:Lye,ap:jye,chain:Rh,extend:Yy,duplicate:Uye,flatten:Bye,map:Zy,reduce:Xy,foldMap:U2,reduceRight:qw,extract:Kw,traverse:Vw,sequence:Hw,of:Of,URI:Ii,Functor:Jw,flap:zye,Pointed:qye,Apply:Qy,apFirst:Kye,apSecond:Vye,Applicative:Hye,Chain:Gw,Monad:Jye,chainFirst:Gye,Foldable:Yye,Traversable:Zye,Comonad:Xye,Do:Qye,bindTo:ebe,bind:tbe,apS:nbe,elem:rbe,exists:B2,tree:ibe},Symbol.toStringTag,{value:"Module"}));var gr=qt,Yn=bn,abe=function(e){return[Yn(e),gr(e)]};function Yw(e){return{URI:yr,_E:void 0,map:Mh,ap:function(t,n){return[gr(t)(gr(n)),e.concat(Yn(t),Yn(n))]}}}var z2=function(e){return function(t){return[t,e.empty]}};function ube(e){var t=Yw(e);return{URI:yr,_E:void 0,map:t.map,ap:t.ap,of:z2(e)}}function Zw(e){var t=Yw(e);return{URI:yr,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(gr(n)),o=i[0],a=i[1];return[o,e.concat(Yn(n),a)]}}}function sbe(e){var t=Zw(e);return{URI:yr,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:z2(e)}}function cbe(e){var t=function(r,i){for(var o=i(r),a=e.empty,u=gr(o);u._tag==="Left";)a=e.concat(a,Yn(o)),o=i(u.left),u=gr(o);return[u.right,e.concat(a,Yn(o))]},n=Zw(e);return{URI:yr,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var q2=function(e,t){return m(e,Y2(t))},Mh=function(e,t){return m(e,tE(t))},K2=function(e,t,n){return m(e,G2(t,n))},V2=function(e,t){return m(e,nE(t))},H2=function(e,t){return m(e,rE(t))},Xw=function(e,t,n){return m(e,X2(t,n))},Qw=function(e){var t=Z2();return function(n,r){return m(n,t(r))}},eE=function(e,t,n){return m(e,Q2(t,n))};function J2(e){var t=eq(e);return function(n,r){return m(n,t(r))}}var G2=function(e,t){return function(n){return[t(gr(n)),e(Yn(n))]}},tE=function(e){return function(t){return[e(gr(t)),Yn(t)]}},nE=function(e){return function(t){return[gr(t),e(Yn(t))]}},Y2=function(e){return function(t){return[gr(t),Yn(e)]}},rE=function(e){return function(t){return[e(t),Yn(t)]}},lbe=rE(B),iE=Cy,Z2=T1,X2=S1,Q2=I1,eq=function(e){return function(t){return function(n){return e.map(t(gr(n)),function(r){return[r,Yn(n)]})}}},oE=function(e){return function(t){return e.map(gr(t),function(n){return[n,Yn(t)]})}},yr="Tuple",tq={URI:yr,map:Mh},fbe=De(tq),dbe={URI:yr,bimap:K2,mapLeft:V2},pbe={URI:yr,compose:q2},hbe={URI:yr,map:Mh,extend:H2,extract:iE},mbe={URI:yr,reduce:Xw,foldMap:Qw,reduceRight:eE},vbe={URI:yr,map:Mh,reduce:Xw,foldMap:Qw,reduceRight:eE,traverse:J2,sequence:oE},gbe=tE,ybe=nE,bbe={URI:yr,compose:q2,map:Mh,bimap:K2,mapLeft:V2,extract:iE,extend:H2,reduce:Xw,foldMap:Qw,reduceRight:eE,traverse:J2,sequence:oE};const _be=Object.freeze(Object.defineProperty({__proto__:null,fst:gr,snd:Yn,swap:abe,getApply:Yw,getApplicative:ube,getChain:Zw,getMonad:sbe,getChainRec:cbe,bimap:G2,mapFst:tE,mapSnd:nE,compose:Y2,extend:rE,duplicate:lbe,extract:iE,foldMap:Z2,reduce:X2,reduceRight:Q2,traverse:eq,sequence:oE,URI:yr,Functor:tq,flap:fbe,Bifunctor:dbe,Semigroupoid:pbe,Comonad:hbe,Foldable:mbe,Traversable:vbe,map:gbe,mapLeft:ybe,tuple:bbe},Symbol.toStringTag,{value:"Module"})),$be=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function Sbe(e,t){var n=HC(t,qa(e));return{map:n.map,ap:n.ap,of:n.of,chain:function(r,i){return t.chain(r,function(o){return Lt(o)?t.of(So(o.left)):i(o.right)})},alt:function(r,i){return t.chain(r,function(o){return y$(o)?t.of(o):t.map(i(),function(a){return Lt(a)?So(e.concat(o.left,a.left)):a})})}}}const Tbe=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:Sbe},Symbol.toStringTag,{value:"Module"}));var nq=iS(void 0),Ibe={concat:nq.concat,empty:void 0};const Obe=Object.freeze(Object.defineProperty({__proto__:null,Semigroup:nq,Monoid:Ibe},Symbol.toStringTag,{value:"Module"}));var wbe=function(e){return function(){return[void 0,e]}},Ebe=function(e){return function(){var t=e(),n=t[0],r=t[1];return[[n,r],r]}},Rbe=function(e){return function(){var t=e(),n=t[0],r=n[0],i=n[1],o=t[1];return[r,i(o)]}},Mbe=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,e(i)],i]}}},Cbe=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[r,e(i)]}}},Ch=function(e,t){return m(e,rq(t))},rq=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[e(r),i]}}},Qs="Writer",iq=function(e){return{URI:Qs,_E:void 0,of:function(t){return function(){return[t,e.empty]}}}},aE=function(e){return{URI:Qs,_E:void 0,map:Ch,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)]}}}},oq=function(e){var t=aE(e),n=iq(e);return{URI:Qs,_E:void 0,map:Ch,ap:t.ap,of:n.of}};function aq(e){var t=aE(e);return{URI:Qs,_E:void 0,map:Ch,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 xbe(e){var t=oq(e),n=aq(e);return{URI:Qs,_E:void 0,map:Ch,ap:t.ap,of:t.of,chain:n.chain}}var uE={URI:Qs,map:Ch},kbe=De(uE),Abe=function(e){return e()[0]},Wbe=function(e){return e()[1]},Nbe=function(e){return e()[0]},Pbe=function(e){return e()[1]},Fbe=uE;const Dbe=Object.freeze(Object.defineProperty({__proto__:null,tell:wbe,listen:Ebe,pass:Rbe,listens:Mbe,censor:Cbe,map:rq,URI:Qs,getPointed:iq,getApply:aE,getApplicative:oq,getChain:aq,getMonad:xbe,Functor:uE,flap:kbe,evaluate:Abe,execute:Wbe,evalWriter:Nbe,execWriter:Pbe,writer:Fbe},Symbol.toStringTag,{value:"Module"}));function Lbe(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 uq=La(Object.freeze(Object.defineProperty({__proto__:null,alt:h7,alternative:v7,applicative:hJ,apply:dJ,array:RN,bifunctor:QX,boolean:uQ,booleanAlgebra:dQ,bounded:vQ,boundedDistributiveLattice:bQ,boundedJoinSemilattice:_Q,boundedLattice:$Q,boundedMeetSemilattice:SQ,category:TQ,chain:mJ,chainRec:vJ,choice:wQ,comonad:EQ,compactable:gee,console:See,const:Fee,contravariant:Dee,date:Vee,distributiveLattice:gQ,either:Ox,eitherT:Jee,endomorphism:Yee,extend:Zee,field:ete,filterable:nte,filterableWithIndex:rte,foldable:cte,foldableWithIndex:fte,fromEither:gJ,fromIO:dte,fromReader:Wte,fromState:ene,fromTask:tne,fromThese:nne,function:VC,functor:pJ,functorWithIndex:ine,group:one,heytingAlgebra:ane,hkt:une,identity:Mne,invariant:Cne,io:Gne,ioEither:Gre,ioOption:Bie,ioRef:qie,joinSemilattice:Kie,json:Jie,lattice:Gie,magma:V7,map:iae,meetSemilattice:oae,monad:aae,monadIO:uae,monadTask:sae,monadThrow:cae,monoid:Sae,naturalTransformation:Tae,nonEmptyArray:PY,number:zY,option:hP,optionT:Zre,ord:B7,ordering:Cae,pipeable:Jae,pointed:Gae,predicate:kQ,profunctor:Yae,random:eue,reader:Ate,readerEither:Yue,readerT:Que,readerTaskEither:Wfe,readonlyArray:mZ,readonlyMap:Soe,readonlyNonEmptyArray:q8,readonlyRecord:Ode,readonlySet:Bde,readonlyTuple:rpe,readerTask:uce,record:ihe,refinement:phe,ring:ghe,semigroup:Pk,semigroupoid:yhe,semiring:_he,separated:TJ,set:Bhe,eq:R7,show:Jhe,state:Qte,stateReaderTaskEither:sve,stateT:Yhe,store:gve,string:Zfe,strong:_ve,struct:Tve,task:Ose,taskEither:gle,taskOption:Ige,taskThese:Iye,these:Zge,theseT:Qge,traced:kye,traversable:Wye,traversableWithIndex:Nye,tree:obe,tuple:_be,unfoldable:$be,validationT:Tbe,void:Obe,witherable:IJ,writer:Dbe,writerT:Object.freeze(Object.defineProperty({__proto__:null,getWriterM:Lbe},Symbol.toStringTag,{value:"Module"})),zero:qY},Symbol.toStringTag,{value:"Module"})));function sq(e,t,n){return n===void 0&&(n=e.name),new be(n,e.is,e.validate,function(r){return t(e.encode(r))})}const jbe=La(Object.freeze(Object.defineProperty({__proto__:null,mapOutput:sq},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(je,"__esModule",{value:!0}),je.addType=je.isEmpty=je.objectToMap=je.grouped=je.formatDate=je.formatDateTime=je.filterDouble=je.refineType=je.nullable=void 0;const Ube=K.exports,Bbe=uq,zbe=Un,wf=(0,Ube.__importStar)(Q),qbe=jbe;function Kbe(e){return wf.union([e,wf.null,wf.undefined])}je.nullable=Kbe;function Vbe(e,t,n){return new wf.Type(t,e.is,(r,i)=>(0,zbe.pipe)(e.validate(r,i),Bbe.either.chain(o=>n(o)?wf.success(o):wf.failure(r,i))),e.encode)}je.refineType=Vbe;function Hbe(e){if(e==="")return null;const t=Number(e);return Number.isNaN(t)?null:t}je.filterDouble=Hbe;function Jbe(e){return e.toISOString().replace(/\.\d{3}Z$/,"+0000")}je.formatDateTime=Jbe;function Gbe(e){return e.toISOString().replace(/T.*/,"")}je.formatDate=Gbe;function Ybe(e,t){return e.reduce((n,r,i)=>(i%t===0?n.push([r]):n[Math.floor(i/t)].push(r),n),new Array)}je.grouped=Ybe;function Zbe(e){return new Map(Object.entries(e))}je.objectToMap=Zbe;function Xbe(e){for(const t in e)return!1;return!0}je.isEmpty=Xbe;function Qbe(e,t){return(0,qbe.mapOutput)(e,n=>({...n,__TYPE__:t}))}je.addType=Qbe;var sE={};Object.defineProperty(sE,"__esModule",{value:!0});const e_e=K.exports,t_e=mn,n_e=Un,ec=(0,e_e.__importStar)(Q);sE.default=new ec.Type("IntFromNumber",ec.Int.is,(e,t)=>(0,n_e.pipe)(ec.number.validate(e,t),(0,t_e.chain)(n=>ec.Int.is(n)?ec.success(n):ec.success(Math.round(n)))),ec.Int.encode);var cE={};Object.defineProperty(cE,"__esModule",{value:!0});const r_e=K.exports,i_e=mn,o_e=Un,Ef=(0,r_e.__importStar)(Q),a_e=/^([0-9]+)px$/;cE.default=new Ef.Type("IntFromPixels",Ef.Int.is,(e,t)=>(0,o_e.pipe)(Ef.string.validate(e,t),(0,i_e.chain)(n=>{try{const r=n.match(a_e);if(!r)return Ef.failure(e,t);const i=parseInt(r[1]);return Ef.success(i)}catch{return Ef.failure(e,t)}})),String);var lE={};Object.defineProperty(lE,"__esModule",{value:!0});const u_e=K.exports,s_e=(0,u_e.__importStar)(Q),c_e=je;lE.default=(0,c_e.refineType)(s_e.string,"nonEmptyString",e=>e.trim().length>0);var fE={},eb={};Object.defineProperty(eb,"__esModule",{value:!0});const l_e=K.exports,f_e=(0,l_e.__importStar)(Q),d_e=je;eb.default=(0,d_e.nullable)(f_e.string),Object.defineProperty(fE,"__esModule",{value:!0});const p_e=K.exports,h_e=mn,m_e=Un,dE=Q,v_e=(0,p_e.__importDefault)(eb);fE.default=new dE.Type("nonEmptyStringOrNull",e=>typeof e=="string"||e===null,(e,t)=>(0,m_e.pipe)(v_e.default.validate(e,t),(0,h_e.chain)(n=>typeof n=="string"&&n.length>0?(0,dE.success)(n):(0,dE.success)(null))),e=>e);var pE={};Object.defineProperty(pE,"__esModule",{value:!0});const g_e=K.exports,y_e=(0,g_e.__importStar)(Q),b_e=je;pE.default=(0,b_e.nullable)(y_e.number);var hE={};Object.defineProperty(hE,"__esModule",{value:!0});const __e=K.exports,$_e=mn,S_e=Un,tb=(0,__e.__importStar)(Q);hE.default=new tb.Type("StringFromInt",tb.string.is,(e,t)=>(0,S_e.pipe)(tb.boolean.validate(e,t),(0,$_e.chain)(n=>tb.success(n.toString()))),e=>e);var mE={};Object.defineProperty(mE,"__esModule",{value:!0});const T_e=K.exports,I_e=mn,O_e=Un,nb=(0,T_e.__importStar)(Q);mE.default=new nb.Type("StringFromInt",nb.string.is,(e,t)=>(0,O_e.pipe)(nb.number.validate(e,t),(0,I_e.chain)(n=>nb.success(n.toString()))),e=>e),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=K.exports;var n=X$;Object.defineProperty(e,"DateFromString",{enumerable:!0,get:function(){return(0,t.__importDefault)(n).default}});var r=Q$;Object.defineProperty(e,"DateFromStringOrNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(r).default}});var i=eS;Object.defineProperty(e,"DateFromTsMs",{enumerable:!0,get:function(){return(0,t.__importDefault)(i).default}}),e.Function=(0,t.__importStar)(je);var o=sE;Object.defineProperty(e,"IntFromNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(o).default}});var a=cE;Object.defineProperty(e,"IntFromPixels",{enumerable:!0,get:function(){return(0,t.__importDefault)(a).default}});var u=lE;Object.defineProperty(e,"NonEmptyString",{enumerable:!0,get:function(){return(0,t.__importDefault)(u).default}});var s=fE;Object.defineProperty(e,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(s).default}});var c=pE;Object.defineProperty(e,"NumberOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(c).default}});var l=hE;Object.defineProperty(e,"StringFromBoolean",{enumerable:!0,get:function(){return(0,t.__importDefault)(l).default}});var f=mE;Object.defineProperty(e,"StringFromNumber",{enumerable:!0,get:function(){return(0,t.__importDefault)(f).default}});var d=eb;Object.defineProperty(e,"StringOrNull",{enumerable:!0,get:function(){return(0,t.__importDefault)(d).default}})}(Xe);var Oi={},vE={},gE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyContent=e.EmptyContentType=void 0,e.EmptyContentType="EmptyContent",e.EmptyContent={is:t=>t.__TYPE__===e.EmptyContentType}})(gE);var xh={};const cq=La(RN),yu=La(hP);var rb={},kh={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanContentType=void 0;const t=K.exports,n=mn,r=(0,t.__importStar)(Q);e.BooleanContentType="BooleanContent";const i=new r.Type("BooleanContent",o=>{var a;return((a=o)===null||a===void 0?void 0:a.__TYPE__)===e.BooleanContentType},(o,a)=>n.Chain.chain(r.boolean.validate(o,a),u=>r.success({value:u,__TYPE__:e.BooleanContentType})),o=>r.boolean.encode(o.value));e.default=i})(kh);var Rf={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmbedContentC=e.EmbedContent=e.EmbedContentType=void 0;const t=K.exports,n=uq,r=Un,i=(0,t.__importStar)(Q),o=Xe,a=je;e.EmbedContentType="EmbedContent",e.EmbedContent=new i.Type("EmbedContent",u=>u.__TYPE__===e.EmbedContentType,u=>(0,r.pipe)(e.EmbedContentC.decode(u),n.either.map(s=>({...e.EmbedContentC.encode(s),all:u}))),u=>e.EmbedContentC.encode(u)),e.EmbedContentC=(0,a.addType)(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})])),e.EmbedContentType)})(Rf);var bu={};Object.defineProperty(bu,"__esModule",{value:!0}),bu.FieldContentType=void 0;const lq=K.exports,w_e=Un,fq=(0,lq.__importStar)(yu),E_e=(0,lq.__importStar)(Q);bu.FieldContentType="FieldContent";function R_e(e){let t=0;for(;t<e.length&&e[t]<=" ";)t++;let n=e.length;for(;t<n&&e[n-1]<=" ";)n--;return e.substring(t,n)}const M_e={types:["Text","Date","Timestamp","Color","Number","Range","Select"],forType:(e,t)=>(0,w_e.pipe)(fq.fromEither(E_e.string.decode(t)),fq.map(n=>({value:R_e(n),type:e,__TYPE__:"FieldContent"})))};bu.default=M_e;var Ah={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPointContent=e.GeoPointContentType=void 0;const t=K.exports,n=(0,t.__importStar)(Q),r=je;e.GeoPointContentType="GeoPointContent",e.GeoPointContent=(0,r.addType)(n.strict({position:n.strict({lat:n.number,lng:n.number})}),e.GeoPointContentType)})(Ah);var Mf={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImageContent=e.ImageContentType=e.ImageContentView=void 0;const t=K.exports,n=(0,t.__importStar)(Q),r=Xe,i=je,o=n.exact(n.type({id:n.string,url:n.string,width:n.number,height:n.number}));e.ImageContentView=n.exact(n.intersection([n.type({origin:o,width:n.number,height:n.number,edit:n.type({zoom:n.number,crop:n.type({x:n.number,y:n.number}),background:n.string})}),n.partial({url:n.string,credits:r.NonEmptyStringOrNull,alt:r.NonEmptyStringOrNull,provider:r.StringOrNull})])),e.ImageContentType="ImageContent",e.ImageContent=(0,i.addType)(n.intersection([e.ImageContentView,n.partial({thumbnails:n.record(n.string,e.ImageContentView)})]),e.ImageContentType)})(Mf);var Wh={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationFieldsContentType=void 0;const t=K.exports,n=mn,r=(0,t.__importStar)(Q);e.IntegrationFieldsContentType="IntegrationFieldsContent";const i=new r.Type("IntegrationFieldsContent",o=>{var a;return((a=o)===null||a===void 0?void 0:a.__TYPE__)===e.IntegrationFieldsContentType},(o,a)=>n.Chain.chain(r.string.validate(o,a),u=>r.success({value:u,__TYPE__:e.IntegrationFieldsContentType})),()=>{throw new Error("Not implemented - Not used - Not relevant")});e.default=i})(Wh);var yE={},ib={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isDocumentLink=e.DocumentLink=e.DocumentLinkType=void 0;const t=K.exports,n=(0,t.__importStar)(Q),r=Xe,i=je;e.DocumentLinkType="DocumentLink",e.DocumentLink=(0,i.addType)(n.strict({id:r.NonEmptyString}),e.DocumentLinkType);function o(a){return a.__TYPE__===e.DocumentLinkType}e.isDocumentLink=o})(ib);var ob={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isExternalLink=e.ExternalLink=e.ExternalLinkType=void 0;const t=K.exports,n=(0,t.__importStar)(Q),r=Xe,i=je;e.ExternalLinkType="ExternalLink",e.ExternalLink=(0,i.addType)(n.exact(n.intersection([n.type({url:n.string}),n.partial({kind:n.literal("web"),target:r.StringOrNull,preview:(0,i.nullable)(n.partial({title:n.string}))})])),e.ExternalLinkType);function o(a){return a.__TYPE__===e.ExternalLinkType}e.isExternalLink=o})(ob);var ab={},dq=Bm(ai,function(e){return e.length>0},"NonEmptyString");function pq(e,t){t===void 0&&(t="NonEmptyArray<"+e.name+">");var n=qm(e);return new be(t,function(r){return n.is(r)&&xt(r)},function(r,i){return ce(n.validate(r,i),Ar(function(o){var a=BS(o);return Ne(a)?Ze(r,i):Ie(a.value)}))},function(r){return n.encode(r)})}function hq(e,t,n){n===void 0&&(n="Set<"+e.name+">");var r=qm(e),i=KB(t),o=BB(t);return new be(n,function(a){return a instanceof Set&&qB(e.is)(a)},function(a,u){return ce(r.validate(a,u),Ar(function(s){var c=o(s);return c.size!==s.length?Ze(a,u):Ie(c)}))},function(a){return r.encode(i(a))})}function C_e(e,t,n){return n===void 0&&(n="ReadonlySet<"+e.name+">"),hq(e,t,n)}function bE(e,t){return new be(e,t,function(n,r){return t(n)?Ie(n):Ze(n,r)},We)}var x_e=function(e){return e instanceof Date},k_e=bE("Date",x_e),A_e=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))},W_e=function(e,t){return{get:e,reverseGet:t}},mq=function(e){return _u(e.get,X(e.reverseGet,Dn))},N_e=function(e){return tc(X(e.get,vt),e.reverseGet)},P_e=function(e){return aa(X(e.get,vt),X(e.reverseGet,Dn))},F_e=function(e){return Cf(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.reverseGet(i)})}}})},_u=function(e,t){return{get:e,set:t}},_E=function(e){return aa(X(e.get,vt),e.set)},D_e=function(e){return Cf(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.set(i)(r)})}}})},vq=function(e){return function(t){return _u(function(n){return e.get(t.get(n))},function(n){return function(r){return t.set(e.set(n)(t.get(r)))(r)}})}},L_e=function(e){return function(t){return tc(X(t.getOption,vp(e.getOption)),X(e.reverseGet,t.reverseGet))}},j_e=function(e){return function(t){return nc($E(e))(_E(t))}},U_e=function(){return _u(B,Dn)},B_e=function(e){return function(t){return _u(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)}})}},z_e=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return _u(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}})}},q_e=function(e){return function(t){return _u(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)}})}},K_e=function(e){return function(t){return ce(t,vq(p$e().at(e)))}},tc=function(e,t){return{getOption:e,reverseGet:t}},$E=function(e){return aa(e.getOption,function(t){return yq(t)(e)})},gq=function(e){return Cf(function(t){return function(n){return function(r){return ce(e.getOption(r),xo(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return yq(o)(e)(r)})}))}}})},V_e=function(e){return function(t){return function(n){return ce(t.getOption(n),Ki(function(r){var i=e(r);return i===r?n:t.reverseGet(i)}))}}},H_e=function(e){return function(t){var n=V_e(e)(t);return function(r){return ce(n(r),_T(function(){return r}))}}},yq=function(e){return H_e(function(){return e})},J_e=function(e){return function(t){return nc(_E(e))($E(t))}},G_e=function(){return tc(ys,B)},SE=function(e){return tc(Zv(e),B)},Y_e=function(){return tc(B,vt)},Z_e=function(){return tc(Ml,Be)},X_e=function(){return tc(function(e){return oe(e)?vt(e.left):tt},bt)},aa=function(e,t){return{getOption:e,set:t}},Q_e=function(e){return Cf(function(t){return function(n){return function(r){return ce(e.getOption(r),xo(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return e.set(o)(r)})}))}}})},bq=function(e){return function(t){return function(n){return ce(t.getOption(n),Ki(function(r){var i=e(r);return i===r?n:t.set(i)(n)}))}}},_q=function(e){return function(t){var n=bq(e)(t);return function(r){return ce(n(r),_T(function(){return r}))}}},nc=function(e){return function(t){return aa(X(t.getOption,vp(e.getOption)),function(n){return _q(e.set(n))(t)})}},e$e=function(e){return function(t){return ce(t,nc(c$e().index(e)))}},t$e=function(e){return function(t){return ce(t,nc(l$e().index(e)))}},n$e=function(e){return function(t){return ce(t,nc(f$e().index(e)))}},r$e=function(e){return aa(Mv(e),function(t){return function(n){return ce(Rv(e)(n),xo(function(){return n},function(r){return Uv(r,t,n)}))}})},$q=function(e,t,n){if(n[e]===t)return n;var r=A_e([n[0]],n.slice(1),!0);return r[e]=t,r},i$e=function(e){return aa(Mv(e),function(t){return function(n){return ce(Rv(e)(n),xo(function(){return n},function(r){return $q(r,t,n)}))}})},Cf=function(e){return{modifyF:e}};function TE(e){return function(t){return Cf(function(n){return function(r){return t.modifyF(n)(e.modifyF(n)(r))}})}}var o$e={URI:"Identity",map:function(e,t){return t(e)},of:B,ap:function(e,t){return e(t)}},a$e=function(e){return e.URI==="Identity"};function u$e(e){return function(){return Cf(function(t){var n=a$e(t)?e.map:e.traverse(t);return function(r){return function(i){return n(i,r)}}})}}function s$e(e){return TE(u$e(e)())}var IE=function(e){return{index:e}},c$e=function(){return IE(function(e){return aa(function(t){return ds(e,t)},function(t){return function(n){return ce(ds(e,n),xo(function(){return n},function(){return Uv(e,t,n)}))}})})},l$e=function(){return IE(function(e){return aa(function(t){return ds(e,t)},function(t){return function(n){return ce(ds(e,n),xo(function(){return n},function(){return $q(e,t,n)}))}})})},f$e=function(){return IE(function(e){return aa(function(t){return Ps(e,t)},function(t){return function(n){return n[e]===t||Ne(Ps(e,n))?n:a1(e,t)(n)}})})},d$e=function(e){return{at:e}};function p$e(){return d$e(function(e){return _u(function(t){return Ps(e,t)},xo(function(){return my(e)},function(t){return a1(e,t)}))})}var Sq=W_e,OE=mq,wE=N_e,EE=P_e,RE=F_e,h$e=function(e){return function(t){return Sq(X(t.get,e.get),X(e.reverseGet,t.reverseGet))}},m$e=function(e){return Sq(e.reverseGet,e.get)},v$e=function(e){return function(t){return function(n){return t.reverseGet(e(t.get(n)))}}},Tq=_u,ub=U_e,$u=_E,xf=D_e,rc=vq,g$e=rc,y$e=X(mq,rc),ic=j_e,ME=function(e){return X($u,nc(e))},b$e=function(e){return X(xf,TE(e))},Iq=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 _$e(e){return function(t){return function(n){return function(r){return ce(n.get(r),t,function(i){return e.map(i,function(o){return n.set(o)(r)})})}}}}var $$e=function(e){return ic(G_e())(e)};function S$e(e){return ic(SE(e))}var Oq=B_e,wq=z_e,T$e=q_e,I$e=function(e){return X($u,e$e(e))},O$e=function(e){return X($u,t$e(e))},w$e=function(e){return X($u,n$e(e))},E$e=K_e,R$e=ic(Y_e()),M$e=ic(Z_e()),C$e=ic(X_e());function x$e(e){return X(xf,s$e(e))}function k$e(e){return ME(r$e(e))}function A$e(e){return ME(i$e(e))}var W$e=function(e,t){return function(n){return Eq(n,e,t)}},Eq=function(e,t,n){return Tq(X(e.get,t),X(n,e.set))},sb="monocle-ts/Lens",N$e={URI:sb,imap:Eq},Rq={URI:sb,compose:function(e,t){return rc(e)(t)}},P$e={URI:sb,compose:Rq.compose,id:ub};const F$e=Object.freeze(Object.defineProperty({__proto__:null,lens:Tq,id:ub,asOptional:$u,asTraversal:xf,compose:rc,composeLens:g$e,composeIso:y$e,composePrism:ic,composeOptional:ME,composeTraversal:b$e,modify:Iq,modifyF:_$e,fromNullable:$$e,filter:S$e,prop:Oq,props:wq,component:T$e,index:I$e,indexNonEmpty:O$e,key:w$e,atKey:E$e,some:R$e,right:M$e,left:C$e,traverse:x$e,findFirst:k$e,findFirstNonEmpty:A$e,imap:W$e,URI:sb,Invariant:N$e,Semigroupoid:Rq,Category:P$e},Symbol.toStringTag,{value:"Module"}));var Mq=Q_e,oc=nc,D$e=bq,L$e=_q,j$e=SE,CE=$E,xE=gq,kE=L_e,U$e=J_e,ua=TE,Cq=function(e){return function(t){return t.modifyF(o$e)(e)}},B$e=function(e){return Cq(function(){return e})};function z$e(e){return ua(gq(SE(e)))}var xq=function(e){return new Aq(e.get,e.reverseGet)},kf=function(e){return new AE(e.get,e.set)},Nh=function(e){return new Wq(e.getOption,e.reverseGet)},Br=function(e){return new q$e(e.getOption,e.set)},br=function(e){return new K$e(e.modifyF)},kq=function(e,t,n){var r;return n===e[t]?e:Object.assign({},e,(r={},r[t]=n,r))},Aq=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 xq(m$e(this))},e.prototype.modify=function(t){return v$e(t)(this)},e.prototype.asLens=function(){return kf(OE(this))},e.prototype.asPrism=function(){return Nh(wE(this))},e.prototype.asOptional=function(){return Br(EE(this))},e.prototype.asTraversal=function(){return br(RE(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 Pq(function(n){return t.get(n)})},e.prototype.asSetter=function(){var t=this;return new Ph(function(n){return t.modify(n)})},e.prototype.compose=function(t){return xq(h$e(t)(this))},e.prototype.composeIso=function(t){return this.compose(t)},e.prototype.composeLens=function(t){return kf(ce(this,OE,rc(t)))},e.prototype.composePrism=function(t){return Nh(ce(this,wE,kE(t)))},e.prototype.composeOptional=function(t){return Br(ce(this,EE,oc(t)))},e.prototype.composeTraversal=function(t){return br(ce(this,RE,ua(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}(),AE=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 kf(ce(ub(),Oq(t)))}},e.fromProps=function(){return function(t){return kf(ce(ub(),wq.apply(F$e,t)))}},e.fromNullableProp=function(){return function(t,n){return new e(function(r){var i=ys(r[t]);return Ne(i)?n:i.value},function(r){return function(i){return kq(i,t,r)}})}},e.prototype.modify=function(t){return Iq(t)(this)},e.prototype.asOptional=function(){return Br($u(this))},e.prototype.asTraversal=function(){return br(xf(this))},e.prototype.asSetter=function(){var t=this;return new Ph(function(n){return t.modify(n)})},e.prototype.asGetter=function(){var t=this;return new Pq(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 kf(rc(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 Br(ce(this,$u,oc(t)))},e.prototype.composeTraversal=function(t){return br(ce(this,xf,ua(t)))},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return kf(ce(this,rc(ce(t,OE))))},e.prototype.composePrism=function(t){return Br(ic(t)(this))},e}(),Wq=function(){function e(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return e.fromPredicate=function(t){return Nh(j$e(t))},e.some=function(){return Nq},e.prototype.modify=function(t){var n=this;return function(r){var i=n.modifyOption(t)(r);return Ne(i)?r:i.value}},e.prototype.modifyOption=function(t){var n=this;return function(r){return dP.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 Br(CE(this))},e.prototype.asTraversal=function(){return br(xE(this))},e.prototype.asSetter=function(){var t=this;return new Ph(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 Ne(o)?n.empty:r(o.value)}}})},e.prototype.compose=function(t){return Nh(kE(t)(this))},e.prototype.composePrism=function(t){return this.compose(t)},e.prototype.composeOptional=function(t){return Br(ce(this,CE,oc(t)))},e.prototype.composeTraversal=function(t){return br(ce(this,xE,ua(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 Nh(ce(this,kE(ce(t,wE))))},e.prototype.composeLens=function(t){return Br(U$e(t)(this))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),Nq=new Wq(B,vt),q$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 ys(n[t])},function(n){return function(r){return r[t]==null?r:kq(r,t,n)}})}},e.fromOptionProp=function(){var t=AE.fromProp();return function(n){return t(n).composePrism(Nq)}},e.prototype.modify=function(t){return L$e(t)(this)},e.prototype.modifyOption=function(t){return D$e(t)(this)},e.prototype.asTraversal=function(){return br(Mq(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 Ne(o)?n.empty:r(o.value)}}})},e.prototype.asSetter=function(){var t=this;return new Ph(function(n){return t.modify(n)})},e.prototype.compose=function(t){return Br(oc(t)(this))},e.prototype.composeOptional=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return br(ce(this,Mq,ua(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 Br(ce(this,oc(ce(t,$u))))},e.prototype.composePrism=function(t){return Br(ce(this,oc(ce(t,CE))))},e.prototype.composeIso=function(t){return Br(ce(this,oc(ce(t,EE))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),K$e=function(){function e(t){this.modifyF=t,this._tag="Traversal"}return e.prototype.modify=function(t){return Cq(t)(this)},e.prototype.set=function(t){return B$e(t)(this)},e.prototype.filter=function(t){return br(z$e(t)(this))},e.prototype.asFold=function(){var t=this;return new Af(function(n){return function(r){return t.modifyF(vP(n))(function(i){return Cl(r(i))})}})},e.prototype.asSetter=function(){var t=this;return new Ph(function(n){return t.modify(n)})},e.prototype.compose=function(t){return br(ua(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 br(ce(this,ua(ce(t,xf))))},e.prototype.composePrism=function(t){return br(ce(this,ua(ce(t,xE))))},e.prototype.composeIso=function(t){return br(ce(this,ua(ce(t,RE))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),Pq=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(Q0())(eu),this.exist=t(hL),this.all=t(pL),this.foldMapFirst=t(pP())}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(Zv(t))},e.prototype.headOption=function(t){return this.find(function(){return!0})(t)},e}(),Ph=function(){function e(t){this.modify=t,this._tag="Setter"}return e.prototype.set=function(t){return this.modify(Dn(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}(),V$e=new Aq(Jc,Jc);function H$e(){return V$e}function J$e(e,t){t===void 0&&(t="fromNewtype("+e.name+")");var n=H$e();return new be(t,function(r){return e.is(r)},function(r,i){return ce(e.validate(r,i),us(n.wrap))},function(r){return e.encode(n.unwrap(r))})}var G$e=Bd({_tag:jd("None")}),Y$e=jd("Some");function Fq(e,t){return t===void 0&&(t="Option<"+e.name+">"),Ud([G$e,Bd({_tag:Y$e,value:e},"Some<"+e.name+">")],t)}function Z$e(e,t){return t===void 0&&(t="Option<"+e.name+">"),new be(t,Fq(e).is,function(n,r){return n==null?Ie(tt):ce(e.validate(n,r),us(vt))},function(n){return $T(ce(n,Ki(e.encode)))})}var X$e=new be("DateFromISOString",function(e){return e instanceof Date},function(e,t){return ce(ai.validate(e,t),Ar(function(n){var r=new Date(n);return isNaN(r.getTime())?Ze(e,t):Ie(r)}))},function(e){return e.toISOString()});function Q$e(e,t){return t===void 0&&(t="ReadonlyNonEmptyArray<"+e.name+">"),pq(e,t)}function Dq(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}var eSe=new be("DateFromNumber",function(e){return e instanceof Date},function(e,t){return ce(ls.validate(e,t),Ar(function(n){var r=new Date(n);return isNaN(r.getTime())?Ze(e,t):Ie(r)}))},function(e){return e.getTime()});function cb(e,t,n){n===void 0&&(n=e.name);var r=Dq(e);return r.validate=t,r.decode=function(i){return t(i,sk(r))},r.name=n,r}function tSe(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),cb(e,function(r,i){return gx(function(){return Ie(t)})(e.validate(r,i))},n)}var nSe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,rSe=Bm(ai,function(e){return nSe.test(e)},"UUID");function iSe(e,t,n){return n===void 0&&(n="fromNullable("+e.name+")"),cb(e,function(r,i){return r==null?Ie(t):e.validate(r,i)},n)}var oSe=new be("BooleanFromString",Um.is,function(e,t){return ce(ai.validate(e,t),Ar(function(n){return n==="true"?Ie(!0):n==="false"?Ie(!1):Ze(e,t)}))},String);function aSe(e,t){return cb(e,function(n,r){return Fd(function(){return[{value:n,context:r,message:t(n,r),actual:n}]})(e.validate(n,r))})}function Lq(e){switch(e._tag){case"InterfaceType":return e.props;case"ExactType":return Lq(e.type)}}var uSe=AE.fromProp();function sSe(e){var t={};for(var n in Lq(e))t[n]=uSe(n);return t}var cSe=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},lSe=bE("RegExp",cSe),fSe=new be("DateFromUnixTime",function(e){return e instanceof Date},function(e,t){return ce(zm.validate(e,t),Ar(function(n){var r=new Date(n*1e3);return isNaN(r.getTime())?Ze(e,t):Ie(r)}))},function(e){return Math.floor(e.getTime()/1e3)}),WE=new be("NumberFromString",ls.is,function(e,t){return ce(ai.validate(e,t),Ar(function(n){var r=+n;return isNaN(r)||n.trim()===""?Ze(e,t):Ie(r)}))},String),dSe=new be("IntFromString",zm.is,function(e,t){return ce(WE.validate(e,t),Ar(function(n){return zm.is(n)?Ie(n):Ze(e,t)}))},WE.encode),jq=V$("JsonArray",function(){return ik(lb)}),Uq=V$("JsonRecord",function(){return G$(ai,lb)}),lb=Ud([Um,ls,ai,q$,jq,Uq],"Json"),pSe=new be("JsonFromString",lb.is,function(e,t){try{return Ie(JSON.parse(e))}catch{return Ze(e,t)}},function(e){return JSON.stringify(e)}),hSe=jd("Left"),mSe=jd("Right");function vSe(e,t,n){return n===void 0&&(n="Either<"+e.name+", "+t.name+">"),Ud([Bd({_tag:hSe,left:e},"Left<"+e.name+">"),Bd({_tag:mSe,right:t},"Right<"+e.name+">")],n)}var gSe=new be("BigIntFromString",function(e){return typeof e=="bigint"},function(e,t){return ce(ai.validate(e,t),Ar(function(n){if(!dq.is(n.trim()))return Ze(e,t);try{return Ie(BigInt(n))}catch{return Ze(e,t)}}))},String);function ySe(e,t,n){return n===void 0&&(n=e.name),new be(n,e.is,e.validate,t)}var bSe=new be("BooleanFromNumber",Um.is,function(e,t){return ce(ls.validate(e,t),us(function(n){return n!==0}))},Number);const NE=La(Object.freeze(Object.defineProperty({__proto__:null,mapOutput:sq,NonEmptyString:dq,nonEmptyArray:pq,readonlySetFromArray:C_e,fromRefinement:bE,date:k_e,fromNewtype:J$e,optionFromNullable:Z$e,DateFromISOString:X$e,readonlyNonEmptyArray:Q$e,clone:Dq,DateFromNumber:eSe,withFallback:tSe,UUID:rSe,fromNullable:iSe,BooleanFromString:oSe,withMessage:aSe,withValidate:cb,getLenses:sSe,regexp:lSe,option:Fq,DateFromUnixTime:fSe,NumberFromString:WE,setFromArray:hq,IntFromString:dSe,JsonArray:jq,JsonRecord:Uq,Json:lb,JsonFromString:pSe,either:vSe,BigIntFromString:gSe,withEncode:ySe,BooleanFromNumber:bSe},Symbol.toStringTag,{value:"Module"})));var fb={},_Se=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),$Se=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),SSe=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&_Se(t,e,n);return $Se(t,e),t};Object.defineProperty(fb,"__esModule",{value:!0}),fb.mapOutput=void 0;var TSe=SSe(Q);function ISe(e,t,n){return n===void 0&&(n=e.name),new TSe.Type(n,e.is,e.validate,function(r){return t(e.encode(r))})}fb.mapOutput=ISe,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isFileLink=e.FileLink=e.FileLinkType=void 0;const t=K.exports,n=(0,t.__importStar)(Q),r=NE,i=fb,o=je;e.FileLinkType="FileLink",e.FileLink=(0,i.mapOutput)(n.exact(n.intersection([n.type({id:n.string,url:n.string,name:n.string,kind:n.string}),n.partial({date:(0,o.nullable)(n.string),size:(0,r.withFallback)(n.string,"0")})])),u=>({...u,size:u.size||"0",__TYPE__:e.FileLinkType}));function a(u){return u.__TYPE__===e.FileLinkType}e.isFileLink=a}(ab);var db={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isImageLink=e.ImageLink=e.ImageLinkType=void 0;const t=K.exports,n=(0,t.__importStar)(Q),r=Xe,i=je;e.ImageLinkType="ImageLink",e.ImageLink=(0,i.addType)(n.exact(n.intersection([n.type({id:n.string,url:n.string,height:n.string,width:n.string,size:n.string,name:n.string,kind:n.string}),n.partial({date:r.StringOrNull})])),e.ImageLinkType);function o(a){return a.__TYPE__===e.ImageLinkType}e.isImageLink=o})(db);var PE={},Bq;function FE(){return Bq||(Bq=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkContent=e.LinkContentType=void 0;const t=K.exports,n=mn,r=(0,t.__importStar)(Q),i=Fh();e.LinkContentType="LinkContent",e.LinkContent=new r.Type("LinkContent",o=>{var a;return i.Link.is((a=o)===null||a===void 0?void 0:a.value)},(o,a)=>n.Chain.chain(i.Link.validate(o,a),u=>r.success({value:i.Link.encode(u),__TYPE__:e.LinkContentType})),o=>i.Link.encode(o.value))}(PE)),PE}var zq;function Fh(){return zq||(zq=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinksTypes=e.is=e.BROKEN_CUSTOM_TYPE=e.LinkContent=e.ImageLink=e.FileLink=e.ExternalLink=e.DocumentLink=e.Link=void 0;const t=K.exports,n=(0,t.__importStar)(Q),r=ib,i=ob,o=ab,a=db,u=FE();e.Link=n.union([a.ImageLink,o.FileLink,r.DocumentLink,i.ExternalLink]);var s=ib;Object.defineProperty(e,"DocumentLink",{enumerable:!0,get:function(){return s.DocumentLink}});var c=ob;Object.defineProperty(e,"ExternalLink",{enumerable:!0,get:function(){return c.ExternalLink}});var l=ab;Object.defineProperty(e,"FileLink",{enumerable:!0,get:function(){return l.FileLink}});var f=db;Object.defineProperty(e,"ImageLink",{enumerable:!0,get:function(){return f.ImageLink}});var d=FE();Object.defineProperty(e,"LinkContent",{enumerable:!0,get:function(){return d.LinkContent}}),e.BROKEN_CUSTOM_TYPE="broken_type",e.is={documentLink:r.isDocumentLink,fileLink:o.isFileLink,externalLink:i.isExternalLink,imageLink:a.isImageLink},e.LinksTypes={DocumentLink:r.DocumentLinkType,FileLink:o.FileLinkType,ExternalLink:i.ExternalLinkType,ImageLink:a.ImageLinkType,LinkContent:u.LinkContentType}}(yE)),yE}var Dh={},pb={},Ce={},hb={},ht={};Object.defineProperty(ht,"__esModule",{value:!0}),ht.WidgetTypes=void 0,ht.WidgetTypes={Text:"Text",RichText:"StructuredText",Color:"Color",Image:"Image",Date:"Date",Timestamp:"Timestamp",Number:"Number",Range:"Range",Select:"Select",Link:"Link",Embed:"Embed",GeoPoint:"GeoPoint",Separator:"Separator",UID:"UID",BooleanField:"Boolean",IntegrationField:"IntegrationFields",Group:"Group",Slices:"Slices",LegacySlices:"Choice"},Object.defineProperty(hb,"__esModule",{value:!0});const OSe=K.exports,io=(0,OSe.__importStar)(Q),wSe=Xe,ESe=ht,RSe=io.exact(io.partial({label:wSe.StringOrNull,default_value:io.boolean,placeholder_true:io.string,placeholder_false:io.string})),MSe=io.exact(io.intersection([io.type({type:io.literal(ESe.WidgetTypes.BooleanField)}),io.partial({config:RSe})]));hb.default=MSe;var mb={};Object.defineProperty(mb,"__esModule",{value:!0});const CSe=K.exports,Su=(0,CSe.__importStar)(Q),qq=Xe,xSe=ht,kSe=Su.exact(Su.partial({label:qq.StringOrNull,placeholder:Su.string})),ASe=Su.exact(Su.intersection([Su.type({type:Su.literal(xSe.WidgetTypes.Color)}),Su.partial({fieldset:qq.StringOrNull,config:kSe})]));mb.default=ASe;var vb={};Object.defineProperty(vb,"__esModule",{value:!0});const WSe=K.exports,sa=(0,WSe.__importStar)(Q),Kq=Xe,NSe=ht,PSe=sa.exact(sa.partial({label:Kq.StringOrNull,placeholder:sa.string,default:sa.string})),FSe=sa.exact(sa.intersection([sa.type({type:sa.literal(NSe.WidgetTypes.Date)}),sa.partial({fieldset:Kq.StringOrNull,config:PSe})]));vb.default=FSe;var gb={};Object.defineProperty(gb,"__esModule",{value:!0});const DSe=K.exports,ca=(0,DSe.__importStar)(Q),Vq=Xe,LSe=ht,jSe=ca.exact(ca.partial({label:Vq.StringOrNull,placeholder:ca.string,useAsTitle:ca.boolean})),USe=ca.exact(ca.intersection([ca.type({type:ca.literal(LSe.WidgetTypes.Embed)}),ca.partial({fieldset:Vq.StringOrNull,config:jSe})]));gb.default=USe;var yb={};Object.defineProperty(yb,"__esModule",{value:!0});const BSe=K.exports,ac=(0,BSe.__importStar)(Q),Hq=Xe,zSe=ht,qSe=ac.exact(ac.partial({label:Hq.StringOrNull})),KSe=ac.exact(ac.intersection([ac.type({type:ac.literal(zSe.WidgetTypes.GeoPoint)}),ac.partial({fieldset:Hq.StringOrNull,config:qSe})]));yb.default=KSe;var bb={},Lh={},_b={},Wf={},uc={};Object.defineProperty(uc,"__esModule",{value:!0}),uc.pipe=uc.pipeable=void 0;var DE=ja,VSe=function(e){return typeof e.map=="function"},HSe=function(e){return typeof e.contramap=="function"},JSe=function(e){return typeof e.mapWithIndex=="function"},GSe=function(e){return typeof e.ap=="function"},YSe=function(e){return typeof e.chain=="function"},ZSe=function(e){return typeof e.bimap=="function"},XSe=function(e){return typeof e.extend=="function"},QSe=function(e){return typeof e.reduce=="function"},e0e=function(e){return typeof e.reduceWithIndex=="function"},t0e=function(e){return typeof e.alt=="function"},n0e=function(e){return typeof e.compact=="function"},r0e=function(e){return typeof e.filter=="function"},i0e=function(e){return typeof e.filterWithIndex=="function"},o0e=function(e){return typeof e.promap=="function"},a0e=function(e){return typeof e.compose=="function"},u0e=function(e){return typeof e.throwError=="function"};function s0e(e){var t={};if(VSe(e)){var n=function(S){return function($){return e.map($,S)}};t.map=n}if(HSe(e)){var r=function(S){return function($){return e.contramap($,S)}};t.contramap=r}if(JSe(e)){var i=function(S){return function($){return e.mapWithIndex($,S)}};t.mapWithIndex=i}if(GSe(e)){var o=function(S){return function($){return e.ap($,S)}},a=function(S){return function($){return e.ap(e.map($,function(U){return function(){return U}}),S)}};t.ap=o,t.apFirst=a,t.apSecond=function(S){return function($){return e.ap(e.map($,function(){return function(U){return U}}),S)}}}if(YSe(e)){var u=function(S){return function($){return e.chain($,S)}},s=function(S){return function($){return e.chain($,function(U){return e.map(S(U),function(){return U})})}},c=function(S){return e.chain(S,DE.identity)};t.chain=u,t.chainFirst=s,t.flatten=c}if(ZSe(e)){var l=function(S,$){return function(U){return e.bimap(U,S,$)}},f=function(S){return function($){return e.mapLeft($,S)}};t.bimap=l,t.mapLeft=f}if(XSe(e)){var d=function(S){return function($){return e.extend($,S)}},p=function(S){return e.extend(S,DE.identity)};t.extend=d,t.duplicate=p}if(QSe(e)){var h=function(S,$){return function(U){return e.reduce(U,S,$)}},v=function(S){var $=e.foldMap(S);return function(U){return function(Z){return $(Z,U)}}},y=function(S,$){return function(U){return e.reduceRight(U,S,$)}};t.reduce=h,t.foldMap=v,t.reduceRight=y}if(e0e(e)){var b=function(S,$){return function(U){return e.reduceWithIndex(U,S,$)}},w=function(S){var $=e.foldMapWithIndex(S);return function(U){return function(Z){return $(Z,U)}}},F=function(S,$){return function(U){return e.reduceRightWithIndex(U,S,$)}};t.reduceWithIndex=b,t.foldMapWithIndex=w,t.reduceRightWithIndex=F}if(t0e(e)){var g=function(S){return function($){return e.alt($,S)}};t.alt=g}if(n0e(e)&&(t.compact=e.compact,t.separate=e.separate),r0e(e)){var T=function(S){return function($){return e.filter($,S)}},I=function(S){return function($){return e.filterMap($,S)}},W=function(S){return function($){return e.partition($,S)}},E=function(S){return function($){return e.partitionMap($,S)}};t.filter=T,t.filterMap=I,t.partition=W,t.partitionMap=E}if(i0e(e)){var J=function(S){return function($){return e.filterWithIndex($,S)}},q=function(S){return function($){return e.filterMapWithIndex($,S)}},x=function(S){return function($){return e.partitionWithIndex($,S)}},G=function(S){return function($){return e.partitionMapWithIndex($,S)}};t.filterWithIndex=J,t.filterMapWithIndex=q,t.partitionWithIndex=x,t.partitionMapWithIndex=G}if(o0e(e)){var O=function(S,$){return function(U){return e.promap(U,S,$)}};t.promap=O}if(a0e(e)){var R=function(S){return function($){return e.compose($,S)}};t.compose=R}if(u0e(e)){var k=function(S){return function($){return $._tag==="None"?e.throwError(S()):e.of($.value)}},L=function(S){return S._tag==="Left"?e.throwError(S.left):e.of(S.right)},z=function(S,$){return function(U){return S(U)?e.of(U):e.throwError($(U))}},j=function(S,$){return function(U){return e.chain(U,function(Z){return S(Z)?e.of(Z):e.throwError($(Z))})}};t.fromOption=k,t.fromEither=L,t.fromPredicate=z,t.filterOrElse=j}return t}uc.pipeable=s0e,uc.pipe=DE.pipe;var c0e=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),l0e=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),f0e=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&c0e(t,e,n);return l0e(t,e),t};Object.defineProperty(Wf,"__esModule",{value:!0}),Wf.NumberFromString=void 0;var jh=f0e(Q),d0e=uc,p0e=$o;Wf.NumberFromString=new jh.Type("NumberFromString",jh.number.is,function(e,t){return d0e.pipe(jh.string.validate(e,t),p0e.chain(function(n){var r=+n;return isNaN(r)||n.trim()===""?jh.failure(e,t):jh.success(r)}))},String);var h0e=se&&se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),m0e=se&&se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),v0e=se&&se.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&h0e(t,e,n);return m0e(t,e),t};Object.defineProperty(_b,"__esModule",{value:!0}),_b.IntFromString=void 0;var Uh=v0e(Q),Jq=Wf,g0e=uc,y0e=$o;_b.IntFromString=new Uh.Type("IntFromString",Uh.Int.is,function(e,t){return g0e.pipe(Jq.NumberFromString.validate(e,t),y0e.chain(function(n){return Uh.Int.is(n)?Uh.success(n):Uh.failure(e,t)}))},Jq.NumberFromString.encode),Object.defineProperty(Lh,"__esModule",{value:!0});const b0e=K.exports,_0e=$o,la=(0,b0e.__importStar)(Q),$0e=_b,Gq=Xe,Yq=new la.Type("SideConstraints",e=>!e||typeof e=="number",(e,t)=>_0e.either.chain(la.union([la.literal("auto"),la.literal(""),la.Int,$0e.IntFromString,Gq.IntFromNumber,Gq.IntFromPixels,la.null]).validate(e,t),n=>n==="auto"||n===""?la.success(null):la.success(n)),e=>e),S0e=la.partial({width:Yq,height:Yq});Lh.default=S0e,Object.defineProperty(bb,"__esModule",{value:!0});const Zq=K.exports,_r=(0,Zq.__importStar)(Q),Xq=Xe,Qq=(0,Zq.__importDefault)(Lh),T0e=ht,I0e=_r.exact(_r.intersection([_r.type({name:_r.string}),Qq.default])),O0e=_r.exact(_r.partial({label:Xq.StringOrNull,placeholder:_r.string,constraint:Qq.default,thumbnails:_r.readonlyArray(I0e)})),w0e=_r.exact(_r.intersection([_r.type({type:_r.literal(T0e.WidgetTypes.Image)}),_r.partial({fieldset:Xq.StringOrNull,config:O0e})]));bb.default=w0e;var $b={};Object.defineProperty($b,"__esModule",{value:!0});const E0e=K.exports,fa=(0,E0e.__importStar)(Q),eK=Xe,R0e=ht,M0e=fa.exact(fa.partial({label:eK.StringOrNull,placeholder:fa.string,catalog:fa.string})),C0e=fa.exact(fa.intersection([fa.type({type:fa.literal(R0e.WidgetTypes.IntegrationField)}),fa.partial({fieldset:eK.StringOrNull,config:M0e})]));$b.default=C0e;var Sb={};Object.defineProperty(Sb,"__esModule",{value:!0});const x0e=K.exports,k0e=$o,ft=(0,x0e.__importStar)(Q),A0e=il,tK=Xe,W0e=ht,N0e=e=>{if(e instanceof Array&&e.reduce((n,r)=>n&&typeof r=="string",!0))return ft.success(e)},P0e=e=>{if(typeof e=="string")return ft.success([e])},nK=new ft.Type("MasksArrayString",e=>e instanceof Array,(e,t)=>k0e.either.chain(ft.union([ft.array(ft.string),ft.string]).validate(e,t),n=>N0e(n)||P0e(n)||ft.failure(e,t)),e=>e),F0e=ft.exact(ft.partial({label:tK.StringOrNull,useAsTitle:ft.boolean,placeholder:ft.string,select:(0,A0e.withFallback)(ft.union([ft.literal("media"),ft.literal("document"),ft.literal("web"),ft.null]),null),customtypes:ft.readonlyArray(ft.string),masks:nK,tags:nK,allowTargetBlank:ft.boolean})),D0e=ft.exact(ft.intersection([ft.type({type:ft.literal(W0e.WidgetTypes.Link)}),ft.partial({fieldset:tK.StringOrNull,config:F0e})]));Sb.default=D0e;var Tu={},Tb={};Object.defineProperty(Tb,"__esModule",{value:!0});const L0e=K.exports,Zn=(0,L0e.__importStar)(Q),LE=Wf,rK=Xe,j0e=ht,U0e=Zn.exact(Zn.partial({label:rK.StringOrNull,placeholder:Zn.string,min:Zn.union([Zn.number,LE.NumberFromString]),max:Zn.union([Zn.number,LE.NumberFromString]),step:Zn.union([Zn.number,LE.NumberFromString])})),B0e=Zn.exact(Zn.intersection([Zn.type({type:Zn.literal(j0e.WidgetTypes.Number)}),Zn.partial({fieldset:rK.StringOrNull,config:U0e})]));Tb.default=B0e;var Ib={};Object.defineProperty(Ib,"__esModule",{value:!0});const z0e=K.exports,Xn=(0,z0e.__importStar)(Q),jE=Wf,iK=Xe,q0e=ht,K0e=Xn.exact(Xn.partial({label:iK.StringOrNull,placeholder:Xn.string,min:Xn.union([Xn.number,jE.NumberFromString]),max:Xn.union([Xn.number,jE.NumberFromString]),step:Xn.union([Xn.number,jE.NumberFromString])})),V0e=Xn.exact(Xn.intersection([Xn.type({type:Xn.literal(q0e.WidgetTypes.Range)}),Xn.partial({fieldset:iK.StringOrNull,config:K0e})]));Ib.default=V0e;var Ob={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichText=e.RichTextConfig=e.RichTextNodeTypeCodec=e.RichTextNodeType=e.DEFAULT_OPTION=void 0;const t=K.exports,n=$o,r=(0,t.__importStar)(Q),i=Xe,o=(0,t.__importDefault)(Lh),a=ht;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=r.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 u=new r.Type("RichTextOptions",p=>typeof p=="string",(p,h)=>n.either.chain(r.union([r.string,r.null]).validate(p,h),v=>{if(!v)return r.success(e.DEFAULT_OPTION);const b=v.split(",").map(w=>w.trim()).filter(w=>(0,n.getOrElseW)(()=>{})(e.RichTextNodeTypeCodec.decode(w)));return b.length?r.success(b.join(",")):r.success(e.DEFAULT_OPTION)}),p=>p),s=p=>{if(!p)return r.success([])},c=p=>{if(p instanceof Object){const h=p;if(!Object.entries(h).length)return r.success([]);if(h[""])return r.success(h[""].map(y=>y.name));const v=Object.entries(h).reduce((y,[,b])=>y.concat(b.map(w=>w.name)),[]).filter(Boolean);return r.success(v)}},l=p=>{if(p instanceof Array&&p.reduce((v,y)=>v&&typeof y=="string",!0))return r.success(p)},f=p=>{if(typeof p=="string")return r.success([p])},d=new r.Type("RichTextLabels",p=>p instanceof Array,(p,h)=>{const v=r.record(r.string,r.readonlyArray(r.record(r.literal("name"),r.string))),y=r.readonlyArray(r.string);return n.either.chain(r.union([v,y,r.string,r.null]).validate(p,h),b=>s(b)||l(b)||c(b)||f(b)||r.failure(p,h))},p=>p);e.RichTextConfig=r.exact(r.partial({label:i.StringOrNull,placeholder:r.string,useAsTitle:r.boolean,single:u,multi:u,imageConstraint:o.default,labels:d,allowTargetBlank:r.boolean})),e.RichText=r.exact(r.intersection([r.type({type:r.literal(a.WidgetTypes.RichText)}),r.partial({fieldset:i.StringOrNull,config:e.RichTextConfig})]))})(Ob);var wb={};Object.defineProperty(wb,"__esModule",{value:!0});const H0e=K.exports,zr=(0,H0e.__importStar)(Q),Eb=Xe,J0e=ht,G0e=zr.exact(zr.partial({label:Eb.StringOrNull,placeholder:zr.string,default_value:zr.string,options:zr.readonlyArray(zr.union([zr.string,Eb.StringFromNumber,Eb.StringFromBoolean]))})),Y0e=zr.exact(zr.intersection([zr.type({type:zr.literal(J0e.WidgetTypes.Select)}),zr.partial({fieldset:Eb.StringOrNull,config:G0e})]));wb.default=Y0e;var Rb={};Object.defineProperty(Rb,"__esModule",{value:!0});const Z0e=K.exports,sc=(0,Z0e.__importStar)(Q),X0e=Xe,Q0e=ht,eTe=sc.exact(sc.partial({label:X0e.StringOrNull})),tTe=sc.exact(sc.intersection([sc.type({type:sc.literal(Q0e.WidgetTypes.Separator)}),sc.partial({config:eTe})]));Rb.default=tTe;var Mb={};Object.defineProperty(Mb,"__esModule",{value:!0});const nTe=K.exports,da=(0,nTe.__importStar)(Q),oK=Xe,rTe=ht,iTe=da.exact(da.partial({label:oK.StringOrNull,useAsTitle:da.boolean,placeholder:da.string})),oTe=da.exact(da.intersection([da.type({type:da.literal(rTe.WidgetTypes.Text)}),da.partial({fieldset:oK.StringOrNull,config:iTe})]));Mb.default=oTe;var Cb={};Object.defineProperty(Cb,"__esModule",{value:!0});const aTe=K.exports,pa=(0,aTe.__importStar)(Q),aK=Xe,uTe=ht,sTe=pa.exact(pa.partial({label:aK.StringOrNull,placeholder:pa.string,default:pa.string})),cTe=pa.exact(pa.intersection([pa.type({type:pa.literal(uTe.WidgetTypes.Timestamp)}),pa.partial({fieldset:aK.StringOrNull,config:sTe})]));Cb.default=cTe,Object.defineProperty(Tu,"__esModule",{value:!0});const Cn=K.exports,lTe=(0,Cn.__importStar)(Q),fTe=(0,Cn.__importDefault)(hb),dTe=(0,Cn.__importDefault)(mb),pTe=(0,Cn.__importDefault)(vb),hTe=(0,Cn.__importDefault)(gb),mTe=(0,Cn.__importDefault)(yb),vTe=(0,Cn.__importDefault)(bb),gTe=(0,Cn.__importDefault)($b),yTe=(0,Cn.__importDefault)(Sb),bTe=(0,Cn.__importDefault)(Tb),_Te=(0,Cn.__importDefault)(Ib),$Te=Ob,STe=(0,Cn.__importDefault)(wb),TTe=(0,Cn.__importDefault)(Rb),ITe=(0,Cn.__importDefault)(Mb),OTe=(0,Cn.__importDefault)(Cb),wTe=lTe.union([dTe.default,fTe.default,hTe.default,mTe.default,pTe.default,bTe.default,_Te.default,$Te.RichText,STe.default,TTe.default,ITe.default,OTe.default,yTe.default,vTe.default,gTe.default]);Tu.default=wTe,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.Text=e.Separator=e.Select=e.Range=e.Number=e.NestableWidget=e.Link=e.IntegrationField=e.Image=e.GeoPoint=e.Embed=e.Date=e.Color=e.BooleanField=void 0;const t=K.exports;var n=hb;Object.defineProperty(e,"BooleanField",{enumerable:!0,get:function(){return(0,t.__importDefault)(n).default}});var r=mb;Object.defineProperty(e,"Color",{enumerable:!0,get:function(){return(0,t.__importDefault)(r).default}});var i=vb;Object.defineProperty(e,"Date",{enumerable:!0,get:function(){return(0,t.__importDefault)(i).default}});var o=gb;Object.defineProperty(e,"Embed",{enumerable:!0,get:function(){return(0,t.__importDefault)(o).default}});var a=yb;Object.defineProperty(e,"GeoPoint",{enumerable:!0,get:function(){return(0,t.__importDefault)(a).default}});var u=bb;Object.defineProperty(e,"Image",{enumerable:!0,get:function(){return(0,t.__importDefault)(u).default}});var s=$b;Object.defineProperty(e,"IntegrationField",{enumerable:!0,get:function(){return(0,t.__importDefault)(s).default}});var c=Sb;Object.defineProperty(e,"Link",{enumerable:!0,get:function(){return(0,t.__importDefault)(c).default}});var l=Tu;Object.defineProperty(e,"NestableWidget",{enumerable:!0,get:function(){return(0,t.__importDefault)(l).default}});var f=Tb;Object.defineProperty(e,"Number",{enumerable:!0,get:function(){return(0,t.__importDefault)(f).default}});var d=Ib;Object.defineProperty(e,"Range",{enumerable:!0,get:function(){return(0,t.__importDefault)(d).default}}),(0,t.__exportStar)(Ob,e);var p=wb;Object.defineProperty(e,"Select",{enumerable:!0,get:function(){return(0,t.__importDefault)(p).default}});var h=Rb;Object.defineProperty(e,"Separator",{enumerable:!0,get:function(){return(0,t.__importDefault)(h).default}});var v=Mb;Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return(0,t.__importDefault)(v).default}});var y=Cb;Object.defineProperty(e,"Timestamp",{enumerable:!0,get:function(){return(0,t.__importDefault)(y).default}})}(Ce),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Block=e.TextBlock=e.checkEmbedBlock=e.EmbedBlock=e.checkImageBlock=e.ImageBlock=e.ValidatedMetas=e.Span=e.Meta=void 0;const t=K.exports,n=(0,t.__importStar)($o),r=(0,t.__importStar)(Q),i=Ce,o=Xe,a=je,u=Rf,s=Mf,c=Fh();e.Meta=r.exact(r.intersection([r.partial({data:r.unknown}),r.type({start:r.number,end:r.number,type:r.union([i.RichTextNodeTypeCodec,r.literal("label")])})])),e.Span=e.Meta,e.ValidatedMetas=new r.Type("ValidatedMetas",d=>Array.isArray(d)&&d.every(e.Meta.is),(d,p)=>{if(Array.isArray(d)){const h=d.reduce((v,y)=>{const b=e.Meta.decode(y);if(n.isRight(b)){const w=b.right;if(w.data&&w.type==="hyperlink"&&n.isRight(c.Link.validate(w.data,p))||w.type!=="hyperlink")return[...v,w]}return v},[]).sort((v,y)=>v.start-y.start);return r.success(h)}else return r.failure(d,p)},d=>r.array(e.Meta).encode(d)),e.ImageBlock=r.exact(r.intersection([r.type({type:r.literal(i.RichTextNodeType.image),data:r.intersection([s.ImageContentView,r.partial({linkTo:(0,a.nullable)(c.Link)})])}),r.partial({label:o.StringOrNull,direction:o.StringOrNull})]));function l(d){return d.type===i.RichTextNodeType.image}e.checkImageBlock=l,e.EmbedBlock=r.exact(r.intersection([r.type({type:r.literal(i.RichTextNodeType.embed),data:u.EmbedContent}),r.partial({label:o.StringOrNull,direction:o.StringOrNull})]));function f(d){return d.type===i.RichTextNodeType.embed}e.checkEmbedBlock=f,e.TextBlock=r.exact(r.intersection([r.type({type:(0,a.refineType)(i.RichTextNodeTypeCodec,`string which isn't ${i.RichTextNodeType.image} ${i.RichTextNodeType.embed}`,d=>d!==i.RichTextNodeType.image&&d!==i.RichTextNodeType.embed),content:r.intersection([r.type({text:r.string}),r.partial({spans:e.ValidatedMetas})])}),r.partial({label:r.string,direction:r.string})])),e.Block=r.union([e.ImageBlock,e.EmbedBlock,e.TextBlock])}(pb),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Blocks=e.StructuredTextContent=e.StructuredTextContentType=void 0;const t=K.exports,n=mn,r=(0,t.__importStar)(Q),i=pb;e.StructuredTextContentType="StructuredTextContent",e.StructuredTextContent=new r.Type(e.StructuredTextContentType,o=>{var a;return((a=o)===null||a===void 0?void 0:a.__TYPE__)===e.StructuredTextContentType},(o,a)=>n.Chain.chain(r.array(i.Block).validate(o,a),u=>r.success({value:u,__TYPE__:e.StructuredTextContentType})),()=>{throw new Error("NotImplementedError: Not relevant method")}),e.Blocks=(0,t.__importStar)(pb)}(Dh);var Bh={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UIDContent=e.UIDContentType=void 0;const t=K.exports,n=mn,r=(0,t.__importStar)(Q);e.UIDContentType="UIDContent",e.UIDContent=new r.Type("UIDContent",i=>{var o;return((o=i)===null||o===void 0?void 0:o.__TYPE__)===e.UIDContentType},(i,o)=>n.Chain.chain(r.string.validate(i,o),a=>r.success({value:a,__TYPE__:"UIDContent"})),i=>i.value)})(Bh),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleWidgetContent=e.is=e.SimpleWidgetContentType=void 0;const t=K.exports,n=Un,r=(0,t.__importStar)(yu),i=(0,t.__importStar)(Q),o=(0,t.__importDefault)(kh),a=Rf,u=(0,t.__importDefault)(bu),s=Ah,c=Mf,l=(0,t.__importDefault)(Wh),f=Fh(),d=Dh,p=Bh;e.SimpleWidgetContentType=["EmptyContent","ImageContent","GeoPointContent","EmbedContent","BooleanContent","IntegrationFieldsContent","StructuredTextContent","LinkContent","UIDContent","SeparatorContent","FieldContent"];function h(y){const b=y;return e.SimpleWidgetContentType.includes(b.__TYPE__)}e.is=h;const v=i.type({value:i.null});e.SimpleWidgetContent={from:(y,b)=>{if(b===null||v.is(b)){const w={type:y,__TYPE__:"EmptyContent"};return r.some(w)}switch(y){case"StructuredText":return r.fromEither(d.StructuredTextContent.decode(b));case"IntegrationFields":return r.fromEither(l.default.decode(b));case"Image":return(0,n.pipe)(r.fromEither(c.ImageContent.decode(b)),r.map(w=>c.ImageContent.encode(w)));case"GeoPoint":return(0,n.pipe)(r.fromEither(s.GeoPointContent.decode(b)),r.map(w=>s.GeoPointContent.encode(w)));case"Embed":return r.fromEither(a.EmbedContent.decode(b));case"Link":return r.fromEither(f.LinkContent.decode(b));case"UID":return r.fromEither(p.UIDContent.decode(b));case"Separator":return r.some({__TYPE__:"SeparatorContent"});case"Boolean":return r.fromEither(o.default.decode(b));default:return u.default.types.includes(y)?u.default.forType(y,b):r.none}},is:y=>e.SimpleWidgetContentType.includes(y.__TYPE__)}}(rb),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GroupContent=e.GroupContentType=e.GroupItemContentType=void 0;const t=K.exports,n=(0,t.__importStar)(cq),r=(0,t.__importStar)(yu),i=(0,t.__importStar)(Q),o=rb;e.GroupItemContentType="GroupItemContent",e.GroupContentType="GroupContentType",e.GroupContent=Object.freeze({itemsContentsFromJson:(a,u,s,c)=>u?u.map(l=>{if(typeof l=="object"&&l!==null){const d=Object.entries(l).sort(([p],[h])=>{var v,y;const b=(v=c.get(`${a}.${p}`))!==null&&v!==void 0?v:1e4,w=(y=c.get(`${a}.${h}`))!==null&&y!==void 0?y:1e4;return b-w}).map(([p,h])=>{const v=s.get(`${a}.${p}`);return v?r.map(y=>[p,y])(o.SimpleWidgetContent.from(v,h)):r.none});return{__TYPE__:"GroupItemContent",value:n.compact(d)}}else return{__TYPE__:"GroupItemContent",value:[]}}):[],fromJson:(a,u,s,c,l)=>{const f=Array.of(a,[u]).flat().join("."),d=r.fromEither(i.array(i.unknown).decode(s));return r.map(p=>({value:e.GroupContent.itemsContentsFromJson(f,p,c,l),__TYPE__:e.GroupContentType}))(d)}})}(xh);var xb={},kb={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SeparatorContent=e.SeparatorContentType=void 0;const t=K.exports,n=(0,t.__importStar)(Q);e.SeparatorContentType="SeparatorContent",e.SeparatorContent={codec:n.strict({__TYPE__:n.literal(e.SeparatorContentType)}),is(r){return r.__TYPE__==="SeparatorContent"}}})(kb),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NestableTypes=e.Links=e.IntegrationFieldsContent=e.ImageContentView=e.ImageContent=e.GeoPointContent=e.FieldContent=e.BooleanContent=void 0;const t=K.exports,n=kh,r=Rf,i=bu,o=Ah,a=Mf,u=Wh,s=Fh(),c=kb,l=Dh;var f=kh;Object.defineProperty(e,"BooleanContent",{enumerable:!0,get:function(){return(0,t.__importDefault)(f).default}}),(0,t.__exportStar)(Rf,e);var d=bu;Object.defineProperty(e,"FieldContent",{enumerable:!0,get:function(){return(0,t.__importDefault)(d).default}});var p=Ah;Object.defineProperty(e,"GeoPointContent",{enumerable:!0,get:function(){return p.GeoPointContent}});var h=Mf;Object.defineProperty(e,"ImageContent",{enumerable:!0,get:function(){return h.ImageContent}}),Object.defineProperty(e,"ImageContentView",{enumerable:!0,get:function(){return h.ImageContentView}});var v=Wh;Object.defineProperty(e,"IntegrationFieldsContent",{enumerable:!0,get:function(){return(0,t.__importDefault)(v).default}}),e.Links=(0,t.__importStar)(Fh()),(0,t.__exportStar)(kb,e),(0,t.__exportStar)(Dh,e),e.NestableTypes={Links:s.LinksTypes,StructuredText:l.StructuredTextContentType,Boolean:n.BooleanContentType,Embed:r.EmbedContentType,Field:i.FieldContentType,GeoPoint:o.GeoPointContentType,Image:a.ImageContentType,IntegrationFields:u.IntegrationFieldsContentType,Separator:c.SeparatorContentType}}(xb);var UE={},cc={},uK;function sK(){if(uK)return cc;uK=1,Object.defineProperty(cc,"__esModule",{value:!0}),cc.CompositeSliceContent=cc.CompositeSliceContentType=void 0;const e=K.exports,t=mn,n=(0,e.__importStar)(yu),r=(0,e.__importStar)(Q),i=Iu();cc.CompositeSliceContentType="CompositeSliceContent";const o=r.exact(r.partial({repeat:r.array(r.unknown),"non-repeat":r.UnknownRecord}));return cc.CompositeSliceContent={fromJson:(a,u,s,c,l)=>{var f;const d=Array.of(a,[u,"repeat"]).flat().join("."),p=o.decode(s);if((0,t.isRight)(p)){const h=p.right.repeat,v=(f=p.right["non-repeat"])!==null&&f!==void 0?f:{},y=i.GroupContent.itemsContentsFromJson(d,h,c,l),w=Object.entries(v).sort(([F],[g])=>{var T,I;const W=(T=l.get(`${Array.of(a,[u]).flat().join(".")}.${F}`))!==null&&T!==void 0?T:1e4,E=(I=l.get(`${Array.of(a,[u]).flat().join(".")}.${g}`))!==null&&I!==void 0?I:1e4;return W-E}).reduce((F,[g,T])=>{const I=Array.of(a,[u,"non-repeat",g]).flat().join("."),W=c.get(I);if(W){const E=i.SimpleWidgetContent.from(W,T);n.isSome(E)&&(F[g]=E.value)}return F},{});return n.some({repeat:y,nonRepeat:w,__TYPE__:"CompositeSliceContent"})}else return n.none}},cc}var lc={},cK;function lK(){if(cK)return lc;cK=1,Object.defineProperty(lc,"__esModule",{value:!0}),lc.SharedSliceContent=lc.SharedSliceContentType=void 0;const e=K.exports,t=mn,n=(0,e.__importStar)(yu),r=(0,e.__importStar)(Q),i=NE,o=Iu();lc.SharedSliceContentType="SharedSliceContent";const a=r.exact(r.type({variation:r.string,items:(0,i.withFallback)(r.array(r.unknown),[]),primary:(0,i.withFallback)(r.UnknownRecord,{})}));return lc.SharedSliceContent={fromJson:(u,s,c,l,f)=>{const d=(0,t.map)(p=>{const h=Array.of(u,[s,"variations",p.variation,"items"]).flat().join("."),v=o.GroupContent.itemsContentsFromJson(h,p.items,l,f),b=Object.entries(p.primary).sort(([F],[g])=>{var T,I;const W=(T=f.get(`${Array.of(u,[s]).flat().join(".")}.${F}`))!==null&&T!==void 0?T:1e4,E=(I=f.get(`${Array.of(u,[s]).flat().join(".")}.${g}`))!==null&&I!==void 0?I:1e4;return W-E}).reduce((F,[g,T])=>{const I=Array.of(u,[s,"variations",p.variation,"primary",g]).flat().join("."),W=l.get(I);if(W){const E=o.SimpleWidgetContent.from(W,T);n.isSome(E)&&(F[g]=E.value)}return F},{});return{variation:p.variation,primary:b,items:v,__TYPE__:"SharedSliceContent"}})(a.decode(c));return n.fromEither(d)}},lc}var Ab={},Nf={};Object.defineProperty(Nf,"__esModule",{value:!0});const ETe=K.exports,RTe=(0,ETe.__importStar)(yu),fK=xh,dK=rb,MTe={fromJson:(e,t,n,r,i)=>{const o=Array.of(e,[t]).flat().join("."),a=r.get(o);return a==="Group"?fK.GroupContent.fromJson(e,t,n,r,i):a?dK.SimpleWidgetContent.from(a,n):RTe.none},is:e=>dK.SimpleWidgetContent.is(e)||fK.GroupContentType===e.__TYPE__};Nf.default=MTe,Object.defineProperty(Ab,"__esModule",{value:!0}),Ab.SimpleSliceContent=void 0;const CTe=K.exports,xTe=(0,CTe.__importDefault)(Nf);Ab.SimpleSliceContent=xTe.default;var BE={},zh={},pK;function hK(){if(pK)return zh;pK=1,Object.defineProperty(zh,"__esModule",{value:!0}),zh.SliceWidgetContent=void 0;const e=K.exports,t=(0,e.__importStar)(yu),n=(0,e.__importDefault)(Nf),r=sK(),i=lK();return zh.SliceWidgetContent={fromJson:(o,a,u,s,c)=>{const l=Array.of(o,[a]).flat().join("."),f=s.get(l);return f==="SharedSlice"?i.SharedSliceContent.fromJson(o,a,u,s,c):f==="Slice"?r.CompositeSliceContent.fromJson(o,a,u,s,c):f?n.default.fromJson(o,a,u,s,c):t.none}},zh}var mK;function kTe(){return mK||(mK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SlicesContent=e.SlicesContentType=void 0;const t=K.exports,n=(0,t.__importStar)(cq),r=Un,i=(0,t.__importStar)(yu),o=(0,t.__importStar)(Q),a=je,u=hK();e.SlicesContentType="SliceContentType";const s=o.exact(o.intersection([o.type({key:o.string,value:o.unknown}),o.partial({label:(0,a.nullable)(o.string)})]));e.SlicesContent={itemsCodec:(c,l)=>(0,r.pipe)(s.decode(c),i.fromEither,i.chain(f=>{const d=f.key.indexOf("$"),p=f.key.substring(0,d>0?d:void 0),h=l(p,f.value);return i.map(v=>{var y;return{key:f.key,name:p,maybeLabel:(y=f.label)!==null&&y!==void 0?y:void 0,widget:v}})(h)})),fromJson:(c,l,f,d)=>{if(f.get(c)==="Slices"){const p=i.getOrElse(()=>new Array)(i.fromEither(o.array(o.unknown).decode(l))),h=(v,y)=>u.SliceWidgetContent.fromJson([c],v,y,f,d);return i.some({value:n.compact(p.map(v=>e.SlicesContent.itemsCodec(v,h))),__TYPE__:e.SlicesContentType})}else return console.error("fieldTypes.get(key) !== 'Slices'"),i.none}}}(BE)),BE}var vK;function qh(){return vK||(vK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=K.exports;(0,t.__exportStar)(sK(),e),(0,t.__exportStar)(lK(),e),(0,t.__exportStar)(Ab,e),(0,t.__exportStar)(kTe(),e),(0,t.__exportStar)(hK(),e)}(UE)),UE}var gK;function Iu(){return gK||(gK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Widget=e.WidgetKey=e.WidgetTypes=e.StaticWidgetContent=e.Slices=e.Nestable=void 0;const t=K.exports,n=(0,t.__importStar)(Q),r=je,i=gE,o=xh,a=xb,u=qh(),s=(0,t.__importDefault)(Nf),c=Bh;(0,t.__exportStar)(gE,e),(0,t.__exportStar)(xh,e),e.Nestable=(0,t.__importStar)(xb),(0,t.__exportStar)(rb,e),e.Slices=(0,t.__importStar)(qh());var l=Nf;Object.defineProperty(e,"StaticWidgetContent",{enumerable:!0,get:function(){return(0,t.__importDefault)(l).default}}),(0,t.__exportStar)(Bh,e),e.WidgetTypes={...a.NestableTypes,Empty:i.EmptyContentType,UID:c.UIDContentType,Group:o.GroupContentType,slices:u.SlicesContentType};const f=new RegExp("^[^<>]+$");e.WidgetKey=(0,r.refineType)(n.string,"WidgetKey",d=>d.length===0||f.test(d)),e.Widget={fromJson(d,p,h,v){return h.get(d)==="Slices"?u.SlicesContent.fromJson(d,p,h,v):s.default.fromJson([],d,p,h,v)}}}(vE)),vE}var wi={},Kh={};Object.defineProperty(Kh,"__esModule",{value:!0});const yK=K.exports,Ei=(0,yK.__importStar)(Q),ATe=Iu(),bK=Xe,WTe=(0,yK.__importDefault)(Tu),NTe=ht,PTe=Ei.exact(Ei.partial({label:bK.StringOrNull,repeat:Ei.boolean,fields:Ei.record(ATe.WidgetKey,WTe.default)})),FTe=Ei.exact(Ei.intersection([Ei.type({type:Ei.literal(NTe.WidgetTypes.Group)}),Ei.partial({fieldset:bK.StringOrNull,icon:Ei.string,description:Ei.string,config:PTe})]));Kh.default=FTe;var zE={},Wb={},ha={};Object.defineProperty(ha,"__esModule",{value:!0}),ha.SlicesTypes=void 0,ha.SlicesTypes={Slice:"Slice",SharedSlice:"SharedSlice"},Object.defineProperty(Wb,"__esModule",{value:!0});const _K=K.exports,qr=(0,_K.__importStar)(Q),$K=Iu(),SK=Xe,TK=(0,_K.__importDefault)(Tu),DTe=ha,LTe=qr.exact(qr.partial({label:SK.StringOrNull})),jTe=qr.exact(qr.intersection([qr.type({type:qr.literal(DTe.SlicesTypes.Slice)}),qr.partial({fieldset:SK.StringOrNull,description:qr.string,icon:qr.string,display:qr.string,"non-repeat":qr.record($K.WidgetKey,TK.default),repeat:qr.record($K.WidgetKey,TK.default),config:LTe})]));Wb.default=jTe;var Nb={};Object.defineProperty(Nb,"__esModule",{value:!0});const qE=K.exports,UTe=(0,qE.__importStar)(Q),BTe=(0,qE.__importDefault)(Kh),zTe=(0,qE.__importDefault)(Tu),qTe=UTe.union([zTe.default,BTe.default]);Nb.default=qTe;var KE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SharedSlice=e.Variation=void 0;const t=K.exports,n=(0,t.__importStar)(Q),r=il,i=Iu(),o=(0,t.__importDefault)(Tu),a=ha,u="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,u),docURL:n.string,version:n.string}),n.partial({display:n.string,primary:n.record(i.WidgetKey,o.default),items:n.record(i.WidgetKey,o.default)})])),e.SharedSlice=n.exact(n.intersection([n.type({id:n.string,type:n.literal(a.SlicesTypes.SharedSlice),name:n.string,variations:n.readonlyArray(e.Variation)}),n.partial({description:n.string})]))})(KE);var Pb={};Object.defineProperty(Pb,"__esModule",{value:!0});const KTe=K.exports,VE=(0,KTe.__importStar)(Q),VTe=ha,HTe=VE.exact(VE.type({type:VE.literal(VTe.SlicesTypes.SharedSlice)}));Pb.default=HTe,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Slices=e.DynamicSlices=e.StaticSlices=e.slicesReader=e.DynamicSlicesConfig=e.StaticSlicesConfig=e.slicesConfigReader=e.SlicesLabels=void 0;const t=K.exports,n=(0,t.__importStar)(Q),r=Iu(),i=Xe,o=ht,a=(0,t.__importDefault)(Wb),u=(0,t.__importDefault)(Nb),s=KE,c=(0,t.__importDefault)(Pb),l=ha;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 f(h){return n.exact(n.partial({label:i.StringOrNull,labels:e.SlicesLabels,choices:n.record(r.WidgetKey,n.union([u.default,a.default,h]))}))}e.slicesConfigReader=f,e.StaticSlicesConfig=f(s.SharedSlice),e.DynamicSlicesConfig=f(c.default);const d={toStatic(h,v){const y=Object.entries(h.choices||{}).reduce((b,[w,F])=>{if(F.type===l.SlicesTypes.SharedSlice){const g=v.get(w);return g?{...b,[w]:g}:b}else return{...b,[w]:F}},{});return{...h,choices:y}}};function p(h){return n.exact(n.intersection([n.type({type:n.union([n.literal(o.WidgetTypes.Slices),n.literal(o.WidgetTypes.LegacySlices)])}),n.partial({fieldset:i.StringOrNull,config:h})]))}e.slicesReader=p,e.StaticSlices=p(e.StaticSlicesConfig),e.DynamicSlices=p(e.DynamicSlicesConfig),e.Slices={toStatic(h,v){return h.config?{...h,config:d.toStatic(h.config,v)}:h}}}(zE);var Fb={};Object.defineProperty(Fb,"__esModule",{value:!0});const JTe=K.exports,ma=(0,JTe.__importStar)(Q),IK=Xe,GTe=ht,YTe=ma.exact(ma.partial({label:IK.StringOrNull,useAsTitle:ma.boolean,placeholder:ma.string})),ZTe=ma.exact(ma.intersection([ma.type({type:ma.literal(GTe.WidgetTypes.UID)}),ma.partial({fieldset:IK.StringOrNull,config:YTe})]));Fb.default=ZTe,Object.defineProperty(wi,"__esModule",{value:!0}),wi.Widgets=wi.DynamicWidget=wi.StaticWidget=wi.widgetReader=void 0;const Db=K.exports,XTe=(0,Db.__importStar)(Q),QTe=(0,Db.__importDefault)(Kh),eIe=(0,Db.__importDefault)(Tu),HE=zE,tIe=(0,Db.__importDefault)(Fb),OK=ht;function JE(e){return XTe.union([tIe.default,eIe.default,QTe.default,e])}wi.widgetReader=JE,wi.StaticWidget=JE(HE.StaticSlices),wi.DynamicWidget=JE(HE.DynamicSlices),wi.Widgets={toStatic(e,t){switch(e.type){case OK.WidgetTypes.LegacySlices:case OK.WidgetTypes.Slices:return HE.Slices.toStatic(e,t);default:return e}}},Object.defineProperty(Oi,"__esModule",{value:!0}),Oi.Sections=Oi.DynamicSection=Oi.StaticSection=Oi.sectionReader=void 0;const nIe=K.exports,rIe=(0,nIe.__importStar)(Q),iIe=Iu(),GE=wi;function YE(e){return rIe.record(iIe.WidgetKey,e)}Oi.sectionReader=YE,Oi.StaticSection=YE(GE.StaticWidget),Oi.DynamicSection=YE(GE.DynamicWidget),Oi.Sections={toStatic(e,t){return Object.entries(e).reduce((r,[i,o])=>({...r,[i]:GE.Widgets.toStatic(o,t)}),{})}},Object.defineProperty(pn,"__esModule",{value:!0}),pn.filterMissingSharedSlices=pn.collectWidgets=pn.validateSlices=pn.toStatic=pn.flattenWidgets=pn.CustomType=pn.StaticCustomType=void 0;const oIe=K.exports,wK=$o,oo=(0,oIe.__importStar)(Q),EK=il,aIe=Xe,ZE=Oi,RK=ha,MK=ht;class uIe extends Error{constructor(t){super(),Object.defineProperty(this,"slices",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"message",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.slices=t,this.message=this._formatError(t)}_formatError(t){return`The following slices doesn't exists in your Prismic repository:
|
|
3
|
-
${t.map(r=>` - ${r}`).join(`
|
|
4
|
-
`)}
|
|
5
|
-
`}}function CK(e){return oo.exact(oo.intersection([oo.type({id:oo.string,label:aIe.StringOrNull,repeatable:(0,EK.withFallback)(oo.boolean,!0),json:oo.record(oo.string,e),status:(0,EK.withFallback)(oo.boolean,!0)}),oo.partial({hash:oo.string})]))}pn.StaticCustomType=CK(ZE.StaticSection),pn.CustomType=CK(ZE.DynamicSection);function xK(e){return Object.entries(e.json).reduce((t,[,n])=>{const r=Object.entries(n);return t.concat(r)},[])}pn.flattenWidgets=xK;function sIe(e){return xK(e).filter(([,r])=>r.type===MK.WidgetTypes.Slices).reduce((r,[,i])=>{const o=Object.entries(i.config&&i.config.choices?i.config.choices:{}).filter(([,a])=>a.type===RK.SlicesTypes.SharedSlice).map(([a])=>a);return r.concat(o)},[])}function cIe(e){const t=sIe(e);return function(n){return t.map(n)}}function lIe(e,t){const n=Object.entries(e.json).reduce((r,[i,o])=>({...r,[i]:ZE.Sections.toStatic(o,t)}),{});return{...e,json:n}}pn.toStatic=lIe;function fIe(e,t){const n=cIe(e)(r=>{if(!t.get(r))return r}).filter(Boolean);return n.length>0?(0,wK.left)(new uIe(n)):(0,wK.right)(e)}pn.validateSlices=fIe;function kK(e,t){const n=Object.entries(e.json).reduce((r,[i,o])=>{const a=Object.entries(o).reduce((u,[s,c])=>{const l=t(s,c);return l?{...u,[s]:l}:u},{});return{...r,[i]:a}},{});return{...e,json:n}}pn.collectWidgets=kK;function dIe(e,t){return kK(e,(n,r)=>{if(r.type===MK.WidgetTypes.Slices){if(!r.config||!r.config.choices)return r;const i=Object.entries(r.config.choices).reduce((a,[u,s])=>s.type===RK.SlicesTypes.SharedSlice&&!t.get(u)?a:{...a,[u]:s},{}),o={...r.config,choices:i};return{...r,config:o}}return r})}pn.filterMissingSharedSlices=dIe;var AK={},Lb={};(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={}))})(Lb);var jb={},fc={},Ub={};Object.defineProperty(Ub,"__esModule",{value:!0}),Ub.toRecord=void 0;function pIe(e,t){return e.reduce((n,r)=>{const i=t(r);return{...n,[i]:r}},{})}Ub.toRecord=pIe;var Pf={};Object.defineProperty(Pf,"__esModule",{value:!0}),Pf.isNotEmpty=Pf.zipObjects=void 0;function hIe(e,t){return[...new Set(Object.keys(e||{}).concat(Object.keys(t||{})))].reduce((r,i)=>{const o=e==null?void 0:e[i],a=t==null?void 0:t[i];return{...r,[i]:{left:o,right:a}}},{})}Pf.zipObjects=hIe;function mIe(e){return Boolean(Object.keys(e).length)}Pf.isNotEmpty=mIe,Object.defineProperty(fc,"__esModule",{value:!0}),fc.Objects=fc.Arrays=void 0;const WK=K.exports;fc.Arrays=(0,WK.__importStar)(Ub),fc.Objects=(0,WK.__importStar)(Pf);var Vh={};Object.defineProperty(Vh,"__esModule",{value:!0}),Vh.VariationComparator=void 0;const Bb=fc,Ff=Lb;function vIe(e,t){const n=Bb.Objects.zipObjects(e,t);return Object.entries(n).reduce((r,[i,o])=>i==="primary"||i==="items"||(o==null?void 0:o.left)===(o==null?void 0:o.right)?r:{...r,[i]:o==null?void 0:o.right},{})}function NK(e,t){const n=Bb.Objects.zipObjects(e,t),r=Object.entries(n).reduce((i,[o,a])=>{if(JSON.stringify(a==null?void 0:a.left)===JSON.stringify(a==null?void 0:a.right))return i;const u=(()=>{if(!(!(a!=null&&a.left)&&!(a!=null&&a.right)))return(a==null?void 0:a.left)&&!a.right?{op:Ff.DiffOperation.Removed}:!(a!=null&&a.left)&&(a==null?void 0:a.right)?{op:Ff.DiffOperation.Added,value:a.right}:{op:Ff.DiffOperation.Updated,value:a.right}})();return u?{...i,[o]:u}:i},{});return Bb.Objects.isNotEmpty(r)?r:void 0}Vh.VariationComparator={compare(e,t){if(e&&!t)return{op:Ff.DiffOperation.Removed};if(!e&&t)return{op:Ff.DiffOperation.Added,value:t};const n=vIe(e,t),r=NK(e==null?void 0:e.primary,t==null?void 0:t.primary),i=NK(e==null?void 0:e.items,t==null?void 0:t.items),o={...n,...r?{primary:r}:{},...i?{items:i}:{}};if(Bb.Objects.isNotEmpty(o))return{op:Ff.DiffOperation.Updated,value:o}}},Object.defineProperty(jb,"__esModule",{value:!0}),jb.SliceComparator=void 0;const Df=fc,XE=Lb,gIe=Vh;function yIe(e,t){const n=Df.Objects.zipObjects(e,t);return Object.entries(n).reduce((r,[i,o])=>i==="variations"||(o==null?void 0:o.left)===(o==null?void 0:o.right)?r:{...r,[i]:o==null?void 0:o.right},{})}jb.SliceComparator={compare(e,t){if(!e&&t)return{op:XE.DiffOperation.Added,value:t};if(e&&!t)return{op:XE.DiffOperation.Removed};const n=yIe(e,t),r=Df.Objects.zipObjects(e&&Df.Arrays.toRecord(e.variations,a=>a.id),t&&Df.Arrays.toRecord(t.variations,a=>a.id)),i=Object.entries(r).reduce((a,[u,s])=>{if(!s)return a;const c=gIe.VariationComparator.compare(s.left,s.right);return c?{...a,[u]:c}:a},{}),o={...n,...Df.Objects.isNotEmpty(i)?{variations:i}:{}};if(Df.Objects.isNotEmpty(o))return{op:XE.DiffOperation.Updated,value:o}}},function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=K.exports;(0,t.__exportStar)(Lb,e),(0,t.__exportStar)(jb,e),(0,t.__exportStar)(Vh,e)}(AK);var nt={},PK={};(function(e){var t=se&&se.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageConstraint=void 0;var n=Lh;Object.defineProperty(e,"ImageConstraint",{enumerable:!0,get:function(){return t(n).default}})})(PK);var zb={},FK={};Object.defineProperty(FK,"__esModule",{value:!0}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SlicesTypes=e.SliceZone=e.Slice=e.SharedSliceRef=e.LegacySlice=e.CompositeSlice=void 0;const t=K.exports;var n=Wb;Object.defineProperty(e,"CompositeSlice",{enumerable:!0,get:function(){return(0,t.__importDefault)(n).default}});var r=Nb;Object.defineProperty(e,"LegacySlice",{enumerable:!0,get:function(){return(0,t.__importDefault)(r).default}}),(0,t.__exportStar)(KE,e);var i=Pb;Object.defineProperty(e,"SharedSliceRef",{enumerable:!0,get:function(){return(0,t.__importDefault)(i).default}}),e.Slice=(0,t.__importStar)(FK),e.SliceZone=(0,t.__importStar)(zE);var o=ha;Object.defineProperty(e,"SlicesTypes",{enumerable:!0,get:function(){return o.SlicesTypes}})}(zb),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WidgetTypes=e.Widget=e.UID=e.Slices=e.Shared=e.Nestable=e.Group=void 0;const t=K.exports;var n=Kh;Object.defineProperty(e,"Group",{enumerable:!0,get:function(){return(0,t.__importDefault)(n).default}}),e.Nestable=(0,t.__importStar)(Ce),e.Shared=(0,t.__importStar)(PK),e.Slices=(0,t.__importStar)(zb);var r=Fb;Object.defineProperty(e,"UID",{enumerable:!0,get:function(){return(0,t.__importDefault)(r).default}}),e.Widget=(0,t.__importStar)(wi);var i=ht;Object.defineProperty(e,"WidgetTypes",{enumerable:!0,get:function(){return i.WidgetTypes}})}(nt),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Widgets=e.Section=e.Comparators=void 0;const t=K.exports;(0,t.__exportStar)(pn,e),e.Comparators=(0,t.__importStar)(AK),e.Section=(0,t.__importStar)(Oi),e.Widgets=(0,t.__importStar)(nt)}(kC);const DK={unsplash:{url:"https://unsplash.wroom.io"}},LK=ie.createContext(DK);function bIe(){return ie.useContext(LK)}function _Ie(e){return gi(e.json)}function $Ie(e,t){const n=e.json[t];if(n===void 0)throw new Error(`Cannot find a section with name '${t}'.`);return n}function SIe(e,t){return _f(n=>e[n]!==void 0)(t)}function va(e){return e!=null}function TIe(e){const t=m(e,wy(va));return new Map(th(t))}var ze={},jK={},QE={},Hh={},Ou={},dc={};Object.defineProperty(dc,"__esModule",{value:!0}),dc.BooleanContentType=dc.BooleanContent=void 0;const IIe=K.exports,eR=(0,IIe.__importStar)(Q),UK=kh;dc.BooleanContent=eR.strict({__TYPE__:eR.literal(UK.BooleanContentType),value:eR.boolean}),dc.BooleanContentType=UK.BooleanContentType;var pc={};Object.defineProperty(pc,"__esModule",{value:!0}),pc.EmbedContentType=pc.EmbedContent=void 0;const OIe=K.exports,qb=(0,OIe.__importStar)(Q),tR=Rf;pc.EmbedContent=qb.intersection([tR.EmbedContentC,qb.strict({__TYPE__:qb.literal(tR.EmbedContentType),all:qb.unknown})]),pc.EmbedContentType=tR.EmbedContentType;var nR={},rR={};Object.defineProperty(rR,"__esModule",{value:!0});const wIe=K.exports,EIe=mn,RIe=Un,Kb=(0,wIe.__importStar)(Q);function MIe(e){let t=0;for(;t<e.length&&e[t]<=" ";)t++;let n=e.length;for(;t<n&&e[n-1]<=" ";)n--;return e.substring(t,n)}rR.default=new Kb.Type("TrimmedString",Kb.string.is,(e,t)=>(0,RIe.pipe)(Kb.string.validate(e,t),(0,EIe.chain)(n=>Kb.success(MIe(n)))),e=>e),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FieldContentType=e.FieldContent=e.FieldType=void 0;const t=K.exports,n=(0,t.__importStar)(Q),r=bu,i=(0,t.__importDefault)(rR);e.FieldType=n.keyof({Text:null,Date:null,Timestamp:null,Color:null,Number:null,Range:null,Select:null}),e.FieldContent=n.strict({type:e.FieldType,value:i.default,__TYPE__:n.literal(r.FieldContentType)}),e.FieldContentType=r.FieldContentType}(nR);var hc={};Object.defineProperty(hc,"__esModule",{value:!0}),hc.GeoPointContentType=hc.GeoPointContent=void 0;const CIe=K.exports,iR=(0,CIe.__importStar)(Q),oR=Ah;hc.GeoPointContent=iR.intersection([oR.GeoPointContent,iR.strict({__TYPE__:iR.literal(oR.GeoPointContentType)})]),hc.GeoPointContentType=oR.GeoPointContentType;var ga={};Object.defineProperty(ga,"__esModule",{value:!0}),ga.ImageContentView=ga.ImageContentType=ga.ImageContent=void 0;const xIe=K.exports,aR=(0,xIe.__importStar)(Q),Vb=Mf;ga.ImageContent=aR.intersection([Vb.ImageContent,aR.strict({__TYPE__:aR.literal(Vb.ImageContentType)})]),ga.ImageContentType=Vb.ImageContentType,ga.ImageContentView=Vb.ImageContentView;var mc={};Object.defineProperty(mc,"__esModule",{value:!0}),mc.IntegrationFieldsContentType=mc.IntegrationFieldContent=void 0;const kIe=K.exports,uR=(0,kIe.__importStar)(Q),BK=Wh;mc.IntegrationFieldContent=uR.strict({__TYPE__:uR.literal(BK.IntegrationFieldsContentType),value:uR.string}),mc.IntegrationFieldsContentType=BK.IntegrationFieldsContentType;var sR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinksTypes=e.LinkContentType=e.LinkContent=e.ExternalLinkType=e.ExternalLinkContent=e.DocumentLinkType=e.DocumentLinkContent=e.FileLinkType=e.FileLinkContent=e.ImageLinkType=e.ImageLinkContent=void 0;const t=K.exports,n=(0,t.__importStar)(Q),r=NE,i=ib,o=ob,a=ab,u=db,s=FE();e.ImageLinkContent=n.intersection([n.strict({__TYPE__:n.literal(u.ImageLinkType)}),u.ImageLink]),e.ImageLinkType=u.ImageLinkType,e.FileLinkContent=n.intersection([a.FileLink,n.exact(n.type({__TYPE__:n.literal(a.FileLinkType),size:(0,r.withFallback)(n.string,"0")}))]),e.FileLinkType=a.FileLinkType,e.DocumentLinkContent=n.intersection([n.strict({__TYPE__:n.literal(i.DocumentLinkType)}),i.DocumentLink]),e.DocumentLinkType=i.DocumentLinkType,e.ExternalLinkContent=n.intersection([n.strict({__TYPE__:n.literal(o.ExternalLinkType)}),o.ExternalLink]),e.ExternalLinkType=o.ExternalLinkType,e.LinkContent=n.strict({__TYPE__:n.literal(s.LinkContentType),value:n.union([e.ImageLinkContent,e.FileLinkContent,e.DocumentLinkContent,e.ExternalLinkContent])}),e.LinkContentType=s.LinkContentType,e.LinksTypes={DocumentLink:e.DocumentLinkType,FileLink:e.FileLinkType,ExternalLink:e.ExternalLinkType,ImageLink:e.ImageLinkType,LinkContent:e.LinkContentType}})(sR);var Lf={},xn={};Object.defineProperty(xn,"__esModule",{value:!0}),xn.Block=xn.EmbedBlock=xn.ImageBlock=xn.TextBlock=xn.RichTextContentType=xn.RichTextContent=void 0;const AIe=K.exports,cR=(0,AIe.__importStar)(Q),lR=Dh,Hb=pb;xn.RichTextContent=cR.strict({__TYPE__:cR.literal(lR.StructuredTextContentType),value:cR.array(lR.Blocks.Block)}),xn.RichTextContentType=lR.StructuredTextContentType,xn.TextBlock=Hb.TextBlock,xn.ImageBlock=Hb.ImageBlock,xn.EmbedBlock=Hb.EmbedBlock,xn.Block=Hb.Block;var vc={};Object.defineProperty(vc,"__esModule",{value:!0}),vc.SeparatorContentType=vc.SeparatorContent=void 0;const WIe=K.exports,zK=(0,WIe.__importStar)(Q),qK=kb;vc.SeparatorContent=zK.strict({__TYPE__:zK.literal(qK.SeparatorContentType)}),vc.SeparatorContentType=qK.SeparatorContentType,Object.defineProperty(Lf,"__esModule",{value:!0}),Lf.NestableTypes=Lf.NestableContent=void 0;const NIe=K.exports,PIe=(0,NIe.__importStar)(Q),KK=xb,VK=dc,FIe=pc,HK=nR,JK=hc,GK=ga,YK=mc,ZK=sR,DIe=xn,XK=vc;Lf.NestableContent=PIe.union([VK.BooleanContent,FIe.EmbedContent,HK.FieldContent,JK.GeoPointContent,GK.ImageContent,YK.IntegrationFieldContent,ZK.LinkContent,DIe.RichTextContent,XK.SeparatorContent]),Lf.NestableTypes={Links:ZK.LinksTypes,RichText:KK.StructuredTextContentType,Boolean:VK.BooleanContentType,Embed:KK.EmbedContentType,Field:HK.FieldContentType,GeoPoint:JK.GeoPointContentType,Image:GK.ImageContentType,IntegrationFields:YK.IntegrationFieldsContentType,Separator:XK.SeparatorContentType},function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=K.exports;(0,t.__exportStar)(dc,e),(0,t.__exportStar)(pc,e),(0,t.__exportStar)(nR,e),(0,t.__exportStar)(hc,e),(0,t.__exportStar)(ga,e),(0,t.__exportStar)(mc,e),(0,t.__exportStar)(sR,e),(0,t.__exportStar)(Lf,e),(0,t.__exportStar)(xn,e),(0,t.__exportStar)(vc,e)}(Ou),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GroupContentType=e.GroupContent=e.GroupItemContentType=e.GroupItemContent=void 0;const t=K.exports,n=(0,t.__importStar)(Q),r=xh,i=Ou;e.GroupItemContent=n.strict({__TYPE__:n.literal(r.GroupItemContentType),value:n.array(n.tuple([n.string,i.NestableContent]))}),e.GroupItemContentType=r.GroupItemContentType,e.GroupContent=n.strict({__TYPE__:n.literal(r.GroupContentType),value:n.array(e.GroupItemContent)}),e.GroupContentType=r.GroupContentType}(Hh);var fR={},gc={},Jh={};Object.defineProperty(Jh,"__esModule",{value:!0}),Jh.RepeatableWidgets=void 0;const LIe=K.exports,yc=(0,LIe.__importStar)(Q),jIe=Hh,UIe=Ou,QK=yc.tuple([yc.string,UIe.NestableContent]),BIe=yc.strict({__TYPE__:yc.literal(jIe.GroupItemContentType),value:yc.array(QK)});yc.array(QK),Jh.RepeatableWidgets=yc.array(BIe),Object.defineProperty(gc,"__esModule",{value:!0}),gc.CompositeSliceContentType=gc.CompositeSliceContent=void 0;const zIe=K.exports,Jb=(0,zIe.__importStar)(Q),eV=qh(),qIe=Ou,KIe=Jh;gc.CompositeSliceContent=Jb.strict({__TYPE__:Jb.literal(eV.CompositeSliceContentType),nonRepeat:Jb.record(Jb.string,qIe.NestableContent),repeat:KIe.RepeatableWidgets}),gc.CompositeSliceContentType=eV.CompositeSliceContentType;var bc={};Object.defineProperty(bc,"__esModule",{value:!0}),bc.SharedSliceContentType=bc.SharedSliceContent=void 0;const VIe=K.exports,Gh=(0,VIe.__importStar)(Q),tV=qh(),HIe=Ou,JIe=Jh;bc.SharedSliceContent=Gh.strict({__TYPE__:Gh.literal(tV.SharedSliceContentType),variation:Gh.string,primary:Gh.record(Gh.string,HIe.NestableContent),items:JIe.RepeatableWidgets}),bc.SharedSliceContentType=tV.SharedSliceContentType;var Yh={};Object.defineProperty(Yh,"__esModule",{value:!0}),Yh.SimpleSliceContent=void 0;const GIe=K.exports,YIe=(0,GIe.__importStar)(Q),ZIe=Hh,XIe=Ou;Yh.SimpleSliceContent=YIe.union([XIe.NestableContent,ZIe.GroupContent]);var nV={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SlicesContentType=e.SlicesContent=e.SliceItemContent=void 0;const t=K.exports,n=(0,t.__importStar)(Q),r=qh(),i=gc,o=bc,a=Yh;e.SliceItemContent=n.type({key:n.string,name:n.string,maybeLabel:n.union([n.string,n.undefined]),widget:n.union([i.CompositeSliceContent,o.SharedSliceContent,a.SimpleSliceContent])}),e.SlicesContent=n.type({__TYPE__:n.literal(r.SlicesContentType),value:n.array(e.SliceItemContent)}),e.SlicesContentType=r.SlicesContentType})(nV),function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=K.exports;(0,t.__exportStar)(gc,e),(0,t.__exportStar)(bc,e),(0,t.__exportStar)(Yh,e),(0,t.__exportStar)(nV,e)}(fR);var _c={};Object.defineProperty(_c,"__esModule",{value:!0}),_c.UIDContentType=_c.UIDContent=void 0;const QIe=K.exports,dR=(0,QIe.__importStar)(Q),rV=Bh;_c.UIDContent=dR.type({__TYPE__:dR.literal(rV.UIDContentType),value:dR.string}),_c.UIDContentType=rV.UIDContentType,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WidgetTypes=e.WidgetContent=void 0;const t=K.exports,n=(0,t.__importStar)(Q),r=Hh,i=Ou,o=fR,a=_c;(0,t.__exportStar)(Hh,e),(0,t.__exportStar)(Ou,e),(0,t.__exportStar)(fR,e),(0,t.__exportStar)(_c,e),e.WidgetContent=n.union([r.GroupContent,i.NestableContent,a.UIDContent,o.SlicesContent]),e.WidgetTypes={...i.NestableTypes,UID:a.UIDContentType,Group:r.GroupContentType,slices:o.SlicesContentType}}(QE),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CustomTypeContent=e.WidgetKey=void 0;const t=K.exports,n=(0,t.__importStar)(Q),r=Iu(),i=QE;e.WidgetKey=r.WidgetKey;const o=n.union([i.SlicesContent,i.UIDContent,i.NestableContent,i.GroupContent]);e.CustomTypeContent=n.record(e.WidgetKey,o)}(jK),function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=K.exports;(0,t.__exportStar)(jK,e),(0,t.__exportStar)(QE,e)}(ze);function eOe(e){return e.type===nt.WidgetTypes.LegacySlices||e.type===nt.WidgetTypes.Slices}function tOe(e){return e.__TYPE__===ze.WidgetTypes.slices}function pR(e){return Object.entries(e).filter(t=>t[1]!==void 0)}function gt(e,t){return e===void 0||!t(e)?void 0:e}function nOe(e){const t=m(e,Ey(eOe),S$(th));return[Md(t),Cd(t)]}function rOe(e,t){return m(t,_f((n,r)=>e[n]!==void 0&&(r===void 0||ze.GroupContent.is(r)||ze.UIDContent.is(r)||ze.NestableContent.is(r))))}function iOe(e){return e.__TYPE__==="SharedSliceContent"}function oOe(e){return e.__TYPE__==="CompositeSliceContent"}function aOe(e){return e.__TYPE__!=="CompositeSliceContent"&&e.__TYPE__!=="SharedSliceContent"}function uOe(e,t,n){const r=e.value[t];if(r===void 0)throw new Error(`Cannot update undefined content at index ${t}.`);return n?{...e,value:[...e.value.slice(0,t),{...r,widget:n},...e.value.slice(t+1)]}:e}function sOe(e){var t,n,r;return(r=(n=(t=e.config)==null?void 0:t.label)!=null?n:e.fieldset)!=null?r:e.type}function cOe(e){var t;return(t=e["non-repeat"])!=null?t:{}}function lOe(e){var t;return(t=e.repeat)!=null?t:{}}function iV(e){return e.__TYPE__===ze.WidgetTypes.Group}function Gb(e){return e.__TYPE__!==ze.WidgetTypes.Group&&e.__TYPE__!==ze.WidgetTypes.UID}function fOe(e,t,n){return n===void 0?my(t)(e):{...e,[t]:n}}function dOe(e){return e.__TYPE__===ze.WidgetTypes.Field&&e.type==="Color"}function pOe(e){return e.__TYPE__===ze.WidgetTypes.Field&&e.type==="Date"}function hOe(e){return e.__TYPE__===ze.WidgetTypes.GeoPoint}function mOe(e){return e.__TYPE__===ze.WidgetTypes.Image}function vOe(e){return e.__TYPE__===ze.WidgetTypes.Field&&e.type==="Text"}function gOe(e){return e.__TYPE__===ze.WidgetTypes.Field&&e.type==="Number"}function yOe(e){return e.__TYPE__===ze.WidgetTypes.Field&&e.type==="Range"}function bOe(e){return e.__TYPE__===ze.WidgetTypes.Field&&e.type==="Select"}function _Oe(e){return e.__TYPE__===ze.WidgetTypes.Field&&e.type==="Timestamp"}function ya(e){var t,n,r;return(r=(n=(t=e.config)==null?void 0:t.label)!=null?n:e.type===nt.WidgetTypes.BooleanField||e.type===nt.WidgetTypes.Separator?void 0:e.fieldset)!=null?r:e.type}const oV="...";function jf(e,t){var n,r,i,o,a;return e.type===nt.WidgetTypes.BooleanField?(i=t?(n=e.config)==null?void 0:n.placeholder_true:(r=e.config)==null?void 0:r.placeholder_false)!=null?i:oV:e.type===nt.WidgetTypes.GeoPoint?"TODO":(a=(o=e.config)==null?void 0:o.placeholder)!=null?a:oV}var Yb={exports:{}},Zh={};/**
|
|
1
|
+
(function(Sn,K){typeof exports=="object"&&typeof module<"u"?K(exports,require("react"),require("@prismicio/editor-ui"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@prismicio/editor-ui","react-dom"],K):(Sn=typeof globalThis<"u"?globalThis:Sn||self,K(Sn.EditorFields={},Sn.React,Sn.EditorUi,Sn.ReactDOM))})(this,function(Sn,K,N,Wb){"use strict";var _Me=Object.defineProperty;var SMe=(Sn,K,N)=>K in Sn?_Me(Sn,K,{enumerable:!0,configurable:!0,writable:!0,value:N}):Sn[K]=N;var Uh=(Sn,K,N)=>(SMe(Sn,typeof K!="symbol"?K+"":K,N),N);function EC(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=EC(K),h6=EC(Wb);var pe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vc(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 E={},m6={get exports(){return E},set exports(e){E=e}},Pf={};/**
|
|
6
2
|
* @license React
|
|
7
3
|
* react-jsx-runtime.production.min.js
|
|
8
4
|
*
|
|
@@ -10,7 +6,7 @@ ${t.map(r=>` - ${r}`).join(`
|
|
|
10
6
|
*
|
|
11
7
|
* This source code is licensed under the MIT license found in the
|
|
12
8
|
* LICENSE file in the root directory of this source tree.
|
|
13
|
-
*/var
|
|
9
|
+
*/var CC;function v6(){if(CC)return Pf;CC=1;var e=K,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(u,s,c){var l,f={},d=null,p=null;c!==void 0&&(d=""+c),s.key!==void 0&&(d=""+s.key),s.ref!==void 0&&(p=s.ref);for(l in s)r.call(s,l)&&!o.hasOwnProperty(l)&&(f[l]=s[l]);if(u&&u.defaultProps)for(l in s=u.defaultProps,s)f[l]===void 0&&(f[l]=s[l]);return{$$typeof:t,type:u,key:d,ref:p,props:f,_owner:i.current}}return Pf.Fragment=n,Pf.jsx=a,Pf.jsxs=a,Pf}var Lf={};/**
|
|
14
10
|
* @license React
|
|
15
11
|
* react-jsx-runtime.development.js
|
|
16
12
|
*
|
|
@@ -18,29 +14,33 @@ ${t.map(r=>` - ${r}`).join(`
|
|
|
18
14
|
*
|
|
19
15
|
* This source code is licensed under the MIT license found in the
|
|
20
16
|
* LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/var
|
|
22
|
-
`+
|
|
23
|
-
`),
|
|
24
|
-
`),
|
|
25
|
-
`+
|
|
26
|
-
|
|
27
|
-
Check the render method of \``+_+"`."}return""}}function Od(_){{if(_!==void 0){var V=_.fileName.replace(/^.*[\\\/]/,""),te=_.lineNumber;return`
|
|
17
|
+
*/var MC;function g6(){return MC||(MC=1,process.env.NODE_ENV!=="production"&&function(){var e=K,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(O){if(O===null||typeof O!="object")return null;var U=h&&O[h]||O[v];return typeof U=="function"?U:null}var _=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(O){{for(var U=arguments.length,te=new Array(U>1?U-1:0),$e=1;$e<U;$e++)te[$e-1]=arguments[$e];S("error",O,te)}}function S(O,U,te){{var $e=_.ReactDebugCurrentFrame,Ze=$e.getStackAddendum();Ze!==""&&(U+="%s",te=te.concat([Ze]));var at=te.map(function(Ve){return String(Ve)});at.unshift("Warning: "+U),Function.prototype.apply.call(console[O],console,at)}}var b=!1,$=!1,T=!1,C=!1,R=!1,q;q=Symbol.for("react.module.reference");function G(O){return!!(typeof O=="string"||typeof O=="function"||O===r||O===o||R||O===i||O===c||O===l||C||O===p||b||$||T||typeof O=="object"&&O!==null&&(O.$$typeof===d||O.$$typeof===f||O.$$typeof===a||O.$$typeof===u||O.$$typeof===s||O.$$typeof===q||O.getModuleId!==void 0))}function A(O,U,te){var $e=O.displayName;if($e)return $e;var Ze=U.displayName||U.name||"";return Ze!==""?te+"("+Ze+")":te}function Y(O){return O.displayName||"Context"}function ie(O){if(O==null)return null;if(typeof O.tag=="number"&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof O=="function")return O.displayName||O.name||null;if(typeof O=="string")return O;switch(O){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 O=="object")switch(O.$$typeof){case u:var U=O;return Y(U)+".Consumer";case a:var te=O;return Y(te._context)+".Provider";case s:return A(O,O.render,"ForwardRef");case f:var $e=O.displayName||null;return $e!==null?$e:ie(O.type)||"Memo";case d:{var Ze=O,at=Ze._payload,Ve=Ze._init;try{return ie(Ve(at))}catch{return null}}}return null}var J=Object.assign,ge=0,Te,M,x,w,I,F,L;function Z(){}Z.__reactDisabledLog=!0;function ee(){{if(ge===0){Te=console.log,M=console.info,x=console.warn,w=console.error,I=console.group,F=console.groupCollapsed,L=console.groupEnd;var O={configurable:!0,enumerable:!0,value:Z,writable:!0};Object.defineProperties(console,{info:O,log:O,warn:O,error:O,group:O,groupCollapsed:O,groupEnd:O})}ge++}}function Ee(){{if(ge--,ge===0){var O={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:J({},O,{value:Te}),info:J({},O,{value:M}),warn:J({},O,{value:x}),error:J({},O,{value:w}),group:J({},O,{value:I}),groupCollapsed:J({},O,{value:F}),groupEnd:J({},O,{value:L})})}ge<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ue=_.ReactCurrentDispatcher,xe;function Be(O,U,te){{if(xe===void 0)try{throw Error()}catch(Ze){var $e=Ze.stack.trim().match(/\n( *(at )?)/);xe=$e&&$e[1]||""}return`
|
|
18
|
+
`+xe+O}}var Ke=!1,it;{var Ft=typeof WeakMap=="function"?WeakMap:Map;it=new Ft}function qt(O,U){if(!O||Ke)return"";{var te=it.get(O);if(te!==void 0)return te}var $e;Ke=!0;var Ze=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var at;at=ue.current,ue.current=null,ee();try{if(U){var Ve=function(){throw Error()};if(Object.defineProperty(Ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ve,[])}catch(Ta){$e=Ta}Reflect.construct(O,[],Ve)}else{try{Ve.call()}catch(Ta){$e=Ta}O.call(Ve.prototype)}}else{try{throw Error()}catch(Ta){$e=Ta}O()}}catch(Ta){if(Ta&&$e&&typeof Ta.stack=="string"){for(var We=Ta.stack.split(`
|
|
19
|
+
`),Kn=$e.stack.split(`
|
|
20
|
+
`),Wt=We.length-1,Ut=Kn.length-1;Wt>=1&&Ut>=0&&We[Wt]!==Kn[Ut];)Ut--;for(;Wt>=1&&Ut>=0;Wt--,Ut--)if(We[Wt]!==Kn[Ut]){if(Wt!==1||Ut!==1)do if(Wt--,Ut--,Ut<0||We[Wt]!==Kn[Ut]){var ei=`
|
|
21
|
+
`+We[Wt].replace(" at new "," at ");return O.displayName&&ei.includes("<anonymous>")&&(ei=ei.replace("<anonymous>",O.displayName)),typeof O=="function"&&it.set(O,ei),ei}while(Wt>=1&&Ut>=0);break}}}finally{Ke=!1,ue.current=at,Ee(),Error.prepareStackTrace=Ze}var Wf=O?O.displayName||O.name:"",f6=Wf?Be(Wf):"";return typeof O=="function"&&it.set(O,f6),f6}function Ht(O,U,te){return qt(O,!1)}function Mn(O){var U=O.prototype;return!!(U&&U.isReactComponent)}function kr(O,U,te){if(O==null)return"";if(typeof O=="function")return qt(O,Mn(O));if(typeof O=="string")return Be(O);switch(O){case c:return Be("Suspense");case l:return Be("SuspenseList")}if(typeof O=="object")switch(O.$$typeof){case s:return Ht(O.render);case f:return kr(O.type,U,te);case d:{var $e=O,Ze=$e._payload,at=$e._init;try{return kr(at(Ze),U,te)}catch{}}}return""}var lr=Object.prototype.hasOwnProperty,X={},ne=_.ReactDebugCurrentFrame;function Ce(O){if(O){var U=O._owner,te=kr(O.type,O._source,U?U.type:null);ne.setExtraStackFrame(te)}else ne.setExtraStackFrame(null)}function Ot(O,U,te,$e,Ze){{var at=Function.call.bind(lr);for(var Ve in O)if(at(O,Ve)){var We=void 0;try{if(typeof O[Ve]!="function"){var Kn=Error(($e||"React class")+": "+te+" type `"+Ve+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof O[Ve]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Kn.name="Invariant Violation",Kn}We=O[Ve](U,Ve,$e,te,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Wt){We=Wt}We&&!(We instanceof Error)&&(Ce(Ze),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).",$e||"React class",te,Ve,typeof We),Ce(null)),We instanceof Error&&!(We.message in X)&&(X[We.message]=!0,Ce(Ze),g("Failed %s type: %s",te,We.message),Ce(null))}}}var Xr=Array.isArray;function Fi(O){return Xr(O)}function Wi(O){{var U=typeof Symbol=="function"&&Symbol.toStringTag,te=U&&O[Symbol.toStringTag]||O.constructor.name||"Object";return te}}function ba(O){try{return _a(O),!1}catch{return!0}}function _a(O){return""+O}function Sa(O){if(ba(O))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Wi(O)),_a(O)}var Qr=_.ReactCurrentOwner,Cu={key:!0,ref:!0,__self:!0,__source:!0},xf,W,k;k={};function D(O){if(lr.call(O,"ref")){var U=Object.getOwnPropertyDescriptor(O,"ref").get;if(U&&U.isReactWarning)return!1}return O.ref!==void 0}function Ae(O){if(lr.call(O,"key")){var U=Object.getOwnPropertyDescriptor(O,"key").get;if(U&&U.isReactWarning)return!1}return O.key!==void 0}function P(O,U){if(typeof O.ref=="string"&&Qr.current&&U&&Qr.current.stateNode!==U){var te=ie(Qr.current.type);k[te]||(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(Qr.current.type),O.ref),k[te]=!0)}}function oe(O,U){{var te=function(){xf||(xf=!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)",U))};te.isReactWarning=!0,Object.defineProperty(O,"key",{get:te,configurable:!0})}}function ve(O,U){{var te=function(){W||(W=!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)",U))};te.isReactWarning=!0,Object.defineProperty(O,"ref",{get:te,configurable:!0})}}var me=function(O,U,te,$e,Ze,at,Ve){var We={$$typeof:t,type:O,key:U,ref:te,props:Ve,_owner:at};return We._store={},Object.defineProperty(We._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(We,"_self",{configurable:!1,enumerable:!1,writable:!1,value:$e}),Object.defineProperty(We,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Ze}),Object.freeze&&(Object.freeze(We.props),Object.freeze(We)),We};function Ie(O,U,te,$e,Ze){{var at,Ve={},We=null,Kn=null;te!==void 0&&(Sa(te),We=""+te),Ae(U)&&(Sa(U.key),We=""+U.key),D(U)&&(Kn=U.ref,P(U,Ze));for(at in U)lr.call(U,at)&&!Cu.hasOwnProperty(at)&&(Ve[at]=U[at]);if(O&&O.defaultProps){var Wt=O.defaultProps;for(at in Wt)Ve[at]===void 0&&(Ve[at]=Wt[at])}if(We||Kn){var Ut=typeof O=="function"?O.displayName||O.name||"Unknown":O;We&&oe(Ve,Ut),Kn&&ve(Ve,Ut)}return me(O,We,Kn,Ze,$e,Qr.current,Ve)}}var st=_.ReactCurrentOwner,zn=_.ReactDebugCurrentFrame;function Ar(O){if(O){var U=O._owner,te=kr(O.type,O._source,U?U.type:null);zn.setExtraStackFrame(te)}else zn.setExtraStackFrame(null)}var kf;kf=!1;function Pi(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function Af(){{if(st.current){var O=ie(st.current.type);if(O)return`
|
|
28
22
|
|
|
29
|
-
Check
|
|
23
|
+
Check the render method of \``+O+"`."}return""}}function Nf(O){{if(O!==void 0){var U=O.fileName.replace(/^.*[\\\/]/,""),te=O.lineNumber;return`
|
|
30
24
|
|
|
31
|
-
Check the top-level render call using <`+te+">.")}return V}}function wd(_,V){{if(!_._store||_._store.validated||_.key!=null)return;_._store.validated=!0;var te=MC(V);if(Fa[te])return;Fa[te]=!0;var _e="";_&&_._owner&&_._owner!==ot.current&&(_e=" It was passed a child from "+O(_._owner.type)+"."),Cr(_),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',te,_e),Cr(null)}}function Kc(_,V){{if(typeof _!="object")return;if(Pi(_))for(var te=0;te<_.length;te++){var _e=_[te];Di(_e)&&wd(_e,V)}else if(Di(_))_._store&&(_._store.validated=!0);else if(_){var He=y(_);if(typeof He=="function"&&He!==_.entries)for(var rt=He.call(_),Le;!(Le=rt.next()).done;)Di(Le.value)&&wd(Le.value,V)}}}function PWe(_){{var V=_.type;if(V==null||typeof V=="string")return;var te;if(typeof V=="function")te=V.propTypes;else if(typeof V=="object"&&(V.$$typeof===s||V.$$typeof===f))te=V.propTypes;else return;if(te){var _e=O(V);ar(te,_.props,"prop",_e,_)}else if(V.PropTypes!==void 0&&!Td){Td=!0;var He=O(V);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",He||"Unknown")}typeof V.getDefaultProps=="function"&&!V.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function FWe(_){{for(var V=Object.keys(_.props),te=0;te<V.length;te++){var _e=V[te];if(_e!=="children"&&_e!=="key"){Cr(_),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",_e),Cr(null);break}}_.ref!==null&&(Cr(_),w("Invalid attribute `ref` supplied to `React.Fragment`."),Cr(null))}}function JH(_,V,te,_e,He,rt){{var Le=q(_);if(!Le){var Ae="";(_===void 0||typeof _=="object"&&_!==null&&Object.keys(_).length===0)&&(Ae+=" 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 Fn=Od(He);Fn?Ae+=Fn:Ae+=Id();var Mt;_===null?Mt="null":Pi(_)?Mt="array":_!==void 0&&_.$$typeof===t?(Mt="<"+(O(_.type)||"Unknown")+" />",Ae=" Did you accidentally export a JSX literal instead of a component?"):Mt=typeof _,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Mt,Ae)}var At=$e(_,V,te,He,rt);if(At==null)return At;if(Le){var ti=V.children;if(ti!==void 0)if(_e)if(Pi(ti)){for(var Ed=0;Ed<ti.length;Ed++)Kc(ti[Ed],_);Object.freeze&&Object.freeze(ti)}else w("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 Kc(ti,_)}return _===r?FWe(At):PWe(At),At}}function DWe(_,V,te){return JH(_,V,te,!0)}function LWe(_,V,te){return JH(_,V,te,!1)}var jWe=LWe,UWe=DWe;Xh.Fragment=r,Xh.jsx=jWe,Xh.jsxs=UWe}()),Xh}(function(e){process.env.NODE_ENV==="production"?e.exports=$Oe():e.exports=SOe()})(Yb);const $c=Yb.exports.Fragment,C=Yb.exports.jsx,qe=Yb.exports.jsxs,TOe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var a,u,s;const o=(s=(u=e==null?void 0:e.value)!=null?u:(a=t.config)==null?void 0:a.default_value)!=null?s:!1;return qe(A.Field,{children:[C(A.FieldIcon,{children:C(A.Icon,{name:"toggleOff"})}),C(A.FieldLabel,{htmlFor:n,children:ya(t)}),qe(A.FieldControl,{children:[C(A.Text,{children:jf(t,o)}),C(A.Switch,{checked:o,id:n,onCheckedChange:c=>{i||r(IOe(c))}})]})]})};function IOe(e){return{__TYPE__:"BooleanContent",value:e}}const OOe=e=>e===void 0?void 0:{__TYPE__:ze.WidgetTypes.Field,type:"Date",value:e},wOe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var a;const o=(a=e==null?void 0:e.value)!=null?a:"";return qe(A.Field,{children:[C(A.FieldIcon,{children:C(A.Icon,{name:"dateRange"})}),C(A.FieldLabel,{htmlFor:n,children:ya(t)}),C(A.FieldControl,{children:C(A.DateInput,{id:n,placeholder:jf(t),readOnly:i,value:o,onValueChange:u=>r(OOe(u))})})]})},Qh="__MAIN_THUMBNAIL__";function sV(e,t,n){var o,a,u,s;const r=e.name===Qh?void 0:e.name;let i;return t?va(n)?i=[n.width,n.height]:va(e.width)||va(e.height)?i=[(o=e.width)!=null?o:void 0,(a=e.height)!=null?a:void 0]:i=[t.origin.width,t.origin.height]:i=void 0,[r,i?`${(u=i[0])!=null?u:"auto"}x${(s=i[1])!=null?s:"auto"}px`:void 0]}function EOe(e){var t,n,r;return[{...(t=e.config)==null?void 0:t.constraint,name:Qh}].concat((r=(n=e.config)==null?void 0:n.thumbnails)!=null?r:[])}function ROe(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!=null?o:[]]}function MOe(e,t,n,r){const i=r.length===0?void 0:r;return e===Qh?{...t,alt:i}:{...t,thumbnails:{...t.thumbnails,[e]:{...n,alt:i}}}}function cV(e,t){const{width:n,height:r}=t!=null?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 lV(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 fV(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 COe(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 dV=({contentView:e,constraints:t,croppedImage:n})=>{const[r,i]=cV(e.origin,t),o=lV(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}}}},xOe=({field:e,content:t,thumbnail:n,croppedImage:r})=>{var u,s,c,l;if(n===Qh){const f=dV({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=dV({contentView:o,constraints:i,croppedImage:r});return a.url===o.url?t:{...t,thumbnails:{...t.thumbnails,[n]:a}}},kOe=({initialSize:e,constraints:t})=>{const n=(t==null?void 0:t.width)&&(t==null?void 0: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)}},AOe=({contentView:e,constraints:t})=>{var a;const n=kOe({initialSize:e.origin,constraints:t}),r=(a=e.edit.zoom)!=null?a:1,i=Math.round(n.width/r),o=Math.round(n.height/r);return{...e.edit.crop,width:i,height:o,zoom:r}};function WOe(e,t){const n={};for(const r in e)n[r]=t(e[r],r);return n}function NOe(e,t,n,r){var u,s,c,l,f,d,p;if(!n){const h=(u=t.config)==null?void 0:u.thumbnails,v=h&&Object.fromEntries(h.map(y=>[y.name,Zb(r,y)]));return{__TYPE__:"ImageContent",...Zb(r,(s=t.config)==null?void 0:s.constraint),thumbnails:v}}if(e===Qh){const h=Zb(r,(c=t.config)==null?void 0:c.constraint);return h.url===n.url?n:{...n,...h}}const i=(f=(l=t.config)==null?void 0:l.thumbnails)==null?void 0:f.find(h=>h.name===e);if(!i)return n;const o=(d=n.thumbnails)==null?void 0:d[e],a=Zb(r,i);return a.url===(o==null?void 0:o.url)?n:{...n,thumbnails:WOe((p=n.thumbnails)!=null?p:{},(h,v)=>v===e?a:h)}}function Zb(e,t){const{width:n,height:r,rect:i}=POe(e,t),o=Boolean((t==null?void 0:t.width)||(t==null?void 0:t.height));return{url:lV(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 POe(e,t){const[n,r]=cV(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 pV={x:0,y:0,width:0,height:0,zoom:1},FOe=({selectedImage:{thumbnail:e,contentView:t}})=>e.width&&e.height?e.width/e.height:t?t.origin.width/t.origin.height:1,DOe=({trigger:e,initialImages:t,initialOption:n,onClose:r})=>{var I,W,E,J,q,x;const[i,o]=ye.useState({}),[a,u]=ye.useState({}),[s,c]=ye.useState(!1),[l,f]=ye.useState(!1),[d,p]=ye.useState(n),h=t[d],v=G=>{var k;if(!h)return;const O=h.thumbnail.name,R=(k=i[O])!=null?k:pV;o({...i,[O]:{...R,zoom:G}})},y=G=>{var k;if(!h)return;const O=h.thumbnail.name,R=(k=i[O])!=null?k:pV;o({...i,[O]:{...R,...G}})},b=G=>{if(!h)return;const O=h.thumbnail.name,R=a[O];u({...a,[O]:{...R,crop:G}})},w=G=>{var k;if(!h)return;const O=h.thumbnail.name,R=(k=a[O])!=null?k:{};u({...a,[O]:{...R,aspectRatio:G}})},F=i[(I=h==null?void 0:h.thumbnail.name)!=null?I:""],g=s?F!=null?F:(h==null?void 0:h.contentView)&&AOe({contentView:h.contentView,constraints:h.thumbnail}):void 0,T=a[(W=h==null?void 0:h.thumbnail.name)!=null?W:""];return qe(A.Dialog,{trigger:e,onAnimationEnd:()=>f(!0),open:s,onOpenChange:G=>{G?(p(n),o({}),u({})):(f(!1),r({option:d,croppedImages:i})),c(G)},children:[C(A.DialogHeader,{icon:"photo",title:"Image editor"}),C(A.DialogOptions,{value:String(d),onValueChange:G=>p(Number(G)),children:t.map((G,O)=>{var R,k;return C(A.DialogOptionsItem,{value:String(O),icon:"photo",title:(R=G.labels[0])!=null?R:"Main",subtitle:(k=G.labels[1])!=null?k:""},G.thumbnail.name)})}),h&&C(A.DialogContent,{children:l&&C(A.CropperControls,{image:(J=(E=h.contentView)==null?void 0:E.origin.url)!=null?J:"",crop:(q=T==null?void 0:T.crop)!=null?q:{x:0,y:0},onCropChange:b,zoom:(x=F==null?void 0:F.zoom)!=null?x:1,onZoomChange:v,aspectRatio:FOe({selectedImage:h,cropper:T}),onAspectRatioChange:w,initialCroppedArea:g,onCropAreaChange:y},h.thumbnail.name)})]})};function LOe(e){const t=ie.useRef(e);return ie.useLayoutEffect(()=>{t.current=e}),ie.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function jOe(){const[e,t]=ie.useState({});return ie.useCallback(()=>t({}),[])}function UOe(e,t,n){ie.useEffect(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[e])}var Ge;(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})(Ge||(Ge={}));const ae=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Sc=e=>{switch(typeof e){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(e)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"object":return Array.isArray(e)?ae.array:e===null?ae.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ae.promise:typeof Map<"u"&&e instanceof Map?ae.map:typeof Set<"u"&&e instanceof Set?ae.set:typeof Date<"u"&&e instanceof Date?ae.date:ae.object;default:return ae.unknown}},ne=Ge.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"]);class wu 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,Ge.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()}}wu.create=e=>new wu(e);const Xb=(e,t)=>{let n;switch(e.code){case ne.invalid_type:e.received===ae.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ne.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ge.jsonStringifyReplacer)}`;break;case ne.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ge.joinValues(e.keys,", ")}`;break;case ne.invalid_union:n="Invalid input";break;case ne.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ge.joinValues(e.options)}`;break;case ne.invalid_enum_value:n=`Invalid enum value. Expected ${Ge.joinValues(e.options)}, received '${e.received}'`;break;case ne.invalid_arguments:n="Invalid function arguments";break;case ne.invalid_return_type:n="Invalid function return type";break;case ne.invalid_date:n="Invalid date";break;case ne.invalid_string:typeof e.validation=="object"?"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}"`:Ge.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ne.too_small:e.type==="array"?n=`Array must contain ${e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be greater than ${e.inclusive?"or equal to ":""}${e.minimum}`:e.type==="date"?n=`Date must be greater than ${e.inclusive?"or equal to ":""}${new Date(e.minimum)}`:n="Invalid input";break;case ne.too_big:e.type==="array"?n=`Array must contain ${e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be less than ${e.inclusive?"or equal to ":""}${e.maximum}`:e.type==="date"?n=`Date must be smaller than ${e.inclusive?"or equal to ":""}${new Date(e.maximum)}`:n="Invalid input";break;case ne.custom:n="Invalid input";break;case ne.invalid_intersection_types:n="Intersection results could not be merged";break;case ne.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;default:n=t.defaultError,Ge.assertNever(e)}return{message:n}};let BOe=Xb;function hR(){return BOe}const mR=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}};function fe(e,t){const n=mR({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,hR(),Xb].filter(r=>!!r)});e.common.issues.push(n)}class Qn{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 we;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 Qn.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 we;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 we=Object.freeze({status:"aborted"}),er=e=>({status:"valid",value:e}),hV=e=>e.status==="aborted",mV=e=>e.status==="dirty",vR=e=>e.status==="valid",vV=e=>typeof Promise!==void 0&&e instanceof Promise;var Ke;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ke||(Ke={}));class ao{constructor(t,n,r,i){this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._path.concat(this._key)}}const gV=(e,t)=>{if(vR(t))return{success:!0,data:t.value};{if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");const n=new wu(e.common.issues);return{success:!1,error:n}}};function xe(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!=null?r:u.defaultError}:{message:n!=null?n:u.defaultError},description:i}}class Ue{constructor(t){this.spa=this.safeParseAsync,this.superRefine=this._refinement,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.default=this.default.bind(this),this.describe=this.describe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Sc(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Sc(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Qn,ctx:{common:t.parent.common,data:t.data,parsedType:Sc(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(vV(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:Sc(t)},o=this._parseSync({data:t,path:i.path,parent:i});return gV(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:Sc(t)},i=this._parse({data:t,path:[],parent:r}),o=await(vV(i)?i:Promise.resolve(i));return gV(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:ne.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 Ru({schema:this,typeName:Se.ZodEffects,effect:{type:"refinement",refinement:t}})}optional(){return $a.create(this)}nullable(){return Kf.create(this)}nullish(){return this.optional().nullable()}array(){return ba.create(this)}promise(){return nm.create(this)}or(t){return Qb.create([this,t])}and(t){return e_.create(this,t)}transform(t){return new Ru({schema:this,typeName:Se.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new _V({innerType:this,defaultValue:n,typeName:Se.ZodDefault})}brand(){return new HOe({typeName:Se.ZodBranded,type:this,...xe(void 0)})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const zOe=/^c[^\s-]{8,}$/i,qOe=/^([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,KOe=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;class Tc extends Ue{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(i=>t.test(i),{validation:n,code:ne.invalid_string,...Ke.errToObj(r)}),this.nonempty=t=>this.min(1,Ke.errToObj(t)),this.trim=()=>new Tc({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(t){if(this._getType(t)!==ae.string){const o=this._getOrReturnCtx(t);return fe(o,{code:ne.invalid_type,expected:ae.string,received:o.parsedType}),we}const r=new Qn;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),fe(i,{code:ne.too_small,minimum:o.value,type:"string",inclusive:!0,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),fe(i,{code:ne.too_big,maximum:o.value,type:"string",inclusive:!0,message:o.message}),r.dirty());else if(o.kind==="email")KOe.test(t.data)||(i=this._getOrReturnCtx(t,i),fe(i,{validation:"email",code:ne.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")qOe.test(t.data)||(i=this._getOrReturnCtx(t,i),fe(i,{validation:"uuid",code:ne.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")zOe.test(t.data)||(i=this._getOrReturnCtx(t,i),fe(i,{validation:"cuid",code:ne.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),fe(i,{validation:"url",code:ne.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),fe(i,{validation:"regex",code:ne.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),fe(i,{code:ne.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),fe(i,{code:ne.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):Ge.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new Tc({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ke.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ke.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ke.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ke.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ke.errToObj(n)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ke.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ke.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ke.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ke.errToObj(n)})}length(t,n){return this.min(t,n).max(t,n)}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}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}}Tc.create=e=>new Tc({checks:[],typeName:Se.ZodString,...xe(e)});function VOe(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 Uf extends Ue{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._getType(t)!==ae.number){const o=this._getOrReturnCtx(t);return fe(o,{code:ne.invalid_type,expected:ae.number,received:o.parsedType}),we}let r;const i=new Qn;for(const o of this._def.checks)o.kind==="int"?Ge.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),fe(r,{code:ne.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),fe(r,{code:ne.too_small,minimum:o.value,type:"number",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),fe(r,{code:ne.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?VOe(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),fe(r,{code:ne.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Ge.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ke.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ke.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ke.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ke.toString(n))}setLimit(t,n,r,i){return new Uf({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ke.toString(i)}]})}_addCheck(t){return new Uf({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ke.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ke.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ke.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ke.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ke.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ke.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}get isInt(){return!!this._def.checks.find(t=>t.kind==="int")}}Uf.create=e=>new Uf({checks:[],typeName:Se.ZodNumber,...xe(e)});class gR extends Ue{_parse(t){if(this._getType(t)!==ae.bigint){const r=this._getOrReturnCtx(t);return fe(r,{code:ne.invalid_type,expected:ae.bigint,received:r.parsedType}),we}return er(t.data)}}gR.create=e=>new gR({typeName:Se.ZodBigInt,...xe(e)});class yR extends Ue{_parse(t){if(this._getType(t)!==ae.boolean){const r=this._getOrReturnCtx(t);return fe(r,{code:ne.invalid_type,expected:ae.boolean,received:r.parsedType}),we}return er(t.data)}}yR.create=e=>new yR({typeName:Se.ZodBoolean,...xe(e)});class em extends Ue{_parse(t){if(this._getType(t)!==ae.date){const o=this._getOrReturnCtx(t);return fe(o,{code:ne.invalid_type,expected:ae.date,received:o.parsedType}),we}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return fe(o,{code:ne.invalid_date}),we}const r=new Qn;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),fe(i,{code:ne.too_small,message:o.message,inclusive:!0,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),fe(i,{code:ne.too_big,message:o.message,inclusive:!0,maximum:o.value,type:"date"}),r.dirty()):Ge.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new em({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ke.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ke.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}}em.create=e=>new em({checks:[],typeName:Se.ZodDate,...xe(e)});class bR extends Ue{_parse(t){if(this._getType(t)!==ae.undefined){const r=this._getOrReturnCtx(t);return fe(r,{code:ne.invalid_type,expected:ae.undefined,received:r.parsedType}),we}return er(t.data)}}bR.create=e=>new bR({typeName:Se.ZodUndefined,...xe(e)});class _R extends Ue{_parse(t){if(this._getType(t)!==ae.null){const r=this._getOrReturnCtx(t);return fe(r,{code:ne.invalid_type,expected:ae.null,received:r.parsedType}),we}return er(t.data)}}_R.create=e=>new _R({typeName:Se.ZodNull,...xe(e)});class $R extends Ue{constructor(){super(...arguments),this._any=!0}_parse(t){return er(t.data)}}$R.create=e=>new $R({typeName:Se.ZodAny,...xe(e)});class Bf extends Ue{constructor(){super(...arguments),this._unknown=!0}_parse(t){return er(t.data)}}Bf.create=e=>new Bf({typeName:Se.ZodUnknown,...xe(e)});class Eu extends Ue{_parse(t){const n=this._getOrReturnCtx(t);return fe(n,{code:ne.invalid_type,expected:ae.never,received:n.parsedType}),we}}Eu.create=e=>new Eu({typeName:Se.ZodNever,...xe(e)});class SR extends Ue{_parse(t){if(this._getType(t)!==ae.undefined){const r=this._getOrReturnCtx(t);return fe(r,{code:ne.invalid_type,expected:ae.void,received:r.parsedType}),we}return er(t.data)}}SR.create=e=>new SR({typeName:Se.ZodVoid,...xe(e)});class ba extends Ue{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==ae.array)return fe(n,{code:ne.invalid_type,expected:ae.array,received:n.parsedType}),we;if(i.minLength!==null&&n.data.length<i.minLength.value&&(fe(n,{code:ne.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(fe(n,{code:ne.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all(n.data.map((a,u)=>i.type._parseAsync(new ao(n,a,n.path,u)))).then(a=>Qn.mergeArray(r,a));const o=n.data.map((a,u)=>i.type._parseSync(new ao(n,a,n.path,u)));return Qn.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new ba({...this._def,minLength:{value:t,message:Ke.toString(n)}})}max(t,n){return new ba({...this._def,maxLength:{value:t,message:Ke.toString(n)}})}length(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}ba.create=(e,t)=>new ba({type:e,minLength:null,maxLength:null,typeName:Se.ZodArray,...xe(t)});var TR;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(TR||(TR={}));const yV=e=>t=>new yt({...e,shape:()=>({...e.shape(),...t})});function zf(e){if(e instanceof yt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=$a.create(zf(r))}return new yt({...e._def,shape:()=>t})}else return e instanceof ba?ba.create(zf(e.element)):e instanceof $a?$a.create(zf(e.unwrap())):e instanceof Kf?Kf.create(zf(e.unwrap())):e instanceof _a?_a.create(e.items.map(t=>zf(t))):e}class yt extends Ue{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=yV(this._def),this.extend=yV(this._def)}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Ge.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==ae.object){const c=this._getOrReturnCtx(t);return fe(c,{code:ne.invalid_type,expected:ae.object,received:c.parsedType}),we}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof Eu&&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 ao(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Eu){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&&(fe(i,{code:ne.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 ao(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=>Qn.mergeObjectSync(r,c)):Qn.mergeObjectSync(r,s)}get shape(){return this._def.shape()}strict(t){return Ke.errToObj,new yt({...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=Ke.errToObj(t).message)!==null&&u!==void 0?u:s}:{message:s}}}:{}})}strip(){return new yt({...this._def,unknownKeys:"strip"})}passthrough(){return new yt({...this._def,unknownKeys:"passthrough"})}setKey(t,n){return this.augment({[t]:n})}merge(t){return new yt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>TR.mergeShapes(this._def.shape(),t._def.shape()),typeName:Se.ZodObject})}catchall(t){return new yt({...this._def,catchall:t})}pick(t){const n={};return Ge.objectKeys(t).map(r=>{this.shape[r]&&(n[r]=this.shape[r])}),new yt({...this._def,shape:()=>n})}omit(t){const n={};return Ge.objectKeys(this.shape).map(r=>{Ge.objectKeys(t).indexOf(r)===-1&&(n[r]=this.shape[r])}),new yt({...this._def,shape:()=>n})}deepPartial(){return zf(this)}partial(t){const n={};if(t)return Ge.objectKeys(this.shape).map(r=>{Ge.objectKeys(t).indexOf(r)===-1?n[r]=this.shape[r]:n[r]=this.shape[r].optional()}),new yt({...this._def,shape:()=>n});for(const r in this.shape){const i=this.shape[r];n[r]=i.optional()}return new yt({...this._def,shape:()=>n})}required(){const t={};for(const n in this.shape){let i=this.shape[n];for(;i instanceof $a;)i=i._def.innerType;t[n]=i}return new yt({...this._def,shape:()=>t})}keyof(){return bV(Ge.objectKeys(this.shape))}}yt.create=(e,t)=>new yt({shape:()=>e,unknownKeys:"strip",catchall:Eu.create(),typeName:Se.ZodObject,...xe(t)}),yt.strictCreate=(e,t)=>new yt({shape:()=>e,unknownKeys:"strict",catchall:Eu.create(),typeName:Se.ZodObject,...xe(t)}),yt.lazycreate=(e,t)=>new yt({shape:e,unknownKeys:"strip",catchall:Eu.create(),typeName:Se.ZodObject,...xe(t)});class Qb extends Ue{_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 wu(u.ctx.common.issues));return fe(n,{code:ne.invalid_union,unionErrors:a}),we}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 wu(s));return fe(n,{code:ne.invalid_union,unionErrors:u}),we}}get options(){return this._def.options}}Qb.create=(e,t)=>new Qb({options:e,typeName:Se.ZodUnion,...xe(t)});class IR extends Ue{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ae.object)return fe(n,{code:ne.invalid_type,expected:ae.object,received:n.parsedType}),we;const r=this.discriminator,i=n.data[r],o=this.options.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}):(fe(n,{code:ne.invalid_union_discriminator,options:this.validDiscriminatorValues,path:[r]}),we)}get discriminator(){return this._def.discriminator}get validDiscriminatorValues(){return Array.from(this.options.keys())}get options(){return this._def.options}static create(t,n,r){const i=new Map;try{n.forEach(o=>{const a=o.shape[t].value;i.set(a,o)})}catch{throw new Error("The discriminator value could not be extracted from all the provided schemas")}if(i.size!==n.length)throw new Error("Some of the discriminator values are not unique");return new IR({typeName:Se.ZodDiscriminatedUnion,discriminator:t,options:i,...xe(r)})}}function OR(e,t){const n=Sc(e),r=Sc(t);if(e===t)return{valid:!0,data:e};if(n===ae.object&&r===ae.object){const i=Ge.objectKeys(t),o=Ge.objectKeys(e).filter(u=>i.indexOf(u)!==-1),a={...e,...t};for(const u of o){const s=OR(e[u],t[u]);if(!s.valid)return{valid:!1};a[u]=s.data}return{valid:!0,data:a}}else if(n===ae.array&&r===ae.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=OR(a,u);if(!s.valid)return{valid:!1};i.push(s.data)}return{valid:!0,data:i}}else return n===ae.date&&r===ae.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class e_ extends Ue{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(hV(o)||hV(a))return we;const u=OR(o.value,a.value);return u.valid?((mV(o)||mV(a))&&n.dirty(),{status:n.value,value:u.data}):(fe(r,{code:ne.invalid_intersection_types}),we)};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}))}}e_.create=(e,t,n)=>new e_({left:e,right:t,typeName:Se.ZodIntersection,...xe(n)});class _a extends Ue{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ae.array)return fe(r,{code:ne.invalid_type,expected:ae.array,received:r.parsedType}),we;if(r.data.length<this._def.items.length)return fe(r,{code:ne.too_small,minimum:this._def.items.length,inclusive:!0,type:"array"}),we;!this._def.rest&&r.data.length>this._def.items.length&&(fe(r,{code:ne.too_big,maximum:this._def.items.length,inclusive:!0,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 ao(r,a,r.path,u)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Qn.mergeArray(n,a)):Qn.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new _a({...this._def,rest:t})}}_a.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new _a({items:e,typeName:Se.ZodTuple,rest:null,...xe(t)})};class t_ extends Ue{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!==ae.object)return fe(r,{code:ne.invalid_type,expected:ae.object,received:r.parsedType}),we;const i=[],o=this._def.keyType,a=this._def.valueType;for(const u in r.data)i.push({key:o._parse(new ao(r,u,r.path,u)),value:a._parse(new ao(r,r.data[u],r.path,u))});return r.common.async?Qn.mergeObjectAsync(n,i):Qn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Ue?new t_({keyType:t,valueType:n,typeName:Se.ZodRecord,...xe(r)}):new t_({keyType:Tc.create(),valueType:t,typeName:Se.ZodRecord,...xe(n)})}}class wR extends Ue{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ae.map)return fe(r,{code:ne.invalid_type,expected:ae.map,received:r.parsedType}),we;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([u,s],c)=>({key:i._parse(new ao(r,u,r.path,[c,"key"])),value:o._parse(new ao(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 we;(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 we;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),u.set(c.value,l.value)}return{status:n.value,value:u}}}}wR.create=(e,t,n)=>new wR({valueType:t,keyType:e,typeName:Se.ZodMap,...xe(n)});class qf extends Ue{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ae.set)return fe(r,{code:ne.invalid_type,expected:ae.set,received:r.parsedType}),we;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(fe(r,{code:ne.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(fe(r,{code:ne.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,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 we;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 ao(r,s,r.path,c)));return r.common.async?Promise.all(u).then(s=>a(s)):a(u)}min(t,n){return new qf({...this._def,minSize:{value:t,message:Ke.toString(n)}})}max(t,n){return new qf({...this._def,maxSize:{value:t,message:Ke.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}qf.create=(e,t)=>new qf({valueType:e,minSize:null,maxSize:null,typeName:Se.ZodSet,...xe(t)});class tm extends Ue{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ae.function)return fe(n,{code:ne.invalid_type,expected:ae.function,received:n.parsedType}),we;function r(u,s){return mR({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,hR(),Xb].filter(c=>!!c),issueData:{code:ne.invalid_arguments,argumentsError:s}})}function i(u,s){return mR({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,hR(),Xb].filter(c=>!!c),issueData:{code:ne.invalid_return_type,returnTypeError:s}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof nm?er(async(...u)=>{const s=new wu([]),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})}):er((...u)=>{const s=this._def.args.safeParse(u,o);if(!s.success)throw new wu([r(u,s.error)]);const c=a(...s.data),l=this._def.returns.safeParse(c,o);if(!l.success)throw new wu([i(c,l.error)]);return l.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new tm({...this._def,args:_a.create(t).rest(Bf.create())})}returns(t){return new tm({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new tm({args:t||_a.create([]).rest(Bf.create()),returns:n||Bf.create(),typeName:Se.ZodFunction,...xe(r)})}}class ER extends Ue{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})}}ER.create=(e,t)=>new ER({getter:e,typeName:Se.ZodLazy,...xe(t)});class RR extends Ue{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return fe(n,{code:ne.invalid_literal,expected:this._def.value}),we}return{status:"valid",value:t.data}}get value(){return this._def.value}}RR.create=(e,t)=>new RR({value:e,typeName:Se.ZodLiteral,...xe(t)});function bV(e,t){return new MR({values:e,typeName:Se.ZodEnum,...xe(t)})}class MR extends Ue{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return fe(n,{expected:Ge.joinValues(r),received:n.parsedType,code:ne.invalid_type}),we}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return fe(n,{received:n.data,code:ne.invalid_enum_value,options:r}),we}return er(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}}MR.create=bV;class CR extends Ue{_parse(t){const n=Ge.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ae.string&&r.parsedType!==ae.number){const i=Ge.objectValues(n);return fe(r,{expected:Ge.joinValues(i),received:r.parsedType,code:ne.invalid_type}),we}if(n.indexOf(t.data)===-1){const i=Ge.objectValues(n);return fe(r,{received:r.data,code:ne.invalid_enum_value,options:i}),we}return er(t.data)}get enum(){return this._def.values}}CR.create=(e,t)=>new CR({values:e,typeName:Se.ZodNativeEnum,...xe(t)});class nm extends Ue{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ae.promise&&n.common.async===!1)return fe(n,{code:ne.invalid_type,expected:ae.promise,received:n.parsedType}),we;const r=n.parsedType===ae.promise?n.data:Promise.resolve(n.data);return er(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}nm.create=(e,t)=>new nm({type:e,typeName:Se.ZodPromise,...xe(t)});class Ru extends Ue{innerType(){return 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=>{fe(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"?we:(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"?we:(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(!vR(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=>vR(a)?Promise.resolve(i.transform(a.value,o)).then(u=>({status:n.value,value:u})):a);Ge.assertNever(i)}}Ru.create=(e,t,n)=>new Ru({schema:e,typeName:Se.ZodEffects,effect:t,...xe(n)}),Ru.createWithPreprocess=(e,t,n)=>new Ru({schema:t,effect:{type:"preprocess",transform:e},typeName:Se.ZodEffects,...xe(n)});class $a extends Ue{_parse(t){return this._getType(t)===ae.undefined?er(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}$a.create=(e,t)=>new $a({innerType:e,typeName:Se.ZodOptional,...xe(t)});class Kf extends Ue{_parse(t){return this._getType(t)===ae.null?er(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Kf.create=(e,t)=>new Kf({innerType:e,typeName:Se.ZodNullable,...xe(t)});class _V extends Ue{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===ae.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}_V.create=(e,t)=>new $a({innerType:e,typeName:Se.ZodOptional,...xe(t)});class xR extends Ue{_parse(t){if(this._getType(t)!==ae.nan){const r=this._getOrReturnCtx(t);return fe(r,{code:ne.invalid_type,expected:ae.nan,received:r.parsedType}),we}return{status:"valid",value:t.data}}}xR.create=e=>new xR({typeName:Se.ZodNaN,...xe(e)});class HOe extends Ue{_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}}yt.lazycreate;var Se;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",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.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded"})(Se||(Se={}));const kR=Tc.create,$V=Uf.create;xR.create,gR.create,yR.create,em.create,bR.create,_R.create,$R.create;const JOe=Bf.create;Eu.create,SR.create;const GOe=ba.create,AR=yt.create;yt.strictCreate,Qb.create,IR.create,e_.create,_a.create,t_.create,wR.create,qf.create,tm.create,ER.create,RR.create,MR.create,CR.create,nm.create,Ru.create,$a.create,Kf.create,Ru.createWithPreprocess;async function YOe(e,t){const{okType:n,errorType:r=ZOe,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=c.get("Content-Type")==="application/json"?JSON.stringify(a):a;let f=!1;try{const d=new AbortController,p=XOe([d.signal,i].filter(va));setTimeout(()=>{f=!0,d.abort()},u);const h=await fetch(e,{...s,body:l,headers:c,signal:p}),{status:v}=h,y=await h.json();if(h.ok){const b=n.safeParse(y);return b.success?{ok:!0,body:b.data}:{ok:!1,error:"validation",status:v,cause:b.error}}else{const b=r.safeParse(y);return b.success?{ok:!1,error:"http",status:v,body:b.data}:{ok:!1,error:"validation",status:v,cause:b.error}}}catch(d){return QOe(d)?{ok:!1,error:f?"timeout":"abort"}:{ok:!1,error:"unknown",cause:d}}}const ZOe=JOe();function XOe(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 QOe(e){return e instanceof DOMException&&e.name==="AbortError"}function e1e(e,t){t1e(e,t);const n=Mu.get(e,t);if(!n){const i=e(...t);throw Mu.set(e,t,{state:"fetching",promise:i}),SV(e,t,i).catch(o=>console.error(o)),i}if(n.state==="fetching")throw n.promise;const{result:r}=n;if(r.ok)return r.body;throw r}function t1e(e,t){const n=jOe();ie.useEffect(()=>{const r=Mu.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=Mu.get(e,t);if(!o||o.state!=="fetched")return;const a=e(...t);Mu.set(e,t,{state:"revalidating",promise:a,result:o.result}),SV(e,t,a).then(n).catch(u=>console.error(u))}return document.addEventListener("visibilitychange",i),()=>document.removeEventListener("visibilitychange",i)})}function SV(e,t,n){return n.then(r=>Mu.set(e,t,{state:"fetched",result:r})).catch(r=>Mu.set(e,t,{state:"fetched",result:{ok:!1,error:"unknown",cause:r}}))}const Mu=r1e(),n1e=Mu;function r1e(){const e=new Map,t=new Map,n={cacheCapacity:100,revalidationStrategy:{type:"swr",onFocus:!0}};function r(o){return o.join(`
|
|
32
|
-
`)}function i(o){var a;return(a=e.get(o))!=null?a:n}return{get(o,a){const u=r(a),s=t.get(o);if(!s||!s.has(u))return;const c=s.get(u);return s.delete(u),c!==void 0&&s.set(u,c),c},set(o,a,u){let s=t.get(o);s||(s=new Map,t.set(o,s));const c=i(o),l=r(a);s.size===c.cacheCapacity&&!s.has(l)&&s.delete(s.keys().next().value),s.set(l,u)},getFetcherConfig:i,registerFetcherConfig(o,a){e.set(o,a)},forgetAllErrors(){t.forEach(o=>o.forEach((a,u)=>{a.state==="fetched"&&!a.result.ok&&o.delete(u)}))}}}const i1e=AR({id:kR(),width:$V(),height:$V(),urls:AR({full:kR(),small:kR().transform(COe)})}),o1e=AR({results:GOe(i1e)}).transform(e=>e.results);function TV(e,t){const n=new URLSearchParams({page:"1",per_page:"30",query:t});return YOe(`${e}/search/photos?${n.toString()}`,{okType:o1e})}n1e.registerFetcherConfig(TV,{cacheCapacity:5,revalidationStrategy:{type:"never"}});function a1e(e,t){return e1e(TV,[e,t])}const IV=e=>{const{trigger:t,onMediaSelected:n}=e,[r,i]=ie.useState(!1),[o,a]=ie.useState(""),[u,s]=ie.useState(o),[c,l]=ie.useTransition();return UOe(o,200,f=>l(()=>s(f))),qe(A.Dialog,{trigger:t,open:r,onOpenChange:i,children:[C(A.DialogHeader,{icon:"folder",title:"Add an image from Unsplash.com"}),qe(A.DialogContent,{children:[C("div",{style:{paddingInline:A.tokens.space["24px"]},children:C(A.SearchInput,{value:o,placeholder:"Search on Unsplash.com",onValueChange:a})}),C(c1e,{children:C(A.ErrorBoundary,{errorImageSrc:A.dialogErrorImage,title:"Request failed",description:"An error occurred while searching for your image.",style:{marginTop:"auto",marginBottom:"auto"},children:C(ie.Suspense,{fallback:C(A.MasonrySkeleton,{}),children:C(u1e,{term:u,isUpdating:c,onMediaSelected:f=>{i(!1),n==null||n(f)}})})})})]})]})},u1e=e=>{const{term:t,isUpdating:n,onMediaSelected:r}=e,i=bIe(),o=a1e(i.unsplash.url,t||"fruit"),a=s1e(n);return o.length?C(A.Masonry,{items:o,getItemInfo:l1e,style:a,children:u=>C(A.MasonryMedia,{url:u.urls.small,onClick:()=>r({id:u.id,url:u.urls.full,width:u.width,height:u.height})})}):qe(A.BlankSlate,{style:{marginTop:"auto",marginBottom:"auto",...a},children:[C(A.BlankSlateImage,{children:C("img",{src:A.dialogErrorImage,alt:"No results"})}),C(A.BlankSlateTitle,{size:"big",children:"Oh no ..."}),C(A.BlankSlateDescription,{children:"The search returned no result."})]})};function s1e(e){return{opacity:e?.4:1,transitionProperty:e?"opacity":"none",transitionDuration:A.tokens.transitionDuration.standard,transitionTimingFunction:A.tokens.transitionTimingFunction.easeInOut}}const c1e=({children:e})=>C(A.ScrollArea,{style:{height:"100%",paddingInline:A.tokens.space["24px"],paddingTop:A.tokens.space["4px"]},children:e});function l1e(e){return{key:e.id,aspectRatio:e.width/e.height}}const f1e=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{const[o,a]=ie.useState(0),[u,s]=ie.useTransition(),c=d1e(t),l=c[o],f=e?ROe(t,e):void 0,d=f==null?void 0:f[o],p=ya(t),h=l?sV(l,e,d).filter(va):[],v=e&&!i?"visible":"hidden";function y(g){if(!l)return;const T=NOe(l.name,t,e,g);T!==e&&s(()=>r(T))}function b(g){s(()=>a(g))}const w=c.map((g,T)=>{const I=f==null?void 0:f[T];return{thumbnail:g,contentView:I,labels:sV(g,e,I)}}),F=({option:g,croppedImages:T})=>{if(a(g),!e)return;const I=Object.entries(T).reduce((W,[E,J])=>xOe({field:t,content:W,thumbnail:E,croppedImage:J}),e);I!==e&&s(()=>r(I))};return qe(A.Card,{color:"grey2",variant:"dashed",children:[qe(A.CardHeader,{children:[qe(A.CardHeaderTitle,{children:[p,h.length&&C(A.Text,{color:"grey11",component:"span",children:` \u2022 ${h.join(" \u2022 ")}`})]}),qe(A.CardHeaderActions,{style:{visibility:v},children:[C(DOe,{trigger:C(A.Button,{startIcon:C(A.Icon,{name:"crop"}),children:"Crop & Resize"}),initialImages:w,initialOption:o,onClose:F}),C(IV,{trigger:C(A.Button,{startIcon:C(A.Icon,{name:"imageSearch"}),children:"Replace"}),onMediaSelected:y}),C(A.Button,{onClick:()=>{a(0),r(void 0)},startIcon:C(A.Icon,{name:"delete"}),children:"Clear"})]})]}),C(ie.Suspense,{fallback:C("div",{style:{height:466}}),children:l&&e&&f?C(p1e,{allContentViews:f,content:e,contentView:d,id:n,onContentChange:r,onPageChange:b,page:o,readOnly:i,thumbnailName:l.name,isUpdating:u}):C(h1e,{onMediaSelected:y,readOnly:i,isUpdating:u})})]})};function d1e(e){return ie.useMemo(()=>EOe(e),[e])}const p1e=e=>{var f;const{allContentViews:t,content:n,contentView:r,id:i,onContentChange:o,onPageChange:a,page:u,readOnly:s,thumbnailName:c,isUpdating:l}=e;return qe(A.CardContent,{children:[C(A.Carousel,{getItemSource:m1e,items:t,onPageChange:a,page:u,style:{height:400},children:d=>{var p;return(d==null?void 0:d.url)&&C(A.CarouselItem,{src:fV(d.url),alt:(p=d.alt)!=null?p:void 0,isUpdating:l},`${c}_${d.url}`)}}),qe(A.Field,{labelPosition:"side",children:[C(A.FieldLabel,{htmlFor:i,children:"Alt text"}),C(A.FieldControl,{children:C(A.TextInput,{id:i,onValueChange:d=>{r&&o(MOe(c,n,r,d))},placeholder:"Short description for the visually impaired",readOnly:s||!r,value:(f=r==null?void 0:r.alt)!=null?f:""})})]})]})},h1e=({onMediaSelected:e,readOnly:t,isUpdating:n})=>C(A.CardContent,{children:C(A.Card,{color:"grey3",variant:"outlined",children:C(A.CardContent,{style:{paddingBlock:parseFloat(A.tokens.space["48px"])},children:qe(A.BlankSlate,{children:[C(A.BlankSlateIcon,{name:"cloudUpload"}),C(A.BlankSlateTitle,{children:n?"Preparing your image...":"You haven't selected an image"}),!t&&C(A.BlankSlateActions,{children:C(IV,{trigger:C(A.Button,{disabled:n,children:"Select image"}),onMediaSelected:e})})]})})})});function m1e(e){return e!=null&&e.url?fV(e.url):void 0}const v1e=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var o;return qe(A.Field,{children:[C(A.FieldIcon,{children:C(A.Icon,{name:"notes"})}),C(A.FieldLabel,{htmlFor:n,children:ya(t)}),C(A.FieldControl,{children:C(A.TextArea,{id:n,onChange:a=>{r(g1e(a.target.value))},placeholder:jf(t),readOnly:i,value:(o=e==null?void 0:e.value)!=null?o:""})})]})};function g1e(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Text",value:e}}function y1e(e){try{return new URL(e)}catch{return}}function b1e(e){return e.charAt(0).toUpperCase()+e.slice(1)}const _1e=e=>{const{hasLink:t,onUnlink:n}=e;return qe($c,{children:[C(A.Select,{value:"web",variant:"secondary",size:"small",icon:"public",disabled:!0,children:C(A.SelectItem,{value:"web",icon:"public",children:"Link to web page"})}),C(A.Button,{startIcon:C(A.Icon,{name:"linkOff"}),variant:"secondary",size:"small",disabled:!t,onClick:n})]})},$1e=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{const o=e==null?void 0:e.value,[a,u]=ie.useState(!1),[s,c]=ie.useState(!1);if(o&&o.__TYPE__!=="ExternalLink")return null;const l=o==null?void 0:o.url,f=l?y1e(l):void 0,d=(a||s)&&Boolean(f),p=h=>r(S1e(o,h));return C(A.LinkDescriptionPopover,{url:f,title:f?T1e(f):"",open:d,align:"start",sideOffset:-3,openDelay:100,closeDelay:200,onMouseOverChange:c,anchor:qe(A.Field,{onMouseOverChange:u,children:[C(A.FieldIcon,{children:C(A.Icon,{name:"link"})}),C(A.FieldLabel,{htmlFor:n,children:ya(t)}),C(A.FieldControl,{children:C(A.TextInput,{id:n,onValueChange:p,placeholder:jf(t),readOnly:i,value:l!=null?l:"",variant:f?"link":"normal",onFocus:()=>u(!0),onBlur:()=>u(!1),endAdornment:C(_1e,{hasLink:Boolean(l),onUnlink:()=>p("")})})})]})})};function S1e(e,t){if(!!t)return e?{__TYPE__:"LinkContent",value:{...e,kind:"web",url:t}}:{__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",kind:"web",url:t}}}function T1e(e){return e.host.split(".").slice(0,-1).filter(t=>t!=="www").map(b1e).join("")}const I1e=({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 qe(A.Field,{children:[C(A.FieldIcon,{children:C(A.Icon,{name:"pin"})}),C(A.FieldLabel,{htmlFor:n,children:ya(t)}),C(A.FieldControl,{children:C(A.NumberInput,{id:n,value:a,min:(u=t.config)==null?void 0:u.min,max:(s=t.config)==null?void 0:s.max,placeholder:jf(t),readOnly:i,onValueChange:c=>r(O1e(c))})})]})};function O1e(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(e)}}function cn(e){this.content=e}cn.prototype={constructor:cn,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 cn(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 cn(n)},addToStart:function(e,t){return new cn([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new cn(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 cn(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=cn.from(e),e.size?new cn(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=cn.from(e),e.size?new cn(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=cn.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},get size(){return this.content.length>>1}},cn.from=function(e){if(e instanceof cn)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new cn(t)};function OV(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=OV(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function wV(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=wV(a.content,u.content,n-1,r-1);if(c)return c}n-=s,r-=s}}class H{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 H(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 H(r,i)}cutByIndex(t,n){return t==n?H.empty:t==0&&n==this.content.length?this:new H(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 H(i,o)}addToStart(t){return new H([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new H(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 OV(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return wV(this,t,n,r)}findIndex(t,n=-1){if(t==0)return n_(0,t);if(t==this.size)return n_(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?n_(r+1,a):n_(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 H.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new H(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return H.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 H(n||t,r)}static from(t){if(!t)return H.empty;if(t instanceof H)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new H([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}H.empty=new H([],0);const WR={index:0,offset:0};function n_(e,t){return WR.index=e,WR.offset=t,WR}function r_(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(!r_(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!r_(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}class Ye{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&&r_(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 Ye.none;if(t instanceof Ye)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}}Ye.none=[];class Vf extends Error{}class ee{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=RV(this.content,t+this.openStart,n);return r&&new ee(r,this.openStart,this.openEnd)}removeBetween(t,n){return new ee(EV(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 ee.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 ee(H.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 ee(t,r,i)}}ee.empty=new ee(H.empty,0,0);function EV(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(EV(o.content,t-i-1,n-i-1)))}function RV(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=RV(a.content,t-o-1,n);return u&&e.replaceChild(i,a.copy(u))}function w1e(e,t,n){if(n.openStart>e.depth)throw new Vf("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Vf("Inconsistent open depths");return MV(e,t,n,0)}function MV(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=MV(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 Oc(a,u.cut(0,e.parentOffset).append(n.content).append(u.cut(t.parentOffset)))}else{let{start:a,end:u}=E1e(n,e);return Oc(o,xV(e,a,u,t,r))}else return Oc(o,i_(e,t,r))}function CV(e,t){if(!t.type.compatibleContent(e.type))throw new Vf("Cannot join "+t.type.name+" onto "+e.type.name)}function NR(e,t,n){let r=e.node(n);return CV(r,t.node(n)),r}function Ic(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 rm(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&&(Ic(e.nodeAfter,r),o++));for(let u=o;u<a;u++)Ic(i.child(u),r);t&&t.depth==n&&t.textOffset&&Ic(t.nodeBefore,r)}function Oc(e,t){if(!e.type.validContent(t))throw new Vf("Invalid content for node "+e.type.name);return e.copy(t)}function xV(e,t,n,r,i){let o=e.depth>i&&NR(e,t,i+1),a=r.depth>i&&NR(n,r,i+1),u=[];return rm(null,e,i,u),o&&a&&t.index(i)==n.index(i)?(CV(o,a),Ic(Oc(o,xV(e,t,n,r,i+1)),u)):(o&&Ic(Oc(o,i_(e,t,i+1)),u),rm(t,n,i,u),a&&Ic(Oc(a,i_(n,r,i+1)),u)),rm(r,null,i,u),new H(u)}function i_(e,t,n){let r=[];if(rm(null,e,n,r),e.depth>n){let i=NR(e,t,n+1);Ic(Oc(i,i_(e,t,n+1)),r)}return rm(t,null,n,r),new H(r)}function E1e(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(H.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class im{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 Ye.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 o_(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 im(n,r,o)}static resolveCached(t,n){for(let i=0;i<PR.length;i++){let o=PR[i];if(o.pos==n&&o.doc==t)return o}let r=PR[FR]=im.resolve(t,n);return FR=(FR+1)%R1e,r}}let PR=[],FR=0,R1e=12;class o_{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 M1e=Object.create(null);class uo{constructor(t,n,r,i=Ye.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||H.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&&r_(this.attrs,n||t.defaultAttrs||M1e)&&Ye.sameSet(this.marks,r||Ye.none)}copy(t=null){return t==this.content?this:new uo(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new uo(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 ee.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 ee(c,i.depth-a,o.depth-a)}replace(t,n,r){return w1e(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 im.resolveCached(this,t)}resolveNoCache(t){return im.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()+")"),kV(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=H.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(){if(!this.type.validContent(this.content))throw new RangeError(`Invalid content for node ${this.type.name}: ${this.content.toString().slice(0,50)}`);let t=Ye.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!Ye.sameSet(t,this.marks))throw 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=H.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}}uo.prototype.text=void 0;class a_ extends uo{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):kV(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 a_(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new a_(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 kV(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class wc{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new C1e(t,n);if(r.next==null)return wc.empty;let i=AV(r);r.next&&r.err("Unexpected trailing text");let o=F1e(P1e(i));return D1e(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&&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 H.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(`
|
|
33
|
-
`)}}wc.empty=new wc(!0);class C1e{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 AV(e){let t=[];do t.push(x1e(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function x1e(e){let t=[];do t.push(k1e(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function k1e(e){let t=N1e(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=A1e(e,t);else break;return t}function WV(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function A1e(e,t){let n=WV(e),r=n;return e.eat(",")&&(e.next!="}"?r=WV(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function W1e(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 N1e(e){if(e.eat("(")){let t=AV(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=W1e(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 P1e(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 NV(e,t){return t-e}function PV(e,t){let n=[];return r(t),n.sort(NV);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 F1e(e){let t=Object.create(null);return n(PV(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]);PV(e,s).forEach(l=>{c||i.push([u,c=[]]),c.indexOf(l)==-1&&c.push(l)})})});let o=t[r.join(",")]=new wc(r.indexOf(e.length-1)>-1);for(let a=0;a<i.length;a++){let u=i[a][1].sort(NV);o.next.push({type:i[a][0],next:t[u.join(",")]||n(u)})}return o}}function D1e(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 FV(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 DV(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 LV(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new L1e(e[n]);return t}class u_{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=LV(r.attrs),this.defaultAttrs=FV(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==wc.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:DV(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new uo(this,this.computeAttrs(t),H.from(n),Ye.setFrom(r))}createChecked(t=null,n,r){if(n=H.from(n),!this.validContent(n))throw new RangeError("Invalid content for node "+this.name);return new uo(this,this.computeAttrs(t),n,Ye.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=H.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(H.empty,!0);return o?new uo(this,t,n.append(o),Ye.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}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:Ye.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,a)=>r[o]=new u_(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 L1e{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class s_{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=LV(i.attrs),this.excluded=null;let o=FV(this.attrs);this.instance=o?new Ye(this,o):null}create(t=null){return!t&&this.instance?this.instance:new Ye(this,DV(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,a)=>r[o]=new s_(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 j1e{constructor(t){this.cached=Object.create(null),this.spec={nodes:cn.from(t.nodes),marks:cn.from(t.marks||{}),topNode:t.topNode},this.nodes=u_.compile(this.spec.nodes,this),this.marks=s_.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let i=this.nodes[r],o=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[o]||(n[o]=wc.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?jV(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let r in this.marks){let i=this.marks[r],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:jV(this,o.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 u_){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 a_(r,r.defaultAttrs,t,Ye.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return uo.fromJSON(this,t)}markFromJSON(t){return Ye.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function jV(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 Hf{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 qV(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new qV(this,n,!0);return r.addAll(t,n.from,n.to),ee.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(z1e(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=KV(a)),a.mark=i})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=KV(a)),a.node=i})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Hf(t,Hf.schemaRules(t)))}}const UV={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},U1e={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},BV={ol:!0,ul:!0},c_=1,l_=2,om=4;function zV(e,t,n){return t!=null?(t?c_:0)|(t==="full"?l_:0):e&&e.whitespace=="pre"?c_|l_:n&~om}class f_{constructor(t,n,r,i,o,a,u){this.type=t,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=u,this.content=[],this.activeMarks=Ye.none,this.stashMarks=[],this.match=a||(u&om?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(H.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&c_)){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=H.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(H.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):K1e(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&&!UV.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class qV{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=zV(null,n.preserveWhitespace,0)|(r?om:0);i?o=new f_(i.type,i.attrs,Ye.none,Ye.none,!0,n.topMatch||i.type.contentMatch,a):r?o=new f_(null,null,Ye.none,Ye.none,!0,null,a):o=new f_(t.schema.topNodeType,null,Ye.none,Ye.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){if(t.nodeType==3)this.addTextNode(t);else if(t.nodeType==1){let n=t.getAttribute("style"),r=n?this.readStyles(q1e(n)):null,i=this.top;if(r!=null)for(let o=0;o<r.length;o++)this.addPendingMark(r[o]);if(this.addElement(t),r!=null)for(let o=0;o<r.length;o++)this.removePendingMark(r[o],i)}}addTextNode(t){let n=t.nodeValue,r=this.top;if(r.options&l_||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&c_)r.options&l_?n=n.replace(/\r\n?/g,`
|
|
34
|
-
`):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;BV.hasOwnProperty(r)&&this.parser.normalizeLists&&B1e(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));if(o?o.ignore:U1e.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(UV.hasOwnProperty(r))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(`
|
|
35
|
-
`))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=Ye.none;e:for(let r=0;r<t.length;r+=2)for(let i=void 0;;){let o=this.parser.matchStyle(t[r],t[r+1],this,i);if(!o)continue e;if(o.ignore)return null;if(n=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(n),o.consuming===!1)i=o;else break}return n}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=zV(t,i,o.options);o.options&om&&o.content.length==0&&(a|=om),this.nodes.push(new f_(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=V1e(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 B1e(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&BV.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function z1e(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function q1e(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 KV(e){let t={};for(let n in e)t[n]=e[n];return t}function K1e(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 V1e(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}class so{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=DR(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}=so.renderSpec(DR(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&&so.renderSpec(DR(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}=so.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 so(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=VV(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return VV(t.marks)}}function VV(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function DR(e){return e.document||window.document}const HV=65535,JV=Math.pow(2,16);function H1e(e,t){return e+t*JV}function GV(e){return e&HV}function J1e(e){return(e-(e&HV))/JV}const YV=1,ZV=2,d_=4,XV=8;class LR{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&XV)>0}get deletedBefore(){return(this.delInfo&(YV|d_))>0}get deletedAfter(){return(this.delInfo&(ZV|d_))>0}get deletedAcross(){return(this.delInfo&d_)>0}}class Kr{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Kr.empty)return Kr.empty}recover(t){let n=0,r=GV(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+J1e(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:H1e(u/3,t-s),v=t==s?ZV:t==f?YV:d_;return(n<0?t!=s:t!=f)&&(v|=XV),new LR(p,v,h)}i+=l-c}return r?t+i:new LR(t+i,0,null)}touches(t,n){let r=0,i=GV(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 Kr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Kr.empty:new Kr(t<0?[0,-t,0]:[0,0,t])}}Kr.empty=new Kr([]);class am{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 am(this.maps,this.mirror,t,n)}copy(){return new am(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 am;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 LR(t,i,null)}}const jR=Object.create(null);class tr{getMap(){return Kr.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=jR[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 jR)throw new RangeError("Duplicate use of step JSON ID "+t);return jR[t]=n,n.prototype.jsonID=t,n}}class Pt{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Pt(t,null)}static fail(t){return new Pt(null,t)}static fromReplace(t,n,r,i){try{return Pt.ok(t.replace(n,r,i))}catch(o){if(o instanceof Vf)return Pt.fail(o.message);throw o}}}function UR(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(UR(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return H.fromArray(r)}class Cu extends tr{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 ee(UR(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 Pt.fromReplace(t,this.from,this.to,o)}invert(){return new co(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 Cu(n.pos,r.pos,this.mark)}merge(t){return t instanceof Cu&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Cu(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 Cu(n.from,n.to,t.markFromJSON(n.mark))}}tr.jsonID("addMark",Cu);class co extends tr{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 ee(UR(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Pt.fromReplace(t,this.from,this.to,r)}invert(){return new Cu(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 co(n.pos,r.pos,this.mark)}merge(t){return t instanceof co&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new co(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 co(n.from,n.to,t.markFromJSON(n.mark))}}tr.jsonID("removeMark",co);class xu extends tr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Pt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Pt.fromReplace(t,this.pos,this.pos+1,new ee(H.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 xu(this.pos,n.marks[i]);return new xu(this.pos,this.mark)}}return new Jf(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new xu(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 xu(n.pos,t.markFromJSON(n.mark))}}tr.jsonID("addNodeMark",xu);class Jf extends tr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Pt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Pt.fromReplace(t,this.pos,this.pos+1,new ee(H.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new xu(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Jf(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 Jf(n.pos,t.markFromJSON(n.mark))}}tr.jsonID("removeNodeMark",Jf);class kn extends tr{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&BR(t,this.from,this.to)?Pt.fail("Structure replace would overwrite content"):Pt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Kr([this.from,this.to-this.from,this.slice.size])}invert(t){return new kn(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 kn(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof kn)||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?ee.empty:new ee(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new kn(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?ee.empty:new ee(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new kn(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 kn(n.from,n.to,ee.fromJSON(t,n.slice),!!n.structure)}}tr.jsonID("replace",kn);class ln extends tr{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&&(BR(t,this.from,this.gapFrom)||BR(t,this.gapTo,this.to)))return Pt.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Pt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Pt.fromReplace(t,this.from,this.to,r):Pt.fail("Content does not fit in gap")}getMap(){return new Kr([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 ln(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 ln(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 ln(n.from,n.to,n.gapFrom,n.gapTo,ee.fromJSON(t,n.slice),n.insert,!!n.structure)}}tr.jsonID("replaceAround",ln);function BR(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 G1e(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 co(d,p,f[v])));u&&u.to==d?u.to=p:o.push(u=new Cu(d,p,r))}}),i.forEach(s=>e.step(s)),o.forEach(s=>e.step(s))}function Y1e(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 s_){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 co(a.from,a.to,a.style)))}function Z1e(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 kn(a,c,ee.empty));else{r=l;for(let f=0;f<s.marks.length;f++)n.allowsMarkType(s.marks[f].type)||e.step(new co(a,c,s.marks[f]))}a=c}if(!r.validEnd){let u=r.fillBefore(H.empty,!0);e.replace(a,a,new ee(u,0,0))}for(let u=o.length-1;u>=0;u--)e.step(o[u])}function X1e(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function um(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||!X1e(i,o,a))break}return null}function Q1e(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=H.empty,f=0;for(let h=o,v=!1;h>n;h--)v||r.index(h)>0?(v=!0,l=H.from(r.node(h).copy(l)),f++):s--;let d=H.empty,p=0;for(let h=o,v=!1;h>n;h--)v||i.after(h+1)<i.end(h)?(v=!0,d=H.from(i.node(h).copy(d)),p++):c++;e.step(new ln(s,c,a,u,new ee(l.append(d),f,p),l.size-f,!0))}function QV(e,t,n=null,r=e){let i=ewe(e,t),o=i&&twe(r,t);return o?i.map(e3).concat({type:t,attrs:n}).concat(o.map(e3)):null}function e3(e){return{type:e,attrs:null}}function ewe(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 twe(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 nwe(e,t,n){let r=H.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=H.from(n[a].type.create(n[a].attrs,r))}let i=t.start,o=t.end;e.step(new ln(i,o,i,o,new ee(r,0,0),n.length,!0))}function rwe(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)&&iwe(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 ln(c,l,c+1,l-1,new ee(H.from(r.create(i,null,a.marks)),0,0),1,!0)),!1}})}function iwe(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function owe(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 ln(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new ee(H.from(a),0,0),1,!0))}function t3(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 awe(e,t,n=1,r){let i=e.doc.resolve(t),o=H.empty,a=H.empty;for(let u=i.depth,s=i.depth-n,c=n-1;u>s;u--,c--){o=H.from(i.node(u).copy(o));let l=r&&r[c];a=H.from(l?l.type.create(l.attrs,a):i.node(u).copy(a))}e.step(new kn(t,t,new ee(o.append(a),n,n),!0))}function n3(e,t){let n=e.resolve(t),r=n.index();return uwe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function uwe(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function swe(e,t,n){let r=new kn(t-n,t+n,ee.empty,!0);e.step(r)}function cwe(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 lwe(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 zR(e,t,n=t,r=ee.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return r3(i,o,r)?new kn(t,n,r):new fwe(i,o,r).fit()}function r3(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class fwe{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=H.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=H.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 ee(o,a,u);return t>-1?new ln(r.pos,t,this.$to.pos,this.$to.end(),s,n):s.size||r.pos!=this.$to.pos?new kn(r.pos,i.pos,s):null}findFittable(){for(let t=1;t<=2;t++)for(let n=this.unplaced.openStart;n>=0;n--){let r,i=null;n?(i=qR(this.unplaced.content,n-1).firstChild,r=i.content):r=this.unplaced.content;let o=r.firstChild;for(let a=this.depth;a>=0;a--){let{type:u,match:s}=this.frontier[a],c,l=null;if(t==1&&(o?s.matchType(o.type)||(l=s.fillBefore(H.from(o),!1)):i&&u.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:a,parent:i,inject:l};if(t==2&&o&&(c=s.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:a,parent:i,wrap:c};if(i&&s.matchType(i.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=qR(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new ee(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=qR(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new ee(sm(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new ee(sm(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),y=f.matchType(v.type);if(!y)break;c++,(c>1||s==0||v.content.size)&&(f=y,l.push(i3(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=cm(this.placed,n,H.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,y=u;v<p;v++){let b=y.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),y=b.content}this.unplaced=h?t==0?ee.empty:new ee(sm(a.content,t-1,1),t-1,p<0?a.openEnd:t-1):new ee(sm(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||!KR(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=KR(t,n,i,r,o);if(!!a){for(let u=n-1;u>=0;u--){let{match:s,type:c}=this.frontier[u],l=KR(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=cm(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=cm(this.placed,this.depth,H.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(H.empty,!0);n.childCount&&(this.placed=cm(this.placed,this.frontier.length,n))}}function sm(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(sm(e.firstChild.content,t-1,n)))}function cm(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(cm(e.lastChild.content,t-1,n)))}function qR(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function i3(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,i3(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(H.empty,!0)))),e.copy(r)}function KR(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&&!dwe(n,o.content,a)?u:null}function dwe(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function pwe(e){return e.spec.defining||e.spec.definingForContent}function hwe(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(r3(i,o,r))return e.step(new kn(t,n,r));let a=a3(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=pwe(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 y=a[(v+s)%a.length],b=!0;y<0&&(b=!1,y=-y);let w=i.node(y-1),F=i.index(y-1);if(w.canReplaceWith(F,F,h.type,h.marks))return e.replace(i.before(y),b?o.after(y):n,new ee(o3(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 o3(e,t,n,r,i){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(o3(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(H.empty,!0))}return e}function mwe(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=cwe(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new ee(H.from(r),0,0))}function vwe(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=a3(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 a3(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 Gf extends tr{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 Pt.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 Pt.fromReplace(t,this.pos,this.pos+1,new ee(H.from(i),0,n.isLeaf?0:1))}getMap(){return Kr.empty}invert(t){return new Gf(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 Gf(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 Gf(n.pos,n.attr,n.value)}}tr.jsonID("attr",Gf);let Yf=class extends Error{};Yf=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},Yf.prototype=Object.create(Error.prototype),Yf.prototype.constructor=Yf,Yf.prototype.name="TransformError";class gwe{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new am}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Yf(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=ee.empty){let i=zR(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new ee(H.from(r),0,0))}delete(t,n){return this.replace(t,n,ee.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return hwe(this,t,n,r),this}replaceRangeWith(t,n,r){return mwe(this,t,n,r),this}deleteRange(t,n){return vwe(this,t,n),this}lift(t,n){return Q1e(this,t,n),this}join(t,n=1){return swe(this,t,n),this}wrap(t,n){return nwe(this,t,n),this}setBlockType(t,n=t,r,i=null){return rwe(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i=[]){return owe(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new Gf(t,n,r)),this}addNodeMark(t,n){return this.step(new xu(t,n)),this}removeNodeMark(t,n){if(!(n instanceof Ye)){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 Jf(t,n)),this}split(t,n=1,r){return awe(this,t,n,r),this}addMark(t,n,r){return G1e(this,t,n,r),this}removeMark(t,n,r){return Y1e(this,t,n,r),this}clearIncompatible(t,n,r){return Z1e(this,t,n,r),this}}const VR=Object.create(null);class Fe{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new ywe(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=ee.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?ee.empty:n),u==0&&c3(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),c3(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new ke(t):Zf(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?Zf(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):Zf(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 Ri(t.node(0))}static atStart(t){return Zf(t,t,0,0,1)||new Ri(t)}static atEnd(t){return Zf(t,t,t.content.size,t.childCount,-1)||new Ri(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=VR[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 VR)throw new RangeError("Duplicate use of selection JSON ID "+t);return VR[t]=n,n.prototype.jsonID=t,n}getBookmark(){return ke.between(this.$anchor,this.$head).getBookmark()}}Fe.prototype.visible=!0;class ywe{constructor(t,n){this.$from=t,this.$to=n}}let u3=!1;function s3(e){!u3&&!e.parent.inlineContent&&(u3=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class ke extends Fe{constructor(t,n=t){s3(t),s3(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 Fe.near(r);let i=t.resolve(n.map(this.anchor));return new ke(i.parent.inlineContent?i:r,r)}replace(t,n=ee.empty){if(super.replace(t,n),n==ee.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof ke&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new p_(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 ke(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=Fe.findFrom(n,r,!0)||Fe.findFrom(n,-r,!0);if(o)n=o.$head;else return Fe.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Fe.findFrom(t,-r,!0)||Fe.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new ke(t,n)}}Fe.jsonID("text",ke);class p_{constructor(t,n){this.anchor=t,this.head=n}map(t){return new p_(t.map(this.anchor),t.map(this.head))}resolve(t){return ke.between(t.resolve(this.anchor),t.resolve(this.head))}}class ve extends Fe{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?Fe.near(o):new ve(o)}content(){return new ee(H.from(this.node),0,0)}eq(t){return t instanceof ve&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new HR(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ve(t.resolve(n.anchor))}static create(t,n){return new ve(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}ve.prototype.visible=!1,Fe.jsonID("node",ve);class HR{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new p_(r,r):new HR(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&ve.isSelectable(r)?new ve(n):Fe.near(n)}}class Ri extends Fe{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=ee.empty){if(n==ee.empty){t.delete(0,t.doc.content.size);let r=Fe.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Ri(t)}map(t){return new Ri(t)}eq(t){return t instanceof Ri}getBookmark(){return bwe}}Fe.jsonID("all",Ri);const bwe={map(){return this},resolve(e){return new Ri(e)}};function Zf(e,t,n,r,i,o=!1){if(t.inlineContent)return ke.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&&ve.isSelectable(u))return ve.create(e,n-(i<0?u.nodeSize:0))}else{let s=Zf(e,u,n+i,i<0?u.childCount:0,i,o);if(s)return s}n+=u.nodeSize*i}return null}function c3(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof kn||i instanceof ln))return;let o=e.mapping.maps[r],a;o.forEach((u,s,c,l)=>{a==null&&(a=l)}),e.setSelection(Fe.near(e.doc.resolve(a),n))}const l3=1,h_=2,f3=4;class _we extends gwe{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|l3)&~h_,this.storedMarks=null,this}get selectionSet(){return(this.updated&l3)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=h_,this}ensureMarks(t){return Ye.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&h_)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~h_,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Ye.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),r=r==null?n:r,!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(Fe.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|=f3,this}get scrolledIntoView(){return(this.updated&f3)>0}}function d3(e,t){return!t||!e?e:e.bind(t)}class lm{constructor(t,n,r){this.name=t,this.init=d3(n.init,r),this.apply=d3(n.apply,r)}}const $we=[new lm("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new lm("selection",{init(e,t){return e.selection||Fe.atStart(t.doc)},apply(e){return e.selection}}),new lm("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new lm("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class JR{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=$we.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 lm(r.key,r.spec.state,r))})}}class Xf{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 Xf(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 _we(this)}static create(t){let n=new JR(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new Xf(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 JR(this.schema,t.plugins),r=n.fields,i=new Xf(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 JR(t.schema,t.plugins),o=new Xf(i);return i.fields.forEach(a=>{if(a.name=="doc")o.doc=uo.fromJSON(t.schema,n.doc);else if(a.name=="selection")o.selection=Fe.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 p3(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=p3(i,t,{})),n[r]=i}return n}class Vr{constructor(t){this.spec=t,this.props={},t.props&&p3(t.props,this,this.props),this.key=t.key?t.key.key:h3("plugin")}getState(t){return t[this.key]}}const GR=Object.create(null);function h3(e){return e in GR?e+"$"+ ++GR[e]:(GR[e]=0,e+"$")}class ku{constructor(t="key"){this.key=h3(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Au=typeof navigator<"u"?navigator:null,m3=typeof document<"u"?document:null,Wu=Au&&Au.userAgent||"",YR=/Edge\/(\d+)/.exec(Wu),v3=/MSIE \d/.exec(Wu),ZR=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Wu),$r=!!(v3||ZR||YR),Nu=v3?document.documentMode:ZR?+ZR[1]:YR?+YR[1]:0,lo=!$r&&/gecko\/(\d+)/i.test(Wu);lo&&+(/Firefox\/(\d+)/.exec(Wu)||[0,0])[1];const XR=!$r&&/Chrome\/(\d+)/.exec(Wu),An=!!XR,Swe=XR?+XR[1]:0,nr=!$r&&!!Au&&/Apple Computer/.test(Au.vendor),Qf=nr&&(/Mobile\/\w+/.test(Wu)||!!Au&&Au.maxTouchPoints>2),Hr=Qf||(Au?/Mac/.test(Au.platform):!1),fo=/Android \d/.test(Wu),m_=!!m3&&"webkitFontSmoothing"in m3.documentElement.style,Twe=m_?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,Sr=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},QR=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let g3=null;const Sa=function(e,t,n){let r=g3||(g3=document.createRange());return r.setEnd(e,n==null?e.nodeValue.length:n),r.setStart(e,t||0),r},fm=function(e,t,n,r){return n&&(y3(e,t,n,r,-1)||y3(e,t,n,r,1))},Iwe=/^(img|br|input|textarea|hr)$/i;function y3(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:po(e))){let o=e.parentNode;if(!o||o.nodeType!=1||wwe(e)||Iwe.test(e.nodeName)||e.contentEditable=="false")return!1;t=Sr(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?po(e):0}else return!1}}function po(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Owe(e,t,n){for(let r=t==0,i=t==po(e);r||i;){if(e==n)return!0;let o=Sr(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,i=i&&o==po(e)}}function wwe(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 eM=function(e){let t=e.isCollapsed;return t&&An&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function ed(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function Ewe(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Pu(e,t){return typeof e=="number"?e:e[t]}function Rwe(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 b3(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=QR(a)){if(a.nodeType!=1)continue;let u=a,s=u==o.body,c=s?Ewe(o):Rwe(u),l=0,f=0;if(t.top<c.top+Pu(r,"top")?f=-(c.top-t.top+Pu(i,"top")):t.bottom>c.bottom-Pu(r,"bottom")&&(f=t.bottom-c.bottom+Pu(i,"bottom")),t.left<c.left+Pu(r,"left")?l=-(c.left-t.left+Pu(i,"left")):t.right>c.right-Pu(r,"right")&&(l=t.right-c.right+Pu(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 Mwe(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:_3(e.dom)}}function _3(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=QR(r));return t}function Cwe({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;$3(n,r==0?0:r-t)}function $3(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 td=null;function xwe(e){if(e.setActive)return e.setActive();if(td)return e.focus(td);let t=_3(e);e.focus(td==null?{get preventScroll(){return td={preventScroll:!0},!0}}:void 0),td||(td=!1,$3(t,0))}function S3(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=Sa(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?kwe(n,i):!n||r&&n.nodeType==1?{node:e,offset:o}:S3(n,i)}function kwe(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=Fu(r,1);if(o.top!=o.bottom&&tM(t,o))return{node:e,offset:i+(t.left>=(o.left+o.right)/2?1:0)}}return{node:e,offset:0}}function tM(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Awe(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function Wwe(e,t,n){let{node:r,offset:i}=S3(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 Nwe(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.node.isBlock&&a.parent){let u=a.dom.getBoundingClientRect();if(u.left>r.left||u.top>r.top)i=a.posBefore;else if(u.right<r.left||u.bottom<r.top)i=a.posAfter;else break}o=a.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,1)}function T3(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(tM(t,c))return T3(a,t,c)}}if((o=(o+1)%r)==i)break}return e}function Pwe(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+1),a;if(!o||!e.dom.contains(o.nodeType!=1?o.parentNode:o)){let s=e.dom.getBoundingClientRect();if(!tM(t,s)||(o=T3(e.dom,t,s),!o))return null}if(nr)for(let s=o;r&&s;s=QR(s))s.draggable&&(r=void 0);if(o=Awe(o,t),r){if(lo&&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=Nwe(e,r,i,t))}a==null&&(a=Wwe(e,o,t));let u=e.docView.nearestDesc(o,!0);return{pos:a,inside:u?u.posAtStart-u.border:-1}}function Fu(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const Fwe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function I3(e,t,n){let{node:r,offset:i}=e.docView.domFromPos(t,n<0?-1:1),o=m_||lo;if(r.nodeType==3)if(o&&(Fwe.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let a=Fu(Sa(r,i,i),n);if(lo&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let u=Fu(Sa(r,i-1,i-1),-1);if(u.top==a.top){let s=Fu(Sa(r,i,i+1),-1);if(s.top!=a.top)return dm(s,s.left<u.left)}}return a}else{let a=i,u=i,s=n<0?1:-1;return n<0&&!i?(u++,s=-1):n>=0&&i==r.nodeValue.length?(a--,s=1):n<0?a--:u++,dm(Fu(Sa(r,a,u),s),s<0)}if(!e.state.doc.resolve(t).parent.inlineContent){if(i&&(n<0||i==po(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return nM(a.getBoundingClientRect(),!1)}if(i<po(r)){let a=r.childNodes[i];if(a.nodeType==1)return nM(a.getBoundingClientRect(),!0)}return nM(r.getBoundingClientRect(),n>=0)}if(i&&(n<0||i==po(r))){let a=r.childNodes[i-1],u=a.nodeType==3?Sa(a,po(a)-(o?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(u)return dm(Fu(u,1),!1)}if(i<po(r)){let a=r.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let u=a?a.nodeType==3?Sa(a,0,o?0:1):a.nodeType==1?a:null:null;if(u)return dm(Fu(u,-1),!0)}return dm(Fu(r.nodeType==3?Sa(r):r,-n),n>=0)}function dm(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 nM(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 O3(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 Dwe(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return O3(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.dom;break}o=u.dom.parentNode}let a=I3(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=Sa(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 Lwe=/[\u0590-\u08ac]/;function jwe(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!Lwe.test(r.parent.textContent)||!u.modify?n=="left"||n=="backward"?o:a:O3(e,t,()=>{let s=u.getRangeAt(0),c=u.focusNode,l=u.focusOffset,f=u.caretBidiLevel;u.modify("move",n,"character");let p=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(u.focusNode.nodeType==1?u.focusNode:u.focusNode.parentNode)||c==u.focusNode&&l==u.focusOffset;return u.removeAllRanges(),u.addRange(s),f!=null&&(u.caretBidiLevel=f),p})}let w3=null,E3=null,R3=!1;function Uwe(e,t,n){return w3==t&&E3==n?R3:(w3=t,E3=n,R3=n=="up"||n=="down"?Dwe(e,t,n):jwe(e,t,n))}const Mi=0,M3=1,nd=2,ho=3;class pm{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Mi,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>Sr(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==null?r>0:i)?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};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 k3){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 C3&&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?Sr(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?Sr(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=Sr(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=Sr(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((lo||nr)&&t==n){let{node:d,offset:p}=u;if(d.nodeType==3){if(l=!!(p&&d.nodeValue[p-1]==`
|
|
36
|
-
`),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:Sr(v)+1});break}let y=h.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let h=d.childNodes[p-1];l=h&&(h.nodeName=="BR"||h.contentEditable=="false")}}if(lo&&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&&nr)&&fm(u.node,u.offset,c.anchorNode,c.anchorOffset)&&fm(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(d){if(!(d instanceof DOMException))throw d}}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?nd:M3,t==u&&n==s&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=ho:o.markDirty(t-u,n-u);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?nd:ho}r=a}this.dirty=nd}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?nd:M3;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class C3 extends pm{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==Mi&&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 Bwe extends pm{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 Ec extends pm{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=so.renderSpec(document,n.type.spec.toDOM(n,r))),new Ec(t,n,a.dom,a.contentDOM||a.dom)}parseRule(){return this.dirty&ho||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!=ho&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Mi){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Mi}}slice(t,n,r){let i=Ec.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;n<a&&(o=oM(o,n,a,r)),t>0&&(o=oM(o,0,t,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}}class Rc extends pm{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}=so.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=N3(l,r,n),c?s=new zwe(t,n,r,i,l,f||null,d,c,o,a+1):n.isText?new v_(t,n,r,i,l,d,o):new Rc(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=()=>H.empty)}return t}matchesNode(t,n,r){return this.dirty==Mi&&t.eq(this.node)&&iM(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 Kwe(this,a&&a.node);Jwe(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?Ye.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==nd)&&(a&&this.protectLocalComposition(t,a),A3(this.contentDOM,this.children,t),Qf&&Gwe(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof ke)||r<n||i>n+this.node.content.size)return null;let o=t.domSelection(),a=Ywe(o.focusNode,o.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){let u=a.nodeValue,s=Zwe(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 Bwe(this,o,n,i);t.input.compositionNodes.push(a),this.children=oM(this.children,r,r+i.length,t,a)}update(t,n,r,i){return this.dirty==ho||!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=Mi}updateOuterDeco(t){if(iM(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=W3(this.dom,this.nodeDOM,rM(this.outerDeco,this.node,n),rM(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 x3(e,t,n,r,i){return N3(r,t,e),new Rc(void 0,e,t,n,r,r,r,i,0)}class v_ extends Rc{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==ho||this.dirty!=Mi&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Mi||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=Mi,!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 v_(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=ho)}get domAtom(){return!1}}class k3 extends pm{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Mi&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class zwe extends Rc{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==ho)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 A3(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=P3(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(u,r);if(a instanceof Ec){let s=r?r.previousSibling:e.lastChild;A3(a.contentDOM,a.children,n),r=s?s.nextSibling:e.firstChild}}for(;r;)r=P3(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const hm=function(e){e&&(this.nodeName=e)};hm.prototype=Object.create(null);const Mc=[new hm];function rM(e,t,n){if(e.length==0)return Mc;let r=n?Mc[0]:new hm,i=[r];for(let o=0;o<e.length;o++){let a=e[o].type.attrs;if(!!a){a.nodeName&&i.push(r=new hm(a.nodeName));for(let u in a){let s=a[u];s!=null&&(n&&i.length==1&&i.push(r=new hm(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 W3(e,t,n,r){if(n==Mc&&r==Mc)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=Mc[0]),i=s}qwe(i,u||Mc[0],a)}return i}function qwe(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 N3(e,t,n){return W3(e,e,Mc,rM(t,n,e.nodeType!=1))}function iM(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 P3(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Kwe{constructor(t,n){this.lock=n,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=Vwe(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=Mi,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++)if(this.top.children[s].matchesMark(t[o])){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=Ec.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==ho&&a.dom==a.contentDOM&&(a.dirty=nd),a.update(t,n,r,o)?(this.destroyBetween(this.index,i),this.index=i+1,!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 Rc){let s=this.preMatch.matched.get(u);if(s!=null&&s!=o)return!1;let c=u.dom;if(!(this.lock&&(c==this.lock||c.nodeType==1&&c.contains(this.lock.parentNode))&&!(t.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==t.text&&u.dirty!=ho&&iM(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,Rc.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 C3(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 Ec;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof v_)||/\n$/.test(t.node.text))&&((nr||An)&&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 k3(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}}function Vwe(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 Ec)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 Hwe(e,t){return e.type.side-t.type.side}function Jwe(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(Hwe);for(let y=0;y<v.length;y++)n(v[y],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 Gwe(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 Ywe(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=po(e)}else if(e.nodeType==1&&t<e.childNodes.length)e=e.childNodes[t],t=0;else return null}}function Zwe(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 oM(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 F3(e,t=null){let n=e.domSelection(),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(eM(n)){for(s=u;i&&!i.node;)i=i.parent;let l=i.node;if(i&&l.isAtom&&ve.isSelectable(l)&&i.parent&&!(l.isInline&&Owe(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new ve(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=uM(e,s,u,l)}return c}function D3(e){return e.editable?e.hasFocus():K3(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Du(e,t=!1){let n=e.state.selection;if(B3(e,n),!!D3(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&An){let r=e.domSelection(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&fm(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)Qwe(e);else{let{anchor:r,head:i}=n,o,a;L3&&!(n instanceof ke)&&(n.$from.parent.inlineContent||(o=j3(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=j3(e,n.to))),e.docView.setSelection(r,i,e.root,t),L3&&(o&&U3(o),a&&U3(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Xwe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const L3=nr||An&&Swe<63;function j3(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(nr&&i&&i.contentEditable=="false")return aM(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return aM(i);if(o)return aM(o)}}function aM(e){return e.contentEditable="true",nr&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function U3(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Xwe(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelection(),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(()=>{(!D3(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function Qwe(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,Sr(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&$r&&Nu<=11&&(r.disabled=!0,r.disabled=!1)}function B3(e,t){if(t instanceof ve){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(z3(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else z3(e)}function z3(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function uM(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||ke.between(t,n,r)}function q3(e){return e.editable&&e.root.activeElement!=e.dom?!1:K3(e)}function K3(e){let t=e.domSelection();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 eEe(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return fm(t.node,t.offset,n.anchorNode,n.anchorOffset)}function sM(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&&Fe.findFrom(o,t)}function Cc(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function V3(e,t,n){let r=e.state.selection;if(r instanceof ke){if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let i=sM(e.state,t);return i&&i instanceof ve?Cc(e,i):!1}else if(!(Hr&&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?ve.isSelectable(o)?Cc(e,new ve(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):m_?Cc(e,new ke(e.state.doc.resolve(t<0?u:u+o.nodeSize))):!1:!1}}else{if(r instanceof ve&&r.node.isInline)return Cc(e,new ke(t>0?r.$to:r.$from));{let i=sM(e.state,t);return i?Cc(e,i):!1}}}function g_(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function mm(e){let t=e.pmViewDesc;return t&&t.size==0&&(e.nextSibling||e.nodeName!="BR")}function cM(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,a=!1;for(lo&&n.nodeType==1&&r<g_(n)&&mm(n.childNodes[r])&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let u=n.childNodes[r-1];if(mm(u))i=n,o=--r;else if(u.nodeType==3)n=u,r=n.nodeValue.length;else break}}else{if(H3(n))break;{let u=n.previousSibling;for(;u&&mm(u);)i=n.parentNode,o=Sr(u),u=u.previousSibling;if(u)n=u,r=g_(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?fM(e,t,n,r):i&&fM(e,t,i,o)}function lM(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=g_(n),o,a;for(;;)if(r<i){if(n.nodeType!=1)break;let u=n.childNodes[r];if(mm(u))o=n,a=++r;else break}else{if(H3(n))break;{let u=n.nextSibling;for(;u&&mm(u);)o=u.parentNode,a=Sr(u)+1,u=u.nextSibling;if(u)n=u,r=0,i=g_(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&fM(e,t,o,a)}function H3(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function fM(e,t,n,r){if(eM(t)){let o=document.createRange();o.setEnd(n,r),o.setStart(n,r),t.removeAllRanges(),t.addRange(o)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Du(e)},50)}function J3(e,t,n){let r=e.state.selection;if(r instanceof ke&&!r.empty||n.indexOf("s")>-1||Hr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let a=sM(e.state,t);if(a&&a instanceof ve)return Cc(e,a)}if(!i.parent.inlineContent){let a=t<0?i:o,u=r instanceof Ri?Fe.near(a,t):Fe.findFrom(a,t);return u?Cc(e,u):!1}return!1}function G3(e,t){if(!(e.state.selection instanceof ke))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 Y3(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function tEe(e){if(!nr||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;Y3(e,r,"true"),setTimeout(()=>Y3(e,r,"false"),20)}return!1}function nEe(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function rEe(e,t){let n=t.keyCode,r=nEe(t);return n==8||Hr&&n==72&&r=="c"?G3(e,-1)||cM(e):n==46||Hr&&n==68&&r=="c"?G3(e,1)||lM(e):n==13||n==27?!0:n==37||Hr&&n==66&&r=="c"?V3(e,-1,r)||cM(e):n==39||Hr&&n==70&&r=="c"?V3(e,1,r)||lM(e):n==38||Hr&&n==80&&r=="c"?J3(e,-1,r)||cM(e):n==40||Hr&&n==78&&r=="c"?tEe(e)||J3(e,1,r)||lM(e):r==(Hr?"m":"c")&&(n==66||n==73||n==89||n==90)}function Z3(e,t){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")||so.fromSchema(e.state.schema),u=o4(),s=u.createElement("div");s.appendChild(a.serializeFragment(r,{document:u}));let c=s.firstChild,l,f=0;for(;c&&c.nodeType==1&&(l=r4[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))||t.content.textBetween(0,t.content.size,`
|
|
25
|
+
Check your code at `+U+":"+te+"."}return""}}var $a={};function IC(O){{var U=Af();if(!U){var te=typeof O=="string"?O:O.displayName||O.name;te&&(U=`
|
|
37
26
|
|
|
38
|
-
`);return{dom:s,text:d}}function X3(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)}),o)return t?new ee(H.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
39
|
-
`))),0,0):ee.empty;let f=e.someProp("clipboardTextParser",d=>d(t,i,r));if(f)u=f;else{let d=i.marks(),{schema:p}=e.state,h=so.fromSchema(p);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(v=>{let y=a.appendChild(document.createElement("p"));v&&y.appendChild(h.serializeNode(p.text(v,d)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n)}),a=aEe(n),m_&&uEe(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&&a.firstChild;f--)a=a.firstChild;if(u||(u=(e.someProp("clipboardParser")||e.someProp("domParser")||Hf.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(s||l),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!iEe.test(d.parentNode.nodeName)?{ignore:!0}:null}})),l)u=sEe(n4(u,+l[1],+l[2]),l[4]);else if(u=ee.maxOpen(oEe(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=n4(u,f,d)}return e.someProp("transformPasted",f=>{u=f(u)}),u}const iEe=/^(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 oEe(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&&e4(s,o,u,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=t4(a[a.length-1],o.length));let l=Q3(u,s);a.push(l),i=i.matchType(l.type),o=s}}),a)return H.from(a)}return e}function Q3(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,H.from(e));return e}function e4(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=e4(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(H.from(Q3(n,e,i+1))))}}function t4(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,t4(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(H.empty,!0);return e.copy(n.append(r))}function dM(e,t,n,r,i,o){let a=t<0?e.firstChild:e.lastChild,u=a.content;return i<r-1&&(u=dM(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(H.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(u))}function n4(e,t,n){return t<e.openStart&&(e=new ee(dM(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new ee(dM(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const r4={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 i4=null;function o4(){return i4||(i4=document.implementation.createHTMLDocument("title"))}function aEe(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=o4().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&r4[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 uEe(e){let t=e.querySelectorAll(An?"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=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function sEe(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=H.from(s.create(r[u+1],i)),o++,a++}return new ee(i,o,a)}const rr={};let Wn={};class cEe{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.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 lEe(e){for(let t in rr){let n=rr[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{dEe(e,r)&&!hM(e,r)&&(e.editable||!(r.type in Wn))&&n(e,r)})}nr&&e.dom.addEventListener("input",()=>null),pM(e)}function xc(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function fEe(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 pM(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>hM(e,r))})}function hM(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function dEe(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 pEe(e,t){!hM(e,t)&&rr[t.type]&&(e.editable||!(t.type in Wn))&&rr[t.type](e,t)}Wn.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!u4(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(fo&&An&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Qf&&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,ed(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||rEe(e,n)?n.preventDefault():xc(e,"key")},Wn.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},Wn.keypress=(e,t)=>{let n=t;if(u4(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Hr&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof ke)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);e.someProp("handleTextInput",o=>o(e,r.$from.pos,r.$to.pos,i))||e.dispatch(e.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function y_(e){return{left:e.clientX,top:e.clientY}}function hEe(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function mM(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 rd(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function mEe(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&ve.isSelectable(r)?(rd(e,new ve(n),"pointer"),!0):!1}function vEe(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof ve&&(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(ve.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?(rd(e,ve.create(e.state.doc,i),"pointer"),!0):!1}function gEe(e,t,n,r,i){return mM(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?vEe(e,n):mEe(e,n))}function yEe(e,t,n,r){return mM(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function bEe(e,t,n,r){return mM(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||_Ee(e,n,r)}function _Ee(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(rd(e,ke.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)rd(e,ke.create(r,u+1,u+1+a.content.size),"pointer");else if(ve.isSelectable(a))rd(e,ve.create(r,u),"pointer");else continue;return!0}}function vM(e){return b_(e)}const a4=Hr?"metaKey":"ctrlKey";rr.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=vM(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&hEe(n,e.input.lastClick)&&!n[a4]&&(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(y_(n));!a||(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new $Ee(e,a,n,!!r)):(o=="doubleClick"?yEe:bEe)(e,a.pos,a.inside,n)?n.preventDefault():xc(e,"pointer"))};class $Ee{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[a4],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 ve&&c.from<=a&&c.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&lo&&!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)),xc(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(()=>Du(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(y_(t))),this.allowDefault||!n?xc(this.view,"pointer"):gEe(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||nr&&this.mightDrag&&!this.mightDrag.node.isAtom||An&&!(this.view.state.selection instanceof ke)&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(rd(this.view,Fe.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):xc(this.view,"pointer")}move(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0),xc(this.view,"pointer"),t.buttons==0&&this.done()}}rr.touchdown=e=>{vM(e),xc(e,"pointer")},rr.contextmenu=e=>vM(e);function u4(e,t){return e.composing?!0:nr&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const SEe=fo?5e3:-1;Wn.compositionstart=Wn.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(),b_(e,!0),e.markCursor=null;else if(b_(e),lo&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelection();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){r.collapse(a,a.nodeValue.length);break}else i=a,o=-1}}e.input.composing=!0}s4(e,SEe)},Wn.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,s4(e,20))};function s4(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>b_(e),t))}function c4(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=TEe());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function TEe(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function b_(e,t=!1){if(!(fo&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),c4(e),t||e.docView&&e.docView.dirty){let n=F3(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}function IEe(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 id=$r&&Nu<15||Qf&&Twe<604;rr.copy=Wn.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=id?null:n.clipboardData,a=r.content(),{dom:u,text:s}=Z3(e,a);o?(n.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",s)):IEe(e,u),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function OEe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function wEe(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?gM(e,r.value,null,t):gM(e,r.textContent,r.innerHTML,t)},50)}function gM(e,t,n,r){let i=X3(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",u=>u(e,r,i||ee.empty)))return!0;if(!i)return!1;let o=OEe(i),a=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Wn.paste=(e,t)=>{let n=t;if(e.composing&&!fo)return;let r=id?null:n.clipboardData;r&&gM(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():wEe(e,n)};class EEe{constructor(t,n){this.slice=t,this.move=n}}const l4=Hr?"altKey":"ctrlKey";rr.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(y_(n));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof ve?i.to-1:i.to))){if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(ve.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(ve.create(e.state.doc,c.posBefore)))}}let a=e.state.selection.content(),{dom:u,text:s}=Z3(e,a);n.dataTransfer.clearData(),n.dataTransfer.setData(id?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",id||n.dataTransfer.setData("text/plain",s),e.dragging=new EEe(a,!n[l4])},rr.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Wn.dragover=Wn.dragenter=(e,t)=>t.preventDefault(),Wn.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(y_(n));if(!i)return;let o=e.state.doc.resolve(i.pos);if(!o)return;let a=r&&r.slice;a?e.someProp("transformPasted",h=>{a=h(a)}):a=X3(e,n.dataTransfer.getData(id?"Text":"text/plain"),id?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[l4]);if(e.someProp("handleDrop",h=>h(e,n,a||ee.empty,u))){n.preventDefault();return}if(!a)return;n.preventDefault();let s=a?lwe(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&&ve.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new ve(p));else{let h=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((v,y,b,w)=>h=w),c.setSelection(uM(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},rr.focus=e=>{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.domSelection())&&Du(e)},20))},rr.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)},rr.beforeinput=(e,t)=>{if(An&&fo&&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,ed(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 Wn)rr[e]=Wn[e];function vm(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 yM{constructor(t,n){this.toDOM=t,this.spec=n||kc,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 Tr(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof yM&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&vm(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Lu{constructor(t,n){this.attrs=t,this.spec=n||kc}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 Tr(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Lu&&vm(this.attrs,t.attrs)&&vm(this.spec,t.spec)}static is(t){return t.type instanceof Lu}destroy(){}}class bM{constructor(t,n){this.attrs=t,this.spec=n||kc}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 Tr(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 bM&&vm(this.attrs,t.attrs)&&vm(this.spec,t.spec)}destroy(){}}class Tr{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Tr(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 Tr(t,t,new yM(n,r))}static inline(t,n,r,i){return new Tr(t,n,new Lu(r,i))}static node(t,n,r,i){return new Tr(t,n,new bM(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Lu}}const od=[],kc={};class Vt{constructor(t,n){this.local=t.length?t:od,this.children=n.length?n:od}static create(t,n){return n.length?__(n,t,0,kc):_n}find(t,n,r){let i=[];return this.findInner(t==null?0:t,n==null?1e9:n,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==_n||t.maps.length==0?this:this.mapInner(t,n,0,0,r||kc)}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?REe(this.children,a||[],t,n,r,i,o):a?new Vt(a.sort(Ac),od):_n}add(t,n){return n.length?this==_n?Vt.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=d4(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,__(l,u,c+1,kc)),o+=3}});let a=f4(o?p4(n):n,-r);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||a.splice(u--,1);return new Vt(a.length?this.local.concat(a).sort(Ac):this.local,i||this.children)}remove(t){return t.length==0||this==_n?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!=_n?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 Vt(i,r):_n}forChild(t,n){if(this==_n)return this;if(n.isLeaf)return Vt.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 Lu){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 Vt(i.sort(Ac),od);return r?new ju([u,r]):u}return r||_n}eq(t){if(this==t)return!0;if(!(t instanceof Vt)||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 _M(this.localsInner(t))}localsInner(t){if(this==_n)return od;if(t.inlineContent||!this.local.some(Lu.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Lu||n.push(this.local[r]);return n}}Vt.empty=new Vt([],[]),Vt.removeOverlap=_M;const _n=Vt.empty;class ju{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,kc));return ju.from(r)}forChild(t,n){if(n.isLeaf)return Vt.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=_n&&(o instanceof ju?r=r.concat(o.members):r.push(o))}return ju.from(r)}eq(t){if(!(t instanceof ju)||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?_M(r?n:n.sort(Ac)):od}static from(t){switch(t.length){case 0:return _n;case 1:return t[0];default:return new ju(t)}}}function REe(e,t,n,r,i,o,a){let u=e.slice(),s=(l,f,d,p)=>{for(let h=0;h<u.length;h+=3){let v=u[h+1],y;if(v<0||l>v+o)continue;let b=u[h]+o;f>=b?u[h+1]=l<=b?-2:-1:d>=i&&(y=p-d-(f-l))&&(u[h]+=y,u[h+1]+=y)}};for(let l=0;l<n.maps.length;l++)n.maps[l].forEach(s);let c=!1;for(let l=0;l<u.length;l+=3)if(u[l+1]<0){if(u[l+1]==-2){c=!0,u[l+1]=-1;continue}let f=n.map(e[l]+o),d=f-i;if(d<0||d>=r.content.size){c=!0;continue}let p=n.map(e[l+1]+o,-1),h=p-i,{index:v,offset:y}=r.content.findIndex(d),b=r.maybeChild(v);if(b&&y==d&&y+b.nodeSize==h){let w=u[l+2].mapInner(n,b,f+1,e[l]+o+1,a);w!=_n?(u[l]=d,u[l+1]=h,u[l+2]=w):(u[l+1]=-2,c=!0)}else c=!0}if(c){let l=MEe(u,e,t,n,i,o,a),f=__(l,r,0,a);t=f.local;for(let d=0;d<u.length;d+=3)u[d+1]<0&&(u.splice(d,3),d-=3);for(let d=0,p=0;d<f.children.length;d+=3){let h=f.children[d];for(;p<u.length&&u[p]<h;)p+=3;u.splice(p,0,f.children[d],f.children[d+1],f.children[d+2])}}return new Vt(t.sort(Ac),u)}function f4(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 Tr(i.from+t,i.to+t,i.type))}return n}function MEe(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 d4(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 p4(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function __(e,t,n,r){let i=[],o=!1;t.forEach((u,s)=>{let c=d4(e,u,s+n);if(c){o=!0;let l=__(c,u,n+s+1,r);l!=_n&&i.push(s,s+u.nodeSize,l)}});let a=f4(o?p4(e):e,-n).sort(Ac);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 Vt(a,i):_n}function Ac(e,t){return e.from-t.from||e.to-t.to}function _M(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),h4(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),h4(t,i,r.copy(o.from,r.to)));break}}}return t}function h4(e,t,n){for(;t<e.length&&Ac(n,e[t])>0;)t++;e.splice(t,0,n)}function $M(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=_n&&t.push(r)}),e.cursorWrapper&&t.push(Vt.create(e.state.doc,[e.cursorWrapper.deco])),ju.from(t)}const CEe={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},xEe=$r&&Nu<=11;class kEe{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 AEe{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new kEe,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]);$r&&Nu<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),xEe&&(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.observe(this.view.dom,CEe),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(!!q3(this.view)){if(this.suppressingSelectionUpdates)return Du(this.view);if($r&&Nu<=11&&!this.view.state.selection.empty){let t=this.view.domSelection();if(t.focusNode&&fm(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(t){if(t.rangeCount==0)return!0;let n=t.getRangeAt(0).commonAncestorContainer,r=this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}flush(){if(!this.view.docView||this.flushingSoon>-1)return;let t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);let n=this.view.domSelection(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&q3(this.view)&&!this.ignoreSelectionChange(n),i=-1,o=-1,a=!1,u=[];if(this.view.editable)for(let s=0;s<t.length;s++){let c=this.registerMutation(t[s],u);c&&(i=i<0?c.from:Math.min(c.from,i),o=o<0?c.to:Math.max(c.to,o),c.typeOver&&(a=!0))}if(lo&&u.length>1){let s=u.filter(c=>c.nodeName=="BR");if(s.length==2){let c=s[0],l=s[1];c.parentNode&&c.parentNode.parentNode==l.parentNode?l.remove():c.remove()}}(i>-1||r)&&(i>-1&&(this.view.docView.markDirty(i,o),WEe(this.view)),this.handleDOMChange(i,o,a,u),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(n)||Du(this.view),this.currentSelection.set(n))}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($r&&Nu<=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?Sr(i)+1:0,u=r.localPosFromDOM(t.target,a,-1),s=o&&o.parentNode==t.target?Sr(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 m4=!1;function WEe(e){m4||(m4=!0,getComputedStyle(e.dom).whiteSpace=="normal"&&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."))}function NEe(e,t,n){let{node:r,fromOffset:i,toOffset:o,from:a,to:u}=e.docView.parseRange(t,n),s=e.domSelection(),c,l=s.anchorNode;if(l&&e.dom.contains(l.nodeType==1?l:l.parentNode)&&(c=[{node:l,offset:s.anchorOffset}],eM(s)||c.push({node:s.focusNode,offset:s.focusOffset})),An&&e.input.lastKeyCode===8)for(let y=o;y>i;y--){let b=r.childNodes[y-1],w=b.pmViewDesc;if(b.nodeName=="BR"&&!w){o=y;break}if(!w||w.size)break}let f=e.state.doc,d=e.someProp("domParser")||Hf.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:PEe,context:p});if(c&&c[0].pos!=null){let y=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=y),h={anchor:y+a,head:b+a}}return{doc:v,sel:h,from:a,to:u}}function PEe(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(nr&&/^(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||nr&&/^(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 FEe(e,t,n,r,i){if(t<0){let E=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,J=F3(e,E);if(J&&!e.state.selection.eq(J)){let q=e.state.tr.setSelection(J);E=="pointer"?q.setMeta("pointer",!0):E=="key"&&q.scrollIntoView(),e.dispatch(q)}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=NEe(e,t,n);if(An&&e.cursorWrapper&&s.sel&&s.sel.anchor==e.cursorWrapper.deco.from){let E=e.cursorWrapper.deco.type.toDOM.nextSibling,J=E&&E.nodeValue?E.nodeValue.length:1;s.sel={anchor:s.sel.anchor+J,head:s.sel.anchor+J}}let 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=jEe(l.content,s.doc.content,s.from,f,d);if((Qf&&e.input.lastIOSEnter>Date.now()-225||fo)&&i.some(E=>E.nodeName=="DIV"||E.nodeName=="P")&&(!p||p.endA>=p.endB)&&e.someProp("handleKeyDown",E=>E(e,ed(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!p)if(r&&u instanceof ke&&!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}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&p.start==p.endB&&e.state.selection instanceof ke&&(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)),$r&&Nu<=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)==" \xA0"&&(p.start--,p.endA--,p.endB--);let h=s.doc.resolveNoCache(p.start-s.from),v=s.doc.resolveNoCache(p.endB-s.from),y=c.resolve(p.start),b=h.sameParent(v)&&h.parent.inlineContent&&y.end()>=p.endA,w;if((Qf&&e.input.lastIOSEnter>Date.now()-225&&(!b||i.some(E=>E.nodeName=="DIV"||E.nodeName=="P"))||!b&&h.pos<s.doc.content.size&&(w=Fe.findFrom(s.doc.resolve(h.pos+1),1,!0))&&w.head==v.pos)&&e.someProp("handleKeyDown",E=>E(e,ed(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>p.start&&LEe(c,p.start,p.endA,h,v)&&e.someProp("handleKeyDown",E=>E(e,ed(8,"Backspace")))){fo&&An&&e.domObserver.suppressSelectionUpdates();return}An&&fo&&p.endB==p.start&&(e.input.lastAndroidDelete=Date.now()),fo&&!b&&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,ed(13,"Enter"))})},20));let F=p.start,g=p.endA,T,I,W;if(b){if(h.pos==v.pos)$r&&Nu<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Du(e),20)),T=e.state.tr.delete(F,g),I=c.resolve(p.start).marksAcross(c.resolve(p.endA));else if(p.endA==p.endB&&(W=DEe(h.parent.content.cut(h.parentOffset,v.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start()))))T=e.state.tr,W.type=="add"?T.addMark(F,g,W.mark):T.removeMark(F,g,W.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",J=>J(e,F,g,E)))return;T=e.state.tr.insertText(E,F,g)}}if(T||(T=e.state.tr.replace(F,g,s.doc.slice(p.start-s.from,p.endB-s.from))),s.sel){let E=v4(e,T.doc,s.sel);E&&!(An&&fo&&e.composing&&E.empty&&(p.start!=p.endB||e.input.lastAndroidDelete<Date.now()-100)&&(E.head==F||E.head==T.mapping.map(g)-1)||$r&&E.empty&&E.head==F)&&T.setSelection(E)}I&&T.ensureMarks(I),e.dispatch(T.scrollIntoView())}function v4(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:uM(e,t.resolve(n.anchor),t.resolve(n.head))}function DEe(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(H.from(c).eq(e))return{mark:u,type:a}}function LEe(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||SM(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(SM(o,!0,!0));return!a.parent.isTextblock||a.pos>n||SM(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function SM(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 jEe(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}return a<o&&e.size<t.size?(o-=r<=o&&r>=a?o-r:0,u=o+(u-a),a=o):u<o&&(o-=r<=o&&r>=u?o-r:0,a=o+(a-u),u=o),{start:o,endA:a,endB:u}}class UEe{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 cEe,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach($4),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=b4(this),y4(this),this.nodeViews=_4(this),this.docView=x3(this.state.doc,g4(this),$M(this),this.dom,this),this.domObserver=new AEe(this,(r,i,o,a)=>FEe(this,r,i,o,a)),this.domObserver.start(),lEe(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&&pM(this),this._props=t,t.plugins&&(t.plugins.forEach($4),this.directPlugins=t.plugins),this.updateStateInner(t.state,!0)}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.state.plugins!=t.plugins)}updateStateInner(t,n){let r=this.state,i=!1,o=!1;if(t.storedMarks&&this.composing&&(c4(this),o=!0),this.state=t,n){let f=_4(this);zEe(f,this.nodeViews)&&(this.nodeViews=f,i=!0),pM(this)}this.editable=b4(this),y4(this);let a=$M(this),u=g4(this),s=n?"reset":t.scrollToSelection>r.scrollToSelection?"to selection":"preserve",c=i||!this.docView.matchesNode(t.doc,u,a);(c||!t.selection.eq(r.selection))&&(o=!0);let l=s=="preserve"&&o&&this.dom.style.overflowAnchor==null&&Mwe(this);if(o){this.domObserver.stop();let f=c&&($r||An)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&BEe(r.selection,t.selection);if(c){let d=An?this.trackWrites=this.domSelection().focusNode:null;(i||!this.docView.update(t.doc,u,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=x3(t.doc,u,a,this.dom,this)),d&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&eEe(this))?Du(this,f):(B3(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(r),s=="reset")this.dom.scrollTop=0;else if(s=="to selection"){let f=this.domSelection().focusNode;if(!this.someProp("handleScrollToSelection",d=>d(this)))if(t.selection instanceof ve){let d=this.docView.domAfterPos(t.selection.from);d.nodeType==1&&b3(this,d.getBoundingClientRect(),f)}else b3(this,this.coordsAtPos(t.selection.head,1),f)}else l&&Cwe(l)}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(){return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&xwe(this.dom),Du(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 Pwe(this,t)}coordsAtPos(t,n=1){return I3(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 Uwe(this,n||this.state,t)}destroy(){!this.docView||(fEe(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],$M(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 pEe(this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelection(){return this.root.getSelection()}}function g4(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]))}),[Tr.node(0,e.state.doc.content.size,t)]}function y4(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:Tr.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function b4(e){return!e.someProp("editable",t=>t(e.state)===!1)}function BEe(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 _4(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 zEe(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 $4(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")}var Uu={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:"'"},$_={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},S4=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent);typeof navigator<"u"&&/Gecko\/\d+/.test(navigator.userAgent);for(var qEe=typeof navigator<"u"&&/Mac/.test(navigator.platform),KEe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),VEe=qEe||S4&&+S4[1]<57,fn=0;fn<10;fn++)Uu[48+fn]=Uu[96+fn]=String(fn);for(var fn=1;fn<=24;fn++)Uu[fn+111]="F"+fn;for(var fn=65;fn<=90;fn++)Uu[fn]=String.fromCharCode(fn+32),$_[fn]=String.fromCharCode(fn);for(var TM in Uu)$_.hasOwnProperty(TM)||($_[TM]=Uu[TM]);function HEe(e){var t=VEe&&(e.ctrlKey||e.altKey||e.metaKey)||KEe&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?$_:Uu)[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 JEe=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function GEe(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))JEe?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 YEe(e){let t=Object.create(null);for(let n in e)t[GEe(n)]=e[n];return t}function IM(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n!==!1&&t.shiftKey&&(e="Shift-"+e),e}function ZEe(e){return new Vr({props:{handleKeyDown:XEe(e)}})}function XEe(e){let t=YEe(e);return function(n,r){let i=HEe(r),o=i.length==1&&i!=" ",a,u=t[IM(i,r,!o)];if(u&&u(n.state,n.dispatch,n))return!0;if(o&&(r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(a=Uu[r.keyCode])&&a!=i){let s=t[IM(a,r,!0)];if(s&&s(n.state,n.dispatch,n))return!0}else if(o&&r.shiftKey){let s=t[IM(i,r,!0)];if(s&&s(n.state,n.dispatch,n))return!0}return!1}}const T4=65535,I4=Math.pow(2,16);function QEe(e,t){return e+t*I4}function O4(e){return e&T4}function eRe(e){return(e-(e&T4))/I4}const w4=1,E4=2,S_=4,R4=8;class M4{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&R4)>0}get deletedBefore(){return(this.delInfo&(w4|S_))>0}get deletedAfter(){return(this.delInfo&(E4|S_))>0}get deletedAcross(){return(this.delInfo&S_)>0}}class Ci{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Ci.empty)return Ci.empty}recover(t){let n=0,r=O4(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+eRe(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:QEe(u/3,t-s),v=t==s?E4:t==f?w4:S_;return(n<0?t!=s:t!=f)&&(v|=R4),new M4(p,v,h)}i+=l-c}return r?t+i:new M4(t+i,0,null)}touches(t,n){let r=0,i=O4(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 Ci(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Ci.empty:new Ci(t<0?[0,-t,0]:[0,0,t])}}Ci.empty=new Ci([]);const OM=Object.create(null);class Bu{getMap(){return Ci.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=OM[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 OM)throw new RangeError("Duplicate use of step JSON ID "+t);return OM[t]=n,n.prototype.jsonID=t,n}}class Ir{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Ir(t,null)}static fail(t){return new Ir(null,t)}static fromReplace(t,n,r,i){try{return Ir.ok(t.replace(n,r,i))}catch(o){if(o instanceof Vf)return Ir.fail(o.message);throw o}}}function wM(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(wM(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return H.fromArray(r)}class Wc extends Bu{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 ee(wM(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 Ir.fromReplace(t,this.from,this.to,o)}invert(){return new Nc(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 Wc(n.pos,r.pos,this.mark)}merge(t){return t instanceof Wc&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Wc(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 Wc(n.from,n.to,t.markFromJSON(n.mark))}}Bu.jsonID("addMark",Wc);class Nc extends Bu{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 ee(wM(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Ir.fromReplace(t,this.from,this.to,r)}invert(){return new Wc(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 Nc(n.pos,r.pos,this.mark)}merge(t){return t instanceof Nc&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Nc(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 Nc(n.from,n.to,t.markFromJSON(n.mark))}}Bu.jsonID("removeMark",Nc);class Ta extends Bu{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&EM(t,this.from,this.to)?Ir.fail("Structure replace would overwrite content"):Ir.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Ci([this.from,this.to-this.from,this.slice.size])}invert(t){return new Ta(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 Ta(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Ta)||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?ee.empty:new ee(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Ta(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?ee.empty:new ee(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Ta(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 Ta(n.from,n.to,ee.fromJSON(t,n.slice),!!n.structure)}}Bu.jsonID("replace",Ta);class ad extends Bu{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&&(EM(t,this.from,this.gapFrom)||EM(t,this.gapTo,this.to)))return Ir.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Ir.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Ir.fromReplace(t,this.from,this.to,r):Ir.fail("Content does not fit in gap")}getMap(){return new Ci([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 ad(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 ad(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 ad(n.from,n.to,n.gapFrom,n.gapTo,ee.fromJSON(t,n.slice),n.insert,!!n.structure)}}Bu.jsonID("replaceAround",ad);function EM(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 tRe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function nRe(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||!tRe(i,o,a))break}return null}function rRe(e,t,n=null,r=e){let i=iRe(e,t),o=i&&oRe(r,t);return o?i.map(C4).concat({type:t,attrs:n}).concat(o.map(C4)):null}function C4(e){return{type:e,attrs:null}}function iRe(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 oRe(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 T_(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 RM(e,t){let n=e.resolve(t),r=n.index();return aRe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function aRe(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}let gm=class extends Error{};gm=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},gm.prototype=Object.create(Error.prototype),gm.prototype.constructor=gm,gm.prototype.name="TransformError";const uRe=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0),sRe=(e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;let i=x4(r);if(!i){let a=r.blockRange(),u=a&&um(a);return u==null?!1:(t&&t(e.tr.lift(a,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&W4(e,i,t))return!0;if(r.parent.content.size==0&&(ud(o,"end")||ve.isSelectable(o))){let a=zR(e.doc,r.before(),r.after(),ee.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(ud(o,"end")?Fe.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):ve.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 ud(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 cRe=(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=x4(r)}let a=o&&o.nodeBefore;return!a||!ve.isSelectable(a)?!1:(t&&t(e.tr.setSelection(ve.create(e.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function x4(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}const lRe=(e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;let i=k4(r);if(!i)return!1;let o=i.nodeAfter;if(W4(e,i,t))return!0;if(r.parent.content.size==0&&(ud(o,"start")||ve.isSelectable(o))){let a=zR(e.doc,r.before(),r.after(),ee.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(ud(o,"start")?Fe.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):ve.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},fRe=(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=k4(r)}let a=o&&o.nodeAfter;return!a||!ve.isSelectable(a)?!1:(t&&t(e.tr.setSelection(ve.create(e.doc,o.pos)).scrollIntoView()),!0)};function k4(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 dRe=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&um(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},pRe=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
40
|
-
`).scrollIntoView()),!0)};function A4(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 hRe=(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=A4(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(Fe.near(s.doc.resolve(u),1)),t(s.scrollIntoView())}return!0},mRe=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Ri||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=A4(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(ke.create(u.doc,a+1)),t(u.scrollIntoView())}return!0},vRe=(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(t3(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&um(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},gRe=(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(ve.create(e.doc,i))),!0)};function yRe(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||n3(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function W4(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(yRe(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=H.empty;for(let v=o.length-1;v>=0;v--)d=H.from(o[v].create(null,d));d=H.from(r.copy(d));let p=e.tr.step(new ln(t.pos-1,f,t.pos,f,new ee(d,1,0),o.length,!0)),h=f+2*o.length;n3(p.doc,h)&&p.join(h),n(p.scrollIntoView())}return!0}let s=Fe.findFrom(t,1),c=s&&s.$from.blockRange(s.$to),l=c&&um(c);if(l!=null&&l>=t.depth)return n&&n(e.tr.lift(c,l).scrollIntoView()),!0;if(u&&ud(i,"start",!0)&&ud(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=H.empty;for(let b=d.length-1;b>=0;b--)v=H.from(d[b].copy(v));let y=e.tr.step(new ln(t.pos-d.length,t.pos+i.nodeSize,t.pos+h,t.pos+i.nodeSize-h,new ee(v,d.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}function N4(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(ke.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const bRe=N4(-1),_Re=N4(1);function $Re(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),u=a&&QV(a,e,t);return u?(r&&r(n.tr.wrap(a,u).scrollIntoView()),!0):!1}}function P4(e,t=null){return function(n,r){let{from:i,to:o}=n.selection,a=!1;return n.doc.nodesBetween(i,o,(u,s)=>{if(a)return!1;if(!(!u.isTextblock||u.hasMarkup(e,t)))if(u.type==e)a=!0;else{let c=n.doc.resolve(s),l=c.index();a=c.parent.canReplaceWith(l,l+1,e)}}),a?(r&&r(n.tr.setBlockType(i,o,e,t).scrollIntoView()),!0):!1}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function SRe(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 o_(l,l,a.depth),a.endIndex<a.parent.childCount&&(a=new o_(i,n.doc.resolve(o.end(a.depth)),a.depth)),u=!0}let c=QV(s,e,t,a);return c?(r&&r(TRe(n.tr,a,c,u,e).scrollIntoView()),!0):!1}}function TRe(e,t,n,r,i){let o=H.empty;for(let l=n.length-1;l>=0;l--)o=H.from(n[l].type.create(n[l].attrs,o));e.step(new ln(t.start-(r?2:0),t.end,t.start,t.end,new ee(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&&t3(e.doc,s,u)&&(e.split(s,u),s+=2*u),s+=c.child(l).nodeSize;return e}function IRe(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?ORe(t,n,e,o):wRe(t,n,o):!0:!1}}function ORe(e,t,n,r){let i=e.tr,o=r.end,a=r.$to.end(r.depth);return o<a&&(i.step(new ln(o-1,a,o,a,new ee(H.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new o_(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth)),t(i.lift(r,um(r)).scrollIntoView()),!0}function wRe(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?H.empty:H.from(i))))return!1;let f=o.pos,d=f+a.nodeSize;return r.step(new ln(f-(u?1:0),d+(s?1:0),f+1,d-1,new ee((u?H.empty:H.from(i.copy(H.empty))).append(s?H.empty:H.from(i.copy(H.empty))),u?0:1,s?0:1),u?0:1)),t(r.scrollIntoView()),!0}function ERe(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=H.from(c?e.create():null),f=new ee(H.from(e.create(null,H.from(u.type.create(null,l)))),c?3:1,0),d=o.start,p=o.end;n(t.tr.step(new ln(d-(c?3:1),p,d,p,f,1,!0)).scrollIntoView())}return!0}}function I_(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 O_{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 y=this.buildProps(c,n),b=p(...v)(y);return u.push(b),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:I_({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 RRe{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 ue(e,t,n){return e.config[t]===void 0&&e.parent?ue(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?ue(e.parent,t,n):null}):e.config[t]}function w_(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 F4(e){const t=[],{nodeExtensions:n,markExtensions:r}=w_(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=ue(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=ue(a,"addAttributes",u);if(!s)return;const c=s();Object.entries(c).forEach(([l,f])=>{const d={...o,...f};f.isRequired&&f.default===void 0&&delete d.default,t.push({type:a.name,name:l,attribute:d})})}),t}function Ht(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 dn(...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 MM(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)=>dn(n,r),{})}function D4(e){return typeof e=="function"}function Ee(e,t=void 0,...n){return D4(e)?t?e.bind(t)(...n):e(...n):e}function MRe(e={}){return Object.keys(e).length===0&&e.constructor===Object}function CRe(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function L4(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):CRe(n.getAttribute(a.name));return u==null?o:{...o,[a.name]:u}},{});return{...r,...i}}}}function j4(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&MRe(n)?!1:n!=null))}function U4(e){var t;const n=F4(e),{nodeExtensions:r,markExtensions:i}=w_(e),o=(t=r.find(s=>ue(s,"topNode")))===null||t===void 0?void 0:t.name,a=Object.fromEntries(r.map(s=>{const c=n.filter(y=>y.type===s.name),l={name:s.name,options:s.options,storage:s.storage},f=e.reduce((y,b)=>{const w=ue(b,"extendNodeSchema",l);return{...y,...w?w(s):{}}},{}),d=j4({...f,content:Ee(ue(s,"content",l)),marks:Ee(ue(s,"marks",l)),group:Ee(ue(s,"group",l)),inline:Ee(ue(s,"inline",l)),atom:Ee(ue(s,"atom",l)),selectable:Ee(ue(s,"selectable",l)),draggable:Ee(ue(s,"draggable",l)),code:Ee(ue(s,"code",l)),defining:Ee(ue(s,"defining",l)),isolating:Ee(ue(s,"isolating",l)),attrs:Object.fromEntries(c.map(y=>{var b;return[y.name,{default:(b=y==null?void 0:y.attribute)===null||b===void 0?void 0:b.default}]}))}),p=Ee(ue(s,"parseHTML",l));p&&(d.parseDOM=p.map(y=>L4(y,c)));const h=ue(s,"renderHTML",l);h&&(d.toDOM=y=>h({node:y,HTMLAttributes:MM(y,c)}));const v=ue(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,y)=>{const b=ue(y,"extendMarkSchema",l);return{...v,...b?b(s):{}}},{}),d=j4({...f,inclusive:Ee(ue(s,"inclusive",l)),excludes:Ee(ue(s,"excludes",l)),group:Ee(ue(s,"group",l)),spanning:Ee(ue(s,"spanning",l)),code:Ee(ue(s,"code",l)),attrs:Object.fromEntries(c.map(v=>{var y;return[v.name,{default:(y=v==null?void 0:v.attribute)===null||y===void 0?void 0:y.default}]}))}),p=Ee(ue(s,"parseHTML",l));p&&(d.parseDOM=p.map(v=>L4(v,c)));const h=ue(s,"renderHTML",l);return h&&(d.toDOM=v=>h({mark:v,HTMLAttributes:MM(v,c)})),[s.name,d]}));return new j1e({topNode:o,nodes:a,marks:u})}function CM(e,t){return t.nodes[e]||t.marks[e]||null}function B4(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}const xRe=(e,t=500)=>{let n="";return e.parent.nodesBetween(Math.max(0,e.parentOffset-t),e.parentOffset,(r,i,o,a)=>{var u,s,c;n+=((s=(u=r.type.spec).toText)===null||s===void 0?void 0:s.call(u,{node:r,pos:i,parent:o,index:a}))||((c=e.nodeBefore)===null||c===void 0?void 0:c.text)||"%leaf%"}),n};function xM(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class kM{constructor(t){this.find=t.find,this.handler=t.handler}}const kRe=(e,t)=>{if(xM(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[];return r.push(n.text),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 AM(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=xRe(c)+o;return a.forEach(d=>{if(l)return;const p=kRe(f,d.find);if(!p)return;const h=s.state.tr,v=I_({state:s.state,transaction:h}),y={from:r-(p[0].length-o.length),to:i},{commands:b,chain:w,can:F}=new O_({editor:n,state:v});d.handler({state:v,range:y,match:p,commands:b,chain:w,can:F})===null||!h.steps.length||(h.setMeta(u,{transform:h,from:r,to:i,text:o}),s.dispatch(h),l=!0)}),l}function ARe(e){const{editor:t,rules:n}=e,r=new Vr({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 AM({editor:t,from:o,to:a,text:u,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&AM({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?AM({editor:t,from:a.pos,to:a.pos,text:`
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
`,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 q4(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const URe=Or.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Vr({key:new ku("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=q4(n);return z4(r,{from:a,to:u},{textSerializers:s})}}})]}}),BRe=()=>({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),zRe=(e=!1)=>({commands:t})=>t.setContent("",e),qRe=()=>({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=nRe(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},KRe=e=>t=>e(t),VRe=()=>({state:e,dispatch:t})=>mRe(e,t),HRe=e=>({tr:t,state:n,dispatch:r})=>{const i=Ht(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},JRe=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},GRe=()=>({state:e,dispatch:t})=>uRe(e,t),YRe=()=>({commands:e})=>e.keyboardShortcut("Enter"),ZRe=()=>({state:e,dispatch:t})=>hRe(e,t);function R_(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:xM(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function NM(e,t,n={}){return e.find(r=>r.type===t&&R_(r.attrs,n))}function XRe(e,t,n={}){return!!NM(e,t,n)}function PM(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=NM([...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(NM([...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&&XRe([...e.parent.child(u).marks],t,n);)s+=e.parent.child(u).nodeSize,u+=1;return{from:a,to:s}}function zu(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 QRe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=zu(e,r.schema),{doc:a,selection:u}=n,{$from:s,from:c,to:l}=u;if(i){const f=PM(s,o,t);if(f&&f.from<=c&&f.to>=l){const d=ke.create(a,f.from,f.to);n.setSelection(d)}}return!0},eMe=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 K4(e){return e instanceof ke}function Ia(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function V4(e,t=null){if(!t)return null;const n=Fe.atStart(e),r=Fe.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?ke.create(e,Ia(0,i,o),Ia(e.content.size,i,o)):ke.create(e,Ia(t,i,o),Ia(t,i,o))}function M_(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const tMe=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const a=()=>{M_()&&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&&!K4(n.state.selection))return a(),!0;const u=V4(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},nMe=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),rMe=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t);function H4(e){const t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,"text/html").body}function C_(e,t,n){if(n={slice:!0,parseOptions:{},...n},typeof e=="object"&&e!==null)try{return Array.isArray(e)?H.fromArray(e.map(r=>t.nodeFromJSON(r))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),C_("",t,n)}if(typeof e=="string"){const r=Hf.fromSchema(t);return n.slice?r.parseSlice(H4(e),n.parseOptions).content:r.parse(H4(e),n.parseOptions)}return C_("",t,n)}function iMe(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof Ta||i instanceof ad))return;const o=e.mapping.maps[r];let a=0;o.forEach((u,s,c,l)=>{a===0&&(a=l)}),e.setSelection(Fe.near(e.doc.resolve(a),n))}const oMe=e=>e.toString().startsWith("<"),aMe=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const a=C_(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((oMe(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&&iMe(r,r.steps.length-1,-1)}return!0},uMe=()=>({state:e,dispatch:t})=>sRe(e,t),sMe=()=>({state:e,dispatch:t})=>lRe(e,t);function J4(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function cMe(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))M_()||J4()?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 lMe=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=cMe(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 ym(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,a=t?Ht(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=>R_(f.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((f,d)=>f+d.to-d.from,0)>=s}const fMe=(e,t={})=>({state:n,dispatch:r})=>{const i=Ht(e,n.schema);return ym(n,i,t)?dRe(n,r):!1},dMe=()=>({state:e,dispatch:t})=>vRe(e,t),pMe=e=>({state:t,dispatch:n})=>{const r=Ht(e,t.schema);return IRe(r)(t,n)},hMe=()=>({state:e,dispatch:t})=>pRe(e,t);function x_(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function G4(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 mMe=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const u=x_(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(o=Ht(e,r.schema)),u==="mark"&&(a=zu(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,G4(c.attrs,t)),a&&c.marks.length&&c.marks.forEach(f=>{a===f.type&&n.addMark(l,l+c.nodeSize,a.create(G4(f.attrs,t)))})})}),!0):!1},vMe=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),gMe=()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),yMe=()=>({state:e,dispatch:t})=>cRe(e,t),bMe=()=>({state:e,dispatch:t})=>fRe(e,t),_Me=()=>({state:e,dispatch:t})=>gRe(e,t),$Me=()=>({state:e,dispatch:t})=>_Re(e,t),SMe=()=>({state:e,dispatch:t})=>bRe(e,t);function Y4(e,t,n={}){return C_(e,t,{slice:!1,parseOptions:n})}const TMe=(e,t=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,u=Y4(e,i.schema,n);return o&&r.replaceWith(0,a.content.size,u).setMeta("preventUpdate",!t),!0};function Z4(e,t){const n=zu(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}:{}}const IMe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:a,ranges:u}=o,s=zu(e,r.schema);if(i)if(a){const c=Z4(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(b=>b.type===s)?d.marks.forEach(b=>{s===b.type&&n.addMark(h,v,s.create({...b.attrs,...t}))}):n.addMark(h,v,s.create(t))})});return!0},OMe=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),wMe=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=Ht(e,n.schema);return o.isTextblock?i().command(({commands:a})=>P4(o,t)(n)?!0:a.clearNodes()).command(({state:a})=>P4(o,t)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},EMe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=Ia(e,0,r.content.size),o=ve.create(r,i);t.setSelection(o)}return!0},RMe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,a=ke.atStart(r).from,u=ke.atEnd(r).to,s=Ia(i,a,u),c=Ia(o,a,u),l=ke.create(r,s,c);t.setSelection(l)}return!0},MMe=e=>({state:t,dispatch:n})=>{const r=Ht(e,t.schema);return ERe(r)(t,n)};function CMe(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 k_(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 X4(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 xMe=({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=k_(c,u.node().type.name,u.node().attrs);if(o instanceof ve&&o.node.isBlock)return!u.parentOffset||!T_(a,u.pos)?!1:(r&&(e&&X4(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 ke&&t.deleteSelection();const d=u.depth===0?void 0:CMe(u.node(-1).contentMatchAt(u.indexAfter(-1)));let p=f&&d?[{type:d,attrs:l}]:void 0,h=T_(t.doc,t.mapping.map(u.pos),1,p);if(!p&&!h&&T_(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()),y=t.doc.resolve(v);u.node(-1).canReplaceWith(y.index(),y.index()+1,d)&&t.setNodeMarkup(t.mapping.map(u.before()),d)}e&&X4(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0},kMe=e=>({tr:t,state:n,dispatch:r,editor:i})=>{var o;const a=Ht(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 y=H.empty;const b=u.index(-1)?1:u.index(-2)?2:3;for(let W=u.depth-b;W>=u.depth-3;W-=1)y=H.from(u.node(W).copy(y));const w=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,F=k_(f,u.node().type.name,u.node().attrs),g=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(F))||void 0;y=y.append(H.from(a.createAndFill(null,g)||void 0));const T=u.before(u.depth-(b-1));t.replace(T,u.after(-w),new ee(y,4-b,0));let I=-1;t.doc.nodesBetween(T,t.doc.content.size,(W,E)=>{if(I>-1)return!1;W.isTextblock&&W.content.size===0&&(I=E+1)}),I>-1&&t.setSelection(ke.near(t.doc.resolve(I))),t.scrollIntoView()}return!0}const d=s.pos===u.end()?l.contentMatchAt(0).defaultType:null,p=k_(f,l.type.name,l.attrs),h=k_(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 T_(t.doc,u.pos,2)?(r&&t.split(u.pos,2,v).scrollIntoView(),!0):!1};function AMe(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 FM(e){return t=>AMe(t.$from,e)}function Q4(e,t){const{nodeExtensions:n}=w_(t),r=n.find(a=>a.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=Ee(ue(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}const e5=(e,t)=>{const n=FM(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)&&RM(e.doc,n.pos)&&e.join(n.pos),!0},t5=(e,t)=>{const n=FM(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)&&RM(e.doc,r)&&e.join(r),!0},WMe=(e,t)=>({editor:n,tr:r,state:i,dispatch:o,chain:a,commands:u,can:s})=>{const{extensions:c}=n.extensionManager,l=Ht(e,i.schema),f=Ht(t,i.schema),{selection:d}=i,{$from:p,$to:h}=d,v=p.blockRange(h);if(!v)return!1;const y=FM(b=>Q4(b.type.name,c))(d);if(v.depth>=1&&y&&v.depth-y.depth<=1){if(y.node.type===l)return u.liftListItem(f);if(Q4(y.node.type.name,c)&&l.validContent(y.node.content)&&o)return a().command(()=>(r.setNodeMarkup(y.pos,l),!0)).command(()=>e5(r,l)).command(()=>t5(r,l)).run()}return a().command(()=>s().wrapInList(l)?!0:u.clearNodes()).wrapInList(l).command(()=>e5(r,l)).command(()=>t5(r,l)).run()};function DM(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?zu(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>R_(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,y)=>{if(!v.isText&&!v.marks.length)return;const b=Math.max(p,y),w=Math.min(h,y+v.nodeSize);a+=w-b,u.push(...v.marks.map(g=>({mark:g,from:b,to:w})))})}),a===0)return!1;const s=u.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>R_(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}var NMe=Object.freeze({__proto__:null,blur:BRe,clearContent:zRe,clearNodes:qRe,command:KRe,createParagraphNear:VRe,deleteNode:HRe,deleteRange:JRe,deleteSelection:GRe,enter:YRe,exitCode:ZRe,extendMarkRange:QRe,first:eMe,focus:tMe,forEach:nMe,insertContent:rMe,insertContentAt:aMe,joinBackward:uMe,joinForward:sMe,keyboardShortcut:lMe,lift:fMe,liftEmptyBlock:dMe,liftListItem:pMe,newlineInCode:hMe,resetAttributes:mMe,scrollIntoView:vMe,selectAll:gMe,selectNodeBackward:yMe,selectNodeForward:bMe,selectParentNode:_Me,selectTextblockEnd:$Me,selectTextblockStart:SMe,setContent:TMe,setMark:IMe,setMeta:OMe,setNode:wMe,setNodeSelection:EMe,setTextSelection:RMe,sinkListItem:MMe,splitBlock:xMe,splitListItem:kMe,toggleList:WMe,toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,a=zu(e,r.schema);return DM(r,a,t)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,t)},toggleNode:(e,t,n={})=>({state:r,commands:i})=>{const o=Ht(e,r.schema),a=Ht(t,r.schema);return ym(r,o,n)?i.setNode(a):i.setNode(o,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const i=Ht(e,n.schema);return ym(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=zu(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(y=>y.type===s))===null||o===void 0?void 0:o.attrs,v=PM(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=x_(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(o=Ht(e,r.schema)),u==="mark"&&(a=zu(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=Ht(e,n.schema);return $Re(i,t)(n,r)},wrapInList:(e,t={})=>({state:n,dispatch:r})=>{const i=Ht(e,n.schema);return SRe(i,t)(n,r)}});const PMe=Or.create({name:"commands",addCommands(){return{...NMe}}}),FMe=Or.create({name:"editable",addProseMirrorPlugins(){return[new Vr({key:new ku("editable"),props:{editable:()=>this.editor.options.editable}})]}}),DMe=Or.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Vr({key:new ku("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}}}})]}}),LMe=Or.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=Fe.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.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 M_()||J4()?o:i},addProseMirrorPlugins(){return[new Vr({key:new ku("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=Fe.atStart(t.doc).from,s=Fe.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=I_({state:n,transaction:f}),{commands:p}=new O_({editor:this.editor,state:d});if(p.clearNodes(),!!f.steps.length)return f}})]}}),jMe=Or.create({name:"tabindex",addProseMirrorPlugins(){return[new Vr({key:new ku("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var UMe=Object.freeze({__proto__:null,ClipboardTextSerializer:URe,Commands:PMe,Editable:FMe,FocusEvents:DMe,Keymap:LMe,Tabindex:jMe});function BMe(e,t){const n=Ht(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 zMe(e,t){const n=x_(typeof t=="string"?t:t.name,e.schema);return n==="node"?BMe(e,t):n==="mark"?Z4(e,t):{}}function qMe(e,t){const n=so.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function KMe(e,t){const n={from:0,to:e.content.size};return z4(e,n,t)}function VMe(e,t,n={}){if(!t)return ym(e,null,n)||DM(e,null,n);const r=x_(t,e.schema);return r==="node"?ym(e,t,n):r==="mark"?DM(e,t,n):!1}function HMe(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)}const JMe=`.ProseMirror {
|
|
27
|
+
Check the top-level render call using <`+te+">.")}return U}}function Ff(O,U){{if(!O._store||O._store.validated||O.key!=null)return;O._store.validated=!0;var te=IC(U);if($a[te])return;$a[te]=!0;var $e="";O&&O._owner&&O._owner!==st.current&&($e=" It was passed a child from "+ie(O._owner.type)+"."),Ar(O),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',te,$e),Ar(null)}}function mc(O,U){{if(typeof O!="object")return;if(Fi(O))for(var te=0;te<O.length;te++){var $e=O[te];Pi($e)&&Ff($e,U)}else if(Pi(O))O._store&&(O._store.validated=!0);else if(O){var Ze=m(O);if(typeof Ze=="function"&&Ze!==O.entries)for(var at=Ze.call(O),Ve;!(Ve=at.next()).done;)Pi(Ve.value)&&Ff(Ve.value,U)}}}function hMe(O){{var U=O.type;if(U==null||typeof U=="string")return;var te;if(typeof U=="function")te=U.propTypes;else if(typeof U=="object"&&(U.$$typeof===s||U.$$typeof===f))te=U.propTypes;else return;if(te){var $e=ie(U);Ot(te,O.props,"prop",$e,O)}else if(U.PropTypes!==void 0&&!kf){kf=!0;var Ze=ie(U);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ze||"Unknown")}typeof U.getDefaultProps=="function"&&!U.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function mMe(O){{for(var U=Object.keys(O.props),te=0;te<U.length;te++){var $e=U[te];if($e!=="children"&&$e!=="key"){Ar(O),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",$e),Ar(null);break}}O.ref!==null&&(Ar(O),g("Invalid attribute `ref` supplied to `React.Fragment`."),Ar(null))}}function l6(O,U,te,$e,Ze,at){{var Ve=G(O);if(!Ve){var We="";(O===void 0||typeof O=="object"&&O!==null&&Object.keys(O).length===0)&&(We+=" 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 Kn=Nf(Ze);Kn?We+=Kn:We+=Af();var Wt;O===null?Wt="null":Fi(O)?Wt="array":O!==void 0&&O.$$typeof===t?(Wt="<"+(ie(O.type)||"Unknown")+" />",We=" Did you accidentally export a JSX literal instead of a component?"):Wt=typeof O,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Wt,We)}var Ut=Ie(O,U,te,Ze,at);if(Ut==null)return Ut;if(Ve){var ei=U.children;if(ei!==void 0)if($e)if(Fi(ei)){for(var Wf=0;Wf<ei.length;Wf++)mc(ei[Wf],O);Object.freeze&&Object.freeze(ei)}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 mc(ei,O)}return O===r?mMe(Ut):hMe(Ut),Ut}}function vMe(O,U,te){return l6(O,U,te,!0)}function gMe(O,U,te){return l6(O,U,te,!1)}var yMe=gMe,bMe=vMe;Lf.Fragment=r,Lf.jsx=yMe,Lf.jsxs=bMe}()),Lf}(function(e){process.env.NODE_ENV==="production"?e.exports=v6():e.exports=g6()})(m6);function ho(e){return e!=null}var Pe={},H={},y6={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,C,R,q,G,A,Y,ie;(function(J){var ge=typeof pe=="object"?pe:typeof self=="object"?self:typeof this=="object"?this:{};J(Te(ge,Te(e.exports)));function Te(M,x){return M!==ge&&(typeof Object.create=="function"?Object.defineProperty(M,"__esModule",{value:!0}):M.__esModule=!0),function(w,I){return M[w]=x?x(w,I):I}}})(function(J){var ge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,x){M.__proto__=x}||function(M,x){for(var w in x)Object.prototype.hasOwnProperty.call(x,w)&&(M[w]=x[w])};t=function(M,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");ge(M,x);function w(){this.constructor=M}M.prototype=x===null?Object.create(x):(w.prototype=x.prototype,new w)},n=Object.assign||function(M){for(var x,w=1,I=arguments.length;w<I;w++){x=arguments[w];for(var F in x)Object.prototype.hasOwnProperty.call(x,F)&&(M[F]=x[F])}return M},r=function(M,x){var w={};for(var I in M)Object.prototype.hasOwnProperty.call(M,I)&&x.indexOf(I)<0&&(w[I]=M[I]);if(M!=null&&typeof Object.getOwnPropertySymbols=="function")for(var F=0,I=Object.getOwnPropertySymbols(M);F<I.length;F++)x.indexOf(I[F])<0&&Object.prototype.propertyIsEnumerable.call(M,I[F])&&(w[I[F]]=M[I[F]]);return w},i=function(M,x,w,I){var F=arguments.length,L=F<3?x:I===null?I=Object.getOwnPropertyDescriptor(x,w):I,Z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(M,x,w,I);else for(var ee=M.length-1;ee>=0;ee--)(Z=M[ee])&&(L=(F<3?Z(L):F>3?Z(x,w,L):Z(x,w))||L);return F>3&&L&&Object.defineProperty(x,w,L),L},o=function(M,x){return function(w,I){x(w,I,M)}},a=function(M,x,w,I,F,L){function Z(Mn){if(Mn!==void 0&&typeof Mn!="function")throw new TypeError("Function expected");return Mn}for(var ee=I.kind,Ee=ee==="getter"?"get":ee==="setter"?"set":"value",ue=!x&&M?I.static?M:M.prototype:null,xe=x||(ue?Object.getOwnPropertyDescriptor(ue,I.name):{}),Be,Ke=!1,it=w.length-1;it>=0;it--){var Ft={};for(var qt in I)Ft[qt]=qt==="access"?{}:I[qt];for(var qt in I.access)Ft.access[qt]=I.access[qt];Ft.addInitializer=function(Mn){if(Ke)throw new TypeError("Cannot add initializers after decoration has completed");L.push(Z(Mn||null))};var Ht=(0,w[it])(ee==="accessor"?{get:xe.get,set:xe.set}:xe[Ee],Ft);if(ee==="accessor"){if(Ht===void 0)continue;if(Ht===null||typeof Ht!="object")throw new TypeError("Object expected");(Be=Z(Ht.get))&&(xe.get=Be),(Be=Z(Ht.set))&&(xe.set=Be),(Be=Z(Ht.init))&&F.push(Be)}else(Be=Z(Ht))&&(ee==="field"?F.push(Be):xe[Ee]=Be)}ue&&Object.defineProperty(ue,I.name,xe),Ke=!0},u=function(M,x,w){for(var I=arguments.length>2,F=0;F<x.length;F++)w=I?x[F].call(M,w):x[F].call(M);return I?w:void 0},s=function(M){return typeof M=="symbol"?M:"".concat(M)},c=function(M,x,w){return typeof x=="symbol"&&(x=x.description?"[".concat(x.description,"]"):""),Object.defineProperty(M,"name",{configurable:!0,value:w?"".concat(w," ",x):x})},l=function(M,x){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(M,x)},f=function(M,x,w,I){function F(L){return L instanceof w?L:new w(function(Z){Z(L)})}return new(w||(w=Promise))(function(L,Z){function ee(xe){try{ue(I.next(xe))}catch(Be){Z(Be)}}function Ee(xe){try{ue(I.throw(xe))}catch(Be){Z(Be)}}function ue(xe){xe.done?L(xe.value):F(xe.value).then(ee,Ee)}ue((I=I.apply(M,x||[])).next())})},d=function(M,x){var w={label:0,sent:function(){if(L[0]&1)throw L[1];return L[1]},trys:[],ops:[]},I,F,L,Z;return Z={next:ee(0),throw:ee(1),return:ee(2)},typeof Symbol=="function"&&(Z[Symbol.iterator]=function(){return this}),Z;function ee(ue){return function(xe){return Ee([ue,xe])}}function Ee(ue){if(I)throw new TypeError("Generator is already executing.");for(;Z&&(Z=0,ue[0]&&(w=0)),w;)try{if(I=1,F&&(L=ue[0]&2?F.return:ue[0]?F.throw||((L=F.return)&&L.call(F),0):F.next)&&!(L=L.call(F,ue[1])).done)return L;switch(F=0,L&&(ue=[ue[0]&2,L.value]),ue[0]){case 0:case 1:L=ue;break;case 4:return w.label++,{value:ue[1],done:!1};case 5:w.label++,F=ue[1],ue=[0];continue;case 7:ue=w.ops.pop(),w.trys.pop();continue;default:if(L=w.trys,!(L=L.length>0&&L[L.length-1])&&(ue[0]===6||ue[0]===2)){w=0;continue}if(ue[0]===3&&(!L||ue[1]>L[0]&&ue[1]<L[3])){w.label=ue[1];break}if(ue[0]===6&&w.label<L[1]){w.label=L[1],L=ue;break}if(L&&w.label<L[2]){w.label=L[2],w.ops.push(ue);break}L[2]&&w.ops.pop(),w.trys.pop();continue}ue=x.call(M,w)}catch(xe){ue=[6,xe],F=0}finally{I=L=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},p=function(M,x){for(var w in M)w!=="default"&&!Object.prototype.hasOwnProperty.call(x,w)&&ie(x,M,w)},ie=Object.create?function(M,x,w,I){I===void 0&&(I=w);var F=Object.getOwnPropertyDescriptor(x,w);(!F||("get"in F?!x.__esModule:F.writable||F.configurable))&&(F={enumerable:!0,get:function(){return x[w]}}),Object.defineProperty(M,I,F)}:function(M,x,w,I){I===void 0&&(I=w),M[I]=x[w]},h=function(M){var x=typeof Symbol=="function"&&Symbol.iterator,w=x&&M[x],I=0;if(w)return w.call(M);if(M&&typeof M.length=="number")return{next:function(){return M&&I>=M.length&&(M=void 0),{value:M&&M[I++],done:!M}}};throw new TypeError(x?"Object is not iterable.":"Symbol.iterator is not defined.")},v=function(M,x){var w=typeof Symbol=="function"&&M[Symbol.iterator];if(!w)return M;var I=w.call(M),F,L=[],Z;try{for(;(x===void 0||x-- >0)&&!(F=I.next()).done;)L.push(F.value)}catch(ee){Z={error:ee}}finally{try{F&&!F.done&&(w=I.return)&&w.call(I)}finally{if(Z)throw Z.error}}return L},m=function(){for(var M=[],x=0;x<arguments.length;x++)M=M.concat(v(arguments[x]));return M},_=function(){for(var M=0,x=0,w=arguments.length;x<w;x++)M+=arguments[x].length;for(var I=Array(M),F=0,x=0;x<w;x++)for(var L=arguments[x],Z=0,ee=L.length;Z<ee;Z++,F++)I[F]=L[Z];return I},g=function(M,x,w){if(w||arguments.length===2)for(var I=0,F=x.length,L;I<F;I++)(L||!(I in x))&&(L||(L=Array.prototype.slice.call(x,0,I)),L[I]=x[I]);return M.concat(L||Array.prototype.slice.call(x))},S=function(M){return this instanceof S?(this.v=M,this):new S(M)},b=function(M,x,w){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var I=w.apply(M,x||[]),F,L=[];return F={},Z("next"),Z("throw"),Z("return"),F[Symbol.asyncIterator]=function(){return this},F;function Z(Ke){I[Ke]&&(F[Ke]=function(it){return new Promise(function(Ft,qt){L.push([Ke,it,Ft,qt])>1||ee(Ke,it)})})}function ee(Ke,it){try{Ee(I[Ke](it))}catch(Ft){Be(L[0][3],Ft)}}function Ee(Ke){Ke.value instanceof S?Promise.resolve(Ke.value.v).then(ue,xe):Be(L[0][2],Ke)}function ue(Ke){ee("next",Ke)}function xe(Ke){ee("throw",Ke)}function Be(Ke,it){Ke(it),L.shift(),L.length&&ee(L[0][0],L[0][1])}},$=function(M){var x,w;return x={},I("next"),I("throw",function(F){throw F}),I("return"),x[Symbol.iterator]=function(){return this},x;function I(F,L){x[F]=M[F]?function(Z){return(w=!w)?{value:S(M[F](Z)),done:!1}:L?L(Z):Z}:L}},T=function(M){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var x=M[Symbol.asyncIterator],w;return x?x.call(M):(M=typeof h=="function"?h(M):M[Symbol.iterator](),w={},I("next"),I("throw"),I("return"),w[Symbol.asyncIterator]=function(){return this},w);function I(L){w[L]=M[L]&&function(Z){return new Promise(function(ee,Ee){Z=M[L](Z),F(ee,Ee,Z.done,Z.value)})}}function F(L,Z,ee,Ee){Promise.resolve(Ee).then(function(ue){L({value:ue,done:ee})},Z)}},C=function(M,x){return Object.defineProperty?Object.defineProperty(M,"raw",{value:x}):M.raw=x,M};var Te=Object.create?function(M,x){Object.defineProperty(M,"default",{enumerable:!0,value:x})}:function(M,x){M.default=x};R=function(M){if(M&&M.__esModule)return M;var x={};if(M!=null)for(var w in M)w!=="default"&&Object.prototype.hasOwnProperty.call(M,w)&&ie(x,M,w);return Te(x,M),x},q=function(M){return M&&M.__esModule?M:{default:M}},G=function(M,x,w,I){if(w==="a"&&!I)throw new TypeError("Private accessor was defined without a getter");if(typeof x=="function"?M!==x||!I:!x.has(M))throw new TypeError("Cannot read private member from an object whose class did not declare it");return w==="m"?I:w==="a"?I.call(M):I?I.value:x.get(M)},A=function(M,x,w,I,F){if(I==="m")throw new TypeError("Private method is not writable");if(I==="a"&&!F)throw new TypeError("Private accessor was defined without a setter");if(typeof x=="function"?M!==x||!F:!x.has(M))throw new TypeError("Cannot write private member to an object whose class did not declare it");return I==="a"?F.call(M,w):F?F.value=w:x.set(M,w),w},Y=function(M,x){if(x===null||typeof x!="object"&&typeof x!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof M=="function"?x===M:M.has(x)},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",C),J("__importStar",R),J("__importDefault",q),J("__classPrivateFieldGet",G),J("__classPrivateFieldSet",A),J("__classPrivateFieldIn",Y)})})(y6);var rn={},Pb={},Mu={},on={},Lb={},xC;function Xe(){return xC||(xC=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,C){return function(R){return $.meet(T(R),C(R))}},join:function(T,C){return function(R){return $.join(T(R),C(R))}},zero:function(){return $.zero},one:function(){return $.one},implies:function(T,C){return function(R){return $.implies(T(R),C(R))}},not:function(T){return function(C){return $.not(T(C))}}}}};e.getBooleanAlgebra=t;var n=function($){return function(){return{concat:function(T,C){return function(R){return $.concat(T(R),C(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,C){return function(R){return $.add(T(R),C(R))}},zero:function(){return $.zero},mul:function(T,C){return function(R){return $.mul(T(R),C(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(C,R){return function(q){return $.sub(C(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,C){return $(C,T)}}e.flip=c;function l($,T,C,R,q,G,A,Y,ie){switch(arguments.length){case 1:return $;case 2:return function(){return T($.apply(this,arguments))};case 3:return function(){return C(T($.apply(this,arguments)))};case 4:return function(){return R(C(T($.apply(this,arguments))))};case 5:return function(){return q(R(C(T($.apply(this,arguments)))))};case 6:return function(){return G(q(R(C(T($.apply(this,arguments))))))};case 7:return function(){return A(G(q(R(C(T($.apply(this,arguments)))))))};case 8:return function(){return Y(A(G(q(R(C(T($.apply(this,arguments))))))))};case 9:return function(){return ie(Y(A(G(q(R(C(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=[],C=0;C<arguments.length;C++)T[C]=arguments[C];return $(T)}}e.untupled=m;function _($,T,C,R,q,G,A,Y,ie){switch(arguments.length){case 1:return $;case 2:return T($);case 3:return C(T($));case 4:return R(C(T($)));case 5:return q(R(C(T($))));case 6:return G(q(R(C(T($)))));case 7:return A(G(q(R(C(T($))))));case 8:return Y(A(G(q(R(C(T($)))))));case 9:return ie(Y(A(G(q(R(C(T($))))))));default:{for(var J=arguments[0],ge=1;ge<arguments.length;ge++)J=arguments[ge](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}(Lb)),Lb}var Le={},kC;function Bh(){if(kC)return Le;kC=1;var e=pe&&pe.__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(Le,"__esModule",{value:!0}),Le.fromReadonlyNonEmptyArray=Le.has=Le.emptyRecord=Le.emptyReadonlyArray=Le.tail=Le.head=Le.isNonEmpty=Le.singleton=Le.right=Le.left=Le.isRight=Le.isLeft=Le.some=Le.none=Le.isSome=Le.isNone=void 0;var t=function(p){return p._tag==="None"};Le.isNone=t;var n=function(p){return p._tag==="Some"};Le.isSome=n,Le.none={_tag:"None"};var r=function(p){return{_tag:"Some",value:p}};Le.some=r;var i=function(p){return p._tag==="Left"};Le.isLeft=i;var o=function(p){return p._tag==="Right"};Le.isRight=o;var a=function(p){return{_tag:"Left",left:p}};Le.left=a;var u=function(p){return{_tag:"Right",right:p}};Le.right=u;var s=function(p){return[p]};Le.singleton=s;var c=function(p){return p.length>0};Le.isNonEmpty=c;var l=function(p){return p[0]};Le.head=l;var f=function(p){return p.slice(1)};Le.tail=f,Le.emptyReadonlyArray=[],Le.emptyRecord={},Le.has=Object.prototype.hasOwnProperty;var d=function(p){return e([p[0]],p.slice(1),!0)};return Le.fromReadonlyNonEmptyArray=d,Le}var AC;function NC(){if(AC)return on;AC=1;var e=pe&&pe.__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=pe&&pe.__setModuleDefault||(Object.create?function(m,_){Object.defineProperty(m,"default",{enumerable:!0,value:_})}:function(m,_){m.default=_}),n=pe&&pe.__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(on,"__esModule",{value:!0}),on.sequenceS=on.sequenceT=on.getApplySemigroup=on.apS=on.apSecond=on.apFirst=on.ap=void 0;var r=Xe(),i=n(Bh());function o(m,_){return function(g){return function(S){return m.ap(m.map(S,function(b){return function($){return _.ap(b,$)}}),g)}}}on.ap=o;function a(m){return function(_){return function(g){return m.ap(m.map(g,function(S){return function(){return S}}),_)}}}on.apFirst=a;function u(m){return function(_){return function(g){return m.ap(m.map(g,function(){return function(S){return S}}),_)}}}on.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)}}}on.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)}}}}on.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 $}}on.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 C;return C={},C[m[0]]=g,C[m[1]]=S,C[m[2]]=b,C[m[3]]=$,C[m[4]]=T,C}}}}};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 on.sequenceS=v,on}var ti={},FC;function Db(){if(FC)return ti;FC=1,Object.defineProperty(ti,"__esModule",{value:!0}),ti.getFunctorComposition=ti.bindTo=ti.flap=ti.map=void 0;var e=Xe();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 WC;function b6(){if(WC)return Mu;WC=1,Object.defineProperty(Mu,"__esModule",{value:!0}),Mu.getApplicativeComposition=Mu.getApplicativeMonoid=void 0;var e=NC(),t=Xe(),n=Db();function r(o){var a=(0,e.getApplySemigroup)(o);return function(u){return{concat:a(u).concat,empty:o.of(u.empty)}}}Mu.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 Mu.getApplicativeComposition=i,Mu}var xu={},PC;function LC(){if(PC)return xu;PC=1,Object.defineProperty(xu,"__esModule",{value:!0}),xu.bind=xu.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})})}}}xu.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 xu.bind=t,xu}var Df={},DC;function _6(){if(DC)return Df;DC=1,Object.defineProperty(Df,"__esModule",{value:!0}),Df.tailRec=void 0;var e=function(t,n){for(var r=n(t);r._tag==="Left";)r=n(r.left);return r.right};return Df.tailRec=e,Df}var Bt={},jC;function S6(){if(jC)return Bt;jC=1;var e=pe&&pe.__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=pe&&pe.__setModuleDefault||(Object.create?function(h,v){Object.defineProperty(h,"default",{enumerable:!0,value:v})}:function(h,v){h.default=v}),n=pe&&pe.__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(Bt,"__esModule",{value:!0}),Bt.filterOrElse=Bt.chainFirstEitherK=Bt.chainEitherK=Bt.fromEitherK=Bt.chainOptionK=Bt.fromOptionK=Bt.fromPredicate=Bt.fromOption=void 0;var r=LC(),i=Xe(),o=n(Bh());function a(h){return function(v){return function(m){return h.fromEither(o.isNone(m)?o.left(v()):o.right(m.value))}}}Bt.fromOption=a;function u(h){return function(v,m){return function(_){return h.fromEither(v(_)?o.right(_):o.left(m(_)))}}}Bt.fromPredicate=u;function s(h){var v=a(h);return function(m){var _=v(m);return function(g){return(0,i.flow)(g,_)}}}Bt.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))}}}}Bt.chainOptionK=c;function l(h){return function(v){return(0,i.flow)(v,h.fromEither)}}Bt.fromEitherK=l;function f(h,v){var m=l(h);return function(_){return function(g){return v.chain(g,m(_))}}}Bt.chainEitherK=f;function d(h,v){return(0,i.flow)(l(h),(0,r.chainFirst)(v))}Bt.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 Bt.filterOrElse=p,Bt}var jb={},qC;function $6(){return qC||(qC=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=Xe(),n=Db(),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}(jb)),jb}var mo={},UC;function T6(){if(UC)return mo;UC=1;var e=pe&&pe.__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=pe&&pe.__setModuleDefault||(Object.create?function(u,s){Object.defineProperty(u,"default",{enumerable:!0,value:s})}:function(u,s){u.default=s}),n=pe&&pe.__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(mo,"__esModule",{value:!0}),mo.filterE=mo.witherDefault=mo.wiltDefault=void 0;var r=n(Bh());function i(u,s){return function(c){var l=u.traverse(c);return function(f,d){return c.map(l(f,d),s.separate)}}}mo.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)}}}mo.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 mo.filterE=a,mo}var BC;function xn(){return BC||(BC=1,function(e){var t=pe&&pe.__createBinding||(Object.create?function(W,k,D,Ae){Ae===void 0&&(Ae=D);var P=Object.getOwnPropertyDescriptor(k,D);(!P||("get"in P?!k.__esModule:P.writable||P.configurable))&&(P={enumerable:!0,get:function(){return k[D]}}),Object.defineProperty(W,Ae,P)}:function(W,k,D,Ae){Ae===void 0&&(Ae=D),W[Ae]=k[D]}),n=pe&&pe.__setModuleDefault||(Object.create?function(W,k){Object.defineProperty(W,"default",{enumerable:!0,value:k})}:function(W,k){W.default=k}),r=pe&&pe.__importStar||function(W){if(W&&W.__esModule)return W;var k={};if(W!=null)for(var D in W)D!=="default"&&Object.prototype.hasOwnProperty.call(W,D)&&t(k,W,D);return n(k,W),k};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=b6(),o=NC(),a=LC(),u=_6(),s=S6(),c=Xe(),l=Db(),f=r(Bh()),d=$6(),p=T6();e.left=f.left,e.right=f.right;var h=function(W,k){return(0,c.pipe)(W,(0,e.map)(k))},v=function(W,k){return(0,c.pipe)(W,(0,e.ap)(k))},m=function(W,k){return(0,c.pipe)(W,(0,e.chain)(k))},_=function(W,k,D){return(0,c.pipe)(W,(0,e.reduce)(k,D))},g=function(W){return function(k,D){var Ae=(0,e.foldMap)(W);return(0,c.pipe)(k,Ae(D))}},S=function(W,k,D){return(0,c.pipe)(W,(0,e.reduceRight)(k,D))},b=function(W){var k=(0,e.traverse)(W);return function(D,Ae){return(0,c.pipe)(D,k(Ae))}},$=function(W,k,D){return(0,c.pipe)(W,(0,e.bimap)(k,D))},T=function(W,k){return(0,c.pipe)(W,(0,e.mapLeft)(k))},C=function(W,k){return(0,c.pipe)(W,(0,e.alt)(k))},R=function(W,k){return(0,c.pipe)(W,(0,e.extend)(k))},q=function(W,k){return(0,u.tailRec)(k(W),function(D){return(0,e.isLeft)(D)?(0,e.right)((0,e.left)(D.left)):(0,e.isLeft)(D.right)?(0,e.left)(k(D.right.left)):(0,e.right)((0,e.right)(D.right.right))})};e.URI="Either";var G=function(W,k){return{show:function(D){return(0,e.isLeft)(D)?"left(".concat(W.show(D.left),")"):"right(".concat(k.show(D.right),")")}}};e.getShow=G;var A=function(W,k){return{equals:function(D,Ae){return D===Ae||((0,e.isLeft)(D)?(0,e.isLeft)(Ae)&&W.equals(D.left,Ae.left):(0,e.isRight)(Ae)&&k.equals(D.right,Ae.right))}}};e.getEq=A;var Y=function(W){return{concat:function(k,D){return(0,e.isLeft)(D)?k:(0,e.isLeft)(k)?D:(0,e.right)(W.concat(k.right,D.right))}}};e.getSemigroup=Y;var ie=function(W){var k=(0,e.left)(W.empty);return{URI:e.URI,_E:void 0,compact:function(D){return(0,e.isLeft)(D)?D:D.right._tag==="None"?k:(0,e.right)(D.right.value)},separate:function(D){return(0,e.isLeft)(D)?(0,d.separated)(D,D):(0,e.isLeft)(D.right)?(0,d.separated)((0,e.right)(D.right.left),k):(0,d.separated)(k,(0,e.right)(D.right.right))}}};e.getCompactable=ie;var J=function(W){var k=(0,e.left)(W.empty),D=(0,e.getCompactable)(W),Ae=D.compact,P=D.separate,oe=function(me,Ie){return(0,e.isLeft)(me)||Ie(me.right)?me:k},ve=function(me,Ie){return(0,e.isLeft)(me)?(0,d.separated)(me,me):Ie(me.right)?(0,d.separated)(k,(0,e.right)(me.right)):(0,d.separated)((0,e.right)(me.right),k)};return{URI:e.URI,_E:void 0,map:h,compact:Ae,separate:P,filter:oe,filterMap:function(me,Ie){if((0,e.isLeft)(me))return me;var st=Ie(me.right);return st._tag==="None"?k:(0,e.right)(st.value)},partition:ve,partitionMap:function(me,Ie){if((0,e.isLeft)(me))return(0,d.separated)(me,me);var st=Ie(me.right);return(0,e.isLeft)(st)?(0,d.separated)((0,e.right)(st.left),k):(0,d.separated)(k,(0,e.right)(st.right))}}};e.getFilterable=J;var ge=function(W){var k=(0,e.getFilterable)(W),D=(0,e.getCompactable)(W);return{URI:e.URI,_E:void 0,map:h,compact:k.compact,separate:k.separate,filter:k.filter,filterMap:k.filterMap,partition:k.partition,partitionMap:k.partitionMap,traverse:b,sequence:e.sequence,reduce:_,foldMap:g,reduceRight:S,wither:(0,p.witherDefault)(e.Traversable,D),wilt:(0,p.wiltDefault)(e.Traversable,D)}};e.getWitherable=ge;var Te=function(W){return{URI:e.URI,_E:void 0,map:h,ap:function(k,D){return(0,e.isLeft)(k)?(0,e.isLeft)(D)?(0,e.left)(W.concat(k.left,D.left)):k:(0,e.isLeft)(D)?D:(0,e.right)(k.right(D.right))},of:e.of}};e.getApplicativeValidation=Te;var M=function(W){return{URI:e.URI,_E:void 0,map:h,alt:function(k,D){if((0,e.isRight)(k))return k;var Ae=D();return(0,e.isLeft)(Ae)?(0,e.left)(W.concat(k.left,Ae.left)):Ae}}};e.getAltValidation=M;var x=function(W){return function(k){return(0,e.isLeft)(k)?k:(0,e.right)(W(k.right))}};e.map=x,e.Functor={URI:e.URI,map:h},e.of=e.right,e.Pointed={URI:e.URI,of:e.of};var w=function(W){return function(k){return(0,e.isLeft)(k)?k:(0,e.isLeft)(W)?W:(0,e.right)(k.right(W.right))}};e.apW=w,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 I=function(W){return function(k){return(0,e.isLeft)(k)?k:W(k.right)}};e.chainW=I,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(W,k){return function(D){return(0,e.isLeft)(D)?W:k(W,D.right)}};e.reduce=F;var L=function(W){return function(k){return function(D){return(0,e.isLeft)(D)?W.empty:k(D.right)}}};e.foldMap=L;var Z=function(W,k){return function(D){return(0,e.isLeft)(D)?W:k(D.right,W)}};e.reduceRight=Z,e.Foldable={URI:e.URI,reduce:_,foldMap:g,reduceRight:S};var ee=function(W){return function(k){return function(D){return(0,e.isLeft)(D)?W.of((0,e.left)(D.left)):W.map(k(D.right),e.right)}}};e.traverse=ee;var Ee=function(W){return function(k){return(0,e.isLeft)(k)?W.of((0,e.left)(k.left)):W.map(k.right,e.right)}};e.sequence=Ee,e.Traversable={URI:e.URI,map:h,reduce:_,foldMap:g,reduceRight:S,traverse:b,sequence:e.sequence};var ue=function(W,k){return function(D){return(0,e.isLeft)(D)?(0,e.left)(W(D.left)):(0,e.right)(k(D.right))}};e.bimap=ue;var xe=function(W){return function(k){return(0,e.isLeft)(k)?(0,e.left)(W(k.left)):k}};e.mapLeft=xe,e.Bifunctor={URI:e.URI,bimap:$,mapLeft:T};var Be=function(W){return function(k){return(0,e.isLeft)(k)?W():k}};e.altW=Be,e.alt=e.altW,e.Alt={URI:e.URI,map:h,alt:C};var Ke=function(W){return function(k){return(0,e.isLeft)(k)?k:(0,e.right)(W(k))}};e.extend=Ke,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(W,k){return function(D){return(0,e.isLeft)(D)?W(D.left):k(D.right)}};e.matchW=it,e.foldW=e.matchW,e.match=e.matchW,e.fold=e.match;var Ft=function(W){return function(k){return(0,e.isLeft)(k)?W(k.left):k.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(W){return(0,e.isLeft)(W)?(0,e.right)(W.left):(0,e.left)(W.right)};e.swap=qt;var Ht=function(W){return function(k){return(0,e.isLeft)(k)?W(k.left):k}};e.orElseW=Ht,e.orElse=e.orElseW;var Mn=function(W){return function(k){return k==null?(0,e.left)(W):(0,e.right)(k)}};e.fromNullable=Mn;var kr=function(W,k){try{return(0,e.right)(W())}catch(D){return(0,e.left)(k(D))}};e.tryCatch=kr;var lr=function(W,k){return function(){for(var D=[],Ae=0;Ae<arguments.length;Ae++)D[Ae]=arguments[Ae];return(0,e.tryCatch)(function(){return W.apply(void 0,D)},k)}};e.tryCatchK=lr;var X=function(W){var k=(0,e.fromNullable)(W);return function(D){return(0,c.flow)(D,k)}};e.fromNullableK=X;var ne=function(W){var k=(0,e.fromNullableK)(W);return function(D){return(0,e.chain)(k(D))}};e.chainNullableK=ne,e.toUnion=(0,e.foldW)(c.identity,c.identity);function Ce(W){return W instanceof Error?W:new Error(String(W))}e.toError=Ce;function Ot(W){return function(k,D){if(D===void 0){var Ae=Ot(W);return function(P){return Ae(k,P)}}return(0,e.isLeft)(D)?!1:W.equals(k,D.right)}}e.elem=Ot;var Xr=function(W){return function(k){return(0,e.isLeft)(k)?!1:W(k.right)}};e.exists=Xr,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 Fi=function(W){return function(k){var D=W(0,f.head(k));if((0,e.isLeft)(D))return D;for(var Ae=[D.right],P=1;P<k.length;P++){var oe=W(P,k[P]);if((0,e.isLeft)(oe))return oe;Ae.push(oe.right)}return(0,e.right)(Ae)}};e.traverseReadonlyNonEmptyArrayWithIndex=Fi;var Wi=function(W){var k=(0,e.traverseReadonlyNonEmptyArrayWithIndex)(W);return function(D){return f.isNonEmpty(D)?k(D):e.ApT}};e.traverseReadonlyArrayWithIndex=Wi,e.traverseArrayWithIndex=e.traverseReadonlyArrayWithIndex;var ba=function(W){return(0,e.traverseReadonlyArrayWithIndex)(function(k,D){return W(D)})};e.traverseArray=ba,e.sequenceArray=(0,e.traverseArray)(c.identity);function _a(W,k){return(0,e.tryCatch)(function(){return JSON.parse(W)},k)}e.parseJSON=_a;var Sa=function(W,k){return(0,e.tryCatch)(function(){var D=JSON.stringify(W);if(typeof D!="string")throw new Error("Converting unsupported structure to JSON");return D},k)};e.stringifyJSON=Sa,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:C,extend:R,chainRec:q,throwError:e.throwError},e.getApplySemigroup=(0,o.getApplySemigroup)(e.Apply),e.getApplyMonoid=(0,i.getApplicativeMonoid)(e.Applicative);var Qr=function(W,k){return(0,o.getApplySemigroup)((0,e.getApplicativeValidation)(W))(k)};e.getValidationSemigroup=Qr;var Cu=function(W,k){return(0,i.getApplicativeMonoid)((0,e.getApplicativeValidation)(W))(k)};e.getValidationMonoid=Cu;function xf(W){var k=(0,e.getApplicativeValidation)(W).ap,D=(0,e.getAltValidation)(W).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:k,alt:D}}e.getValidation=xf}(Pb)),Pb}var zC=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))}}}}},qb=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},KC=function(e){var t=qb(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}},Ub=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}}},VC=function(e){var t=Ub(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))}}}},I6=function(e){return function(t){return t(e)}};function j(e){return e}var gc=j;function Vn(e){return function(){return e}}var Bb=Vn(!0),HC=Vn(!1),GC=Vn(null),zb=Vn(void 0),O6=zb;function w6(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 JC(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e}function R6(e){return e+1}function E6(e){return e-1}function YC(e){throw new Error("Called `absurd` function which should be uncallable")}function C6(e){return function(t){return e.apply(void 0,t)}}function M6(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 x6=YC,Hn=function(e,t){return t};function k6(e){return function(t){return!e(t)}}var A6=function(){return{concat:function(e,t){return V(e,t)},empty:j}};const ZC=Object.freeze(Object.defineProperty({__proto__:null,SK:Hn,absurd:YC,apply:I6,constFalse:HC,constNull:GC,constTrue:Bb,constUndefined:zb,constVoid:O6,constant:Vn,decrement:E6,flip:w6,flow:V,getBooleanAlgebra:zC,getEndomorphismMonoid:A6,getMonoid:KC,getRing:VC,getSemigroup:qb,getSemiring:Ub,hole:x6,identity:j,increment:R6,not:k6,pipe:y,tuple:JC,tupled:C6,unsafeCoerce:gc,untupled:M6},Symbol.toStringTag,{value:"Module"}));var N6=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))},Pt=function(e){return e._tag==="None"},yt=function(e){return e._tag==="Some"},ye={_tag:"None"},de=function(e){return{_tag:"Some",value:e}},Gt=function(e){return e._tag==="Left"},Kb=function(e){return e._tag==="Right"},vo=function(e){return{_tag:"Left",left:e}},Ia=function(e){return{_tag:"Right",right:e}},jf=function(e){return[e]},vt=function(e){return e.length>0},fr=function(e){return e[0]},yc=function(e){return e.slice(1)},an=[],Jt={},ct=Object.prototype.hasOwnProperty,zh=function(e){return N6([e[0]],e.slice(1),!0)};function go(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 wt(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}function Rt(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}function Et(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 Yt(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 Vb(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):Vb(e,t-1,i)}}var Hb={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 F6(e){return ct.call(Hb,e)||(Hb[e]=Vb(JC,e-1,[])),Hb[e]}function W6(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=F6(r),o=e.map(t[0],i),a=1;a<r;a++)o=e.ap(o,t[a]);return o}}function P6(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 Vb(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 L6(e){return function(t){for(var n=Object.keys(t),r=n.length,i=P6(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}const D6=Object.freeze(Object.defineProperty({__proto__:null,ap:go,apFirst:wt,apS:Et,apSecond:Rt,getApplySemigroup:Yt,sequenceS:L6,sequenceT:W6},Symbol.toStringTag,{value:"Module"}));function bc(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function ze(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}function Ct(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}function _c(e,t){var n=bc(e,t);return{map:function(r,i){return y(r,n(i))}}}const j6=Object.freeze(Object.defineProperty({__proto__:null,bindTo:Ct,flap:ze,getFunctorComposition:_c,map:bc},Symbol.toStringTag,{value:"Module"}));function Nr(e){var t=Yt(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function XC(e,t){var n=_c(e,t).map,r=go(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,o){return y(i,r(o))}}}const q6=Object.freeze(Object.defineProperty({__proto__:null,getApplicativeComposition:XC,getApplicativeMonoid:Nr},Symbol.toStringTag,{value:"Module"}));function lt(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 U6=Object.freeze(Object.defineProperty({__proto__:null,bind:Mt,chainFirst:lt},Symbol.toStringTag,{value:"Module"}));var Gb=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};const B6=Object.freeze(Object.defineProperty({__proto__:null,tailRec:Gb},Symbol.toStringTag,{value:"Module"}));function Li(e){return function(t){return function(n){return e.fromEither(Pt(n)?vo(t()):Ia(n.value))}}}function Oa(e){return function(t,n){return function(r){return e.fromEither(t(r)?Ia(r):vo(n(r)))}}}function Di(e){var t=Li(e);return function(n){var r=t(n);return function(i){return V(i,r)}}}function ku(e,t){var n=Di(e);return function(r){var i=n(r);return function(o){return function(a){return t.chain(a,i(o))}}}}function dr(e){return function(t){return V(t,e.fromEither)}}function yo(e,t){var n=dr(e);return function(r){return function(i){return t.chain(i,n(r))}}}function bo(e,t){return V(dr(e),lt(t))}function Au(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Ia(o):vo(r(o)))})}}}const z6=Object.freeze(Object.defineProperty({__proto__:null,chainEitherK:yo,chainFirstEitherK:bo,chainOptionK:ku,filterOrElse:Au,fromEitherK:dr,fromOption:Li,fromOptionK:Di,fromPredicate:Oa},Symbol.toStringTag,{value:"Module"}));var Re=function(e,t){return{left:e,right:t}},K6=function(e,t){return y(e,Jb(t))},V6=function(e,t){return y(e,QC(t))},H6=function(e,t,n){return y(e,eM(t,n))},Jb=function(e){return function(t){return Re(qf(t),e(Uf(t)))}},QC=function(e){return function(t){return Re(e(qf(t)),Uf(t))}},eM=function(e,t){return function(n){return Re(e(qf(n)),t(Uf(n)))}},Yb="Separated",G6={URI:Yb,mapLeft:V6,bimap:H6},tM={URI:Yb,map:K6},J6=ze(tM),qf=function(e){return e.left},Uf=function(e){return e.right};const Y6=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:G6,Functor:tM,URI:Yb,bimap:eM,flap:J6,left:qf,map:Jb,mapLeft:QC,right:Uf,separated:Re},Symbol.toStringTag,{value:"Module"}));function ni(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.separate)}}}function ri(e,t){return function(n){var r=e.traverse(n);return function(i,o){return n.map(r(i,o),t.compact)}}}function Zb(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?de(o):ye})})}}}}const Z6=Object.freeze(Object.defineProperty({__proto__:null,filterE:Zb,wiltDefault:ni,witherDefault:ri},Symbol.toStringTag,{value:"Module"}));var $t=vo,Ge=Ia,$n=function(e,t){return y(e,Wu(t))},Nu=function(e,t){return y(e,oM(t))},Sc=function(e,t){return y(e,Fr(t))},Bf=function(e,t,n){return y(e,uM(t,n))},zf=function(e){return function(t,n){var r=sM(e);return y(t,r(n))}},Kf=function(e,t,n){return y(e,cM(t,n))},Kh=function(e){var t=lM(e);return function(n,r){return y(n,t(r))}},Xb=function(e,t,n){return y(e,i_(t,n))},Qb=function(e,t){return y(e,Jf(t))},nM=function(e,t){return y(e,dM(t))},e_=function(e,t){return y(e,o_(t))},t_=function(e,t){return Gb(t(e),function(n){return se(n)?Ge($t(n.left)):se(n.right)?$t(t(n.right.left)):Ge(Ge(n.right.right))})},Tt="Either",X6=function(e,t){return{show:function(n){return se(n)?"left(".concat(e.show(n.left),")"):"right(".concat(t.show(n.right),")")}}},Q6=function(e,t){return{equals:function(n,r){return n===r||(se(n)?se(r)&&e.equals(n.left,r.left):a_(r)&&t.equals(n.right,r.right))}}},Vf=function(e){return{concat:function(t,n){return se(n)?t:se(t)?n:Ge(e.concat(t.right,n.right))}}},Fu=function(e){var t=$t(e.empty);return{URI:Tt,_E:void 0,compact:function(n){return se(n)?n:n.right._tag==="None"?t:Ge(n.right.value)},separate:function(n){return se(n)?Re(n,n):se(n.right)?Re(Ge(n.right.left),t):Re(t,Ge(n.right.right))}}},$c=function(e){var t=$t(e.empty),n=Fu(e),r=n.compact,i=n.separate,o=function(u,s){return se(u)||s(u.right)?u:t},a=function(u,s){return se(u)?Re(u,u):s(u.right)?Re(t,Ge(u.right)):Re(Ge(u.right),t)};return{URI:Tt,_E:void 0,map:$n,compact:r,separate:i,filter:o,filterMap:function(u,s){if(se(u))return u;var c=s(u.right);return c._tag==="None"?t:Ge(c.value)},partition:a,partitionMap:function(u,s){if(se(u))return Re(u,u);var c=s(u.right);return se(c)?Re(Ge(c.left),t):Re(t,Ge(c.right))}}},eG=function(e){var t=$c(e),n=Fu(e);return{URI:Tt,_E:void 0,map:$n,compact:t.compact,separate:t.separate,filter:t.filter,filterMap:t.filterMap,partition:t.partition,partitionMap:t.partitionMap,traverse:Kh,sequence:Gf,reduce:Bf,foldMap:zf,reduceRight:Kf,wither:ri(r_,n),wilt:ni(r_,n)}},wa=function(e){return{URI:Tt,_E:void 0,map:$n,ap:function(t,n){return se(t)?se(n)?$t(e.concat(t.left,n.left)):t:se(n)?n:Ge(t.right(n.right))},of:ji}},rM=function(e){return{URI:Tt,_E:void 0,map:$n,alt:function(t,n){if(a_(t))return t;var r=n();return se(r)?$t(e.concat(t.left,r.left)):r}}},Wu=function(e){return function(t){return se(t)?t:Ge(e(t.right))}},Ra={URI:Tt,map:$n},ji=Ge,tG={URI:Tt,of:ji},iM=function(e){return function(t){return se(t)?t:se(e)?e:Ge(t.right(e.right))}},oM=iM,Tc={URI:Tt,map:$n,ap:Nu},aM={URI:Tt,map:$n,ap:Nu,of:ji},n_=function(e){return function(t){return se(t)?t:e(t.right)}},Fr=n_,Hf={URI:Tt,map:$n,ap:Nu,chain:Sc},nG={URI:Tt,map:$n,ap:Nu,of:ji,chain:Sc},uM=function(e,t){return function(n){return se(n)?e:t(e,n.right)}},sM=function(e){return function(t){return function(n){return se(n)?e.empty:t(n.right)}}},cM=function(e,t){return function(n){return se(n)?e:t(n.right,e)}},rG={URI:Tt,reduce:Bf,foldMap:zf,reduceRight:Kf},lM=function(e){return function(t){return function(n){return se(n)?e.of($t(n.left)):e.map(t(n.right),Ge)}}},Gf=function(e){return function(t){return se(t)?e.of($t(t.left)):e.map(t.right,Ge)}},r_={URI:Tt,map:$n,reduce:Bf,foldMap:zf,reduceRight:Kf,traverse:Kh,sequence:Gf},i_=function(e,t){return function(n){return se(n)?$t(e(n.left)):Ge(t(n.right))}},Jf=function(e){return function(t){return se(t)?$t(e(t.left)):t}},iG={URI:Tt,bimap:Xb,mapLeft:Qb},fM=function(e){return function(t){return se(t)?e():t}},dM=fM,oG={URI:Tt,map:$n,alt:nM},o_=function(e){return function(t){return se(t)?t:Ge(e(t))}},aG={URI:Tt,map:$n,extend:e_},uG={URI:Tt,map:$n,ap:Nu,chain:Sc,chainRec:t_},Vh=$t,sG={URI:Tt,map:$n,ap:Nu,of:ji,chain:Sc,throwError:Vh},Ic={URI:Tt,fromEither:j},cG=Oa(Ic),pM=Li(Ic),se=Gt,a_=Kb,u_=function(e,t){return function(n){return se(n)?e(n.left):t(n.right)}},hM=u_,Ea=u_,s_=Ea,c_=function(e){return function(t){return se(t)?e(t.left):t.right}},lG=c_,fG=ze(Ra),mM=wt(Tc),dG=mM,vM=Rt(Tc),pG=vM,gM=lt(Hf),hG=gM,yM=n_(j),mG=yM,vG=o_(j),gG=Di(Ic),yG=ku(Ic,Hf),bM=Au(Ic,Hf),bG=bM,_M=function(e){return se(e)?Ge(e.left):$t(e.right)},SM=function(e){return function(t){return se(t)?e(t.left):t}},$M=SM,l_=function(e){return function(t){return t==null?$t(e):Ge(t)}},Pu=function(e,t){try{return Ge(e())}catch(n){return $t(t(n))}},_G=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Pu(function(){return e.apply(void 0,n)},t)}},TM=function(e){var t=l_(e);return function(n){return V(n,t)}},SG=function(e){var t=TM(e);return function(n){return Fr(t(n))}},IM=hM(j,j);function $G(e){return e instanceof Error?e:new Error(String(e))}function OM(e){return function(t,n){if(n===void 0){var r=OM(e);return function(i){return r(t,i)}}return se(n)?!1:e.equals(t,n.right)}}var TG=function(e){return function(t){return se(t)?!1:e(t.right)}},IG=ji(Jt),OG=Ct(Ra),wM=Mt(Hf),wG=wM,RM=Et(Tc),RG=RM,EM=ji(an),Yf=function(e){return function(t){var n=e(0,fr(t));if(se(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var o=e(i,t[i]);if(se(o))return o;r.push(o.right)}return Ge(r)}},f_=function(e){var t=Yf(e);return function(n){return vt(n)?t(n):EM}},EG=f_,CM=function(e){return f_(function(t,n){return e(n)})},CG=CM(j);function MG(e,t){return Pu(function(){return JSON.parse(e)},t)}var xG=function(e,t){return Pu(function(){var n=JSON.stringify(e);if(typeof n!="string")throw new Error("Converting unsupported structure to JSON");return n},t)},kG={URI:Tt,map:$n,of:ji,ap:Nu,chain:Sc,reduce:Bf,foldMap:zf,reduceRight:Kf,traverse:Kh,sequence:Gf,bimap:Xb,mapLeft:Qb,alt:nM,extend:e_,chainRec:t_,throwError:Vh},AG=Yt(Tc),NG=Nr(aM),FG=function(e,t){return Yt(wa(e))(t)},WG=function(e,t){return Nr(wa(e))(t)};function PG(e){var t=wa(e).ap,n=rM(e).alt;return{URI:Tt,_E:void 0,map:$n,of:ji,chain:Sc,bimap:Xb,mapLeft:Qb,reduce:Bf,foldMap:zf,reduceRight:Kf,extend:e_,traverse:Kh,sequence:Gf,chainRec:t_,throwError:Vh,ap:t,alt:n}}const MM=Object.freeze(Object.defineProperty({__proto__:null,Alt:oG,ApT:EM,Applicative:aM,Apply:Tc,Bifunctor:iG,Chain:Hf,ChainRec:uG,Do:IG,Extend:aG,Foldable:rG,FromEither:Ic,Functor:Ra,Monad:nG,MonadThrow:sG,Pointed:tG,Traversable:r_,URI:Tt,alt:dM,altW:fM,ap:oM,apFirst:mM,apFirstW:dG,apS:RM,apSW:RG,apSecond:vM,apSecondW:pG,apW:iM,bimap:i_,bind:wM,bindTo:OG,bindW:wG,chain:Fr,chainFirst:gM,chainFirstW:hG,chainNullableK:SG,chainOptionK:yG,chainW:n_,duplicate:vG,either:kG,elem:OM,exists:TG,extend:o_,filterOrElse:bM,filterOrElseW:bG,flap:fG,flatten:mG,flattenW:yM,fold:s_,foldMap:sM,foldW:hM,fromNullable:l_,fromNullableK:TM,fromOption:pM,fromOptionK:gG,fromPredicate:cG,getAltValidation:rM,getApplicativeValidation:wa,getApplyMonoid:NG,getApplySemigroup:AG,getCompactable:Fu,getEq:Q6,getFilterable:$c,getOrElse:lG,getOrElseW:c_,getSemigroup:Vf,getShow:X6,getValidation:PG,getValidationMonoid:WG,getValidationSemigroup:FG,getWitherable:eG,isLeft:se,isRight:a_,left:$t,map:Wu,mapLeft:Jf,match:Ea,matchW:u_,of:ji,orElse:$M,orElseW:SM,parseJSON:MG,reduce:uM,reduceRight:cM,right:Ge,sequence:Gf,sequenceArray:CG,stringifyJSON:xG,swap:_M,throwError:Vh,toError:$G,toUnion:IM,traverse:lM,traverseArray:CM,traverseArrayWithIndex:EG,traverseReadonlyArrayWithIndex:f_,traverseReadonlyNonEmptyArrayWithIndex:Yf,tryCatch:Pu,tryCatchK:_G},Symbol.toStringTag,{value:"Module"}));var Qe=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)}}(),Oc=globalThis&&globalThis.__assign||function(){return Oc=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},Oc.apply(this,arguments)},LG=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))},qi=$t,tt=function(e,t,n){return qi([{value:e,context:t,message:n}])},we=Ge,Se=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 se(a)?a:t.validate(a.right,o)},this.encode===De&&t.encode===De?De: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}(),De=function(e){return e};function xM(e){return e.displayName||e.name||"<function".concat(e.length,">")}function DG(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 _o(e,t){for(var n=t.length,r=0;r<n;r++)e.push(t[r])}var Lu=Object.prototype.hasOwnProperty;function d_(e){return Object.keys(e).map(function(t){return"".concat(t,": ").concat(e[t].name)}).join(", ")}function Zf(e){for(var t=0;t<e.length;t++)if(e[t].encode!==De)return!1;return!0}function kM(e){return"{ ".concat(d_(e)," }")}function AM(e){return"Partial<".concat(e,">")}function jG(e,t,n,r){r===void 0&&(r="{ [K in ".concat(t.name,"]: ").concat(n.name," }"));var i=e.length;return new S_(r,function(o){return kn.is(o)&&e.every(function(a){return n.is(o[a])})},function(o,a){var u=kn.validate(o,a);if(se(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(se(v))_o(l,v.left);else{var m=v.right;f=f||m!==h,c[p]=m}}return l.length>0?qi(l):we(f||Object.keys(s).length!==i?c:s)},n.encode===De?De: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 p_(e){var t;if(LM(e)){var n=e.value;if(oi.is(n))return t={},t[n]=null,t}else{if(VG(e))return e.keys;if(jM(e)){var r=e.types.map(function(i){return p_(i)});return r.some(Hh.is)?void 0:Object.assign.apply(Object,LG([{}],r,!1))}}}function qG(e,t,n){return n===void 0&&(n="{ [K in ".concat(e.name,"]: ").concat(t.name," }")),new S_(n,function(r){return kn.is(r)?Object.keys(r).every(function(i){return e.is(i)&&t.is(r[i])}):PM(t)&&Array.isArray(r)},function(r,i){if(kn.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(se(p))_o(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(se(v))_o(a,v.left);else{var m=v.right;c=c||m!==d,o[f]=m}}}return a.length>0?qi(a):we(c?o:r)}return PM(t)&&Array.isArray(r)?we(r):tt(r,i)},e.encode===De&&t.encode===De?De: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 NM(e){return"("+e.map(function(t){return t.name}).join(" | ")+")"}function h_(e,t){for(var n=!0,r=!0,i=!kn.is(e),o=0,a=t;o<a.length;o++){var u=a[o];u!==e&&(n=!1),kn.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)(!Lu.call(s,f)||i||u[f]!==e[f])&&(s[f]=u[f])}return s}function m_(e){switch(e._tag){case"RefinementType":case"ReadonlyType":return m_(e.type);case"InterfaceType":case"StrictType":case"PartialType":return e.props;case"IntersectionType":return e.types.reduce(function(t,n){return Object.assign(t,m_(n))},{})}}function FM(e,t){for(var n=Object.getOwnPropertyNames(e),r=!1,i={},o=0;o<n.length;o++){var a=n[o];Lu.call(t,a)?i[a]=e[a]:r=!0}return r?i:e}function UG(e){return DM(e)?"{| ".concat(d_(e.props)," |}"):HG(e)?AM("{| ".concat(d_(e.props)," |}")):"Exact<".concat(e.name,">")}function BG(e){return e.length>0}var Gn={};function WM(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 zG(e,t){if(e===Gn)return t;if(t===Gn)return e;var n=Object.assign({},e);for(var r in t)if(Lu.call(e,r)){var i=WM(e[r],t[r]);if(BG(i))n[r]=i;else{n=Gn;break}}else n[r]=t[r];return n}function KG(e,t){if(e===Gn||t===Gn)return Gn;var n=Gn;for(var r in e)if(Lu.call(t,r)){var i=WM(e[r],t[r]);i.length===0&&(n===Gn&&(n={}),n[r]=e[r].concat(t[r]))}return n}function PM(e){return e._tag==="AnyType"}function LM(e){return e._tag==="LiteralType"}function VG(e){return e._tag==="KeyofType"}function DM(e){return e._tag==="InterfaceType"}function HG(e){return e._tag==="PartialType"}function GG(e){return e._tag==="StrictType"}function JG(e){return e._tag==="ExactType"}function YG(e){return e._tag==="RefinementType"}function ZG(e){return e._tag==="IntersectionType"}function jM(e){return e._tag==="UnionType"}function XG(e){return e._tag==="RecursiveType"}var v_=[];function Ca(e){if(v_.indexOf(e)!==-1)return Gn;if(DM(e)||GG(e)){var t=Gn;for(var n in e.props){var r=e.props[n];LM(r)&&(t===Gn&&(t={}),t[n]=[r.value])}return t}else{if(JG(e)||YG(e))return Ca(e.type);if(ZG(e))return e.types.reduce(function(o,a){return zG(o,Ca(a))},Gn);if(jM(e))return e.types.slice(1).reduce(function(o,a){return KG(o,Ca(a))},Ca(e.types[0]));if(XG(e)){v_.push(e);var i=Ca(e.type);return v_.pop(),i}}return Gn}function qM(e){var t=Ca(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=Ca(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 UM=function(e){Qe(t,e);function t(){var n=e.call(this,"null",function(r){return r===null},function(r,i){return n.is(r)?we(r):tt(r,i)},De)||this;return n._tag="NullType",n}return t}(Se),g_=new UM,BM=function(e){Qe(t,e);function t(){var n=e.call(this,"undefined",function(r){return r===void 0},function(r,i){return n.is(r)?we(r):tt(r,i)},De)||this;return n._tag="UndefinedType",n}return t}(Se),Hh=new BM,zM=function(e){Qe(t,e);function t(){var n=e.call(this,"void",Hh.is,Hh.validate,De)||this;return n._tag="VoidType",n}return t}(Se),KM=new zM,VM=function(e){Qe(t,e);function t(){var n=e.call(this,"unknown",function(r){return!0},we,De)||this;return n._tag="UnknownType",n}return t}(Se),QG=new VM,HM=function(e){Qe(t,e);function t(){var n=e.call(this,"string",function(r){return typeof r=="string"},function(r,i){return n.is(r)?we(r):tt(r,i)},De)||this;return n._tag="StringType",n}return t}(Se),oi=new HM,GM=function(e){Qe(t,e);function t(){var n=e.call(this,"number",function(r){return typeof r=="number"},function(r,i){return n.is(r)?we(r):tt(r,i)},De)||this;return n._tag="NumberType",n}return t}(Se),Du=new GM,JM=function(e){Qe(t,e);function t(){var n=e.call(this,"bigint",function(r){return typeof r=="bigint"},function(r,i){return n.is(r)?we(r):tt(r,i)},De)||this;return n._tag="BigIntType",n}return t}(Se),eJ=new JM,YM=function(e){Qe(t,e);function t(){var n=e.call(this,"boolean",function(r){return typeof r=="boolean"},function(r,i){return n.is(r)?we(r):tt(r,i)},De)||this;return n._tag="BooleanType",n}return t}(Se),Gh=new YM,ZM=function(e){Qe(t,e);function t(){var n=e.call(this,"UnknownArray",Array.isArray,function(r,i){return n.is(r)?we(r):tt(r,i)},De)||this;return n._tag="AnyArrayType",n}return t}(Se),wc=new ZM,XM=function(e){Qe(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)?we(r):tt(r,i)},De)||this;return n._tag="AnyDictionaryType",n}return t}(Se),kn=new XM,QM=function(e){Qe(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}(Se);function Xf(e,t){t===void 0&&(t=JSON.stringify(e));var n=function(r){return r===e};return new QM(t,n,function(r,i){return n(r)?we(e):tt(r,i)},De,e)}var ex=function(e){Qe(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}(Se);function tJ(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)&&Lu.call(e,r)};return new ex(t,n,function(r,i){return n(r)?we(r):tt(r,i)},De,e)}var tx=function(e){Qe(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}(Se);function Jh(e,t,n){return I_(e,t,n)}var Yh=Jh(Du,function(e){return Number.isInteger(e)},"Int"),y_=function(e){Qe(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}(Se);Object.defineProperty(y_.prototype,"type",{get:function(){return this.runDefinition()},enumerable:!0,configurable:!0});function b_(e,t){var n,r=function(){return n||(n=t(i),n.name=e),n},i=new y_(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 nx=function(e){Qe(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}(Se);function Zh(e,t){return t===void 0&&(t="Array<".concat(e.name,">")),new nx(t,function(n){return wc.is(n)&&n.every(e.is)},function(n,r){var i=wc.validate(n,r);if(se(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(se(f))_o(s,f.left);else{var d=f.right;d!==l&&(u===o&&(u=o.slice()),u[c]=d)}}return s.length>0?qi(s):we(u)},e.encode===De?De:function(n){return n.map(e.encode)},e)}var rx=function(e){Qe(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}(Se);function __(e,t){t===void 0&&(t=kM(e));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new rx(t,function(o){if(kn.is(o)){for(var a=0;a<i;a++){var u=n[a],s=o[u];if(s===void 0&&!Lu.call(o,u)||!r[a].is(s))return!1}return!0}return!1},function(o,a){var u=kn.validate(o,a);if(se(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(se(v))_o(l,v.left);else{var m=v.right;(m!==p||m===void 0&&!Lu.call(c,d))&&(c===s&&(c=Oc({},s)),c[d]=m)}}return l.length>0?qi(l):we(c)},Zf(r)?De:function(o){for(var a=Oc({},o),u=0;u<i;u++){var s=n[u],c=r[u].encode;c!==De&&(a[s]=c(o[s]))}return a},e)}var ix=function(e){Qe(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}(Se);function nJ(e,t){t===void 0&&(t=AM(kM(e)));var n=Object.keys(e),r=n.map(function(o){return e[o]}),i=n.length;return new ix(t,function(o){if(kn.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=kn.validate(o,a);if(se(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(se(v))p!==void 0&&_o(l,v.left);else{var m=v.right;m!==p&&(c===s&&(c=Oc({},s)),c[d]=m)}}return l.length>0?qi(l):we(c)},Zf(r)?De:function(o){for(var a=Oc({},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 S_=function(e){Qe(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}(Se);function $_(e,t,n){var r=p_(e);return r?jG(Object.keys(r),e,t,n):qG(e,t,n)}var T_=function(e){Qe(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}(Se);function Qf(e,t){t===void 0&&(t=NM(e));var n=qM(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 Xh(t,function(u){if(kn.is(u)){var s=a(u[r]);return s!==void 0?e[s].is(u):!1}return!1},function(u,s){var c=kn.validate(u,s);if(se(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))},Zf(e)?De: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 T_(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(se(d))_o(c,d.left);else return we(d.right)}return qi(c)},Zf(e)?De: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 ox=function(e){Qe(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}(Se);function rJ(e,t){t===void 0&&(t="(".concat(e.map(function(r){return r.name}).join(" & "),")"));var n=e.length;return new ox(t,function(r){return e.every(function(i){return i.is(r)})},e.length===0?we: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));se(c)?_o(a,c.left):o.push(c.right)}return a.length>0?qi(a):we(h_(r,o))},e.length===0?De:function(r){return h_(r,e.map(function(i){return i.encode(r)}))},e)}var ax=function(e){Qe(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}(Se);function iJ(e,t){t===void 0&&(t="[".concat(e.map(function(r){return r.name}).join(", "),"]"));var n=e.length;return new ax(t,function(r){return wc.is(r)&&r.length===n&&e.every(function(i,o){return i.is(r[o])})},function(r,i){var o=wc.validate(r,i);if(se(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(se(d))_o(s,d.left);else{var p=d.right;p!==l&&(u===a&&(u=a.slice()),u[c]=p)}}return s.length>0?qi(s):we(u)},Zf(e)?De:function(r){return e.map(function(i,o){return i.encode(r[o])})},e)}var ux=function(e){Qe(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}(Se);function oJ(e,t){return t===void 0&&(t="Readonly<".concat(e.name,">")),new ux(t,e.is,e.validate,e.encode,e)}var sx=function(e){Qe(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}(Se);function cx(e,t){t===void 0&&(t="ReadonlyArray<".concat(e.name,">"));var n=Zh(e);return new sx(t,n.is,n.validate,n.encode,e)}var ed=function(e,t){return fx(__(e),t)},lx=function(e){Qe(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}(Se);function fx(e,t){t===void 0&&(t=UG(e));var n=m_(e);return new lx(t,e.is,function(r,i){var o=kn.validate(r,i);if(se(o))return o;var a=e.validate(r,i);return se(a)?a:Ge(FM(a.right,n))},function(r){return e.encode(FM(r,n))},e)}var dx=function(e){Qe(t,e);function t(){var n=e.call(this,"Function",function(r){return typeof r=="function"},function(r,i){return n.is(r)?we(r):tt(r,i)},De)||this;return n._tag="FunctionType",n}return t}(Se),aJ=new dx,Xh=function(e){Qe(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}(T_),uJ=function(e,t,n){n===void 0&&(n=NM(t));var r=Qf(t,n);return r instanceof Xh?r:(console.warn("[io-ts] Cannot build a tagged union for ".concat(n,", returning a de-optimized union")),new Xh(n,r.is,r.validate,r.encode,t,e))},sJ=function(e,t){return{value:e,context:t}},px=function(e){return[{key:"",type:e}]},hx=function(e){Qe(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}(Se),cJ=new hx,mx=function(e){Qe(t,e);function t(){var n=e.call(this,"any",function(r){return!0},we,De)||this;return n._tag="AnyType",n}return t}(Se),lJ=new mx,fJ=kn,vx=function(e){Qe(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)?we(r):tt(r,i)},De)||this;return n._tag="ObjectType",n}return t}(Se),dJ=new vx;function I_(e,t,n){return n===void 0&&(n="(".concat(e.name," | ").concat(xM(t),")")),new tx(n,function(r){return e.is(r)&&t(r)},function(r,i){var o=e.validate(r,i);if(se(o))return o;var a=o.right;return t(a)?we(a):tt(a,i)},e.encode,e,t)}var pJ=I_(Du,Number.isInteger,"Integer"),hJ=$_,mJ=function(e){Qe(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}(Se);function vJ(e){return e}function gJ(e){return function(){return e}}const Q=vc(Object.freeze(Object.defineProperty({__proto__:null,AnyArrayType:ZM,AnyDictionaryType:XM,AnyType:mx,Array:wc,ArrayType:nx,BigIntType:JM,BooleanType:YM,Dictionary:fJ,DictionaryType:S_,ExactType:lx,Function:aJ,FunctionType:dx,Int:Yh,Integer:pJ,InterfaceType:rx,IntersectionType:ox,KeyofType:ex,LiteralType:QM,NeverType:hx,NullType:UM,NumberType:GM,ObjectType:vx,PartialType:ix,ReadonlyArrayType:sx,ReadonlyType:ux,RecursiveType:y_,RefinementType:tx,StrictType:mJ,StringType:HM,TaggedUnionType:Xh,TupleType:ax,Type:Se,UndefinedType:BM,UnionType:T_,UnknownArray:wc,UnknownRecord:kn,UnknownType:VM,VoidType:zM,alias:gJ,any:lJ,appendContext:ii,array:Zh,bigint:eJ,boolean:Gh,brand:Jh,clean:vJ,dictionary:hJ,emptyTags:Gn,exact:fx,failure:tt,failures:qi,getContextEntry:DG,getDefaultContext:px,getDomainKeys:p_,getFunctionName:xM,getIndex:qM,getTags:Ca,getValidationError:sJ,identity:De,interface:__,intersection:rJ,keyof:tJ,literal:Xf,mergeAll:h_,never:cJ,null:g_,nullType:g_,number:Du,object:dJ,partial:nJ,readonly:oJ,readonlyArray:cx,record:$_,recursion:b_,refinement:I_,strict:ed,string:oi,success:we,taggedUnion:uJ,tuple:iJ,type:__,undefined:Hh,union:Qf,unknown:QG,void:KM,voidType:KM},Symbol.toStringTag,{value:"Module"})));var td={},nd={},rd={},gx;function yJ(){if(gx)return rd;gx=1,Object.defineProperty(rd,"__esModule",{value:!0}),rd.clone=void 0;function e(t){var n=Object.create(Object.getPrototypeOf(t));return Object.assign(n,t),n}return rd.clone=e,rd}var yx;function bJ(){if(yx)return nd;yx=1;var e=pe&&pe.__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=pe&&pe.__setModuleDefault||(Object.create?function(a,u){Object.defineProperty(a,"default",{enumerable:!0,value:u})}:function(a,u){a.default=u}),n=pe&&pe.__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(nd,"__esModule",{value:!0}),nd.withValidate=void 0;var r=n(Q),i=yJ();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 nd.withValidate=o,nd}var bx;function O_(){if(bx)return td;bx=1;var e=pe&&pe.__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=pe&&pe.__setModuleDefault||(Object.create?function(u,s){Object.defineProperty(u,"default",{enumerable:!0,value:s})}:function(u,s){u.default=s}),n=pe&&pe.__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(td,"__esModule",{value:!0}),td.withFallback=void 0;var r=n(Q),i=bJ(),o=xn();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 td.withFallback=a,td}var w_={},Qh={};const So=vc(MM),ai=vc(ZC);var _x;function _J(){if(_x)return Qh;_x=1,Object.defineProperty(Qh,"__esModule",{value:!0});const e=H,t=So,n=ai,r=e.__importStar(Q);return Qh.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()),Qh}var em={},Sx;function SJ(){if(Sx)return em;Sx=1,Object.defineProperty(em,"__esModule",{value:!0});const e=H,t=So,n=ai,r=e.__importStar(Q);return em.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),em}var tm={},$x;function $J(){if($x)return tm;$x=1,Object.defineProperty(tm,"__esModule",{value:!0});const e=H,t=So,n=ai,r=e.__importStar(Q);return tm.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()),tm}var xt={};function Tx(e){return function(t){return function(n){return n.reduce(function(r,i){return e.alt(r,function(){return i})},t)}}}const TJ=Object.freeze(Object.defineProperty({__proto__:null,altAll:Tx},Symbol.toStringTag,{value:"Module"}));function IJ(e){return Tx(e)(e.zero())}const OJ=Object.freeze(Object.defineProperty({__proto__:null,altAll:IJ},Symbol.toStringTag,{value:"Module"}));var Wr=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},Ix=function(e){return Wr(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},Ox=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Wr(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},wJ=function(e,t){return y(e,wx(t))},wx=function(e){return function(t){return Wr(function(n,r){return t.equals(e(n),e(r))})}},Rx="Eq",Rc={equals:function(e,t){return e===t}},RJ={equals:function(){return!0}},Ex=function(){return{concat:function(e,t){return Wr(function(n,r){return e.equals(n,r)&&t.equals(n,r)})}}},EJ=function(){return{concat:Ex().concat,empty:RJ}},Cx={URI:Rx,contramap:wJ},CJ=Ox,MJ=Ix,xJ=Rc.equals,kJ=Cx,AJ=Rc,NJ=Rc,FJ=Rc,WJ={equals:function(e,t){return e.valueOf()===t.valueOf()}};const PJ=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:Cx,URI:Rx,contramap:wx,eq:kJ,eqBoolean:AJ,eqDate:WJ,eqNumber:FJ,eqStrict:Rc,eqString:NJ,fromEquals:Wr,getMonoid:EJ,getSemigroup:Ex,getStructEq:MJ,getTupleEq:CJ,strictEqual:xJ,struct:Ix,tuple:Ox},Symbol.toStringTag,{value:"Module"}));var Mx=function(e){return function(t,n){return t===n||e(t,n)===0}},ju=function(e){return{equals:Mx(e),compare:function(t,n){return t===n?0:e(t,n)}}},xx=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ju(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])})},R_=function(e){return ju(function(t,n){return e.compare(n,t)})},LJ=function(e,t){return y(e,nm(t))},nm=function(e){return function(t){return ju(function(n,r){return t.compare(e(n),e(r))})}},kx="Ord",Ax=function(){return{concat:function(e,t){return ju(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},E_=function(){return{concat:Ax().concat,empty:ju(function(){return 0})}},Nx={URI:kx,contramap:LJ},DJ={equals:Bb,compare:Vn(0)},jJ=function(e){return function(t){return function(n){return n===t||e.compare(n,t)===0}}},Fx=function(e){return function(t,n){return e.compare(t,n)===-1}},Wx=function(e){return function(t,n){return e.compare(t,n)===1}},qJ=function(e){return function(t,n){return e.compare(t,n)!==1}},UJ=function(e){return function(t,n){return e.compare(t,n)!==-1}},rm=function(e){return function(t,n){return t===n||e.compare(t,n)<1?t:n}},im=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}},Px=function(e){var t=rm(e),n=im(e);return function(r,i){return function(o){return n(t(o,i),r)}}},BJ=function(e){var t=Fx(e),n=Wx(e);return function(r,i){return function(o){return!(t(o,r)||n(o,i))}}},zJ=xx,KJ=R_,VJ=Nx;function HJ(e,t){return e<t?-1:e>t?1:0}var C_={equals:Rc.equals,compare:HJ},GJ=C_,JJ=C_,om=C_,YJ=y(om,nm(function(e){return e.valueOf()}));const ZJ=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:Nx,URI:kx,between:BJ,clamp:Px,contramap:nm,equals:jJ,equalsDefault:Mx,fromCompare:ju,geq:UJ,getDualOrd:KJ,getMonoid:E_,getSemigroup:Ax,getTupleOrd:zJ,gt:Wx,leq:qJ,lt:Fx,max:im,min:rm,ord:VJ,ordBoolean:GJ,ordDate:YJ,ordNumber:om,ordString:JJ,reverse:R_,trivial:DJ,tuple:xx},Symbol.toStringTag,{value:"Module"}));var Lx=function(e){return{concat:function(t,n){return e.concat(n,t)}}},XJ=function(e){return function(t){return{concat:function(n,r){return e(n)?t.concat(n,r):r}}}},QJ=function(e){return function(t){return{concat:function(n,r){return e(r)?t.concat(n,r):n}}}},eY=function(e){return function(t){return{concat:function(n,r){return t.concat(e(n),e(r))}}}},Dx=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}};const tY=Object.freeze(Object.defineProperty({__proto__:null,concatAll:Dx,endo:eY,filterFirst:XJ,filterSecond:QJ,reverse:Lx},Symbol.toStringTag,{value:"Module"}));var am=function(e){return{concat:rm(e)}},um=function(e){return{concat:im(e)}},M_=function(e){return{concat:function(){return e}}},x_=Lx,k_=function(e){return{concat:function(t,n){var r={};for(var i in e)ct.call(e,i)&&(r[i]=e[i].concat(t[i],n[i]));return r}}},A_=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])})}}},jx=function(e){return function(t){return{concat:function(n,r){return t.concat(n,t.concat(e,r))}}}},N_=function(){return{concat:j}},sm=function(){return{concat:function(e,t){return t}}},F_=Dx,qx=M_(void 0),nY=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},rY=sm,iY=N_,oY=A_,aY=k_,uY=x_,sY=um,cY=am,lY=jx;function fY(e){var t=F_(e);return function(n,r){return r===void 0?t(n):t(n)(r)}}var Ux={concat:function(e,t){return e&&t}},Bx={concat:function(e,t){return e||t}},dY=qb,zx={concat:function(e,t){return e+t}},Kx={concat:function(e,t){return e+t}},Vx={concat:function(e,t){return e*t}};const Hx=Object.freeze(Object.defineProperty({__proto__:null,concatAll:F_,constant:M_,first:N_,fold:fY,getDualSemigroup:uY,getFirstSemigroup:iY,getFunctionSemigroup:dY,getIntercalateSemigroup:lY,getJoinSemigroup:sY,getLastSemigroup:rY,getMeetSemigroup:cY,getObjectSemigroup:nY,getStructSemigroup:aY,getTupleSemigroup:oY,intercalate:jx,last:sm,max:um,min:am,reverse:x_,semigroupAll:Ux,semigroupAny:Bx,semigroupProduct:Vx,semigroupString:zx,semigroupSum:Kx,semigroupVoid:qx,struct:k_,tuple:A_},Symbol.toStringTag,{value:"Module"}));var id=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))},od=an,Ui=vt,cm=function(e,t){return e<0||e>=t.length},W_=function(e){return function(t){return id([e],t,!0)}},Ec=W_,P_=function(e){return function(t){return id(id([],t,!0),[e],!1)}},lm=P_,fm=function(e,t,n){if(Ui(n)){var r=zh(n);return r.splice(e,0,t),r}return[t]},L_=function(e,t,n){if(n[e]===t)return n;var r=zh(n);return r[e]=t,r},D_=function(e){return function(t){if(t.length===1)return t;for(var n=[Nn(t)],r=si(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}},Gx=function(e){if(Ui(e)){var t=E_();return U_(e.reduce(t.concat,t.empty))}return j},j_=function(e){var t=D_(e);return function(n){return function(r){return t(y(r,ud(n)))}}},q_=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(cm(Math.abs(r),t)||r===0)return t;if(r<0){var i=hm(-r)(t),o=i[0],a=i[1];return y(a,ud(o))}else return q_(r-n)(t)}},ad=function(e){return Ui(e)?de(e):ye},dm=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}},pY=function(e){return dm(function(){return e})},Jx=function(e,t){return e<=t?dm(function(n){return e+n})(t-e+1):[e]},Yx=function(e){return[Nn(e),si(e)]},Zx=function(e){return[Cc(e),xa(e)]},hY=function(e){return ad(e.slice())};function Xx(e){return function(t){return t.concat(e)}}function ud(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var mY=function(e){return e.length===1?e:id([xa(e)],e.slice(0,-1).reverse(),!0)};function Qx(e){return function(t){var n=t.length;if(n===0)return od;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 vY=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);ct.call(n,a)?n[a].push(o):n[a]=[o]}return n}},U_=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},gY=function(e,t){return ek(e,function(){return t})},ek=function(e,t){return function(n){return cm(e,n)?ye:de(L_(e,t(n[e]),n))}},tk=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 nk(e,t){return t===void 0?function(n){return nk(n,e)}:tk(e,t,function(n,r){return[n,r]})}var yY=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]},pm=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},B_=function(e){return function(t){var n=si(t);return Ui(n)?y(n,pm(e),Ec(Nn(t))):t}},rk=function(e){return function(t){for(var n=zh(e(0,Nn(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},z_=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;Ui(a);){var u=e(a),s=u[0],c=u[1];o.push(s),a=c}return o}},hm=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[t,od]:[y(t.slice(1,n),Ec(Nn(t))),t.slice(n)]}},ik=function(e){return z_(hm(e))},ui=function(e,t){return y(e,X_(t))},K_=function(e,t){return y(e,Q_(t))},sd=function(e,t){return y(e,lk(t))},V_=function(e,t){return y(e,mm(t))},ok=function(e,t){return y(e,Z_(t))},cd=function(e,t,n){return y(e,eS(t,n))},ld=function(e){var t=tS(e);return function(n,r){return y(n,t(r))}},fd=function(e,t,n){return y(e,nS(t,n))},H_=function(e){var t=fk(e);return function(n,r){return y(n,t(r))}},ak=function(e,t){return y(e,ck(t))},G_=function(e,t,n){return y(e,vm(t,n))},J_=function(e){var t=rS(e);return function(n,r){return y(n,t(r))}},Y_=function(e,t,n){return y(e,gm(t,n))},uk=function(e){var t=bm(e);return function(n,r){return y(n,t(r))}},Ma=jf,sk=function(e){return function(t){return y(t,Xx(e()))}},ck=sk,lk=function(e){return mm(function(t){return y(e,X_(t))})},mm=function(e){return rk(function(t,n){return e(n)})},Z_=function(e){return function(t){for(var n=si(t),r=[e(t)];Ui(n);)r.push(e(n)),n=si(n);return r}},bY=Z_(j),_Y=mm(j),X_=function(e){return Q_(function(t,n){return e(n)})},Q_=function(e){return function(t){for(var n=[e(0,Nn(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},eS=function(e,t){return vm(e,function(n,r,i){return t(r,i)})},tS=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]))}}},nS=function(e,t){return gm(e,function(n,r,i){return t(r,i)})},vm=function(e,t){return function(n){return n.reduce(function(r,i,o){return t(o,r,i)},e)}},rS=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]))}}},gm=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},fk=function(e){var t=bm(e);return function(n){return t(function(r,i){return n(i)})}},ym=function(e){return bm(e)(Hn)},bm=function(e){return function(t){return function(n){for(var r=e.map(t(0,Nn(n)),Ma),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return y(o,lm(a))}}),t(i,n[i]));return r}}},_m=fr,An="ReadonlyNonEmptyArray",dk=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},SY=function(){return{concat:ud}},pk=function(e){return Wr(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},$Y=function(e){var t=j_(e);return{concat:function(n,r){return t(r)(n)}}},iS={URI:An,map:ui},TY=ze(iS),IY={URI:An,of:Ma},OY={URI:An,map:ui,mapWithIndex:K_},Sm={URI:An,map:ui,ap:sd},wY=wt(Sm),RY=Rt(Sm),EY={URI:An,map:ui,ap:sd,of:Ma},oS={URI:An,map:ui,ap:sd,chain:V_},CY=lt(oS),MY={URI:An,map:ui,ap:sd,of:Ma,chain:V_},xY={URI:An,reduce:cd,foldMap:ld,reduceRight:fd},kY={URI:An,reduce:cd,foldMap:ld,reduceRight:fd,reduceWithIndex:G_,foldMapWithIndex:J_,reduceRightWithIndex:Y_},AY={URI:An,map:ui,reduce:cd,foldMap:ld,reduceRight:fd,traverse:H_,sequence:ym},NY={URI:An,map:ui,mapWithIndex:K_,reduce:cd,foldMap:ld,reduceRight:fd,traverse:H_,sequence:ym,reduceWithIndex:G_,foldMapWithIndex:J_,reduceRightWithIndex:Y_,traverseWithIndex:uk},FY={URI:An,map:ui,alt:ak},WY={URI:An,map:ui,extend:ok,extract:_m},PY=Ma(Jt),LY=Ct(iS),DY=Mt(oS),jY=Et(Sm),Nn=_m,si=yc,xa=function(e){return e[e.length-1]},Cc=function(e){return e.slice(0,-1)},hk=function(e){var t=am(e);return function(n){return n.reduce(t.concat)}},mk=function(e){var t=um(e);return function(n){return n.reduce(t.concat)}},$m=function(e){return function(t){return t.reduce(e.concat)}},qY=function(e){return function(t){return e(Nn(t),si(t))}},UY=function(e){return function(t){return e(Cc(t),xa(t))}},vk=function(e){return function(t){return id([e(Nn(t))],si(t),!0)}},BY=function(e){return vk(function(){return e})},gk=function(e){return function(t){return y(Cc(t),lm(e(xa(t))))}},zY=function(e){return gk(function(){return e})},aS=function(e){var t=$m(e);return function(n){return V(B_(n),t)}};function KY(e){var t=U_(e),n=Qx(e);return function(r){return Ui(r)?n(t(r)):od}}function VY(e){return yk(function(t,n){return e(n)})}var yk=function(e){return function(t){return ad(t.filter(function(n,r){return e(r,n)}))}},HY=Yx,GY=Zx;function bk(e,t){return t===void 0?Ec(e):y(t,Ec(e))}var _k=function(e,t){return y(e,ud([t]))},JY=function(e,t){return function(n){return e<0||e>n.length?ye:de(fm(e,t,n))}},YY=pm,ZY=$m,XY={URI:An,of:Ma,map:ui,mapWithIndex:K_,ap:sd,chain:V_,extend:ok,extract:_m,reduce:cd,foldMap:ld,reduceRight:fd,traverse:H_,sequence:ym,reduceWithIndex:G_,foldMapWithIndex:J_,reduceRightWithIndex:Y_,traverseWithIndex:uk,alt:ak};const QY=Object.freeze(Object.defineProperty({__proto__:null,Alt:FY,Applicative:EY,Apply:Sm,Chain:oS,Comonad:WY,Do:PY,Foldable:xY,FoldableWithIndex:kY,Functor:iS,FunctorWithIndex:OY,Monad:MY,Pointed:IY,Traversable:AY,TraversableWithIndex:NY,URI:An,alt:ck,altW:sk,ap:lk,apFirst:wY,apS:jY,apSecond:RY,append:lm,appendW:P_,bind:DY,bindTo:LY,chain:mm,chainFirst:CY,chainWithIndex:rk,chop:z_,chunksOf:ik,concat:ud,concatAll:$m,concatW:Xx,cons:bk,duplicate:bY,empty:od,extend:Z_,extract:_m,filter:VY,filterWithIndex:yk,flap:TY,flatten:_Y,fold:ZY,foldMap:tS,foldMapWithIndex:rS,fromArray:hY,fromReadonlyArray:ad,getEq:pk,getSemigroup:SY,getShow:dk,getUnionSemigroup:$Y,group:Qx,groupBy:vY,groupSort:KY,head:Nn,init:Cc,insertAt:JY,intercalate:aS,intersperse:B_,isNonEmpty:Ui,isOutOfBound:cm,last:xa,makeBy:dm,map:X_,mapWithIndex:Q_,matchLeft:qY,matchRight:UY,max:mk,min:hk,modifyAt:ek,modifyHead:vk,modifyLast:gk,of:Ma,prepend:Ec,prependAll:pm,prependToAll:YY,prependW:W_,range:Jx,readonlyNonEmptyArray:XY,reduce:eS,reduceRight:nS,reduceRightWithIndex:gm,reduceWithIndex:vm,replicate:pY,reverse:mY,rotate:q_,sequence:ym,snoc:_k,sort:U_,sortBy:Gx,splitAt:hm,tail:si,traverse:fk,traverseWithIndex:bm,unappend:Zx,uncons:HY,union:j_,uniq:D_,unprepend:Yx,unsafeInsertAt:fm,unsafeUpdateAt:L_,unsnoc:GY,unzip:yY,updateAt:gY,updateHead:BY,updateLast:zY,zip:nk,zipWith:tk},Symbol.toStringTag,{value:"Module"}));var dd=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))},$o=function(e){return e.length>0},Tm=function(e,t){return e<0||e>=t.length},uS=function(e){return function(t){return dd([e],t,!0)}},Mc=uS,sS=function(e){return function(t){return dd(dd([],t,!0),[e],!1)}},pd=sS,cS=function(e,t,n){if($o(n)){var r=hd(n);return r.splice(e,0,t),r}return[t]},lS=function(e,t,n){var r=hd(n);return r[e]=t,r},fS=function(e){return function(t){if(t.length===1)return xc(t);for(var n=[Pr(t)],r=li(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}},Sk=function(e){if($o(e)){var t=E_();return mS(e.reduce(t.concat,t.empty))}return xc},dS=function(e){var t=fS(e);return function(n){return function(r){return t(y(r,Om(n)))}}},pS=function(e){return function(t){var n=t.length,r=Math.round(e)%n;if(Tm(Math.abs(r),t)||r===0)return xc(t);if(r<0){var i=Rm(-r)(t),o=i[0],a=i[1];return y(a,Om(o))}else return pS(r-n)(t)}},hd=zh,hS=function(e){return $o(e)?de(e):ye},Im=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}},e7=function(e){return Im(function(){return e})},$k=function(e,t){return e<=t?Im(function(n){return e+n})(t-e+1):[e]},Tk=function(e){return[Pr(e),li(e)]},Ik=function(e){return[Ac(e),kc(e)]};function Ok(e){return function(t){return t.concat(e)}}function Om(e,t){return t?e.concat(t):function(n){return n.concat(e)}}var t7=function(e){return dd([kc(e)],e.slice(0,-1).reverse(),!0)};function wk(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 n7=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);ct.call(n,a)?n[a].push(o):n[a]=[o]}return n}},mS=function(e){return function(t){return t.slice().sort(e.compare)}},r7=function(e,t){return function(n){return e<0||e>n.length?ye:de(cS(e,t,n))}},i7=function(e,t){return Rk(e,function(){return t})},Rk=function(e,t){return function(n){return Tm(e,n)?ye:de(lS(e,t(n[e]),n))}},xc=hd,ka=function(e){return[e]},Ek=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 Ck(e,t){return t===void 0?function(n){return Ck(n,e)}:Ek(e,t,function(n,r){return[n,r]})}var o7=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]},wm=function(e){return function(t){for(var n=[e,t[0]],r=1;r<t.length;r++)n.push(e,t[r]);return n}},Mk=function(e){return function(t){var n=li(t);return $o(n)?y(n,wm(e),Mc(Pr(t))):xc(t)}},xk=rS,kk=tS,Ak=function(e){return function(t){for(var n=hd(e(0,Pr(t))),r=1;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},vS=function(e){return function(t){for(var n=e(t),r=n[0],i=n[1],o=[r],a=i;$o(a);){var u=e(a),s=u[0],c=u[1];o.push(s),a=c}return o}},Rm=function(e){return function(t){var n=Math.max(1,e);return n>=t.length?[xc(t),[]]:[y(t.slice(1,n),Mc(Pr(t))),t.slice(n)]}},Nk=function(e){return vS(Rm(e))},ci=function(e,t){return y(e,IS(t))},gS=function(e,t){return y(e,OS(t))},md=function(e,t){return y(e,jk(t))},yS=function(e,t){return y(e,Em(t))},Fk=function(e,t){return y(e,TS(t))},vd=function(e,t,n){return y(e,qk(t,n))},gd=function(e){var t=kk(e);return function(n,r){return y(n,t(r))}},yd=function(e,t,n){return y(e,Bk(t,n))},bS=function(e){var t=Kk(e);return function(n,r){return y(n,t(r))}},Wk=function(e,t){return y(e,Dk(t))},_S=function(e,t,n){return y(e,Uk(t,n))},SS=function(e){var t=xk(e);return function(n,r){return y(n,t(r))}},$S=function(e,t,n){return y(e,zk(t,n))},Pk=function(e){var t=Mm(e);return function(n,r){return y(n,t(r))}},Lk=function(e){return function(t){return y(t,Ok(e()))}},Dk=Lk,jk=function(e){return Em(function(t){return y(e,IS(t))})},Em=function(e){return Ak(function(t,n){return e(n)})},TS=function(e){return function(t){for(var n=li(t),r=[e(t)];$o(n);)r.push(e(n)),n=li(n);return r}},a7=TS(j),u7=Em(j),IS=function(e){return OS(function(t,n){return e(n)})},OS=function(e){return function(t){for(var n=[e(0,Pr(t))],r=1;r<t.length;r++)n.push(e(r,t[r]));return n}},qk=eS,Uk=vm,Bk=nS,zk=gm,Kk=function(e){var t=Mm(e);return function(n){return t(function(r,i){return n(i)})}},Cm=function(e){return Mm(e)(function(t,n){return n})},Mm=function(e){return function(t){return function(n){for(var r=e.map(t(0,Pr(n)),ka),i=1;i<n.length;i++)r=e.ap(e.map(r,function(o){return function(a){return y(o,pd(a))}}),t(i,n[i]));return r}}},wS=Nn,Fn="NonEmptyArray",s7=dk,c7=function(){return{concat:Om}},l7=pk,f7=function(e){var t=dS(e);return{concat:function(n,r){return t(r)(n)}}},RS={URI:Fn,map:ci},d7=ze(RS),p7={URI:Fn,of:ka},h7={URI:Fn,map:ci,mapWithIndex:gS},xm={URI:Fn,map:ci,ap:md},m7=wt(xm),v7=Rt(xm),g7={URI:Fn,map:ci,ap:md,of:ka},ES={URI:Fn,map:ci,ap:md,chain:yS},y7=lt(ES),b7={URI:Fn,map:ci,ap:md,of:ka,chain:yS},_7={URI:Fn,reduce:vd,foldMap:gd,reduceRight:yd},S7={URI:Fn,reduce:vd,foldMap:gd,reduceRight:yd,reduceWithIndex:_S,foldMapWithIndex:SS,reduceRightWithIndex:$S},$7={URI:Fn,map:ci,reduce:vd,foldMap:gd,reduceRight:yd,traverse:bS,sequence:Cm},T7={URI:Fn,map:ci,mapWithIndex:gS,reduce:vd,foldMap:gd,reduceRight:yd,traverse:bS,sequence:Cm,reduceWithIndex:_S,foldMapWithIndex:SS,reduceRightWithIndex:$S,traverseWithIndex:Pk},I7={URI:Fn,map:ci,alt:Wk},O7={URI:Fn,map:ci,extend:Fk,extract:wS},w7=ka(Jt),R7=Ct(RS),E7=Mt(ES),C7=Et(xm),Pr=Nn,li=function(e){return e.slice(1)},kc=xa,Ac=function(e){return e.slice(0,-1)},M7=hk,x7=mk,k7=function(e){return function(t){return t.reduce(e.concat)}},A7=function(e){return function(t){return e(Pr(t),li(t))}},N7=function(e){return function(t){return e(Ac(t),kc(t))}},Vk=function(e){return function(t){return dd([e(Pr(t))],li(t),!0)}},F7=function(e){return Vk(function(){return e})},Hk=function(e){return function(t){return y(Ac(t),pd(e(kc(t))))}},W7=function(e){return Hk(function(){return e})},P7=aS;function L7(e){var t=mS(e),n=wk(e);return function(r){return $o(r)?n(t(r)):[]}}function D7(e){return Gk(function(t,n){return e(n)})}var Gk=function(e){return function(t){return hS(t.filter(function(n,r){return e(r,n)}))}},j7=Tk,q7=Ik;function Jk(e,t){return t===void 0?Mc(e):y(t,Mc(e))}var Yk=function(e,t){return y(e,pd(t))},U7=wm,B7=$m,z7={URI:Fn,of:ka,map:ci,mapWithIndex:gS,ap:md,chain:yS,extend:Fk,extract:wS,reduce:vd,foldMap:gd,reduceRight:yd,traverse:bS,sequence:Cm,reduceWithIndex:_S,foldMapWithIndex:SS,reduceRightWithIndex:$S,traverseWithIndex:Pk,alt:Wk};const K7=Object.freeze(Object.defineProperty({__proto__:null,Alt:I7,Applicative:g7,Apply:xm,Chain:ES,Comonad:O7,Do:w7,Foldable:_7,FoldableWithIndex:S7,Functor:RS,FunctorWithIndex:h7,Monad:b7,Pointed:p7,Traversable:$7,TraversableWithIndex:T7,URI:Fn,alt:Dk,altW:Lk,ap:jk,apFirst:m7,apS:C7,apSecond:v7,append:pd,appendW:sS,bind:E7,bindTo:R7,chain:Em,chainFirst:y7,chainWithIndex:Ak,chop:vS,chunksOf:Nk,concat:Om,concatAll:k7,concatW:Ok,cons:Jk,copy:xc,duplicate:a7,extend:TS,extract:wS,filter:D7,filterWithIndex:Gk,flap:d7,flatten:u7,fold:B7,foldMap:kk,foldMapWithIndex:xk,fromArray:hS,fromReadonlyNonEmptyArray:hd,getEq:l7,getSemigroup:c7,getShow:s7,getUnionSemigroup:f7,group:wk,groupBy:n7,groupSort:L7,head:Pr,init:Ac,insertAt:r7,intercalate:P7,intersperse:Mk,isNonEmpty:$o,isOutOfBound:Tm,last:kc,makeBy:Im,map:IS,mapWithIndex:OS,matchLeft:A7,matchRight:N7,max:x7,min:M7,modifyAt:Rk,modifyHead:Vk,modifyLast:Hk,nonEmptyArray:z7,of:ka,prepend:Mc,prependAll:wm,prependToAll:U7,prependW:uS,range:$k,reduce:qk,reduceRight:Bk,reduceRightWithIndex:zk,reduceWithIndex:Uk,replicate:e7,reverse:t7,rotate:pS,sequence:Cm,snoc:Yk,sort:mS,sortBy:Sk,splitAt:Rm,tail:li,traverse:Kk,traverseWithIndex:Mm,unappend:Ik,uncons:j7,union:dS,uniq:fS,unprepend:Tk,unsafeInsertAt:cS,unsafeUpdateAt:lS,unsnoc:q7,unzip:o7,updateAt:i7,updateHead:F7,updateLast:W7,zip:Ck,zipWith:Ek},Symbol.toStringTag,{value:"Module"}));var V7=function(e){return typeof e=="number"},CS={equals:function(e,t){return e===t}},km={equals:CS.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},H7={equals:CS.equals,compare:km.compare,top:1/0,bottom:-1/0},G7={show:function(e){return JSON.stringify(e)}},Zk={concat:function(e,t){return e-t}},MS={concat:function(e,t){return e+t}},xS={concat:function(e,t){return e*t}},J7={concat:MS.concat,empty:0},Y7={concat:xS.concat,empty:1},Z7={add:MS.concat,zero:0,mul:xS.concat,one:1,sub:Zk.concat,degree:function(e){return 1},div:function(e,t){return e/t},mod:function(e,t){return e%t}};const X7=Object.freeze(Object.defineProperty({__proto__:null,Bounded:H7,Eq:CS,Field:Z7,MagmaSub:Zk,MonoidProduct:Y7,MonoidSum:J7,Ord:km,SemigroupProduct:xS,SemigroupSum:MS,Show:G7,isNumber:V7},Symbol.toStringTag,{value:"Module"}));function Nc(e,t){return function(n){return n?t.of(void 0):e.zero()}}const Q7=Object.freeze(Object.defineProperty({__proto__:null,guard:Nc},Symbol.toStringTag,{value:"Module"}));var e8=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))},Bi=function(e){return e.length===0},kt=Ui,t8=Ec,n8=W_,Am=lm,r8=P_,Xk=function(e,t){return e<=0?It:dm(t)(e)},i8=function(e,t){return Xk(e,function(){return t})};function o8(e){return function(t){return e(t)?[t]:It}}var Qk=function(e){return Pt(e)?It:[e.value]},eA=function(e){return Gt(e)?It:[e.right]},tA=function(e,t){return function(n){return kt(n)?t(n):e()}},nA=tA,rA=function(e,t){return function(n){return kt(n)?t(Nn(n),si(n)):e()}},iA=rA,a8=iA,oA=function(e,t){return function(n){return kt(n)?t(Cc(n),xa(n)):e()}},aA=oA,u8=aA,uA=function(e){return function(t){if(Bi(t))return It;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},s8=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}},c8=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}},l8=function(e){return e.length},Fc=cm;function qu(e,t){return t===void 0?function(n){return qu(e,n)}:Fc(e,t)?ye:de(t[e])}var sA=function(e){return kt(e)?de(Nn(e)):ye},kS=function(e){return kt(e)?de(xa(e)):ye},f8=function(e){return kt(e)?de(si(e)):ye},d8=function(e){return kt(e)?de(Cc(e)):ye},p8=function(e){return function(t){return Fc(e,t)?t:e===0?It:t.slice(0,e)}},h8=function(e){return function(t){return Fc(e,t)?t:e===0?It:t.slice(-e)}};function m8(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?It:n}}var cA=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function v8(e){return function(t){var n=AS(cA(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var g8=function(e){return function(t){return e<=0||Bi(t)?t:e>=t.length?It:t.slice(e,t.length)}},y8=function(e){return function(t){return e<=0||Bi(t)?t:e>=t.length?It:t.slice(0,t.length-e)}};function b8(e){return function(t){var n=cA(t,e);return n===0?t:n===t.length?It:t.slice(n)}}var Nm=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return de(n);return ye}};function Fm(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return de(t[n]);return ye}}var lA=function(e){return function(t){for(var n=0;n<t.length;n++){var r=e(t[n]);if(yt(r))return r}return ye}};function fA(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return de(t[n]);return ye}}var dA=function(e){return function(t){for(var n=t.length-1;n>=0;n--){var r=e(t[n]);if(yt(r))return r}return ye}},pA=function(e){return function(t){for(var n=t.length-1;n>=0;n--)if(e(t[n]))return de(n);return ye}},_8=function(e,t){return function(n){return e<0||e>n.length?ye:de(fm(e,t,n))}},S8=function(e,t){return hA(e,function(){return t})},$8=function(e){return function(t){return Fc(e,t)?ye:de(UA(e,t))}},hA=function(e,t){return function(n){return Fc(e,n)?ye:de(Hm(e,t(n[e]),n))}},T8=function(e){return e.length<=1?e:e.slice().reverse()},I8=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},O8=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},w8=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}},mA=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 vA(e,t){return t===void 0?function(n){return vA(n,e)}:mA(e,t,function(n,r){return[n,r]})}var R8=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]},gA=function(e){var t=pm(e);return function(n){return kt(n)?t(n):n}},E8=function(e){var t=B_(e);return function(n){return kt(n)?t(n):n}},C8=function(e){var t=q_(e);return function(n){return kt(n)?t(n):n}};function bd(e){return function(t,n){if(n===void 0){var r=bd(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 M8=function(e){var t=D_(e);return function(n){return kt(n)?t(n):n}},x8=function(e){var t=Gx(e);return function(n){return kt(n)?t(n):n}},k8=function(e){var t=z_(e);return function(n){return kt(n)?t(n):It}},AS=function(e){return function(t){return e>=1&&kt(t)?hm(e)(t):Bi(t)?[t,It]:[It,t]}},A8=function(e){var t=ik(e);return function(n){return kt(n)?t(n):It}},N8=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Qk(e.apply(void 0,t))}};function F8(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return kt(o)?y(Nn(o),Sd(function(a){return r(y(i,Am(a)),si(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:It};return r(It,e)}var yA=function(e){return function(t){return Bi(t)?e:Bi(e)?t:t.concat(e)}},W8=yA;function NS(e){var t=j_(e);return function(n,r){if(r===void 0){var i=NS(e);return function(o){return i(o,n)}}return kt(n)&&kt(r)?t(r)(n):kt(n)?n:r}}function FS(e){var t=bd(e);return function(n,r){if(r===void 0){var i=FS(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function WS(e){var t=bd(e);return function(n,r){if(r===void 0){var i=WS(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,Um(t))},Wm=function(e,t){return y(e,EA(t))},Aa=function(e,t){return y(e,RA(t))},_d=function(e,t){return y(e,Sd(t))},Pm=function(e,t){return y(e,fi(t))},Lm=function(e,t){return y(e,KS(t))},Dm=function(e,t){return y(e,CA(t))},jm=function(e,t){return y(e,MA(t))},bA=function(e,t){return y(e,VS(t))},_A=function(e,t){return y(e,HS(t))},PS=function(e,t){return y(e,wA(t))},Uu=function(e,t,n){return y(e,zm(t,n))},Wc=function(e){var t=JS(e);return function(n,r){return y(n,t(r))}},Pc=function(e,t,n){return y(e,YS(t,n))},LS=function(e,t,n){return y(e,$d(t,n))},DS=function(e){var t=Bm(e);return function(n,r){return y(n,t(r))}},jS=function(e,t,n){return y(e,Km(t,n))},SA=function(e,t){return y(e,zS(t))},$A=function(e,t){return y(e,xA(t))},TA=function(e,t){return y(e,GS(t))},qm=function(e){var t=kA(e);return function(n,r){return y(n,t(r))}},IA=function(e){var t=ZS(e);return function(n,r){return y(n,t(r))}},qS=function(e,t){return y(e,r$(t))},US=function(e,t){return y(e,i$(t))},Bu=Ma,Lc=function(){return It},OA=function(e){return function(t){return t.concat(e())}},wA=OA,RA=function(e){return Sd(function(t){return y(e,Um(t))})},Sd=function(e){return function(t){return y(t,uA(function(n,r){return e(r)}))}},BS=Sd(j),Um=function(e){return function(t){return t.map(function(n){return e(n)})}},EA=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},Dc=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 Re(t,n)},fi=function(e){return function(t){return t.filter(e)}},zS=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);yt(i)&&n.push(i.value)}return n}},KS=function(e){return zS(function(t,n){return e(n)})},jc=KS(j),CA=function(e){return VS(function(t,n){return e(n)})},VS=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 Re(n,r)}},MA=function(e){return HS(function(t,n){return e(n)})},HS=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 Re(n,r)}},xA=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},GS=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},P8=GS(j),Bm=function(e){return function(t){return function(n){return n.reduce(function(r,i,o){return e.concat(r,t(o,i))},e.empty)}}},zm=function(e,t){return $d(e,function(n,r,i){return t(r,i)})},JS=function(e){var t=Bm(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}},YS=function(e,t){return Km(e,function(n,r,i){return t(r,i)})},Km=function(e,t){return function(n){return n.reduceRight(function(r,i,o){return t(o,i,r)},e)}},kA=function(e){var t=ZS(e);return function(n){return t(function(r,i){return n(i)})}},Td=function(e){return function(t){return Uu(t,e.of(Lc()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return y(i,Am(o))}}),r)})}},ZS=function(e){return function(t){return $d(e.of(Lc()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return y(o,Am(a))}}),t(n,i))})}},L8=function(e){var t=o$(e);return function(n){return function(r){return t(r,n)}}},D8=function(e){var t=a$(e);return function(n){return function(r){return t(r,n)}}},XS=function(e,t){for(var n=[],r=e;;){var i=t(r);if(yt(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},ft="ReadonlyArray",AA=function(e){return{show:function(t){return"[".concat(t.map(e.show).join(", "),"]")}}},NA=function(){return{concat:function(e,t){return Bi(e)?t:Bi(t)?e:e.concat(t)}}},j8=function(){return{concat:NA().concat,empty:It}},FA=function(e){return Wr(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},WA=function(e){return ju(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 km.compare(r,i)})},PA=function(e){var t=NS(e);return{concat:function(n,r){return t(r)(n)}}},q8=function(e){return{concat:PA(e).concat,empty:It}},U8=function(e){var t=FS(e);return{concat:function(n,r){return t(r)(n)}}},B8=function(e){var t=WS(e);return{concat:function(n,r){return t(r)(n)}}},QS={URI:ft,map:un},z8=ze(QS),LA={URI:ft,of:Bu},K8={URI:ft,map:un,mapWithIndex:Wm},Vm={URI:ft,map:un,ap:Aa},V8=wt(Vm),H8=Rt(Vm),G8={URI:ft,map:un,ap:Aa,of:Bu},e$={URI:ft,map:un,ap:Aa,chain:_d},J8={URI:ft,map:un,ap:Aa,of:Bu,chain:_d},Y8=lt(e$),Z8={URI:ft,unfold:XS},X8={URI:ft,map:un,alt:PS},DA={URI:ft,zero:Lc},Q8=Nc(DA,LA),e9={URI:ft,map:un,ap:Aa,of:Bu,alt:PS,zero:Lc},t9={URI:ft,map:un,extend:TA},t$={URI:ft,compact:jc,separate:Dc},n9={URI:ft,map:un,compact:jc,separate:Dc,filter:Pm,filterMap:Lm,partition:Dm,partitionMap:jm},r9={URI:ft,map:un,mapWithIndex:Wm,compact:jc,separate:Dc,filter:Pm,filterMap:Lm,partition:Dm,partitionMap:jm,partitionMapWithIndex:_A,partitionWithIndex:bA,filterMapWithIndex:SA,filterWithIndex:$A},i9={URI:ft,reduce:Uu,foldMap:Wc,reduceRight:Pc},o9={URI:ft,reduce:Uu,foldMap:Wc,reduceRight:Pc,reduceWithIndex:LS,foldMapWithIndex:DS,reduceRightWithIndex:jS},n$={URI:ft,map:un,reduce:Uu,foldMap:Wc,reduceRight:Pc,traverse:qm,sequence:Td},a9={URI:ft,map:un,mapWithIndex:Wm,reduce:Uu,foldMap:Wc,reduceRight:Pc,reduceWithIndex:LS,foldMapWithIndex:DS,reduceRightWithIndex:jS,traverse:qm,sequence:Td,traverseWithIndex:IA},r$=function(e){return function(t){for(var n=e8([],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}},u9={URI:ft,map:un,ap:Aa,chain:_d,chainRec:qS},i$=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}},s9={URI:ft,map:un,ap:Aa,chain:_d,chainRec:US},o$=ri(n$,t$),a$=ni(n$,t$),jA={URI:ft,map:un,compact:jc,separate:Dc,filter:Pm,filterMap:Lm,partition:Dm,partitionMap:jm,reduce:Uu,foldMap:Wc,reduceRight:Pc,traverse:qm,sequence:Td,wither:o$,wilt:a$},c9=Zb(jA),qA={URI:ft,fromEither:eA},l9=dr(qA),f9=fm,Hm=function(e,t,n){return kt(n)?L_(e,t,n):n},UA=function(e,t){var n=t.slice();return n.splice(e,1),n},d9=function(e){return e.slice()},p9=function(e){return Bi(e)?It:e.slice()},It=od;function BA(e){return function(t){return t.every(e)}}var zA=function(e){return function(t){return t.some(e)}},h9=zA,KA=function(e){var t=aS(e);return function(n){return nA(function(){return e.empty},t(n))}},m9=Bu(Jt),v9=Ct(QS),g9=Mt(e$),y9=Et(Vm),b9=Jx,_9=bk,S9=_k,$9=gA,T9={URI:ft,compact:jc,separate:Dc,map:un,ap:Aa,of:Bu,chain:_d,filter:Pm,filterMap:Lm,partition:Dm,partitionMap:jm,mapWithIndex:Wm,partitionMapWithIndex:_A,partitionWithIndex:bA,filterMapWithIndex:SA,filterWithIndex:$A,alt:PS,zero:Lc,unfold:XS,reduce:Uu,foldMap:Wc,reduceRight:Pc,traverse:qm,sequence:Td,reduceWithIndex:LS,foldMapWithIndex:DS,reduceRightWithIndex:jS,traverseWithIndex:IA,extend:TA,wither:o$,wilt:a$};const I9=Object.freeze(Object.defineProperty({__proto__:null,Alt:X8,Alternative:e9,Applicative:G8,Apply:Vm,Chain:e$,ChainRecBreadthFirst:s9,ChainRecDepthFirst:u9,Compactable:t$,Do:m9,Extend:t9,Filterable:n9,FilterableWithIndex:r9,Foldable:i9,FoldableWithIndex:o9,FromEither:qA,Functor:QS,FunctorWithIndex:K8,Monad:J8,Pointed:LA,Traversable:n$,TraversableWithIndex:a9,URI:ft,Unfoldable:Z8,Witherable:jA,Zero:DA,_chainRecBreadthFirst:US,_chainRecDepthFirst:qS,alt:wA,altW:OA,ap:RA,apFirst:V8,apS:y9,apSecond:H8,append:Am,appendW:r8,bind:g9,bindTo:v9,chain:Sd,chainFirst:Y8,chainRecBreadthFirst:i$,chainRecDepthFirst:r$,chainWithIndex:uA,chop:k8,chunksOf:A8,compact:jc,comprehension:F8,concat:W8,concatW:yA,cons:_9,deleteAt:$8,difference:WS,dropLeft:g8,dropLeftWhile:b8,dropRight:y8,duplicate:P8,elem:bd,empty:It,every:BA,exists:h9,extend:GS,filter:fi,filterE:c9,filterMap:KS,filterMapWithIndex:zS,filterWithIndex:xA,findFirst:Fm,findFirstMap:lA,findIndex:Nm,findLast:fA,findLastIndex:pA,findLastMap:dA,flap:z8,flatten:BS,foldLeft:a8,foldMap:JS,foldMapWithIndex:Bm,foldRight:u8,fromArray:p9,fromEither:eA,fromEitherK:l9,fromOption:Qk,fromOptionK:N8,fromPredicate:o8,getDifferenceMagma:B8,getEq:FA,getIntersectionSemigroup:U8,getMonoid:j8,getOrd:WA,getSemigroup:NA,getShow:AA,getUnionMonoid:q8,getUnionSemigroup:PA,guard:Q8,head:sA,init:d8,insertAt:_8,intercalate:KA,intersection:FS,intersperse:E8,isEmpty:Bi,isNonEmpty:kt,isOutOfBound:Fc,last:kS,lefts:O8,lookup:qu,makeBy:Xk,map:Um,mapWithIndex:EA,match:nA,matchLeft:iA,matchLeftW:rA,matchRight:aA,matchRightW:oA,matchW:tA,modifyAt:hA,of:Bu,partition:CA,partitionMap:MA,partitionMapWithIndex:HS,partitionWithIndex:VS,prepend:t8,prependAll:gA,prependToAll:$9,prependW:n8,range:b9,readonlyArray:T9,reduce:zm,reduceRight:YS,reduceRightWithIndex:Km,reduceWithIndex:$d,replicate:i8,reverse:T8,rights:I8,rotate:C8,scanLeft:s8,scanRight:c8,separate:Dc,sequence:Td,size:l8,snoc:S9,some:zA,sort:w8,sortBy:x8,spanLeft:v8,splitAt:AS,tail:f8,takeLeft:p8,takeLeftWhile:m8,takeRight:h8,toArray:d9,traverse:kA,traverseWithIndex:ZS,unfold:XS,union:NS,uniq:M8,unsafeDeleteAt:UA,unsafeInsertAt:f9,unsafeUpdateAt:Hm,unzip:R8,updateAt:S8,wilt:D8,wither:L8,zero:Lc,zip:vA,zipWith:mA},Symbol.toStringTag,{value:"Module"}));var Na=function(e){return e.length===0},Lt=$o,O9=Mc,w9=uS,Gm=pd,R9=sS,VA=function(e,t){return e<=0?[]:Im(t)(e)},E9=function(e,t){return VA(e,function(){return t})};function C9(e){return function(t){return e(t)?[t]:[]}}var HA=function(e){return Pt(e)?[]:[e.value]},GA=function(e){return Gt(e)?[]:[e.right]},JA=function(e,t){return function(n){return Lt(n)?t(n):e()}},M9=JA,YA=function(e,t){return function(n){return Lt(n)?t(Pr(n),li(n)):e()}},ZA=YA,x9=ZA,XA=function(e,t){return function(n){return Lt(n)?t(Ac(n),kc(n)):e()}},QA=XA,k9=QA,eN=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},A9=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}},N9=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}},F9=function(e){return e.length},Id=Tm,W9=qu,P9=sA,L9=kS,D9=function(e){return Lt(e)?de(li(e)):ye},j9=function(e){return Lt(e)?de(Ac(e)):ye},q9=function(e){return function(t){return Id(e,t)?Tn(t):t.slice(0,e)}},U9=function(e){return function(t){return Id(e,t)?Tn(t):e===0?[]:t.slice(-e)}};function B9(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 tN=function(e,t){for(var n=e.length,r=0;r<n&&t(e[r]);r++);return r};function z9(e){return function(t){var n=aN(tN(t,e))(t),r=n[0],i=n[1];return{init:r,rest:i}}}var K9=function(e){return function(t){return e<=0||Na(t)?Tn(t):e>=t.length?[]:t.slice(e,t.length)}},V9=function(e){return function(t){return e<=0||Na(t)?Tn(t):e>=t.length?[]:t.slice(0,t.length-e)}};function H9(e){return function(t){return t.slice(tN(t,e))}}var G9=Nm;function J9(e){return Fm(e)}var Y9=lA;function Z9(e){return fA(e)}var X9=dA,Q9=pA,Tn=function(e){return e.slice()},eZ=function(e,t){return function(n){return e<0||e>n.length?ye:de(FN(e,t,n))}},tZ=function(e,t){return nN(e,function(){return t})},nZ=function(e){return function(t){return Id(e,t)?ye:de(PN(e,t))}},nN=function(e,t){return function(n){return Id(e,n)?ye:de(WN(e,t(n[e]),n))}},rZ=function(e){return Na(e)?[]:e.slice().reverse()},iZ=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Right"&&t.push(r.right)}return t},oZ=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r._tag==="Left"&&t.push(r.left)}return t},aZ=function(e){return function(t){return t.length<=1?Tn(t):t.slice().sort(e.compare)}},rN=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 iN(e,t){return t===void 0?function(n){return iN(n,e)}:rN(e,t,function(n,r){return[n,r]})}var uZ=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]},oN=function(e){var t=wm(e);return function(n){return Lt(n)?t(n):[]}},sZ=function(e){var t=Mk(e);return function(n){return Lt(n)?t(n):Tn(n)}},cZ=function(e){var t=pS(e);return function(n){return Lt(n)?t(n):Tn(n)}},u$=bd,lZ=function(e){var t=fS(e);return function(n){return Lt(n)?t(n):Tn(n)}},fZ=function(e){var t=Sk(e);return function(n){return Lt(n)?t(n):Tn(n)}},dZ=function(e){var t=vS(e);return function(n){return Lt(n)?t(n):[]}},aN=function(e){return function(t){return e>=1&&Lt(t)?Rm(e)(t):Na(t)?[Tn(t),[]]:[[],Tn(t)]}},pZ=function(e){var t=Nk(e);return function(n){return Lt(n)?t(n):[]}},hZ=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return HA(e.apply(void 0,t))}};function mZ(e,t,n){n===void 0&&(n=function(){return!0});var r=function(i,o){return Lt(o)?y(Pr(o),wd(function(a){return r(y(i,Gm(a)),li(o))})):n.apply(void 0,i)?[t.apply(void 0,i)]:[]};return r([],e)}var uN=function(e){return function(t){return Na(t)?Tn(e):Na(e)?Tn(t):t.concat(e)}},vZ=uN;function s$(e){var t=dS(e);return function(n,r){if(r===void 0){var i=s$(e);return function(o){return i(o,n)}}return Lt(n)&&Lt(r)?t(r)(n):Lt(n)?Tn(n):Tn(r)}}function c$(e){var t=u$(e);return function(n,r){if(r===void 0){var i=c$(e);return function(o){return i(o,n)}}return n.filter(function(o){return t(o,r)})}}function l$(e){var t=u$(e);return function(n,r){if(r===void 0){var i=l$(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var sn=function(e,t){return y(e,m$(t))},Jm=function(e,t){return y(e,mN(t))},Fa=function(e,t){return y(e,hN(t))},Od=function(e,t){return y(e,wd(t))},Ym=function(e,t){return y(e,vN(t))},Zm=function(e,t){return y(e,y$(t))},Xm=function(e,t){return y(e,gN(t))},Qm=function(e,t){return y(e,yN(t))},sN=function(e,t){return y(e,b$(t))},cN=function(e,t){return y(e,_$(t))},f$=function(e,t){return y(e,_N(t))},zu=function(e,t,n){return y(e,IN(t,n))},qc=function(e){var t=$N(e);return function(n,r){return y(n,t(r))}},Uc=function(e,t,n){return y(e,ON(t,n))},d$=function(e,t,n){return y(e,$$(t,n))},p$=function(e){var t=TN(e);return function(n,r){return y(n,t(r))}},h$=function(e,t,n){return y(e,wN(t,n))},lN=function(e,t){return y(e,g$(t))},fN=function(e,t){return y(e,SN(t))},dN=function(e,t){return y(e,S$(t))},ev=function(e){var t=tv(e);return function(n,r){return y(n,t(r))}},pN=function(e){var t=T$(e);return function(n,r){return y(n,t(r))}},gZ=qS,yZ=US,Wa=ka,Bc=function(){return[]},m$=function(e){return function(t){return t.map(function(n){return e(n)})}},hN=function(e){return wd(function(t){return y(e,m$(t))})},wd=function(e){return function(t){return y(t,eN(function(n,r){return e(r)}))}},v$=wd(j),mN=function(e){return function(t){return t.map(function(n,r){return e(r,n)})}},g$=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);yt(i)&&n.push(i.value)}return n}},y$=function(e){return g$(function(t,n){return e(n)})},zc=y$(j),Kc=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 Re(t,n)},vN=function(e){return function(t){return t.filter(e)}},gN=function(e){return b$(function(t,n){return e(n)})},b$=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 Re(n,r)}},yN=function(e){return _$(function(t,n){return e(n)})},_$=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 Re(n,r)}},bN=function(e){return function(t){return t.concat(e())}},_N=bN,SN=function(e){return function(t){return t.filter(function(n,r){return e(r,n)})}},S$=function(e){return function(t){return t.map(function(n,r){return e(t.slice(r))})}},bZ=S$(j),$N=JS,TN=Bm,IN=zm,$$=$d,ON=YS,wN=Km,tv=function(e){var t=T$(e);return function(n){return t(function(r,i){return n(i)})}},Rd=function(e){return function(t){return zu(t,e.of(Bc()),function(n,r){return e.ap(e.map(n,function(i){return function(o){return y(i,Gm(o))}}),r)})}},T$=function(e){return function(t){return $$(e.of(Bc()),function(n,r,i){return e.ap(e.map(r,function(o){return function(a){return y(o,Gm(a))}}),t(n,i))})}},_Z=function(e){var t=M$(e);return function(n){return function(r){return t(r,n)}}},SZ=function(e){var t=x$(e);return function(n){return function(r){return t(r,n)}}},I$=function(e,t){for(var n=[],r=e;;){var i=t(r);if(yt(i)){var o=i.value,a=o[0],u=o[1];n.push(a),r=u}else break}return n},dt="Array",$Z=AA,RN=function(){return{concat:function(e,t){return e.concat(t)}}},O$=function(){return{concat:RN().concat,empty:[]}},EN=FA,TZ=WA,CN=function(e){var t=s$(e);return{concat:function(n,r){return t(r)(n)}}},IZ=function(e){return{concat:CN(e).concat,empty:[]}},OZ=function(e){var t=c$(e);return{concat:function(n,r){return t(r)(n)}}},wZ=function(e){var t=l$(e);return{concat:function(n,r){return t(r)(n)}}},w$={URI:dt,map:sn},RZ=ze(w$),MN={URI:dt,of:Wa},EZ={URI:dt,map:sn,mapWithIndex:Jm},nv={URI:dt,map:sn,ap:Fa},CZ=wt(nv),MZ=Rt(nv),xZ={URI:dt,map:sn,ap:Fa,of:Wa},R$={URI:dt,map:sn,ap:Fa,chain:Od},kZ=lt(R$),AZ={URI:dt,map:sn,ap:Fa,of:Wa,chain:Od},NZ={URI:dt,unfold:I$},FZ={URI:dt,map:sn,alt:f$},xN={URI:dt,zero:Bc},WZ=Nc(xN,MN),PZ={URI:dt,map:sn,ap:Fa,of:Wa,alt:f$,zero:Bc},LZ={URI:dt,map:sn,extend:dN},E$={URI:dt,compact:zc,separate:Kc},DZ={URI:dt,map:sn,compact:zc,separate:Kc,filter:Ym,filterMap:Zm,partition:Xm,partitionMap:Qm},jZ={URI:dt,map:sn,mapWithIndex:Jm,compact:zc,separate:Kc,filter:Ym,filterMap:Zm,partition:Xm,partitionMap:Qm,partitionMapWithIndex:cN,partitionWithIndex:sN,filterMapWithIndex:lN,filterWithIndex:fN},kN={URI:dt,reduce:zu,foldMap:qc,reduceRight:Uc},qZ={URI:dt,reduce:zu,foldMap:qc,reduceRight:Uc,reduceWithIndex:d$,foldMapWithIndex:p$,reduceRightWithIndex:h$},C$={URI:dt,map:sn,reduce:zu,foldMap:qc,reduceRight:Uc,traverse:ev,sequence:Rd},UZ={URI:dt,map:sn,mapWithIndex:Jm,reduce:zu,foldMap:qc,reduceRight:Uc,reduceWithIndex:d$,foldMapWithIndex:p$,reduceRightWithIndex:h$,traverse:ev,sequence:Rd,traverseWithIndex:pN},M$=ri(C$,E$),x$=ni(C$,E$),AN={URI:dt,map:sn,compact:zc,separate:Kc,filter:Ym,filterMap:Zm,partition:Xm,partitionMap:Qm,reduce:zu,foldMap:qc,reduceRight:Uc,traverse:ev,sequence:Rd,wither:M$,wilt:x$},BZ=r$,zZ={URI:dt,map:sn,ap:Fa,chain:Od,chainRec:gZ},KZ=i$,VZ={URI:dt,map:sn,ap:Fa,chain:Od,chainRec:yZ},HZ=Zb(AN),NN={URI:dt,fromEither:GA},GZ=dr(NN),FN=cS,WN=function(e,t,n){return Lt(n)?lS(e,t,n):[]},PN=function(e,t){var n=t.slice();return n.splice(e,1),n},JZ=BA,LN=function(e){return function(t){return t.some(e)}},YZ=LN,ZZ=KA,XZ=Wa(Jt),QZ=Ct(w$),eX=Mt(R$),tX=Et(nv),nX=$k,rX=[],iX=Jk,oX=Yk,aX=oN,uX={URI:dt,compact:zc,separate:Kc,map:sn,ap:Fa,of:Wa,chain:Od,filter:Ym,filterMap:Zm,partition:Xm,partitionMap:Qm,mapWithIndex:Jm,partitionMapWithIndex:cN,partitionWithIndex:sN,filterMapWithIndex:lN,filterWithIndex:fN,alt:f$,zero:Bc,unfold:I$,reduce:zu,foldMap:qc,reduceRight:Uc,traverse:ev,sequence:Rd,reduceWithIndex:d$,foldMapWithIndex:p$,reduceRightWithIndex:h$,traverseWithIndex:pN,extend:dN,wither:M$,wilt:x$};const sX=Object.freeze(Object.defineProperty({__proto__:null,Alt:FZ,Alternative:PZ,Applicative:xZ,Apply:nv,Chain:R$,ChainRecBreadthFirst:VZ,ChainRecDepthFirst:zZ,Compactable:E$,Do:XZ,Extend:LZ,Filterable:DZ,FilterableWithIndex:jZ,Foldable:kN,FoldableWithIndex:qZ,FromEither:NN,Functor:w$,FunctorWithIndex:EZ,Monad:AZ,Pointed:MN,Traversable:C$,TraversableWithIndex:UZ,URI:dt,Unfoldable:NZ,Witherable:AN,Zero:xN,alt:_N,altW:bN,ap:hN,apFirst:CZ,apS:tX,apSecond:MZ,append:Gm,appendW:R9,array:uX,bind:eX,bindTo:QZ,chain:wd,chainFirst:kZ,chainRecBreadthFirst:KZ,chainRecDepthFirst:BZ,chainWithIndex:eN,chop:dZ,chunksOf:pZ,compact:zc,comprehension:mZ,concat:vZ,concatW:uN,cons:iX,copy:Tn,deleteAt:nZ,difference:l$,dropLeft:K9,dropLeftWhile:H9,dropRight:V9,duplicate:bZ,elem:u$,empty:rX,every:JZ,exists:YZ,extend:S$,filter:vN,filterE:HZ,filterMap:y$,filterMapWithIndex:g$,filterWithIndex:SN,findFirst:J9,findFirstMap:Y9,findIndex:G9,findLast:Z9,findLastIndex:Q9,findLastMap:X9,flap:RZ,flatten:v$,foldLeft:x9,foldMap:$N,foldMapWithIndex:TN,foldRight:k9,fromEither:GA,fromEitherK:GZ,fromOption:HA,fromOptionK:hZ,fromPredicate:C9,getDifferenceMagma:wZ,getEq:EN,getIntersectionSemigroup:OZ,getMonoid:O$,getOrd:TZ,getSemigroup:RN,getShow:$Z,getUnionMonoid:IZ,getUnionSemigroup:CN,guard:WZ,head:P9,init:j9,insertAt:eZ,intercalate:ZZ,intersection:c$,intersperse:sZ,isEmpty:Na,isNonEmpty:Lt,isOutOfBound:Id,last:L9,lefts:oZ,lookup:W9,makeBy:VA,map:m$,mapWithIndex:mN,match:M9,matchLeft:ZA,matchLeftW:YA,matchRight:QA,matchRightW:XA,matchW:JA,modifyAt:nN,of:Wa,partition:gN,partitionMap:yN,partitionMapWithIndex:_$,partitionWithIndex:b$,prepend:O9,prependAll:oN,prependToAll:aX,prependW:w9,range:nX,reduce:IN,reduceRight:ON,reduceRightWithIndex:wN,reduceWithIndex:$$,replicate:E9,reverse:rZ,rights:iZ,rotate:cZ,scanLeft:A9,scanRight:N9,separate:Kc,sequence:Rd,size:F9,snoc:oX,some:LN,sort:aZ,sortBy:fZ,spanLeft:z9,splitAt:aN,tail:D9,takeLeft:q9,takeLeftWhile:B9,takeRight:U9,traverse:tv,traverseWithIndex:T$,unfold:I$,union:s$,uniq:lZ,unsafeDeleteAt:PN,unsafeInsertAt:FN,unsafeUpdateAt:WN,unzip:uZ,updateAt:tZ,wilt:SZ,wither:_Z,zero:Bc,zip:iN,zipWith:rN},Symbol.toStringTag,{value:"Module"})),cX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var lX=function(e){return typeof e=="boolean"},DN=function(e,t){return function(n){return n?t():e()}},jN=DN,qN=jN,fX=qN,UN={equals:function(e,t){return e===t}},dX={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}},BN={concat:function(e,t){return e&&t}},zN={concat:function(e,t){return e||t}},pX={concat:BN.concat,empty:!0},hX={concat:zN.concat,empty:!1},mX={equals:UN.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},vX={show:function(e){return JSON.stringify(e)}};const gX=Object.freeze(Object.defineProperty({__proto__:null,BooleanAlgebra:dX,Eq:UN,MonoidAll:pX,MonoidAny:hX,Ord:mX,SemigroupAll:BN,SemigroupAny:zN,Show:vX,fold:fX,foldW:jN,isBoolean:lX,match:qN,matchW:DN},Symbol.toStringTag,{value:"Module"}));var KN=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}},yX={meet:function(){},join:function(){},zero:void 0,one:void 0,implies:function(){},not:function(){}},bX=KN,_X={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}},SX=zC;const $X=Object.freeze(Object.defineProperty({__proto__:null,booleanAlgebraBoolean:_X,booleanAlgebraVoid:yX,getDualBooleanAlgebra:bX,getFunctionBooleanAlgebra:SX,reverse:KN},Symbol.toStringTag,{value:"Module"}));var TX=function(e){return Px(e)(e.bottom,e.top)},IX=function(e){var t=R_(e);return{equals:t.equals,compare:t.compare,top:e.bottom,bottom:e.top}},OX={equals:om.equals,compare:om.compare,top:1/0,bottom:-1/0};const wX=Object.freeze(Object.defineProperty({__proto__:null,boundedNumber:OX,clamp:TX,reverse:IX},Symbol.toStringTag,{value:"Module"}));function VN(e){return{meet:rm(e),join:im(e)}}const RX=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxDistributiveLattice:VN},Symbol.toStringTag,{value:"Module"}));function EX(e){var t=VN(e);return function(n,r){return{join:t.join,meet:t.meet,zero:n,one:r}}}const CX=Object.freeze(Object.defineProperty({__proto__:null,getMinMaxBoundedDistributiveLattice:EX},Symbol.toStringTag,{value:"Module"})),MX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),xX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),kX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),AX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function k$(e,t){return function(n,r){return t.compose(e.right(r),e.left(n))}}function HN(e,t){var n=k$(e,t);return function(r,i){return t.compose(e.promap(t.id(),function(o){return o._tag==="Left"?o.left:o.right},j),n(r,i))}}function NX(e){return k$(e,e)}function FX(e){return HN(e,e)}const WX=Object.freeze(Object.defineProperty({__proto__:null,fanIn:HN,fanin:FX,split:k$,splitChoice:NX},Symbol.toStringTag,{value:"Module"})),PX=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var LX=function(e,t){return y(e,GN(t))},GN=function(e){return function(t){return V(e,t)}},JN="Predicate",YN=function(){return{concat:function(e,t){return y(e,XN(t))}}},DX=function(){return{concat:YN().concat,empty:HC}},ZN=function(){return{concat:function(e,t){return y(e,QN(t))}}},jX=function(){return{concat:ZN().concat,empty:Bb}},qX={URI:JN,contramap:LX},Ed=function(e){return function(t){return!e(t)}},XN=function(e){return function(t){return function(n){return t(n)||e(n)}}},QN=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const UX=Object.freeze(Object.defineProperty({__proto__:null,Contravariant:qX,URI:JN,and:QN,contramap:GN,getMonoidAll:jX,getMonoidAny:DX,getSemigroupAll:ZN,getSemigroupAny:YN,not:Ed,or:XN},Symbol.toStringTag,{value:"Module"}));var ot=ye,bt=de;function rv(e){return function(t){return e(t)?bt(t):ot}}var iv=function(e){return e._tag==="Right"?ot:bt(e.left)},Cd=function(e){return e._tag==="Left"?ot:bt(e.right)},pr=function(e,t){return y(e,zi(t))},Ku=function(e,t){return y(e,rF(t))},ov=function(e,t){return y(e,xd(t))},av=function(e,t,n){return y(e,oF(t,n))},uv=function(e){var t=aF(e);return function(n,r){return y(n,t(r))}},sv=function(e,t,n){return y(e,uF(t,n))},A$=function(e){var t=mF(e);return function(n,r){return y(n,t(r))}},N$=function(e,t){return y(e,cF(t))},Md=function(e,t){return y(e,fF(t))},F$=function(e,t){return y(e,dF(t))},eF=function(e,t){return y(e,D$(t))},W$=function(e,t){return y(e,pF(t))},P$=function(e,t){return y(e,hF(t))},zt="Option",BX=function(e){return{show:function(t){return je(t)?"none":"some(".concat(e.show(t.value),")")}}},tF=function(e){return{equals:function(t,n){return t===n||(je(t)?je(n):je(n)?!1:e.equals(t.value,n.value))}}},zX=function(e){return{equals:tF(e).equals,compare:function(t,n){return t===n?0:dv(t)?dv(n)?e.compare(t.value,n.value):1:-1}}},L$=function(e){return{concat:function(t,n){return je(t)?n:je(n)?t:bt(e.concat(t.value,n.value))},empty:ot}},zi=function(e){return function(t){return je(t)?ot:bt(e(t.value))}},Vc={URI:zt,map:pr},To=bt,nF={URI:zt,of:To},rF=function(e){return function(t){return je(t)||je(e)?ot:bt(t.value(e.value))}},Hc={URI:zt,map:pr,ap:Ku},iF={URI:zt,map:pr,ap:Ku,of:To},xd=function(e){return function(t){return je(t)?ot:e(t.value)}},kd={URI:zt,map:pr,ap:Ku,chain:ov},KX={URI:zt,map:pr,ap:Ku,of:To,chain:ov},oF=function(e,t){return function(n){return je(n)?e:t(e,n.value)}},aF=function(e){return function(t){return function(n){return je(n)?e.empty:t(n.value)}}},uF=function(e,t){return function(n){return je(n)?e:t(n.value,e)}},VX={URI:zt,reduce:av,foldMap:uv,reduceRight:sv},sF=function(e){return function(t){return je(t)?e():t}},cF=sF,HX={URI:zt,map:pr,alt:N$},cv=function(){return ot},lF={URI:zt,zero:cv},GX=Nc(lF,nF),JX={URI:zt,map:pr,ap:Ku,of:To,alt:N$,zero:cv},D$=function(e){return function(t){return je(t)?ot:bt(e(t))}},YX={URI:zt,map:pr,extend:eF},Gc=xd(j),ZX=Re(ot,ot),Jc=function(e){return je(e)?ZX:Re(iv(e.value),Cd(e.value))},Vu={URI:zt,compact:Gc,separate:Jc},fF=function(e){return function(t){return je(t)?ot:e(t.value)?t:ot}},dF=function(e){return function(t){return je(t)?ot:e(t.value)}},pF=function(e){return function(t){return Re(Md(t,Ed(e)),Md(t,e))}},hF=function(e){return V(zi(e),Jc)},Io={URI:zt,map:pr,compact:Gc,separate:Jc,filter:Md,filterMap:F$,partition:W$,partitionMap:P$},mF=function(e){return function(t){return function(n){return je(n)?e.of(ot):e.map(t(n.value),bt)}}},lv=function(e){return function(t){return je(t)?e.of(ot):e.map(t.value,bt)}},j$={URI:zt,map:pr,reduce:av,foldMap:uv,reduceRight:sv,traverse:A$,sequence:lv},q$=ri(j$,Vu),U$=ni(j$,Vu),XX=function(e){var t=q$(e);return function(n){return function(r){return t(r,n)}}},QX=function(e){var t=U$(e);return function(n){return function(r){return t(r,n)}}},eQ={URI:zt,map:pr,reduce:av,foldMap:uv,reduceRight:sv,traverse:A$,sequence:lv,compact:Gc,separate:Jc,filter:Md,filterMap:F$,partition:W$,partitionMap:P$,wither:q$,wilt:U$},B$=function(){return ot},tQ={URI:zt,map:pr,ap:Ku,of:To,chain:ov,throwError:B$},Yc=Cd,fv={URI:zt,fromEither:Yc},dv=yt,je=function(e){return e._tag==="None"},z$=function(e,t){return function(n){return je(n)?e():t(n.value)}},nQ=z$,Oo=z$,wo=Oo,K$=function(e){return function(t){return je(t)?e():t.value}},V$=K$,rQ=ze(Vc),iQ=wt(Hc),oQ=Rt(Hc),aQ=Gc,uQ=lt(kd),sQ=D$(j),cQ=dr(fv),lQ=yo(fv,kd),fQ=bo(fv,kd),Hu=function(e){return e==null?ot:bt(e)},vF=function(e){try{return bt(e())}catch{return ot}},dQ=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return vF(function(){return e.apply(void 0,t)})}},pQ=function(e){return V(e,Hu)},gF=function(e){return function(t){return je(t)?ot:Hu(e(t.value))}},H$=Oo(GC,j),yF=Oo(zb,j);function bF(e){return function(t,n){if(n===void 0){var r=bF(e);return function(i){return r(t,i)}}return je(n)?!1:e.equals(t,n.value)}}var hQ=function(e){return function(t){return je(t)?!1:e(t.value)}},mQ=To(Jt),vQ=Ct(Vc),gQ=Mt(kd),yQ=Et(Hc),_F=To(an),pv=function(e){return function(t){var n=e(0,fr(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 bt(r)}},G$=function(e){var t=pv(e);return function(n){return vt(n)?t(n):_F}},bQ=G$,SF=function(e){return G$(function(t,n){return e(n)})},_Q=SF(j);function SQ(e){return function(t){return dv(e(t))}}var $Q=gF,$F={URI:zt,map:pr,of:To,ap:Ku,chain:ov,reduce:av,foldMap:uv,reduceRight:sv,traverse:A$,sequence:lv,zero:cv,alt:N$,extend:eF,compact:Gc,separate:Jc,filter:Md,filterMap:F$,partition:W$,partitionMap:P$,wither:q$,wilt:U$,throwError:B$},TQ=Yt(Hc),IQ=Nr(iF),TF=function(){return L$(N_())},OQ=function(){return L$(sm())};const wQ=Object.freeze(Object.defineProperty({__proto__:null,Alt:HX,Alternative:JX,ApT:_F,Applicative:iF,Apply:Hc,Chain:kd,Compactable:Vu,Do:mQ,Extend:YX,Filterable:Io,Foldable:VX,FromEither:fv,Functor:Vc,Monad:KX,MonadThrow:tQ,Pointed:nF,Traversable:j$,URI:zt,Witherable:eQ,Zero:lF,alt:cF,altW:sF,ap:rF,apFirst:iQ,apS:yQ,apSecond:oQ,bind:gQ,bindTo:vQ,chain:xd,chainEitherK:lQ,chainFirst:uQ,chainFirstEitherK:fQ,chainNullableK:gF,compact:Gc,duplicate:sQ,elem:bF,exists:hQ,extend:D$,filter:fF,filterMap:dF,flap:rQ,flatten:aQ,fold:wo,foldMap:aF,foldW:nQ,fromEither:Yc,fromEitherK:cQ,fromNullable:Hu,fromNullableK:pQ,fromPredicate:rv,getApplyMonoid:IQ,getApplySemigroup:TQ,getEq:tF,getFirstMonoid:TF,getLastMonoid:OQ,getLeft:iv,getMonoid:L$,getOrElse:V$,getOrElseW:K$,getOrd:zX,getRefinement:SQ,getRight:Cd,getShow:BX,guard:GX,isNone:je,isSome:dv,map:zi,mapNullable:$Q,match:Oo,matchW:z$,none:ot,of:To,option:$F,partition:pF,partitionMap:hF,reduce:oF,reduceRight:uF,separate:Jc,sequence:lv,sequenceArray:_Q,some:bt,throwError:B$,toNullable:H$,toUndefined:yF,traverse:mF,traverseArray:SF,traverseArrayWithIndex:bQ,traverseReadonlyArrayWithIndex:G$,traverseReadonlyNonEmptyArrayWithIndex:pv,tryCatch:vF,tryCatchK:dQ,wilt:QX,wither:XX,zero:cv},Symbol.toStringTag,{value:"Module"}));function Ki(e,t){return function(n){return e.map(n,t.compact)}}function Ro(e,t,n){var r=Ki(e,t),i=bc(e,n);return function(o){return Re(r(y(o,i(iv))),r(y(o,i(Cd))))}}function RQ(e,t){var n=_c(e,t).map;return{map:n,compact:Ki(e,t),separate:Ro(e,t,t)}}const EQ=Object.freeze(Object.defineProperty({__proto__:null,compact:Ki,getCompactableComposition:RQ,separate:Ro},Symbol.toStringTag,{value:"Module"}));var CQ=function(e){return function(){return console.log(e)}},MQ=function(e){return function(){return console.warn(e)}},xQ=function(e){return function(){return console.error(e)}},kQ=function(e){return function(){return console.info(e)}};const AQ=Object.freeze(Object.defineProperty({__proto__:null,error:xQ,info:kQ,log:CQ,warn:MQ},Symbol.toStringTag,{value:"Module"}));var Zc=gc;function NQ(e){return{show:function(t){return"make(".concat(e.show(t),")")}}}var FQ=j,WQ=j,PQ=j,LQ=j,DQ=j,jQ=j,qQ=j,UQ=j,BQ=j;function IF(e){return{URI:Gu,_E:void 0,map:J$,ap:function(t,n){return Zc(e.concat(t,n))}}}function OF(e){var t=IF(e);return{URI:Gu,_E:void 0,map:t.map,ap:t.ap,of:function(){return Zc(e.empty)}}}var wF=function(e,t){return y(e,CF())},J$=function(e,t){return y(e,MF())},RF=function(e,t,n){return y(e,xF(t))},EF=function(e,t){return y(e,kF(t))},CF=function(){return gc},MF=function(){return gc},xF=function(e){return function(t){return Zc(e(t))}},kF=function(e){return function(t){return Zc(e(t))}},Gu="Const",AF={URI:Gu,map:J$},zQ=ze(AF),KQ={URI:Gu,contramap:wF},VQ={URI:Gu,bimap:RF,mapLeft:EF},HQ={URI:Gu,map:J$,contramap:wF,bimap:RF,mapLeft:EF};const GQ=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:VQ,Contravariant:KQ,Functor:AF,URI:Gu,bimap:xF,const_:HQ,contramap:CF,flap:zQ,getApplicative:OF,getApply:IF,getBooleanAlgebra:BQ,getBounded:PQ,getEq:FQ,getHeytingAlgebra:UQ,getMonoid:DQ,getOrd:WQ,getRing:qQ,getSemigroup:LQ,getSemiring:jQ,getShow:NQ,make:Zc,map:MF,mapLeft:kF},Symbol.toStringTag,{value:"Module"})),JQ=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var YQ={equals:function(e,t){return e.valueOf()===t.valueOf()}},ZQ={equals:function(e,t){return e.getDate()===t.getDate()}},XQ={equals:function(e,t){return e.getMonth()===t.getMonth()}},QQ={equals:function(e,t){return e.getFullYear()===t.getFullYear()}},eee=y(km,nm(function(e){return e.valueOf()})),tee=function(){return new Date},nee=function(){return new Date().getTime()};const ree=Object.freeze(Object.defineProperty({__proto__:null,Eq:YQ,Ord:eee,create:tee,eqDate:ZQ,eqMonth:XQ,eqYear:QQ,now:nee},Symbol.toStringTag,{value:"Module"}));function Ju(e){return V(Ge,e.of)}function Xc(e){return V($t,e.of)}function Qc(e){return function(t){return e.map(t,Ge)}}function el(e){return function(t){return e.map(t,$t)}}function hv(e){return function(t){return V(l_(t),e.of)}}function mv(e){var t=hv(e);return function(n){var r=t(n);return function(i){return V(i,r)}}}function Y$(e){var t=Yu(e),n=mv(e);return function(r){var i=n(r);return function(o){return t(i(o))}}}function tl(e){return bc(e,Ra)}function nl(e){return go(e,Tc)}function Yu(e){return function(t){return function(n){return e.chain(n,function(r){return se(r)?e.of(r):t(r.right)})}}}function rl(e){return function(t){return function(n){return e.chain(n,function(r){return se(r)?t():e.of(r)})}}}function il(e){return function(t,n){return function(r){return e.map(r,i_(t,n))}}}function ol(e){return function(t){return function(n){return e.map(n,Jf(t))}}}function Ad(e,t){return function(n){return function(r){return e.chain(r,Ea(function(i){return e.map(n(),Jf(function(o){return t.concat(i,o)}))},Ju(e)))}}}function Nd(e){return function(t,n){return function(r){return e.map(r,Ea(t,n))}}}function al(e){return function(t,n){return function(r){return e.chain(r,Ea(t,n))}}}function ul(e){return function(t){return function(n){return e.chain(n,Ea(t,e.of))}}}function Zu(e){return function(t){return function(n){return e.chain(n,function(r){return se(r)?t(r.left):e.of(r)})}}}function Fd(e){var t=Zu(e);return function(n){return t(function(r){return e.map(n(r),function(i){return se(i)?i:$t(r)})})}}function Wd(e){return function(t){return function(n){return e.chain(n,Ea(function(r){return e.map(t(r),$t)},function(r){return e.of(Ge(r))}))}}}function sl(e){return function(t){return e.map(t,_M)}}function Pd(e){return function(t){return e.map(t,IM)}}function iee(e){var t=nl(e),n=tl(e),r=Yu(e),i=rl(e),o=il(e),a=ol(e),u=al(e),s=ul(e),c=Zu(e);return{map:function(l,f){return y(l,n(f))},ap:function(l,f){return y(l,t(f))},of:Ju(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:sl(e),rightM:Qc(e),leftM:el(e),left:Xc(e)}}const oee=Object.freeze(Object.defineProperty({__proto__:null,alt:rl,altValidation:Ad,ap:nl,bimap:il,chain:Yu,chainNullableK:Y$,fromNullable:hv,fromNullableK:mv,getEitherM:iee,getOrElse:ul,left:Xc,leftF:el,map:tl,mapLeft:ol,match:Nd,matchE:al,orElse:Zu,orElseFirst:Fd,orLeft:Wd,right:Ju,rightF:Qc,swap:sl,toUnion:Pd},Symbol.toStringTag,{value:"Module"}));var aee="Endomorphism",NF=function(){return{concat:function(e,t){return V(e,t)}}},FF=function(){return{concat:NF().concat,empty:j}};const uee=Object.freeze(Object.defineProperty({__proto__:null,URI:aee,getMonoid:FF,getSemigroup:NF},Symbol.toStringTag,{value:"Module"})),see=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function WF(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 cee(e,t){var n=t.zero,r=WF(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 lee={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 fee=Object.freeze(Object.defineProperty({__proto__:null,fieldNumber:lee,gcd:WF,lcm:cee},Symbol.toStringTag,{value:"Module"}));function Eo(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filter(i,n)})}}}function Co(e,t){return function(n){return function(r){return e.map(r,function(i){return t.filterMap(i,n)})}}}function Pa(e,t){var n=Eo(e,t);return function(r){var i=n(Ed(r)),o=n(r);return function(a){return Re(i(a),o(a))}}}function La(e,t){var n=Co(e,t);return function(r){return function(i){return Re(y(i,n(function(o){return iv(r(o))})),y(i,n(function(o){return Cd(r(o))})))}}}function dee(e,t){var n=_c(e,t).map,r=Ki(e,t),i=Ro(e,t,t),o=Eo(e,t),a=Co(e,t),u=Pa(e,t),s=La(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 pee=Object.freeze(Object.defineProperty({__proto__:null,filter:Eo,filterMap:Co,getFilterableComposition:dee,partition:Pa,partitionMap:La},Symbol.toStringTag,{value:"Module"})),hee=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function PF(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 DF(e,t){return function(n,r){return function(i){return e.reduceRight(i,n,function(o,a){return t.reduceRight(o,a,r)})}}}function mee(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 vee(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 jF(e){return function(t){return e.reduce(t,[],function(n,r){return n.push(r),n})}}function gee(e,t){var n=function(i,o){return e.ap(e.map(i,Vn),o)},r=e.of(void 0);return function(i,o){return t.reduce(i,r,function(a,u){return n(a,o(u))})}}function yee(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 bee=jF;function Z$(e,t){var n=PF(e,t),r=LF(e,t),i=DF(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 _ee=Object.freeze(Object.defineProperty({__proto__:null,foldM:yee,foldMap:LF,getFoldableComposition:Z$,intercalate:vee,reduce:PF,reduceM:mee,reduceRight:DF,toArray:bee,toReadonlyArray:jF,traverse_:gee},Symbol.toStringTag,{value:"Module"}));function qF(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 UF(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 BF(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 See(e,t){var n=Z$(e,t),r=qF(e,t),i=UF(e,t),o=BF(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 $ee=Object.freeze(Object.defineProperty({__proto__:null,foldMapWithIndex:UF,getFoldableWithIndexComposition:See,reduceRightWithIndex:BF,reduceWithIndex:qF},Symbol.toStringTag,{value:"Module"}));function Vi(e){return function(t){return V(t,e.fromIO)}}function Mo(e,t){return function(n){var r=V(n,e.fromIO);return function(i){return t.chain(i,r)}}}function xo(e,t){var n=lt(t);return function(r){return n(V(r,e.fromIO))}}const Tee=Object.freeze(Object.defineProperty({__proto__:null,chainFirstIOK:xo,chainIOK:Mo,fromIOK:Vi},Symbol.toStringTag,{value:"Module"}));var zF=function(){return j},Iee=j,Ld=function(e){return function(t){return function(n){return t(e(n))}}},Dd=function(e){return function(t){return e(t)(t)}},Oee=Dd,ko=function(e,t){return y(e,Xu(t))},jd=function(e,t){return y(e,HF(t))},X$=function(e,t){return y(e,GF(t))},KF=function(e,t){return y(e,YF(t))},vv=function(e,t,n){return y(e,ZF(t,n))},Xu=function(e){return function(t){return function(n){return e(t(n))}}},VF=function(e){return function(t){return function(n){return t(n)(e(n))}}},HF=VF,Hi=Vn,Q$=function(e){return function(t){return function(n){return e(t(n))(n)}}},GF=Q$,JF=Q$(j),wee=JF,YF=function(e){return function(t){return V(e,t)}},ZF=function(e,t){return function(n){return function(r){return t(n(e(r)))}}},eT=function(){return j},tT=function(e){return function(t){var n=t[0],r=t[1];return[e(n),r]}},nT=function(e){return function(t){var n=t[0],r=t[1];return[n,e(r)]}},rT=function(e){return s_(function(t){return vo(e(t))},Ge)},iT=function(e){return s_($t,function(t){return Ia(e(t))})},Lr="Reader",cn={URI:Lr,map:ko},Ree=ze(cn),oT={URI:Lr,of:Hi},Ao={URI:Lr,map:ko,ap:jd},XF=wt(Ao),Eee=XF,QF=Rt(Ao),Cee=QF,eW={URI:Lr,map:ko,ap:jd,of:Hi},aT={URI:Lr,map:ko,ap:jd,chain:X$},No={URI:Lr,map:ko,of:Hi,ap:jd,chain:X$},tW=lt(aT),Mee=tW,xee={URI:Lr,map:ko,promap:vv},kee={URI:Lr,compose:KF,id:eT},Aee={URI:Lr,map:ko,promap:vv,first:tT,second:nT},Nee={URI:Lr,map:ko,promap:vv,left:rT,right:iT},Fee=Ct(cn),nW=Mt(aT),Wee=nW,Pee=Hi(Jt),rW=Et(Ao),Lee=rW,iW=Hi(an),Qu=function(e){return function(t){return function(n){for(var r=[e(0,fr(t))(n)],i=1;i<t.length;i++)r.push(e(i,t[i])(n));return r}}},uT=function(e){var t=Qu(e);return function(n){return vt(n)?t(n):iW}},Dee=uT,oW=function(e){return uT(function(t,n){return e(n)})},jee=oW(j),qee={URI:Lr,map:ko,of:Hi,ap:jd,chain:X$,promap:vv,compose:KF,id:eT,first:tT,second:nT,left:rT,right:iT},Uee=Yt(Ao),Bee=Nr(eW);const zee=Object.freeze(Object.defineProperty({__proto__:null,ApT:iW,Applicative:eW,Apply:Ao,Category:kee,Chain:aT,Choice:Nee,Do:Pee,Functor:cn,Monad:No,Pointed:oT,Profunctor:xee,Strong:Aee,URI:Lr,ap:HF,apFirst:XF,apFirstW:Eee,apS:rW,apSW:Lee,apSecond:QF,apSecondW:Cee,apW:VF,ask:zF,asks:Iee,asksReader:Oee,asksReaderW:Dd,bind:nW,bindTo:Fee,bindW:Wee,chain:GF,chainFirst:tW,chainFirstW:Mee,chainW:Q$,compose:YF,first:tT,flap:Ree,flatten:wee,flattenW:JF,getMonoid:Bee,getSemigroup:Uee,id:eT,left:rT,local:Ld,map:Xu,of:Hi,promap:ZF,reader:qee,right:iT,second:nT,sequenceArray:jee,traverseArray:oW,traverseArrayWithIndex:Dee,traverseReadonlyArrayWithIndex:uT,traverseReadonlyNonEmptyArrayWithIndex:Qu},Symbol.toStringTag,{value:"Module"}));function qd(e){return function(){return e.fromReader(zF())}}function Ud(e){return e.fromReader}function es(e){return function(t){return V(t,e.fromReader)}}function Bd(e,t){var n=es(e);return function(r){return function(i){return t.chain(i,n(r))}}}function zd(e,t){return V(es(e),lt(t))}const Kee=Object.freeze(Object.defineProperty({__proto__:null,ask:qd,asks:Ud,chainFirstReaderK:zd,chainReaderK:Bd,fromReaderK:es},Symbol.toStringTag,{value:"Module"}));var aW=function(){return function(e){return[e,e]}},uW=function(e){return function(){return[void 0,e]}},sW=function(e){return function(t){return[void 0,e(t)]}},cW=function(e){return function(t){return[e(t),t]}},Kd=function(e,t){return y(e,fW(t))},gv=function(e,t){return y(e,dW(t))},lW=function(e,t){return y(e,sT(t))},fW=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return[e(i),o]}}},dW=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]}}},Vd=function(e){return function(t){return[e,t]}},sT=function(e){return function(t){return function(n){var r=t(n),i=r[0],o=r[1];return e(i)(o)}}},Vee=sT(j),Da="State",cT={URI:Da,map:Kd},Hee=ze(cT),Gee={URI:Da,of:Vd},yv={URI:Da,map:Kd,ap:gv},Jee=wt(yv),Yee=Rt(yv),Zee={URI:Da,map:Kd,ap:gv,of:Vd},lT={URI:Da,map:Kd,ap:gv,chain:lW},pW={URI:Da,map:Kd,ap:gv,of:Vd,chain:lW},Xee=lt(lT),Qee={URI:Da,fromState:j},ete=function(e){return function(t){return t(e)[0]}},tte=function(e){return function(t){return t(e)[1]}},nte=Ct(cT),rte=Mt(lT),ite=Et(yv),hW=function(e){return function(t){return function(n){for(var r=e(0,fr(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]}}},fT=function(e){var t=hW(e);return function(n){return vt(n)?t(n):Vd(an)}},ote=fT,mW=function(e){return fT(function(t,n){return e(n)})},ate=mW(j),ute=function(e,t){return e(t)[0]},ste=function(e,t){return e(t)[1]},cte=pW;const lte=Object.freeze(Object.defineProperty({__proto__:null,Applicative:Zee,Apply:yv,Chain:lT,FromState:Qee,Functor:cT,Monad:pW,Pointed:Gee,URI:Da,ap:dW,apFirst:Jee,apS:ite,apSecond:Yee,bind:rte,bindTo:nte,chain:sT,chainFirst:Xee,evalState:ute,evaluate:ete,execState:ste,execute:tte,flap:Hee,flatten:Vee,get:aW,gets:cW,map:fW,modify:sW,of:Vd,put:uW,sequenceArray:ate,state:cte,traverseArray:mW,traverseArrayWithIndex:ote,traverseReadonlyArrayWithIndex:fT,traverseReadonlyNonEmptyArrayWithIndex:hW},Symbol.toStringTag,{value:"Module"}));function vW(e){return function(){return e.fromState(aW())}}function gW(e){return function(t){return e.fromState(uW(t))}}function yW(e){return V(sW,e.fromState)}function bW(e){return V(cW,e.fromState)}function dT(e){return function(t){return V(t,e.fromState)}}function _W(e,t){var n=dT(e);return function(r){return function(i){return t.chain(i,n(r))}}}const fte=Object.freeze(Object.defineProperty({__proto__:null,chainStateK:_W,fromStateK:dT,get:vW,gets:bW,modify:yW,put:gW},Symbol.toStringTag,{value:"Module"}));function ts(e){return function(t){return V(t,e.fromTask)}}function cl(e,t){return function(n){var r=V(n,e.fromTask);return function(i){return t.chain(i,r)}}}function ll(e,t){var n=lt(t);return function(r){return n(V(r,e.fromTask))}}const dte=Object.freeze(Object.defineProperty({__proto__:null,chainFirstTaskK:ll,chainTaskK:cl,fromTaskK:ts},Symbol.toStringTag,{value:"Module"}));function SW(e){return function(t){return V(t,e.fromThese)}}const pte=Object.freeze(Object.defineProperty({__proto__:null,fromTheseK:SW},Symbol.toStringTag,{value:"Module"}));function $W(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 hte(e,t){var n=_c(e,t).map,r=$W(e,t);return{map:n,mapWithIndex:function(i,o){return y(i,r(o))}}}const mte=Object.freeze(Object.defineProperty({__proto__:null,getFunctorWithIndexComposition:hte,mapWithIndex:$W},Symbol.toStringTag,{value:"Module"})),vte=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),gte=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),yte=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Gi=function(e,t){return y(e,RW(t))},fl=function(e,t){return y(e,EW(t))},bv=function(e,t){return y(e,vT(t))},pT=function(e,t,n){return y(e,CW(t,n))},hT=function(e){return function(t,n){return y(t,MW()(n))}},mT=function(e,t,n){return y(e,xW(t,n))},TW=function(e,t){return y(e,NW())},IW=function(e,t){return y(e,gT(t))},OW=function(e){var t=kW(e);return function(n,r){return y(n,t(r))}},wW=Gb,RW=function(e){return function(t){return e(t)}},EW=function(e){return function(t){return t(e)}},dl=j,vT=function(e){return function(t){return e(t)}},gT=function(e){return function(t){return e(t)}},yT=j,bte=gT(j),_te=vT(j),CW=function(e,t){return function(n){return t(e,n)}},MW=function(){return function(e){return function(t){return e(t)}}},xW=function(e,t){return function(n){return t(n,e)}},kW=function(e){return function(t){return function(n){return e.map(t(n),j)}}},bT=function(e){return function(t){return e.map(t,j)}},AW=function(){return j},NW=AW,hr="Identity",Ste=j,$te=j,_T={URI:hr,map:Gi},Tte=ze(_T),Ite={URI:hr,of:dl},_v={URI:hr,map:Gi,ap:fl},Ote=wt(_v),wte=Rt(_v),Rte={URI:hr,map:Gi,ap:fl,of:dl},ST={URI:hr,map:Gi,ap:fl,chain:bv},Ete={URI:hr,map:Gi,ap:fl,of:dl,chain:bv},Cte=lt(ST),Mte={URI:hr,reduce:pT,foldMap:hT,reduceRight:mT},xte={URI:hr,map:Gi,reduce:pT,foldMap:hT,reduceRight:mT,traverse:OW,sequence:bT},kte={URI:hr,map:Gi,alt:TW},Ate={URI:hr,map:Gi,extend:IW,extract:yT},Nte={URI:hr,map:Gi,ap:fl,chain:bv,chainRec:wW},Fte=dl(Jt),Wte=Ct(_T),Pte=Mt(ST),Lte=Et(_v),Dte={URI:hr,map:Gi,ap:fl,of:dl,chain:bv,reduce:pT,foldMap:hT,reduceRight:mT,traverse:OW,sequence:bT,alt:TW,extract:yT,extend:IW,chainRec:wW};const jte=Object.freeze(Object.defineProperty({__proto__:null,Alt:kte,Applicative:Rte,Apply:_v,Chain:ST,ChainRec:Nte,Comonad:Ate,Do:Fte,Foldable:Mte,Functor:_T,Monad:Ete,Pointed:Ite,Traversable:xte,URI:hr,alt:NW,altW:AW,ap:EW,apFirst:Ote,apS:Lte,apSecond:wte,bind:Pte,bindTo:Wte,chain:vT,chainFirst:Cte,duplicate:bte,extend:gT,extract:yT,flap:Tte,flatten:_te,foldMap:MW,getEq:$te,getShow:Ste,identity:Dte,map:RW,of:dl,reduce:CW,reduceRight:xW,sequence:bT,traverse:kW},Symbol.toStringTag,{value:"Module"})),qte=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Fo=function(e,t){return function(){return t(e())}},ja=function(e,t){return function(){return e()(t())}},pl=function(e,t){return function(){return t(e())()}},FW=function(e,t){return function(){for(var n=t(e)();n._tag==="Left";)n=t(n.left)();return n.right}},Ji=function(e){return function(t){return Fo(t,e)}},Ute=function(e){return function(t){return ja(t,e)}},di=Vn,$T=function(e){return function(t){return pl(t,e)}},Bte=$T(j),pi="IO",ut={URI:pi,map:Fo},zte=ze(ut),Yi={URI:pi,of:di},Wo={URI:pi,map:Fo,ap:ja},Kte=wt(Wo),Vte=Rt(Wo),WW={URI:pi,map:Fo,ap:ja,of:di},Sv={URI:pi,map:Fo,ap:ja,chain:pl},Jn={URI:pi,map:Fo,ap:ja,of:di,chain:pl},Hte=lt(Sv),TT=j,Gte={URI:pi,map:Fo,ap:ja,of:di,chain:pl,fromIO:TT},Jte={URI:pi,map:Fo,ap:ja,chain:pl,chainRec:FW},Yte={URI:pi,fromIO:j},Zte=di(Jt),Xte=Ct(ut),Qte=Mt(Sv),ene=Et(Wo),PW=di(an),$v=function(e){return function(t){return function(){for(var n=[e(0,fr(t))()],r=1;r<t.length;r++)n.push(e(r,t[r])());return n}}},IT=function(e){var t=$v(e);return function(n){return vt(n)?t(n):PW}},tne=IT,LW=function(e){return IT(function(t,n){return e(n)})},nne=LW(j),rne={URI:pi,map:Fo,of:di,ap:ja,chain:pl,fromIO:TT,chainRec:FW},ine=Yt(Wo),one=Nr(WW);const ane=Object.freeze(Object.defineProperty({__proto__:null,ApT:PW,Applicative:WW,Apply:Wo,Chain:Sv,ChainRec:Jte,Do:Zte,FromIO:Yte,Functor:ut,Monad:Jn,MonadIO:Gte,Pointed:Yi,URI:pi,ap:Ute,apFirst:Kte,apS:ene,apSecond:Vte,bind:Qte,bindTo:Xte,chain:$T,chainFirst:Hte,flap:zte,flatten:Bte,fromIO:TT,getMonoid:one,getSemigroup:ine,io:rne,map:Ji,of:di,sequenceArray:nne,traverseArray:LW,traverseArrayWithIndex:tne,traverseReadonlyArrayWithIndex:IT,traverseReadonlyNonEmptyArrayWithIndex:$v},Symbol.toStringTag,{value:"Module"}));var DW=Xc(Yi),jW=Ju(Yi),qW=Qc(ut),une=el(ut),UW=di,Hd=qW,BW=Nd(ut),sne=BW,OT=al(Jn),cne=OT,zW=OT,lne=zW,KW=ul(Jn),fne=KW,VW=function(e,t){return function(){return Pu(e,t)}},dne=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return VW(function(){return e.apply(void 0,n)},t)}},pne=Pd(ut),HW=Zu(Jn),hne=HW,wT=Fd(Jn),mne=wT,vne=function(e){return wT(iP(e))},gne=Wd(Jn),yne=sl(ut),Yn=function(e,t){return y(e,CT(t))},ns=function(e,t){return y(e,MT(t))},bne=function(e,t){return y(e,Tv(function(n){return y(t,CT(n))}))},hl=function(e,t){return y(e,Tv(t))},RT=function(e,t,n){return y(e,JW(t,n))},ET=function(e,t){return y(e,YW(t))},GW=function(e,t){return y(e,xT(t))},CT=tl(ut),JW=il(ut),YW=ol(ut),MT=nl(Wo),_ne=MT,Dr=jW,Tv=Yu(Jn),Iv=Tv,ZW=Iv(j),Sne=ZW,xT=rl(Jn),$ne=xT,Ov=DW,Dt="IOEither";function XW(e){var t=go(Wo,wa(e));return{URI:Dt,_E:void 0,map:Yn,ap:function(n,r){return y(n,t(r))},of:Dr}}function QW(e){var t=Ad(Jn,e);return{URI:Dt,_E:void 0,map:Yn,alt:function(n,r){return y(n,t(r))}}}var eP=function(e){var t=Fu(e);return{URI:Dt,_E:void 0,compact:Ki(ut,t),separate:Ro(ut,t,Ra)}};function Tne(e){var t=$c(e),n=eP(e),r=Eo(ut,t),i=Co(ut,t),o=Pa(ut,t),a=La(ut,t);return{URI:Dt,_E:void 0,map:Yn,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 kT={URI:Dt,map:Yn},Ine=ze(kT),One={URI:Dt,of:Dr},wne={URI:Dt,bimap:RT,mapLeft:ET},Gd={URI:Dt,map:Yn,ap:ns},tP=wt(Gd),Rne=tP,nP=Rt(Gd),Ene=nP,AT={URI:Dt,map:Yn,ap:ns,of:Dr},Cne={URI:Dt,map:Yn,ap:bne,of:Dr},Po={URI:Dt,map:Yn,ap:ns,chain:hl},Mne={URI:Dt,map:Yn,ap:ns,of:Dr,chain:hl},rP=lt(Po),xne=rP,kne={URI:Dt,map:Yn,alt:GW},Ane={URI:Dt,map:Yn,ap:ns,of:Dr,chain:hl,fromIO:Hd},Nne={URI:Dt,map:Yn,ap:ns,of:Dr,chain:hl,throwError:Ov},wv={URI:Dt,fromIO:Hd},iP=Vi(wv),Fne=Mo(wv,Po),Wne=xo(wv,Po),Lo={URI:Dt,fromEither:UW},Pne=Li(Lo),Lne=Di(Lo),Dne=ku(Lo,Po),oP=yo(Lo,Po),jne=oP,aP=bo(Lo,Po),qne=aP,Une=Oa(Lo),uP=Au(Lo,Po),Bne=uP,zne=dr(Lo),Kne=function(e,t,n){return sP(e,t,n)},sP=function(e,t,n){return y(e,Iv(function(r){return y(t(r),$T(function(i){return y(n(r,i),Iv(function(){return di(i)}))}))}))},Vne=Dr(Jt),Hne=Ct(kT),cP=Mt(Po),Gne=cP,lP=Et(Gd),Jne=lP,NT=Dr(an),fP=function(e){return V($v(e),Ji(Yf(Hn)))},FT=function(e){var t=fP(e);return function(n){return vt(n)?t(n):NT}},dP=function(e){return function(t){return function(){var n=e(0,fr(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 Ia(r)}}},WT=function(e){var t=dP(e);return function(n){return vt(n)?t(n):NT}},Yne=FT,pP=function(e){return FT(function(t,n){return e(n)})},Zne=pP(j),Xne=WT,hP=function(e){return WT(function(t,n){return e(n)})},Qne=hP(j),ere=AT,tre={URI:Dt,bimap:RT,mapLeft:ET,map:Yn,of:Dr,ap:ns,chain:hl,alt:GW,fromIO:Hd,throwError:Ov},nre=Yt(Gd),rre=Nr(AT),ire=function(e){return Yt(Wo)(Vf(e))};function ore(e){var t=XW(e),n=QW(e);return{URI:Dt,_E:void 0,map:Yn,ap:t.ap,of:Dr,chain:hl,bimap:RT,mapLeft:ET,alt:n.alt,fromIO:Hd,throwError:Ov}}const are=Object.freeze(Object.defineProperty({__proto__:null,Alt:kne,ApT:NT,Applicative:ere,ApplicativePar:AT,ApplicativeSeq:Cne,ApplyPar:Gd,Bifunctor:wne,Chain:Po,Do:Vne,FromEither:Lo,FromIO:wv,Functor:kT,Monad:Mne,MonadIO:Ane,MonadThrow:Nne,Pointed:One,URI:Dt,alt:xT,altW:$ne,ap:MT,apFirst:tP,apFirstW:Rne,apS:lP,apSW:Jne,apSecond:nP,apSecondW:Ene,apW:_ne,bimap:JW,bind:cP,bindTo:Hne,bindW:Gne,bracket:Kne,bracketW:sP,chain:Tv,chainEitherK:oP,chainEitherKW:jne,chainFirst:rP,chainFirstEitherK:aP,chainFirstEitherKW:qne,chainFirstIOK:Wne,chainFirstW:xne,chainIOK:Fne,chainOptionK:Dne,chainW:Iv,filterOrElse:uP,filterOrElseW:Bne,flap:Ine,flatten:Sne,flattenW:ZW,fold:cne,foldW:lne,fromEither:UW,fromEitherK:zne,fromIO:Hd,fromIOK:iP,fromOption:Pne,fromOptionK:Lne,fromPredicate:Une,getAltIOValidation:QW,getApplicativeIOValidation:XW,getApplyMonoid:rre,getApplySemigroup:nre,getCompactable:eP,getFilterable:Tne,getIOValidation:ore,getOrElse:KW,getOrElseW:fne,getSemigroup:ire,ioEither:tre,left:DW,leftIO:une,map:CT,mapLeft:YW,match:BW,matchE:OT,matchEW:zW,matchW:sne,of:Dr,orElse:HW,orElseFirst:wT,orElseFirstIOK:vne,orElseFirstW:mne,orElseW:hne,orLeft:gne,right:jW,rightIO:qW,sequenceArray:Zne,sequenceSeqArray:Qne,swap:yne,throwError:Ov,toUnion:pne,traverseArray:pP,traverseArrayWithIndex:Yne,traverseReadonlyArrayWithIndex:FT,traverseReadonlyArrayWithIndexSeq:WT,traverseReadonlyNonEmptyArrayWithIndex:fP,traverseReadonlyNonEmptyArrayWithIndexSeq:dP,traverseSeqArray:hP,traverseSeqArrayWithIndex:Xne,tryCatch:VW,tryCatchK:dne},Symbol.toStringTag,{value:"Module"}));function Jd(e){return V(bt,e.of)}function Yd(e){return Vn(e.of(ot))}function Rv(e){return function(t){return e.map(t,bt)}}function Ev(e){return V(Hu,e.of)}function Cv(e){var t=Ev(e);return function(n){return V(n,t)}}function PT(e){var t=ml(e),n=Cv(e);return function(r){return t(n(r))}}function Mv(e){return function(t){return V(t,e.of)}}function LT(e){var t=ml(e),n=Mv(e);return function(r){return t(n(r))}}function DT(e){return function(t){return function(n){return e.of(rv(t)(n))}}}function jT(e){return V(Yc,e.of)}function qT(e){return function(t,n){return function(r){return e.map(r,Oo(t,n))}}}function xv(e){return function(t,n){return function(r){return e.chain(r,Oo(t,n))}}}function kv(e){return function(t){return function(n){return e.chain(n,Oo(t,e.of))}}}function Av(e){return bc(e,Vc)}function Nv(e){return go(e,Hc)}function ml(e){var t=Yd(e);return function(n){return function(r){return e.chain(r,Oo(function(){return t()},n))}}}function Fv(e){var t=Jd(e);return function(n){return function(r){return e.chain(r,Oo(n,t))}}}function ure(e){var t=Nv(e),n=Av(e),r=ml(e),i=Fv(e),o=xv(e),a=kv(e),u=Yd(e);return{map:function(s,c){return y(s,n(c))},ap:function(s,c){return y(s,t(c))},of:Jd(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:Rv(e),none:function(){return u()}}}const sre=Object.freeze(Object.defineProperty({__proto__:null,alt:Fv,ap:Nv,chain:ml,chainNullableK:PT,chainOptionK:LT,fromEither:jT,fromF:Rv,fromNullable:Ev,fromNullableK:Cv,fromOptionK:Mv,fromPredicate:DT,getOptionM:ure,getOrElse:kv,map:Av,match:qT,matchE:xv,some:Jd,zero:Yd},Symbol.toStringTag,{value:"Module"}));var mP=Jd(Yi),cre=DT(Yi),lre=di,vP=jT(Yi),UT=Rv(ut),fre=Ji(Yc),gP=qT(ut),dre=gP,BT=xv(Sv),pre=BT,hre=BT,yP=kv(Jn),mre=yP,vre=Ji(yF),gre=Ji(H$),yre=Ev(Yi),bre=Cv(Yi),_re=PT(Jn),Sre=Mv(Yi),$re=LT(Jn),bP=Av(ut),_P=Nv(Wo),qa=mP,zT=ml(Jn),Tre=zT(j),KT=Fv(Jn),Ire=KT,Wv=Yd(Yi),Ore=Wv(),VT=Ki(ut,Vu),HT=Ro(ut,Vu,Vc),SP=Eo(ut,Io),$P=Co(ut,Io),TP=Pa(ut,Io),IP=La(ut,Io),Do=function(e,t){return y(e,bP(t))},vl=function(e,t){return y(e,_P(t))},GT=function(e,t){return y(e,zT(t))},OP=function(e,t){return y(e,KT(t))},wre=function(e,t){return y(e,SP(t))},Rre=function(e,t){return y(e,$P(t))},Ere=function(e,t){return y(e,TP(t))},Cre=function(e,t){return y(e,IP(t))},Zn="IOOption",JT={URI:Zn,map:Do},Mre=ze(JT),wP={URI:Zn,of:qa},Pv={URI:Zn,map:Do,ap:vl},xre=wt(Pv),kre=Rt(Pv),Are={URI:Zn,map:Do,ap:vl,of:qa},rs={URI:Zn,map:Do,ap:vl,chain:GT},Nre=lt(rs),Fre={URI:Zn,map:Do,alt:OP},RP={URI:Zn,zero:Wv},Wre=Nc(RP,wP),Pre={URI:Zn,map:Do,ap:vl,of:qa,alt:OP,zero:Wv},Lre={URI:Zn,map:Do,ap:vl,of:qa,chain:GT},Dre={URI:Zn,map:Do,ap:vl,of:qa,chain:GT,fromIO:UT},jre={URI:Zn,compact:VT,separate:HT},qre={URI:Zn,map:Do,compact:VT,separate:HT,filter:wre,filterMap:Rre,partition:Ere,partitionMap:Cre},Lv={URI:Zn,fromIO:UT},Ure=Vi(Lv),Bre=Mo(Lv,rs),zre=xo(Lv,rs),Dv={URI:Zn,fromEither:vP},Kre=dr(Dv),Vre=yo(Dv,rs),Hre=bo(Dv,rs),Gre=qa(Jt),Jre=Ct(JT),Yre=Mt(rs),Zre=Et(Pv),EP=qa(an),CP=function(e){return V($v(e),Ji(pv(Hn)))},Xre=function(e){var t=CP(e);return function(n){return vt(n)?t(n):EP}};const Qre=Object.freeze(Object.defineProperty({__proto__:null,Alt:Fre,Alternative:Pre,ApT:EP,Applicative:Are,Apply:Pv,Chain:rs,Compactable:jre,Do:Gre,Filterable:qre,FromEither:Dv,FromIO:Lv,Functor:JT,Monad:Lre,MonadIO:Dre,Pointed:wP,Zero:RP,alt:KT,altW:Ire,ap:_P,apFirst:xre,apS:Zre,apSecond:kre,bind:Yre,bindTo:Jre,chain:zT,chainEitherK:Vre,chainFirst:Nre,chainFirstEitherK:Hre,chainFirstIOK:zre,chainIOK:Bre,chainNullableK:_re,chainOptionK:$re,compact:VT,filter:SP,filterMap:$P,flap:Mre,flatten:Tre,fold:pre,fromEither:vP,fromEitherK:Kre,fromIO:UT,fromIOEither:fre,fromIOK:Ure,fromNullable:yre,fromNullableK:bre,fromOption:lre,fromOptionK:Sre,fromPredicate:cre,getOrElse:yP,getOrElseW:mre,guard:Wre,map:bP,match:gP,matchE:BT,matchEW:hre,matchW:dre,none:Ore,of:qa,partition:TP,partitionMap:IP,separate:HT,some:mP,toNullable:gre,toUndefined:vre,traverseReadonlyArrayWithIndex:Xre,traverseReadonlyNonEmptyArrayWithIndex:CP,zero:Wv},Symbol.toStringTag,{value:"Module"}));var MP=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 eie(e){return function(){return new MP(e)}}const tie=Object.freeze(Object.defineProperty({__proto__:null,IORef:MP,newIORef:eie},Symbol.toStringTag,{value:"Module"})),nie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var rie=function(e){return Pu(function(){return JSON.parse(e)},j)},iie=function(e){return Pu(function(){var t=JSON.stringify(e);if(typeof t!="string")throw new Error("Converting unsupported structure to JSON");return t},j)};const oie=Object.freeze(Object.defineProperty({__proto__:null,parse:rie,stringify:iie},Symbol.toStringTag,{value:"Module"})),aie=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var uie=function(e){return new Map(e)};function sie(e){return new Map(e)}function xP(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 kP=function(e){return e.size},Zi=function(e){return e.size===0};function jv(e){var t=is(e);return function(n,r){if(r===void 0){var i=jv(e);return function(o){return i(n,o)}}return yt(t(n,r))}}function YT(e){return function(t,n){if(n===void 0){var r=YT(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 gl=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},cie=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function AP(e){var t=gl(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 NP=function(e){return AP(e)(function(t,n){return[t,n]})};function lie(e,t){var n=NP(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?de([i[a],a+1]):ye})}}var FP=function(e){var t=jo(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(Pt(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}}},WP=function(e){var t=jo(e);return function(n){return function(r){var i=t(n,r);if(yt(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},fie=function(e){var t=PP(e);return function(n,r){return t(n,function(){return r})}},PP=function(e){var t=jo(e);return function(n,r){return function(i){var o=t(n,i);if(Pt(o))return ye;var a=o.value,u=a[0],s=a[1],c=r(s);if(c===s)return de(i);var l=new Map(i);return l.set(u,c),de(l)}}};function die(e){var t=is(e),n=WP(e);return function(r){var i=n(r);return function(o){return y(t(r,o),zi(function(a){return[a,i(o)]}))}}}function jo(e){return function(t,n){if(n===void 0){var r=jo(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 de([u,s])}return ye}}function is(e){var t=jo(e);return function(n,r){if(r===void 0){var i=is(e);return function(o){return i(n,o)}}return y(t(n,r),zi(function(o){o[0];var a=o[1];return a}))}}function qv(e,t){var n=jo(e);return function(r,i){if(i===void 0){var o=qv(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(Pt(f)||!e.equals(c,f.value[0])||!t.equals(l,f.value[1]))return!1}return!0}}var Uv=new Map;function LP(e,t){var n=qv(e,t);return Wr(function(r,i){return n(r,i)&&n(i,r)})}function pie(e,t){var n=jo(e);return{concat:function(r,i){if(Zi(r))return i;if(Zi(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);yt(f)?o.set(f.value[0],t.concat(f.value[1],l)):o.set(c,l)}return o},empty:Uv}}var hie=function(e,t){return new Map([[e,t]])};function mie(e,t,n){return function(r){var i=jo(e);return n.reduce(r,new Map,function(o,a){var u=a[0],s=a[1],c=i(u,o);return yt(c)?o.set(c.value[0],t.concat(c.value[1],s)):o.set(u,s),o})}}var yl=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},DP=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 Re(n,r)}};function jP(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 Re(n,r)}}var qP=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);yt(s)&&n.set(a,s.value)}return n}};function UP(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 qo=function(e,t){return yl(e,function(n,r){return t(r)})},Zd=function(e,t){return BP(e,function(n,r){return t(r)})},Xd=function(e,t){return zP(e,function(n,r){return t(r)})},Qd=function(e,t){return KP(e,function(n,r){return t(r)})},ep=function(e,t){return VP(e,function(n,r){return t(r)})},BP=function(e,t){return y(e,UP(t))},zP=function(e,t){return y(e,qP(t))},KP=function(e,t){return y(e,jP(t))},VP=function(e,t){return y(e,DP(t))},bl=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];yt(a)&&t.set(o,a.value)}return t},vie=function(e){return function(t){return Zd(t,e)}},gie=function(e){return function(t){return Xd(t,e)}},yie=function(e){return function(t){return qo(t,e)}},bie=function(e){return function(t){return yl(t,e)}},_ie=function(e){return function(t){return Qd(t,e)}},Sie=function(e){return function(t){return ep(t,e)}},_l=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 Re(t,n)},jr="ReadonlyMap",HP=function(e,t){var n=r0(e,t);return{concat:function(r,i){return n(i)(r)}}},$ie=function(e,t){return{concat:HP(e,t).concat,empty:Uv}},Tie=function(e,t){var n=i0(e,t);return{concat:function(r,i){return n(i)(r)}}},Iie=function(e){return function(){var t=o0(e);return{concat:function(n,r){return t(r)(n)}}}};function Oie(){return{URI:jr,_E:void 0,map:qo,mapWithIndex:yl,compact:bl,separate:_l,filter:Zd,filterMap:Xd,partition:Qd,partitionMap:ep,partitionMapWithIndex:VP,partitionWithIndex:KP,filterMapWithIndex:zP,filterWithIndex:BP}}var GP={URI:jr,map:qo},wie=ze(GP),Rie=function(){return{URI:jr,_E:void 0,map:qo,mapWithIndex:yl}},ZT={URI:jr,compact:bl,separate:_l},Eie={URI:jr,map:qo,compact:bl,separate:_l,filter:Zd,filterMap:Xd,partition:Qd,partitionMap:ep},XT=function(e){var t=zv(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},QT=function(e){var t=Kv(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}},e0=function(e){var t=Vv(e);return function(n,r){return t(n,function(i,o,a){return r(o,a)})}},Bv=function(e){var t=XT(e),n=QT(e),r=e0(e);return{URI:jr,_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))}}},zv=function(e){var t=gl(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}}},Kv=function(e){var t=gl(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}}}},Vv=function(e){var t=gl(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}}},t0=function(e){var t=Bv(e),n=zv(e),r=Kv(e),i=Vv(e);return{URI:jr,_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))}}},Cie=function(e){var t=n0(e),n=Bv(e);return{URI:jr,_E:void 0,map:qo,reduce:n.reduce,foldMap:n.foldMap,reduceRight:n.reduceRight,traverse:t.traverse,sequence:t.sequence}},n0=function(e){var t=t0(e),n=gl(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,Hn)}};return{URI:jr,_E:void 0,map:qo,mapWithIndex:yl,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 Mie(e){var t=n0(e);return{URI:jr,_E:void 0,map:qo,compact:bl,separate:_l,filter:Zd,filterMap:Xd,partition:Qd,partitionMap:ep,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:yl,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:ni(t,ZT),wither:ri(t,ZT)}}var r0=function(e,t){var n=is(e);return function(r){return function(i){if(Zi(i))return r;if(Zi(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);yt(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);Pt(f)&&o.set(c,l)}return o}}},i0=function(e,t){var n=is(e);return function(r){return function(i){if(Zi(i)||Zi(r))return Uv;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);yt(f)&&o.set(c,t.concat(l,f.value))}return o}}},o0=function(e){var t=jv(e);return function(n){return function(r){if(Zi(r))return n;if(Zi(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}}},xie=FP,kie={URI:jr,map:qo,compact:bl,separate:_l,filter:Zd,filterMap:Xd,partition:Qd,partitionMap:ep};const Aie=Object.freeze(Object.defineProperty({__proto__:null,Compactable:ZT,Filterable:Eie,Functor:GP,URI:jr,collect:AP,compact:bl,deleteAt:WP,difference:o0,elem:YT,empty:Uv,filter:vie,filterMap:gie,filterMapWithIndex:qP,filterWithIndex:UP,flap:wie,foldMap:QT,foldMapWithIndex:Kv,fromFoldable:mie,fromMap:uie,getDifferenceMagma:Iie,getEq:LP,getFilterableWithIndex:Oie,getFoldable:Bv,getFoldableWithIndex:t0,getFunctorWithIndex:Rie,getIntersectionSemigroup:Tie,getMonoid:pie,getShow:xP,getTraversable:Cie,getTraversableWithIndex:n0,getUnionMonoid:$ie,getUnionSemigroup:HP,getWitherable:Mie,insertAt:xie,intersection:i0,isEmpty:Zi,isSubmap:qv,keys:gl,lookup:is,lookupWithKey:jo,map:yie,mapWithIndex:bie,member:jv,modifyAt:PP,partition:_ie,partitionMap:Sie,partitionMapWithIndex:DP,partitionWithIndex:jP,pop:die,readonlyMap:kie,reduce:XT,reduceRight:e0,reduceRightWithIndex:Vv,reduceWithIndex:zv,separate:_l,singleton:hie,size:kP,toMap:sie,toReadonlyArray:NP,toUnfoldable:lie,union:r0,updateAt:fie,upsertAt:FP,values:cie},Symbol.toStringTag,{value:"Module"}));var Sl=globalThis&&globalThis.__assign||function(){return Sl=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},Sl.apply(this,arguments)},Nie=xP,Fie=kP,Uo=Zi,Wie=jv,Pie=YT,a0=function(e){return function(t){return Array.from(t.keys()).sort(e.compare)}},Lie=function(e){return function(t){return Array.from(t.values()).sort(e.compare)}};function JP(e){var t=a0(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 YP(e){return JP(e)(function(t,n){return[t,n]})}function Die(e,t){var n=YP(e);return function(r){var i=n(r),o=i.length;return t.unfold(0,function(a){return a<o?de([i[a],a+1]):ye})}}var ZP=function(e){var t=as(e);return function(n,r){var i=t(n);return function(o){var a=i(o);if(Pt(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}}},XP=function(e){var t=as(e);return function(n){return function(r){var i=t(n,r);if(yt(i)){var o=new Map(r);return o.delete(i.value[0]),o}return r}}},jie=function(e){var t=QP(e);return function(n,r){return t(n,function(){return r})}},QP=function(e){var t=as(e);return function(n,r){return function(i){var o=t(n,i);if(Pt(o))return ye;var a=new Map(i);return a.set(o.value[0],r(o.value[1])),de(a)}}};function qie(e){var t=eL(e),n=XP(e);return function(r){var i=n(r);return function(o){return y(t(r,o),zi(function(a){return[a,i(o)]}))}}}function as(e){return function(t,n){if(n===void 0){var r=as(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 de([u,s])}return ye}}var eL=is,Uie=qv,Bie=LP;function zie(e,t){var n=as(e);return{concat:function(r,i){if(Uo(r))return i;if(Uo(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);yt(f)?o.set(f.value[0],t.concat(f.value[1],l)):o.set(c,l)}return o},empty:new Map}}var Kie=function(e,t){return new Map([[e,t]])};function Vie(e,t,n){return function(r){var i=as(e);return n.reduce(r,new Map,function(o,a){var u=a[0],s=a[1],c=i(u,o);return yt(c)?o.set(c.value[0],t.concat(c.value[1],s)):o.set(u,s),o})}}var tp=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},tL=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 Re(n,r)}};function nL(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 Re(n,r)}}var rL=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);yt(s)&&n.set(a,s.value)}return n}};function iL(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 $l=function(e,t){return tp(e,function(n,r){return t(r)})},Hv=function(e,t){return oL(e,function(n,r){return t(r)})},Gv=function(e,t){return aL(e,function(n,r){return t(r)})},Jv=function(e,t){return uL(e,function(n,r){return t(r)})},Yv=function(e,t){return sL(e,function(n,r){return t(r)})},oL=function(e,t){return y(e,iL(t))},aL=function(e,t){return y(e,rL(t))},uL=function(e,t){return y(e,nL(t))},sL=function(e,t){return y(e,tL(t))},np=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];yt(a)&&t.set(o,a.value)}return t},Hie=function(e){return function(t){return Hv(t,e)}},Gie=function(e){return function(t){return Gv(t,e)}},Jie=function(e){return function(t){return $l(t,e)}},Yie=function(e){return function(t){return tp(t,e)}},Zie=function(e){return function(t){return Jv(t,e)}},Xie=function(e){return function(t){return Yv(t,e)}},rp=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 Re(t,n)},Bo="Map",cL=function(e,t){var n=hL(e,t);return{concat:function(r,i){return n(i)(r)}}},Qie=function(e,t){return{concat:cL(e,t).concat,empty:new Map}},eoe=function(e,t){var n=mL(e,t);return{concat:function(r,i){return n(i)(r)}}},toe=function(e){return function(){var t=vL(e);return{concat:function(n,r){return t(r)(n)}}}};function noe(){return{URI:Bo,_E:void 0,map:$l,mapWithIndex:tp,compact:np,separate:rp,filter:Hv,filterMap:Gv,partition:Jv,partitionMap:Yv,partitionMapWithIndex:sL,partitionWithIndex:uL,filterMapWithIndex:aL,filterWithIndex:oL}}function roe(e){var t=fL(e);return{URI:Bo,_E:void 0,map:$l,compact:np,separate:rp,filter:Hv,filterMap:Gv,partition:Jv,partitionMap:Yv,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,traverse:t.traverse,sequence:t.sequence,mapWithIndex:tp,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverseWithIndex:t.traverseWithIndex,wilt:ni(t,u0),wither:ri(t,u0)}}var ioe=XT,ooe=QT,aoe=e0,uoe=function(e){return Sl(Sl({},Bv(e)),{URI:Bo})},soe=zv,coe=Kv,loe=Vv,lL=function(e){return Sl(Sl({},t0(e)),{URI:Bo})},fL=function(e){var t=lL(e),n=a0(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:Bo,_E:void 0,map:$l,mapWithIndex:tp,reduce:t.reduce,foldMap:t.foldMap,reduceRight:t.reduceRight,reduceWithIndex:t.reduceWithIndex,foldMapWithIndex:t.foldMapWithIndex,reduceRightWithIndex:t.reduceRightWithIndex,traverse:i,sequence:o,traverseWithIndex:r}},dL={URI:Bo,map:$l},foe=ze(dL),u0={URI:Bo,compact:np,separate:rp},pL={URI:Bo,map:$l,compact:np,separate:rp,filter:Hv,filterMap:Gv,partition:Jv,partitionMap:Yv},Zv=function(e){return new Map(e)},hL=function(e,t){var n=r0(e,t);return function(r){return function(i){return Uo(i)?Zv(r):Uo(r)?Zv(i):n(r)(i)}}},mL=function(e,t){var n=i0(e,t);return function(r){return function(i){return Uo(i)||Uo(r)?new Map:n(r)(i)}}},vL=function(e){var t=o0(e);return function(n){return function(r){return Uo(r)?Zv(n):Uo(n)?Zv(r):t(n)(r)}}},doe=new Map,poe=ZP,hoe=pL;const moe=Object.freeze(Object.defineProperty({__proto__:null,Compactable:u0,Filterable:pL,Functor:dL,URI:Bo,collect:JP,compact:np,deleteAt:XP,difference:vL,elem:Pie,empty:doe,filter:Hie,filterMap:Gie,filterMapWithIndex:rL,filterWithIndex:iL,flap:foe,foldMap:ooe,foldMapWithIndex:coe,fromFoldable:Vie,getDifferenceMagma:toe,getEq:Bie,getFilterableWithIndex:noe,getFoldable:uoe,getFoldableWithIndex:lL,getIntersectionSemigroup:eoe,getMonoid:zie,getShow:Nie,getTraversableWithIndex:fL,getUnionMonoid:Qie,getUnionSemigroup:cL,getWitherable:roe,insertAt:poe,intersection:mL,isEmpty:Uo,isSubmap:Uie,keys:a0,lookup:eL,lookupWithKey:as,map:Jie,mapWithIndex:Yie,map_:hoe,member:Wie,modifyAt:QP,partition:Zie,partitionMap:Xie,partitionMapWithIndex:tL,partitionWithIndex:nL,pop:qie,reduce:ioe,reduceRight:aoe,reduceRightWithIndex:loe,reduceWithIndex:soe,separate:rp,singleton:Kie,size:Fie,toArray:YP,toUnfoldable:Die,union:hL,updateAt:jie,upsertAt:ZP,values:Lie},Symbol.toStringTag,{value:"Module"})),voe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),goe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),yoe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),boe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),_oe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var gL=function(e){return{concat:am(e).concat,empty:e.top}},yL=function(e){return{concat:um(e).concat,empty:e.bottom}},s0=function(e){return{concat:x_(e).concat,empty:e.empty}},bL=function(e){var t={};for(var n in e)ct.call(e,n)&&(t[n]=e[n].empty);return{concat:k_(e).concat,empty:t}},_L=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:A_.apply(Hx,e).concat,empty:e.map(function(n){return n.empty})}},SL=function(e){return F_(e)(e.empty)},Soe={concat:qx.concat,empty:void 0},$oe=_L,Toe=bL,Ioe=s0,Ooe=yL,woe=gL,Roe=SL,$L={concat:Ux.concat,empty:!0},TL={concat:Bx.concat,empty:!1},Eoe=KC,Coe=function(){return s0(FF())},Moe={concat:zx.concat,empty:""},xoe={concat:Kx.concat,empty:0},koe={concat:Vx.concat,empty:1};const Aoe=Object.freeze(Object.defineProperty({__proto__:null,concatAll:SL,fold:Roe,getDualMonoid:Ioe,getEndomorphismMonoid:Coe,getFunctionMonoid:Eoe,getJoinMonoid:Ooe,getMeetMonoid:woe,getStructMonoid:Toe,getTupleMonoid:$oe,max:yL,min:gL,monoidAll:$L,monoidAny:TL,monoidProduct:koe,monoidString:Moe,monoidSum:xoe,monoidVoid:Soe,reverse:s0,struct:bL,tuple:_L},Symbol.toStringTag,{value:"Module"})),Noe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var IL=function(e,t,n){return function(r){return r===-1?e():r===0?t():n()}},Foe=IL,OL=function(e){return e===-1?1:e===1?-1:0},wL={equals:function(e,t){return e===t}},c0={concat:function(e,t){return e!==0?e:t}},RL={concat:c0.concat,empty:0},Woe=function(e){return e<=-1?-1:e>=1?1:0},Poe=OL,Loe=c0,Doe=wL,joe=RL;const qoe=Object.freeze(Object.defineProperty({__proto__:null,Eq:wL,Monoid:RL,Semigroup:c0,eqOrdering:Doe,invert:Poe,match:Foe,matchW:IL,monoidOrdering:joe,reverse:OL,semigroupOrdering:Loe,sign:Woe},Symbol.toStringTag,{value:"Module"}));var Uoe=function(e){return typeof e.map=="function"},Boe=function(e){return typeof e.contramap=="function"},zoe=function(e){return typeof e.mapWithIndex=="function"},Koe=function(e){return typeof e.ap=="function"},Voe=function(e){return typeof e.chain=="function"},Hoe=function(e){return typeof e.bimap=="function"},Goe=function(e){return typeof e.extend=="function"},Joe=function(e){return typeof e.reduce=="function"},Yoe=function(e){return typeof e.reduceWithIndex=="function"},Zoe=function(e){return typeof e.alt=="function"},Xoe=function(e){return typeof e.compact=="function"},Qoe=function(e){return typeof e.filter=="function"},eae=function(e){return typeof e.filterWithIndex=="function"},tae=function(e){return typeof e.promap=="function"},nae=function(e){return typeof e.compose=="function"},rae=function(e){return typeof e.throwError=="function"};function iae(e){var t={};if(Uoe(e)){var n=function(w){return function(I){return e.map(I,w)}};t.map=n}if(Boe(e)){var r=function(w){return function(I){return e.contramap(I,w)}};t.contramap=r}if(zoe(e)){var i=function(w){return function(I){return e.mapWithIndex(I,w)}};t.mapWithIndex=i}if(Koe(e)){var o=function(w){return function(I){return e.ap(I,w)}},a=function(w){return function(I){return e.ap(e.map(I,function(F){return function(){return F}}),w)}};t.ap=o,t.apFirst=a,t.apSecond=function(w){return function(I){return e.ap(e.map(I,function(){return function(F){return F}}),w)}}}if(Voe(e)){var u=function(w){return function(I){return e.chain(I,w)}},s=function(w){return function(I){return e.chain(I,function(F){return e.map(w(F),function(){return F})})}},c=function(w){return e.chain(w,j)};t.chain=u,t.chainFirst=s,t.flatten=c}if(Hoe(e)){var l=function(w,I){return function(F){return e.bimap(F,w,I)}},f=function(w){return function(I){return e.mapLeft(I,w)}};t.bimap=l,t.mapLeft=f}if(Goe(e)){var d=function(w){return function(I){return e.extend(I,w)}},p=function(w){return e.extend(w,j)};t.extend=d,t.duplicate=p}if(Joe(e)){var h=function(w,I){return function(F){return e.reduce(F,w,I)}},v=function(w){var I=e.foldMap(w);return function(F){return function(L){return I(L,F)}}},m=function(w,I){return function(F){return e.reduceRight(F,w,I)}};t.reduce=h,t.foldMap=v,t.reduceRight=m}if(Yoe(e)){var _=function(w,I){return function(F){return e.reduceWithIndex(F,w,I)}},g=function(w){var I=e.foldMapWithIndex(w);return function(F){return function(L){return I(L,F)}}},S=function(w,I){return function(F){return e.reduceRightWithIndex(F,w,I)}};t.reduceWithIndex=_,t.foldMapWithIndex=g,t.reduceRightWithIndex=S}if(Zoe(e)){var b=function(w){return function(I){return e.alt(I,w)}};t.alt=b}if(Xoe(e)&&(t.compact=e.compact,t.separate=e.separate),Qoe(e)){var $=function(w){return function(I){return e.filter(I,w)}},T=function(w){return function(I){return e.filterMap(I,w)}},C=function(w){return function(I){return e.partition(I,w)}},R=function(w){return function(I){return e.partitionMap(I,w)}};t.filter=$,t.filterMap=T,t.partition=C,t.partitionMap=R}if(eae(e)){var q=function(w){return function(I){return e.filterWithIndex(I,w)}},G=function(w){return function(I){return e.filterMapWithIndex(I,w)}},A=function(w){return function(I){return e.partitionWithIndex(I,w)}},Y=function(w){return function(I){return e.partitionMapWithIndex(I,w)}};t.filterWithIndex=q,t.filterMapWithIndex=G,t.partitionWithIndex=A,t.partitionMapWithIndex=Y}if(tae(e)){var ie=function(w,I){return function(F){return e.promap(F,w,I)}};t.promap=ie}if(nae(e)){var J=function(w){return function(I){return e.compose(I,w)}};t.compose=J}if(rae(e)){var ge=function(w){return function(I){return I._tag==="None"?e.throwError(w()):e.of(I.value)}},Te=function(w){return w._tag==="Left"?e.throwError(w.left):e.of(w.right)},M=function(w,I){return function(F){return w(F)?e.of(F):e.throwError(I(F))}},x=function(w,I){return function(F){return e.chain(F,function(L){return w(L)?e.of(L):e.throwError(I(L))})}};t.fromOption=ge,t.fromEither=Te,t.fromPredicate=M,t.filterOrElse=x}return t}var fe=y;const oae=Object.freeze(Object.defineProperty({__proto__:null,pipe:fe,pipeable:iae},Symbol.toStringTag,{value:"Module"})),aae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),uae=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Xv=function(){return Math.random()};function EL(e,t){return y(Xv,Ji(function(n){return Math.floor((t-e+1)*n+e)}))}function sae(e,t){return y(Xv,Ji(function(n){return(t-e)*n+e}))}var cae=y(Xv,Ji(function(e){return e<.5})),lae=function(e){return y(EL(0,e.length-1),Ji(function(t){return e[t]}))};const fae=Object.freeze(Object.defineProperty({__proto__:null,random:Xv,randomBool:cae,randomElem:lae,randomInt:EL,randomRange:sae},Symbol.toStringTag,{value:"Module"}));var l0=Xc(oT),CL=Ju(oT),ML=Qc(cn),dae=el(cn),xL=Hi,kL=ML,AL=Nd(cn),pae=AL,f0=al(No),hae=f0,NL=f0,mae=NL,FL=ul(No),vae=FL,gae=Pd(cn),yae=Ld,WL=Dd,bae=WL,PL=Zu(No),_ae=PL,LL=Fd(No),Sae=LL,$ae=Wd(No),Tae=sl(cn),qr=function(e,t){return y(e,jL(t))},d0=function(e,t,n){return y(e,qL(t,n))},p0=function(e,t){return y(e,UL(t))},Tl=function(e,t){return y(e,h0(t))},ip=function(e,t){return y(e,m0(t))},DL=function(e,t){return y(e,v0(t))},jL=tl(cn),qL=il(cn),UL=ol(cn),h0=nl(Ao),Iae=h0,Xi=CL,m0=Yu(No),BL=m0,zL=BL(j),Oae=zL,v0=rl(No),wae=v0,g0=l0,Zt="ReaderEither",KL=function(e){var t=Fu(e);return{URI:Zt,_E:void 0,compact:Ki(cn,t),separate:Ro(cn,t,Ra)}};function Rae(e){var t=$c(e),n=KL(e),r=Eo(cn,t),i=Co(cn,t),o=Pa(cn,t),a=La(cn,t);return{URI:Zt,_E:void 0,map:qr,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 VL(e){var t=go(Ao,wa(e));return{URI:Zt,_E:void 0,map:qr,ap:function(n,r){return y(n,t(r))},of:Xi}}function HL(e){var t=Ad(No,e);return{URI:Zt,_E:void 0,map:qr,alt:function(n,r){return y(n,t(r))}}}var y0={URI:Zt,map:qr},Eae=ze(y0),Cae={URI:Zt,of:Xi},op={URI:Zt,map:qr,ap:Tl},GL=wt(op),Mae=GL,JL=Rt(op),xae=JL,YL={URI:Zt,map:qr,ap:Tl,of:Xi},zo={URI:Zt,map:qr,ap:Tl,chain:ip},kae={URI:Zt,map:qr,ap:Tl,of:Xi,chain:ip},ZL=lt(zo),Aae=ZL,Nae={URI:Zt,bimap:d0,mapLeft:p0},Fae={URI:Zt,map:qr,alt:DL},Il={URI:Zt,fromReader:kL},Wae=qd(Il),Pae=Ud(Il),Lae=es(Il),XL=Bd(Il,zo),Dae=XL,QL=zd(Il,zo),jae=QL,qae={URI:Zt,map:qr,ap:Tl,of:Xi,chain:ip,throwError:g0},Ko={URI:Zt,fromEither:xL},Uae=Li(Ko),Bae=Di(Ko),zae=ku(Ko,zo),eD=yo(Ko,zo),Kae=eD,tD=bo(Ko,zo),Vae=tD,Hae=Oa(Ko),nD=Au(Ko,zo),Gae=nD,Jae=dr(Ko),Yae=Xi(Jt),Zae=Ct(y0),rD=Mt(zo),Xae=rD,iD=Et(op),Qae=iD,oD=Xi(an),aD=function(e){return V(Qu(e),Xu(Yf(Hn)))},b0=function(e){var t=aD(e);return function(n){return vt(n)?t(n):oD}},eue=b0,uD=function(e){return b0(function(t,n){return e(n)})},tue=uD(j),nue={URI:Zt,bimap:d0,mapLeft:p0,map:qr,of:Xi,ap:Tl,chain:ip,alt:DL,throwError:l0},rue=Yt(op),iue=Nr(YL),oue=function(e){return Yt(Ao)(Vf(e))};function aue(e){var t=VL(e),n=HL(e);return{URI:Zt,_E:void 0,map:qr,ap:t.ap,of:Xi,chain:ip,bimap:d0,mapLeft:p0,alt:n.alt,throwError:g0}}const uue=Object.freeze(Object.defineProperty({__proto__:null,Alt:Fae,ApT:oD,Applicative:YL,Apply:op,Bifunctor:Nae,Chain:zo,Do:Yae,FromEither:Ko,FromReader:Il,Functor:y0,Monad:kae,MonadThrow:qae,Pointed:Cae,URI:Zt,alt:v0,altW:wae,ap:h0,apFirst:GL,apFirstW:Mae,apS:iD,apSW:Qae,apSecond:JL,apSecondW:xae,apW:Iae,ask:Wae,asks:Pae,asksReaderEither:bae,asksReaderEitherW:WL,bimap:qL,bind:rD,bindTo:Zae,bindW:Xae,chain:m0,chainEitherK:eD,chainEitherKW:Kae,chainFirst:ZL,chainFirstEitherK:tD,chainFirstEitherKW:Vae,chainFirstReaderK:QL,chainFirstReaderKW:jae,chainFirstW:Aae,chainOptionK:zae,chainReaderK:XL,chainReaderKW:Dae,chainW:BL,filterOrElse:nD,filterOrElseW:Gae,flap:Eae,flatten:Oae,flattenW:zL,fold:hae,foldW:mae,fromEither:xL,fromEitherK:Jae,fromOption:Uae,fromOptionK:Bae,fromPredicate:Hae,fromReader:kL,fromReaderK:Lae,getAltReaderValidation:HL,getApplicativeReaderValidation:VL,getApplyMonoid:iue,getApplySemigroup:rue,getCompactable:KL,getFilterable:Rae,getOrElse:FL,getOrElseW:vae,getReaderValidation:aue,getSemigroup:oue,left:l0,leftReader:dae,local:yae,map:jL,mapLeft:UL,match:AL,matchE:f0,matchEW:NL,matchW:pae,of:Xi,orElse:PL,orElseFirst:LL,orElseFirstW:Sae,orElseW:_ae,orLeft:$ae,readerEither:nue,right:CL,rightReader:ML,sequenceArray:tue,swap:Tae,throwError:g0,toUnion:gae,traverseArray:uD,traverseArrayWithIndex:eue,traverseReadonlyArrayWithIndex:b0,traverseReadonlyNonEmptyArrayWithIndex:aD},Symbol.toStringTag,{value:"Module"}));function _0(e){return function(t){return function(){return e.of(t)}}}function S0(e){return function(t){return function(n){return function(r){return e.map(n(r),t)}}}}function $0(e){return function(t){return function(n){return function(r){return e.ap(n(r),t(r))}}}}function T0(e){return function(t){return function(n){return function(r){return e.chain(n(r),function(i){return t(i)(r)})}}}}function I0(e){return function(t){return V(t,e.of)}}function sue(e){return function(t){return V(t,e)}}function cue(e){var t=$0(e),n=S0(e),r=T0(e);return{map:function(i,o){return y(i,n(o))},ap:function(i,o){return y(i,t(o))},of:_0(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:I0(e),fromM:function(i){return function(){return i}}}}const lue=Object.freeze(Object.defineProperty({__proto__:null,ap:$0,chain:T0,fromNaturalTransformation:sue,fromReader:I0,getReaderM:cue,map:S0,of:_0},Symbol.toStringTag,{value:"Module"}));var Wn=function(e){return function(){return Promise.resolve().then(e)}};function fue(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var hi=function(e,t){return y(e,Ua(t))},us=function(e,t){return y(e,sD(t))},O0=function(e,t){return y(e,ap(function(n){return y(t,Ua(n))}))},Ol=function(e,t){return y(e,ap(t))},Ua=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},sD=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)}},ap=function(e){return function(t){return function(){return Promise.resolve().then(t).then(function(n){return e(n)()})}}},due=ap(j),Pn="Task";function pue(){return{concat:function(e,t){return function(){return Promise.race([Promise.resolve().then(e),Promise.resolve().then(t)])}},empty:lD}}var qe={URI:Pn,map:hi},hue=ze(qe),ln={URI:Pn,of:In},ss={URI:Pn,map:hi,ap:us},mue=wt(ss),vue=Rt(ss),up={URI:Pn,map:hi,ap:us,of:In},Qv={URI:Pn,map:hi,ap:O0},cD={URI:Pn,map:hi,ap:O0,of:In},wl={URI:Pn,map:hi,ap:us,chain:Ol},Xt={URI:Pn,map:hi,of:In,ap:us,chain:Ol},gue={URI:Pn,map:hi,of:In,ap:us,chain:Ol,fromIO:Wn},sp=j,yue={URI:Pn,map:hi,of:In,ap:us,chain:Ol,fromIO:Wn,fromTask:sp},bue=lt(wl),eg={URI:Pn,fromIO:Wn},_ue=Vi(eg),Sue=Mo(eg,wl),$ue=xo(eg,wl),Tue={URI:Pn,fromIO:Wn,fromTask:sp},lD=function(){return new Promise(function(e){})},Iue=In(Jt),Oue=Ct(qe),wue=Mt(wl),Rue=Et(ss),w0=In(an),Rl=function(e){return function(t){return function(){return Promise.all(t.map(function(n,r){return Promise.resolve().then(function(){return e(r,n)()})}))}}},R0=function(e){var t=Rl(e);return function(n){return vt(n)?t(n):w0}},E0=function(e){return function(t){return function(){return yc(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,fr(t))).then(jf))}}},C0=function(e){var t=E0(e);return function(n){return vt(n)?t(n):w0}},Eue=R0,fD=function(e){return R0(function(t,n){return e(n)})},Cue=fD(j),Mue=C0,dD=function(e){return C0(function(t,n){return e(n)})},xue=dD(j),kue={URI:Pn,map:hi,of:In,ap:us,chain:Ol,fromIO:Wn,fromTask:sp},Aue={URI:Pn,map:hi,of:In,ap:O0,chain:Ol,fromIO:Wn,fromTask:sp},Nue=Yt(Qv),Fue=Nr(cD);const Wue=Object.freeze(Object.defineProperty({__proto__:null,ApT:w0,ApplicativePar:up,ApplicativeSeq:cD,ApplyPar:ss,ApplySeq:Qv,Chain:wl,Do:Iue,FromIO:eg,FromTask:Tue,Functor:qe,Monad:Xt,MonadIO:gue,MonadTask:yue,Pointed:ln,URI:Pn,ap:sD,apFirst:mue,apS:Rue,apSecond:vue,bind:wue,bindTo:Oue,chain:ap,chainFirst:bue,chainFirstIOK:$ue,chainIOK:Sue,delay:fue,flap:hue,flatten:due,fromIO:Wn,fromIOK:_ue,fromTask:sp,getMonoid:Fue,getRaceMonoid:pue,getSemigroup:Nue,map:Ua,never:lD,of:In,sequenceArray:Cue,sequenceSeqArray:xue,task:kue,taskSeq:Aue,traverseArray:fD,traverseArrayWithIndex:Eue,traverseReadonlyArrayWithIndex:R0,traverseReadonlyArrayWithIndexSeq:C0,traverseReadonlyNonEmptyArrayWithIndex:Rl,traverseReadonlyNonEmptyArrayWithIndexSeq:E0,traverseSeqArray:dD,traverseSeqArrayWithIndex:Mue},Symbol.toStringTag,{value:"Module"}));var pD=I0(ln),El=Hi,cs=V(Wn,El),Pue=Ld,hD=Dd,Lue=hD,mi=function(e,t){return y(e,x0(t))},ls=function(e,t){return y(e,k0(t))},M0=function(e,t){return y(e,tg(function(n){return y(t,x0(n))}))},Cl=function(e,t){return y(e,tg(t))},x0=S0(qe),k0=$0(ss),Due=k0,Ur=_0(ln),tg=T0(Xt),mD=tg,vD=mD(j),jue=vD,On="ReaderTask",fn={URI:On,map:mi},que=ze(fn),cp={URI:On,of:Ur},lp={URI:On,map:mi,ap:ls},Uue=wt(lp),Bue=Rt(lp),zue={URI:On,map:mi,ap:ls,of:Ur},A0={URI:On,map:mi,ap:M0},gD={URI:On,map:mi,ap:M0,of:Ur},Qi={URI:On,map:mi,ap:ls,chain:Cl},Vo={URI:On,map:mi,of:Ur,ap:ls,chain:Cl},Kue={URI:On,map:mi,of:Ur,ap:ls,chain:Cl,fromIO:cs},Vue={URI:On,map:mi,of:Ur,ap:ls,chain:Cl,fromIO:cs,fromTask:El},yD=lt(Qi),Hue=yD,ng={URI:On,fromIO:cs},Gue=Vi(ng),Jue=Mo(ng,Qi),Yue=xo(ng,Qi),Ml={URI:On,fromReader:pD},Zue=qd(Ml),Xue=Ud(Ml),Que=es(Ml),bD=Bd(Ml,Qi),ese=bD,_D=zd(Ml,Qi),tse=_D,rg={URI:On,fromIO:cs,fromTask:El},nse=ts(rg),rse=cl(rg,Qi),ise=ll(rg,Qi),ose=Ur(Jt),ase=Ct(fn),SD=Mt(Qi),use=SD,$D=Et(lp),sse=$D,N0=Ur(an),TD=function(e){return V(Qu(e),Xu(Rl(Hn)))},F0=function(e){var t=TD(e);return function(n){return vt(n)?t(n):N0}},ID=function(e){return V(Qu(e),Xu(E0(Hn)))},W0=function(e){var t=ID(e);return function(n){return vt(n)?t(n):N0}},cse=F0,OD=function(e){return F0(function(t,n){return e(n)})},lse=OD(j),fse=W0,wD=function(e){return W0(function(t,n){return e(n)})},dse=wD(j),pse={URI:On,map:mi,of:Ur,ap:ls,chain:Cl,fromIO:cs,fromTask:El},hse={URI:On,map:mi,of:Ur,ap:M0,chain:Cl,fromIO:cs,fromTask:El},mse=Yt(A0),vse=Nr(gD);function gse(e,t){return e(t)()}const yse=Object.freeze(Object.defineProperty({__proto__:null,ApT:N0,ApplicativePar:zue,ApplicativeSeq:gD,ApplyPar:lp,ApplySeq:A0,Chain:Qi,Do:ose,FromIO:ng,FromReader:Ml,FromTask:rg,Functor:fn,Monad:Vo,MonadIO:Kue,MonadTask:Vue,Pointed:cp,URI:On,ap:k0,apFirst:Uue,apS:$D,apSW:sse,apSecond:Bue,apW:Due,ask:Zue,asks:Xue,asksReaderTask:Lue,asksReaderTaskW:hD,bind:SD,bindTo:ase,bindW:use,chain:tg,chainFirst:yD,chainFirstIOK:Yue,chainFirstReaderK:_D,chainFirstReaderKW:tse,chainFirstTaskK:ise,chainFirstW:Hue,chainIOK:Jue,chainReaderK:bD,chainReaderKW:ese,chainTaskK:rse,chainW:mD,flap:que,flatten:jue,flattenW:vD,fromIO:cs,fromIOK:Gue,fromReader:pD,fromReaderK:Que,fromTask:El,fromTaskK:nse,getMonoid:vse,getSemigroup:mse,local:Pue,map:x0,of:Ur,readerTask:pse,readerTaskSeq:hse,run:gse,sequenceArray:lse,sequenceSeqArray:dse,traverseArray:OD,traverseArrayWithIndex:cse,traverseReadonlyArrayWithIndex:F0,traverseReadonlyArrayWithIndexSeq:W0,traverseReadonlyNonEmptyArrayWithIndex:TD,traverseReadonlyNonEmptyArrayWithIndexSeq:ID,traverseSeqArray:wD,traverseSeqArrayWithIndex:fse},Symbol.toStringTag,{value:"Module"}));var bse=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())})},_se=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}}},P0=Xc(ln),L0=Ju(ln),ig=Qc(qe),D0=el(qe),j0=V(Wn,ig),RD=V(Wn,D0),Ba=j0,xl=ig,q0=In,U0=Wn,ED=function(e){return Ua(pM(e))},CD=Nd(qe),Sse=CD,B0=al(Xt),$se=B0,MD=B0,Tse=MD,xD=ul(Xt),Ise=xD,kD=function(e,t){return function(){return bse(void 0,void 0,void 0,function(){var n;return _se(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(Ia)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,vo(t(n))];case 3:return[2]}})})}},Ose=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return kD(function(){return e.apply(void 0,n)},t)}},wse=Pd(qe),Rse=hv(ln),Ese=mv(ln),Cse=Y$(Xt),AD=Zu(Xt),Mse=AD,og=Fd(Xt),xse=og,kse=function(e){return og(ZD(e))},Ase=function(e){return og(XD(e))},Nse=Wd(Xt),Fse=sl(qe),ND=function(e){var t=ED(e);return function(n){return V(n,t)}},FD=function(e){return function(t){return function(n){return y(n,fp(ND(e)(t)))}}},Wse=FD,WD=function(e){return V(e,U0)},PD=function(e){return dp(WD(e))},Pse=PD,dn=function(e,t){return y(e,V0(t))},za=function(e,t){return y(e,H0(t))},z0=function(e,t){return y(e,fp(function(n){return y(t,V0(n))}))},Ka=function(e,t){return y(e,fp(t))},ag=function(e,t,n){return y(e,LD(t,n))},ug=function(e,t){return y(e,DD(t))},K0=function(e,t){return y(e,G0(t))},V0=tl(qe),LD=il(qe),DD=ol(qe),H0=nl(ss),Lse=H0,fp=Yu(Xt),dp=fp,jD=dp(j),Dse=jD,G0=rl(Xt),jse=G0,Xn=L0,pp=P0,gt="TaskEither";function J0(e,t){var n=go(e,wa(t));return{URI:gt,_E:void 0,map:dn,ap:function(r,i){return y(r,n(i))},of:Xn}}function qD(e){var t=Ad(Xt,e);return{URI:gt,_E:void 0,map:dn,alt:function(n,r){return y(n,t(r))}}}var UD=function(e){var t=Fu(e);return{URI:gt,_E:void 0,compact:Ki(qe,t),separate:Ro(qe,t,Ra)}};function qse(e){var t=$c(e),n=UD(e),r=Eo(qe,t),i=Co(qe,t),o=Pa(qe,t),a=La(qe,t);return{URI:gt,_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))}}}var Y0={URI:gt,map:dn},Use=ze(Y0),Bse={URI:gt,of:Xn},sg={URI:gt,map:dn,ap:za},BD=wt(sg),zse=BD,zD=Rt(sg),Kse=zD,Vse={URI:gt,map:dn,ap:za,of:Xn},KD={URI:gt,map:dn,ap:z0},VD={URI:gt,map:dn,ap:z0,of:Xn},vi={URI:gt,map:dn,ap:za,chain:Ka},Hse={URI:gt,map:dn,ap:za,chain:Ka,of:Xn},Gse={URI:gt,map:dn,ap:za,chain:Ka,of:Xn,fromIO:Ba},Jse={URI:gt,map:dn,ap:za,chain:Ka,of:Xn,fromIO:Ba,fromTask:xl},Yse={URI:gt,map:dn,ap:za,chain:Ka,of:Xn,throwError:pp},HD=lt(vi),Zse=HD,Xse={URI:gt,bimap:ag,mapLeft:ug},Qse={URI:gt,map:dn,alt:K0},Ho={URI:gt,fromEither:q0},ece=Li(Ho),tce=Di(Ho),nce=ku(Ho,vi),GD=yo(Ho,vi),rce=GD,JD=bo(Ho,vi),ice=JD,oce=Oa(Ho),YD=Au(Ho,vi),ace=YD,uce=dr(Ho),cg={URI:gt,fromIO:Ba},ZD=Vi(cg),sce=Mo(cg,vi),cce=xo(cg,vi),lg={URI:gt,fromIO:Ba,fromTask:xl},XD=ts(lg),lce=cl(lg,vi),fce=ll(lg,vi);function dce(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(vo(i)):n(Ia(o))};e.apply(null,t.concat(r))})}}}var pce=function(e,t,n){return Z0(e,t,n)},Z0=function(e,t,n){return y(e,dp(function(r){return y(t(r),ap(function(i){return y(n(r,i),dp(function(){return In(i)}))}))}))},hce=Xn(Jt),mce=Ct(Y0),QD=Mt(vi),vce=QD,ej=Et(sg),gce=ej,X0=Xn(an),Q0=function(e){return V(Rl(e),Ua(Yf(Hn)))},eI=function(e){var t=Q0(e);return function(n){return vt(n)?t(n):X0}},tI=function(e){return function(t){return function(){return yc(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,fr(t))().then(Wu(jf)))}}},nI=function(e){var t=tI(e);return function(n){return vt(n)?t(n):X0}},yce=eI,tj=function(e){return eI(function(t,n){return e(n)})},bce=tj(j),_ce=nI,nj=function(e){return nI(function(t,n){return e(n)})},Sce=nj(j),$ce={URI:gt,bimap:ag,mapLeft:ug,map:dn,of:Xn,ap:za,chain:Ka,alt:K0,fromIO:Ba,fromTask:xl,throwError:pp},Tce={URI:gt,bimap:ag,mapLeft:ug,map:dn,of:Xn,ap:z0,chain:Ka,alt:K0,fromIO:Ba,fromTask:xl,throwError:pp},Ice=Yt(KD),Oce=Nr(VD),wce=function(e){return Yt(Qv)(Vf(e))};function Rce(e){var t=J0(up,e),n=qD(e);return{URI:gt,_E:void 0,map:dn,ap:t.ap,of:Xn,chain:Ka,bimap:ag,mapLeft:ug,alt:n.alt,fromIO:Ba,fromTask:xl,throwError:pp}}const Ece=Object.freeze(Object.defineProperty({__proto__:null,Alt:Qse,ApT:X0,ApplicativePar:Vse,ApplicativeSeq:VD,ApplyPar:sg,ApplySeq:KD,Bifunctor:Xse,Chain:vi,Do:hce,FromEither:Ho,FromIO:cg,FromTask:lg,Functor:Y0,Monad:Hse,MonadIO:Gse,MonadTask:Jse,MonadThrow:Yse,Pointed:Bse,URI:gt,alt:G0,altW:jse,ap:H0,apFirst:BD,apFirstW:zse,apS:ej,apSW:gce,apSecond:zD,apSecondW:Kse,apW:Lse,bimap:LD,bind:QD,bindTo:mce,bindW:vce,bracket:pce,bracketW:Z0,chain:fp,chainEitherK:GD,chainEitherKW:rce,chainFirst:HD,chainFirstEitherK:JD,chainFirstEitherKW:ice,chainFirstIOK:cce,chainFirstTaskK:fce,chainFirstW:Zse,chainIOEitherK:Pse,chainIOEitherKW:PD,chainIOK:sce,chainNullableK:Cse,chainOptionK:nce,chainTaskK:lce,chainTaskOptionK:Wse,chainTaskOptionKW:FD,chainW:dp,filterOrElse:YD,filterOrElseW:ace,flap:Use,flatten:Dse,flattenW:jD,fold:$se,foldW:Tse,fromEither:q0,fromEitherK:uce,fromIO:Ba,fromIOEither:U0,fromIOEitherK:WD,fromIOK:ZD,fromNullable:Rse,fromNullableK:Ese,fromOption:ece,fromOptionK:tce,fromPredicate:oce,fromTask:xl,fromTaskK:XD,fromTaskOption:ED,fromTaskOptionK:ND,getAltTaskValidation:qD,getApplicativeTaskValidation:J0,getApplyMonoid:Oce,getApplySemigroup:Ice,getCompactable:UD,getFilterable:qse,getOrElse:xD,getOrElseW:Ise,getSemigroup:wce,getTaskValidation:Rce,left:P0,leftIO:RD,leftTask:D0,map:V0,mapLeft:DD,match:CD,matchE:B0,matchEW:MD,matchW:Sse,of:Xn,orElse:AD,orElseFirst:og,orElseFirstIOK:kse,orElseFirstTaskK:Ase,orElseFirstW:xse,orElseW:Mse,orLeft:Nse,right:L0,rightIO:j0,rightTask:ig,sequenceArray:bce,sequenceSeqArray:Sce,swap:Fse,taskEither:$ce,taskEitherSeq:Tce,taskify:dce,throwError:pp,toUnion:wse,traverseArray:tj,traverseArrayWithIndex:yce,traverseReadonlyArrayWithIndex:eI,traverseReadonlyArrayWithIndexSeq:nI,traverseReadonlyNonEmptyArrayWithIndex:Q0,traverseReadonlyNonEmptyArrayWithIndexSeq:tI,traverseSeqArray:nj,traverseSeqArrayWithIndex:_ce,tryCatch:kD,tryCatchK:Ose},Symbol.toStringTag,{value:"Module"}));var Va=Hi,fg=Xc(cp),rI=Ju(cp),iI=V(ig,Va),rj=V(D0,Va),oI=function(e){return V(e,L0)},ij=function(e){return V(e,P0)},oj=Qc(fn),Cce=el(fn),aI=V(j0,Va),aj=V(RD,Va),uj=Ur,sj=oI,Ha=aI,kl=iI,uI=V(U0,Va),sI=function(e){return V(e,q0)},cj=Nd(fn),Mce=cj,cI=al(Qi),xce=cI,lj=cI,kce=lj,fj=ul(Vo),Ace=fj,Nce=Pd(fn),Fce=hv(cp),Wce=mv(cp),Pce=Y$(Vo),Lce=Ld,dj=Dd,Dce=dj,pj=Zu(Vo),jce=pj,hj=Fd(Vo),qce=hj,Uce=Wd(Vo),Bce=sl(fn),mj=function(e){return V(e,uI)},vj=function(e){return Al(mj(e))},zce=vj,lI=function(e){return V(e,Va)},gj=function(e){return Al(lI(e))},Kce=gj,yj=function(e){return gg(lI(e))},Vce=yj,fI=function(e){return V(e,sI)},bj=function(e){return Al(fI(e))},Hce=bj,_j=function(e){return gg(fI(e))},Gce=_j,pn=function(e,t){return y(e,hp(t))},Ga=function(e,t){return y(e,vI(t))},dI=function(e,t){return y(e,hg(function(n){return y(t,hp(n))}))},Ja=function(e,t){return y(e,hg(t))},pI=function(e,t){return y(e,mg(t))},dg=function(e,t,n){return y(e,hI(t,n))},pg=function(e,t){return y(e,mI(t))},hp=tl(fn),hI=il(fn),mI=ol(fn),vI=nl(lp),Jce=vI,Qn=rI,hg=Yu(Vo),Al=hg,Sj=Al(j),Yce=Sj,mg=rl(Vo),$j=mg,mp=fg,pt="ReaderTaskEither",Tj=function(e){var t=Fu(e);return{URI:pt,_E:void 0,compact:Ki(fn,t),separate:Ro(fn,t,Ra)}};function Zce(e){var t=$c(e),n=Tj(e),r=Eo(fn,t),i=Co(fn,t),o=Pa(fn,t),a=La(fn,t);return{URI:pt,_E:void 0,map:pn,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 Ij(e,t){var n=go(Ao,J0(e,t));return{URI:pt,_E:void 0,map:pn,ap:function(r,i){return y(r,n(i))},of:Qn}}function Oj(e){var t=Ad(Vo,e);return{URI:pt,_E:void 0,map:pn,alt:function(n,r){return y(n,t(r))}}}var fs={URI:pt,map:pn},Xce=ze(fs),gI={URI:pt,of:Qn},vg={URI:pt,map:pn,ap:Ga},wj=wt(vg),Qce=wj,Rj=Rt(vg),ele=Rj,tle={URI:pt,map:pn,ap:Ga,of:Qn},Ej={URI:pt,map:pn,ap:dI},Cj={URI:pt,map:pn,ap:dI,of:Qn},Ln={URI:pt,map:pn,ap:Ga,chain:Ja},nle={URI:pt,map:pn,ap:Ga,chain:Ja,of:Qn},rle={URI:pt,map:pn,ap:Ga,chain:Ja,of:Qn,fromIO:Ha},ile={URI:pt,map:pn,ap:Ga,chain:Ja,of:Qn,fromIO:Ha,fromTask:kl},ole={URI:pt,map:pn,ap:Ga,chain:Ja,of:Qn,throwError:mp},Mj=lt(Ln),gg=Mj,ale={URI:pt,bimap:dg,mapLeft:pg},ule={URI:pt,map:pn,alt:pI},Nl={URI:pt,fromReader:sj},sle=qd(Nl),cle=Ud(Nl),lle=es(Nl),xj=Bd(Nl,Ln),fle=xj,kj=zd(Nl,Ln),dle=kj,yI=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return oj(e.apply(void 0,t))}},Aj=function(e){return Al(yI(e))},ple=Aj,Nj=function(e){return gg(yI(e))},hle=Nj,Go={URI:pt,fromEither:uj},mle=Li(Go),vle=Di(Go),gle=ku(Go,Ln),Fj=yo(Go,Ln),yle=Fj,Wj=bo(Go,Ln),ble=Wj,_le=Oa(Go),Pj=Au(Go,Ln),Sle=Pj,$le=dr(Go),yg={URI:pt,fromIO:Ha},Tle=Vi(yg),Ile=Mo(yg,Ln),Ole=xo(yg,Ln),bg={URI:pt,fromIO:Ha,fromTask:kl},wle=ts(bg),Rle=cl(bg,Ln),Ele=ll(bg,Ln);function Cle(e,t,n){return Lj(e,t,n)}function Lj(e,t,n){return function(r){return Z0(e(r),function(i){return t(i)(r)},function(i,o){return n(i,o)(r)})}}var Mle=Qn(Jt),xle=Ct(fs),Dj=Mt(Ln),kle=Dj,jj=Et(vg),Ale=jj,bI=Qn(an),qj=function(e){return V(Qu(e),Xu(Q0(Hn)))},_I=function(e){var t=qj(e);return function(n){return vt(n)?t(n):bI}},Uj=function(e){return V(Qu(e),Xu(tI(Hn)))},SI=function(e){var t=Uj(e);return function(n){return vt(n)?t(n):bI}},Nle=_I,Bj=function(e){return _I(function(t,n){return e(n)})},Fle=Bj(j),Wle=SI,zj=function(e){return SI(function(t,n){return e(n)})},Ple=zj(j),Lle={URI:pt,map:pn,of:Qn,ap:Ga,chain:Ja,alt:pI,bimap:dg,mapLeft:pg,fromIO:Ha,fromTask:kl,throwError:mp},Dle={URI:pt,map:pn,of:Qn,ap:dI,chain:Ja,alt:pI,bimap:dg,mapLeft:pg,fromIO:Ha,fromTask:kl,throwError:mp},jle=Yt(Ej),qle=Nr(Cj),Ule=function(e){return Yt(A0)(Vf(e))};function Ble(e){var t=Ij(up,e),n=Oj(e);return{URI:pt,_E:void 0,map:pn,of:Qn,chain:Ja,bimap:dg,mapLeft:pg,ap:t.ap,alt:n.alt,fromIO:Ha,fromTask:kl,throwError:mp}}function zle(e,t){return e(t)()}const Kle=Object.freeze(Object.defineProperty({__proto__:null,Alt:ule,ApT:bI,ApplicativePar:tle,ApplicativeSeq:Cj,ApplyPar:vg,ApplySeq:Ej,Bifunctor:ale,Chain:Ln,Do:Mle,FromEither:Go,FromIO:yg,FromReader:Nl,FromTask:bg,Functor:fs,Monad:nle,MonadIO:rle,MonadTask:ile,MonadThrow:ole,Pointed:gI,URI:pt,alt:mg,altW:$j,ap:vI,apFirst:wj,apFirstW:Qce,apS:jj,apSW:Ale,apSecond:Rj,apSecondW:ele,apW:Jce,ask:sle,asks:cle,asksReaderTaskEither:Dce,asksReaderTaskEitherW:dj,bimap:hI,bind:Dj,bindTo:xle,bindW:kle,bracket:Cle,bracketW:Lj,chain:hg,chainEitherK:Fj,chainEitherKW:yle,chainFirst:Mj,chainFirstEitherK:Wj,chainFirstEitherKW:ble,chainFirstIOK:Ole,chainFirstReaderEitherK:Gce,chainFirstReaderEitherKW:_j,chainFirstReaderK:kj,chainFirstReaderKW:dle,chainFirstReaderTaskK:hle,chainFirstReaderTaskKW:Nj,chainFirstTaskEitherK:Vce,chainFirstTaskEitherKW:yj,chainFirstTaskK:Ele,chainFirstW:gg,chainIOEitherK:zce,chainIOEitherKW:vj,chainIOK:Ile,chainNullableK:Pce,chainOptionK:gle,chainReaderEitherK:Hce,chainReaderEitherKW:bj,chainReaderK:xj,chainReaderKW:fle,chainReaderTaskK:ple,chainReaderTaskKW:Aj,chainTaskEitherK:Kce,chainTaskEitherKW:gj,chainTaskK:Rle,chainW:Al,filterOrElse:Pj,filterOrElseW:Sle,flap:Xce,flatten:Yce,flattenW:Sj,fold:xce,foldW:kce,fromEither:uj,fromEitherK:$le,fromIO:Ha,fromIOEither:uI,fromIOEitherK:mj,fromIOK:Tle,fromNullable:Fce,fromNullableK:Wce,fromOption:mle,fromOptionK:vle,fromPredicate:_le,fromReader:sj,fromReaderEither:sI,fromReaderEitherK:fI,fromReaderK:lle,fromReaderTaskK:yI,fromTask:kl,fromTaskEither:Va,fromTaskEitherK:lI,fromTaskK:wle,getAltReaderTaskValidation:Oj,getApplicativeReaderTaskValidation:Ij,getApplyMonoid:qle,getApplySemigroup:jle,getCompactable:Tj,getFilterable:Zce,getOrElse:fj,getOrElseW:Ace,getReaderTaskValidation:Ble,getSemigroup:Ule,left:fg,leftIO:aj,leftReader:ij,leftReaderTask:Cce,leftTask:rj,local:Lce,map:hp,mapLeft:mI,match:cj,matchE:cI,matchEW:lj,matchW:Mce,of:Qn,orElse:pj,orElseFirst:hj,orElseFirstW:qce,orElseW:jce,orLeft:Uce,readerTaskEither:Lle,readerTaskEitherSeq:Dle,right:rI,rightIO:aI,rightReader:oI,rightReaderTask:oj,rightTask:iI,run:zle,sequenceArray:Fle,sequenceSeqArray:Ple,swap:Bce,throwError:mp,toUnion:Nce,traverseArray:Bj,traverseArrayWithIndex:Nle,traverseReadonlyArrayWithIndex:_I,traverseReadonlyArrayWithIndexSeq:SI,traverseReadonlyNonEmptyArrayWithIndex:qj,traverseReadonlyNonEmptyArrayWithIndexSeq:Uj,traverseSeqArray:zj,traverseSeqArrayWithIndex:Wle},Symbol.toStringTag,{value:"Module"}));var Kj={equals:function(e,t){return e===t}},Vj={concat:function(e,t){return e+t}},Hj="",Vle={concat:Vj.concat,empty:Hj},z={equals:Kj.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},Hle={show:function(e){return JSON.stringify(e)}},Gle=function(e){return typeof e=="string"},Jle=function(e){return e.toUpperCase()},Yle=function(e){return e.toLowerCase()},Zle=function(e,t){return function(n){return n.replace(e,t)}},Xle=function(e){return e.trim()},Qle=function(e){return e.trimLeft()},efe=function(e){return e.trimRight()},tfe=function(e,t){return function(n){return n.slice(e,t)}},nfe=function(e){return e.length===0},rfe=function(e){return e.length},ife=function(e){return function(t){var n=t.split(e);return Ui(n)?n:[t]}},ofe=function(e,t){return function(n){return n.includes(e,t)}},afe=function(e,t){return function(n){return n.startsWith(e,t)}},ufe=function(e,t){return function(n){return n.endsWith(e,t)}};const sfe=Object.freeze(Object.defineProperty({__proto__:null,Eq:Kj,Monoid:Vle,Ord:z,Semigroup:Vj,Show:Hle,empty:Hj,endsWith:ufe,includes:ofe,isEmpty:nfe,isString:Gle,replace:Zle,size:rfe,slice:tfe,split:ife,startsWith:afe,toLowerCase:Yle,toUpperCase:Jle,trim:Xle,trimLeft:Qle,trimRight:efe},Symbol.toStringTag,{value:"Module"}));var cfe=function(e){return Object.assign({},e)},lfe=function(e){return Object.assign({},e)},Gj=function(e){return Object.keys(e).length},gi=function(e){for(var t in e)if(ct.call(e,t))return!1;return!0},Fl=function(e){return function(t){return Object.keys(t).sort(e.compare)}},ffe=Fl(z);function _g(e){if(typeof e=="function")return _g(z)(e);var t=Fl(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 vp=_g(z)(function(e,t){return[e,t]});function dfe(e){return function(t){var n=vp(t),r=n.length;return e.unfold(0,function(i){return i<r?de([n[i],i+1]):ye})}}var $I=function(e,t){return function(n){if(ct.call(n,e)&&n[e]===t)return n;var r=Object.assign({},n);return r[e]=t,r}},Jo=function(e,t){return ct.call(t,e)};function Sg(e){return function(t){if(!ct.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var pfe=function(e,t){return function(n){if(!Jo(e,n))return ye;if(n[e]===t)return de(n);var r=Object.assign({},n);return r[e]=t,de(r)}},hfe=function(e,t){return function(n){if(!Jo(e,n))return ye;var r=t(n[e]);if(r===n[e])return de(n);var i=Object.assign({},n);return i[e]=r,de(i)}};function mfe(e){var t=Sg(e);return function(n){var r=ds(e,n);return Pt(r)?ye:de([r.value,t(n)])}}function $g(e){return function(t,n){if(n===void 0){var r=$g(e);return function(o){return r(o,t)}}for(var i in t)if(!ct.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function ds(e,t){return t===void 0?function(n){return ds(e,n)}:ct.call(t,e)?de(t[e]):ye}var gp={};function Tg(e){return function(t){var n={};for(var r in t)ct.call(t,r)&&(n[r]=e(r,t[r]));return n}}function TI(e){return Tg(function(t,n){return e(n)})}function Wl(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return Wl(z).apply(void 0,e);var n=Fl(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 Pl(e){if("compare"in e){var t=Fl(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 Pl(z)(e)}function Ll(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===2)return Ll(z).apply(void 0,e);var n=Fl(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 Jj=function(e,t){var n;return n={},n[e]=t,n};function Yj(e){var t=bp(z)(e);return function(n){return function(r){return t(r,n)}}}function Ig(e){var t=eo(z)(e);return function(n){return function(r){return t(r,n)}}}function Dl(e){return yp(z)(e)}var vfe=function(e){var t=Ig(e);return function(n){return function(r){return e.map(y(r,t(n)),Yo)}}},gfe=function(e){var t=Ig(e);return function(n){return function(r){return e.map(y(r,t(n)),Zo)}}};function Og(e){return function(t){var n={},r={};for(var i in t)if(ct.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 Re(n,r)}}function wg(e){return function(t){var n={},r={};for(var i in t)if(ct.call(t,i)){var o=t[i];e(i,o)?r[i]=o:n[i]=o}return Re(n,r)}}function Rg(e){return function(t){var n={};for(var r in t)if(ct.call(t,r)){var i=e(r,t[r]);yt(i)&&(n[r]=i.value)}return n}}function Eg(e){return function(t){var n={},r=!1;for(var i in t)if(ct.call(t,i)){var o=t[i];e(i,o)?n[i]=o:r=!0}return r?n:t}}function Zj(e,t){var n=II(e,t);return function(r){return n(r,j)}}function II(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]=ct.call(i,u)?e.concat(i[u],s):s,i})}}var yfe=vp,bfe=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 Xj(e){return function(t){for(var n in t)if(!e(t[n]))return!1;return!0}}function Qj(e){return function(t){for(var n in t)if(e(t[n]))return!0;return!1}}function OI(e){return function(t,n){if(n===void 0){var r=OI(e);return function(o){return r(t,o)}}for(var i in n)if(e.equals(n[i],t))return!0;return!1}}var wI=function(e){return function(t){return function(n){if(gi(n))return t;if(gi(t))return n;var r={};for(var i in n)Jo(i,t)?r[i]=e.concat(n[i],t[i]):r[i]=n[i];for(var i in t)Jo(i,r)||(r[i]=t[i]);return r}}},RI=function(e){return function(t){return function(n){if(gi(n)||gi(t))return gp;var r={};for(var i in n)Jo(i,t)&&(r[i]=e.concat(n[i],t[i]));return r}}},EI=function(e){return function(t){if(gi(t))return e;if(gi(e))return t;var n={};for(var r in t)Jo(r,e)||(n[r]=t[r]);for(var r in e)Jo(r,t)||(n[r]=e[r]);return n}},mr=function(e,t){return y(e,TI(t))},ps=function(e,t){return y(e,Tg(t))},vr=function(e){var t=_p(e);return function(n,r,i){return y(n,t(r,i))}},gr=function(e){return function(t){var n=Sp(e)(t);return function(r,i){return y(r,n(i))}}},yr=function(e){var t=$p(e);return function(n,r,i){return y(n,t(r,i))}},hs=function(e,t){return y(e,Ag(t))},ms=function(e,t){return y(e,CI(t))},vs=function(e,t){return y(e,Ng(t))},gs=function(e,t){return y(e,MI(t))},ys=function(e){var t=Wl(e);return function(n,r,i){return y(n,t(r,i))}},bs=function(e){var t=Pl(e);return function(n){var r=t(n);return function(i,o){return y(i,r(o))}}},_s=function(e){var t=Ll(e);return function(n,r,i){return y(n,t(r,i))}},Cg=function(e,t){return y(e,Og(t))},Mg=function(e,t){return y(e,wg(t))},xg=function(e,t){return y(e,Rg(t))},kg=function(e,t){return y(e,Eg(t))},eo=function(e){var t=bp(e);return function(n){var r=t(n);return function(i,o){return r(i,V(Hn,o))}}},yp=function(e){var t=eo(e);return function(n){var r=t(n);return function(i){return r(i,j)}}},bp=function(e){return function(t){var n=Fl(e);return function(r,i){var o=n(r);if(o.length===0)return t.of(gp);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}}},Ag=function(e){return Eg(function(t,n){return e(n)})},CI=function(e){return Rg(function(t,n){return e(n)})},Ng=function(e){return wg(function(t,n){return e(n)})},MI=function(e){return Og(function(t,n){return e(n)})};function _p(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=Wl(e[0]);return function(r,i){return n(r,function(o,a,u){return i(a,u)})}}return _p(z).apply(void 0,e)}function Sp(e){if("compare"in e){var t=Pl(e);return function(n){var r=t(n);return function(i){return r(function(o,a){return i(a)})}}}return Sp(z)(e)}function $p(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length===1){var n=Ll(e[0]);return function(r,i){return n(r,function(o,a,u){return i(a,u)})}}return $p(z).apply(void 0,e)}var Yo=function(e){var t={};for(var n in e)if(ct.call(e,n)){var r=e[n];yt(r)&&(t[n]=r.value)}return t},Zo=function(e){var t={},n={};for(var r in e)if(ct.call(e,r)){var i=e[r];Gt(i)?t[r]=i.left:n[r]=i.right}return Re(t,n)},hn="ReadonlyRecord";function Fg(e){return"compare"in e?function(t){return{show:function(n){var r=_g(e)(function(i,o){return"".concat(JSON.stringify(i),": ").concat(t.show(o))})(n).join(", ");return r===""?"{}":"{ ".concat(r," }")}}}:Fg(z)(e)}function eq(e){var t=$g(e);return Wr(function(n,r){return t(n)(r)&&t(r)(n)})}function tq(e){return{concat:function(t,n){if(gi(t))return n;if(gi(n))return t;var r=Object.assign({},t);for(var i in n)ct.call(n,i)&&(r[i]=ct.call(t,i)?e.concat(t[i],n[i]):n[i]);return r},empty:gp}}var nq={URI:hn,map:mr},_fe=ze(nq),Sfe={URI:hn,map:mr,mapWithIndex:ps},$fe=function(e){return{URI:hn,reduce:vr(e),foldMap:gr(e),reduceRight:yr(e)}},Tfe=function(e){return{URI:hn,reduce:vr(e),foldMap:gr(e),reduceRight:yr(e),reduceWithIndex:ys(e),foldMapWithIndex:bs(e),reduceRightWithIndex:_s(e)}},Tp={URI:hn,compact:Yo,separate:Zo},Ife={URI:hn,map:mr,compact:Yo,separate:Zo,filter:hs,filterMap:ms,partition:vs,partitionMap:gs},Ofe={URI:hn,map:mr,mapWithIndex:ps,compact:Yo,separate:Zo,filter:hs,filterMap:ms,partition:vs,partitionMap:gs,filterMapWithIndex:xg,filterWithIndex:kg,partitionMapWithIndex:Cg,partitionWithIndex:Mg},rq=function(e){return{URI:hn,map:mr,reduce:vr(e),foldMap:gr(e),reduceRight:yr(e),traverse:eo(e),sequence:yp(e)}},wfe=function(e){return{URI:hn,map:mr,mapWithIndex:ps,reduce:vr(e),foldMap:gr(e),reduceRight:yr(e),reduceWithIndex:ys(e),foldMapWithIndex:bs(e),reduceRightWithIndex:_s(e),traverse:eo(e),sequence:yp(e),traverseWithIndex:bp(e)}},Rfe=function(e){var t=rq(e);return{URI:hn,map:mr,reduce:vr(e),foldMap:gr(e),reduceRight:yr(e),traverse:t.traverse,sequence:t.sequence,compact:Yo,separate:Zo,filter:hs,filterMap:ms,partition:vs,partitionMap:gs,wither:ri(t,Tp),wilt:ni(t,Tp)}},iq=function(e){var t=wI(e);return{concat:function(n,r){return t(r)(n)}}},Efe=function(e){return{concat:iq(e).concat,empty:gp}},Cfe=function(e){var t=RI(e);return{concat:function(n,r){return t(r)(n)}}},Mfe=function(){return{concat:function(e,t){return EI(t)(e)}}},xfe={URI:hn,reduce:vr(z),foldMap:gr(z),reduceRight:yr(z)},kfe={URI:hn,reduce:vr(z),foldMap:gr(z),reduceRight:yr(z),reduceWithIndex:ys(z),foldMapWithIndex:bs(z),reduceRightWithIndex:_s(z)},xI={URI:hn,map:mr,reduce:vr(z),foldMap:gr(z),reduceRight:yr(z),traverse:eo(z),sequence:Dl},Afe={URI:hn,map:mr,mapWithIndex:ps,reduce:vr(z),foldMap:gr(z),reduceRight:yr(z),reduceWithIndex:ys(z),foldMapWithIndex:bs(z),reduceRightWithIndex:_s(z),traverse:eo(z),sequence:Dl,traverseWithIndex:bp(z)},oq=ri(xI,Tp),aq=ni(xI,Tp),Nfe={URI:hn,map:mr,reduce:vr(z),foldMap:gr(z),reduceRight:yr(z),traverse:eo(z),sequence:Dl,compact:Yo,separate:Zo,filter:hs,filterMap:ms,partition:vs,partitionMap:gs,wither:oq,wilt:aq},kI=$I;function uq(e,t){return ct.call(t===void 0?this:t,e)}var Ffe={URI:hn,map:mr,reduce:vr(z),foldMap:gr(z),reduceRight:yr(z),traverse:eo(z),sequence:Dl,compact:Yo,separate:Zo,filter:hs,filterMap:ms,partition:vs,partitionMap:gs,mapWithIndex:ps,reduceWithIndex:ys(z),foldMapWithIndex:bs(z),reduceRightWithIndex:_s(z),filterMapWithIndex:xg,filterWithIndex:kg,partitionMapWithIndex:Cg,partitionWithIndex:Mg,traverseWithIndex:bp(z),wither:oq,wilt:aq};const Wfe=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Tp,Filterable:Ife,FilterableWithIndex:Ofe,Foldable:xfe,FoldableWithIndex:kfe,Functor:nq,FunctorWithIndex:Sfe,Traversable:xI,TraversableWithIndex:Afe,URI:hn,Witherable:Nfe,_filter:hs,_filterMap:ms,_filterMapWithIndex:xg,_filterWithIndex:kg,_foldMap:gr,_foldMapWithIndex:bs,_map:mr,_mapWithIndex:ps,_partition:vs,_partitionMap:gs,_partitionMapWithIndex:Cg,_partitionWithIndex:Mg,_reduce:vr,_reduceRight:yr,_reduceRightWithIndex:_s,_reduceWithIndex:ys,_sequence:yp,_traverse:eo,collect:_g,compact:Yo,deleteAt:Sg,difference:EI,elem:OI,empty:gp,every:Xj,filter:Ag,filterMap:CI,filterMapWithIndex:Rg,filterWithIndex:Eg,flap:_fe,foldMap:Sp,foldMapWithIndex:Pl,fromEntries:bfe,fromFoldable:Zj,fromFoldableMap:II,fromRecord:cfe,getDifferenceMagma:Mfe,getEq:eq,getFoldable:$fe,getFoldableWithIndex:Tfe,getIntersectionSemigroup:Cfe,getMonoid:tq,getShow:Fg,getTraversable:rq,getTraversableWithIndex:wfe,getUnionMonoid:Efe,getUnionSemigroup:iq,getWitherable:Rfe,has:Jo,hasOwnProperty:uq,insertAt:kI,intersection:RI,isEmpty:gi,isSubrecord:$g,keys:ffe,lookup:ds,map:TI,mapWithIndex:Tg,modifyAt:hfe,partition:Ng,partitionMap:MI,partitionMapWithIndex:Og,partitionWithIndex:wg,pop:mfe,readonlyRecord:Ffe,reduce:_p,reduceRight:$p,reduceRightWithIndex:Ll,reduceWithIndex:Wl,separate:Zo,sequence:Dl,singleton:Jj,size:Gj,some:Qj,toEntries:yfe,toReadonlyArray:vp,toRecord:lfe,toUnfoldable:dfe,traverse:Ig,traverseWithIndex:Yj,union:wI,updateAt:pfe,upsertAt:$I,wilt:gfe,wither:vfe},Symbol.toStringTag,{value:"Module"}));var Pfe=function(e){return new Set(e)},Lfe=function(e){return new Set([e])},sq=function(e){return function(t){for(var n=t.length,r=new Set,i=mn(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}};function Dfe(e){return new Set(e)}function jfe(e){var t=mn(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 qfe(e){var t=mn(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 AI(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 Ufe(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 Re(o,i)}}function NI(e){var t=mn(e);return function(n,r){if(r===void 0){var i=NI(e);return function(a){return i(n,a)}}if(Ip(n))return r;if(Ip(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function FI(e){var t=mn(e);return function(n,r){if(r===void 0){var i=FI(e);return function(a){return i(a,n)}}if(Ip(n)||Ip(r))return PI;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function Bfe(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,u=new Set,s=mn(e),c=mn(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 Re(a,u)}}}function WI(e){var t=mn(e);return function(n,r){if(r===void 0){var i=WI(e);return function(o){return i(o,n)}}return AI(function(o){return!t(o,r)})(n)}}function cq(e){var t=Wg(e);return function(n,r){return function(i){return t(i).reduce(r,n)}}}function lq(e,t){var n=Wg(e);return function(r){return function(i){return n(i).reduce(function(o,a){return t.concat(o,r(a))},t.empty)}}}var fq=function(e){var t=Wg(e);return function(n,r){return function(i){return t(i).reduceRight(function(o,a){return r(a,o)},n)}}};function dq(e){var t=mn(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var pq=function(e){return function(t){return function(n){return AI(function(r){return!e.equals(t,r)})(n)}}},zfe=function(e){var t=mn(e),n=pq(e),r=dq(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},Kfe=function(e){return hq(e)(j)};function Vfe(e,t){return function(n){var r=mn(e),i=mn(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}}),Re(o,a)}}function hq(e){var t=mn(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 PI=new Set,Ip=function(e){return e.size===0},Hfe=function(e){return e.size},LI=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 DI(e){return Ed(LI(Ed(e)))}function Op(e){var t=mn(e);return function(n,r){if(r===void 0){var i=Op(e);return function(o){return i(o,n)}}return DI(function(o){return t(o,r)})(n)}}function mn(e){return function(t,n){if(n===void 0){var r=mn(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 Wg=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},Gfe="ReadonlySet";function mq(e){return{show:function(t){var n=[];return t.forEach(function(r){n.push(e.show(r))}),"new Set([".concat(n.sort().join(", "),"])")}}}function vq(e){var t=Op(e);return Wr(function(n,r){return t(n,r)&&t(r,n)})}var gq=function(e){return{concat:NI(e)}},Jfe=function(e){return{concat:gq(e).concat,empty:PI}},Yfe=function(e){return{concat:FI(e)}},Zfe=function(e){return{concat:WI(e)}},Xfe=sq;const Qfe=Object.freeze(Object.defineProperty({__proto__:null,URI:Gfe,chain:qfe,compact:Kfe,difference:WI,elem:mn,empty:PI,every:DI,filter:AI,filterMap:hq,foldMap:lq,fromArray:Xfe,fromReadonlyArray:sq,fromSet:Pfe,getDifferenceMagma:Zfe,getEq:vq,getIntersectionSemigroup:Yfe,getShow:mq,getUnionMonoid:Jfe,getUnionSemigroup:gq,insert:dq,intersection:FI,isEmpty:Ip,isSubset:Op,map:jfe,partition:Ufe,partitionMap:Bfe,reduce:cq,reduceRight:fq,remove:pq,separate:Vfe,singleton:Lfe,size:Hfe,some:LI,toReadonlyArray:Wg,toSet:Dfe,toggle:zfe,union:NI},Symbol.toStringTag,{value:"Module"}));function Qt(e){return e[0]}function wn(e){return e[1]}var ede=function(e){return[wn(e),Qt(e)]};function jI(e){return{URI:br,_E:void 0,map:wp,ap:function(t,n){return[Qt(t)(Qt(n)),e.concat(wn(t),wn(n))]}}}var yq=function(e){return function(t){return[t,e.empty]}};function tde(e){var t=jI(e);return{URI:br,_E:void 0,map:t.map,ap:t.ap,of:yq(e)}}function qI(e){var t=jI(e);return{URI:br,_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 nde(e){var t=qI(e);return{URI:br,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:yq(e)}}function rde(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=qI(e);return{URI:br,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var bq=function(e,t){return y(e,Oq(t))},wp=function(e,t){return y(e,KI(t))},_q=function(e,t,n){return y(e,Iq(t,n))},Sq=function(e,t){return y(e,VI(t))},$q=function(e,t){return y(e,HI(t))},UI=function(e,t,n){return y(e,GI(t,n))},BI=function(e){var t=JI();return function(n,r){return y(n,t(r))}},zI=function(e,t,n){return y(e,YI(t,n))},Tq=function(e){var t=wq(e);return function(n,r){return y(n,t(r))}},Iq=function(e,t){return function(n){return[t(Qt(n)),e(wn(n))]}},KI=function(e){return function(t){return[e(Qt(t)),wn(t)]}},VI=function(e){return function(t){return[Qt(t),e(wn(t))]}},Oq=function(e){return function(t){return[Qt(t),wn(e)]}},HI=function(e){return function(t){return[e(t),wn(t)]}},Pg=Qt,ide=HI(j),GI=function(e,t){return function(n){return t(e,Qt(n))}},JI=function(){return function(e){return function(t){return e(Qt(t))}}},YI=function(e,t){return function(n){return t(Qt(n),e)}},wq=function(e){return function(t){return function(n){return e.map(t(Qt(n)),function(r){return[r,wn(n)]})}}},ZI=function(e){return function(t){return e.map(Qt(t),function(n){return[n,wn(t)]})}},br="ReadonlyTuple",Rq={URI:br,map:wp},ode=ze(Rq),ade={URI:br,bimap:_q,mapLeft:Sq},ude={URI:br,compose:bq},sde={URI:br,map:wp,extend:$q,extract:Pg},cde={URI:br,reduce:UI,foldMap:BI,reduceRight:zI},lde={URI:br,map:wp,reduce:UI,foldMap:BI,reduceRight:zI,traverse:Tq,sequence:ZI},fde=KI,dde=VI,pde={URI:br,compose:bq,map:wp,bimap:_q,mapLeft:Sq,extract:Pg,extend:$q,reduce:UI,foldMap:BI,reduceRight:zI,traverse:Tq,sequence:ZI};const hde=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:ade,Comonad:sde,Foldable:cde,Functor:Rq,Semigroupoid:ude,Traversable:lde,URI:br,bimap:Iq,compose:Oq,duplicate:ide,extend:HI,extract:Pg,flap:ode,foldMap:JI,fst:Qt,getApplicative:tde,getApply:jI,getChain:qI,getChainRec:rde,getMonad:nde,map:fde,mapFst:KI,mapLeft:dde,mapSnd:VI,readonlyTuple:pde,reduce:GI,reduceRight:YI,sequence:ZI,snd:wn,swap:ede,traverse:wq},Symbol.toStringTag,{value:"Module"}));var jl=globalThis&&globalThis.__assign||function(){return jl=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},jl.apply(this,arguments)},mde=Gj,Ss=gi,XI=function(e){return function(t){return Object.keys(t).sort(e.compare)}},vde=XI(z);function QI(e){if(typeof e=="function")return QI(z)(e);var t=XI(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 eO=QI(z)(function(e,t){return[e,t]});function gde(e){return function(t){var n=eO(t),r=n.length;return e.unfold(0,function(i){return i<r?de([n[i],i+1]):ye})}}var Eq=$I,Cq=Jo;function Mq(e){return function(t){if(!ct.call(t,e))return t;var n=Object.assign({},t);return delete n[e],n}}var yde=function(e,t){return xq(e,function(){return t})},xq=function(e,t){return function(n){if(!Cq(e,n))return ye;var r=Object.assign({},n);return r[e]=t(n[e]),de(r)}};function bde(e){var t=Mq(e);return function(n){var r=kq(e,n);return Pt(r)?ye:de([r.value,t(n)])}}var _de=$g,kq=ds,Sde=Tg,$de=TI;function Tde(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?Wl(e[0]):Wl(z).apply(void 0,e)}function Ide(e){return"compare"in e?Pl(e):Pl(z)(e)}function Ode(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?Ll(e[0]):Ll(z).apply(void 0,e)}var wde=Jj;function Rde(e){return Yj(e)}function tO(e){return Ig(e)}function Rp(e){return Dl(e)}var Ede=function(e){var t=tO(e);return function(n){return function(r){return e.map(y(r,t(n)),Ya)}}},Cde=function(e){var t=tO(e);return function(n){return function(r){return e.map(y(r,t(n)),Za)}}},Mde=Og;function xde(e){return wg(e)}var kde=Rg;function Ade(e){return Eg(e)}function Aq(e,t){return Zj(e,t)}var Nde=eO,Fde=function(e){return Aq(sm(),kN)(e)};function Wde(e,t){return II(e,t)}var Pde=Xj,Lde=Qj,Dde=OI,Nq=function(e){var t=wI(e);return function(n){return function(r){return Ss(r)?jl({},n):Ss(n)?jl({},r):t(n)(r)}}},Fq=function(e){return function(t){return function(n){return Ss(n)||Ss(t)?{}:RI(e)(t)(n)}}},Wq=function(e){return function(t){return Ss(t)?jl({},e):Ss(e)?jl({},t):EI(e)(t)}},yi=mr,Ep=ps,bi=vr,_i=gr,Si=yr,Cp=hs,Mp=ms,xp=vs,kp=gs,Ap=ys,Np=bs,Fp=_s,Pq=Cg,Lq=Mg,Dq=xg,jq=kg,ql=eo,qq=yp,nO=function(e){return function(t){var n=XI(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}}},jde=Ag,qde=CI,Ude=Ng,Bde=MI;function zde(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?_p(e[0]):_p(z).apply(void 0,e)}function Kde(e){return"compare"in e?Sp(e):Sp(z)(e)}function Vde(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===1?$p(e[0]):$p(z).apply(void 0,e)}var Ya=Yo,Za=Zo,vn="Record";function Hde(e){return"compare"in e?Fg(e):Fg(z)(e)}var Gde=eq,Jde=tq,Uq={URI:vn,map:yi},Yde=ze(Uq),Zde={URI:vn,map:yi,mapWithIndex:Ep},Xde=function(e){return{URI:vn,reduce:bi(e),foldMap:_i(e),reduceRight:Si(e)}},Qde=function(e){return{URI:vn,reduce:bi(e),foldMap:_i(e),reduceRight:Si(e),reduceWithIndex:Ap(e),foldMapWithIndex:Np(e),reduceRightWithIndex:Fp(e)}},Wp={URI:vn,compact:Ya,separate:Za},epe={URI:vn,map:yi,compact:Ya,separate:Za,filter:Cp,filterMap:Mp,partition:xp,partitionMap:kp},tpe={URI:vn,map:yi,mapWithIndex:Ep,compact:Ya,separate:Za,filter:Cp,filterMap:Mp,partition:xp,partitionMap:kp,filterMapWithIndex:Dq,filterWithIndex:jq,partitionMapWithIndex:Pq,partitionWithIndex:Lq},Bq=function(e){return{URI:vn,map:yi,reduce:bi(e),foldMap:_i(e),reduceRight:Si(e),traverse:ql(e),sequence:qq(e)}},npe=function(e){return{URI:vn,map:yi,mapWithIndex:Ep,reduce:bi(e),foldMap:_i(e),reduceRight:Si(e),reduceWithIndex:Ap(e),foldMapWithIndex:Np(e),reduceRightWithIndex:Fp(e),traverse:ql(e),sequence:qq(e),traverseWithIndex:nO(e)}},rpe=function(e){var t=Bq(e);return{URI:vn,map:yi,reduce:bi(e),foldMap:_i(e),reduceRight:Si(e),traverse:t.traverse,sequence:t.sequence,compact:Ya,separate:Za,filter:Cp,filterMap:Mp,partition:xp,partitionMap:kp,wither:ri(t,Wp),wilt:ni(t,Wp)}},zq=function(e){var t=Nq(e);return{concat:function(n,r){return t(r)(n)}}},ipe=function(e){return{concat:zq(e).concat,empty:{}}},ope=function(e){var t=Fq(e);return{concat:function(n,r){return t(r)(n)}}},ape=function(){return{concat:function(e,t){return Wq(t)(e)}}},upe={URI:vn,reduce:bi(z),foldMap:_i(z),reduceRight:Si(z)},spe={URI:vn,reduce:bi(z),foldMap:_i(z),reduceRight:Si(z),reduceWithIndex:Ap(z),foldMapWithIndex:Np(z),reduceRightWithIndex:Fp(z)},rO={URI:vn,map:yi,reduce:bi(z),foldMap:_i(z),reduceRight:Si(z),traverse:ql(z),sequence:Rp},cpe={URI:vn,map:yi,mapWithIndex:Ep,reduce:bi(z),foldMap:_i(z),reduceRight:Si(z),reduceWithIndex:Ap(z),foldMapWithIndex:Np(z),reduceRightWithIndex:Fp(z),traverse:ql(z),sequence:Rp,traverseWithIndex:nO(z)},Kq=ri(rO,Wp),Vq=ni(rO,Wp),lpe={URI:vn,map:yi,reduce:bi(z),foldMap:_i(z),reduceRight:Si(z),traverse:ql(z),sequence:Rp,compact:Ya,separate:Za,filter:Cp,filterMap:Mp,partition:xp,partitionMap:kp,wither:Kq,wilt:Vq},fpe={},dpe=Eq,ppe=uq,hpe={URI:vn,map:yi,reduce:bi(z),foldMap:_i(z),reduceRight:Si(z),traverse:ql(z),sequence:Rp,compact:Ya,separate:Za,filter:Cp,filterMap:Mp,partition:xp,partitionMap:kp,mapWithIndex:Ep,reduceWithIndex:Ap(z),foldMapWithIndex:Np(z),reduceRightWithIndex:Fp(z),filterMapWithIndex:Dq,filterWithIndex:jq,partitionMapWithIndex:Pq,partitionWithIndex:Lq,traverseWithIndex:nO(z),wither:Kq,wilt:Vq};const mpe=Object.freeze(Object.defineProperty({__proto__:null,Compactable:Wp,Filterable:epe,FilterableWithIndex:tpe,Foldable:upe,FoldableWithIndex:spe,Functor:Uq,FunctorWithIndex:Zde,Traversable:rO,TraversableWithIndex:cpe,URI:vn,Witherable:lpe,collect:QI,compact:Ya,deleteAt:Mq,difference:Wq,elem:Dde,empty:fpe,every:Pde,filter:jde,filterMap:qde,filterMapWithIndex:kde,filterWithIndex:Ade,flap:Yde,foldMap:Kde,foldMapWithIndex:Ide,fromEntries:Fde,fromFoldable:Aq,fromFoldableMap:Wde,getDifferenceMagma:ape,getEq:Gde,getFoldable:Xde,getFoldableWithIndex:Qde,getIntersectionSemigroup:ope,getMonoid:Jde,getShow:Hde,getTraversable:Bq,getTraversableWithIndex:npe,getUnionMonoid:ipe,getUnionSemigroup:zq,getWitherable:rpe,has:Cq,hasOwnProperty:ppe,insertAt:dpe,intersection:Fq,isEmpty:Ss,isSubrecord:_de,keys:vde,lookup:kq,map:$de,mapWithIndex:Sde,modifyAt:xq,partition:Ude,partitionMap:Bde,partitionMapWithIndex:Mde,partitionWithIndex:xde,pop:bde,record:hpe,reduce:zde,reduceRight:Vde,reduceRightWithIndex:Ode,reduceWithIndex:Tde,separate:Za,sequence:Rp,singleton:wde,size:mde,some:Lde,toArray:eO,toEntries:Nde,toUnfoldable:gde,traverse:tO,traverseWithIndex:Rde,union:Nq,updateAt:yde,upsertAt:Eq,wilt:Cde,wither:Ede},Symbol.toStringTag,{value:"Module"}));var vpe=function(e){return function(t){return yt(e(t))}},gpe=function(e){return function(t){return Kb(e(t))}},ype=function(){return function(e){return!0}},bpe=function(e){return function(t){return!e(t)}},_pe=function(e){return function(t){return function(n){return t(n)||e(n)}}},Spe=function(e){return function(t){return function(n){return t(n)&&e(n)}}},$pe=function(){return function(e){return!1}},Tpe=function(e){return function(t){return function(n){return t(n)&&e(n)}}};const Ipe=Object.freeze(Object.defineProperty({__proto__:null,and:Spe,compose:Tpe,fromEitherK:gpe,fromOptionK:vpe,id:ype,not:bpe,or:_pe,zero:$pe},Symbol.toStringTag,{value:"Module"}));var Hq=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])})}}},Ope=function(e){return function(t){return e.sub(e.zero,t)}},wpe=Hq,Rpe=VC;const Epe=Object.freeze(Object.defineProperty({__proto__:null,getFunctionRing:Rpe,getTupleRing:wpe,negate:Ope,tuple:Hq},Symbol.toStringTag,{value:"Module"})),Cpe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Mpe=Ub;const xpe=Object.freeze(Object.defineProperty({__proto__:null,getFunctionSemiring:Mpe},Symbol.toStringTag,{value:"Module"}));var kpe=mq,Ape=vq;function Npe(e){var t=er(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 Fpe(e){var t=er(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 iO(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 Wpe(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 Re(o,i)}}function oO(e){var t=er(e);return function(n,r){if(r===void 0){var i=oO(e);return function(a){return i(n,a)}}if(Pp(n))return r;if(Pp(r))return n;var o=new Set(n);return r.forEach(function(a){t(a,o)||o.add(a)}),o}}function aO(e){var t=er(e);return function(n,r){if(r===void 0){var i=aO(e);return function(a){return i(a,n)}}if(Pp(n)||Pp(r))return new Set;var o=new Set;return n.forEach(function(a){t(a,r)&&o.add(a)}),o}}function Ppe(e,t){return function(n){return function(r){for(var i=r.values(),o,a=new Set,u=new Set,s=er(e),c=er(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 Re(a,u)}}}function uO(e){var t=er(e);return function(n,r){if(r===void 0){var i=uO(e);return function(o){return i(o,n)}}return iO(function(o){return!t(o,r)})(n)}}var Gq=function(e){return{concat:oO(e)}},Lpe=function(e){return{concat:Gq(e).concat,empty:new Set}},Dpe=function(e){return{concat:aO(e)}},jpe=function(e){return{concat:uO(e)}},qpe=cq,Upe=lq,Bpe=fq,zpe=function(e){return new Set([e])};function Jq(e){var t=er(e);return function(n){return function(r){if(t(n)(r))return r;var i=new Set(r);return i.add(n),i}}}var Yq=function(e){return function(t){return function(n){return iO(function(r){return!e.equals(t,r)})(n)}}},Kpe=function(e){var t=er(e),n=Yq(e),r=Jq(e);return function(i){return function(o){return(t(i,o)?n:r)(i)(o)}}},Zq=function(e){return function(t){for(var n=t.length,r=new Set,i=er(e),o=0;o<n;o++){var a=t[o];i(a,r)||r.add(a)}return r}},Vpe=function(e){return Xq(e)(j)};function Hpe(e,t){return function(n){var r=er(e),i=er(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}}),Re(o,a)}}function Xq(e){var t=er(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 Gpe=new Set,Pp=function(e){return e.size===0},Jpe=function(e){return e.size},Ype=LI,Qq=DI,Zpe=Op,er=mn,eU=function(e){return function(t){var n=[];return t.forEach(function(r){return n.push(r)}),n.sort(e.compare)}},Xpe=Op;const Qpe=Object.freeze(Object.defineProperty({__proto__:null,chain:Fpe,compact:Vpe,difference:uO,elem:er,empty:Gpe,every:Qq,filter:iO,filterMap:Xq,foldMap:Upe,fromArray:Zq,getDifferenceMagma:jpe,getEq:Ape,getIntersectionSemigroup:Dpe,getShow:kpe,getUnionMonoid:Lpe,getUnionSemigroup:Gq,insert:Jq,intersection:aO,isEmpty:Pp,isSubset:Zpe,map:Npe,partition:Wpe,partitionMap:Ppe,reduce:qpe,reduceRight:Bpe,remove:Yq,separate:Hpe,singleton:zpe,size:Jpe,some:Ype,subset:Xpe,toArray:eU,toggle:Kpe,union:oO},Symbol.toStringTag,{value:"Module"}));var tU=function(e){return{show:function(t){var n="{";for(var r in e)ct.call(e,r)&&(n+=" ".concat(r,": ").concat(e[r].show(t[r]),","));return n.length>1&&(n=n.slice(0,-1)+" "),n+="}",n}}},nU=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(", "),"]")}}},ehe=nU,the=tU,nhe={show:function(e){return JSON.stringify(e)}},rhe={show:function(e){return JSON.stringify(e)}},ihe={show:function(e){return JSON.stringify(e)}};const ohe=Object.freeze(Object.defineProperty({__proto__:null,getStructShow:the,getTupleShow:ehe,showBoolean:nhe,showNumber:ihe,showString:rhe,struct:tU,tuple:nU},Symbol.toStringTag,{value:"Module"}));function sO(e){return function(t){return function(n){return e.of([t,n])}}}function cO(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 lO(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 fO(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 dO(e){return function(t){return function(n){return e.of(t(n))}}}function pO(e){return function(t){return function(n){return e.map(t,function(r){return[r,n]})}}}function hO(e){return function(t){return function(n){return e.map(n(t),function(r){var i=r[0];return i})}}}function mO(e){return function(t){return function(n){return e.map(n(t),wn)}}}function ahe(e){var t=lO(e),n=cO(e),r=fO(e),i=hO(e),o=mO(e);return{map:function(a,u){return y(a,n(u))},ap:function(a,u){return y(a,t(u))},of:sO(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:dO(e),fromM:pO(e),evalState:function(a,u){return y(a,i(u))},execState:function(a,u){return y(a,o(u))}}}const uhe=Object.freeze(Object.defineProperty({__proto__:null,ap:lO,chain:fO,evaluate:hO,execute:mO,fromF:pO,fromState:dO,getStateM:ahe,map:cO,of:sO},Symbol.toStringTag,{value:"Module"}));var vO=function(e){return function(){return fg(e)}},gO=sO(gI);function rU(e){return $i(iI(e))}function she(e){return $i(rj(e))}function iU(e){return $i(oI(e))}function che(e){return $i(ij(e))}function oU(e){return $i(aI(e))}function lhe(e){return $i(aj(e))}var fhe=function(e){return V(e,rI)},dhe=function(e){return function(t){return fg(e(t)[0])}},aU=Ea(function(e){return vO(e)},gO),uU=iU,$s=oU,Lp=rU,sU=dO(gI),cU=function(e){return $i(Va(e))},lU=function(e){return $i(uI(e))},phe=function(e){return $i(sI(e))},$i=pO(fs),hhe=function(e){return function(t){return V(t,Ld(e))}},fU=function(e){return function(t){return function(n){return e(n)(t)(n)}}},mhe=fU,dU=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return lU(e.apply(void 0,t))}},pU=function(e){return function(t){return y(t,Dp(dU(e)))}},vhe=pU,hU=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return cU(e.apply(void 0,t))}},mU=function(e){return function(t){return y(t,Dp(hU(e)))}},ghe=mU,vU=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return $i(e.apply(void 0,t))}},gU=function(e){return function(t){return y(t,Dp(vU(e)))}},yhe=gU,Ti=function(e,t){return y(e,yU(t))},Xo=function(e,t){return y(e,bO(t))},Ts=function(e,t){return y(e,_O(t))},yO=function(e,t){return function(n){return y(e(n),mg(function(){return t()(n)}))}},Lg=function(e,t,n){return function(r){return y(e(r),hI(t,function(i){var o=i[0],a=i[1];return[n(o),a]}))}},Dg=function(e,t){return function(n){return y(e(n),mI(t))}},yU=cO(fs),bhe=function(e,t){return function(n){return Lg(n,e,t)}},_he=function(e){return function(t){return Dg(t,e)}},bO=lO(Ln),She=bO,to=gO,_O=fO(Ln),Dp=_O,bU=Dp(j),$he=bU,_U=function(e){return function(t){return function(n){return y(t(n),$j(function(){return e()(n)}))}}},The=_U,jg=vO,Kt="StateReaderTaskEither",SO={URI:Kt,map:Ti},Ihe=ze(SO),Ohe={URI:Kt,of:to},qg={URI:Kt,map:Ti,ap:Xo},SU=wt(qg),whe=SU,$U=Rt(qg),Rhe=$U,Ehe={URI:Kt,map:Ti,ap:Xo,of:to},tr={URI:Kt,map:Ti,ap:Xo,chain:Ts},Is={URI:Kt,fromState:sU},Che=vW(Is),Mhe=gW(Is),xhe=yW(Is),khe=bW(Is),Ahe=dT(Is),Nhe=_W(Is,tr),Fhe={URI:Kt,map:Ti,ap:Xo,of:to,chain:Ts},Whe={URI:Kt,map:Ti,ap:Xo,of:to,chain:Ts,fromIO:$s},Phe={URI:Kt,map:Ti,ap:Xo,of:to,chain:Ts,fromIO:$s,fromTask:Lp},Lhe={URI:Kt,map:Ti,ap:Xo,of:to,chain:Ts,throwError:jg},TU=lt(tr),Dhe=TU,jhe={URI:Kt,bimap:Lg,mapLeft:Dg},qhe={URI:Kt,map:Ti,alt:yO},Ul={URI:Kt,fromReader:uU},Uhe=qd(Ul),Bhe=Ud(Ul),zhe=es(Ul),IU=Bd(Ul,tr),Khe=IU,OU=zd(Ul,tr),Vhe=OU,Qo={URI:Kt,fromEither:aU},Hhe=Li(Qo),Ghe=Di(Qo),Jhe=ku(Qo,tr),wU=yo(Qo,tr),Yhe=wU,RU=bo(Qo,tr),Zhe=RU,Xhe=Oa(Qo),EU=Au(Qo,tr),Qhe=EU,eme=dr(Qo),Ug={URI:Kt,fromIO:$s},tme=Vi(Ug),nme=Mo(Ug,tr),rme=xo(Ug,tr),Bg={URI:Kt,fromIO:$s,fromTask:Lp},ime=ts(Bg),ome=cl(Bg,tr),ame=ll(Bg,tr),ume=hO(fs),sme=mO(fs),cme=Ct(SO),CU=Mt(tr),lme=CU,MU=Et(qg),fme=MU,xU=function(e){return function(t){return function(n){return function(r){return function(){return yc(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,fr(t))(n)(r)().then(Wu(function(i){var o=i[0],a=i[1];return[[o],a]})))}}}}},$O=function(e){var t=xU(e);return function(n){return vt(n)?t(n):to(an)}},dme=$O,kU=function(e){return $O(function(t,n){return e(n)})},pme=kU(j),hme={URI:Kt,map:Ti,of:to,ap:Xo,chain:Ts,bimap:Lg,mapLeft:Dg,alt:yO,fromIO:$s,fromTask:Lp,throwError:jg},mme={URI:Kt,map:Ti,of:to,ap:Xo,chain:Ts,bimap:Lg,mapLeft:Dg,alt:yO,fromIO:$s,fromTask:Lp,throwError:jg},vme=function(e,t){return y(e(t),hp(function(n){var r=n[0];return r}))},gme=function(e,t){return y(e(t),hp(function(n){n[0];var r=n[1];return r}))};function yme(e,t,n){return e(t)(n)()}const bme=Object.freeze(Object.defineProperty({__proto__:null,Alt:qhe,Applicative:Ehe,Apply:qg,Bifunctor:jhe,Chain:tr,FromEither:Qo,FromIO:Ug,FromReader:Ul,FromState:Is,FromTask:Bg,Functor:SO,Monad:Fhe,MonadIO:Whe,MonadTask:Phe,MonadThrow:Lhe,Pointed:Ohe,URI:Kt,alt:The,altW:_U,ap:bO,apFirst:SU,apFirstW:whe,apS:MU,apSW:fme,apSecond:$U,apSecondW:Rhe,apW:She,ask:Uhe,asks:Bhe,asksStateReaderTaskEither:mhe,asksStateReaderTaskEitherW:fU,bimap:bhe,bind:CU,bindTo:cme,bindW:lme,chain:_O,chainEitherK:wU,chainEitherKW:Yhe,chainFirst:TU,chainFirstEitherK:RU,chainFirstEitherKW:Zhe,chainFirstIOK:rme,chainFirstReaderK:OU,chainFirstReaderKW:Vhe,chainFirstTaskK:ame,chainFirstW:Dhe,chainIOEitherK:vhe,chainIOEitherKW:pU,chainIOK:nme,chainOptionK:Jhe,chainReaderK:IU,chainReaderKW:Khe,chainReaderTaskEitherK:yhe,chainReaderTaskEitherKW:gU,chainStateK:Nhe,chainTaskEitherK:ghe,chainTaskEitherKW:mU,chainTaskK:ome,chainW:Dp,evalState:vme,evaluate:ume,execState:gme,execute:sme,filterOrElse:EU,filterOrElseW:Qhe,flap:Ihe,flatten:$he,flattenW:bU,fromEither:aU,fromEitherK:eme,fromIO:$s,fromIOEither:lU,fromIOEitherK:dU,fromIOK:tme,fromOption:Hhe,fromOptionK:Ghe,fromPredicate:Xhe,fromReader:uU,fromReaderEither:phe,fromReaderK:zhe,fromReaderTaskEither:$i,fromReaderTaskEitherK:vU,fromState:sU,fromStateK:Ahe,fromTask:Lp,fromTaskEither:cU,fromTaskEitherK:hU,fromTaskK:ime,get:Che,gets:khe,left:vO,leftIO:lhe,leftReader:che,leftState:dhe,leftTask:she,local:hhe,map:yU,mapLeft:_he,modify:xhe,of:to,put:Mhe,right:gO,rightIO:oU,rightReader:iU,rightState:fhe,rightTask:rU,run:yme,sequenceArray:pme,stateReaderTaskEither:hme,stateReaderTaskEitherSeq:mme,throwError:jg,traverseArray:kU,traverseArrayWithIndex:dme,traverseReadonlyArrayWithIndex:$O,traverseReadonlyNonEmptyArrayWithIndex:xU},Symbol.toStringTag,{value:"Module"}));function _me(e){return function(t){return{peek:t.peek,pos:e}}}function Sme(e){return function(t){return{peek:t.peek,pos:e(t.pos)}}}function $me(e){return function(t){return t.peek(e(t.pos))}}function Tme(e){return function(t){return function(n){return e.map(t(n.pos),function(r){return n.peek(r)})}}}var AU=function(e,t){return y(e,FU(t))},Ime=function(e,t){return y(e,TO(t))},TO=function(e){return function(t){return{peek:function(n){return e({peek:t.peek,pos:n})},pos:t.pos}}},NU=function(e){return e.peek(e.pos)},Ome=TO(j),FU=function(e){return function(t){return{peek:function(n){return e(t.peek(n))},pos:t.pos}}},IO="Store",WU={URI:IO,map:AU},wme=ze(WU),PU={URI:IO,map:AU,extend:Ime,extract:NU},Rme=PU;const Eme=Object.freeze(Object.defineProperty({__proto__:null,Comonad:PU,Functor:WU,URI:IO,duplicate:Ome,experiment:Tme,extend:TO,extract:NU,flap:wme,map:FU,peeks:$me,seek:_me,seeks:Sme,store:Rme},Symbol.toStringTag,{value:"Module"}));function OO(e,t){return function(n,r){return t.compose(e.second(r),e.first(n))}}function LU(e,t){var n=OO(e,t);return function(r,i){return t.compose(n(r,i),e.promap(t.id(),j,function(o){return[o,o]}))}}function Cme(e){return OO(e,e)}function Mme(e){return LU(e,e)}const xme=Object.freeze(Object.defineProperty({__proto__:null,fanOut:LU,fanout:Mme,split:OO,splitStrong:Cme},Symbol.toStringTag,{value:"Module"}));var kme=function(){return{concat:function(e,t){return Object.assign({},e,t)}}},Ame=function(e){return function(t){var n={};for(var r in t)ct.call(t,r)&&(n[r]=e[r](t[r]));return n}};const Nme=Object.freeze(Object.defineProperty({__proto__:null,evolve:Ame,getAssignSemigroup:kme},Symbol.toStringTag,{value:"Module"}));var Fme=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())})},Wme=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}}},DU=Jd(ln),Pme=DT(ln),Lme=In,jU=jT(ln),jp=function(e){return zg(Wn(e))},zg=Rv(qe),Dme=Ua(Yc),qU=qT(qe),jme=qU,wO=xv(wl),qme=wO,UU=wO,Ume=UU,BU=kv(Xt),Bme=BU,zme=Ev(ln),zU=function(e){return function(){return Fme(void 0,void 0,void 0,function(){return Wme(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e().then(de)];case 1:return[2,t.sent()];case 2:return t.sent(),[2,ye];case 3:return[2]}})})}},Kme=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return zU(function(){return e.apply(void 0,t)})}},Vme=Cv(ln),Hme=PT(Xt),Gme=Mv(ln),Jme=LT(Xt),RO=Av(qe),KU=Nv(ss),no=DU,Kg=ml(Xt),Yme=Kg(j),EO=Fv(Xt),Zme=EO,Vg=Yd(ln),Xme=Vg(),CO=Ki(qe,Vu),MO=Ro(qe,Vu,Vc),VU=Eo(qe,Io),HU=Co(qe,Io),GU=Pa(qe,Io),JU=La(qe,Io),Br=function(e,t){return y(e,RO(t))},Os=function(e,t){return y(e,KU(t))},Hg=function(e,t){return y(e,Kg(t))},YU=function(e,t){return y(e,EO(t))},Qme=function(e,t){return y(e,VU(t))},eve=function(e,t){return y(e,HU(t))},tve=function(e,t){return y(e,GU(t))},nve=function(e,t){return y(e,JU(t))},en="TaskOption",xO={URI:en,map:Br},rve=ze(xO),ZU={URI:en,of:no},Gg={URI:en,map:Br,ap:Os},ive=wt(Gg),ove=Rt(Gg),ave={URI:en,map:Br,ap:Os,of:no},XU=function(e,t){return y(e,Kg(function(n){return y(t,RO(n))}))},uve={URI:en,map:Br,ap:XU},sve={URI:en,map:Br,ap:XU,of:no},ea={URI:en,map:Br,ap:Os,chain:Hg},cve=lt(ea),lve={URI:en,map:Br,alt:YU},QU={URI:en,zero:Vg},fve=Nc(QU,ZU),dve={URI:en,map:Br,ap:Os,of:no,alt:YU,zero:Vg},pve={URI:en,map:Br,ap:Os,of:no,chain:Hg},hve={URI:en,map:Br,ap:Os,of:no,chain:Hg,fromIO:jp},mve={URI:en,map:Br,ap:Os,of:no,chain:Hg,fromIO:jp,fromTask:zg},vve={URI:en,compact:CO,separate:MO},gve={URI:en,map:Br,compact:CO,separate:MO,filter:Qme,filterMap:eve,partition:tve,partitionMap:nve},Jg={URI:en,fromIO:jp},yve=Vi(Jg),bve=Mo(Jg,ea),_ve=xo(Jg,ea),Yg={URI:en,fromEither:jU},Sve=dr(Yg),$ve=yo(Yg,ea),Tve=bo(Yg,ea),Zg={URI:en,fromIO:jp,fromTask:zg},Ive=ts(Zg),Ove=cl(Zg,ea),wve=ll(Zg,ea),Rve=no(Jt),Eve=Ct(xO),Cve=Mt(ea),Mve=Et(Gg),kO=no(an),eB=function(e){return V(Rl(e),Ua(pv(Hn)))},AO=function(e){var t=eB(e);return function(n){return vt(n)?t(n):kO}},tB=function(e){return function(t){return function(){return yc(t).reduce(function(n,r,i){return n.then(function(o){return Pt(o)?n:e(i+1,r)().then(function(a){return Pt(a)?a:(o.value.push(a.value),o)})})},e(0,fr(t))().then(zi(jf)))}}},NO=function(e){var t=tB(e);return function(n){return vt(n)?t(n):kO}},xve=AO,nB=function(e){return AO(function(t,n){return e(n)})},kve=nB(j),Ave=NO,rB=function(e){return NO(function(t,n){return e(n)})},Nve=rB(j);const Fve=Object.freeze(Object.defineProperty({__proto__:null,Alt:lve,Alternative:dve,ApT:kO,ApplicativePar:ave,ApplicativeSeq:sve,ApplyPar:Gg,ApplySeq:uve,Chain:ea,Compactable:vve,Do:Rve,Filterable:gve,FromEither:Yg,FromIO:Jg,FromTask:Zg,Functor:xO,Monad:pve,MonadIO:hve,MonadTask:mve,Pointed:ZU,Zero:QU,alt:EO,altW:Zme,ap:KU,apFirst:ive,apS:Mve,apSecond:ove,bind:Cve,bindTo:Eve,chain:Kg,chainEitherK:$ve,chainFirst:cve,chainFirstEitherK:Tve,chainFirstIOK:_ve,chainFirstTaskK:wve,chainIOK:bve,chainNullableK:Hme,chainOptionK:Jme,chainTaskK:Ove,compact:CO,filter:VU,filterMap:HU,flap:rve,flatten:Yme,fold:qme,foldW:Ume,fromEither:jU,fromEitherK:Sve,fromIO:jp,fromIOK:yve,fromNullable:zme,fromNullableK:Vme,fromOption:Lme,fromOptionK:Gme,fromPredicate:Pme,fromTask:zg,fromTaskEither:Dme,fromTaskK:Ive,getOrElse:BU,getOrElseW:Bme,guard:fve,map:RO,match:qU,matchE:wO,matchEW:UU,matchW:jme,none:Xme,of:no,partition:GU,partitionMap:JU,separate:MO,sequenceArray:kve,sequenceSeqArray:Nve,some:DU,traverseArray:nB,traverseArrayWithIndex:xve,traverseReadonlyArrayWithIndex:AO,traverseReadonlyArrayWithIndexSeq:NO,traverseReadonlyNonEmptyArrayWithIndex:eB,traverseReadonlyNonEmptyArrayWithIndexSeq:tB,traverseSeqArray:rB,traverseSeqArrayWithIndex:Ave,tryCatch:zU,tryCatchK:Kme,zero:Vg},Symbol.toStringTag,{value:"Module"}));var Ye=function(e){return e._tag==="Left"},At=function(e){return e._tag==="Right"};function ws(e){return e._tag==="Both"}function gn(e){return{_tag:"Left",left:e}}function nr(e){return{_tag:"Right",right:e}}function nt(e,t){return{_tag:"Both",left:e,right:t}}var FO=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)}}},Wve=FO,Xa=FO,Pve=Xa,iB=Xa(nr,gn,function(e,t){return nt(t,e)});function Lve(e,t){return{show:Xa(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 Dve(e,t){return Wr(function(n,r){return Ye(n)?Ye(r)&&e.equals(n.left,r.left):At(n)?At(r)&&t.equals(n.right,r.right):ws(r)&&e.equals(n.left,r.left)&&t.equals(n.right,r.right)})}function oB(e,t){return{concat:function(n,r){return Ye(n)?Ye(r)?gn(e.concat(n.left,r.left)):At(r)?nt(n.left,r.right):nt(e.concat(n.left,r.left),r.right):At(n)?Ye(r)?nt(r.left,n.right):At(r)?nr(t.concat(n.right,r.right)):nt(r.left,t.concat(n.right,r.right)):Ye(r)?nt(e.concat(n.left,r.left),n.right):At(r)?nt(n.left,t.concat(n.right,r.right)):nt(e.concat(n.left,r.left),t.concat(n.right,r.right))}}}var Xg=function(e){return{URI:_r,_E:void 0,map:Rs,ap:function(t,n){return Ye(t)?Ye(n)?gn(e.concat(t.left,n.left)):At(n)?gn(t.left):gn(e.concat(t.left,n.left)):At(t)?Ye(n)?gn(n.left):At(n)?nr(t.right(n.right)):nt(n.left,t.right(n.right)):Ye(n)?gn(e.concat(t.left,n.left)):At(n)?nt(t.left,t.right(n.right)):nt(e.concat(t.left,n.left),t.right(n.right))}}};function jve(e){var t=Xg(e);return{URI:_r,_E:void 0,map:Rs,ap:t.ap,of:qp}}function aB(e){var t=Xg(e),n=function(r,i){if(Ye(r))return r;if(At(r))return i(r.right);var o=i(r.right);return Ye(o)?gn(e.concat(r.left,o.left)):At(o)?nt(r.left,o.right):nt(e.concat(r.left,o.left),o.right)};return{URI:_r,_E:void 0,map:Rs,ap:t.ap,chain:n}}function qve(e){var t=aB(e);return{URI:_r,_E:void 0,map:Rs,of:qp,ap:t.ap,chain:t.chain,throwError:gn}}function Uve(e){return Ye(e)?de(e.left):At(e)?ye:de(e.left)}function Bve(e){return Ye(e)?ye:(At(e),de(e.right))}function zve(e){return function(t){return Pt(t)?gn(e):nt(e,t.value)}}function Kve(e){return function(t){return Pt(t)?nr(e):nt(t.value,e)}}function Vve(e){return Ye(e)?de(e.left):ye}function Hve(e){return At(e)?de(e.right):ye}var Gve=function(e,t){return Pt(e)?Pt(t)?ye:de(nr(t.value)):Pt(t)?de(gn(e.value)):de(nt(e.value,t.value))},Rs=function(e,t){return y(e,qO(t))},uB=function(e,t,n){return y(e,DO(t,n))},sB=function(e,t){return y(e,jO(t))},WO=function(e,t,n){return y(e,lB(t,n))},PO=function(e){var t=fB(e);return function(n,r){return y(n,t(r))}},LO=function(e,t,n){return y(e,dB(t,n))},cB=function(e){var t=pB(e);return function(n,r){return y(n,t(r))}},DO=function(e,t){return function(n){return Ye(n)?gn(e(n.left)):At(n)?nr(t(n.right)):nt(e(n.left),t(n.right))}},jO=function(e){return function(t){return Ye(t)?gn(e(t.left)):ws(t)?nt(e(t.left),t.right):t}},qO=function(e){return function(t){return Ye(t)?t:At(t)?nr(e(t.right)):nt(t.left,e(t.right))}},lB=function(e,t){return function(n){return Ye(n)?e:t(e,n.right)}},fB=function(e){return function(t){return function(n){return Ye(n)?e.empty:t(n.right)}}},dB=function(e,t){return function(n){return Ye(n)?e:t(n.right,e)}},pB=function(e){return function(t){return function(n){return Ye(n)?e.of(n):At(n)?e.map(t(n.right),nr):e.map(t(n.right),function(r){return nt(n.left,r)})}}},UO=function(e){return function(t){return Ye(t)?e.of(t):At(t)?e.map(t.right,nr):e.map(t.right,function(n){return nt(t.left,n)})}},qp=nr,_r="These",BO={URI:_r,map:Rs},Jve=ze(BO),Yve={URI:_r,of:qp},Zve={URI:_r,bimap:uB,mapLeft:sB},Xve={URI:_r,fromThese:j},Qve={URI:_r,reduce:WO,foldMap:PO,reduceRight:LO},ege={URI:_r,map:Rs,reduce:WO,foldMap:PO,reduceRight:LO,traverse:cB,sequence:UO},zO={URI:_r,fromEither:j},tge=Li(zO),nge=Di(zO),rge=function(e){return function(t){return function(n){return Ye(n)?!1:e.equals(t,n.right)}}},ige=function(e){return function(t){return Ye(t)?!1:e(t.right)}},KO=function(e,t){return function(n){return Ye(n)?[n.left,t()]:At(n)?[e(),n.right]:[n.left,n.right]}},oge=function(e,t){return KO(function(){return e},function(){return t})},hB=qp(an),VO=function(e){return function(t){return function(n){var r=ye,i=t(0,fr(n));if(Ye(i))return i;ws(i)&&(r=de(i.left));for(var o=[i.right],a=1;a<n.length;a++){var u=t(a,n[a]);if(Ye(u))return u;ws(u)&&(r=Pt(r)?de(u.left):de(e.concat(r.value,u.left))),o.push(u.right)}return Pt(r)?nr(o):nt(r.value,o)}}},age=function(e){return function(t){var n=VO(e)(t);return function(r){return vt(r)?n(r):hB}}},uge={URI:_r,map:Rs,bimap:uB,mapLeft:sB,reduce:WO,foldMap:PO,reduceRight:LO,traverse:cB,sequence:UO};const sge=Object.freeze(Object.defineProperty({__proto__:null,ApT:hB,Bifunctor:Zve,Foldable:Qve,FromEither:zO,FromThese:Xve,Functor:BO,Pointed:Yve,Traversable:ege,URI:_r,bimap:DO,both:nt,elem:rge,exists:ige,flap:Jve,fold:Pve,foldMap:fB,foldW:Wve,fromOption:tge,fromOptionK:nge,fromOptions:Gve,getApplicative:jve,getApply:Xg,getChain:aB,getEq:Dve,getLeft:Uve,getLeftOnly:Vve,getMonad:qve,getRight:Bve,getRightOnly:Hve,getSemigroup:oB,getShow:Lve,isBoth:ws,isLeft:Ye,isRight:At,left:gn,leftOrBoth:zve,map:qO,mapLeft:jO,match:Xa,matchW:FO,of:qp,reduce:lB,reduceRight:dB,right:nr,rightOrBoth:Kve,sequence:UO,swap:iB,these:uge,toTuple:oge,toTuple2:KO,traverse:pB,traverseReadonlyArrayWithIndex:age,traverseReadonlyNonEmptyArrayWithIndex:VO},Symbol.toStringTag,{value:"Module"}));function Qg(e){return V(nr,e.of)}function ey(e){return V(gn,e.of)}function HO(e){return V(nt,e.of)}function GO(e){return function(t){return e.map(t,nr)}}function JO(e){return function(t){return e.map(t,gn)}}function YO(e){return bc(e,BO)}function ZO(e,t){return go(e,Xg(t))}function XO(e,t){var n=ey(e);return function(r){return function(i){return e.chain(i,Xa(n,r,function(o,a){return e.map(r(a),Xa(function(u){return gn(t.concat(o,u))},function(u){return nt(o,u)},function(u,s){return nt(t.concat(o,u),s)}))}))}}}function QO(e){return function(t,n){return function(r){return e.map(r,DO(t,n))}}}function e1(e){return function(t){return function(n){return e.map(n,jO(t))}}}function mB(e){return function(t,n,r){return function(i){return e.map(i,Xa(t,n,r))}}}function t1(e){return function(t,n,r){return function(i){return e.chain(i,Xa(t,n,r))}}}function n1(e){return function(t){return e.map(t,iB)}}function r1(e){return function(t,n){return function(r){return e.map(r,KO(t,n))}}}function cge(e){var t=YO(e),n=QO(e),r=e1(e),i=t1(e),o=r1(e),a=Qg(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:n1(e),rightM:GO(e),leftM:JO(e),left:ey(e),right:Qg(e),both:HO(e),toTuple:function(s,c,l){return y(s,o(function(){return c},function(){return l}))},getMonad:function(s){var c=ZO(e,s),l=XO(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 lge=Object.freeze(Object.defineProperty({__proto__:null,ap:ZO,bimap:QO,both:HO,chain:XO,getTheseM:cge,left:ey,leftF:JO,map:YO,mapLeft:e1,match:mB,matchE:t1,right:Qg,rightF:GO,swap:n1,toTuple2:r1},Symbol.toStringTag,{value:"Module"}));var fge=ey(ln),vB=Qg(ln),dge=HO(ln),i1=GO(qe),gB=JO(qe),yB=V(Wn,i1),pge=V(Wn,gB),bB=In,_B=In,ty=yB,hge=Wn,o1=i1,SB=mB(qe),mge=SB,$B=t1(Xt),TB=$B,IB=TB,vge=IB,gge=n1(qe),Es=function(e,t){return y(e,OB(t))},a1=function(e,t,n){return y(e,wB(t,n))},u1=function(e,t){return y(e,RB(t))},OB=YO(qe),wB=QO(qe),RB=e1(qe),Up=vB,Dn="TaskThese",s1=function(e,t){var n=ZO(e,t);return{URI:Dn,_E:void 0,map:Es,ap:function(r,i){return y(r,n(i))}}};function EB(e,t){var n=s1(e,t).ap;return{URI:Dn,_E:void 0,map:Es,ap:n,of:Up}}function CB(e){var t=s1(up,e),n=XO(Xt,e);return{URI:Dn,_E:void 0,map:Es,ap:t.ap,chain:function(r,i){return y(r,n(i))}}}function yge(e){var t=EB(up,e),n=CB(e);return{URI:Dn,_E:void 0,map:Es,ap:t.ap,of:Up,chain:n.chain,fromIO:ty,fromTask:o1}}var MB={URI:Dn,map:Es},bge=ze(MB),_ge={URI:Dn,of:Up},Sge={URI:Dn,bimap:a1,mapLeft:u1},ny={URI:Dn,fromEither:bB},$ge=Li(ny),Tge=Di(ny),Ige=Oa(ny),xB={URI:Dn,fromThese:_B},Oge=SW(xB),kB={URI:Dn,fromIO:ty},wge=Vi(kB),AB={URI:Dn,fromIO:ty,fromTask:o1},Rge=ts(AB),NB=r1(qe),c1=Up(an),FB=function(e){var t=VO(e);return function(n){return V(Rl(n),Ua(t(Hn)))}},Ege=function(e){return function(t){var n=FB(e)(t);return function(r){return vt(r)?n(r):c1}}},WB=function(e){return function(t){return function(n){return function(){return yc(n).reduce(function(r,i,o){return r.then(function(a){return Ye(a)?r:t(o+1,i)().then(function(u){if(Ye(u))return u;if(ws(u)){var s=a.right;return s.push(u.right),ws(a)?nt(e.concat(a.left,u.left),s):nt(u.left,s)}return a.right.push(u.right),a})})},t(0,fr(n))().then(qO(jf)))}}}},Cge=function(e){return function(t){var n=WB(e)(t);return function(r){return vt(r)?n(r):c1}}},Mge={URI:Dn,map:Es},xge={URI:Dn,bimap:a1,mapLeft:u1},kge=function(e,t){return NB(function(){return e},function(){return t})},Age={URI:Dn,map:Es,bimap:a1,mapLeft:u1},Nge=function(e,t){return Yt(Qv)(oB(e,t))};const Fge=Object.freeze(Object.defineProperty({__proto__:null,ApT:c1,Bifunctor:Sge,FromEither:ny,FromIO:kB,FromTask:AB,FromThese:xB,Functor:MB,Pointed:_ge,URI:Dn,bifunctorTaskThese:xge,bimap:wB,both:dge,flap:bge,fold:TB,foldW:vge,fromEither:bB,fromIO:ty,fromIOEither:hge,fromIOK:wge,fromOption:$ge,fromOptionK:Tge,fromPredicate:Ige,fromTask:o1,fromTaskK:Rge,fromThese:_B,fromTheseK:Oge,functorTaskThese:Mge,getApplicative:EB,getApply:s1,getChain:CB,getMonad:yge,getSemigroup:Nge,left:fge,leftIO:pge,leftTask:gB,map:OB,mapLeft:RB,match:SB,matchE:$B,matchEW:IB,matchW:mge,of:Up,right:vB,rightIO:yB,rightTask:i1,swap:gge,taskThese:Age,toTuple:kge,toTuple2:NB,traverseReadonlyArrayWithIndex:Ege,traverseReadonlyArrayWithIndexSeq:Cge,traverseReadonlyNonEmptyArrayWithIndex:FB,traverseReadonlyNonEmptyArrayWithIndexSeq:WB},Symbol.toStringTag,{value:"Module"}));function Wge(e,t){return function(n){return n(t(n(e.empty)))}}function Pge(e){return function(t){return[e(t),t]}}function Lge(e){return function(t){return function(n){return[t(n),e(n)]}}}function Dge(e){return function(t){return function(n){return t(e(n))}}}function jge(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:l1,_E:void 0,map:PB,extend:t,extract:n}}var PB=function(e,t){return y(e,LB(t))},LB=function(e){return function(t){return function(n){return e(t(n))}}},l1="Traced",f1={URI:l1,map:PB},qge=ze(f1),Uge=f1;const Bge=Object.freeze(Object.defineProperty({__proto__:null,Functor:f1,URI:l1,censor:Dge,flap:qge,getComonad:jge,listen:Pge,listens:Lge,map:LB,traced:Uge,tracks:Wge},Symbol.toStringTag,{value:"Module"}));function DB(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 jB(e,t){return function(n){var r=e.sequence(n),i=t.sequence(n);return function(o){return r(e.map(o,i))}}}function zge(e,t){var n=_c(e,t).map,r=Z$(e,t),i=DB(e,t),o=jB(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 Kge=Object.freeze(Object.defineProperty({__proto__:null,getTraversableComposition:zge,sequence:jB,traverse:DB},Symbol.toStringTag,{value:"Module"})),Vge=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function qB(e,t){return t===void 0&&(t=[]),{value:e,forest:t}}function Hge(e){var t=function(n){return Na(n.forest)?"make(".concat(e.show(n.value),")"):"make(".concat(e.show(n.value),", [").concat(n.forest.map(t).join(", "),"])")};return{show:t}}function Gge(e){var t,n=Wr(function(r,i){return e.equals(r.value,i.value)&&t.equals(r.forest,i.forest)});return t=EN(n),n}var UB=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+=UB(e+(r>1&&!a?"│ ":" "),i.forest)}return n};function BB(e){return UB(`
|
|
28
|
+
`,e)}function Jge(e){return e.value+BB(e.forest)}function zB(e,t){var n=t(e),r=n[0],i=n[1];return{value:r,forest:KB(i,t)}}function KB(e,t){return e.map(function(n){return zB(n,t)})}function VB(e){var t=HB(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 HB(e){var t=tv(e);return function(n,r){return y(n,t(function(i){return VB(e)(i,r)}))}}function Yge(e){var t=function(n){return e(n.value,n.forest.map(t))};return t}var Qa=function(e,t){return y(e,iy(t))},Bl=function(e,t){return y(e,Bp(function(n){return y(t,iy(n))}))},d1=function(e,t){return y(e,Bp(t))},p1=function(e,t,n){return y(e,oy(t,n))},h1=function(e){var t=YB(e);return function(n,r){return y(n,t(r))}},m1=function(e,t,n){return y(e,v1(t,n))},GB=function(e,t){return y(e,ry(t))},JB=function(e){var t=y1(e);return function(n,r){return y(n,t(r))}},Zge=function(e){return function(t){return Bl(t,e)}},Bp=function(e){return function(t){var n=e(t.value),r=n.value,i=n.forest,o=O$().concat;return{value:r,forest:o(i,t.forest.map(Bp(e)))}}},ry=function(e){return function(t){return{value:e(t),forest:t.forest.map(ry(e))}}},Xge=ry(j),Qge=Bp(j),iy=function(e){return function(t){return{value:e(t.value),forest:t.forest.map(iy(e))}}},oy=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],oy(r,t));return r}},YB=function(e){return function(t){return oy(e.empty,function(n,r){return e.concat(n,t(r))})}},v1=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],v1(r,t));return t(n.value,r)}},g1=function(e){return e.value},y1=function(e){var t=tv(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},b1=function(e){return y1(e)(j)},zl=function(e){return qB(e)},Ii="Tree",_1={URI:Ii,map:Qa},eye=ze(_1),tye={URI:Ii,of:zl},ay={URI:Ii,map:Qa,ap:Bl},nye=wt(ay),rye=Rt(ay),iye={URI:Ii,map:Qa,ap:Bl,of:zl},S1={URI:Ii,map:Qa,ap:Bl,chain:d1},oye={URI:Ii,map:Qa,ap:Bl,of:zl,chain:d1},aye=lt(S1),uye={URI:Ii,reduce:p1,foldMap:h1,reduceRight:m1},sye={URI:Ii,map:Qa,reduce:p1,foldMap:h1,reduceRight:m1,traverse:JB,sequence:b1},cye={URI:Ii,map:Qa,extend:GB,extract:g1},lye=zl(Jt),fye=Ct(_1),dye=Mt(S1),pye=Et(ay);function hye(e){var t=function(n,r){return e.equals(n,r.value)||r.forest.some(function(i){return t(n,i)})};return t}var ZB=function(e){return function(t){return e(t.value)||t.forest.some(ZB(e))}},mye={URI:Ii,map:Qa,of:zl,ap:Bl,chain:d1,reduce:p1,foldMap:h1,reduceRight:m1,traverse:JB,sequence:b1,extract:g1,extend:GB};const vye=Object.freeze(Object.defineProperty({__proto__:null,Applicative:iye,Apply:ay,Chain:S1,Comonad:cye,Do:lye,Foldable:uye,Functor:_1,Monad:oye,Pointed:tye,Traversable:sye,URI:Ii,ap:Zge,apFirst:nye,apS:pye,apSecond:rye,bind:dye,bindTo:fye,chain:Bp,chainFirst:aye,drawForest:BB,drawTree:Jge,duplicate:Xge,elem:hye,exists:ZB,extend:ry,extract:g1,flap:eye,flatten:Qge,fold:Yge,foldMap:YB,getEq:Gge,getShow:Hge,make:qB,map:iy,of:zl,reduce:oy,reduceRight:v1,sequence:b1,traverse:y1,tree:mye,unfoldForest:KB,unfoldForestM:HB,unfoldTree:zB,unfoldTreeM:VB},Symbol.toStringTag,{value:"Module"}));var Sr=Qt,rr=wn,gye=function(e){return[rr(e),Sr(e)]};function $1(e){return{URI:$r,_E:void 0,map:zp,ap:function(t,n){return[Sr(t)(Sr(n)),e.concat(rr(t),rr(n))]}}}var XB=function(e){return function(t){return[t,e.empty]}};function yye(e){var t=$1(e);return{URI:$r,_E:void 0,map:t.map,ap:t.ap,of:XB(e)}}function T1(e){var t=$1(e);return{URI:$r,_E:void 0,map:t.map,ap:t.ap,chain:function(n,r){var i=r(Sr(n)),o=i[0],a=i[1];return[o,e.concat(rr(n),a)]}}}function bye(e){var t=T1(e);return{URI:$r,_E:void 0,map:t.map,ap:t.ap,chain:t.chain,of:XB(e)}}function _ye(e){var t=function(r,i){for(var o=i(r),a=e.empty,u=Sr(o);u._tag==="Left";)a=e.concat(a,rr(o)),o=i(u.left),u=Sr(o);return[u.right,e.concat(a,rr(o))]},n=T1(e);return{URI:$r,_E:void 0,map:n.map,ap:n.ap,chain:n.chain,chainRec:t}}var QB=function(e,t){return y(e,oz(t))},zp=function(e,t){return y(e,R1(t))},ez=function(e,t,n){return y(e,iz(t,n))},tz=function(e,t){return y(e,E1(t))},nz=function(e,t){return y(e,C1(t))},I1=function(e,t,n){return y(e,uz(t,n))},O1=function(e){var t=az();return function(n,r){return y(n,t(r))}},w1=function(e,t,n){return y(e,sz(t,n))};function rz(e){var t=cz(e);return function(n,r){return y(n,t(r))}}var iz=function(e,t){return function(n){return[t(Sr(n)),e(rr(n))]}},R1=function(e){return function(t){return[e(Sr(t)),rr(t)]}},E1=function(e){return function(t){return[Sr(t),e(rr(t))]}},oz=function(e){return function(t){return[Sr(t),rr(e)]}},C1=function(e){return function(t){return[e(t),rr(t)]}},Sye=C1(j),M1=Pg,az=JI,uz=GI,sz=YI,cz=function(e){return function(t){return function(n){return e.map(t(Sr(n)),function(r){return[r,rr(n)]})}}},x1=function(e){return function(t){return e.map(Sr(t),function(n){return[n,rr(t)]})}},$r="Tuple",lz={URI:$r,map:zp},$ye=ze(lz),Tye={URI:$r,bimap:ez,mapLeft:tz},Iye={URI:$r,compose:QB},Oye={URI:$r,map:zp,extend:nz,extract:M1},wye={URI:$r,reduce:I1,foldMap:O1,reduceRight:w1},Rye={URI:$r,map:zp,reduce:I1,foldMap:O1,reduceRight:w1,traverse:rz,sequence:x1},Eye=R1,Cye=E1,Mye={URI:$r,compose:QB,map:zp,bimap:ez,mapLeft:tz,extract:M1,extend:nz,reduce:I1,foldMap:O1,reduceRight:w1,traverse:rz,sequence:x1};const xye=Object.freeze(Object.defineProperty({__proto__:null,Bifunctor:Tye,Comonad:Oye,Foldable:wye,Functor:lz,Semigroupoid:Iye,Traversable:Rye,URI:$r,bimap:iz,compose:oz,duplicate:Sye,extend:C1,extract:M1,flap:$ye,foldMap:az,fst:Sr,getApplicative:yye,getApply:$1,getChain:T1,getChainRec:_ye,getMonad:bye,map:Eye,mapFst:R1,mapLeft:Cye,mapSnd:E1,reduce:uz,reduceRight:sz,sequence:x1,snd:rr,swap:gye,traverse:cz,tuple:Mye},Symbol.toStringTag,{value:"Module"})),kye=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function Aye(e,t){var n=XC(t,wa(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(vo(o.left)):i(o.right)})},alt:function(r,i){return t.chain(r,function(o){return Kb(o)?t.of(o):t.map(i(),function(a){return Gt(a)?vo(e.concat(o.left,a.left)):a})})}}}const Nye=Object.freeze(Object.defineProperty({__proto__:null,getValidationM:Aye},Symbol.toStringTag,{value:"Module"}));var fz=M_(void 0),Fye={concat:fz.concat,empty:void 0};const Wye=Object.freeze(Object.defineProperty({__proto__:null,Monoid:Fye,Semigroup:fz},Symbol.toStringTag,{value:"Module"}));var Pye=function(e){return function(){return[void 0,e]}},Lye=function(e){return function(){var t=e(),n=t[0],r=t[1];return[[n,r],r]}},Dye=function(e){return function(){var t=e(),n=t[0],r=n[0],i=n[1],o=t[1];return[r,i(o)]}},jye=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[[r,e(i)],i]}}},qye=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[r,e(i)]}}},Kp=function(e,t){return y(e,dz(t))},dz=function(e){return function(t){return function(){var n=t(),r=n[0],i=n[1];return[e(r),i]}}},Cs="Writer",pz=function(e){return{URI:Cs,_E:void 0,of:function(t){return function(){return[t,e.empty]}}}},k1=function(e){return{URI:Cs,_E:void 0,map:Kp,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)]}}}},hz=function(e){var t=k1(e),n=pz(e);return{URI:Cs,_E:void 0,map:Kp,ap:t.ap,of:n.of}};function mz(e){var t=k1(e);return{URI:Cs,_E:void 0,map:Kp,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 Uye(e){var t=hz(e),n=mz(e);return{URI:Cs,_E:void 0,map:Kp,ap:t.ap,of:t.of,chain:n.chain}}var A1={URI:Cs,map:Kp},Bye=ze(A1),zye=function(e){return e()[0]},Kye=function(e){return e()[1]},Vye=function(e){return e()[0]},Hye=function(e){return e()[1]},Gye=A1;const Jye=Object.freeze(Object.defineProperty({__proto__:null,Functor:A1,URI:Cs,censor:qye,evalWriter:Vye,evaluate:zye,execWriter:Hye,execute:Kye,flap:Bye,getApplicative:hz,getApply:k1,getChain:mz,getMonad:Uye,getPointed:pz,listen:Lye,listens:jye,map:dz,pass:Dye,tell:Pye,writer:Gye},Symbol.toStringTag,{value:"Module"}));function Yye(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 ht=vc(Object.freeze(Object.defineProperty({__proto__:null,alt:TJ,alternative:OJ,applicative:q6,apply:D6,array:sX,bifunctor:cX,boolean:gX,booleanAlgebra:$X,bounded:wX,boundedDistributiveLattice:CX,boundedJoinSemilattice:MX,boundedLattice:xX,boundedMeetSemilattice:kX,category:AX,chain:U6,chainRec:B6,choice:WX,comonad:PX,compactable:EQ,console:AQ,const:GQ,contravariant:JQ,date:ree,distributiveLattice:RX,either:MM,eitherT:oee,endomorphism:uee,eq:PJ,extend:see,field:fee,filterable:pee,filterableWithIndex:hee,foldable:_ee,foldableWithIndex:$ee,fromEither:z6,fromIO:Tee,fromReader:Kee,fromState:fte,fromTask:dte,fromThese:pte,function:ZC,functor:j6,functorWithIndex:mte,group:vte,heytingAlgebra:gte,hkt:yte,identity:jte,invariant:qte,io:ane,ioEither:are,ioOption:Qre,ioRef:tie,joinSemilattice:nie,json:oie,lattice:aie,magma:tY,map:moe,meetSemilattice:voe,monad:goe,monadIO:yoe,monadTask:boe,monadThrow:_oe,monoid:Aoe,naturalTransformation:Noe,nonEmptyArray:K7,number:X7,option:wQ,optionT:sre,ord:ZJ,ordering:qoe,pipeable:oae,pointed:aae,predicate:UX,profunctor:uae,random:fae,reader:zee,readerEither:uue,readerT:lue,readerTask:yse,readerTaskEither:Kle,readonlyArray:I9,readonlyMap:Aie,readonlyNonEmptyArray:QY,readonlyRecord:Wfe,readonlySet:Qfe,readonlyTuple:hde,record:mpe,refinement:Ipe,ring:Epe,semigroup:Hx,semigroupoid:Cpe,semiring:xpe,separated:Y6,set:Qpe,show:ohe,state:lte,stateReaderTaskEither:bme,stateT:uhe,store:Eme,string:sfe,strong:xme,struct:Nme,task:Wue,taskEither:Ece,taskOption:Fve,taskThese:Fge,these:sge,theseT:lge,traced:Bge,traversable:Kge,traversableWithIndex:Vge,tree:vye,tuple:xye,unfoldable:kye,validationT:Nye,void:Wye,witherable:Z6,writer:Jye,writerT:Object.freeze(Object.defineProperty({__proto__:null,getWriterM:Yye},Symbol.toStringTag,{value:"Module"})),zero:Q7},Symbol.toStringTag,{value:"Module"})));function vz(e,t,n){return n===void 0&&(n=e.name),new Se(n,e.is,e.validate,function(r){return t(e.encode(r))})}const Zye=vc(Object.freeze(Object.defineProperty({__proto__:null,mapOutput:vz},Symbol.toStringTag,{value:"Module"})));var gz;function eu(){if(gz)return xt;gz=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.addType=xt.isEmpty=xt.objectToMap=xt.grouped=xt.formatDate=xt.formatDateTime=xt.filterDouble=xt.refineType=xt.nullable=void 0;const e=H,t=ht,n=ai,r=e.__importStar(Q),i=Zye;function o(h){return r.union([h,r.null,r.undefined])}xt.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)}xt.refineType=a;function u(h){if(h==="")return null;const v=Number(h);return Number.isNaN(v)?null:v}xt.filterDouble=u;function s(h){return h.toISOString().replace(/\.\d{3}Z$/,"+0000")}xt.formatDateTime=s;function c(h){return h.toISOString().replace(/T.*/,"")}xt.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)}xt.grouped=l;function f(h){return new Map(Object.entries(h))}xt.objectToMap=f;function d(h){for(const v in h)return!1;return!0}xt.isEmpty=d;function p(h,v){return(0,i.mapOutput)(h,m=>({...m,__TYPE__:v}))}return xt.addType=p,xt}var uy={},yz;function Xye(){if(yz)return uy;yz=1,Object.defineProperty(uy,"__esModule",{value:!0});const e=H,t=So,n=ai,r=e.__importStar(Q);return uy.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),uy}var sy={},bz;function Qye(){if(bz)return sy;bz=1,Object.defineProperty(sy,"__esModule",{value:!0});const e=H,t=So,n=ai,r=e.__importStar(Q),i=/^([0-9]+)px$/;return sy.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),sy}var cy={},_z;function ebe(){if(_z)return cy;_z=1,Object.defineProperty(cy,"__esModule",{value:!0});const t=H.__importStar(Q),n=eu();return cy.default=(0,n.refineType)(t.string,"nonEmptyString",r=>r.trim().length>0),cy}var ly={},fy={},Sz;function $z(){if(Sz)return fy;Sz=1,Object.defineProperty(fy,"__esModule",{value:!0});const t=H.__importStar(Q),n=eu();return fy.default=(0,n.nullable)(t.string),fy}var Tz;function tbe(){if(Tz)return ly;Tz=1,Object.defineProperty(ly,"__esModule",{value:!0});const e=H,t=So,n=ai,r=Q,i=e.__importDefault($z());return ly.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),ly}var dy={},Iz;function nbe(){if(Iz)return dy;Iz=1,Object.defineProperty(dy,"__esModule",{value:!0});const t=H.__importStar(Q),n=eu();return dy.default=(0,n.nullable)(t.number),dy}var py={},Oz;function rbe(){if(Oz)return py;Oz=1,Object.defineProperty(py,"__esModule",{value:!0});const e=H,t=So,n=ai,r=e.__importStar(Q);return py.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),py}var hy={},wz;function ibe(){if(wz)return hy;wz=1,Object.defineProperty(hy,"__esModule",{value:!0});const e=H,t=So,n=ai,r=e.__importStar(Q);return hy.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),hy}var Rz;function mt(){return Rz||(Rz=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=_J();Object.defineProperty(e,"DateFromString",{enumerable:!0,get:function(){return t.__importDefault(n).default}});var r=SJ();Object.defineProperty(e,"DateFromStringOrNumber",{enumerable:!0,get:function(){return t.__importDefault(r).default}});var i=$J();Object.defineProperty(e,"DateFromTsMs",{enumerable:!0,get:function(){return t.__importDefault(i).default}}),e.Function=t.__importStar(eu());var o=Xye();Object.defineProperty(e,"IntFromNumber",{enumerable:!0,get:function(){return t.__importDefault(o).default}});var a=Qye();Object.defineProperty(e,"IntFromPixels",{enumerable:!0,get:function(){return t.__importDefault(a).default}});var u=ebe();Object.defineProperty(e,"NonEmptyString",{enumerable:!0,get:function(){return t.__importDefault(u).default}});var s=tbe();Object.defineProperty(e,"NonEmptyStringOrNull",{enumerable:!0,get:function(){return t.__importDefault(s).default}});var c=nbe();Object.defineProperty(e,"NumberOrNull",{enumerable:!0,get:function(){return t.__importDefault(c).default}});var l=rbe();Object.defineProperty(e,"StringFromBoolean",{enumerable:!0,get:function(){return t.__importDefault(l).default}});var f=ibe();Object.defineProperty(e,"StringFromNumber",{enumerable:!0,get:function(){return t.__importDefault(f).default}});var d=$z();Object.defineProperty(e,"StringOrNull",{enumerable:!0,get:function(){return t.__importDefault(d).default}})}(w_)),w_}var Oi={},N1={},Vp={},Ez;function obe(){if(Ez)return Vp;Ez=1,Object.defineProperty(Vp,"__esModule",{value:!0}),Vp.WidgetKey=void 0;const t=H.__importStar(Q),n=eu(),r=new RegExp("^[^<>]+$");return Vp.WidgetKey=(0,n.refineType)(t.string,"WidgetKey",i=>i.length===0||r.test(i)),Vp}var Cz;function Kl(){return Cz||(Cz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),H.__exportStar(obe(),e)}(N1)),N1}var Tr={},F1={},Hp={},W1={},Mz;function xz(){return Mz||(Mz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanField=e.BooleanConfig=e.BooleanFieldType=void 0;const n=H.__importStar(Q),r=mt();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})]))}(W1)),W1}var P1={},kz;function Az(){return kz||(kz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Color=e.ColorConfig=e.ColorFieldType=void 0;const n=H.__importStar(Q),r=mt();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})]))}(P1)),P1}var L1={},Nz;function Fz(){return Nz||(Nz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Date=e.DateConfig=e.DateFieldType=void 0;const n=H.__importStar(Q),r=mt();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})]))}(L1)),L1}var D1={},Wz;function Pz(){return Wz||(Wz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Embed=e.EmbedConfig=e.EmbedFieldType=void 0;const n=H.__importStar(Q),r=mt();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})]))}(D1)),D1}var j1={},Lz;function Dz(){return Lz||(Lz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPoint=e.GeoPointConfig=e.GeoPointFieldType=void 0;const n=H.__importStar(Q),r=mt();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})]))}(j1)),j1}var q1={},my={},Gp={},Jp={},Ms={},jz;function qz(){if(jz)return Ms;jz=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.pipe=Ms.pipeable=void 0;var e=Xe(),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(X){return function(ne){return g.map(ne,X)}};S.map=b}if(n(g)){var $=function(X){return function(ne){return g.contramap(ne,X)}};S.contramap=$}if(r(g)){var T=function(X){return function(ne){return g.mapWithIndex(ne,X)}};S.mapWithIndex=T}if(i(g)){var C=function(X){return function(ne){return g.ap(ne,X)}},R=function(X){return function(ne){return g.ap(g.map(ne,function(Ce){return function(){return Ce}}),X)}};S.ap=C,S.apFirst=R,S.apSecond=function(X){return function(ne){return g.ap(g.map(ne,function(){return function(Ce){return Ce}}),X)}}}if(o(g)){var q=function(X){return function(ne){return g.chain(ne,X)}},G=function(X){return function(ne){return g.chain(ne,function(Ce){return g.map(X(Ce),function(){return Ce})})}},A=function(X){return g.chain(X,e.identity)};S.chain=q,S.chainFirst=G,S.flatten=A}if(a(g)){var Y=function(X,ne){return function(Ce){return g.bimap(Ce,X,ne)}},ie=function(X){return function(ne){return g.mapLeft(ne,X)}};S.bimap=Y,S.mapLeft=ie}if(u(g)){var J=function(X){return function(ne){return g.extend(ne,X)}},ge=function(X){return g.extend(X,e.identity)};S.extend=J,S.duplicate=ge}if(s(g)){var Te=function(X,ne){return function(Ce){return g.reduce(Ce,X,ne)}},M=function(X){var ne=g.foldMap(X);return function(Ce){return function(Ot){return ne(Ot,Ce)}}},x=function(X,ne){return function(Ce){return g.reduceRight(Ce,X,ne)}};S.reduce=Te,S.foldMap=M,S.reduceRight=x}if(c(g)){var w=function(X,ne){return function(Ce){return g.reduceWithIndex(Ce,X,ne)}},I=function(X){var ne=g.foldMapWithIndex(X);return function(Ce){return function(Ot){return ne(Ot,Ce)}}},F=function(X,ne){return function(Ce){return g.reduceRightWithIndex(Ce,X,ne)}};S.reduceWithIndex=w,S.foldMapWithIndex=I,S.reduceRightWithIndex=F}if(l(g)){var L=function(X){return function(ne){return g.alt(ne,X)}};S.alt=L}if(f(g)&&(S.compact=g.compact,S.separate=g.separate),d(g)){var Z=function(X){return function(ne){return g.filter(ne,X)}},ee=function(X){return function(ne){return g.filterMap(ne,X)}},Ee=function(X){return function(ne){return g.partition(ne,X)}},ue=function(X){return function(ne){return g.partitionMap(ne,X)}};S.filter=Z,S.filterMap=ee,S.partition=Ee,S.partitionMap=ue}if(p(g)){var xe=function(X){return function(ne){return g.filterWithIndex(ne,X)}},Be=function(X){return function(ne){return g.filterMapWithIndex(ne,X)}},Ke=function(X){return function(ne){return g.partitionWithIndex(ne,X)}},it=function(X){return function(ne){return g.partitionMapWithIndex(ne,X)}};S.filterWithIndex=xe,S.filterMapWithIndex=Be,S.partitionWithIndex=Ke,S.partitionMapWithIndex=it}if(h(g)){var Ft=function(X,ne){return function(Ce){return g.promap(Ce,X,ne)}};S.promap=Ft}if(v(g)){var qt=function(X){return function(ne){return g.compose(ne,X)}};S.compose=qt}if(m(g)){var Ht=function(X){return function(ne){return ne._tag==="None"?g.throwError(X()):g.of(ne.value)}},Mn=function(X){return X._tag==="Left"?g.throwError(X.left):g.of(X.right)},kr=function(X,ne){return function(Ce){return X(Ce)?g.of(Ce):g.throwError(ne(Ce))}},lr=function(X,ne){return function(Ce){return g.chain(Ce,function(Ot){return X(Ot)?g.of(Ot):g.throwError(ne(Ot))})}};S.fromOption=Ht,S.fromEither=Mn,S.fromPredicate=kr,S.filterOrElse=lr}return S}return Ms.pipeable=_,Ms.pipe=e.pipe,Ms}var Uz;function U1(){if(Uz)return Jp;Uz=1;var e=pe&&pe.__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=pe&&pe.__setModuleDefault||(Object.create?function(a,u){Object.defineProperty(a,"default",{enumerable:!0,value:u})}:function(a,u){a.default=u}),n=pe&&pe.__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(Jp,"__esModule",{value:!0}),Jp.NumberFromString=void 0;var r=n(Q),i=qz(),o=xn();return Jp.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),Jp}var Bz;function abe(){if(Bz)return Gp;Bz=1;var e=pe&&pe.__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=pe&&pe.__setModuleDefault||(Object.create?function(u,s){Object.defineProperty(u,"default",{enumerable:!0,value:s})}:function(u,s){u.default=s}),n=pe&&pe.__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(Gp,"__esModule",{value:!0}),Gp.IntFromString=void 0;var r=n(Q),i=U1(),o=qz(),a=xn();return Gp.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),Gp}var zz;function B1(){if(zz)return my;zz=1,Object.defineProperty(my,"__esModule",{value:!0});const e=H,t=xn(),n=e.__importStar(Q),r=abe(),i=mt(),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 Kz;function Vz(){return Kz||(Kz=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(Q),r=mt(),i=t.__importDefault(B1());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})]))}(q1)),q1}var z1={},Hz;function Gz(){return Hz||(Hz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationField=e.IntegrationFieldConfig=e.IntegrationFieldType=void 0;const n=H.__importStar(Q),r=mt();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})]))}(z1)),z1}var K1={},Jz;function Yz(){return Jz||(Jz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Link=e.LinkConfig=e.LinkFieldType=void 0;const t=H,n=xn(),r=t.__importStar(Q),i=O_(),o=mt(),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})]))}(K1)),K1}var V1={},Zz;function Xz(){return Zz||(Zz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Number=e.NumberConfig=e.NumberFieldType=void 0;const n=H.__importStar(Q),r=U1(),i=mt();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})]))}(V1)),V1}var H1={},Qz;function eK(){return Qz||(Qz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Range=e.RangeConfig=e.RangeFieldType=void 0;const n=H.__importStar(Q),r=U1(),i=mt();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})]))}(H1)),H1}var G1={},tK;function nK(){return tK||(tK=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=ht,r=xn(),i=Xe(),o=t.__importStar(Q),a=mt(),u=t.__importDefault(B1());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})]))}(G1)),G1}var J1={},rK;function iK(){return rK||(rK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Select=e.SelectConfig=e.SelectFieldType=void 0;const n=H.__importStar(Q),r=mt();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})]))}(J1)),J1}var Y1={},oK;function aK(){return oK||(oK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Separator=e.SeparatorConfig=e.SeparatorFieldType=void 0;const n=H.__importStar(Q),r=mt();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})]))}(Y1)),Y1}var Z1={},uK;function sK(){return uK||(uK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Text=e.TextConfig=e.TextFieldType=void 0;const n=H.__importStar(Q),r=mt();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})]))}(Z1)),Z1}var X1={},cK;function lK(){return cK||(cK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.TimestampConfig=e.TimestampFieldType=void 0;const n=H.__importStar(Q),r=mt();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})]))}(X1)),X1}var fK;function Vl(){if(fK)return Hp;fK=1,Object.defineProperty(Hp,"__esModule",{value:!0}),Hp.NestableWidget=void 0;const t=H.__importStar(Q),n=xz(),r=Az(),i=Fz(),o=Pz(),a=Dz(),u=Vz(),s=Gz(),c=Yz(),l=Xz(),f=eK(),d=nK(),p=iK(),h=aK(),v=sK(),m=lK();return Hp.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]),Hp}var dK;function Q1(){return dK||(dK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Group=e.GroupConfig=e.GroupFieldType=void 0;const n=H.__importStar(Q),r=Kl(),i=mt(),o=Vl();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})]))}(F1)),F1}var ew={},pK;function tw(){return pK||(pK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(xz(),e),t.__exportStar(Az(),e),t.__exportStar(Fz(),e),t.__exportStar(Pz(),e),t.__exportStar(Dz(),e),t.__exportStar(Vz(),e),t.__exportStar(Gz(),e),t.__exportStar(Yz(),e),t.__exportStar(Vl(),e),t.__exportStar(Xz(),e),t.__exportStar(eK(),e),t.__exportStar(nK(),e),t.__exportStar(iK(),e),t.__exportStar(aK(),e),t.__exportStar(sK(),e),t.__exportStar(lK(),e)}(ew)),ew}var nw={},rw={},hK;function iw(){return hK||(hK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CompositeSlice=e.CompositeSliceConfig=e.CompositeSliceType=void 0;const n=H.__importStar(Q),r=Kl(),i=mt(),o=Vl();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})]))}(rw)),rw}var Yp={},mK;function vK(){if(mK)return Yp;mK=1,Object.defineProperty(Yp,"__esModule",{value:!0}),Yp.LegacySlice=void 0;const t=H.__importStar(Q),n=Q1(),r=Vl();return Yp.LegacySlice=t.union([r.NestableWidget,n.Group]),Yp}var ow={},gK;function vy(){return gK||(gK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SharedSlice=e.SharedSliceType=e.Variation=void 0;const n=H.__importStar(Q),r=O_(),i=Kl(),o=Vl(),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})]))}(ow)),ow}var Zp={},yK;function bK(){if(yK)return Zp;yK=1,Object.defineProperty(Zp,"__esModule",{value:!0}),Zp.SharedSliceRef=void 0;const t=H.__importStar(Q),n=vy();return Zp.SharedSliceRef=t.exact(t.type({type:t.literal(n.SharedSliceType)})),Zp}var _K;function SK(){return _K||(_K=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(Q),r=Kl(),i=mt(),o=iw(),a=vK(),u=vy(),s=bK();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}}}(nw)),nw}var aw={},$K;function TK(){return $K||($K=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UID=e.UIDConfig=e.UIDFieldType=void 0;const n=H.__importStar(Q),r=mt();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})]))}(aw)),aw}var IK;function OK(){if(IK)return Tr;IK=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.Widgets=Tr.FieldType=Tr.DynamicWidget=Tr.StaticWidget=Tr.widgetReader=void 0;const t=H.__importStar(Q),n=Q1(),r=tw(),i=Vl(),o=SK(),a=TK();function u(s){return t.union([a.UID,i.NestableWidget,n.Group,s])}return Tr.widgetReader=u,Tr.StaticWidget=u(o.StaticSlices),Tr.DynamicWidget=u(o.DynamicSlices),Tr.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}),Tr.Widgets={toStatic(s,c){switch(s.type){case"Choice":case"Slices":return o.Slices.toStatic(s,c);default:return s}}},Tr}var wK;function RK(){if(wK)return Oi;wK=1,Object.defineProperty(Oi,"__esModule",{value:!0}),Oi.Sections=Oi.DynamicSection=Oi.StaticSection=Oi.sectionReader=void 0;const t=H.__importStar(Q),n=Kl(),r=OK();function i(o){return t.record(n.WidgetKey,o)}return Oi.sectionReader=i,Oi.StaticSection=i(r.StaticWidget),Oi.DynamicSection=i(r.DynamicWidget),Oi.Sections={toStatic(o,a){return Object.entries(o).reduce((s,[c,l])=>({...s,[c]:r.Widgets.toStatic(l,a)}),{})}},Oi}var EK;function ube(){if(EK)return rn;EK=1,Object.defineProperty(rn,"__esModule",{value:!0}),rn.filterMissingSharedSlices=rn.collectWidgets=rn.validateSlices=rn.toStatic=rn.flattenWidgets=rn.CustomType=rn.StaticCustomType=void 0;const e=H,t=xn(),n=e.__importStar(Q),r=O_(),i=mt(),o=RK();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:
|
|
29
|
+
${m.map(g=>` - ${g}`).join(`
|
|
30
|
+
`)}
|
|
31
|
+
`}}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})]))}rn.StaticCustomType=u(o.StaticSection),rn.CustomType=u(o.DynamicSection);function s(v){return Object.entries(v.json).reduce((m,[,_])=>{const g=Object.entries(_);return m.concat(g)},[])}rn.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:_}}rn.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)}rn.validateSlices=d;function p(v,m){const _=Object.entries(v.json).reduce((g,[S,b])=>{const $=Object.entries(b).reduce((T,[C,R])=>{const q=m(C,R);return q?{...T,[C]:q}:T},{});return{...g,[S]:$}},{});return{...v,json:_}}rn.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,C])=>C.type==="SharedSlice"&&!m.get(T)?$:{...$,[T]:C},{}),b={...g.config,choices:S};return{...g,config:b}}return g})}return rn.filterMissingSharedSlices=h,rn}var uw={},sw={},CK;function cw(){return CK||(CK=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={}))}(sw)),sw}var Xp={},xs={},Qp={},MK;function sbe(){if(MK)return Qp;MK=1,Object.defineProperty(Qp,"__esModule",{value:!0}),Qp.toRecord=void 0;function e(t,n){return t.reduce((r,i)=>{const o=n(i);return{...r,[o]:i}},{})}return Qp.toRecord=e,Qp}var ta={},xK;function lw(){if(xK)return ta;xK=1,Object.defineProperty(ta,"__esModule",{value:!0}),ta.withOptionals=ta.isNotEmpty=ta.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}}},{})}ta.zipObjects=e;function t(r){return Boolean(Object.keys(r).length)}ta.isNotEmpty=t;function n(r,i){return{...r,...i.reduce((o,[a,u])=>u?{...o,[a]:u}:o,{})}}return ta.withOptionals=n,ta}var kK;function AK(){if(kK)return xs;kK=1,Object.defineProperty(xs,"__esModule",{value:!0}),xs.Objects=xs.Arrays=void 0;const e=H;return xs.Arrays=e.__importStar(sbe()),xs.Objects=e.__importStar(lw()),xs}var eh={},NK;function FK(){if(NK)return eh;NK=1,Object.defineProperty(eh,"__esModule",{value:!0}),eh.VariationComparator=void 0;const e=AK(),t=cw();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 eh.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}}},eh}var WK;function cbe(){if(WK)return Xp;WK=1,Object.defineProperty(Xp,"__esModule",{value:!0}),Xp.SliceComparator=void 0;const e=AK(),t=cw(),n=FK();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 Xp.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}}},Xp}var PK;function lbe(){return PK||(PK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(cw(),e),t.__exportStar(cbe(),e),t.__exportStar(FK(),e)}(uw)),uw}var fw={},dw={},LK;function fbe(){return LK||(LK=1,function(e){var t=pe&&pe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImageConstraint=void 0;var n=B1();Object.defineProperty(e,"ImageConstraint",{enumerable:!0,get:function(){return t(n).default}})}(dw)),dw}var pw={},hw={},DK;function dbe(){return DK||(DK=1,Object.defineProperty(hw,"__esModule",{value:!0})),hw}var th={},jK;function pbe(){if(jK)return th;jK=1,Object.defineProperty(th,"__esModule",{value:!0}),th.SlicesTypes=void 0;const t=H.__importStar(Q),n=iw(),r=vy();return th.SlicesTypes=t.keyof({[n.CompositeSliceType]:null,[r.SharedSliceType]:null}),th}var qK;function hbe(){return qK||(qK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(iw(),e),t.__exportStar(vK(),e),t.__exportStar(vy(),e),t.__exportStar(bK(),e),t.__exportStar(dbe(),e),t.__exportStar(SK(),e),t.__exportStar(pbe(),e)}(pw)),pw}var UK;function na(){return UK||(UK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(Q1(),e),t.__exportStar(tw(),e),t.__exportStar(fbe(),e),t.__exportStar(hbe(),e),t.__exportStar(TK(),e),t.__exportStar(OK(),e)}(fw)),fw}(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(ube(),e),t.__exportStar(lbe(),e),t.__exportStar(RK(),e),t.__exportStar(na(),e)})(Pe);const BK={unsplash:{url:"https://unsplash.wroom.io"}},zK=K.createContext(BK);function mbe(){return K.useContext(zK)}var _t={},ks={},mw={},vw={},wi={},KK;function Hl(){if(KK)return wi;KK=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.defaultCtx=wi.getFieldCtx=wi.LegacyContentCtx=wi.FieldOrSliceType=void 0;const t=H.__importStar(Q),n=na();wi.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)}};wi.LegacyContentCtx=r;function i(a,u,s){return new r(a,[...u.fieldPath,u.fieldKey,...s||[]],u.allTypes)}wi.getFieldCtx=i;function o(a,u=new Map){return new r(a,[],u)}return wi.defaultCtx=o,wi}var As={},VK;function Nt(){if(VK)return As;VK=1,Object.defineProperty(As,"__esModule",{value:!0}),As.hasContentType=As.hasFieldContentType=void 0;const e=xn(),t=cR();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))}As.hasFieldContentType=n;function r(i){return typeof i=="object"&&i!==null&&"__TYPE__"in i}return As.hasContentType=r,As}var gw={},yw={},HK;function GK(){return HK||(HK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BooleanContent=e.BooleanLegacy=e.isBooleanContent=e.BooleanContentType=void 0;const t=H,n=ht,r=Xe(),i=t.__importStar(Q),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})}(yw)),yw}var bw={},JK;function _w(){return JK||(JK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.buildEmbedContent=e.EmbedContent=e.EmbedLegacy=e.EmbedContentLegacy=e.isEmbedContent=e.EmbedContentType=void 0;const t=H,n=ht,r=Xe(),i=t.__importStar(Q),o=lw(),a=mt(),u=Nt();e.EmbedContentType="EmbedContent";const s=f=>(0,u.hasContentType)(f)&&f.__TYPE__===e.EmbedContentType;e.isEmbedContent=s,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:a.StringOrNull,author_name:a.StringOrNull,author_url:a.StringOrNull,provider_name:a.StringOrNull,provider_url:a.StringOrNull,cache_age:i.union([i.string,i.number,i.null]),thumbnail_url:a.StringOrNull,thumbnail_width:a.NumberOrNull,thumbnail_height:a.NumberOrNull,html:a.StringOrNull})]));const c=f=>new i.Type("EmbedLegacy",e.isEmbedContent,d=>(0,r.pipe)(e.EmbedContentLegacy.decode(d),n.either.map(p=>l({...p,__TYPE__:e.EmbedContentType}))),d=>({content:l(d).all,types:{[f.keyOfType]:"Embed"}}));e.EmbedLegacy=c,e.EmbedContent=new i.Type("EmbedContent",e.isEmbedContent,f=>(0,r.pipe)(i.intersection([e.EmbedContentLegacy,i.strict({__TYPE__:i.literal(e.EmbedContentType)})]).decode(f),n.either.map(d=>l(d))),f=>f);function l(f){return{...f,all:(0,o.withOptionals)({embed_url:f.embed_url,type:f.type},[["author_name",f.author_name],["author_url",f.author_url],["cache_age",f.cache_age],["html",f.html],["provider_name",f.provider_name],["provider_url",f.provider_url],["thumbnail_height",f.thumbnail_height],["thumbnail_width",f.thumbnail_width],["thumbnail_url",f.thumbnail_url],["title",f.title],["version",f.version]])}}e.buildEmbedContent=l}(bw)),bw}var Sw={},$w={},gy={},YK;function Ns(){if(YK)return gy;YK=1,Object.defineProperty(gy,"__esModule",{value:!0});const e=H,t=So,n=ai,r=e.__importStar(Q);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 gy.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),gy}var nh={},ZK;function ra(){return ZK||(ZK=1,Object.defineProperty(nh,"__esModule",{value:!0}),nh.FieldContentType=void 0,nh.FieldContentType="FieldContent"),nh}var XK;function QK(){return XK||(XK=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorContent=e.ColorLegacy=e.isColorContent=void 0;const t=H,n=ht,r=Xe(),i=t.__importStar(Q),o=na(),a=t.__importDefault(Ns()),u=Nt(),s=ra(),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)})}($w)),$w}var Tw={},e2;function t2(){return e2||(e2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DateContent=e.DateLegacy=e.isDateContent=void 0;const t=H,n=ht,r=Xe(),i=t.__importStar(Q),o=na(),a=t.__importDefault(Ns()),u=Nt(),s=ra(),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)})}(Tw)),Tw}var Iw={},n2;function r2(){return n2||(n2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.NumberContent=e.NumberLegacy=e.isNumberContent=void 0;const t=H,n=ht,r=Xe(),i=t.__importStar(Q),o=na(),a=t.__importDefault(Ns()),u=Nt(),s=ra(),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)})}(Iw)),Iw}var Ow={},i2;function o2(){return i2||(i2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RangeContent=e.RangeLegacy=e.isRangeContent=void 0;const t=H,n=ht,r=Xe(),i=t.__importStar(Q),o=na(),a=t.__importDefault(Ns()),u=Nt(),s=ra(),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)})}(Ow)),Ow}var ww={},a2;function u2(){return a2||(a2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectContent=e.SelectLegacy=e.isSelectContent=void 0;const t=H,n=ht,r=Xe(),i=t.__importStar(Q),o=na(),a=t.__importDefault(Ns()),u=Nt(),s=ra(),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)})}(ww)),ww}var Rw={},s2;function c2(){return s2||(s2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextContent=e.TextLegacy=e.isTextContent=void 0;const t=H,n=ht,r=Xe(),i=t.__importStar(Q),o=na(),a=t.__importDefault(Ns()),u=Nt(),s=ra(),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)})}(Rw)),Rw}var Ew={},l2;function f2(){return l2||(l2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TimestampContent=e.TimestampLegacy=e.isTimestampContent=void 0;const t=H,n=ht,r=Xe(),i=t.__importStar(Q),o=na(),a=t.__importDefault(Ns()),u=Nt(),s=ra(),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)})}(Ew)),Ew}var d2;function p2(){return d2||(d2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FieldContent=e.FieldType=void 0;const t=H,n=t.__importStar(Q),r=QK(),i=t2(),o=r2(),a=o2(),u=u2(),s=c2(),c=f2();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(QK(),e),t.__exportStar(ra(),e),t.__exportStar(t2(),e),t.__exportStar(r2(),e),t.__exportStar(o2(),e),t.__exportStar(u2(),e),t.__exportStar(c2(),e),t.__exportStar(f2(),e)}(Sw)),Sw}var Cw={},h2;function m2(){return h2||(h2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.GeoPointContent=e.GeoPointLegacy=e.isGeoPointContent=e.GeoPointContentType=void 0;const t=H,n=ht,r=ai,i=t.__importStar(Q),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)})])}(Cw)),Cw}var Mw={},v2;function xw(){return v2||(v2=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=ht,r=Xe(),i=t.__importStar(Q),o=lw(),a=mt(),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)})])}(Mw)),Mw}var kw={},g2;function y2(){return g2||(g2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.IntegrationFieldContent=e.IntegrationFieldLegacy=e.isIntegrationFieldContent=e.IntegrationFieldContentType=void 0;const t=H,n=ht,r=Xe(),i=t.__importStar(Q),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})}(kw)),kw}var Aw={},b2=Jh(oi,function(e){return e.length>0},"NonEmptyString");function _2(e,t){t===void 0&&(t="NonEmptyArray<"+e.name+">");var n=Zh(e);return new Se(t,function(r){return n.is(r)&&Lt(r)},function(r,i){return fe(n.validate(r,i),Fr(function(o){var a=hS(o);return je(a)?tt(r,i):we(a.value)}))},function(r){return n.encode(r)})}function S2(e,t,n){n===void 0&&(n="Set<"+e.name+">");var r=Zh(e),i=eU(t),o=Zq(t);return new Se(n,function(a){return a instanceof Set&&Qq(e.is)(a)},function(a,u){return fe(r.validate(a,u),Fr(function(s){var c=o(s);return c.size!==s.length?tt(a,u):we(c)}))},function(a){return r.encode(i(a))})}function vbe(e,t,n){return n===void 0&&(n="ReadonlySet<"+e.name+">"),S2(e,t,n)}function Nw(e,t){return new Se(e,t,function(n,r){return t(n)?we(n):tt(n,r)},De)}var gbe=function(e){return e instanceof Date},ybe=Nw("Date",gbe),bbe=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))},_be=function(e,t){return{get:e,reverseGet:t}},$2=function(e){return tu(e.get,V(e.reverseGet,Vn))},Sbe=function(e){return Fs(V(e.get,bt),e.reverseGet)},$be=function(e){return ia(V(e.get,bt),V(e.reverseGet,Vn))},Tbe=function(e){return Gl(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.reverseGet(i)})}}})},tu=function(e,t){return{get:e,set:t}},Fw=function(e){return ia(V(e.get,bt),e.set)},Ibe=function(e){return Gl(function(t){return function(n){return function(r){return t.map(n(e.get(r)),function(i){return e.set(i)(r)})}}})},T2=function(e){return function(t){return tu(function(n){return e.get(t.get(n))},function(n){return function(r){return t.set(e.set(n)(t.get(r)))(r)}})}},Obe=function(e){return function(t){return Fs(V(t.getOption,xd(e.getOption)),V(e.reverseGet,t.reverseGet))}},wbe=function(e){return function(t){return Ws(Ww(e))(Fw(t))}},Rbe=function(){return tu(j,Vn)},Ebe=function(e){return function(t){return tu(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)}})}},Cbe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return tu(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}})}},Mbe=function(e){return function(t){return tu(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)}})}},xbe=function(e){return function(t){return fe(t,T2(Qbe().at(e)))}},Fs=function(e,t){return{getOption:e,reverseGet:t}},Ww=function(e){return ia(e.getOption,function(t){return O2(t)(e)})},I2=function(e){return Gl(function(t){return function(n){return function(r){return fe(e.getOption(r),wo(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return O2(o)(e)(r)})}))}}})},kbe=function(e){return function(t){return function(n){return fe(t.getOption(n),zi(function(r){var i=e(r);return i===r?n:t.reverseGet(i)}))}}},Abe=function(e){return function(t){var n=kbe(e)(t);return function(r){return fe(n(r),V$(function(){return r}))}}},O2=function(e){return Abe(function(){return e})},Nbe=function(e){return function(t){return Ws(Fw(e))(Ww(t))}},Fbe=function(){return Fs(Hu,j)},Pw=function(e){return Fs(rv(e),j)},Wbe=function(){return Fs(j,bt)},Pbe=function(){return Fs(Yc,Ge)},Lbe=function(){return Fs(function(e){return se(e)?bt(e.left):ot},$t)},ia=function(e,t){return{getOption:e,set:t}},Dbe=function(e){return Gl(function(t){return function(n){return function(r){return fe(e.getOption(r),wo(function(){return t.of(r)},function(i){return t.map(n(i),function(o){return e.set(o)(r)})}))}}})},w2=function(e){return function(t){return function(n){return fe(t.getOption(n),zi(function(r){var i=e(r);return i===r?n:t.set(i)(n)}))}}},R2=function(e){return function(t){var n=w2(e)(t);return function(r){return fe(n(r),V$(function(){return r}))}}},Ws=function(e){return function(t){return ia(V(t.getOption,xd(e.getOption)),function(n){return R2(e.set(n))(t)})}},jbe=function(e){return function(t){return fe(t,Ws(Jbe().index(e)))}},qbe=function(e){return function(t){return fe(t,Ws(Ybe().index(e)))}},Ube=function(e){return function(t){return fe(t,Ws(Zbe().index(e)))}},Bbe=function(e){return ia(Fm(e),function(t){return function(n){return fe(Nm(e)(n),wo(function(){return n},function(r){return Hm(r,t,n)}))}})},E2=function(e,t,n){if(n[e]===t)return n;var r=bbe([n[0]],n.slice(1),!0);return r[e]=t,r},zbe=function(e){return ia(Fm(e),function(t){return function(n){return fe(Nm(e)(n),wo(function(){return n},function(r){return E2(r,t,n)}))}})},Gl=function(e){return{modifyF:e}};function Lw(e){return function(t){return Gl(function(n){return function(r){return t.modifyF(n)(e.modifyF(n)(r))}})}}var Kbe={URI:"Identity",map:function(e,t){return t(e)},of:j,ap:function(e,t){return e(t)}},Vbe=function(e){return e.URI==="Identity"};function Hbe(e){return function(){return Gl(function(t){var n=Vbe(t)?e.map:e.traverse(t);return function(r){return function(i){return n(i,r)}}})}}function Gbe(e){return Lw(Hbe(e)())}var Dw=function(e){return{index:e}},Jbe=function(){return Dw(function(e){return ia(function(t){return qu(e,t)},function(t){return function(n){return fe(qu(e,n),wo(function(){return n},function(){return Hm(e,t,n)}))}})})},Ybe=function(){return Dw(function(e){return ia(function(t){return qu(e,t)},function(t){return function(n){return fe(qu(e,n),wo(function(){return n},function(){return E2(e,t,n)}))}})})},Zbe=function(){return Dw(function(e){return ia(function(t){return ds(e,t)},function(t){return function(n){return n[e]===t||je(ds(e,n))?n:kI(e,t)(n)}})})},Xbe=function(e){return{at:e}};function Qbe(){return Xbe(function(e){return tu(function(t){return ds(e,t)},wo(function(){return Sg(e)},function(t){return kI(e,t)}))})}var C2=_be,jw=$2,qw=Sbe,Uw=$be,Bw=Tbe,e_e=function(e){return function(t){return C2(V(t.get,e.get),V(e.reverseGet,t.reverseGet))}},t_e=function(e){return C2(e.reverseGet,e.get)},n_e=function(e){return function(t){return function(n){return t.reverseGet(e(t.get(n)))}}},M2=tu,yy=Rbe,nu=Fw,Jl=Ibe,Ps=T2,r_e=Ps,i_e=V($2,Ps),Ls=wbe,zw=function(e){return V(nu,Ws(e))},o_e=function(e){return V(Jl,Lw(e))},x2=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 a_e(e){return function(t){return function(n){return function(r){return fe(n.get(r),t,function(i){return e.map(i,function(o){return n.set(o)(r)})})}}}}var u_e=function(e){return Ls(Fbe())(e)};function s_e(e){return Ls(Pw(e))}var k2=Ebe,A2=Cbe,c_e=Mbe,l_e=function(e){return V(nu,jbe(e))},f_e=function(e){return V(nu,qbe(e))},d_e=function(e){return V(nu,Ube(e))},p_e=xbe,h_e=Ls(Wbe()),m_e=Ls(Pbe()),v_e=Ls(Lbe());function g_e(e){return V(Jl,Gbe(e))}function y_e(e){return zw(Bbe(e))}function b_e(e){return zw(zbe(e))}var __e=function(e,t){return function(n){return N2(n,e,t)}},N2=function(e,t,n){return M2(V(e.get,t),V(n,e.set))},by="monocle-ts/Lens",S_e={URI:by,imap:N2},F2={URI:by,compose:function(e,t){return Ps(e)(t)}},$_e={URI:by,compose:F2.compose,id:yy};const T_e=Object.freeze(Object.defineProperty({__proto__:null,Category:$_e,Invariant:S_e,Semigroupoid:F2,URI:by,asOptional:nu,asTraversal:Jl,atKey:p_e,component:c_e,compose:Ps,composeIso:i_e,composeLens:r_e,composeOptional:zw,composePrism:Ls,composeTraversal:o_e,filter:s_e,findFirst:y_e,findFirstNonEmpty:b_e,fromNullable:u_e,id:yy,imap:__e,index:l_e,indexNonEmpty:f_e,key:d_e,left:v_e,lens:M2,modify:x2,modifyF:a_e,prop:k2,props:A2,right:m_e,some:h_e,traverse:g_e},Symbol.toStringTag,{value:"Module"}));var W2=Dbe,Ds=Ws,I_e=w2,O_e=R2,w_e=Pw,Kw=Ww,Vw=I2,Hw=Obe,R_e=Nbe,oa=Lw,P2=function(e){return function(t){return t.modifyF(Kbe)(e)}},E_e=function(e){return P2(function(){return e})};function C_e(e){return oa(I2(Pw(e)))}var L2=function(e){return new j2(e.get,e.reverseGet)},Yl=function(e){return new Gw(e.get,e.set)},rh=function(e){return new q2(e.getOption,e.reverseGet)},zr=function(e){return new M_e(e.getOption,e.set)},Ir=function(e){return new x_e(e.modifyF)},D2=function(e,t,n){var r;return n===e[t]?e:Object.assign({},e,(r={},r[t]=n,r))},j2=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 L2(t_e(this))},e.prototype.modify=function(t){return n_e(t)(this)},e.prototype.asLens=function(){return Yl(jw(this))},e.prototype.asPrism=function(){return rh(qw(this))},e.prototype.asOptional=function(){return zr(Uw(this))},e.prototype.asTraversal=function(){return Ir(Bw(this))},e.prototype.asFold=function(){var t=this;return new Zl(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.asGetter=function(){var t=this;return new B2(function(n){return t.get(n)})},e.prototype.asSetter=function(){var t=this;return new ih(function(n){return t.modify(n)})},e.prototype.compose=function(t){return L2(e_e(t)(this))},e.prototype.composeIso=function(t){return this.compose(t)},e.prototype.composeLens=function(t){return Yl(fe(this,jw,Ps(t)))},e.prototype.composePrism=function(t){return rh(fe(this,qw,Hw(t)))},e.prototype.composeOptional=function(t){return zr(fe(this,Uw,Ds(t)))},e.prototype.composeTraversal=function(t){return Ir(fe(this,Bw,oa(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}(),Gw=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 Yl(fe(yy(),k2(t)))}},e.fromProps=function(){return function(t){return Yl(fe(yy(),A2.apply(T_e,t)))}},e.fromNullableProp=function(){return function(t,n){return new e(function(r){var i=Hu(r[t]);return je(i)?n:i.value},function(r){return function(i){return D2(i,t,r)}})}},e.prototype.modify=function(t){return x2(t)(this)},e.prototype.asOptional=function(){return zr(nu(this))},e.prototype.asTraversal=function(){return Ir(Jl(this))},e.prototype.asSetter=function(){var t=this;return new ih(function(n){return t.modify(n)})},e.prototype.asGetter=function(){var t=this;return new B2(function(n){return t.get(n)})},e.prototype.asFold=function(){var t=this;return new Zl(function(){return function(n){return function(r){return n(t.get(r))}}})},e.prototype.compose=function(t){return Yl(Ps(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 zr(fe(this,nu,Ds(t)))},e.prototype.composeTraversal=function(t){return Ir(fe(this,Jl,oa(t)))},e.prototype.composeSetter=function(t){return this.asSetter().compose(t)},e.prototype.composeIso=function(t){return Yl(fe(this,Ps(fe(t,jw))))},e.prototype.composePrism=function(t){return zr(Ls(t)(this))},e}(),q2=function(){function e(t,n){this.getOption=t,this.reverseGet=n,this._tag="Prism"}return e.fromPredicate=function(t){return rh(w_e(t))},e.some=function(){return U2},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 $F.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 zr(Kw(this))},e.prototype.asTraversal=function(){return Ir(Vw(this))},e.prototype.asSetter=function(){var t=this;return new ih(function(n){return t.modify(n)})},e.prototype.asFold=function(){var t=this;return new Zl(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 rh(Hw(t)(this))},e.prototype.composePrism=function(t){return this.compose(t)},e.prototype.composeOptional=function(t){return zr(fe(this,Kw,Ds(t)))},e.prototype.composeTraversal=function(t){return Ir(fe(this,Vw,oa(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 rh(fe(this,Hw(fe(t,qw))))},e.prototype.composeLens=function(t){return zr(R_e(t)(this))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),U2=new q2(j,bt),M_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 Hu(n[t])},function(n){return function(r){return r[t]==null?r:D2(r,t,n)}})}},e.fromOptionProp=function(){var t=Gw.fromProp();return function(n){return t(n).composePrism(U2)}},e.prototype.modify=function(t){return O_e(t)(this)},e.prototype.modifyOption=function(t){return I_e(t)(this)},e.prototype.asTraversal=function(){return Ir(W2(this))},e.prototype.asFold=function(){var t=this;return new Zl(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 ih(function(n){return t.modify(n)})},e.prototype.compose=function(t){return zr(Ds(t)(this))},e.prototype.composeOptional=function(t){return this.compose(t)},e.prototype.composeTraversal=function(t){return Ir(fe(this,W2,oa(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 zr(fe(this,Ds(fe(t,nu))))},e.prototype.composePrism=function(t){return zr(fe(this,Ds(fe(t,Kw))))},e.prototype.composeIso=function(t){return zr(fe(this,Ds(fe(t,Uw))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),x_e=function(){function e(t){this.modifyF=t,this._tag="Traversal"}return e.prototype.modify=function(t){return P2(t)(this)},e.prototype.set=function(t){return E_e(t)(this)},e.prototype.filter=function(t){return Ir(C_e(t)(this))},e.prototype.asFold=function(){var t=this;return new Zl(function(n){return function(r){return t.modifyF(OF(n))(function(i){return Zc(r(i))})}})},e.prototype.asSetter=function(){var t=this;return new ih(function(n){return t.modify(n)})},e.prototype.compose=function(t){return Ir(oa(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 Ir(fe(this,oa(fe(t,Jl))))},e.prototype.composePrism=function(t){return Ir(fe(this,oa(fe(t,Vw))))},e.prototype.composeIso=function(t){return Ir(fe(this,oa(fe(t,Bw))))},e.prototype.composeGetter=function(t){return this.asFold().compose(t.asFold())},e}(),B2=function(){function e(t){this.get=t,this._tag="Getter"}return e.prototype.asFold=function(){var t=this;return new Zl(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}(),Zl=function(){function e(t){this.foldMap=t,this._tag="Fold",this.getAll=t(O$())(Wa),this.exist=t(TL),this.all=t($L),this.foldMapFirst=t(TF())}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(rv(t))},e.prototype.headOption=function(t){return this.find(function(){return!0})(t)},e}(),ih=function(){function e(t){this.modify=t,this._tag="Setter"}return e.prototype.set=function(t){return this.modify(Vn(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}(),k_e=new j2(gc,gc);function A_e(){return k_e}function N_e(e,t){t===void 0&&(t="fromNewtype("+e.name+")");var n=A_e();return new Se(t,function(r){return e.is(r)},function(r,i){return fe(e.validate(r,i),Wu(n.wrap))},function(r){return e.encode(n.unwrap(r))})}var F_e=ed({_tag:Xf("None")}),W_e=Xf("Some");function z2(e,t){return t===void 0&&(t="Option<"+e.name+">"),Qf([F_e,ed({_tag:W_e,value:e},"Some<"+e.name+">")],t)}function P_e(e,t){return t===void 0&&(t="Option<"+e.name+">"),new Se(t,z2(e).is,function(n,r){return n==null?we(ot):fe(e.validate(n,r),Wu(bt))},function(n){return H$(fe(n,zi(e.encode)))})}var L_e=new Se("DateFromISOString",function(e){return e instanceof Date},function(e,t){return fe(oi.validate(e,t),Fr(function(n){var r=new Date(n);return isNaN(r.getTime())?tt(e,t):we(r)}))},function(e){return e.toISOString()});function D_e(e,t){return t===void 0&&(t="ReadonlyNonEmptyArray<"+e.name+">"),_2(e,t)}function K2(e){var t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t}var j_e=new Se("DateFromNumber",function(e){return e instanceof Date},function(e,t){return fe(Du.validate(e,t),Fr(function(n){var r=new Date(n);return isNaN(r.getTime())?tt(e,t):we(r)}))},function(e){return e.getTime()});function _y(e,t,n){n===void 0&&(n=e.name);var r=K2(e);return r.validate=t,r.decode=function(i){return t(i,px(r))},r.name=n,r}function q_e(e,t,n){return n===void 0&&(n="withFallback("+e.name+")"),_y(e,function(r,i){return $M(function(){return we(t)})(e.validate(r,i))},n)}var U_e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,B_e=Jh(oi,function(e){return U_e.test(e)},"UUID");function z_e(e,t,n){return n===void 0&&(n="fromNullable("+e.name+")"),_y(e,function(r,i){return r==null?we(t):e.validate(r,i)},n)}var K_e=new Se("BooleanFromString",Gh.is,function(e,t){return fe(oi.validate(e,t),Fr(function(n){return n==="true"?we(!0):n==="false"?we(!1):tt(e,t)}))},String);function V_e(e,t){return _y(e,function(n,r){return Jf(function(){return[{value:n,context:r,message:t(n,r),actual:n}]})(e.validate(n,r))})}function V2(e){switch(e._tag){case"InterfaceType":return e.props;case"ExactType":return V2(e.type)}}var H_e=Gw.fromProp();function G_e(e){var t={};for(var n in V2(e))t[n]=H_e(n);return t}var J_e=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Y_e=Nw("RegExp",J_e),Z_e=new Se("DateFromUnixTime",function(e){return e instanceof Date},function(e,t){return fe(Yh.validate(e,t),Fr(function(n){var r=new Date(n*1e3);return isNaN(r.getTime())?tt(e,t):we(r)}))},function(e){return Math.floor(e.getTime()/1e3)}),Jw=new Se("NumberFromString",Du.is,function(e,t){return fe(oi.validate(e,t),Fr(function(n){var r=+n;return isNaN(r)||n.trim()===""?tt(e,t):we(r)}))},String),X_e=new Se("IntFromString",Yh.is,function(e,t){return fe(Jw.validate(e,t),Fr(function(n){return Yh.is(n)?we(n):tt(e,t)}))},Jw.encode),H2=b_("JsonArray",function(){return cx(Sy)}),G2=b_("JsonRecord",function(){return $_(oi,Sy)}),Sy=Qf([Gh,Du,oi,g_,H2,G2],"Json"),Q_e=new Se("JsonFromString",Sy.is,function(e,t){try{return we(JSON.parse(e))}catch{return tt(e,t)}},function(e){return JSON.stringify(e)}),eSe=Xf("Left"),tSe=Xf("Right");function nSe(e,t,n){return n===void 0&&(n="Either<"+e.name+", "+t.name+">"),Qf([ed({_tag:eSe,left:e},"Left<"+e.name+">"),ed({_tag:tSe,right:t},"Right<"+e.name+">")],n)}var rSe=new Se("BigIntFromString",function(e){return typeof e=="bigint"},function(e,t){return fe(oi.validate(e,t),Fr(function(n){if(!b2.is(n.trim()))return tt(e,t);try{return we(BigInt(n))}catch{return tt(e,t)}}))},String);function iSe(e,t,n){return n===void 0&&(n=e.name),new Se(n,e.is,e.validate,t)}var oSe=new Se("BooleanFromNumber",Gh.is,function(e,t){return fe(Du.validate(e,t),Wu(function(n){return n!==0}))},Number);const J2=vc(Object.freeze(Object.defineProperty({__proto__:null,BigIntFromString:rSe,BooleanFromNumber:oSe,BooleanFromString:K_e,DateFromISOString:L_e,DateFromNumber:j_e,DateFromUnixTime:Z_e,IntFromString:X_e,Json:Sy,JsonArray:H2,JsonFromString:Q_e,JsonRecord:G2,NonEmptyString:b2,NumberFromString:Jw,UUID:B_e,clone:K2,date:ybe,either:nSe,fromNewtype:N_e,fromNullable:z_e,fromRefinement:Nw,getLenses:G_e,mapOutput:vz,nonEmptyArray:_2,option:z2,optionFromNullable:P_e,readonlyNonEmptyArray:D_e,readonlySetFromArray:vbe,regexp:Y_e,setFromArray:S2,withEncode:iSe,withFallback:q_e,withMessage:V_e,withValidate:_y},Symbol.toStringTag,{value:"Module"})));var Y2;function Yw(){return Y2||(Y2=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=ht,r=Xe(),i=t.__importStar(Q),o=J2,a=mt(),u=eu(),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})}(Aw)),Aw}var aa={},Zw={},Z2;function aSe(){return Z2||(Z2=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyContent=e.EmptyLegacy=e.isEmptyContent=e.EmptyContentType=void 0;const t=H,n=ht,r=Xe(),i=t.__importStar(Q),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)})}(Zw)),Zw}var Xw={},Qw={},X2;function Q2(){return X2||(X2=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=ht,r=xn(),i=Xe(),o=t.__importStar(Q),a=tw(),u=mt(),s=eu(),c=_w(),l=xw(),f=Yw();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 C=$.reduce((R,q)=>{const G=e.Meta.decode(q);if((0,r.isRight)(G)){const A=G.right;if(A.data&&A.type==="hyperlink"){const Y=b.decode(A.data);return(0,r.isLeft)(Y)?R:[...R,{...A,data:Y.right}]}else if(A.type!=="hyperlink")return[...R,A]}return R},[]).sort((R,q)=>R.start-q.start);return o.success(C)}else return o.failure($,T)},$=>$.reduce((T,C)=>{if(C.type==="hyperlink"&&C.data){const R=b.decode(C.data);return(0,r.isLeft)(R)?T:[...T,{...C,data:b.encode(R.right)}]}return[...T,e.Meta.encode(C)]},[]));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:c.EmbedContentLegacy}),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.map($=>e.EmbedBlock.encode({...$,data:(0,c.buildEmbedContent)({...$.data,__TYPE__:c.EmbedContentType})}))),b=>h.encode(b));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])}(Qw)),Qw}var eV;function tV(){return eV||(eV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RichTextLegacy=e.RichTextContent=e.isRichTextContent=e.RichTextContentType=void 0;const t=H,n=ht,r=Xe(),i=t.__importStar(Q),o=Nt(),a=Q2();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(Q2(),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}(Xw)),Xw}var eR={},nV;function rV(){return nV||(nV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SeparatorContent=e.SeparatorLegacy=e.isSeparatorContent=e.SeparatorContentType=void 0;const n=H.__importStar(Q),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)})}(eR)),eR}var iV;function uSe(){if(iV)return aa;iV=1,Object.defineProperty(aa,"__esModule",{value:!0}),aa.NestableLegacy=aa.isNestableContent=aa.NestableContent=void 0;const e=H,t=xn(),n=e.__importStar(Q),r=aSe(),i=GK(),o=_w(),a=p2(),u=ra(),s=m2(),c=xw(),l=y2(),f=Yw(),d=tV(),p=rV();aa.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);aa.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 aa.NestableLegacy=v,aa}var oV;function js(){return oV||(oV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(GK(),e),t.__exportStar(_w(),e),t.__exportStar(p2(),e),t.__exportStar(m2(),e),t.__exportStar(xw(),e),t.__exportStar(y2(),e),t.__exportStar(Yw(),e),t.__exportStar(uSe(),e),t.__exportStar(tV(),e),t.__exportStar(rV(),e)}(gw)),gw}var aV;function $y(){return aV||(aV=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=ht,r=xn(),i=Xe(),o=t.__importStar(Q),a=Hl(),u=Nt(),s=js();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)})}(vw)),vw}var tR={},nR={},qs={},uV;function sV(){if(uV)return qs;uV=1,Object.defineProperty(qs,"__esModule",{value:!0}),qs.RepeatableWidgets=qs.RepeatableWidgetsLegacy=void 0;const t=H.__importStar(Q),n=$y(),r=js(),i=u=>t.array((0,n.GroupItemLegacy)(u));qs.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),qs.RepeatableWidgets=t.array(a),qs}var cV;function rR(){return cV||(cV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CompositeSliceContent=e.CompositeSliceLegacy=e.isCompositeSliceContent=e.CompositeSliceContentType=void 0;const t=H,n=ht,r=xn(),i=Xe(),o=t.__importStar(Q),a=Hl(),u=Nt(),s=js(),c=sV();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})}(nR)),nR}var iR={},lV;function oR(){return lV||(lV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SharedSliceContent=e.SharedSliceLegacy=e.isSharedSliceContent=e.SharedSliceContentType=void 0;const t=H,n=ht,r=xn(),i=Xe(),o=t.__importStar(Q),a=J2,u=Hl(),s=Nt(),c=js(),l=sV();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"]),C=(0,c.NestableLegacy)(T).decode($);return!C||(0,r.isLeft)(C)?S:{...S,[b]:C.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})}(iR)),iR}var ua={},fV;function aR(){if(fV)return ua;fV=1,Object.defineProperty(ua,"__esModule",{value:!0}),ua.SimpleSliceLegacy=ua.isSimpleSliceContent=ua.SimpleSliceContent=void 0;const t=H.__importStar(Q),n=$y(),r=js();ua.SimpleSliceContent=t.union([r.NestableContent,n.GroupContent]);const i=a=>(0,r.isNestableContent)(a)||(0,n.isGroupContent)(a);ua.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 ua.SimpleSliceLegacy=o,ua}var Us={},Bs={},dV;function sSe(){if(dV)return Bs;dV=1,Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.SliceContent=Bs.SliceLegacy=void 0;const t=H.__importStar(Q),n=rR(),r=oR(),i=aR(),o=a=>({decode:u=>(()=>{switch(a.fieldType){case"Slice":return(0,n.CompositeSliceLegacy)(a);case"SharedSlice":return(0,r.SharedSliceLegacy)(a);default:return(0,i.SimpleSliceLegacy)(a)}})().decode(u),encode:u=>{switch(u.__TYPE__){case"SharedSliceContent":return(0,r.SharedSliceLegacy)(a).encode(u);case"CompositeSliceContent":return(0,n.CompositeSliceLegacy)(a).encode(u);default:return(0,i.SimpleSliceLegacy)(a).encode(u)}}});return Bs.SliceLegacy=o,Bs.SliceContent=t.union([n.CompositeSliceContent,r.SharedSliceContent,i.SimpleSliceContent]),Bs}var pV;function hV(){if(pV)return Us;pV=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.SlicesItemLegacy=Us.SliceItemContent=void 0;const e=H,t=ht,n=xn(),r=Xe(),i=e.__importStar(Q),o=eu(),a=Hl(),u=sSe(),s=rR(),c=oR(),l=aR();Us.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)(m.key,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.key,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 Us.SlicesItemLegacy=d,Us}var uR={},mV;function cSe(){return mV||(mV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SlicesContent=e.SlicesLegacy=e.isSlicesContent=e.SlicesContentType=void 0;const t=H,n=ht,r=Xe(),i=t.__importStar(Q),o=Nt(),a=hV();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)})}(uR)),uR}var vV;function gV(){return vV||(vV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(rR(),e),t.__exportStar(oR(),e),t.__exportStar(aR(),e),t.__exportStar(hV(),e),t.__exportStar(cSe(),e)}(tR)),tR}var sR={},yV;function bV(){return yV||(yV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.UIDContent=e.UIDLegacy=e.isUIDContent=e.UIDContentType=void 0;const t=H,n=ht,r=Xe(),i=t.__importStar(Q),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})}(sR)),sR}var sa={},_V;function lSe(){if(_V)return sa;_V=1,Object.defineProperty(sa,"__esModule",{value:!0}),sa.WidgetLegacy=sa.isWidgetContent=sa.WidgetContent=void 0;const t=H.__importStar(Q),n=$y(),r=js(),i=gV(),o=bV();sa.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);sa.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 sa.WidgetLegacy=u,sa}var SV;function cR(){return SV||(SV=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar($y(),e),t.__exportStar(js(),e),t.__exportStar(gV(),e),t.__exportStar(bV(),e),t.__exportStar(lSe(),e)}(mw)),mw}var $V;function fSe(){if($V)return ks;$V=1,Object.defineProperty(ks,"__esModule",{value:!0}),ks.DocumentLegacy=ks.Document=void 0;const e=H,t=ht,n=xn(),r=Xe(),i=e.__importStar(Q),o=Kl(),a=cR(),u=Hl();ks.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 ks.DocumentLegacy={_codec:c,extractMetadata:l,parse:f,encode:d},ks}(function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=H;t.__exportStar(fSe(),e),t.__exportStar(cR(),e),t.__exportStar(Hl(),e)})(_t);function ca(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 TV="...";function Xl(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)??TV:e.type==="GeoPoint"?"TODO":((i=e.config)==null?void 0:i.placeholder)??TV}const dSe=({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 E.jsxs(N.Field,{children:[E.jsx(N.FieldIcon,{children:E.jsx(N.Icon,{name:"toggleOff"})}),E.jsx(N.FieldLabel,{htmlFor:n,children:ca(t)}),E.jsxs(N.FieldControl,{children:[E.jsx(N.Text,{children:Xl(t,o)}),E.jsx(N.Switch,{checked:o,id:n,onCheckedChange:u=>{i||r(pSe(u))}})]})]})};function pSe(e){return{__TYPE__:"BooleanContent",value:e}}const hSe=e=>e===void 0?void 0:{__TYPE__:"FieldContent",type:"Date",value:e},mSe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{const o=(e==null?void 0:e.value)??"";return E.jsxs(N.Field,{children:[E.jsx(N.FieldIcon,{children:E.jsx(N.Icon,{name:"dateRange"})}),E.jsx(N.FieldLabel,{htmlFor:n,children:ca(t)}),E.jsx(N.FieldControl,{children:E.jsx(N.DateInput,{id:n,placeholder:Xl(t),readOnly:i,value:o,onValueChange:a=>r(hSe(a))})})]})},oh="__MAIN_THUMBNAIL__";function IV(e,t,n){const r=e.name===oh?void 0:e.name;let i;return t?ho(n)?i=[n.width,n.height]:ho(e.width)||ho(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 vSe(e){var t,n;return[{...(t=e.config)==null?void 0:t.constraint,name:oh}].concat(((n=e.config)==null?void 0:n.thumbnails)??[])}function gSe(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 ySe(e,t,n,r){const i=r.length===0?void 0:r;return e===oh?{...t,alt:i}:{...t,thumbnails:{...t.thumbnails,[e]:{...n,alt:i}}}}function OV(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 wV(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 RV(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 bSe(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 EV=({contentView:e,constraints:t,croppedImage:n})=>{const[r,i]=OV(e.origin,t),o=wV(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}}}},_Se=({field:e,content:t,thumbnail:n,croppedImage:r})=>{var u,s,c,l;if(n===oh){const f=EV({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=EV({contentView:o,constraints:i,croppedImage:r});return a.url===o.url?t:{...t,thumbnails:{...t.thumbnails,[n]:a}}},SSe=({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)}},$Se=({contentView:e,constraints:t})=>{const n=SSe({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}},CV={x:0,y:0,width:0,height:0,zoom:1},TSe=({selectedImage:{thumbnail:e,contentView:t}})=>e.width&&e.height?e.width/e.height:t?t.origin.width/t.origin.height:1,ISe=({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=C=>{if(!h)return;const R=h.thumbnail.name,q=i[R]??CV;o({...i,[R]:{...q,zoom:C}})},m=C=>{if(!h)return;const R=h.thumbnail.name,q=i[R]??CV;o({...i,[R]:{...q,...C}})},_=C=>{if(!h)return;const R=h.thumbnail.name,q=a[R];u({...a,[R]:{...q,crop:C}})},g=C=>{if(!h)return;const R=h.thumbnail.name,q=a[R]??{};u({...a,[R]:{...q,aspectRatio:C}})},S=i[(h==null?void 0:h.thumbnail.name)??""],b=s?S??((h==null?void 0:h.contentView)&&$Se({contentView:h.contentView,constraints:h.thumbnail})):void 0,$=a[(h==null?void 0:h.thumbnail.name)??""];return E.jsxs(N.Dialog,{trigger:e,onAnimationEnd:()=>f(!0),open:s,onOpenChange:C=>{C?(p(n),o({}),u({})):(f(!1),r({option:d,croppedImages:i})),c(C)},children:[E.jsx(N.DialogHeader,{icon:"photo",title:"Image editor"}),E.jsx(N.DialogOptions,{value:String(d),onValueChange:C=>p(Number(C)),children:t.map((C,R)=>E.jsx(N.DialogOptionsItem,{value:String(R),icon:"photo",title:C.labels[0]??"Main",subtitle:C.labels[1]??""},C.thumbnail.name))}),h&&E.jsx(N.DialogContent,{children:l&&E.jsx(N.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:TSe({selectedImage:h,cropper:$}),onAspectRatioChange:g,initialCroppedArea:b,onCropAreaChange:m},h.thumbnail.name)})]})};function OSe(e){const t=K.useRef(e);return K.useLayoutEffect(()=>{t.current=e}),K.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function wSe(){const[e,t]=K.useState({});return K.useCallback(()=>t({}),[])}function RSe(e,t,n){K.useEffect(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[e])}var et;(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})(et||(et={}));const ce=et.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),zs=e=>{switch(typeof e){case"undefined":return ce.undefined;case"string":return ce.string;case"number":return isNaN(e)?ce.nan:ce.number;case"boolean":return ce.boolean;case"function":return ce.function;case"bigint":return ce.bigint;case"object":return Array.isArray(e)?ce.array:e===null?ce.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ce.promise:typeof Map<"u"&&e instanceof Map?ce.map:typeof Set<"u"&&e instanceof Set?ce.set:typeof Date<"u"&&e instanceof Date?ce.date:ce.object;default:return ce.unknown}},re=et.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"]);class ru 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,et.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()}}ru.create=e=>new ru(e);const Ty=(e,t)=>{let n;switch(e.code){case re.invalid_type:e.received===ce.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case re.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,et.jsonStringifyReplacer)}`;break;case re.unrecognized_keys:n=`Unrecognized key(s) in object: ${et.joinValues(e.keys,", ")}`;break;case re.invalid_union:n="Invalid input";break;case re.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${et.joinValues(e.options)}`;break;case re.invalid_enum_value:n=`Invalid enum value. Expected ${et.joinValues(e.options)}, received '${e.received}'`;break;case re.invalid_arguments:n="Invalid function arguments";break;case re.invalid_return_type:n="Invalid function return type";break;case re.invalid_date:n="Invalid date";break;case re.invalid_string:typeof e.validation=="object"?"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}"`:et.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case re.too_small:e.type==="array"?n=`Array must contain ${e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be greater than ${e.inclusive?"or equal to ":""}${e.minimum}`:e.type==="date"?n=`Date must be greater than ${e.inclusive?"or equal to ":""}${new Date(e.minimum)}`:n="Invalid input";break;case re.too_big:e.type==="array"?n=`Array must contain ${e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be less than ${e.inclusive?"or equal to ":""}${e.maximum}`:e.type==="date"?n=`Date must be smaller than ${e.inclusive?"or equal to ":""}${new Date(e.maximum)}`:n="Invalid input";break;case re.custom:n="Invalid input";break;case re.invalid_intersection_types:n="Intersection results could not be merged";break;case re.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;default:n=t.defaultError,et.assertNever(e)}return{message:n}};let ESe=Ty;function lR(){return ESe}const fR=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}};function he(e,t){const n=fR({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,lR(),Ty].filter(r=>!!r)});e.common.issues.push(n)}class ir{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 Me;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 ir.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 Me;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 Me=Object.freeze({status:"aborted"}),or=e=>({status:"valid",value:e}),MV=e=>e.status==="aborted",xV=e=>e.status==="dirty",dR=e=>e.status==="valid",kV=e=>typeof Promise!==void 0&&e instanceof Promise;var Je;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Je||(Je={}));class ro{constructor(t,n,r,i){this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._path.concat(this._key)}}const AV=(e,t)=>{if(dR(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,error:new ru(e.common.issues)}};function Ne(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 He{constructor(t){this.spa=this.safeParseAsync,this.superRefine=this._refinement,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.default=this.default.bind(this),this.describe=this.describe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return zs(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:zs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ir,ctx:{common:t.parent.common,data:t.data,parsedType:zs(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(kV(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:zs(t)},o=this._parseSync({data:t,path:i.path,parent:i});return AV(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:zs(t)},i=this._parse({data:t,path:[],parent:r}),o=await(kV(i)?i:Promise.resolve(i));return AV(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:re.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 ou({schema:this,typeName:Oe.ZodEffects,effect:{type:"refinement",refinement:t}})}optional(){return da.create(this)}nullable(){return rf.create(this)}nullish(){return this.optional().nullable()}array(){return la.create(this)}promise(){return sh.create(this)}or(t){return Iy.create([this,t])}and(t){return Oy.create(this,t)}transform(t){return new ou({schema:this,typeName:Oe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new WV({innerType:this,defaultValue:n,typeName:Oe.ZodDefault})}brand(){return new ASe({typeName:Oe.ZodBranded,type:this,...Ne(void 0)})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const CSe=/^c[^\s-]{8,}$/i,MSe=/^([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,xSe=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;class Ks extends He{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(i=>t.test(i),{validation:n,code:re.invalid_string,...Je.errToObj(r)}),this.nonempty=t=>this.min(1,Je.errToObj(t)),this.trim=()=>new Ks({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(t){if(this._getType(t)!==ce.string){const o=this._getOrReturnCtx(t);return he(o,{code:re.invalid_type,expected:ce.string,received:o.parsedType}),Me}const r=new ir;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),he(i,{code:re.too_small,minimum:o.value,type:"string",inclusive:!0,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),he(i,{code:re.too_big,maximum:o.value,type:"string",inclusive:!0,message:o.message}),r.dirty());else if(o.kind==="email")xSe.test(t.data)||(i=this._getOrReturnCtx(t,i),he(i,{validation:"email",code:re.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")MSe.test(t.data)||(i=this._getOrReturnCtx(t,i),he(i,{validation:"uuid",code:re.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")CSe.test(t.data)||(i=this._getOrReturnCtx(t,i),he(i,{validation:"cuid",code:re.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),he(i,{validation:"url",code:re.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),he(i,{validation:"regex",code:re.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),he(i,{code:re.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),he(i,{code:re.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):et.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new Ks({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Je.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Je.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Je.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Je.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Je.errToObj(n)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Je.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Je.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Je.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Je.errToObj(n)})}length(t,n){return this.min(t,n).max(t,n)}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}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}}Ks.create=e=>new Ks({checks:[],typeName:Oe.ZodString,...Ne(e)});function kSe(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 Ql extends He{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._getType(t)!==ce.number){const o=this._getOrReturnCtx(t);return he(o,{code:re.invalid_type,expected:ce.number,received:o.parsedType}),Me}let r;const i=new ir;for(const o of this._def.checks)o.kind==="int"?et.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),he(r,{code:re.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),he(r,{code:re.too_small,minimum:o.value,type:"number",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),he(r,{code:re.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?kSe(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),he(r,{code:re.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):et.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Je.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Je.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Je.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Je.toString(n))}setLimit(t,n,r,i){return new Ql({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Je.toString(i)}]})}_addCheck(t){return new Ql({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Je.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Je.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Je.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Je.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Je.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Je.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}get isInt(){return!!this._def.checks.find(t=>t.kind==="int")}}Ql.create=e=>new Ql({checks:[],typeName:Oe.ZodNumber,...Ne(e)});class pR extends He{_parse(t){if(this._getType(t)!==ce.bigint){const r=this._getOrReturnCtx(t);return he(r,{code:re.invalid_type,expected:ce.bigint,received:r.parsedType}),Me}return or(t.data)}}pR.create=e=>new pR({typeName:Oe.ZodBigInt,...Ne(e)});class hR extends He{_parse(t){if(this._getType(t)!==ce.boolean){const r=this._getOrReturnCtx(t);return he(r,{code:re.invalid_type,expected:ce.boolean,received:r.parsedType}),Me}return or(t.data)}}hR.create=e=>new hR({typeName:Oe.ZodBoolean,...Ne(e)});class ah extends He{_parse(t){if(this._getType(t)!==ce.date){const o=this._getOrReturnCtx(t);return he(o,{code:re.invalid_type,expected:ce.date,received:o.parsedType}),Me}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return he(o,{code:re.invalid_date}),Me}const r=new ir;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),he(i,{code:re.too_small,message:o.message,inclusive:!0,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),he(i,{code:re.too_big,message:o.message,inclusive:!0,maximum:o.value,type:"date"}),r.dirty()):et.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ah({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Je.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Je.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}}ah.create=e=>new ah({checks:[],typeName:Oe.ZodDate,...Ne(e)});class mR extends He{_parse(t){if(this._getType(t)!==ce.undefined){const r=this._getOrReturnCtx(t);return he(r,{code:re.invalid_type,expected:ce.undefined,received:r.parsedType}),Me}return or(t.data)}}mR.create=e=>new mR({typeName:Oe.ZodUndefined,...Ne(e)});class vR extends He{_parse(t){if(this._getType(t)!==ce.null){const r=this._getOrReturnCtx(t);return he(r,{code:re.invalid_type,expected:ce.null,received:r.parsedType}),Me}return or(t.data)}}vR.create=e=>new vR({typeName:Oe.ZodNull,...Ne(e)});class gR extends He{constructor(){super(...arguments),this._any=!0}_parse(t){return or(t.data)}}gR.create=e=>new gR({typeName:Oe.ZodAny,...Ne(e)});class ef extends He{constructor(){super(...arguments),this._unknown=!0}_parse(t){return or(t.data)}}ef.create=e=>new ef({typeName:Oe.ZodUnknown,...Ne(e)});class iu extends He{_parse(t){const n=this._getOrReturnCtx(t);return he(n,{code:re.invalid_type,expected:ce.never,received:n.parsedType}),Me}}iu.create=e=>new iu({typeName:Oe.ZodNever,...Ne(e)});class yR extends He{_parse(t){if(this._getType(t)!==ce.undefined){const r=this._getOrReturnCtx(t);return he(r,{code:re.invalid_type,expected:ce.void,received:r.parsedType}),Me}return or(t.data)}}yR.create=e=>new yR({typeName:Oe.ZodVoid,...Ne(e)});class la extends He{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==ce.array)return he(n,{code:re.invalid_type,expected:ce.array,received:n.parsedType}),Me;if(i.minLength!==null&&n.data.length<i.minLength.value&&(he(n,{code:re.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(he(n,{code:re.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all(n.data.map((a,u)=>i.type._parseAsync(new ro(n,a,n.path,u)))).then(a=>ir.mergeArray(r,a));const o=n.data.map((a,u)=>i.type._parseSync(new ro(n,a,n.path,u)));return ir.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new la({...this._def,minLength:{value:t,message:Je.toString(n)}})}max(t,n){return new la({...this._def,maxLength:{value:t,message:Je.toString(n)}})}length(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}la.create=(e,t)=>new la({type:e,minLength:null,maxLength:null,typeName:Oe.ZodArray,...Ne(t)});var bR;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(bR||(bR={}));const NV=e=>t=>new St({...e,shape:()=>({...e.shape(),...t})});function tf(e){if(e instanceof St){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=da.create(tf(r))}return new St({...e._def,shape:()=>t})}else return e instanceof la?la.create(tf(e.element)):e instanceof da?da.create(tf(e.unwrap())):e instanceof rf?rf.create(tf(e.unwrap())):e instanceof fa?fa.create(e.items.map(t=>tf(t))):e}class St extends He{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=NV(this._def),this.extend=NV(this._def)}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=et.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==ce.object){const c=this._getOrReturnCtx(t);return he(c,{code:re.invalid_type,expected:ce.object,received:c.parsedType}),Me}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof iu&&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 ro(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof iu){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&&(he(i,{code:re.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 ro(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=>ir.mergeObjectSync(r,c)):ir.mergeObjectSync(r,s)}get shape(){return this._def.shape()}strict(t){return Je.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=Je.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"})}setKey(t,n){return this.augment({[t]:n})}merge(t){return new St({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>bR.mergeShapes(this._def.shape(),t._def.shape()),typeName:Oe.ZodObject})}catchall(t){return new St({...this._def,catchall:t})}pick(t){const n={};return et.objectKeys(t).map(r=>{this.shape[r]&&(n[r]=this.shape[r])}),new St({...this._def,shape:()=>n})}omit(t){const n={};return et.objectKeys(this.shape).map(r=>{et.objectKeys(t).indexOf(r)===-1&&(n[r]=this.shape[r])}),new St({...this._def,shape:()=>n})}deepPartial(){return tf(this)}partial(t){const n={};if(t)return et.objectKeys(this.shape).map(r=>{et.objectKeys(t).indexOf(r)===-1?n[r]=this.shape[r]:n[r]=this.shape[r].optional()}),new St({...this._def,shape:()=>n});for(const r in this.shape){const i=this.shape[r];n[r]=i.optional()}return new St({...this._def,shape:()=>n})}required(){const t={};for(const n in this.shape){let i=this.shape[n];for(;i instanceof da;)i=i._def.innerType;t[n]=i}return new St({...this._def,shape:()=>t})}keyof(){return FV(et.objectKeys(this.shape))}}St.create=(e,t)=>new St({shape:()=>e,unknownKeys:"strip",catchall:iu.create(),typeName:Oe.ZodObject,...Ne(t)}),St.strictCreate=(e,t)=>new St({shape:()=>e,unknownKeys:"strict",catchall:iu.create(),typeName:Oe.ZodObject,...Ne(t)}),St.lazycreate=(e,t)=>new St({shape:e,unknownKeys:"strip",catchall:iu.create(),typeName:Oe.ZodObject,...Ne(t)});class Iy extends He{_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 ru(u.ctx.common.issues));return he(n,{code:re.invalid_union,unionErrors:a}),Me}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 ru(s));return he(n,{code:re.invalid_union,unionErrors:u}),Me}}get options(){return this._def.options}}Iy.create=(e,t)=>new Iy({options:e,typeName:Oe.ZodUnion,...Ne(t)});class _R extends He{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ce.object)return he(n,{code:re.invalid_type,expected:ce.object,received:n.parsedType}),Me;const r=this.discriminator,i=n.data[r],o=this.options.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}):(he(n,{code:re.invalid_union_discriminator,options:this.validDiscriminatorValues,path:[r]}),Me)}get discriminator(){return this._def.discriminator}get validDiscriminatorValues(){return Array.from(this.options.keys())}get options(){return this._def.options}static create(t,n,r){const i=new Map;try{n.forEach(o=>{const a=o.shape[t].value;i.set(a,o)})}catch{throw new Error("The discriminator value could not be extracted from all the provided schemas")}if(i.size!==n.length)throw new Error("Some of the discriminator values are not unique");return new _R({typeName:Oe.ZodDiscriminatedUnion,discriminator:t,options:i,...Ne(r)})}}function SR(e,t){const n=zs(e),r=zs(t);if(e===t)return{valid:!0,data:e};if(n===ce.object&&r===ce.object){const i=et.objectKeys(t),o=et.objectKeys(e).filter(u=>i.indexOf(u)!==-1),a={...e,...t};for(const u of o){const s=SR(e[u],t[u]);if(!s.valid)return{valid:!1};a[u]=s.data}return{valid:!0,data:a}}else if(n===ce.array&&r===ce.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=SR(a,u);if(!s.valid)return{valid:!1};i.push(s.data)}return{valid:!0,data:i}}else return n===ce.date&&r===ce.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Oy extends He{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(MV(o)||MV(a))return Me;const u=SR(o.value,a.value);return u.valid?((xV(o)||xV(a))&&n.dirty(),{status:n.value,value:u.data}):(he(r,{code:re.invalid_intersection_types}),Me)};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}))}}Oy.create=(e,t,n)=>new Oy({left:e,right:t,typeName:Oe.ZodIntersection,...Ne(n)});class fa extends He{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ce.array)return he(r,{code:re.invalid_type,expected:ce.array,received:r.parsedType}),Me;if(r.data.length<this._def.items.length)return he(r,{code:re.too_small,minimum:this._def.items.length,inclusive:!0,type:"array"}),Me;!this._def.rest&&r.data.length>this._def.items.length&&(he(r,{code:re.too_big,maximum:this._def.items.length,inclusive:!0,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 ro(r,a,r.path,u)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>ir.mergeArray(n,a)):ir.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new fa({...this._def,rest:t})}}fa.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fa({items:e,typeName:Oe.ZodTuple,rest:null,...Ne(t)})};class wy extends He{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!==ce.object)return he(r,{code:re.invalid_type,expected:ce.object,received:r.parsedType}),Me;const i=[],o=this._def.keyType,a=this._def.valueType;for(const u in r.data)i.push({key:o._parse(new ro(r,u,r.path,u)),value:a._parse(new ro(r,r.data[u],r.path,u))});return r.common.async?ir.mergeObjectAsync(n,i):ir.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof He?new wy({keyType:t,valueType:n,typeName:Oe.ZodRecord,...Ne(r)}):new wy({keyType:Ks.create(),valueType:t,typeName:Oe.ZodRecord,...Ne(n)})}}class $R extends He{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ce.map)return he(r,{code:re.invalid_type,expected:ce.map,received:r.parsedType}),Me;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([u,s],c)=>({key:i._parse(new ro(r,u,r.path,[c,"key"])),value:o._parse(new ro(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 Me;(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 Me;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),u.set(c.value,l.value)}return{status:n.value,value:u}}}}$R.create=(e,t,n)=>new $R({valueType:t,keyType:e,typeName:Oe.ZodMap,...Ne(n)});class nf extends He{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ce.set)return he(r,{code:re.invalid_type,expected:ce.set,received:r.parsedType}),Me;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(he(r,{code:re.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(he(r,{code:re.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,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 Me;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 ro(r,s,r.path,c)));return r.common.async?Promise.all(u).then(s=>a(s)):a(u)}min(t,n){return new nf({...this._def,minSize:{value:t,message:Je.toString(n)}})}max(t,n){return new nf({...this._def,maxSize:{value:t,message:Je.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}nf.create=(e,t)=>new nf({valueType:e,minSize:null,maxSize:null,typeName:Oe.ZodSet,...Ne(t)});class uh extends He{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ce.function)return he(n,{code:re.invalid_type,expected:ce.function,received:n.parsedType}),Me;function r(u,s){return fR({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,lR(),Ty].filter(c=>!!c),issueData:{code:re.invalid_arguments,argumentsError:s}})}function i(u,s){return fR({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,lR(),Ty].filter(c=>!!c),issueData:{code:re.invalid_return_type,returnTypeError:s}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof sh?or(async(...u)=>{const s=new ru([]),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})}):or((...u)=>{const s=this._def.args.safeParse(u,o);if(!s.success)throw new ru([r(u,s.error)]);const c=a(...s.data),l=this._def.returns.safeParse(c,o);if(!l.success)throw new ru([i(c,l.error)]);return l.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new uh({...this._def,args:fa.create(t).rest(ef.create())})}returns(t){return new uh({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new uh({args:t||fa.create([]).rest(ef.create()),returns:n||ef.create(),typeName:Oe.ZodFunction,...Ne(r)})}}class TR extends He{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})}}TR.create=(e,t)=>new TR({getter:e,typeName:Oe.ZodLazy,...Ne(t)});class IR extends He{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return he(n,{code:re.invalid_literal,expected:this._def.value}),Me}return{status:"valid",value:t.data}}get value(){return this._def.value}}IR.create=(e,t)=>new IR({value:e,typeName:Oe.ZodLiteral,...Ne(t)});function FV(e,t){return new OR({values:e,typeName:Oe.ZodEnum,...Ne(t)})}class OR extends He{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return he(n,{expected:et.joinValues(r),received:n.parsedType,code:re.invalid_type}),Me}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return he(n,{received:n.data,code:re.invalid_enum_value,options:r}),Me}return or(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}}OR.create=FV;class wR extends He{_parse(t){const n=et.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ce.string&&r.parsedType!==ce.number){const i=et.objectValues(n);return he(r,{expected:et.joinValues(i),received:r.parsedType,code:re.invalid_type}),Me}if(n.indexOf(t.data)===-1){const i=et.objectValues(n);return he(r,{received:r.data,code:re.invalid_enum_value,options:i}),Me}return or(t.data)}get enum(){return this._def.values}}wR.create=(e,t)=>new wR({values:e,typeName:Oe.ZodNativeEnum,...Ne(t)});class sh extends He{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ce.promise&&n.common.async===!1)return he(n,{code:re.invalid_type,expected:ce.promise,received:n.parsedType}),Me;const r=n.parsedType===ce.promise?n.data:Promise.resolve(n.data);return or(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}sh.create=(e,t)=>new sh({type:e,typeName:Oe.ZodPromise,...Ne(t)});class ou extends He{innerType(){return 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=>{he(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"?Me:(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"?Me:(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(!dR(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=>dR(a)?Promise.resolve(i.transform(a.value,o)).then(u=>({status:n.value,value:u})):a);et.assertNever(i)}}ou.create=(e,t,n)=>new ou({schema:e,typeName:Oe.ZodEffects,effect:t,...Ne(n)}),ou.createWithPreprocess=(e,t,n)=>new ou({schema:t,effect:{type:"preprocess",transform:e},typeName:Oe.ZodEffects,...Ne(n)});class da extends He{_parse(t){return this._getType(t)===ce.undefined?or(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}da.create=(e,t)=>new da({innerType:e,typeName:Oe.ZodOptional,...Ne(t)});class rf extends He{_parse(t){return this._getType(t)===ce.null?or(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}rf.create=(e,t)=>new rf({innerType:e,typeName:Oe.ZodNullable,...Ne(t)});class WV extends He{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===ce.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}WV.create=(e,t)=>new da({innerType:e,typeName:Oe.ZodOptional,...Ne(t)});class RR extends He{_parse(t){if(this._getType(t)!==ce.nan){const r=this._getOrReturnCtx(t);return he(r,{code:re.invalid_type,expected:ce.nan,received:r.parsedType}),Me}return{status:"valid",value:t.data}}}RR.create=e=>new RR({typeName:Oe.ZodNaN,...Ne(e)});class ASe extends He{_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}}St.lazycreate;var Oe;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",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.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded"})(Oe||(Oe={}));const ER=Ks.create,PV=Ql.create;RR.create,pR.create,hR.create,ah.create,mR.create,vR.create,gR.create;const NSe=ef.create;iu.create,yR.create;const FSe=la.create,CR=St.create;St.strictCreate,Iy.create,_R.create,Oy.create,fa.create,wy.create,$R.create,nf.create,uh.create,TR.create,IR.create,OR.create,wR.create,sh.create,ou.create,da.create,rf.create,ou.createWithPreprocess;async function WSe(e,t){const{okType:n,errorType:r=PSe,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=c.get("Content-Type")==="application/json"?JSON.stringify(a):a;let f=!1;try{const d=new AbortController,p=LSe([d.signal,i].filter(ho));setTimeout(()=>{f=!0,d.abort()},u);const h=await fetch(e,{...s,body:l,headers:c,signal:p}),{status:v}=h,m=await h.json();if(h.ok){const _=n.safeParse(m);return _.success?{ok:!0,body:_.data}:{ok:!1,error:"validation",status:v,cause:_.error}}else{const _=r.safeParse(m);return _.success?{ok:!1,error:"http",status:v,body:_.data}:{ok:!1,error:"validation",status:v,cause:_.error}}}catch(d){return DSe(d)?{ok:!1,error:f?"timeout":"abort"}:{ok:!1,error:"unknown",cause:d}}}const PSe=NSe();function LSe(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 DSe(e){return e instanceof DOMException&&e.name==="AbortError"}function jSe(e,t){qSe(e,t);const n=au.get(e,t);if(!n){const i=e(...t);throw au.set(e,t,{state:"fetching",promise:i}),LV(e,t,i).catch(o=>console.error(o)),i}if(n.state==="fetching")throw n.promise;const{result:r}=n;if(r.ok)return r.body;throw r}function qSe(e,t){const n=wSe();K.useEffect(()=>{const r=au.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=au.get(e,t);if(!o||o.state!=="fetched")return;const a=e(...t);au.set(e,t,{state:"revalidating",promise:a,result:o.result}),LV(e,t,a).then(n).catch(u=>console.error(u))}return document.addEventListener("visibilitychange",i),()=>document.removeEventListener("visibilitychange",i)})}function LV(e,t,n){return n.then(r=>au.set(e,t,{state:"fetched",result:r})).catch(r=>au.set(e,t,{state:"fetched",result:{ok:!1,error:"unknown",cause:r}}))}const au=BSe(),USe=au;function BSe(){const e=new Map,t=new Map,n={cacheCapacity:100,revalidationStrategy:{type:"swr",onFocus:!0}};function r(o){return o.join(`
|
|
32
|
+
`)}function i(o){return e.get(o)??n}return{get(o,a){const u=r(a),s=t.get(o);if(!s||!s.has(u))return;const c=s.get(u);return s.delete(u),c!==void 0&&s.set(u,c),c},set(o,a,u){let s=t.get(o);s||(s=new Map,t.set(o,s));const c=i(o),l=r(a);s.size===c.cacheCapacity&&!s.has(l)&&s.delete(s.keys().next().value),s.set(l,u)},getFetcherConfig:i,registerFetcherConfig(o,a){e.set(o,a)},forgetAllErrors(){t.forEach(o=>o.forEach((a,u)=>{a.state==="fetched"&&!a.result.ok&&o.delete(u)}))}}}const zSe=CR({id:ER(),width:PV(),height:PV(),urls:CR({full:ER(),small:ER().transform(bSe)})}),KSe=CR({results:FSe(zSe)}).transform(e=>e.results);function DV(e,t){const n=new URLSearchParams({page:"1",per_page:"30",query:t});return WSe(`${e}/search/photos?${n.toString()}`,{okType:KSe})}USe.registerFetcherConfig(DV,{cacheCapacity:5,revalidationStrategy:{type:"never"}});function VSe(e,t){return jSe(DV,[e,t])}const jV=e=>{const{trigger:t,onMediaSelected:n}=e,[r,i]=K.useState(!1),[o,a]=K.useState(""),[u,s]=K.useState(o),[c,l]=K.useTransition();return RSe(o,200,f=>l(()=>s(f))),E.jsxs(N.Dialog,{trigger:t,open:r,onOpenChange:i,children:[E.jsx(N.DialogHeader,{icon:"folder",title:"Add an image from Unsplash.com"}),E.jsxs(N.DialogContent,{children:[E.jsx("div",{style:{paddingInline:N.tokens.space["24px"]},children:E.jsx(N.SearchInput,{value:o,placeholder:"Search on Unsplash.com",onValueChange:a})}),E.jsx(JSe,{children:E.jsx(N.ErrorBoundary,{errorImageSrc:N.dialogErrorImage,title:"Request failed",description:"An error occurred while searching for your image.",style:{marginTop:"auto",marginBottom:"auto"},children:E.jsx(K.Suspense,{fallback:E.jsx(N.MasonrySkeleton,{}),children:E.jsx(HSe,{term:u,isUpdating:c,onMediaSelected:f=>{i(!1),n==null||n(f)}})})})})]})]})},HSe=e=>{const{term:t,isUpdating:n,onMediaSelected:r}=e,i=mbe(),o=VSe(i.unsplash.url,t||"fruit"),a=GSe(n);return o.length?E.jsx(N.Masonry,{items:o,getItemInfo:YSe,style:a,children:u=>E.jsx(N.MasonryMedia,{url:u.urls.small,onClick:()=>r({id:u.id,url:u.urls.full,width:u.width,height:u.height})})}):E.jsxs(N.BlankSlate,{style:{marginTop:"auto",marginBottom:"auto",...a},children:[E.jsx(N.BlankSlateImage,{children:E.jsx("img",{src:N.dialogErrorImage,alt:"No results"})}),E.jsx(N.BlankSlateTitle,{size:"big",children:"Oh no ..."}),E.jsx(N.BlankSlateDescription,{children:"The search returned no result."})]})};function GSe(e){return{opacity:e?.4:1,transitionProperty:e?"opacity":"none",transitionDuration:N.tokens.transitionDuration.standard,transitionTimingFunction:N.tokens.transitionTimingFunction.easeInOut}}const JSe=({children:e})=>E.jsx(N.ScrollArea,{style:{height:"100%",paddingInline:N.tokens.space["24px"],paddingTop:N.tokens.space["4px"]},children:e});function YSe(e){return{key:e.id,aspectRatio:e.width/e.height}}function ZSe(e,t){const n={};for(const r in e)n[r]=t(e[r],r);return n}function XSe(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,Ry(r,v)]));return{__TYPE__:"ImageContent",...Ry(r,(s=t.config)==null?void 0:s.constraint),thumbnails:h}}if(e===oh){const p=Ry(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=Ry(r,i);return a.url===(o==null?void 0:o.url)?n:{...n,thumbnails:ZSe(n.thumbnails??{},(p,h)=>h===e?a:p)}}function Ry(e,t){const{width:n,height:r,rect:i}=QSe(e,t),o=Boolean((t==null?void 0:t.width)||(t==null?void 0:t.height));return{url:wV(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 QSe(e,t){const[n,r]=OV(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 e$e=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{const[o,a]=K.useState(0),[u,s]=K.useTransition(),c=t$e(t),l=c[o],f=e?gSe(t,e):void 0,d=f==null?void 0:f[o],p=ca(t),h=l?IV(l,e,d).filter(ho):[],v=e&&!i?"visible":"hidden";function m(b){if(!l)return;const $=XSe(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:IV(b,e,T)}}),S=({option:b,croppedImages:$})=>{if(a(b),!e)return;const T=Object.entries($).reduce((C,[R,q])=>_Se({field:t,content:C,thumbnail:R,croppedImage:q}),e);T!==e&&s(()=>r(T))};return E.jsxs(N.Card,{color:"grey2",variant:"dashed",children:[E.jsxs(N.CardHeader,{children:[E.jsxs(N.CardHeaderTitle,{children:[p,h.length&&E.jsx(N.Text,{color:"grey11",component:"span",children:` • ${h.join(" • ")}`})]}),E.jsxs(N.CardHeaderActions,{style:{visibility:v},children:[E.jsx(ISe,{trigger:E.jsx(N.Button,{startIcon:E.jsx(N.Icon,{name:"crop"}),children:"Crop & Resize"}),initialImages:g,initialOption:o,onClose:S}),E.jsx(jV,{trigger:E.jsx(N.Button,{startIcon:E.jsx(N.Icon,{name:"imageSearch"}),children:"Replace"}),onMediaSelected:m}),E.jsx(N.Button,{onClick:()=>{a(0),r(void 0)},startIcon:E.jsx(N.Icon,{name:"delete"}),children:"Clear"})]})]}),E.jsx(K.Suspense,{fallback:E.jsx("div",{style:{height:466}}),children:l&&e&&f?E.jsx(n$e,{allContentViews:f,content:e,contentView:d,id:n,onContentChange:r,onPageChange:_,page:o,readOnly:i,thumbnailName:l.name,isUpdating:u}):E.jsx(r$e,{onMediaSelected:m,readOnly:i,isUpdating:u})})]})};function t$e(e){return K.useMemo(()=>vSe(e),[e])}const n$e=e=>{const{allContentViews:t,content:n,contentView:r,id:i,onContentChange:o,onPageChange:a,page:u,readOnly:s,thumbnailName:c,isUpdating:l}=e;return E.jsxs(N.CardContent,{children:[E.jsx(N.Carousel,{getItemSource:i$e,items:t,onPageChange:a,page:u,style:{height:400},children:f=>(f==null?void 0:f.url)&&E.jsx(N.CarouselItem,{src:RV(f.url),alt:f.alt??void 0,isUpdating:l},`${c}_${f.url}`)}),E.jsxs(N.Field,{labelPosition:"side",children:[E.jsx(N.FieldLabel,{htmlFor:i,children:"Alt text"}),E.jsx(N.FieldControl,{children:E.jsx(N.TextInput,{id:i,onValueChange:f=>{r&&o(ySe(c,n,r,f))},placeholder:"Short description for the visually impaired",readOnly:s||!r,value:(r==null?void 0:r.alt)??""})})]})]})},r$e=({onMediaSelected:e,readOnly:t,isUpdating:n})=>E.jsx(N.CardContent,{children:E.jsx(N.Card,{color:"grey3",variant:"outlined",children:E.jsx(N.CardContent,{style:{paddingBlock:parseFloat(N.tokens.space["48px"])},children:E.jsxs(N.BlankSlate,{children:[E.jsx(N.BlankSlateIcon,{name:"cloudUpload"}),E.jsx(N.BlankSlateTitle,{children:n?"Preparing your image...":"You haven't selected an image"}),!t&&E.jsx(N.BlankSlateActions,{children:E.jsx(jV,{trigger:E.jsx(N.Button,{disabled:n,children:"Select image"}),onMediaSelected:e})})]})})})});function i$e(e){return e!=null&&e.url?RV(e.url):void 0}const o$e=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>E.jsxs(N.Field,{children:[E.jsx(N.FieldIcon,{children:E.jsx(N.Icon,{name:"notes"})}),E.jsx(N.FieldLabel,{htmlFor:n,children:ca(t)}),E.jsx(N.FieldControl,{children:E.jsx(N.TextArea,{id:n,onChange:o=>{r(a$e(o.target.value))},placeholder:Xl(t),readOnly:i,value:(e==null?void 0:e.value)??""})})]});function a$e(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Text",value:e}}function u$e(e){try{return new URL(e)}catch{return}}function s$e(e){return e.charAt(0).toUpperCase()+e.slice(1)}const c$e=e=>{const{hasLink:t,onUnlink:n}=e;return E.jsxs(E.Fragment,{children:[E.jsx(N.Select,{value:"web",variant:"secondary",size:"small",icon:"public",disabled:!0,children:E.jsx(N.SelectItem,{value:"web",icon:"public",children:"Link to web page"})}),E.jsx(N.Button,{startIcon:E.jsx(N.Icon,{name:"linkOff"}),variant:"secondary",size:"small",disabled:!t,onClick:n})]})},l$e=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var h,v;const[o,a]=K.useState(!1),[u,s]=K.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?u$e(l):void 0,d=(o||u)&&Boolean(f),p=m=>r(f$e(c,m));return E.jsx(N.LinkDescriptionPopover,{url:f,title:f?d$e(f):"",open:d,align:"start",sideOffset:-3,openDelay:100,closeDelay:200,onMouseOverChange:s,anchor:E.jsxs(N.Field,{onMouseOverChange:a,children:[E.jsx(N.FieldIcon,{children:E.jsx(N.Icon,{name:"link"})}),E.jsx(N.FieldLabel,{htmlFor:n,children:ca(t)}),E.jsx(N.FieldControl,{children:E.jsx(N.TextInput,{id:n,onValueChange:p,placeholder:Xl(t),readOnly:i,value:l??"",variant:f?"link":"normal",onFocus:()=>a(!0),onBlur:()=>a(!1),endAdornment:E.jsx(c$e,{hasLink:Boolean(l),onUnlink:()=>p("")})})})]})})};function f$e(e,t){if(t)return e?{__TYPE__:"LinkContent",value:{...e,url:t}}:{__TYPE__:"LinkContent",value:{__TYPE__:"ExternalLink",url:t}}}function d$e(e){return e.host.split(".").slice(0,-1).filter(t=>t!=="www").map(s$e).join("")}const p$e=({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 E.jsxs(N.Field,{children:[E.jsx(N.FieldIcon,{children:E.jsx(N.Icon,{name:"pin"})}),E.jsx(N.FieldLabel,{htmlFor:n,children:ca(t)}),E.jsx(N.FieldControl,{children:E.jsx(N.NumberInput,{id:n,value:a,min:(u=t.config)==null?void 0:u.min,max:(s=t.config)==null?void 0:s.max,placeholder:Xl(t),readOnly:i,onValueChange:c=>r(h$e(c))})})]})};function h$e(e){return e===void 0?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(e)}}function yn(e){this.content=e}yn.prototype={constructor:yn,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 yn(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 yn(n)},addToStart:function(e,t){return new yn([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new yn(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 yn(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=yn.from(e),e.size?new yn(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=yn.from(e),e.size?new yn(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=yn.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}},yn.from=function(e){if(e instanceof yn)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new yn(t)};function qV(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=qV(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function UV(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=UV(a.content,u.content,n-1,r-1);if(c)return c}n-=s,r-=s}}class B{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 B(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 B(r,i)}cutByIndex(t,n){return t==n?B.empty:t==0&&n==this.content.length?this:new B(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 B(i,o)}addToStart(t){return new B([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new B(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 qV(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return UV(this,t,n,r)}findIndex(t,n=-1){if(t==0)return Ey(0,t);if(t==this.size)return Ey(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?Ey(r+1,a):Ey(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 B.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new B(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return B.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 B(n||t,r)}static from(t){if(!t)return B.empty;if(t instanceof B)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new B([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}B.empty=new B([],0);const MR={index:0,offset:0};function Ey(e,t){return MR.index=e,MR.offset=t,MR}function Cy(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(!Cy(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Cy(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let rt=class OC{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&&Cy(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 OC.none;if(t instanceof OC)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};rt.none=[];class My extends Error{}class ae{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=zV(this.content,t+this.openStart,n);return r&&new ae(r,this.openStart,this.openEnd)}removeBetween(t,n){return new ae(BV(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 ae.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 ae(B.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 ae(t,r,i)}}ae.empty=new ae(B.empty,0,0);function BV(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(BV(o.content,t-i-1,n-i-1)))}function zV(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=zV(a.content,t-o-1,n);return u&&e.replaceChild(i,a.copy(u))}function m$e(e,t,n){if(n.openStart>e.depth)throw new My("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new My("Inconsistent open depths");return KV(e,t,n,0)}function KV(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=KV(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 Hs(a,u.cut(0,e.parentOffset).append(n.content).append(u.cut(t.parentOffset)))}else{let{start:a,end:u}=v$e(n,e);return Hs(o,HV(e,a,u,t,r))}else return Hs(o,xy(e,t,r))}function VV(e,t){if(!t.type.compatibleContent(e.type))throw new My("Cannot join "+t.type.name+" onto "+e.type.name)}function xR(e,t,n){let r=e.node(n);return VV(r,t.node(n)),r}function Vs(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 ch(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&&(Vs(e.nodeAfter,r),o++));for(let u=o;u<a;u++)Vs(i.child(u),r);t&&t.depth==n&&t.textOffset&&Vs(t.nodeBefore,r)}function Hs(e,t){return e.type.checkContent(t),e.copy(t)}function HV(e,t,n,r,i){let o=e.depth>i&&xR(e,t,i+1),a=r.depth>i&&xR(n,r,i+1),u=[];return ch(null,e,i,u),o&&a&&t.index(i)==n.index(i)?(VV(o,a),Vs(Hs(o,HV(e,t,n,r,i+1)),u)):(o&&Vs(Hs(o,xy(e,t,i+1)),u),ch(t,n,i,u),a&&Vs(Hs(a,xy(n,r,i+1)),u)),ch(r,null,i,u),new B(u)}function xy(e,t,n){let r=[];if(ch(null,e,n,r),e.depth>n){let i=xR(e,t,n+1);Vs(Hs(i,xy(e,t,n+1)),r)}return ch(t,null,n,r),new B(r)}function v$e(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(B.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class lh{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 ky(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 lh(n,r,o)}static resolveCached(t,n){for(let i=0;i<kR.length;i++){let o=kR[i];if(o.pos==n&&o.doc==t)return o}let r=kR[AR]=lh.resolve(t,n);return AR=(AR+1)%g$e,r}}let kR=[],AR=0,g$e=12;class ky{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 y$e=Object.create(null);let Gs=class wC{constructor(t,n,r,i=rt.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||B.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&&Cy(this.attrs,n||t.defaultAttrs||y$e)&&rt.sameSet(this.marks,r||rt.none)}copy(t=null){return t==this.content?this:new wC(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new wC(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 ae.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 ae(c,i.depth-a,o.depth-a)}replace(t,n,r){return m$e(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 lh.resolveCached(this,t)}resolveNoCache(t){return lh.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()+")"),GV(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=B.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=B.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,i,r)}};Gs.prototype.text=void 0;class Ay extends Gs{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):GV(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 Ay(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Ay(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 GV(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Js{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new b$e(t,n);if(r.next==null)return Js.empty;let i=JV(r);r.next&&r.err("Unexpected trailing text");let o=w$e(O$e(i));return R$e(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 B.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(`
|
|
33
|
+
`)}}Js.empty=new Js(!0);class b$e{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 JV(e){let t=[];do t.push(_$e(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function _$e(e){let t=[];do t.push(S$e(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function S$e(e){let t=I$e(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=$$e(e,t);else break;return t}function YV(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function $$e(e,t){let n=YV(e),r=n;return e.eat(",")&&(e.next!="}"?r=YV(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function T$e(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 I$e(e){if(e.eat("(")){let t=JV(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=T$e(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 O$e(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 ZV(e,t){return t-e}function XV(e,t){let n=[];return r(t),n.sort(ZV);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 w$e(e){let t=Object.create(null);return n(XV(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]);XV(e,s).forEach(l=>{c||i.push([u,c=[]]),c.indexOf(l)==-1&&c.push(l)})})});let o=t[r.join(",")]=new Js(r.indexOf(e.length-1)>-1);for(let a=0;a<i.length;a++){let u=i[a][1].sort(ZV);o.next.push({type:i[a][0],next:t[u.join(",")]||n(u)})}return o}}function R$e(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 QV(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 e3(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 t3(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new E$e(e[n]);return t}let n3=class d6{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=t3(r.attrs),this.defaultAttrs=QV(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==Js.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:e3(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Gs(this,this.computeAttrs(t),B.from(n),rt.setFrom(r))}createChecked(t=null,n,r){return n=B.from(n),this.checkContent(n),new Gs(this,this.computeAttrs(t),n,rt.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=B.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(B.empty,!0);return o?new Gs(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 d6(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 E$e{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Ny{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=t3(i.attrs),this.excluded=null;let o=QV(this.attrs);this.instance=o?new rt(this,o):null}create(t=null){return!t&&this.instance?this.instance:new rt(this,e3(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,a)=>r[o]=new Ny(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 C$e{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=yn.from(t.nodes),n.marks=yn.from(t.marks||{}),this.nodes=n3.compile(this.spec.nodes,this),this.marks=Ny.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]=Js.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=u=="_"?null:u?r3(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==""?[]:r3(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 n3){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 Ay(r,r.defaultAttrs,t,rt.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return Gs.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 r3(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 of{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 u3(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new u3(this,n,!0);return r.addAll(t,n.from,n.to),ae.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(k$e(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=s3(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=s3(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new of(t,of.schemaRules(t)))}}const i3={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},M$e={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},o3={ol:!0,ul:!0},Fy=1,Wy=2,fh=4;function a3(e,t,n){return t!=null?(t?Fy:0)|(t==="full"?Wy:0):e&&e.whitespace=="pre"?Fy|Wy:n&~fh}class Py{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&fh?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(B.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&Fy)){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=B.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(B.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):N$e(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&&!i3.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class u3{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,a=a3(null,n.preserveWhitespace,0)|(r?fh:0);i?o=new Py(i.type,i.attrs,rt.none,rt.none,!0,n.topMatch||i.type.contentMatch,a):r?o=new Py(null,null,rt.none,rt.none,!0,null,a):o=new Py(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(A$e(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&Wy||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&Fy)r.options&Wy?n=n.replace(/\r\n?/g,`
|
|
34
|
+
`):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;o3.hasOwnProperty(r)&&this.parser.normalizeLists&&x$e(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));if(o?o.ignore:M$e.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(i3.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(`
|
|
35
|
+
`))}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=a3(t,i,o.options);o.options&fh&&o.content.length==0&&(a|=fh),this.nodes.push(new Py(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=F$e(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 x$e(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&o3.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function k$e(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function A$e(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 s3(e){let t={};for(let n in e)t[n]=e[n];return t}function N$e(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 F$e(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}class io{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=NR(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}=io.renderSpec(NR(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&&io.renderSpec(NR(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}=io.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 io(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=c3(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return c3(t.marks)}}function c3(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function NR(e){return e.document||window.document}const l3=65535,f3=Math.pow(2,16);function W$e(e,t){return e+t*f3}function d3(e){return e&l3}function P$e(e){return(e-(e&l3))/f3}const p3=1,h3=2,Ly=4,m3=8;class FR{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&m3)>0}get deletedBefore(){return(this.delInfo&(p3|Ly))>0}get deletedAfter(){return(this.delInfo&(h3|Ly))>0}get deletedAcross(){return(this.delInfo&Ly)>0}}class Kr{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Kr.empty)return Kr.empty}recover(t){let n=0,r=d3(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+P$e(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:W$e(u/3,t-s),v=t==s?h3:t==f?p3:Ly;return(n<0?t!=s:t!=f)&&(v|=m3),new FR(p,v,h)}i+=l-c}return r?t+i:new FR(t+i,0,null)}touches(t,n){let r=0,i=d3(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 Kr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Kr.empty:new Kr(t<0?[0,-t,0]:[0,0,t])}}Kr.empty=new Kr([]);class dh{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 dh(this.maps,this.mirror,t,n)}copy(){return new dh(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 dh;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 FR(t,i,null)}}const WR=Object.create(null);class ar{getMap(){return Kr.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=WR[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 WR)throw new RangeError("Duplicate use of step JSON ID "+t);return WR[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 My)return Vt.fail(o.message);throw o}}}function PR(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(PR(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return B.fromArray(r)}class uu extends ar{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 ae(PR(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 oo(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 uu(n.pos,r.pos,this.mark)}merge(t){return t instanceof uu&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new uu(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 uu(n.from,n.to,t.markFromJSON(n.mark))}}ar.jsonID("addMark",uu);class oo extends ar{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 ae(PR(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 uu(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 oo(n.pos,r.pos,this.mark)}merge(t){return t instanceof oo&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new oo(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 oo(n.from,n.to,t.markFromJSON(n.mark))}}ar.jsonID("removeMark",oo);class su extends ar{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 ae(B.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 su(this.pos,n.marks[i]);return new su(this.pos,this.mark)}}return new af(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new su(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 su(n.pos,t.markFromJSON(n.mark))}}ar.jsonID("addNodeMark",su);class af extends ar{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 ae(B.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new su(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new af(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 af(n.pos,t.markFromJSON(n.mark))}}ar.jsonID("removeNodeMark",af);class Rn extends ar{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&LR(t,this.from,this.to)?Vt.fail("Structure replace would overwrite content"):Vt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Kr([this.from,this.to-this.from,this.slice.size])}invert(t){return new Rn(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 Rn(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof Rn)||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?ae.empty:new ae(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Rn(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?ae.empty:new ae(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Rn(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 Rn(n.from,n.to,ae.fromJSON(t,n.slice),!!n.structure)}}ar.jsonID("replace",Rn);class tn extends ar{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&&(LR(t,this.from,this.gapFrom)||LR(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 Kr([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,ae.fromJSON(t,n.slice),n.insert,!!n.structure)}}ar.jsonID("replaceAround",tn);function LR(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 L$e(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 oo(d,p,f[v])));u&&u.to==d?u.to=p:o.push(u=new uu(d,p,r))}}),i.forEach(s=>e.step(s)),o.forEach(s=>e.step(s))}function D$e(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 Ny){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 oo(a.from,a.to,a.style)))}function j$e(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 Rn(a,c,ae.empty));else{r=l;for(let f=0;f<s.marks.length;f++)n.allowsMarkType(s.marks[f].type)||e.step(new oo(a,c,s.marks[f]))}a=c}if(!r.validEnd){let u=r.fillBefore(B.empty,!0);e.replace(a,a,new ae(u,0,0))}for(let u=o.length-1;u>=0;u--)e.step(o[u])}function q$e(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function uf(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||!q$e(i,o,a))break}return null}function U$e(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=B.empty,f=0;for(let h=o,v=!1;h>n;h--)v||r.index(h)>0?(v=!0,l=B.from(r.node(h).copy(l)),f++):s--;let d=B.empty,p=0;for(let h=o,v=!1;h>n;h--)v||i.after(h+1)<i.end(h)?(v=!0,d=B.from(i.node(h).copy(d)),p++):c++;e.step(new tn(s,c,a,u,new ae(l.append(d),f,p),l.size-f,!0))}function DR(e,t,n=null,r=e){let i=B$e(e,t),o=i&&z$e(r,t);return o?i.map(v3).concat({type:t,attrs:n}).concat(o.map(v3)):null}function v3(e){return{type:e,attrs:null}}function B$e(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 z$e(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 K$e(e,t,n){let r=B.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=B.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 ae(r,0,0),n.length,!0))}function V$e(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)&&H$e(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 ae(B.from(r.create(i,null,a.marks)),0,0),1,!0)),!1}})}function H$e(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function G$e(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 ae(B.from(a),0,0),1,!0))}function sf(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 J$e(e,t,n=1,r){let i=e.doc.resolve(t),o=B.empty,a=B.empty;for(let u=i.depth,s=i.depth-n,c=n-1;u>s;u--,c--){o=B.from(i.node(u).copy(o));let l=r&&r[c];a=B.from(l?l.type.create(l.attrs,a):i.node(u).copy(a))}e.step(new Rn(t,t,new ae(o.append(a),n,n),!0))}function cu(e,t){let n=e.resolve(t),r=n.index();return g3(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function g3(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function y3(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&&g3(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 Y$e(e,t,n){let r=new Rn(t-n,t+n,ae.empty,!0);e.step(r)}function Z$e(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 X$e(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 jR(e,t,n=t,r=ae.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return b3(i,o,r)?new Rn(t,n,r):new Q$e(i,o,r).fit()}function b3(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class Q$e{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=B.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=B.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 ae(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 Rn(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=qR(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(B.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=qR(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new ae(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=qR(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new ae(ph(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new ae(ph(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(_3(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=hh(this.placed,n,B.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?ae.empty:new ae(ph(a.content,t-1,1),t-1,p<0?a.openEnd:t-1):new ae(ph(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||!UR(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=UR(t,n,i,r,o);if(a){for(let u=n-1;u>=0;u--){let{match:s,type:c}=this.frontier[u],l=UR(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=hh(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=hh(this.placed,this.depth,B.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(B.empty,!0);n.childCount&&(this.placed=hh(this.placed,this.frontier.length,n))}}function ph(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(ph(e.firstChild.content,t-1,n)))}function hh(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(hh(e.lastChild.content,t-1,n)))}function qR(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function _3(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,_3(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(B.empty,!0)))),e.copy(r)}function UR(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&&!eTe(n,o.content,a)?u:null}function eTe(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function tTe(e){return e.spec.defining||e.spec.definingForContent}function nTe(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(b3(i,o,r))return e.step(new Rn(t,n,r));let a=$3(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=tTe(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 ae(S3(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 S3(e,t,n,r,i){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(S3(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(B.empty,!0))}return e}function rTe(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=Z$e(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new ae(B.from(r),0,0))}function iTe(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=$3(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 $3(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 cf extends ar{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 ae(B.from(i),0,n.isLeaf?0:1))}getMap(){return Kr.empty}invert(t){return new cf(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 cf(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 cf(n.pos,n.attr,n.value)}}ar.jsonID("attr",cf);let lf=class extends Error{};lf=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},lf.prototype=Object.create(Error.prototype),lf.prototype.constructor=lf,lf.prototype.name="TransformError";class oTe{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new dh}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new lf(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=ae.empty){let i=jR(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new ae(B.from(r),0,0))}delete(t,n){return this.replace(t,n,ae.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return nTe(this,t,n,r),this}replaceRangeWith(t,n,r){return rTe(this,t,n,r),this}deleteRange(t,n){return iTe(this,t,n),this}lift(t,n){return U$e(this,t,n),this}join(t,n=1){return Y$e(this,t,n),this}wrap(t,n){return K$e(this,t,n),this}setBlockType(t,n=t,r,i=null){return V$e(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return G$e(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new cf(t,n,r)),this}addNodeMark(t,n){return this.step(new su(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 af(t,n)),this}split(t,n=1,r){return J$e(this,t,n,r),this}addMark(t,n,r){return L$e(this,t,n,r),this}removeMark(t,n,r){return D$e(this,t,n,r),this}clearIncompatible(t,n,r){return j$e(this,t,n,r),this}}const BR=Object.create(null);class Fe{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new aTe(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=ae.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?ae.empty:n),u==0&&O3(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),O3(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new Ue(t):ff(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?ff(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):ff(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 Ri(t.node(0))}static atStart(t){return ff(t,t,0,0,1)||new Ri(t)}static atEnd(t){return ff(t,t,t.content.size,t.childCount,-1)||new Ri(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=BR[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 BR)throw new RangeError("Duplicate use of selection JSON ID "+t);return BR[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Ue.between(this.$anchor,this.$head).getBookmark()}}Fe.prototype.visible=!0;class aTe{constructor(t,n){this.$from=t,this.$to=n}}let T3=!1;function I3(e){!T3&&!e.parent.inlineContent&&(T3=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Ue extends Fe{constructor(t,n=t){I3(t),I3(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 Fe.near(r);let i=t.resolve(n.map(this.anchor));return new Ue(i.parent.inlineContent?i:r,r)}replace(t,n=ae.empty){if(super.replace(t,n),n==ae.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof Ue&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Dy(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 Ue(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=Fe.findFrom(n,r,!0)||Fe.findFrom(n,-r,!0);if(o)n=o.$head;else return Fe.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Fe.findFrom(t,-r,!0)||Fe.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new Ue(t,n)}}Fe.jsonID("text",Ue);class Dy{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Dy(t.map(this.anchor),t.map(this.head))}resolve(t){return Ue.between(t.resolve(this.anchor),t.resolve(this.head))}}class be extends Fe{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?Fe.near(o):new be(o)}content(){return new ae(B.from(this.node),0,0)}eq(t){return t instanceof be&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new zR(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new be(t.resolve(n.anchor))}static create(t,n){return new be(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}be.prototype.visible=!1,Fe.jsonID("node",be);class zR{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Dy(r,r):new zR(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&be.isSelectable(r)?new be(n):Fe.near(n)}}class Ri extends Fe{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=ae.empty){if(n==ae.empty){t.delete(0,t.doc.content.size);let r=Fe.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Ri(t)}map(t){return new Ri(t)}eq(t){return t instanceof Ri}getBookmark(){return uTe}}Fe.jsonID("all",Ri);const uTe={map(){return this},resolve(e){return new Ri(e)}};function ff(e,t,n,r,i,o=!1){if(t.inlineContent)return Ue.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&&be.isSelectable(u))return be.create(e,n-(i<0?u.nodeSize:0))}else{let s=ff(e,u,n+i,i<0?u.childCount:0,i,o);if(s)return s}n+=u.nodeSize*i}return null}function O3(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Rn||i instanceof tn))return;let o=e.mapping.maps[r],a;o.forEach((u,s,c,l)=>{a==null&&(a=l)}),e.setSelection(Fe.near(e.doc.resolve(a),n))}const w3=1,jy=2,R3=4;class sTe extends oTe{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|w3)&~jy,this.storedMarks=null,this}get selectionSet(){return(this.updated&w3)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=jy,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&jy)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~jy,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(Fe.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|=R3,this}get scrolledIntoView(){return(this.updated&R3)>0}}function E3(e,t){return!t||!e?e:e.bind(t)}class mh{constructor(t,n,r){this.name=t,this.init=E3(n.init,r),this.apply=E3(n.apply,r)}}const cTe=[new mh("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new mh("selection",{init(e,t){return e.selection||Fe.atStart(t.doc)},apply(e){return e.selection}}),new mh("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new mh("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class KR{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=cTe.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 mh(r.key,r.spec.state,r))})}}class df{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 df(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 sTe(this)}static create(t){let n=new KR(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new df(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 KR(this.schema,t.plugins),r=n.fields,i=new df(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 KR(t.schema,t.plugins),o=new df(i);return i.fields.forEach(a=>{if(a.name=="doc")o.doc=Gs.fromJSON(t.schema,n.doc);else if(a.name=="selection")o.selection=Fe.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 C3(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=C3(i,t,{})),n[r]=i}return n}class Vr{constructor(t){this.spec=t,this.props={},t.props&&C3(t.props,this,this.props),this.key=t.key?t.key.key:M3("plugin")}getState(t){return t[this.key]}}const VR=Object.create(null);function M3(e){return e in VR?e+"$"+ ++VR[e]:(VR[e]=0,e+"$")}class lu{constructor(t="key"){this.key=M3(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Or=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},vh=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let x3=null;const pa=function(e,t,n){let r=x3||(x3=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},Ys=function(e,t,n,r){return n&&(k3(e,t,n,r,-1)||k3(e,t,n,r,1))},lTe=/^(img|br|input|textarea|hr)$/i;function k3(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:ao(e))){let o=e.parentNode;if(!o||o.nodeType!=1||dTe(e)||lTe.test(e.nodeName)||e.contentEditable=="false")return!1;t=Or(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?ao(e):0}else return!1}}function ao(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function fTe(e,t,n){for(let r=t==0,i=t==ao(e);r||i;){if(e==n)return!0;let o=Or(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,i=i&&o==ao(e)}}function dTe(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 qy=function(e){return e.focusNode&&Ys(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Zs(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function pTe(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}const fu=typeof navigator<"u"?navigator:null,A3=typeof document<"u"?document:null,du=fu&&fu.userAgent||"",HR=/Edge\/(\d+)/.exec(du),N3=/MSIE \d/.exec(du),GR=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(du),ur=!!(N3||GR||HR),pu=N3?document.documentMode:GR?+GR[1]:HR?+HR[1]:0,Ei=!ur&&/gecko\/(\d+)/i.test(du);Ei&&+(/Firefox\/(\d+)/.exec(du)||[0,0])[1];const JR=!ur&&/Chrome\/(\d+)/.exec(du),jn=!!JR,hTe=JR?+JR[1]:0,qn=!ur&&!!fu&&/Apple Computer/.test(fu.vendor),pf=qn&&(/Mobile\/\w+/.test(du)||!!fu&&fu.maxTouchPoints>2),Hr=pf||(fu?/Mac/.test(fu.platform):!1),Ci=/Android \d/.test(du),Uy=!!A3&&"webkitFontSmoothing"in A3.documentElement.style,mTe=Uy?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function vTe(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function hu(e,t){return typeof e=="number"?e:e[t]}function gTe(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 F3(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=vh(a)){if(a.nodeType!=1)continue;let u=a,s=u==o.body,c=s?vTe(o):gTe(u),l=0,f=0;if(t.top<c.top+hu(r,"top")?f=-(c.top-t.top+hu(i,"top")):t.bottom>c.bottom-hu(r,"bottom")&&(f=t.bottom-c.bottom+hu(i,"bottom")),t.left<c.left+hu(r,"left")?l=-(c.left-t.left+hu(i,"left")):t.right>c.right-hu(r,"right")&&(l=t.right-c.right+hu(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 yTe(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:W3(e.dom)}}function W3(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=vh(r));return t}function bTe({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;P3(n,r==0?0:r-t)}function P3(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 hf=null;function _Te(e){if(e.setActive)return e.setActive();if(hf)return e.focus(hf);let t=W3(e);e.focus(hf==null?{get preventScroll(){return hf={preventScroll:!0},!0}}:void 0),hf||(hf=!1,P3(t,0))}function L3(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=pa(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?STe(n,i):!n||r&&n.nodeType==1?{node:e,offset:o}:L3(n,i)}function STe(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=mu(r,1);if(o.top!=o.bottom&&YR(t,o))return{node:e,offset:i+(t.left>=(o.left+o.right)/2?1:0)}}return{node:e,offset:0}}function YR(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function $Te(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function TTe(e,t,n){let{node:r,offset:i}=L3(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 ITe(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 D3(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(YR(t,c))return D3(a,t,c)}}if((o=(o+1)%r)==i)break}return e}function OTe(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(!YR(t,s)||(o=D3(e.dom,t,s),!o))return null}if(qn)for(let s=o;r&&s;s=vh(s))s.draggable&&(r=void 0);if(o=$Te(o,t),r){if(Ei&&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=ITe(e,r,i,t))}a==null&&(a=TTe(e,o,t));let u=e.docView.nearestDesc(o,!0);return{pos:a,inside:u?u.posAtStart-u.border:-1}}function mu(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 j3(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),a=Uy||Ei;if(r.nodeType==3)if(a&&(wTe.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let s=mu(pa(r,i,i),n);if(Ei&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=mu(pa(r,i-1,i-1),-1);if(c.top==s.top){let l=mu(pa(r,i,i+1),-1);if(l.top!=s.top)return gh(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++,gh(mu(pa(r,s,c),1),l<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==ao(r))){let s=r.childNodes[i-1];if(s.nodeType==1)return ZR(s.getBoundingClientRect(),!1)}if(o==null&&i<ao(r)){let s=r.childNodes[i];if(s.nodeType==1)return ZR(s.getBoundingClientRect(),!0)}return ZR(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==ao(r))){let s=r.childNodes[i-1],c=s.nodeType==3?pa(s,ao(s)-(a?0:1)):s.nodeType==1&&(s.nodeName!="BR"||!s.nextSibling)?s:null;if(c)return gh(mu(c,1),!1)}if(o==null&&i<ao(r)){let s=r.childNodes[i];for(;s.pmViewDesc&&s.pmViewDesc.ignoreForCoords;)s=s.nextSibling;let c=s?s.nodeType==3?pa(s,0,a?0:1):s.nodeType==1?s:null:null;if(c)return gh(mu(c,-1),!0)}return gh(mu(r.nodeType==3?pa(r):r,-n),n>=0)}function gh(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 ZR(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 q3(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 RTe(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return q3(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=j3(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=pa(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 ETe=/[\u0590-\u08ac]/;function CTe(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!ETe.test(r.parent.textContent)||!u.modify?n=="left"||n=="backward"?o:a:q3(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 U3=null,B3=null,z3=!1;function MTe(e,t,n){return U3==t&&B3==n?z3:(U3=t,B3=n,z3=n=="up"||n=="down"?RTe(e,t,n):CTe(e,t,n))}const Mi=0,K3=1,mf=2,uo=3;class yh{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Mi,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>Or(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 G3){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 V3&&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?Or(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?Or(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=Or(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=Or(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((Ei||qn)&&t==n){let{node:d,offset:p}=u;if(d.nodeType==3){if(l=!!(p&&d.nodeValue[p-1]==`
|
|
36
|
+
`),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:Or(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(Ei&&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&&qn)&&Ys(u.node,u.offset,c.anchorNode,c.anchorOffset)&&Ys(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?mf:K3,t==u&&n==s&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=uo:o.markDirty(t-u,n-u);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?mf:uo}r=a}this.dirty=mf}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?mf:K3;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class V3 extends yh{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==Mi&&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 xTe extends yh{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 Xs extends yh{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=io.renderSpec(document,n.type.spec.toDOM(n,r))),new Xs(t,n,a.dom,a.contentDOM||a.dom)}parseRule(){return this.dirty&uo||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!=uo&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Mi){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Mi}}slice(t,n,r){let i=Xs.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;n<a&&(o=eE(o,n,a,r)),t>0&&(o=eE(o,0,t,r));for(let u=0;u<o.length;u++)o[u].parent=i;return i.children=o,i}}class Qs extends yh{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}=io.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=Z3(l,r,n),c?s=new kTe(t,n,r,i,l,f||null,d,c,o,a+1):n.isText?new By(t,n,r,i,l,d,o):new Qs(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=()=>B.empty)}return t}matchesNode(t,n,r){return this.dirty==Mi&&t.eq(this.node)&&QR(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 NTe(this,a&&a.node,t);PTe(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==mf)&&(a&&this.protectLocalComposition(t,a),J3(this.contentDOM,this.children,t),pf&<e(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof Ue)||r<n||i>n+this.node.content.size)return null;let o=t.domSelectionRange(),a=DTe(o.focusNode,o.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){let u=a.nodeValue,s=jTe(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 xTe(this,o,n,i);t.input.compositionNodes.push(a),this.children=eE(this.children,r,r+i.length,t,a)}update(t,n,r,i){return this.dirty==uo||!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=Mi}updateOuterDeco(t){if(QR(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Y3(this.dom,this.nodeDOM,XR(this.outerDeco,this.node,n),XR(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 H3(e,t,n,r,i){return Z3(r,t,e),new Qs(void 0,e,t,n,r,r,r,i,0)}class By extends Qs{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==uo||this.dirty!=Mi&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Mi||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=Mi,!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 By(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=uo)}get domAtom(){return!1}}class G3 extends yh{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Mi&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class kTe extends Qs{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==uo)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 J3(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=X3(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(u,r);if(a instanceof Xs){let s=r?r.previousSibling:e.lastChild;J3(a.contentDOM,a.children,n),r=s?s.nextSibling:e.firstChild}}for(;r;)r=X3(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const bh=function(e){e&&(this.nodeName=e)};bh.prototype=Object.create(null);const ec=[new bh];function XR(e,t,n){if(e.length==0)return ec;let r=n?ec[0]:new bh,i=[r];for(let o=0;o<e.length;o++){let a=e[o].type.attrs;if(a){a.nodeName&&i.push(r=new bh(a.nodeName));for(let u in a){let s=a[u];s!=null&&(n&&i.length==1&&i.push(r=new bh(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 Y3(e,t,n,r){if(n==ec&&r==ec)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=ec[0]),i=s}ATe(i,u||ec[0],a)}return i}function ATe(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 Z3(e,t,n){return Y3(e,e,ec,XR(t,n,e.nodeType!=1))}function QR(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 X3(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class NTe{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=FTe(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=Mi,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=Xs.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==uo&&a.dom==a.contentDOM&&(a.dirty=mf),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 Qs){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!=uo&&QR(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,Qs.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 V3(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 Xs;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof By)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((qn||jn)&&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 G3(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 FTe(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 Xs)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 WTe(e,t){return e.type.side-t.type.side}function PTe(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(WTe);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 LTe(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 DTe(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=ao(e)}else if(e.nodeType==1&&t<e.childNodes.length)e=e.childNodes[t],t=0;else return null}}function jTe(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 eE(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 tE(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(qy(n)){for(s=u;i&&!i.node;)i=i.parent;let l=i.node;if(i&&l.isAtom&&be.isSelectable(l)&&i.parent&&!(l.isInline&&fTe(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new be(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=rE(e,s,u,l)}return c}function Q3(e){return e.editable?e.hasFocus():a4(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function ha(e,t=!1){let n=e.state.selection;if(r4(e,n),!!Q3(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&jn){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Ys(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)UTe(e);else{let{anchor:r,head:i}=n,o,a;e4&&!(n instanceof Ue)&&(n.$from.parent.inlineContent||(o=t4(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=t4(e,n.to))),e.docView.setSelection(r,i,e.root,t),e4&&(o&&n4(o),a&&n4(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&qTe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const e4=qn||jn&&hTe<63;function t4(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(qn&&i&&i.contentEditable=="false")return nE(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return nE(i);if(o)return nE(o)}}function nE(e){return e.contentEditable="true",qn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function n4(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function qTe(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(()=>{(!Q3(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function UTe(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,Or(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&ur&&pu<=11&&(r.disabled=!0,r.disabled=!1)}function r4(e,t){if(t instanceof be){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(i4(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else i4(e)}function i4(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function rE(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||Ue.between(t,n,r)}function o4(e){return e.editable&&!e.hasFocus()?!1:a4(e)}function a4(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 BTe(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Ys(t.node,t.offset,n.anchorNode,n.anchorOffset)}function iE(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&&Fe.findFrom(o,t)}function tc(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function u4(e,t,n){let r=e.state.selection;if(r instanceof Ue){if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let i=iE(e.state,t);return i&&i instanceof be?tc(e,i):!1}else if(!(Hr&&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?be.isSelectable(o)?tc(e,new be(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):Uy?tc(e,new Ue(e.state.doc.resolve(t<0?u:u+o.nodeSize))):!1:!1}}else{if(r instanceof be&&r.node.isInline)return tc(e,new Ue(t>0?r.$to:r.$from));{let i=iE(e.state,t);return i?tc(e,i):!1}}}function zy(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function _h(e){let t=e.pmViewDesc;return t&&t.size==0&&(e.nextSibling||e.nodeName!="BR")}function oE(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,a=!1;for(Ei&&n.nodeType==1&&r<zy(n)&&_h(n.childNodes[r])&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let u=n.childNodes[r-1];if(_h(u))i=n,o=--r;else if(u.nodeType==3)n=u,r=n.nodeValue.length;else break}}else{if(s4(n))break;{let u=n.previousSibling;for(;u&&_h(u);)i=n.parentNode,o=Or(u),u=u.previousSibling;if(u)n=u,r=zy(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?uE(e,n,r):i&&uE(e,i,o)}function aE(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=zy(n),o,a;for(;;)if(r<i){if(n.nodeType!=1)break;let u=n.childNodes[r];if(_h(u))o=n,a=++r;else break}else{if(s4(n))break;{let u=n.nextSibling;for(;u&&_h(u);)o=u.parentNode,a=Or(u)+1,u=u.nextSibling;if(u)n=u,r=0,i=zy(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&uE(e,o,a)}function s4(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function uE(e,t,n){let r=e.domSelection();if(qy(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&&ha(e)},50)}function c4(e,t,n){let r=e.state.selection;if(r instanceof Ue&&!r.empty||n.indexOf("s")>-1||Hr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let a=iE(e.state,t);if(a&&a instanceof be)return tc(e,a)}if(!i.parent.inlineContent){let a=t<0?i:o,u=r instanceof Ri?Fe.near(a,t):Fe.findFrom(a,t);return u?tc(e,u):!1}return!1}function l4(e,t){if(!(e.state.selection instanceof Ue))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 f4(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function zTe(e){if(!qn||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;f4(e,r,"true"),setTimeout(()=>f4(e,r,"false"),20)}return!1}function KTe(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function VTe(e,t){let n=t.keyCode,r=KTe(t);return n==8||Hr&&n==72&&r=="c"?l4(e,-1)||oE(e):n==46||Hr&&n==68&&r=="c"?l4(e,1)||aE(e):n==13||n==27?!0:n==37||Hr&&n==66&&r=="c"?u4(e,-1,r)||oE(e):n==39||Hr&&n==70&&r=="c"?u4(e,1,r)||aE(e):n==38||Hr&&n==80&&r=="c"?c4(e,-1,r)||oE(e):n==40||Hr&&n==78&&r=="c"?zTe(e)||c4(e,1,r)||aE(e):r==(Hr?"m":"c")&&(n==66||n==73||n==89||n==90)}function d4(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")||io.fromSchema(e.state.schema),u=_4(),s=u.createElement("div");s.appendChild(a.serializeFragment(r,{document:u}));let c=s.firstChild,l,f=0;for(;c&&c.nodeType==1&&(l=y4[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,`
|
|
37
|
+
|
|
38
|
+
`);return{dom:s,text:d}}function p4(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 ae(B.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
39
|
+
`))),0,0):ae.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=io.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=JTe(n),Uy&&YTe(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")||of.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(s||l),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!HTe.test(d.parentNode.nodeName)?{ignore:!0}:null}})),l)u=ZTe(g4(u,+l[1],+l[2]),l[4]);else if(u=ae.maxOpen(GTe(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=g4(u,f,d)}return e.someProp("transformPasted",f=>{u=f(u,e)}),u}const HTe=/^(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 GTe(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&&m4(s,o,u,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=v4(a[a.length-1],o.length));let l=h4(u,s);a.push(l),i=i.matchType(l.type),o=s}}),a)return B.from(a)}return e}function h4(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,B.from(e));return e}function m4(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=m4(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(B.from(h4(n,e,i+1))))}}function v4(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,v4(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(B.empty,!0);return e.copy(n.append(r))}function sE(e,t,n,r,i,o){let a=t<0?e.firstChild:e.lastChild,u=a.content;return i<r-1&&(u=sE(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(B.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(u))}function g4(e,t,n){return t<e.openStart&&(e=new ae(sE(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new ae(sE(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const y4={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 b4=null;function _4(){return b4||(b4=document.implementation.createHTMLDocument("title"))}function JTe(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=_4().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&y4[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 YTe(e){let t=e.querySelectorAll(jn?"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 ZTe(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=B.from(s.create(r[u+1],i)),o++,a++}return new ae(i,o,a)}const Un={},Bn={},XTe={touchstart:!0,touchmove:!0};class QTe{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 e0e(e){for(let t in Un){let n=Un[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{n0e(e,r)&&!lE(e,r)&&(e.editable||!(r.type in Bn))&&n(e,r)},XTe[t]?{passive:!0}:void 0)}qn&&e.dom.addEventListener("input",()=>null),cE(e)}function vu(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function t0e(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 cE(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>lE(e,r))})}function lE(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function n0e(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 r0e(e,t){!lE(e,t)&&Un[t.type]&&(e.editable||!(t.type in Bn))&&Un[t.type](e,t)}Bn.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!$4(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Ci&&jn&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),pf&&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,Zs(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||VTe(e,n)?n.preventDefault():vu(e,"key")},Bn.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},Bn.keypress=(e,t)=>{let n=t;if($4(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Hr&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Ue)||!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 Ky(e){return{left:e.clientX,top:e.clientY}}function i0e(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function fE(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 vf(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function o0e(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&be.isSelectable(r)?(vf(e,new be(n),"pointer"),!0):!1}function a0e(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof be&&(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(be.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?(vf(e,be.create(e.state.doc,i),"pointer"),!0):!1}function u0e(e,t,n,r,i){return fE(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?a0e(e,n):o0e(e,n))}function s0e(e,t,n,r){return fE(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function c0e(e,t,n,r){return fE(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||l0e(e,n,r)}function l0e(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(vf(e,Ue.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)vf(e,Ue.create(r,u+1,u+1+a.content.size),"pointer");else if(be.isSelectable(a))vf(e,be.create(r,u),"pointer");else continue;return!0}}function dE(e){return Vy(e)}const S4=Hr?"metaKey":"ctrlKey";Un.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=dE(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&i0e(n,e.input.lastClick)&&!n[S4]&&(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(Ky(n));a&&(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new f0e(e,a,n,!!r)):(o=="doubleClick"?s0e:c0e)(e,a.pos,a.inside,n)?n.preventDefault():vu(e,"pointer"))};class f0e{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[S4],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 be&&c.from<=a&&c.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ei&&!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)),vu(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(()=>ha(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(Ky(t))),this.updateAllowDefault(t),this.allowDefault||!n?vu(this.view,"pointer"):u0e(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||qn&&this.mightDrag&&!this.mightDrag.node.isAtom||jn&&!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)?(vf(this.view,Fe.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):vu(this.view,"pointer")}move(t){this.updateAllowDefault(t),vu(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)}}Un.touchstart=e=>{e.input.lastTouch=Date.now(),dE(e),vu(e,"pointer")},Un.touchmove=e=>{e.input.lastTouch=Date.now(),vu(e,"pointer")},Un.contextmenu=e=>dE(e);function $4(e,t){return e.composing?!0:qn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const d0e=Ci?5e3:-1;Bn.compositionstart=Bn.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(),Vy(e,!0),e.markCursor=null;else if(Vy(e),Ei&&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}T4(e,d0e)},Bn.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,T4(e,20))};function T4(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Vy(e),t))}function I4(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=p0e());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function p0e(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Vy(e,t=!1){if(!(Ci&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),I4(e),t||e.docView&&e.docView.dirty){let n=tE(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}function h0e(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 gf=ur&&pu<15||pf&&mTe<604;Un.copy=Bn.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=gf?null:n.clipboardData,a=r.content(),{dom:u,text:s}=d4(e,a);o?(n.preventDefault(),o.clearData(),o.setData("text/html",u.innerHTML),o.setData("text/plain",s)):h0e(e,u),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function m0e(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function v0e(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?Sh(e,r.value,null,e.input.shiftKey,t):Sh(e,r.textContent,r.innerHTML,e.input.shiftKey,t)},50)}function Sh(e,t,n,r,i){let o=p4(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",s=>s(e,i,o||ae.empty)))return!0;if(!o)return!1;let a=m0e(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}Bn.paste=(e,t)=>{let n=t;if(e.composing&&!Ci)return;let r=gf?null:n.clipboardData;r&&Sh(e,r.getData("text/plain"),r.getData("text/html"),e.input.shiftKey,n)?n.preventDefault():v0e(e,n)};class g0e{constructor(t,n){this.slice=t,this.move=n}}const O4=Hr?"altKey":"ctrlKey";Un.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(Ky(n));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof be?i.to-1:i.to))){if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(be.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(be.create(e.state.doc,c.posBefore)))}}let a=e.state.selection.content(),{dom:u,text:s}=d4(e,a);n.dataTransfer.clearData(),n.dataTransfer.setData(gf?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",gf||n.dataTransfer.setData("text/plain",s),e.dragging=new g0e(a,!n[O4])},Un.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Bn.dragover=Bn.dragenter=(e,t)=>t.preventDefault(),Bn.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(Ky(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=p4(e,n.dataTransfer.getData(gf?"Text":"text/plain"),gf?null:n.dataTransfer.getData("text/html"),!1,o);let u=!!(r&&!n[O4]);if(e.someProp("handleDrop",h=>h(e,n,a||ae.empty,u))){n.preventDefault();return}if(!a)return;n.preventDefault();let s=a?X$e(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&&be.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new be(p));else{let h=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((v,m,_,g)=>h=g),c.setSelection(rE(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},Un.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())&&ha(e)},20))},Un.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)},Un.beforeinput=(e,t)=>{if(jn&&Ci&&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,Zs(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 Bn)Un[e]=Bn[e];function $h(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 pE{constructor(t,n){this.toDOM=t,this.spec=n||nc,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 wr(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof pE&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&$h(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class gu{constructor(t,n){this.attrs=t,this.spec=n||nc}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 wr(o,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof gu&&$h(this.attrs,t.attrs)&&$h(this.spec,t.spec)}static is(t){return t.type instanceof gu}destroy(){}}let y0e=class p6{constructor(t,n){this.attrs=t,this.spec=n||nc}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 wr(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 p6&&$h(this.attrs,t.attrs)&&$h(this.spec,t.spec)}destroy(){}};class wr{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new wr(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 wr(t,t,new pE(n,r))}static inline(t,n,r,i){return new wr(t,n,new gu(r,i))}static node(t,n,r,i){return new wr(t,n,new y0e(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof gu}}const yf=[],nc={};class jt{constructor(t,n){this.local=t.length?t:yf,this.children=n.length?n:yf}static create(t,n){return n.length?Hy(n,t,0,nc):En}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==En||t.maps.length==0?this:this.mapInner(t,n,0,0,r||nc)}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?b0e(this.children,a||[],t,n,r,i,o):a?new jt(a.sort(rc),yf):En}add(t,n){return n.length?this==En?jt.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=R4(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,Hy(l,u,c+1,nc)),o+=3}});let a=w4(o?E4(n):n,-r);for(let u=0;u<a.length;u++)a[u].type.valid(t,a[u])||a.splice(u--,1);return new jt(a.length?this.local.concat(a).sort(rc):this.local,i||this.children)}remove(t){return t.length==0||this==En?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!=En?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 jt(i,r):En}forChild(t,n){if(this==En)return this;if(n.isLeaf)return jt.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 gu){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 jt(i.sort(rc),yf);return r?new yu([u,r]):u}return r||En}eq(t){if(this==t)return!0;if(!(t instanceof jt)||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 hE(this.localsInner(t))}localsInner(t){if(this==En)return yf;if(t.inlineContent||!this.local.some(gu.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof gu||n.push(this.local[r]);return n}}jt.empty=new jt([],[]),jt.removeOverlap=hE;const En=jt.empty;class yu{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,nc));return yu.from(r)}forChild(t,n){if(n.isLeaf)return jt.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=En&&(o instanceof yu?r=r.concat(o.members):r.push(o))}return yu.from(r)}eq(t){if(!(t instanceof yu)||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?hE(r?n:n.sort(rc)):yf}static from(t){switch(t.length){case 0:return En;case 1:return t[0];default:return new yu(t.every(n=>n instanceof jt)?t:t.reduce((n,r)=>n.concat(r instanceof jt?r:r.members),[]))}}}function b0e(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);_!=En?(u[c]=f,u[c+1]=p,u[c+2]=_):(u[c+1]=-2,s=!0)}else s=!0}if(s){let c=_0e(u,e,t,n,i,o,a),l=Hy(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 jt(t.sort(rc),u)}function w4(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 wr(i.from+t,i.to+t,i.type))}return n}function _0e(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 R4(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 E4(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Hy(e,t,n,r){let i=[],o=!1;t.forEach((u,s)=>{let c=R4(e,u,s+n);if(c){o=!0;let l=Hy(c,u,n+s+1,r);l!=En&&i.push(s,s+u.nodeSize,l)}});let a=w4(o?E4(e):e,-n).sort(rc);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 jt(a,i):En}function rc(e,t){return e.from-t.from||e.to-t.to}function hE(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),C4(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),C4(t,i,r.copy(o.from,r.to)));break}}}return t}function C4(e,t,n){for(;t<e.length&&rc(n,e[t])>0;)t++;e.splice(t,0,n)}function mE(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=En&&t.push(r)}),e.cursorWrapper&&t.push(jt.create(e.state.doc,[e.cursorWrapper.deco])),yu.from(t)}const S0e={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},$0e=ur&&pu<=11;class T0e{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 I0e{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new T0e,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]);ur&&pu<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),$0e&&(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,S0e)),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(o4(this.view)){if(this.suppressingSelectionUpdates)return ha(this.view);if(ur&&pu<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Ys(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=vh(o))n.add(o);for(let o=t.anchorNode;o;o=vh(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)&&o4(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(Ei&&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&&qy(r)&&(c=tE(t))&&c.eq(Fe.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,ha(t),this.currentSelection.set(r),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,a),O0e(t)),this.handleDOMChange(o,a,u,s),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||ha(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(ur&&pu<=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?Or(i)+1:0,u=r.localPosFromDOM(t.target,a,-1),s=o&&o.parentNode==t.target?Or(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 M4=new WeakMap,x4=!1;function O0e(e){if(!M4.has(e)&&(M4.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Ei,x4)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."),x4=!0}}function w0e(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 Ys(u.node,u.offset,o,a)&&([r,i,o,a]=[o,a,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:a}}function R0e(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}],qy(s)||c.push({node:s.focusNode,offset:s.focusOffset})),jn&&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")||of.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:E0e,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 E0e(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(qn&&/^(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||qn&&/^(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 C0e(e,t,n,r,i){if(t<0){let R=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,q=tE(e,R);if(q&&!e.state.selection.eq(q)){if(jn&&Ci&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",A=>A(e,Zs(13,"Enter"))))return;let G=e.state.tr.setSelection(q);R=="pointer"?G.setMeta("pointer",!0):R=="key"&&G.scrollIntoView(),e.dispatch(G)}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=R0e(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=k0e(l.content,s.doc.content,s.from,f,d);if((pf&&e.input.lastIOSEnter>Date.now()-225||Ci)&&i.some(R=>R.nodeName=="DIV"||R.nodeName=="P"||R.nodeName=="LI")&&(!p||p.endA>=p.endB)&&e.someProp("handleKeyDown",R=>R(e,Zs(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!p)if(r&&u instanceof Ue&&!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=k4(e,e.state.doc,s.sel);R&&!R.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(R))}return}if(jn&&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 Ue&&(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)),ur&&pu<=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((pf&&e.input.lastIOSEnter>Date.now()-225&&(!_||i.some(R=>R.nodeName=="DIV"||R.nodeName=="P"))||!_&&h.pos<s.doc.content.size&&(g=Fe.findFrom(s.doc.resolve(h.pos+1),1,!0))&&g.head==v.pos)&&e.someProp("handleKeyDown",R=>R(e,Zs(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>p.start&&x0e(c,p.start,p.endA,h,v)&&e.someProp("handleKeyDown",R=>R(e,Zs(8,"Backspace")))){Ci&&jn&&e.domObserver.suppressSelectionUpdates();return}jn&&Ci&&p.endB==p.start&&(e.input.lastAndroidDelete=Date.now()),Ci&&!_&&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,Zs(13,"Enter"))})},20));let S=p.start,b=p.endA,$,T,C;if(_){if(h.pos==v.pos)ur&&pu<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>ha(e),20)),$=e.state.tr.delete(S,b),T=c.resolve(p.start).marksAcross(c.resolve(p.endA));else if(p.endA==p.endB&&(C=M0e(h.parent.content.cut(h.parentOffset,v.parentOffset),m.parent.content.cut(m.parentOffset,p.endA-m.start()))))$=e.state.tr,C.type=="add"?$.addMark(S,b,C.mark):$.removeMark(S,b,C.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=k4(e,$.doc,s.sel);R&&!(jn&&Ci&&e.composing&&R.empty&&(p.start!=p.endB||e.input.lastAndroidDelete<Date.now()-100)&&(R.head==S||R.head==$.mapping.map(b)-1)||ur&&R.empty&&R.head==S)&&$.setSelection(R)}T&&$.ensureMarks(T),e.dispatch($.scrollIntoView())}function k4(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:rE(e,t.resolve(n.anchor),t.resolve(n.head))}function M0e(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(B.from(c).eq(e))return{mark:u,type:a}}function x0e(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||vE(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(vE(o,!0,!0));return!a.parent.isTextblock||a.pos>n||vE(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function vE(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 k0e(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 A0e{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 QTe,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(P4),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=F4(this),N4(this),this.nodeViews=W4(this),this.docView=H3(this.state.doc,A4(this),mE(this),this.dom,this),this.domObserver=new I0e(this,(r,i,o,a)=>C0e(this,r,i,o,a)),this.domObserver.start(),e0e(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&&cE(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(P4),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&&(I4(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=W4(this);F0e(d,this.nodeViews)&&(this.nodeViews=d,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&cE(this),this.editable=F4(this),N4(this);let u=mE(this),s=A4(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&&yTe(this);if(o){this.domObserver.stop();let d=l&&(ur||jn)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&N0e(r.selection,t.selection);if(l){let p=jn?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(t.doc,s,u,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=H3(t.doc,s,u,this.dom,this)),p&&!this.trackWrites&&(d=!0)}d||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&BTe(this))?ha(this,d):(r4(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():f&&bTe(f)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof be){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&F3(this,n.getBoundingClientRect(),t)}else F3(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(ur){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&&_Te(this.dom),ha(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 OTe(this,t)}coordsAtPos(t,n=1){return j3(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 MTe(this,n||this.state,t)}pasteHTML(t,n){return Sh(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Sh(this,t,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(t0e(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],mE(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 r0e(this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return qn&&this.root.nodeType===11&&pTe(this.dom.ownerDocument)==this.dom?w0e(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function A4(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]))}),[wr.node(0,e.state.doc.content.size,t)]}function N4(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:wr.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function F4(e){return!e.someProp("editable",t=>t(e.state)===!1)}function N0e(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 W4(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 F0e(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 P4(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 bu={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:"'"},Gy={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},L4=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),W0e=typeof navigator<"u"&&/Mac/.test(navigator.platform),P0e=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),L0e=W0e||L4&&+L4[1]<57,bn=0;bn<10;bn++)bu[48+bn]=bu[96+bn]=String(bn);for(var bn=1;bn<=24;bn++)bu[bn+111]="F"+bn;for(var bn=65;bn<=90;bn++)bu[bn]=String.fromCharCode(bn+32),Gy[bn]=String.fromCharCode(bn);for(var gE in bu)Gy.hasOwnProperty(gE)||(Gy[gE]=bu[gE]);function D0e(e){var t=L0e&&(e.ctrlKey||e.altKey||e.metaKey)||P0e&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Gy:bu)[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 j0e=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function q0e(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))j0e?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 U0e(e){let t=Object.create(null);for(let n in e)t[q0e(n)]=e[n];return t}function yE(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 B0e(e){return new Vr({props:{handleKeyDown:z0e(e)}})}function z0e(e){let t=U0e(e);return function(n,r){let i=D0e(r),o,a=t[yE(i,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let u=t[yE(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=bu[r.keyCode])&&o!=i){let u=t[yE(o,r)];if(u&&u(n.state,n.dispatch,n))return!0}}return!1}}const K0e=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function V0e(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const H0e=(e,t,n)=>{let r=V0e(e,n);if(!r)return!1;let i=D4(r);if(!i){let a=r.blockRange(),u=a&&uf(a);return u==null?!1:(t&&t(e.tr.lift(a,u).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&U4(e,i,t))return!0;if(r.parent.content.size==0&&(bf(o,"end")||be.isSelectable(o))){let a=jR(e.doc,r.before(),r.after(),ae.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(bf(o,"end")?Fe.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):be.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 bf(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 G0e=(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=D4(r)}let a=o&&o.nodeBefore;return!a||!be.isSelectable(a)?!1:(t&&t(e.tr.setSelection(be.create(e.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function D4(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 J0e(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const Y0e=(e,t,n)=>{let r=J0e(e,n);if(!r)return!1;let i=j4(r);if(!i)return!1;let o=i.nodeAfter;if(U4(e,i,t))return!0;if(r.parent.content.size==0&&(bf(o,"start")||be.isSelectable(o))){let a=jR(e.doc,r.before(),r.after(),ae.empty);if(a&&a.slice.size<a.to-a.from){if(t){let u=e.tr.step(a);u.setSelection(bf(o,"start")?Fe.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):be.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},Z0e=(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=j4(r)}let a=o&&o.nodeAfter;return!a||!be.isSelectable(a)?!1:(t&&t(e.tr.setSelection(be.create(e.doc,o.pos)).scrollIntoView()),!0)};function j4(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 X0e=(e,t)=>{let n=e.selection,r=n instanceof be,i;if(r){if(n.node.isTextblock||!cu(e.doc,n.from))return!1;i=n.from}else if(i=y3(e.doc,n.from,-1),i==null)return!1;if(t){let o=e.tr.join(i);r&&o.setSelection(be.create(o.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},Q0e=(e,t)=>{let n=e.selection,r;if(n instanceof be){if(n.node.isTextblock||!cu(e.doc,n.to))return!1;r=n.to}else if(r=y3(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},eIe=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&uf(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},tIe=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
40
|
+
`).scrollIntoView()),!0)};function q4(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 nIe=(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=q4(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(Fe.near(s.doc.resolve(u),1)),t(s.scrollIntoView())}return!0},rIe=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Ri||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=q4(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(Ue.create(u.doc,a+1)),t(u.scrollIntoView())}return!0},iIe=(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(sf(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&uf(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},oIe=(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(be.create(e.doc,i))),!0)};function aIe(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||cu(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function U4(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(aIe(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=B.empty;for(let v=o.length-1;v>=0;v--)d=B.from(o[v].create(null,d));d=B.from(r.copy(d));let p=e.tr.step(new tn(t.pos-1,f,t.pos,f,new ae(d,1,0),o.length,!0)),h=f+2*o.length;cu(p.doc,h)&&p.join(h),n(p.scrollIntoView())}return!0}let s=Fe.findFrom(t,1),c=s&&s.$from.blockRange(s.$to),l=c&&uf(c);if(l!=null&&l>=t.depth)return n&&n(e.tr.lift(c,l).scrollIntoView()),!0;if(u&&bf(i,"start",!0)&&bf(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=B.empty;for(let _=d.length-1;_>=0;_--)v=B.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 ae(v,d.length,0),0,!0));n(m.scrollIntoView())}return!0}}return!1}function B4(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(Ue.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const uIe=B4(-1),sIe=B4(1);function cIe(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,a=i.blockRange(o),u=a&&DR(a,e,t);return u?(r&&r(n.tr.wrap(a,u).scrollIntoView()),!0):!1}}function z4(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 lIe(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 ky(l,l,a.depth),a.endIndex<a.parent.childCount&&(a=new ky(i,n.doc.resolve(o.end(a.depth)),a.depth)),u=!0}let c=DR(s,e,t,a);return c?(r&&r(fIe(n.tr,a,c,u,e).scrollIntoView()),!0):!1}}function fIe(e,t,n,r,i){let o=B.empty;for(let l=n.length-1;l>=0;l--)o=B.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 ae(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&&sf(e.doc,s,u)&&(e.split(s,u),s+=2*u),s+=c.child(l).nodeSize;return e}function dIe(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?pIe(t,n,e,o):hIe(t,n,o):!0:!1}}function pIe(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 ae(B.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ky(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const u=uf(r);if(u==null)return!1;i.lift(r,u);let s=i.mapping.map(o,-1)-1;return cu(i.doc,s)&&i.join(s),t(i.scrollIntoView()),!0}function hIe(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?B.empty:B.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 ae((u?B.empty:B.from(i.copy(B.empty))).append(s?B.empty:B.from(i.copy(B.empty))),u?0:1,s?0:1),u?0:1)),t(r.scrollIntoView()),!0}function mIe(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=B.from(c?e.create():null),f=new ae(B.from(e.create(null,B.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 Jy(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 Yy{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:Jy({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 vIe{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 le(e,t,n){return e.config[t]===void 0&&e.parent?le(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?le(e.parent,t,n):null}):e.config[t]}function Zy(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 K4(e){const t=[],{nodeExtensions:n,markExtensions:r}=Zy(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=le(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=le(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 _n(...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 bE(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)=>_n(n,r),{})}function V4(e){return typeof e=="function"}function ke(e,t=void 0,...n){return V4(e)?t?e.bind(t)(...n):e(...n):e}function gIe(e={}){return Object.keys(e).length===0&&e.constructor===Object}function yIe(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function H4(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):yIe(n.getAttribute(a.name));return u==null?o:{...o,[a.name]:u}},{});return{...r,...i}}}}function G4(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&gIe(n)?!1:n!=null))}function J4(e){var t;const n=K4(e),{nodeExtensions:r,markExtensions:i}=Zy(e),o=(t=r.find(s=>le(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=le(_,"extendNodeSchema",l);return{...m,...g?g(s):{}}},{}),d=G4({...f,content:ke(le(s,"content",l)),marks:ke(le(s,"marks",l)),group:ke(le(s,"group",l)),inline:ke(le(s,"inline",l)),atom:ke(le(s,"atom",l)),selectable:ke(le(s,"selectable",l)),draggable:ke(le(s,"draggable",l)),code:ke(le(s,"code",l)),defining:ke(le(s,"defining",l)),isolating:ke(le(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=ke(le(s,"parseHTML",l));p&&(d.parseDOM=p.map(m=>H4(m,c)));const h=le(s,"renderHTML",l);h&&(d.toDOM=m=>h({node:m,HTMLAttributes:bE(m,c)}));const v=le(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 _=le(m,"extendMarkSchema",l);return{...v,..._?_(s):{}}},{}),d=G4({...f,inclusive:ke(le(s,"inclusive",l)),excludes:ke(le(s,"excludes",l)),group:ke(le(s,"group",l)),spanning:ke(le(s,"spanning",l)),code:ke(le(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=ke(le(s,"parseHTML",l));p&&(d.parseDOM=p.map(v=>H4(v,c)));const h=le(s,"renderHTML",l);return h&&(d.toDOM=v=>h({mark:v,HTMLAttributes:bE(v,c)})),[s.name,d]}));return new C$e({topNode:o,nodes:a,marks:u})}function _E(e,t){return t.nodes[e]||t.marks[e]||null}function Y4(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}const bIe=(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 SE(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class $E{constructor(t){this.find=t.find,this.handler=t.handler}}const _Ie=(e,t)=>{if(SE(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 TE(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=bIe(c)+o;return a.forEach(d=>{if(l)return;const p=_Ie(f,d.find);if(!p)return;const h=s.state.tr,v=Jy({state:s.state,transaction:h}),m={from:r-(p[0].length-o.length),to:i},{commands:_,chain:g,can:S}=new Yy({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 SIe(e){const{editor:t,rules:n}=e,r=new Vr({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 TE({editor:t,from:o,to:a,text:u,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&TE({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?TE({editor:t,from:a.pos,to:a.pos,text:`
|
|
41
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function $Ie(e){return typeof e=="number"}class TIe{constructor(t){this.find=t.find,this.handler=t.handler}}const IIe=(e,t)=>{if(SE(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 OIe(e){const{editor:t,state:n,from:r,to:i,rule:o}=e,{commands:a,chain:u,can:s}=new Yy({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,"");IIe(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 wIe(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1;return n.map(u=>new Vr({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(!$Ie(h)||!v||h===v.b)return;const m=l.tr,_=Jy({state:l,transaction:m});if(!(!OIe({editor:t,state:_,from:Math.max(h-1,0),to:v.b-1,rule:u})||!m.steps.length))return m}}))}function RIe(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return[...new Set(t)]}class ic{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=ic.resolve(t),this.schema=J4(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:_E(r.name,this.schema)};r.type==="mark"&&(!((i=ke(le(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const a=le(r,"onBeforeCreate",o);a&&this.editor.on("beforeCreate",a);const u=le(r,"onCreate",o);u&&this.editor.on("create",u);const s=le(r,"onUpdate",o);s&&this.editor.on("update",s);const c=le(r,"onSelectionUpdate",o);c&&this.editor.on("selectionUpdate",c);const l=le(r,"onTransaction",o);l&&this.editor.on("transaction",l);const f=le(r,"onFocus",o);f&&this.editor.on("focus",f);const d=le(r,"onBlur",o);d&&this.editor.on("blur",d);const p=le(r,"onDestroy",o);p&&this.editor.on("destroy",p)})}static resolve(t){const n=ic.sort(ic.flatten(t)),r=RIe(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=le(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(t){return t.sort((r,i)=>{const o=le(r,"priority")||100,a=le(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:_E(n.name,this.schema)},i=le(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){const{editor:t}=this,n=ic.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(a=>{const u={name:a.name,options:a.options,storage:a.storage,editor:t,type:_E(a.name,this.schema)},s=[],c=le(a,"addKeyboardShortcuts",u);let l={};if(a.type==="mark"&&a.config.exitable&&(l.ArrowRight=()=>kE.handleExit({editor:t,mark:a})),c){const v=Object.fromEntries(Object.entries(c()).map(([m,_])=>[m,()=>_({editor:t})]));l={...l,...v}}const f=B0e(l);s.push(f);const d=le(a,"addInputRules",u);Y4(a,t.options.enableInputRules)&&d&&r.push(...d());const p=le(a,"addPasteRules",u);Y4(a,t.options.enablePasteRules)&&p&&i.push(...p());const h=le(a,"addProseMirrorPlugins",u);if(h){const v=h();s.push(...v)}return s}).flat();return[SIe({editor:t,rules:r}),...wIe({editor:t,rules:i}),...o]}get attributes(){return K4(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=Zy(this.extensions);return Object.fromEntries(n.filter(r=>!!le(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=le(r,"addNodeView",o);if(!a)return[];const u=(s,c,l,f)=>{const d=bE(s,i);return a()({editor:t,node:s,getPos:l,decorations:f,HTMLAttributes:d,extension:r})};return[r.name,u]}))}}function EIe(e){return Object.prototype.toString.call(e).slice(8,-1)}function IE(e){return EIe(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Xy(e,t){const n={...e};return IE(e)&&IE(t)&&Object.keys(t).forEach(r=>{IE(t[r])?r in e?n[r]=Xy(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=ke(le(this,"addOptions",{name:this.name}))),this.storage=ke(le(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Rr(t)}configure(t={}){const n=this.extend();return n.options=Xy(this.options,t),n.storage=ke(le(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=ke(le(n,"addOptions",{name:n.name})),n.storage=ke(le(n,"addStorage",{name:n.name,options:n.options})),n}}function Z4(e,t,n){const{from:r,to:i}=t,{blockSeparator:o=`
|
|
42
|
+
|
|
43
|
+
`,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 X4(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const CIe=Rr.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Vr({key:new lu("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=X4(n);return Z4(r,{from:a,to:u},{textSerializers:s})}}})]}}),MIe=()=>({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),xIe=(e=!1)=>({commands:t})=>t.setContent("",e),kIe=()=>({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=uf(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},AIe=e=>t=>e(t),NIe=()=>({state:e,dispatch:t})=>rIe(e,t),FIe=()=>({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},WIe=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},PIe=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},LIe=()=>({state:e,dispatch:t})=>K0e(e,t),DIe=()=>({commands:e})=>e.keyboardShortcut("Enter"),jIe=()=>({state:e,dispatch:t})=>nIe(e,t);function Qy(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:SE(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function OE(e,t,n={}){return e.find(r=>r.type===t&&Qy(r.attrs,n))}function qIe(e,t,n={}){return!!OE(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=OE([...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(OE([...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&&qIe([...e.parent.child(u).marks],t,n);)s+=e.parent.child(u).nodeSize,u+=1;return{from:a,to:s}}function _u(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 UIe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=_u(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=Ue.create(a,f.from,f.to);n.setSelection(d)}}return!0},BIe=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 RE(e){return e instanceof Ue}function ma(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Q4(e,t=null){if(!t)return null;const n=Fe.atStart(e),r=Fe.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?Ue.create(e,ma(0,i,o),ma(e.content.size,i,o)):Ue.create(e,ma(t,i,o),ma(t,i,o))}function EE(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const zIe=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const a=()=>{EE()&&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&&!RE(n.state.selection))return a(),!0;const u=Q4(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},KIe=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),VIe=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t);function eH(e){const t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,"text/html").body}function eb(e,t,n){if(n={slice:!0,parseOptions:{},...n},typeof e=="object"&&e!==null)try{return Array.isArray(e)?B.fromArray(e.map(r=>t.nodeFromJSON(r))):t.nodeFromJSON(e)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),eb("",t,n)}if(typeof e=="string"){const r=of.fromSchema(t);return n.slice?r.parseSlice(eH(e),n.parseOptions).content:r.parse(eH(e),n.parseOptions)}return eb("",t,n)}function HIe(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof Rn||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(Fe.near(e.doc.resolve(a),n))}const GIe=e=>e.toString().startsWith("<"),JIe=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const a=eb(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((GIe(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&&HIe(r,r.steps.length-1,-1)}return!0},YIe=()=>({state:e,dispatch:t})=>X0e(e,t),ZIe=()=>({state:e,dispatch:t})=>Q0e(e,t),XIe=()=>({state:e,dispatch:t})=>H0e(e,t),QIe=()=>({state:e,dispatch:t})=>Y0e(e,t);function tH(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function eOe(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))EE()||tH()?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 tOe=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=eOe(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 Th(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=>Qy(f.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((f,d)=>f+d.to-d.from,0)>=s}const nOe=(e,t={})=>({state:n,dispatch:r})=>{const i=nn(e,n.schema);return Th(n,i,t)?eIe(n,r):!1},rOe=()=>({state:e,dispatch:t})=>iIe(e,t),iOe=e=>({state:t,dispatch:n})=>{const r=nn(e,t.schema);return dIe(r)(t,n)},oOe=()=>({state:e,dispatch:t})=>tIe(e,t);function tb(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function nH(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 aOe=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,a=null;const u=tb(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(o=nn(e,r.schema)),u==="mark"&&(a=_u(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,nH(c.attrs,t)),a&&c.marks.length&&c.marks.forEach(f=>{a===f.type&&n.addMark(l,l+c.nodeSize,a.create(nH(f.attrs,t)))})})}),!0):!1},uOe=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),sOe=()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),cOe=()=>({state:e,dispatch:t})=>G0e(e,t),lOe=()=>({state:e,dispatch:t})=>Z0e(e,t),fOe=()=>({state:e,dispatch:t})=>oIe(e,t),dOe=()=>({state:e,dispatch:t})=>sIe(e,t),pOe=()=>({state:e,dispatch:t})=>uIe(e,t);function rH(e,t,n={}){return eb(e,t,{slice:!1,parseOptions:n})}const hOe=(e,t=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,u=rH(e,i.schema,n);return o&&r.replaceWith(0,a.content.size,u).setMeta("preventUpdate",!t),!0};function mOe(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 vOe(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 CE(e){return t=>vOe(t.$from,e)}function gOe(e,t){const n=io.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function yOe(e){const t=ic.resolve(e);return J4(t)}function bOe(e,t){const n={from:0,to:e.content.size};return Z4(e,n,t)}function iH(e,t){const n=_u(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 _Oe(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 SOe(e,t){const n=tb(typeof t=="string"?t:t.name,e.schema);return n==="node"?_Oe(e,t):n==="mark"?iH(e,t):{}}function oH(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 ME(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?_u(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Qy(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=>Qy(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 $Oe(e,t,n={}){if(!t)return Th(e,null,n)||ME(e,null,n);const r=tb(t,e.schema);return r==="node"?Th(e,t,n):r==="mark"?ME(e,t,n):!1}function aH(e,t){const{nodeExtensions:n}=Zy(t),r=n.find(a=>a.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=ke(le(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function TOe(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 IOe(e){return e instanceof be}function OOe(e,t,n){const i=e.state.doc.content.size,o=ma(t,0,i),a=ma(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(RE(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 ROe=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:a,ranges:u}=o,s=_u(e,r.schema);if(i)if(a){const c=iH(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)},EOe=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),COe=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=nn(e,n.schema);return o.isTextblock?i().command(({commands:a})=>z4(o,t)(n)?!0:a.clearNodes()).command(({state:a})=>z4(o,t)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},MOe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=ma(e,0,r.content.size),o=be.create(r,i);t.setSelection(o)}return!0},xOe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,a=Ue.atStart(r).from,u=Ue.atEnd(r).to,s=ma(i,a,u),c=ma(o,a,u),l=Ue.create(r,s,c);t.setSelection(l)}return!0},kOe=e=>({state:t,dispatch:n})=>{const r=nn(e,t.schema);return mIe(r)(t,n)};function nb(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 uH(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 AOe=({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=nb(c,u.node().type.name,u.node().attrs);if(o instanceof be&&o.node.isBlock)return!u.parentOffset||!sf(a,u.pos)?!1:(r&&(e&&uH(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 Ue&&t.deleteSelection();const d=u.depth===0?void 0:mOe(u.node(-1).contentMatchAt(u.indexAfter(-1)));let p=f&&d?[{type:d,attrs:l}]:void 0,h=sf(t.doc,t.mapping.map(u.pos),1,p);if(!p&&!h&&sf(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&&uH(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0},NOe=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=B.empty;const _=u.index(-1)?1:u.index(-2)?2:3;for(let C=u.depth-_;C>=u.depth-3;C-=1)m=B.from(u.node(C).copy(m));const g=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,S=nb(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(B.from(a.createAndFill(null,b)||void 0));const $=u.before(u.depth-(_-1));t.replace($,u.after(-g),new ae(m,4-_,0));let T=-1;t.doc.nodesBetween($,t.doc.content.size,(C,R)=>{if(T>-1)return!1;C.isTextblock&&C.content.size===0&&(T=R+1)}),T>-1&&t.setSelection(Ue.near(t.doc.resolve(T))),t.scrollIntoView()}return!0}const d=s.pos===u.end()?l.contentMatchAt(0).defaultType:null,p=nb(f,l.type.name,l.attrs),h=nb(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 sf(t.doc,u.pos,2)?(r&&t.split(u.pos,2,v).scrollIntoView(),!0):!1},sH=(e,t)=>{const n=CE(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)&&cu(e.doc,n.pos)&&e.join(n.pos),!0},cH=(e,t)=>{const n=CE(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)&&cu(e.doc,r)&&e.join(r),!0};var FOe=Object.freeze({__proto__:null,blur:MIe,clearContent:xIe,clearNodes:kIe,command:AIe,createParagraphNear:NIe,deleteCurrentNode:FIe,deleteNode:WIe,deleteRange:PIe,deleteSelection:LIe,enter:DIe,exitCode:jIe,extendMarkRange:UIe,first:BIe,focus:zIe,forEach:KIe,insertContent:VIe,insertContentAt:JIe,joinUp:YIe,joinDown:ZIe,joinBackward:XIe,joinForward:QIe,keyboardShortcut:tOe,lift:nOe,liftEmptyBlock:rOe,liftListItem:iOe,newlineInCode:oOe,resetAttributes:aOe,scrollIntoView:uOe,selectAll:sOe,selectNodeBackward:cOe,selectNodeForward:lOe,selectParentNode:fOe,selectTextblockEnd:dOe,selectTextblockStart:pOe,setContent:hOe,setMark:ROe,setMeta:EOe,setNode:COe,setNodeSelection:MOe,setTextSelection:xOe,sinkListItem:kOe,splitBlock:AOe,splitListItem:NOe,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=CE(_=>aH(_.type.name,c))(d);if(v.depth>=1&&m&&v.depth-m.depth<=1){if(m.node.type===l)return u.liftListItem(f);if(aH(m.node.type.name,c)&&l.validContent(m.node.content)&&o)return a().command(()=>(r.setNodeMarkup(m.pos,l),!0)).command(()=>sH(r,l)).command(()=>cH(r,l)).run()}return a().command(()=>s().wrapInList(l)?!0:u.clearNodes()).wrapInList(l).command(()=>sH(r,l)).command(()=>cH(r,l)).run()},toggleMark:(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,a=_u(e,r.schema);return ME(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 Th(r,o,n)?i.setNode(a):i.setNode(o,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const i=nn(e,n.schema);return Th(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=_u(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=tb(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(o=nn(e,r.schema)),u==="mark"&&(a=_u(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 cIe(i,t)(n,r)},wrapInList:(e,t={})=>({state:n,dispatch:r})=>{const i=nn(e,n.schema);return lIe(i,t)(n,r)}});const WOe=Rr.create({name:"commands",addCommands(){return{...FOe}}}),POe=Rr.create({name:"editable",addProseMirrorPlugins(){return[new Vr({key:new lu("editable"),props:{editable:()=>this.editor.options.editable}})]}}),LOe=Rr.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Vr({key:new lu("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}}}})]}}),DOe=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=Fe.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 EE()||tH()?o:i},addProseMirrorPlugins(){return[new Vr({key:new lu("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=Fe.atStart(t.doc).from,s=Fe.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=Jy({state:n,transaction:f}),{commands:p}=new Yy({editor:this.editor,state:d});if(p.clearNodes(),!!f.steps.length)return f}})]}}),jOe=Rr.create({name:"tabindex",addProseMirrorPlugins(){return[new Vr({key:new lu("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var qOe=Object.freeze({__proto__:null,ClipboardTextSerializer:CIe,Commands:WOe,Editable:POe,FocusEvents:LOe,Keymap:DOe,Tabindex:jOe});const UOe=`.ProseMirror {
|
|
44
44
|
position: relative;
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -114,35 +114,35 @@ img.ProseMirror-separator {
|
|
|
114
114
|
|
|
115
115
|
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
116
116
|
opacity: 0
|
|
117
|
-
}`;function
|
|
117
|
+
}`;function BOe(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 zOe=class extends vIe{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=BOe(UOe,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=V4(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(qOe):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new ic(n,this)}createCommandManager(){this.commandManager=new Yy({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const t=rH(this.options.content,this.schema,this.options.parseOptions),n=Q4(t,this.options.autofocus);this.view=new A0e(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:df.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 SOe(this.state,t)}isActive(t,n){const r=typeof t=="string"?t:null,i=typeof t=="string"?n:t;return $Oe(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return gOe(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:n=`
|
|
118
118
|
|
|
119
|
-
`,textSerializers:r={}}=t||{};return KMe(this.state.doc,{blockSeparator:n,textSerializers:{...r,...q4(this.schema)}})}get isEmpty(){return HMe(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 ZMe(e){const t=Pc.resolve(e);return U4(t)}function n5(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e-1),a=PM(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 XMe(e){return e instanceof ve}function QMe(e,t,n){const i=e.state.doc.content.size,o=Ia(t,0,i),a=Ia(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,b={top:c,bottom:l,left:f,right:d,width:p,height:h,x:f,y:c};return{...b,toJSON:()=>b}}function A_(e){return new kM({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Ee(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(n5(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 LM(e){return new kM({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=Ee(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 r5(e){return new kM({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Ee(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),u=o.doc.resolve(n.from).blockRange(),s=u&&rRe(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&&RM(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&o.join(n.from-1)}})}class sd{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=Ee(ue(this,"addOptions",{name:this.name}))),this.storage=Ee(ue(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new sd(t)}configure(t={}){const n=this.extend();return n.options=E_(this.options,t),n.storage=Ee(ue(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new sd(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=Ee(ue(n,"addOptions",{name:n.name})),n.storage=Ee(ue(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 wr{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=Ee(ue(this,"addOptions",{name:this.name}))),this.storage=Ee(ue(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new wr(t)}configure(t={}){const n=this.extend();return n.options=E_(this.options,t),n.storage=Ee(ue(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new wr(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=Ee(ue(n,"addOptions",{name:n.name})),n.storage=Ee(ue(n,"addStorage",{name:n.name,options:n.options})),n}}class eCe{constructor(t,n,r){this.isDragging=!1,this.component=t,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var n,r,i,o,a,u,s;const{view:c}=this.editor,l=t.target,f=l.nodeType===3?(n=l.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):l.closest("[data-drag-handle]");if(!this.dom||((r=this.contentDOM)===null||r===void 0?void 0:r.contains(l))||!f)return;let d=0,p=0;if(this.dom!==f){const y=this.dom.getBoundingClientRect(),b=f.getBoundingClientRect(),w=(i=t.offsetX)!==null&&i!==void 0?i:(o=t.nativeEvent)===null||o===void 0?void 0:o.offsetX,F=(a=t.offsetY)!==null&&a!==void 0?a:(u=t.nativeEvent)===null||u===void 0?void 0:u.offsetY;d=b.x-y.x+w,p=b.y-y.y+F}(s=t.dataTransfer)===null||s===void 0||s.setDragImage(this.dom,d,p);const h=ve.create(c.state.doc,this.getPos()),v=c.state.tr.setSelection(h);c.dispatch(v)}stopEvent(t){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:t});const r=t.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const o=t.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o)return!0;const{isEditable:u}=this.editor,{isDragging:s}=this,c=!!this.node.type.spec.draggable,l=ve.isSelectable(this.node),f=t.type==="copy",d=t.type==="paste",p=t.type==="cut",h=t.type==="mousedown",v=t.type.startsWith("drag");if(!c&&l&&v&&t.preventDefault(),c&&v&&!s)return t.preventDefault(),!1;if(c&&u&&!s&&h){const y=r.closest("[data-drag-handle]");y&&(this.dom===y||this.dom.contains(y))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(s||o||f||d||p||h&&l)}ignoreMutation(t){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:t}):this.node.isLeaf||this.node.isAtom?!0:t.type==="selection"||this.dom.contains(t.target)&&t.type==="childList"&&M_()&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===t.target&&t.type==="attributes"?!0:!this.contentDOM.contains(t.target)}updateAttributes(t){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return n.setNodeMarkup(r,void 0,{...this.node.attrs,...t}),!0})}deleteNode(){const t=this.getPos(),n=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:n})}}function W_(e){return new NRe({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Ee(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(n5(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 tCe(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var ir="top",Jr="bottom",Gr="right",or="left",N_="auto",bm=[ir,Jr,Gr,or],cd="start",_m="end",nCe="clippingParents",i5="viewport",$m="popper",rCe="reference",o5=bm.reduce(function(e,t){return e.concat([t+"-"+cd,t+"-"+_m])},[]),a5=[].concat(bm,[N_]).reduce(function(e,t){return e.concat([t,t+"-"+cd,t+"-"+_m])},[]),iCe="beforeRead",oCe="read",aCe="afterRead",uCe="beforeMain",sCe="main",cCe="afterMain",lCe="beforeWrite",fCe="write",dCe="afterWrite",jM=[iCe,oCe,aCe,uCe,sCe,cCe,lCe,fCe,dCe];function mo(e){return e?(e.nodeName||"").toLowerCase():null}function Yr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Fc(e){var t=Yr(e).Element;return e instanceof t||e instanceof Element}function Er(e){var t=Yr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function UM(e){if(typeof ShadowRoot>"u")return!1;var t=Yr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function pCe(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];!Er(o)||!mo(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 hCe(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},{});!Er(i)||!mo(i)||(Object.assign(i.style,u),Object.keys(o).forEach(function(s){i.removeAttribute(s)}))})}}const u5={name:"applyStyles",enabled:!0,phase:"write",fn:pCe,effect:hCe,requires:["computeStyles"]};function xi(e){return e.split("-")[0]}var Dc=Math.max,P_=Math.min,ld=Math.round;function BM(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function s5(){return!/^((?!chrome|android).)*safari/i.test(BM())}function fd(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Er(e)&&(i=e.offsetWidth>0&&ld(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&ld(r.height)/e.offsetHeight||1);var a=Fc(e)?Yr(e):window,u=a.visualViewport,s=!s5()&&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 zM(e){var t=fd(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 c5(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&UM(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ki(e){return Yr(e).getComputedStyle(e)}function mCe(e){return["table","td","th"].indexOf(mo(e))>=0}function qu(e){return((Fc(e)?e.ownerDocument:e.document)||window.document).documentElement}function F_(e){return mo(e)==="html"?e:e.assignedSlot||e.parentNode||(UM(e)?e.host:null)||qu(e)}function l5(e){return!Er(e)||ki(e).position==="fixed"?null:e.offsetParent}function vCe(e){var t=/firefox/i.test(BM()),n=/Trident/i.test(BM());if(n&&Er(e)){var r=ki(e);if(r.position==="fixed")return null}var i=F_(e);for(UM(i)&&(i=i.host);Er(i)&&["html","body"].indexOf(mo(i))<0;){var o=ki(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 Sm(e){for(var t=Yr(e),n=l5(e);n&&mCe(n)&&ki(n).position==="static";)n=l5(n);return n&&(mo(n)==="html"||mo(n)==="body"&&ki(n).position==="static")?t:n||vCe(e)||t}function qM(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Tm(e,t,n){return Dc(e,P_(t,n))}function gCe(e,t,n){var r=Tm(e,t,n);return r>n?n:r}function f5(){return{top:0,right:0,bottom:0,left:0}}function d5(e){return Object.assign({},f5(),e)}function p5(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var yCe=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,d5(typeof t!="number"?t:p5(t,bm))};function bCe(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,u=xi(n.placement),s=qM(u),c=[or,Gr].indexOf(u)>=0,l=c?"height":"width";if(!(!o||!a)){var f=yCe(i.padding,n),d=zM(o),p=s==="y"?ir:or,h=s==="y"?Jr:Gr,v=n.rects.reference[l]+n.rects.reference[s]-a[s]-n.rects.popper[l],y=a[s]-n.rects.reference[s],b=Sm(o),w=b?s==="y"?b.clientHeight||0:b.clientWidth||0:0,F=v/2-y/2,g=f[p],T=w-d[l]-f[h],I=w/2-d[l]/2+F,W=Tm(g,I,T),E=s;n.modifiersData[r]=(t={},t[E]=W,t.centerOffset=W-I,t)}}function _Ce(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"&&(Er(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(" "))),!c5(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 $Ce={name:"arrow",enabled:!0,phase:"main",fn:bCe,effect:_Ce,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function dd(e){return e.split("-")[1]}var SCe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function TCe(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:ld(t*i)/i||0,y:ld(n*i)/i||0}}function h5(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,y=typeof l=="function"?l({x:p,y:v}):{x:p,y:v};p=y.x,v=y.y;var b=a.hasOwnProperty("x"),w=a.hasOwnProperty("y"),F=or,g=ir,T=window;if(c){var I=Sm(n),W="clientHeight",E="clientWidth";if(I===Yr(n)&&(I=qu(n),ki(I).position!=="static"&&u==="absolute"&&(W="scrollHeight",E="scrollWidth")),I=I,i===ir||(i===or||i===Gr)&&o===_m){g=Jr;var J=f&&I===T&&T.visualViewport?T.visualViewport.height:I[W];v-=J-r.height,v*=s?1:-1}if(i===or||(i===ir||i===Jr)&&o===_m){F=Gr;var q=f&&I===T&&T.visualViewport?T.visualViewport.width:I[E];p-=q-r.width,p*=s?1:-1}}var x=Object.assign({position:u},c&&SCe),G=l===!0?TCe({x:p,y:v}):{x:p,y:v};if(p=G.x,v=G.y,s){var O;return Object.assign({},x,(O={},O[g]=w?"0":"",O[F]=b?"0":"",O.transform=(T.devicePixelRatio||1)<=1?"translate("+p+"px, "+v+"px)":"translate3d("+p+"px, "+v+"px, 0)",O))}return Object.assign({},x,(t={},t[g]=w?v+"px":"",t[F]=b?p+"px":"",t.transform="",t))}function ICe(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=ki(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".',`
|
|
119
|
+
`,textSerializers:r={}}=t||{};return bOe(this.state.doc,{blockSeparator:n,textSerializers:{...r,...X4(this.schema)}})}get isEmpty(){return TOe(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 rb(e){return new $E({find:e.find,handler:({state:t,range:n,match:r})=>{const i=ke(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(oH(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 xE(e){return new $E({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=ke(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 lH(e){return new $E({find:e.find,handler:({state:t,range:n,match:r})=>{const i=ke(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),u=o.doc.resolve(n.from).blockRange(),s=u&&DR(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&&cu(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&o.join(n.from-1)}})}let kE=class RC{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=ke(le(this,"addOptions",{name:this.name}))),this.storage=ke(le(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new RC(t)}configure(t={}){const n=this.extend();return n.options=Xy(this.options,t),n.storage=ke(le(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new RC(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=ke(le(n,"addOptions",{name:n.name})),n.storage=ke(le(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 Gr{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=ke(le(this,"addOptions",{name:this.name}))),this.storage=ke(le(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Gr(t)}configure(t={}){const n=this.extend();return n.options=Xy(this.options,t),n.storage=ke(le(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Gr(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=ke(le(n,"addOptions",{name:n.name})),n.storage=ke(le(n,"addStorage",{name:n.name,options:n.options})),n}}function ib(e){return new TIe({find:e.find,handler:({state:t,range:n,match:r})=>{const i=ke(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(oH(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 KOe(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var sr="top",Jr="bottom",Yr="right",cr="left",ob="auto",Ih=[sr,Jr,Yr,cr],_f="start",Oh="end",VOe="clippingParents",fH="viewport",wh="popper",HOe="reference",dH=Ih.reduce(function(e,t){return e.concat([t+"-"+_f,t+"-"+Oh])},[]),pH=[].concat(Ih,[ob]).reduce(function(e,t){return e.concat([t,t+"-"+_f,t+"-"+Oh])},[]),GOe="beforeRead",JOe="read",YOe="afterRead",ZOe="beforeMain",XOe="main",QOe="afterMain",e1e="beforeWrite",t1e="write",n1e="afterWrite",AE=[GOe,JOe,YOe,ZOe,XOe,QOe,e1e,t1e,n1e];function so(e){return e?(e.nodeName||"").toLowerCase():null}function Zr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function oc(e){var t=Zr(e).Element;return e instanceof t||e instanceof Element}function Er(e){var t=Zr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function NE(e){if(typeof ShadowRoot>"u")return!1;var t=Zr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function r1e(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];!Er(o)||!so(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 i1e(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},{});!Er(i)||!so(i)||(Object.assign(i.style,u),Object.keys(o).forEach(function(s){i.removeAttribute(s)}))})}}const hH={name:"applyStyles",enabled:!0,phase:"write",fn:r1e,effect:i1e,requires:["computeStyles"]};function xi(e){return e.split("-")[0]}var ac=Math.max,ab=Math.min,Sf=Math.round;function FE(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function mH(){return!/^((?!chrome|android).)*safari/i.test(FE())}function $f(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Er(e)&&(i=e.offsetWidth>0&&Sf(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Sf(r.height)/e.offsetHeight||1);var a=oc(e)?Zr(e):window,u=a.visualViewport,s=!mH()&&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 WE(e){var t=$f(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 vH(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&NE(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ki(e){return Zr(e).getComputedStyle(e)}function o1e(e){return["table","td","th"].indexOf(so(e))>=0}function Su(e){return((oc(e)?e.ownerDocument:e.document)||window.document).documentElement}function ub(e){return so(e)==="html"?e:e.assignedSlot||e.parentNode||(NE(e)?e.host:null)||Su(e)}function gH(e){return!Er(e)||ki(e).position==="fixed"?null:e.offsetParent}function a1e(e){var t=/firefox/i.test(FE()),n=/Trident/i.test(FE());if(n&&Er(e)){var r=ki(e);if(r.position==="fixed")return null}var i=ub(e);for(NE(i)&&(i=i.host);Er(i)&&["html","body"].indexOf(so(i))<0;){var o=ki(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 Rh(e){for(var t=Zr(e),n=gH(e);n&&o1e(n)&&ki(n).position==="static";)n=gH(n);return n&&(so(n)==="html"||so(n)==="body"&&ki(n).position==="static")?t:n||a1e(e)||t}function PE(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Eh(e,t,n){return ac(e,ab(t,n))}function u1e(e,t,n){var r=Eh(e,t,n);return r>n?n:r}function yH(){return{top:0,right:0,bottom:0,left:0}}function bH(e){return Object.assign({},yH(),e)}function _H(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var s1e=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,bH(typeof t!="number"?t:_H(t,Ih))};function c1e(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,u=xi(n.placement),s=PE(u),c=[cr,Yr].indexOf(u)>=0,l=c?"height":"width";if(!(!o||!a)){var f=s1e(i.padding,n),d=WE(o),p=s==="y"?sr:cr,h=s==="y"?Jr:Yr,v=n.rects.reference[l]+n.rects.reference[s]-a[s]-n.rects.popper[l],m=a[s]-n.rects.reference[s],_=Rh(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,C=Eh(b,T,$),R=s;n.modifiersData[r]=(t={},t[R]=C,t.centerOffset=C-T,t)}}function l1e(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"&&(Er(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(" "))),!vH(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 f1e={name:"arrow",enabled:!0,phase:"main",fn:c1e,effect:l1e,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Tf(e){return e.split("-")[1]}var d1e={top:"auto",right:"auto",bottom:"auto",left:"auto"};function p1e(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:Sf(t*i)/i||0,y:Sf(n*i)/i||0}}function SH(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=cr,b=sr,$=window;if(c){var T=Rh(n),C="clientHeight",R="clientWidth";if(T===Zr(n)&&(T=Su(n),ki(T).position!=="static"&&u==="absolute"&&(C="scrollHeight",R="scrollWidth")),T=T,i===sr||(i===cr||i===Yr)&&o===Oh){b=Jr;var q=f&&T===$&&$.visualViewport?$.visualViewport.height:T[C];v-=q-r.height,v*=s?1:-1}if(i===cr||(i===sr||i===Jr)&&o===Oh){S=Yr;var G=f&&T===$&&$.visualViewport?$.visualViewport.width:T[R];p-=G-r.width,p*=s?1:-1}}var A=Object.assign({position:u},c&&d1e),Y=l===!0?p1e({x:p,y:v}):{x:p,y:v};if(p=Y.x,v=Y.y,s){var ie;return Object.assign({},A,(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({},A,(t={},t[b]=g?v+"px":"",t[S]=_?p+"px":"",t.transform="",t))}function h1e(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=ki(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".',`
|
|
120
120
|
|
|
121
121
|
`,'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.",`
|
|
122
122
|
|
|
123
|
-
`,"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:xi(t.placement),variation:dd(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,h5(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,h5(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 OCe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ICe,data:{}};var D_={passive:!0};function wCe(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=Yr(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(l){l.addEventListener("scroll",n.update,D_)}),u&&s.addEventListener("resize",n.update,D_),function(){o&&c.forEach(function(l){l.removeEventListener("scroll",n.update,D_)}),u&&s.removeEventListener("resize",n.update,D_)}}const ECe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:wCe,data:{}};var RCe={left:"right",right:"left",bottom:"top",top:"bottom"};function L_(e){return e.replace(/left|right|bottom|top/g,function(t){return RCe[t]})}var MCe={start:"end",end:"start"};function m5(e){return e.replace(/start|end/g,function(t){return MCe[t]})}function KM(e){var t=Yr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function VM(e){return fd(qu(e)).left+KM(e).scrollLeft}function CCe(e,t){var n=Yr(e),r=qu(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,u=0,s=0;if(i){o=i.width,a=i.height;var c=s5();(c||!c&&t==="fixed")&&(u=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:u+VM(e),y:s}}function xCe(e){var t,n=qu(e),r=KM(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=Dc(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Dc(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+VM(e),s=-r.scrollTop;return ki(i||n).direction==="rtl"&&(u+=Dc(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:u,y:s}}function HM(e){var t=ki(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function v5(e){return["html","body","#document"].indexOf(mo(e))>=0?e.ownerDocument.body:Er(e)&&HM(e)?e:v5(F_(e))}function Im(e,t){var n;t===void 0&&(t=[]);var r=v5(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Yr(r),a=i?[o].concat(o.visualViewport||[],HM(r)?r:[]):r,u=t.concat(a);return i?u:u.concat(Im(F_(a)))}function JM(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function kCe(e,t){var n=fd(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 g5(e,t,n){return t===i5?JM(CCe(e,n)):Fc(t)?kCe(t,n):JM(xCe(qu(e)))}function ACe(e){var t=Im(F_(e)),n=["absolute","fixed"].indexOf(ki(e).position)>=0,r=n&&Er(e)?Sm(e):e;return Fc(r)?t.filter(function(i){return Fc(i)&&c5(i,r)&&mo(i)!=="body"}):[]}function WCe(e,t,n,r){var i=t==="clippingParents"?ACe(e):[].concat(t),o=[].concat(i,[n]),a=o[0],u=o.reduce(function(s,c){var l=g5(e,c,r);return s.top=Dc(l.top,s.top),s.right=P_(l.right,s.right),s.bottom=P_(l.bottom,s.bottom),s.left=Dc(l.left,s.left),s},g5(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 y5(e){var t=e.reference,n=e.element,r=e.placement,i=r?xi(r):null,o=r?dd(r):null,a=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,s;switch(i){case ir:s={x:a,y:t.y-n.height};break;case Jr:s={x:a,y:t.y+t.height};break;case Gr:s={x:t.x+t.width,y:u};break;case or:s={x:t.x-n.width,y:u};break;default:s={x:t.x,y:t.y}}var c=i?qM(i):null;if(c!=null){var l=c==="y"?"height":"width";switch(o){case cd:s[c]=s[c]-(t[l]/2-n[l]/2);break;case _m:s[c]=s[c]+(t[l]/2-n[l]/2);break}}return s}function Om(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?nCe:u,c=n.rootBoundary,l=c===void 0?i5:c,f=n.elementContext,d=f===void 0?$m:f,p=n.altBoundary,h=p===void 0?!1:p,v=n.padding,y=v===void 0?0:v,b=d5(typeof y!="number"?y:p5(y,bm)),w=d===$m?rCe:$m,F=e.rects.popper,g=e.elements[h?w:d],T=WCe(Fc(g)?g:g.contextElement||qu(e.elements.popper),s,l,a),I=fd(e.elements.reference),W=y5({reference:I,element:F,strategy:"absolute",placement:i}),E=JM(Object.assign({},F,W)),J=d===$m?E:I,q={top:T.top-J.top+b.top,bottom:J.bottom-T.bottom+b.bottom,left:T.left-J.left+b.left,right:J.right-T.right+b.right},x=e.modifiersData.offset;if(d===$m&&x){var G=x[i];Object.keys(q).forEach(function(O){var R=[Gr,Jr].indexOf(O)>=0?1:-1,k=[ir,Jr].indexOf(O)>=0?"y":"x";q[O]+=G[k]*R})}return q}function NCe(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?a5:s,l=dd(r),f=l?u?o5:o5.filter(function(h){return dd(h)===l}):bm,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]=Om(e,{placement:v,boundary:i,rootBoundary:o,padding:a})[xi(v)],h},{});return Object.keys(p).sort(function(h,v){return p[h]-p[v]})}function PCe(e){if(xi(e)===N_)return[];var t=L_(e);return[m5(e),t,m5(t)]}function FCe(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,y=t.options.placement,b=xi(y),w=b===y,F=s||(w||!h?[L_(y)]:PCe(y)),g=[y].concat(F).reduce(function(he,Te){return he.concat(xi(Te)===N_?NCe(t,{placement:Te,boundary:l,rootBoundary:f,padding:c,flipVariations:h,allowedAutoPlacements:v}):Te)},[]),T=t.rects.reference,I=t.rects.popper,W=new Map,E=!0,J=g[0],q=0;q<g.length;q++){var x=g[q],G=xi(x),O=dd(x)===cd,R=[ir,Jr].indexOf(G)>=0,k=R?"width":"height",L=Om(t,{placement:x,boundary:l,rootBoundary:f,altBoundary:d,padding:c}),z=R?O?Gr:or:O?Jr:ir;T[k]>I[k]&&(z=L_(z));var j=L_(z),S=[];if(o&&S.push(L[G]<=0),u&&S.push(L[z]<=0,L[j]<=0),S.every(function(he){return he})){J=x,E=!1;break}W.set(x,S)}if(E)for(var $=h?3:1,U=function(Te){var et=g.find(function(Ft){var Jt=W.get(Ft);if(Jt)return Jt.slice(0,Te).every(function(Zr){return Zr})});if(et)return J=et,"break"},Z=$;Z>0;Z--){var ge=U(Z);if(ge==="break")break}t.placement!==J&&(t.modifiersData[r]._skip=!0,t.placement=J,t.reset=!0)}}const DCe={name:"flip",enabled:!0,phase:"main",fn:FCe,requiresIfExists:["offset"],data:{_skip:!1}};function b5(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 _5(e){return[ir,Gr,Jr,or].some(function(t){return e[t]>=0})}function LCe(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Om(t,{elementContext:"reference"}),u=Om(t,{altBoundary:!0}),s=b5(a,r),c=b5(u,i,o),l=_5(s),f=_5(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 jCe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:LCe};function UCe(e,t,n){var r=xi(e),i=[or,ir].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,[or,Gr].indexOf(r)>=0?{x:u,y:a}:{x:a,y:u}}function BCe(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=a5.reduce(function(l,f){return l[f]=UCe(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 zCe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:BCe};function qCe(e){var t=e.state,n=e.name;t.modifiersData[n]=y5({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const KCe={name:"popperOffsets",enabled:!0,phase:"read",fn:qCe,data:{}};function VCe(e){return e==="x"?"y":"x"}function HCe(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,y=Om(t,{boundary:s,rootBoundary:c,padding:f,altBoundary:l}),b=xi(t.placement),w=dd(t.placement),F=!w,g=qM(b),T=VCe(g),I=t.modifiersData.popperOffsets,W=t.rects.reference,E=t.rects.popper,J=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,q=typeof J=="number"?{mainAxis:J,altAxis:J}:Object.assign({mainAxis:0,altAxis:0},J),x=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,G={x:0,y:0};if(!!I){if(o){var O,R=g==="y"?ir:or,k=g==="y"?Jr:Gr,L=g==="y"?"height":"width",z=I[g],j=z+y[R],S=z-y[k],$=p?-E[L]/2:0,U=w===cd?W[L]:E[L],Z=w===cd?-E[L]:-W[L],ge=t.elements.arrow,he=p&&ge?zM(ge):{width:0,height:0},Te=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:f5(),et=Te[R],Ft=Te[k],Jt=Tm(0,W[L],he[L]),Zr=F?W[L]/2-$-Jt-et-q.mainAxis:U-Jt-et-q.mainAxis,Nn=F?-W[L]/2+$+Jt+Ft+q.mainAxis:Z+Jt+Ft+q.mainAxis,bo=t.elements.arrow&&Sm(t.elements.arrow),xa=bo?g==="y"?bo.clientTop||0:bo.clientLeft||0:0,ka=(O=x==null?void 0:x[g])!=null?O:0,Xu=z+Zr-ka-xa,Wi=z+Nn-ka,Xr=Tm(p?P_(j,Xu):j,z,p?Dc(S,Wi):S);I[g]=Xr,G[g]=Xr-z}if(u){var _o,Aa=g==="x"?ir:or,Ni=g==="x"?Jr:Gr,ar=I[T],Qr=T==="y"?"height":"width",Pi=ar+y[Aa],Fi=ar-y[Ni],Wa=[ir,or].indexOf(b)!==-1,Na=(_o=x==null?void 0:x[T])!=null?_o:0,Pa=Wa?Pi:ar-W[Qr]-E[Qr]-Na+q.altAxis,ei=Wa?ar+W[Qr]+E[Qr]-Na-q.altAxis:Fi,Qu=p&&Wa?gCe(Pa,ar,ei):Tm(p?Pa:Pi,ar,p?ei:Fi);I[T]=Qu,G[T]=Qu-ar}t.modifiersData[r]=G}}const JCe={name:"preventOverflow",enabled:!0,phase:"main",fn:HCe,requiresIfExists:["offset"]};function GCe(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function YCe(e){return e===Yr(e)||!Er(e)?KM(e):GCe(e)}function ZCe(e){var t=e.getBoundingClientRect(),n=ld(t.width)/e.offsetWidth||1,r=ld(t.height)/e.offsetHeight||1;return n!==1||r!==1}function XCe(e,t,n){n===void 0&&(n=!1);var r=Er(t),i=Er(t)&&ZCe(t),o=qu(t),a=fd(e,i,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(r||!r&&!n)&&((mo(t)!=="body"||HM(o))&&(u=YCe(t)),Er(t)?(s=fd(t,!0),s.x+=t.clientLeft,s.y+=t.clientTop):o&&(s.x=VM(o))),{x:a.left+u.scrollLeft-s.x,y:a.top+u.scrollTop-s.y,width:a.width,height:a.height}}function QCe(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 exe(e){var t=QCe(e);return jM.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function txe(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Ku(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 Lc='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',nxe='Popper: modifier "%s" requires "%s", but "%s" modifier is not available',$5=["name","enabled","phase","fn","effect","requires","options"];function rxe(e){e.forEach(function(t){[].concat(Object.keys(t),$5).filter(function(n,r,i){return i.indexOf(n)===r}).forEach(function(n){switch(n){case"name":typeof t.name!="string"&&console.error(Ku(Lc,String(t.name),'"name"','"string"','"'+String(t.name)+'"'));break;case"enabled":typeof t.enabled!="boolean"&&console.error(Ku(Lc,t.name,'"enabled"','"boolean"','"'+String(t.enabled)+'"'));break;case"phase":jM.indexOf(t.phase)<0&&console.error(Ku(Lc,t.name,'"phase"',"either "+jM.join(", "),'"'+String(t.phase)+'"'));break;case"fn":typeof t.fn!="function"&&console.error(Ku(Lc,t.name,'"fn"','"function"','"'+String(t.fn)+'"'));break;case"effect":t.effect!=null&&typeof t.effect!="function"&&console.error(Ku(Lc,t.name,'"effect"','"function"','"'+String(t.fn)+'"'));break;case"requires":t.requires!=null&&!Array.isArray(t.requires)&&console.error(Ku(Lc,t.name,'"requires"','"array"','"'+String(t.requires)+'"'));break;case"requiresIfExists":Array.isArray(t.requiresIfExists)||console.error(Ku(Lc,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 '+$5.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(Ku(nxe,String(t.name),r,r))})})})}function ixe(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 oxe(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 S5="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",axe="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",T5={placement:"bottom",modifiers:[],strategy:"absolute"};function I5(){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 uxe(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?T5:i;return function(u,s,c){c===void 0&&(c=o);var l={placement:"bottom",orderedModifiers:[],options:Object.assign({},T5,o),modifiersData:{},elements:{reference:u,popper:s},attributes:{},styles:{}},f=[],d=!1,p={state:l,setOptions:function(b){var w=typeof b=="function"?b(l.options):b;v(),l.options=Object.assign({},o,l.options,w),l.scrollParents={reference:Fc(u)?Im(u):u.contextElement?Im(u.contextElement):[],popper:Im(s)};var F=exe(oxe([].concat(r,l.options.modifiers)));if(l.orderedModifiers=F.filter(function(x){return x.enabled}),process.env.NODE_ENV!=="production"){var g=ixe([].concat(F,l.options.modifiers),function(x){var G=x.name;return G});if(rxe(g),xi(l.options.placement)===N_){var T=l.orderedModifiers.find(function(x){var G=x.name;return G==="flip"});T||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" "))}var I=ki(s),W=I.marginTop,E=I.marginRight,J=I.marginBottom,q=I.marginLeft;[W,E,J,q].some(function(x){return parseFloat(x)})&&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 b=l.elements,w=b.reference,F=b.popper;if(!I5(w,F)){process.env.NODE_ENV!=="production"&&console.error(S5);return}l.rects={reference:XCe(w,Sm(F),l.options.strategy==="fixed"),popper:zM(F)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach(function(x){return l.modifiersData[x.name]=Object.assign({},x.data)});for(var g=0,T=0;T<l.orderedModifiers.length;T++){if(process.env.NODE_ENV!=="production"&&(g+=1,g>100)){console.error(axe);break}if(l.reset===!0){l.reset=!1,T=-1;continue}var I=l.orderedModifiers[T],W=I.fn,E=I.options,J=E===void 0?{}:E,q=I.name;typeof W=="function"&&(l=W({state:l,options:J,name:q,instance:p})||l)}}},update:txe(function(){return new Promise(function(y){p.forceUpdate(),y(l)})}),destroy:function(){v(),d=!0}};if(!I5(u,s))return process.env.NODE_ENV!=="production"&&console.error(S5),p;p.setOptions(c).then(function(y){!d&&c.onFirstUpdate&&c.onFirstUpdate(y)});function h(){l.orderedModifiers.forEach(function(y){var b=y.name,w=y.options,F=w===void 0?{}:w,g=y.effect;if(typeof g=="function"){var T=g({state:l,name:b,instance:p,options:F}),I=function(){};f.push(T||I)}})}function v(){f.forEach(function(y){return y()}),f=[]}return p}}var sxe=[ECe,KCe,OCe,u5,zCe,DCe,JCe,$Ce,jCe],cxe=uxe({defaultModifiers:sxe}),lxe="tippy-box",O5="tippy-content",fxe="tippy-backdrop",w5="tippy-arrow",E5="tippy-svg-arrow",jc={passive:!0,capture:!0},R5=function(){return document.body};function dxe(e,t){return{}.hasOwnProperty.call(e,t)}function GM(e,t,n){if(Array.isArray(e)){var r=e[t];return r==null?Array.isArray(n)?n[t]:n:r}return e}function YM(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function M5(e,t){return typeof e=="function"?e.apply(void 0,t):e}function C5(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function pxe(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function hxe(e){return e.split(/\s+/).filter(Boolean)}function pd(e){return[].concat(e)}function x5(e,t){e.indexOf(t)===-1&&e.push(t)}function mxe(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function vxe(e){return e.split("-")[0]}function j_(e){return[].slice.call(e)}function k5(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function wm(){return document.createElement("div")}function Em(e){return["Element","Fragment"].some(function(t){return YM(e,t)})}function gxe(e){return YM(e,"NodeList")}function yxe(e){return YM(e,"MouseEvent")}function bxe(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function _xe(e){return Em(e)?[e]:gxe(e)?j_(e):Array.isArray(e)?e:j_(document.querySelectorAll(e))}function ZM(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function A5(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function $xe(e){var t,n=pd(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function Sxe(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=vxe(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,y=r-o.bottom-d>s,b=o.left-n+p>s,w=n-o.right-h>s;return v||y||b||w})}function XM(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function W5(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 vo={isTouch:!1},N5=0;function Txe(){vo.isTouch||(vo.isTouch=!0,window.performance&&document.addEventListener("mousemove",P5))}function P5(){var e=performance.now();e-N5<20&&(vo.isTouch=!1,document.removeEventListener("mousemove",P5)),N5=e}function Ixe(){var e=document.activeElement;if(bxe(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function Oxe(){document.addEventListener("touchstart",Txe,jc),window.addEventListener("blur",Ixe)}var wxe=typeof window<"u"&&typeof document<"u",Exe=wxe?!!window.msCrypto:!1;function hd(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 F5(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function Rxe(e){return F5(`
|
|
123
|
+
`,"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:xi(t.placement),variation:Tf(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,SH(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,SH(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 m1e={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:h1e,data:{}};var sb={passive:!0};function v1e(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=Zr(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(l){l.addEventListener("scroll",n.update,sb)}),u&&s.addEventListener("resize",n.update,sb),function(){o&&c.forEach(function(l){l.removeEventListener("scroll",n.update,sb)}),u&&s.removeEventListener("resize",n.update,sb)}}const g1e={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:v1e,data:{}};var y1e={left:"right",right:"left",bottom:"top",top:"bottom"};function cb(e){return e.replace(/left|right|bottom|top/g,function(t){return y1e[t]})}var b1e={start:"end",end:"start"};function $H(e){return e.replace(/start|end/g,function(t){return b1e[t]})}function LE(e){var t=Zr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function DE(e){return $f(Su(e)).left+LE(e).scrollLeft}function _1e(e,t){var n=Zr(e),r=Su(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,u=0,s=0;if(i){o=i.width,a=i.height;var c=mH();(c||!c&&t==="fixed")&&(u=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:u+DE(e),y:s}}function S1e(e){var t,n=Su(e),r=LE(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=ac(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=ac(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+DE(e),s=-r.scrollTop;return ki(i||n).direction==="rtl"&&(u+=ac(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:u,y:s}}function jE(e){var t=ki(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function TH(e){return["html","body","#document"].indexOf(so(e))>=0?e.ownerDocument.body:Er(e)&&jE(e)?e:TH(ub(e))}function Ch(e,t){var n;t===void 0&&(t=[]);var r=TH(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Zr(r),a=i?[o].concat(o.visualViewport||[],jE(r)?r:[]):r,u=t.concat(a);return i?u:u.concat(Ch(ub(a)))}function qE(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function $1e(e,t){var n=$f(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 IH(e,t,n){return t===fH?qE(_1e(e,n)):oc(t)?$1e(t,n):qE(S1e(Su(e)))}function T1e(e){var t=Ch(ub(e)),n=["absolute","fixed"].indexOf(ki(e).position)>=0,r=n&&Er(e)?Rh(e):e;return oc(r)?t.filter(function(i){return oc(i)&&vH(i,r)&&so(i)!=="body"}):[]}function I1e(e,t,n,r){var i=t==="clippingParents"?T1e(e):[].concat(t),o=[].concat(i,[n]),a=o[0],u=o.reduce(function(s,c){var l=IH(e,c,r);return s.top=ac(l.top,s.top),s.right=ab(l.right,s.right),s.bottom=ab(l.bottom,s.bottom),s.left=ac(l.left,s.left),s},IH(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 OH(e){var t=e.reference,n=e.element,r=e.placement,i=r?xi(r):null,o=r?Tf(r):null,a=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,s;switch(i){case sr:s={x:a,y:t.y-n.height};break;case Jr:s={x:a,y:t.y+t.height};break;case Yr:s={x:t.x+t.width,y:u};break;case cr:s={x:t.x-n.width,y:u};break;default:s={x:t.x,y:t.y}}var c=i?PE(i):null;if(c!=null){var l=c==="y"?"height":"width";switch(o){case _f:s[c]=s[c]-(t[l]/2-n[l]/2);break;case Oh:s[c]=s[c]+(t[l]/2-n[l]/2);break}}return s}function Mh(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?VOe:u,c=n.rootBoundary,l=c===void 0?fH:c,f=n.elementContext,d=f===void 0?wh:f,p=n.altBoundary,h=p===void 0?!1:p,v=n.padding,m=v===void 0?0:v,_=bH(typeof m!="number"?m:_H(m,Ih)),g=d===wh?HOe:wh,S=e.rects.popper,b=e.elements[h?g:d],$=I1e(oc(b)?b:b.contextElement||Su(e.elements.popper),s,l,a),T=$f(e.elements.reference),C=OH({reference:T,element:S,strategy:"absolute",placement:i}),R=qE(Object.assign({},S,C)),q=d===wh?R:T,G={top:$.top-q.top+_.top,bottom:q.bottom-$.bottom+_.bottom,left:$.left-q.left+_.left,right:q.right-$.right+_.right},A=e.modifiersData.offset;if(d===wh&&A){var Y=A[i];Object.keys(G).forEach(function(ie){var J=[Yr,Jr].indexOf(ie)>=0?1:-1,ge=[sr,Jr].indexOf(ie)>=0?"y":"x";G[ie]+=Y[ge]*J})}return G}function O1e(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?pH:s,l=Tf(r),f=l?u?dH:dH.filter(function(h){return Tf(h)===l}):Ih,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]=Mh(e,{placement:v,boundary:i,rootBoundary:o,padding:a})[xi(v)],h},{});return Object.keys(p).sort(function(h,v){return p[h]-p[v]})}function w1e(e){if(xi(e)===ob)return[];var t=cb(e);return[$H(e),t,$H(t)]}function R1e(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,_=xi(m),g=_===m,S=s||(g||!h?[cb(m)]:w1e(m)),b=[m].concat(S).reduce(function(ee,Ee){return ee.concat(xi(Ee)===ob?O1e(t,{placement:Ee,boundary:l,rootBoundary:f,padding:c,flipVariations:h,allowedAutoPlacements:v}):Ee)},[]),$=t.rects.reference,T=t.rects.popper,C=new Map,R=!0,q=b[0],G=0;G<b.length;G++){var A=b[G],Y=xi(A),ie=Tf(A)===_f,J=[sr,Jr].indexOf(Y)>=0,ge=J?"width":"height",Te=Mh(t,{placement:A,boundary:l,rootBoundary:f,altBoundary:d,padding:c}),M=J?ie?Yr:cr:ie?Jr:sr;$[ge]>T[ge]&&(M=cb(M));var x=cb(M),w=[];if(o&&w.push(Te[Y]<=0),u&&w.push(Te[M]<=0,Te[x]<=0),w.every(function(ee){return ee})){q=A,R=!1;break}C.set(A,w)}if(R)for(var I=h?3:1,F=function(Ee){var ue=b.find(function(xe){var Be=C.get(xe);if(Be)return Be.slice(0,Ee).every(function(Ke){return Ke})});if(ue)return q=ue,"break"},L=I;L>0;L--){var Z=F(L);if(Z==="break")break}t.placement!==q&&(t.modifiersData[r]._skip=!0,t.placement=q,t.reset=!0)}}const E1e={name:"flip",enabled:!0,phase:"main",fn:R1e,requiresIfExists:["offset"],data:{_skip:!1}};function wH(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 RH(e){return[sr,Yr,Jr,cr].some(function(t){return e[t]>=0})}function C1e(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Mh(t,{elementContext:"reference"}),u=Mh(t,{altBoundary:!0}),s=wH(a,r),c=wH(u,i,o),l=RH(s),f=RH(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 M1e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:C1e};function x1e(e,t,n){var r=xi(e),i=[cr,sr].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,[cr,Yr].indexOf(r)>=0?{x:u,y:a}:{x:a,y:u}}function k1e(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=pH.reduce(function(l,f){return l[f]=x1e(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 A1e={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:k1e};function N1e(e){var t=e.state,n=e.name;t.modifiersData[n]=OH({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const F1e={name:"popperOffsets",enabled:!0,phase:"read",fn:N1e,data:{}};function W1e(e){return e==="x"?"y":"x"}function P1e(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=Mh(t,{boundary:s,rootBoundary:c,padding:f,altBoundary:l}),_=xi(t.placement),g=Tf(t.placement),S=!g,b=PE(_),$=W1e(b),T=t.modifiersData.popperOffsets,C=t.rects.reference,R=t.rects.popper,q=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,G=typeof q=="number"?{mainAxis:q,altAxis:q}:Object.assign({mainAxis:0,altAxis:0},q),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,Y={x:0,y:0};if(T){if(o){var ie,J=b==="y"?sr:cr,ge=b==="y"?Jr:Yr,Te=b==="y"?"height":"width",M=T[b],x=M+m[J],w=M-m[ge],I=p?-R[Te]/2:0,F=g===_f?C[Te]:R[Te],L=g===_f?-R[Te]:-C[Te],Z=t.elements.arrow,ee=p&&Z?WE(Z):{width:0,height:0},Ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:yH(),ue=Ee[J],xe=Ee[ge],Be=Eh(0,C[Te],ee[Te]),Ke=S?C[Te]/2-I-Be-ue-G.mainAxis:F-Be-ue-G.mainAxis,it=S?-C[Te]/2+I+Be+xe+G.mainAxis:L+Be+xe+G.mainAxis,Ft=t.elements.arrow&&Rh(t.elements.arrow),qt=Ft?b==="y"?Ft.clientTop||0:Ft.clientLeft||0:0,Ht=(ie=A==null?void 0:A[b])!=null?ie:0,Mn=M+Ke-Ht-qt,kr=M+it-Ht,lr=Eh(p?ab(x,Mn):x,M,p?ac(w,kr):w);T[b]=lr,Y[b]=lr-M}if(u){var X,ne=b==="x"?sr:cr,Ce=b==="x"?Jr:Yr,Ot=T[$],Xr=$==="y"?"height":"width",Fi=Ot+m[ne],Wi=Ot-m[Ce],ba=[sr,cr].indexOf(_)!==-1,_a=(X=A==null?void 0:A[$])!=null?X:0,Sa=ba?Fi:Ot-C[Xr]-R[Xr]-_a+G.altAxis,Qr=ba?Ot+C[Xr]+R[Xr]-_a-G.altAxis:Wi,Cu=p&&ba?u1e(Sa,Ot,Qr):Eh(p?Sa:Fi,Ot,p?Qr:Wi);T[$]=Cu,Y[$]=Cu-Ot}t.modifiersData[r]=Y}}const L1e={name:"preventOverflow",enabled:!0,phase:"main",fn:P1e,requiresIfExists:["offset"]};function D1e(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function j1e(e){return e===Zr(e)||!Er(e)?LE(e):D1e(e)}function q1e(e){var t=e.getBoundingClientRect(),n=Sf(t.width)/e.offsetWidth||1,r=Sf(t.height)/e.offsetHeight||1;return n!==1||r!==1}function U1e(e,t,n){n===void 0&&(n=!1);var r=Er(t),i=Er(t)&&q1e(t),o=Su(t),a=$f(e,i,n),u={scrollLeft:0,scrollTop:0},s={x:0,y:0};return(r||!r&&!n)&&((so(t)!=="body"||jE(o))&&(u=j1e(t)),Er(t)?(s=$f(t,!0),s.x+=t.clientLeft,s.y+=t.clientTop):o&&(s.x=DE(o))),{x:a.left+u.scrollLeft-s.x,y:a.top+u.scrollTop-s.y,width:a.width,height:a.height}}function B1e(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 z1e(e){var t=B1e(e);return AE.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function K1e(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function $u(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 uc='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',V1e='Popper: modifier "%s" requires "%s", but "%s" modifier is not available',EH=["name","enabled","phase","fn","effect","requires","options"];function H1e(e){e.forEach(function(t){[].concat(Object.keys(t),EH).filter(function(n,r,i){return i.indexOf(n)===r}).forEach(function(n){switch(n){case"name":typeof t.name!="string"&&console.error($u(uc,String(t.name),'"name"','"string"','"'+String(t.name)+'"'));break;case"enabled":typeof t.enabled!="boolean"&&console.error($u(uc,t.name,'"enabled"','"boolean"','"'+String(t.enabled)+'"'));break;case"phase":AE.indexOf(t.phase)<0&&console.error($u(uc,t.name,'"phase"',"either "+AE.join(", "),'"'+String(t.phase)+'"'));break;case"fn":typeof t.fn!="function"&&console.error($u(uc,t.name,'"fn"','"function"','"'+String(t.fn)+'"'));break;case"effect":t.effect!=null&&typeof t.effect!="function"&&console.error($u(uc,t.name,'"effect"','"function"','"'+String(t.fn)+'"'));break;case"requires":t.requires!=null&&!Array.isArray(t.requires)&&console.error($u(uc,t.name,'"requires"','"array"','"'+String(t.requires)+'"'));break;case"requiresIfExists":Array.isArray(t.requiresIfExists)||console.error($u(uc,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 '+EH.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($u(V1e,String(t.name),r,r))})})})}function G1e(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 J1e(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 CH="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",Y1e="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",MH={placement:"bottom",modifiers:[],strategy:"absolute"};function xH(){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 Z1e(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?MH:i;return function(u,s,c){c===void 0&&(c=o);var l={placement:"bottom",orderedModifiers:[],options:Object.assign({},MH,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:oc(u)?Ch(u):u.contextElement?Ch(u.contextElement):[],popper:Ch(s)};var S=z1e(J1e([].concat(r,l.options.modifiers)));if(l.orderedModifiers=S.filter(function(A){return A.enabled}),process.env.NODE_ENV!=="production"){var b=G1e([].concat(S,l.options.modifiers),function(A){var Y=A.name;return Y});if(H1e(b),xi(l.options.placement)===ob){var $=l.orderedModifiers.find(function(A){var Y=A.name;return Y==="flip"});$||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" "))}var T=ki(s),C=T.marginTop,R=T.marginRight,q=T.marginBottom,G=T.marginLeft;[C,R,q,G].some(function(A){return parseFloat(A)})&&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(!xH(g,S)){process.env.NODE_ENV!=="production"&&console.error(CH);return}l.rects={reference:U1e(g,Rh(S),l.options.strategy==="fixed"),popper:WE(S)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach(function(A){return l.modifiersData[A.name]=Object.assign({},A.data)});for(var b=0,$=0;$<l.orderedModifiers.length;$++){if(process.env.NODE_ENV!=="production"&&(b+=1,b>100)){console.error(Y1e);break}if(l.reset===!0){l.reset=!1,$=-1;continue}var T=l.orderedModifiers[$],C=T.fn,R=T.options,q=R===void 0?{}:R,G=T.name;typeof C=="function"&&(l=C({state:l,options:q,name:G,instance:p})||l)}}},update:K1e(function(){return new Promise(function(m){p.forceUpdate(),m(l)})}),destroy:function(){v(),d=!0}};if(!xH(u,s))return process.env.NODE_ENV!=="production"&&console.error(CH),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 X1e=[g1e,F1e,m1e,hH,A1e,E1e,L1e,f1e,M1e],Q1e=Z1e({defaultModifiers:X1e}),ewe="tippy-box",kH="tippy-content",twe="tippy-backdrop",AH="tippy-arrow",NH="tippy-svg-arrow",sc={passive:!0,capture:!0},FH=function(){return document.body};function nwe(e,t){return{}.hasOwnProperty.call(e,t)}function UE(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function BE(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function WH(e,t){return typeof e=="function"?e.apply(void 0,t):e}function PH(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function rwe(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function iwe(e){return e.split(/\s+/).filter(Boolean)}function If(e){return[].concat(e)}function LH(e,t){e.indexOf(t)===-1&&e.push(t)}function owe(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function awe(e){return e.split("-")[0]}function lb(e){return[].slice.call(e)}function DH(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function xh(){return document.createElement("div")}function kh(e){return["Element","Fragment"].some(function(t){return BE(e,t)})}function uwe(e){return BE(e,"NodeList")}function swe(e){return BE(e,"MouseEvent")}function cwe(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function lwe(e){return kh(e)?[e]:uwe(e)?lb(e):Array.isArray(e)?e:lb(document.querySelectorAll(e))}function zE(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function jH(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function fwe(e){var t,n=If(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function dwe(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=awe(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 KE(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function qH(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 co={isTouch:!1},UH=0;function pwe(){co.isTouch||(co.isTouch=!0,window.performance&&document.addEventListener("mousemove",BH))}function BH(){var e=performance.now();e-UH<20&&(co.isTouch=!1,document.removeEventListener("mousemove",BH)),UH=e}function hwe(){var e=document.activeElement;if(cwe(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function mwe(){document.addEventListener("touchstart",pwe,sc),window.addEventListener("blur",hwe)}var vwe=typeof window<"u"&&typeof document<"u",gwe=vwe?!!window.msCrypto:!1;function Of(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 zH(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function ywe(e){return zH(`
|
|
124
124
|
%ctippy.js
|
|
125
125
|
|
|
126
|
-
%c`+
|
|
126
|
+
%c`+zH(e)+`
|
|
127
127
|
|
|
128
|
-
%c
|
|
129
|
-
`)}function
|
|
128
|
+
%c👷 This is a development-only message. It will be removed in production.
|
|
129
|
+
`)}function KH(e){return[ywe(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var Ah;process.env.NODE_ENV!=="production"&&bwe();function bwe(){Ah=new Set}function va(e,t){if(e&&!Ah.has(t)){var n;Ah.add(t),(n=console).warn.apply(n,KH(t))}}function VE(e,t){if(e&&!Ah.has(t)){var n;Ah.add(t),(n=console).error.apply(n,KH(t))}}function _we(e){var t=!e,n=Object.prototype.toString.call(e)==="[object Object]"&&!e.addEventListener;VE(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),VE(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var VH={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Swe={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Cr=Object.assign({appendTo:FH,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},VH,Swe),$we=Object.keys(Cr),Twe=function(t){process.env.NODE_ENV!=="production"&&JH(t,[]);var n=Object.keys(t);n.forEach(function(r){Cr[r]=t[r]})};function HH(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=Cr[o])!=null?u:a}return r},{});return Object.assign({},e,n)}function Iwe(e,t){var n=t?Object.keys(HH(Object.assign({},Cr,{plugins:t}))):$we,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 GH(e,t){var n=Object.assign({},t,{content:WH(t.content,[e])},t.ignoreAttributes?{}:Iwe(e,t.plugins));return n.aria=Object.assign({},Cr.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 JH(e,t){e===void 0&&(e={}),t===void 0&&(t=[]);var n=Object.keys(e);n.forEach(function(r){var i=rwe(Cr,Object.keys(VH)),o=!nwe(i,r);o&&(o=t.filter(function(a){return a.name===r}).length===0),va(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.",`
|
|
130
130
|
|
|
131
131
|
`,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
|
|
132
|
-
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var
|
|
132
|
+
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var Owe=function(){return"innerHTML"};function HE(e,t){e[Owe()]=t}function YH(e){var t=xh();return e===!0?t.className=AH:(t.className=NH,kh(e)?t.appendChild(e):HE(t,e)),t}function ZH(e,t){kh(t.content)?(HE(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?HE(e,t.content):e.textContent=t.content)}function GE(e){var t=e.firstElementChild,n=lb(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(kH)}),arrow:n.find(function(r){return r.classList.contains(AH)||r.classList.contains(NH)}),backdrop:n.find(function(r){return r.classList.contains(twe)})}}function XH(e){var t=xh(),n=xh();n.className=ewe,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=xh();r.className=kH,r.setAttribute("data-state","hidden"),ZH(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,a){var u=GE(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)&&ZH(c,e.props),a.arrow?l?o.arrow!==a.arrow&&(s.removeChild(l),s.appendChild(YH(a.arrow))):s.appendChild(YH(a.arrow)):l&&s.removeChild(l)}return{popper:t,onUpdate:i}}XH.$$tippy=!0;var wwe=1,fb=[],JE=[];function Rwe(e,t){var n=GH(e,Object.assign({},Cr,HH(DH(t)))),r,i,o,a=!1,u=!1,s=!1,c=!1,l,f,d,p=[],h=PH(Mn,n.interactiveDebounce),v,m=wwe++,_=null,g=owe(n.plugins),S={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:m,reference:e,popper:xh(),popperInstance:_,props:n,state:S,plugins:g,clearDelayTimeouts:Sa,setProps:Qr,setContent:Cu,show:xf,hide:W,hideWithInteractivity:k,enable:ba,disable:_a,unmount:D,destroy:Ae};if(!n.render)return process.env.NODE_ENV!=="production"&&VE(!0,"render() function has not been supplied."),b;var $=n.render(b),T=$.popper,C=$.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(P){return P.fn(b)}),q=e.hasAttribute("aria-expanded");return Ft(),I(),M(),x("onCreate",[b]),n.showOnCreate&&Fi(),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 G(){var P=b.props.touch;return Array.isArray(P)?P:[P,0]}function A(){return G()[0]==="hold"}function Y(){var P;return!!((P=b.props.render)!=null&&P.$$tippy)}function ie(){return v||e}function J(){var P=ie().parentNode;return P?fwe(P):document}function ge(){return GE(T)}function Te(P){return b.state.isMounted&&!b.state.isVisible||co.isTouch||l&&l.type==="focus"?0:UE(b.props.delay,P?0:1,Cr.delay)}function M(P){P===void 0&&(P=!1),T.style.pointerEvents=b.props.interactive&&!P?"":"none",T.style.zIndex=""+b.props.zIndex}function x(P,oe,ve){if(ve===void 0&&(ve=!0),R.forEach(function(Ie){Ie[P]&&Ie[P].apply(Ie,oe)}),ve){var me;(me=b.props)[P].apply(me,oe)}}function w(){var P=b.props.aria;if(P.content){var oe="aria-"+P.content,ve=T.id,me=If(b.props.triggerTarget||e);me.forEach(function(Ie){var st=Ie.getAttribute(oe);if(b.state.isVisible)Ie.setAttribute(oe,st?st+" "+ve:ve);else{var zn=st&&st.replace(ve,"").trim();zn?Ie.setAttribute(oe,zn):Ie.removeAttribute(oe)}})}}function I(){if(!(q||!b.props.aria.expanded)){var P=If(b.props.triggerTarget||e);P.forEach(function(oe){b.props.interactive?oe.setAttribute("aria-expanded",b.state.isVisible&&oe===ie()?"true":"false"):oe.removeAttribute("aria-expanded")})}}function F(){J().removeEventListener("mousemove",h),fb=fb.filter(function(P){return P!==h})}function L(P){if(!(co.isTouch&&(s||P.type==="mousedown"))){var oe=P.composedPath&&P.composedPath()[0]||P.target;if(!(b.props.interactive&&qH(T,oe))){if(If(b.props.triggerTarget||e).some(function(ve){return qH(ve,oe)})){if(co.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else x("onClickOutside",[b,P]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),u=!0,setTimeout(function(){u=!1}),b.state.isMounted||ue())}}}function Z(){s=!0}function ee(){s=!1}function Ee(){var P=J();P.addEventListener("mousedown",L,!0),P.addEventListener("touchend",L,sc),P.addEventListener("touchstart",ee,sc),P.addEventListener("touchmove",Z,sc)}function ue(){var P=J();P.removeEventListener("mousedown",L,!0),P.removeEventListener("touchend",L,sc),P.removeEventListener("touchstart",ee,sc),P.removeEventListener("touchmove",Z,sc)}function xe(P,oe){Ke(P,function(){!b.state.isVisible&&T.parentNode&&T.parentNode.contains(T)&&oe()})}function Be(P,oe){Ke(P,oe)}function Ke(P,oe){var ve=ge().box;function me(Ie){Ie.target===ve&&(KE(ve,"remove",me),oe())}if(P===0)return oe();KE(ve,"remove",f),KE(ve,"add",me),f=me}function it(P,oe,ve){ve===void 0&&(ve=!1);var me=If(b.props.triggerTarget||e);me.forEach(function(Ie){Ie.addEventListener(P,oe,ve),p.push({node:Ie,eventType:P,handler:oe,options:ve})})}function Ft(){A()&&(it("touchstart",Ht,{passive:!0}),it("touchend",kr,{passive:!0})),iwe(b.props.trigger).forEach(function(P){if(P!=="manual")switch(it(P,Ht),P){case"mouseenter":it("mouseleave",kr);break;case"focus":it(gwe?"focusout":"blur",lr);break;case"focusin":it("focusout",lr);break}})}function qt(){p.forEach(function(P){var oe=P.node,ve=P.eventType,me=P.handler,Ie=P.options;oe.removeEventListener(ve,me,Ie)}),p=[]}function Ht(P){var oe,ve=!1;if(!(!b.state.isEnabled||X(P)||u)){var me=((oe=l)==null?void 0:oe.type)==="focus";l=P,v=P.currentTarget,I(),!b.state.isVisible&&swe(P)&&fb.forEach(function(Ie){return Ie(P)}),P.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||a)&&b.props.hideOnClick!==!1&&b.state.isVisible?ve=!0:Fi(P),P.type==="click"&&(a=!ve),ve&&!me&&Wi(P)}}function Mn(P){var oe=P.target,ve=ie().contains(oe)||T.contains(oe);if(!(P.type==="mousemove"&&ve)){var me=Xr().concat(T).map(function(Ie){var st,zn=Ie._tippy,Ar=(st=zn.popperInstance)==null?void 0:st.state;return Ar?{popperRect:Ie.getBoundingClientRect(),popperState:Ar,props:n}:null}).filter(Boolean);dwe(me,P)&&(F(),Wi(P))}}function kr(P){var oe=X(P)||b.props.trigger.indexOf("click")>=0&&a;if(!oe){if(b.props.interactive){b.hideWithInteractivity(P);return}Wi(P)}}function lr(P){b.props.trigger.indexOf("focusin")<0&&P.target!==ie()||b.props.interactive&&P.relatedTarget&&T.contains(P.relatedTarget)||Wi(P)}function X(P){return co.isTouch?A()!==P.type.indexOf("touch")>=0:!1}function ne(){Ce();var P=b.props,oe=P.popperOptions,ve=P.placement,me=P.offset,Ie=P.getReferenceClientRect,st=P.moveTransition,zn=Y()?GE(T).arrow:null,Ar=Ie?{getBoundingClientRect:Ie,contextElement:Ie.contextElement||ie()}:e,kf={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Nf){var $a=Nf.state;if(Y()){var IC=ge(),Ff=IC.box;["placement","reference-hidden","escaped"].forEach(function(mc){mc==="placement"?Ff.setAttribute("data-placement",$a.placement):$a.attributes.popper["data-popper-"+mc]?Ff.setAttribute("data-"+mc,""):Ff.removeAttribute("data-"+mc)}),$a.attributes.popper={}}}},Pi=[{name:"offset",options:{offset:me}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!st}},kf];Y()&&zn&&Pi.push({name:"arrow",options:{element:zn,padding:3}}),Pi.push.apply(Pi,(oe==null?void 0:oe.modifiers)||[]),b.popperInstance=Q1e(Ar,T,Object.assign({},oe,{placement:ve,onFirstUpdate:d,modifiers:Pi}))}function Ce(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Ot(){var P=b.props.appendTo,oe,ve=ie();b.props.interactive&&P===FH||P==="parent"?oe=ve.parentNode:oe=WH(P,[ve]),oe.contains(T)||oe.appendChild(T),b.state.isMounted=!0,ne(),process.env.NODE_ENV!=="production"&&va(b.props.interactive&&P===Cr.appendTo&&ve.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.",`
|
|
133
133
|
|
|
134
134
|
`,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
|
|
135
135
|
|
|
136
136
|
`,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
|
|
137
137
|
|
|
138
|
-
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function
|
|
138
|
+
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Xr(){return lb(T.querySelectorAll("[data-tippy-root]"))}function Fi(P){b.clearDelayTimeouts(),P&&x("onTrigger",[b,P]),Ee();var oe=Te(!0),ve=G(),me=ve[0],Ie=ve[1];co.isTouch&&me==="hold"&&Ie&&(oe=Ie),oe?r=setTimeout(function(){b.show()},oe):b.show()}function Wi(P){if(b.clearDelayTimeouts(),x("onUntrigger",[b,P]),!b.state.isVisible){ue();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(P.type)>=0&&a)){var oe=Te(!1);oe?i=setTimeout(function(){b.state.isVisible&&b.hide()},oe):o=requestAnimationFrame(function(){b.hide()})}}function ba(){b.state.isEnabled=!0}function _a(){b.hide(),b.state.isEnabled=!1}function Sa(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function Qr(P){if(process.env.NODE_ENV!=="production"&&va(b.state.isDestroyed,Of("setProps")),!b.state.isDestroyed){x("onBeforeUpdate",[b,P]),qt();var oe=b.props,ve=GH(e,Object.assign({},oe,DH(P),{ignoreAttributes:!0}));b.props=ve,Ft(),oe.interactiveDebounce!==ve.interactiveDebounce&&(F(),h=PH(Mn,ve.interactiveDebounce)),oe.triggerTarget&&!ve.triggerTarget?If(oe.triggerTarget).forEach(function(me){me.removeAttribute("aria-expanded")}):ve.triggerTarget&&e.removeAttribute("aria-expanded"),I(),M(),C&&C(oe,ve),b.popperInstance&&(ne(),Xr().forEach(function(me){requestAnimationFrame(me._tippy.popperInstance.forceUpdate)})),x("onAfterUpdate",[b,P])}}function Cu(P){b.setProps({content:P})}function xf(){process.env.NODE_ENV!=="production"&&va(b.state.isDestroyed,Of("show"));var P=b.state.isVisible,oe=b.state.isDestroyed,ve=!b.state.isEnabled,me=co.isTouch&&!b.props.touch,Ie=UE(b.props.duration,0,Cr.duration);if(!(P||oe||ve||me)&&!ie().hasAttribute("disabled")&&(x("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,Y()&&(T.style.visibility="visible"),M(),Ee(),b.state.isMounted||(T.style.transition="none"),Y()){var st=ge(),zn=st.box,Ar=st.content;zE([zn,Ar],0)}d=function(){var Pi;if(!(!b.state.isVisible||c)){if(c=!0,T.offsetHeight,T.style.transition=b.props.moveTransition,Y()&&b.props.animation){var Af=ge(),Nf=Af.box,$a=Af.content;zE([Nf,$a],Ie),jH([Nf,$a],"visible")}w(),I(),LH(JE,b),(Pi=b.popperInstance)==null||Pi.forceUpdate(),x("onMount",[b]),b.props.animation&&Y()&&Be(Ie,function(){b.state.isShown=!0,x("onShown",[b])})}},Ot()}}function W(){process.env.NODE_ENV!=="production"&&va(b.state.isDestroyed,Of("hide"));var P=!b.state.isVisible,oe=b.state.isDestroyed,ve=!b.state.isEnabled,me=UE(b.props.duration,1,Cr.duration);if(!(P||oe||ve)&&(x("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,c=!1,a=!1,Y()&&(T.style.visibility="hidden"),F(),ue(),M(!0),Y()){var Ie=ge(),st=Ie.box,zn=Ie.content;b.props.animation&&(zE([st,zn],me),jH([st,zn],"hidden"))}w(),I(),b.props.animation?Y()&&xe(me,b.unmount):b.unmount()}}function k(P){process.env.NODE_ENV!=="production"&&va(b.state.isDestroyed,Of("hideWithInteractivity")),J().addEventListener("mousemove",h),LH(fb,h),h(P)}function D(){process.env.NODE_ENV!=="production"&&va(b.state.isDestroyed,Of("unmount")),b.state.isVisible&&b.hide(),b.state.isMounted&&(Ce(),Xr().forEach(function(P){P._tippy.unmount()}),T.parentNode&&T.parentNode.removeChild(T),JE=JE.filter(function(P){return P!==b}),b.state.isMounted=!1,x("onHidden",[b]))}function Ae(){process.env.NODE_ENV!=="production"&&va(b.state.isDestroyed,Of("destroy")),!b.state.isDestroyed&&(b.clearDelayTimeouts(),b.unmount(),qt(),delete e._tippy,b.state.isDestroyed=!0,x("onDestroy",[b]))}}function Nh(e,t){t===void 0&&(t={});var n=Cr.plugins.concat(t.plugins||[]);process.env.NODE_ENV!=="production"&&(_we(e),JH(t,n)),mwe();var r=Object.assign({},t,{plugins:n}),i=lwe(e);if(process.env.NODE_ENV!=="production"){var o=kh(r.content),a=i.length>1;va(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.",`
|
|
139
139
|
|
|
140
140
|
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
|
141
141
|
|
|
142
142
|
`,`1) content: element.innerHTML
|
|
143
|
-
`,"2) content: () => element.cloneNode(true)"].join(" "))}var u=i.reduce(function(s,c){var l=c&&Fxe(c,r);return l&&s.push(l),s},[]);return Em(e)?u[0]:u}Mm.defaultProps=Rr,Mm.setDefaultProps=Axe,Mm.currentInput=vo,Object.assign({},u5,{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)}}),Mm.setDefaultProps({render:K5});class Dxe{constructor({editor:t,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:a,state:u,from:s,to:c})=>{const{doc:l,selection:f}=u,{empty:d}=f,p=!l.textBetween(s,c).length&&K4(u.selection),h=this.element.contains(document.activeElement);return!(!(a.hasFocus()||h)||d||p||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var u;if(this.preventHide){this.preventHide=!1;return}(a==null?void 0:a.relatedTarget)&&((u=this.element.parentNode)===null||u===void 0?void 0:u.contains(a.relatedTarget))||this.hide()},this.editor=t,this.element=n,this.view=r,o&&(this.shouldShow=o),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=Mm(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",r=>{this.blurHandler({event:r})}))}update(t,n){var r,i,o;const{state:a,composing:u}=t,{doc:s,selection:c}=a,l=n&&n.doc.eq(s)&&n.selection.eq(c);if(u||l)return;this.createTooltip();const{ranges:f}=c,d=Math.min(...f.map(v=>v.$from.pos)),p=Math.max(...f.map(v=>v.$to.pos));if(!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:t,state:a,oldState:n,from:d,to:p}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>{if(XMe(a.selection)){const v=t.nodeDOM(d);if(v)return v.getBoundingClientRect()}return QMe(t,d,p)})}),this.show()}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;(t=this.tippy)===null||t===void 0||t.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 V5=e=>new Vr({key:typeof e.pluginKey=="string"?new ku(e.pluginKey):e.pluginKey,view:t=>new Dxe({view:t,...e})});Or.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[V5({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});const Lxe=e=>{const[t,n]=ie.useState(null);return ie.useEffect(()=>{if(!t||e.editor.isDestroyed)return;const{pluginKey:r="bubbleMenu",editor:i,tippyOptions:o={},shouldShow:a=null}=e,u=V5({pluginKey:r,editor:i,element:t,tippyOptions:o,shouldShow:a});return i.registerPlugin(u),()=>i.unregisterPlugin(r)},[e.editor,t]),C("div",{ref:n,className:e.className,style:{visibility:"hidden"},children:e.children})};class jxe extends YMe{constructor(){super(...arguments),this.contentComponent=null}}const Uxe=({renderers:e})=>C($c,{children:Array.from(e).map(([t,n])=>YH.default.createPortal(n.reactElement,n.element,t))});class Bxe extends Vc.default.Component{constructor(t){super(t),this.editorContentRef=Vc.default.createRef(),this.state={renderers:new Map}}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()}}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 qe($c,{children:[C("div",{ref:this.editorContentRef,...n}),C(Uxe,{renderers:this.state.renderers})]})}}const zxe=Vc.default.memo(Bxe),H5=ie.createContext({onDragStart:void 0}),qxe=()=>ie.useContext(H5),Kxe=Vc.default.forwardRef((e,t)=>{const{onDragStart:n}=qxe(),r=e.as||"div";return C(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function Vxe(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function Hxe(e){var t;return typeof e=="object"&&((t=e.$$typeof)===null||t===void 0?void 0:t.toString())==="Symbol(react.forward_ref)"}class J5{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(){const t=this.component,n=this.props;(Vxe(t)||Hxe(t))&&(n.ref=r=>{this.ref=r}),this.reactElement=C(t,{...n}),Nm.flushSync(()=>{var r;!((r=this.editor)===null||r===void 0)&&r.contentComponent&&this.editor.contentComponent.setState({renderers:this.editor.contentComponent.state.renderers.set(this.id,this)})})}updateProps(t={}){this.props={...this.props,...t},this.render()}destroy(){Nm.flushSync(()=>{var t;if(!((t=this.editor)===null||t===void 0)&&t.contentComponent){const{renderers:n}=this.editor.contentComponent.state;n.delete(this.id),this.editor.contentComponent.setState({renderers:n})}})}}class Jxe extends eCe{mount(){const t={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(o={})=>this.updateAttributes(o),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const o=a=>a.charAt(0).toUpperCase()+a.substring(1);this.component.displayName=o(this.extension.name)}const n=o=>{const a=this.component,u=this.onDragStart.bind(this),s=c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&c.appendChild(this.contentDOMElement)};return C(H5.Provider,{value:{onDragStart:u,nodeViewContentRef:s},children:C(a,{...o})})};n.displayName="ReactNodeView",this.contentDOMElement=this.node.isLeaf?null:document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit");let r=this.node.isInline?"span":"div";this.options.as&&(r=this.options.as);const{className:i=""}=this.options;this.renderer=new J5(n,{editor:this.editor,props:t,as:r,className:`node-${this.node.type.name} ${i}`.trim()})}get dom(){var t;if(this.renderer.element.firstElementChild&&!(!((t=this.renderer.element.firstElementChild)===null||t===void 0)&&t.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(t,n){const r=i=>{this.renderer.updateProps(i)};if(t.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const i=this.node,o=this.decorations;return this.node=t,this.decorations=n,this.options.update({oldNode:i,oldDecorations:o,newNode:t,newDecorations:n,updateProps:()=>r({node:t,decorations:n})})}return t===this.node&&this.decorations===n||(this.node=t,this.decorations=n,r({node:t,decorations:n})),!0}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy(),this.contentDOMElement=null}}function Gxe(e,t){return n=>n.editor.contentComponent?new Jxe(e,n,t):{}}function Yxe(){const[,e]=ie.useState(0);return()=>e(t=>t+1)}const Zxe=(e={},t=[])=>{const[n,r]=ie.useState(null),i=Yxe();return ie.useEffect(()=>{let o=!0;const a=new jxe(e);return r(a),a.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{o&&i()})})}),()=>{a.destroy(),o=!1}},t),n},Xxe=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,Qxe=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,eke=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,tke=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,nke=sd.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",dn(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[A_({find:Xxe,type:this.type}),A_({find:eke,type:this.type})]},addPasteRules(){return[W_({find:Qxe,type:this.type}),W_({find:tke,type:this.type})]}});var rke=Object.defineProperty,ike=(e,t,n)=>t in e?rke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,md=(e,t,n)=>(ike(e,typeof t!="symbol"?t+"":t,n),n),rC=(e=>(e.Document="document",e.Mark="mark",e.Node="node",e))(rC||{}),vd=(e=>(e.Text="text",e.Embed="embed",e.Image="image",e))(vd||{});class oke{constructor(t,n,r){this.name=t,this.component=n,this.converter=r,md(this,"extType","document")}}class G5{constructor(t,n,r,i){this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,md(this,"extType","mark")}}class gd{constructor(t,n,r,i,o,a=!1){this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a,md(this,"extType","node"),md(this,"nodeType","text")}}class ake{constructor(t,n,r,i){this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,md(this,"extType","node"),md(this,"nodeType","embed")}}class uke extends gd{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class iC extends gd{constructor(t,n,r,i){super(t,n,r,i)}}const oC=nke.extend({name:"bold"}),ske={fromPrismic(e){return function(){var t;return(t=e.marks[oC.name])==null?void 0:t.create()}},toPrismic(){}},Y5=new G5([Ce.RichTextNodeType.strong],oC.name,oC,ske),cke=/^\s*([-+*])\s$/,lke=wr.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",dn(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[r5({find:cke,type:this.type})]}}),Z5=wr.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",dn(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()}}}),
|
|
145
|
-
`,Q5={fromPrismic(e){return function(t){var n;if(t===z_)return(n=e.nodes[B_.name])==null?void 0:n.create({})}},toPrismic(e){if(e.type.name===B_.name)return z_}},sC={isEmptyLine(e){return e.length===0},isFirst(e){return e===0}};function yke(e,t){return function(n){const r=Q5.fromPrismic(e)(z_);if(!r)return[n(t)];const i=t.split(z_);return i.length===1?t.length?[n(t)]:[r]:i.reduce((o,a,u)=>sC.isFirst(u)?sC.isEmptyLine(a)?o:[...o,n(a)]:sC.isEmptyLine(a)?[...o,r]:[...o,r,n(a)],[])}}const q_={name:B_.name,component:B_,converter:Q5,splitTextToNodes:yke},bke=Or.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Vr({props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];return n?(e.descendants((o,a)=>{const u=r>=a&&r<=a+o.nodeSize,s=!o.isLeaf&&!o.childCount;if((u||!this.options.showOnlyCurrent)&&s){const c=[this.options.emptyNodeClass];this.editor.isEmpty&&c.push(this.options.emptyEditorClass);const l=Tr.node(a,a+o.nodeSize,{class:c.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:a,hasAnchor:u}):this.options.placeholder});i.push(l)}return this.options.includeChildren}),Vt.create(e,i)):null}}})]}}),_ke=e=>bke.configure({includeChildren:!0,placeholder:({editor:t,hasAnchor:n,node:r})=>{const i=!Uc.children.exists(t.state.doc,u=>u===r),o=(()=>{const u=t.isEditable,s=t.isFocused&&n,c=r.type.name!==Zu.name;return u&&(s||c||i)})(),a=(()=>{if(i)return yd.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 bd(e){return e.split("-")[0]}function cC(e){return e.split("-")[1]}function Cm(e){return["top","bottom"].includes(bd(e))?"x":"y"}function eH(e){return e==="y"?"height":"width"}function tH(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=Cm(t),s=eH(u),c=r[s]/2-i[s]/2,l=bd(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(cC(t)){case"start":d[u]-=c*(n&&f?-1:1);break;case"end":d[u]+=c*(n&&f?-1:1);break}return d}const $ke=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,u=await(a.isRTL==null?void 0:a.isRTL(t));if(process.env.NODE_ENV!=="production"&&(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(" ")),o.filter(h=>{let{name:v}=h;return v==="autoPlacement"||v==="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(" "));let s=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:l}=tH(s,r,u),f=r,d={},p=0;for(let h=0;h<o.length;h++){const{name:v,fn:y}=o[h],{x:b,y:w,data:F,reset:g}=await y({x:c,y:l,initialPlacement:r,placement:f,strategy:i,middlewareData:d,rects:s,platform:a,elements:{reference:e,floating:t}});if(c=b!=null?b:c,l=w!=null?w:l,d={...d,[v]:{...d[v],...F}},process.env.NODE_ENV!=="production"&&p>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(" ")),g&&p<=50){p++,typeof g=="object"&&(g.placement&&(f=g.placement),g.rects&&(s=g.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):g.rects),{x:c,y:l}=tH(s,f,u)),h=-1;continue}}return{x:c,y:l,placement:f,strategy:i,middlewareData:d}};function Ske(e){return{top:0,right:0,bottom:0,left:0,...e}}function Tke(e){return typeof e!="number"?Ske(e):{top:e,right:e,bottom:e,left:e}}function K_(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function nH(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=Tke(p),y=u[d?f==="floating"?"reference":"floating":f],b=K_(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:c,rootBoundary:l,strategy:s})),w=K_(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:f==="floating"?{...a.floating,x:r,y:i}:a.reference,offsetParent:await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),strategy:s}):a[f]);return{top:b.top-w.top+h.top,bottom:w.bottom-b.bottom+h.bottom,left:b.left-w.left+h.left,right:w.right-b.right+h.right}}const Ike=Math.min,Oke=Math.max;function rH(e,t,n){return Oke(e,Ike(t,n))}const wke={left:"right",right:"left",bottom:"top",top:"bottom"};function V_(e){return e.replace(/left|right|bottom|top/g,t=>wke[t])}function Eke(e,t,n){n===void 0&&(n=!1);const r=cC(e),i=Cm(e),o=eH(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=V_(a)),{main:a,cross:V_(a)}}const Rke={start:"end",end:"start"};function iH(e){return e.replace(/start|end/g,t=>Rke[t])}function Mke(e){const t=V_(e);return[iH(e),t,iH(t)]}const Cke=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",flipAlignment:p=!0,...h}=e,v=bd(r),b=f||(v===a||!p?[V_(a)]:Mke(a)),w=[a,...b],F=await nH(t,h),g=[];let T=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&g.push(F[v]),l){const{main:J,cross:q}=Eke(r,o,await(u.isRTL==null?void 0:u.isRTL(s.floating)));g.push(F[J],F[q])}if(T=[...T,{placement:r,overflows:g}],!g.every(J=>J<=0)){var I,W;const J=((I=(W=i.flip)==null?void 0:W.index)!=null?I:0)+1,q=w[J];if(q)return{data:{index:J,overflows:T},reset:{placement:q}};let x="bottom";switch(d){case"bestFit":{var E;const G=(E=T.map(O=>[O,O.overflows.filter(R=>R>0).reduce((R,k)=>R+k,0)]).sort((O,R)=>O[1]-R[1])[0])==null?void 0:E[0].placement;G&&(x=G);break}case"initialPlacement":x=a;break}if(r!==x)return{reset:{placement:x}}}return{}}}};async function xke(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=bd(n),u=cC(n),s=Cm(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 kke=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await xke(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function oH(e){return e==="x"?"y":"x"}const Ake=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:y=>{let{x:b,y:w}=y;return{x:b,y:w}}},...s}=e,c={x:n,y:r},l=await nH(t,s),f=Cm(bd(i)),d=oH(f);let p=c[f],h=c[d];if(o){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",w=p+l[y],F=p-l[b];p=rH(w,p,F)}if(a){const y=d==="y"?"top":"left",b=d==="y"?"bottom":"right",w=h+l[y],F=h-l[b];h=rH(w,h,F)}const v=u.fn({...t,[f]:p,[d]:h});return{...v,data:{x:v.x-n,y:v.y-r}}}}},Wke=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=Cm(i),d=oH(f);let p=l[f],h=l[d];const v=typeof u=="function"?u(t):u,y=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(s){const T=f==="y"?"height":"width",I=o.reference[f]-o.floating[T]+y.mainAxis,W=o.reference[f]+o.reference[T]-y.mainAxis;p<I?p=I:p>W&&(p=W)}if(c){var b,w,F,g;const T=f==="y"?"width":"height",I=["top","left"].includes(bd(i)),W=o.reference[d]-o.floating[T]+(I&&(b=(w=a.offset)==null?void 0:w[d])!=null?b:0)+(I?0:y.crossAxis),E=o.reference[d]+o.reference[T]+(I?0:(F=(g=a.offset)==null?void 0:g[d])!=null?F:0)-(I?y.crossAxis:0);h<W?h=W:h>E&&(h=E)}return{[f]:p,[d]:h}}}};function aH(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function wa(e){if(e==null)return window;if(!aH(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function Vu(e){return wa(e).getComputedStyle(e)}function Ea(e){return aH(e)?"":e?(e.nodeName||"").toLowerCase():""}function uH(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function go(e){return e instanceof wa(e).HTMLElement}function Hu(e){return e instanceof wa(e).Element}function Nke(e){return e instanceof wa(e).Node}function H_(e){if(typeof ShadowRoot>"u")return!1;const t=wa(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function J_(e){const{overflow:t,overflowX:n,overflowY:r}=Vu(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function Pke(e){return["table","td","th"].includes(Ea(e))}function sH(e){const t=/firefox/i.test(uH()),n=Vu(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&(n.filter?n.filter!=="none":!1)}function cH(){return!/^((?!chrome|android).)*safari/i.test(uH())}const lH=Math.min,xm=Math.max,G_=Math.round;function Ra(e,t,n){var r,i,o,a;t===void 0&&(t=!1),n===void 0&&(n=!1);const u=e.getBoundingClientRect();let s=1,c=1;t&&go(e)&&(s=e.offsetWidth>0&&G_(u.width)/e.offsetWidth||1,c=e.offsetHeight>0&&G_(u.height)/e.offsetHeight||1);const l=Hu(e)?wa(e):window,f=!cH()&&n,d=(u.left+(f&&(r=(i=l.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/s,p=(u.top+(f&&(o=(a=l.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/c,h=u.width/s,v=u.height/c;return{width:h,height:v,top:p,right:d+h,bottom:p+v,left:d,x:d,y:p}}function Ju(e){return((Nke(e)?e.ownerDocument:e.document)||window.document).documentElement}function Y_(e){return Hu(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function fH(e){return Ra(Ju(e)).left+Y_(e).scrollLeft}function Fke(e){const t=Ra(e);return G_(t.width)!==e.offsetWidth||G_(t.height)!==e.offsetHeight}function Dke(e,t,n){const r=go(t),i=Ju(t),o=Ra(e,r&&Fke(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const u={x:0,y:0};if(r||!r&&n!=="fixed")if((Ea(t)!=="body"||J_(i))&&(a=Y_(t)),go(t)){const s=Ra(t,!0);u.x=s.x+t.clientLeft,u.y=s.y+t.clientTop}else i&&(u.x=fH(i));return{x:o.left+a.scrollLeft-u.x,y:o.top+a.scrollTop-u.y,width:o.width,height:o.height}}function dH(e){return Ea(e)==="html"?e:e.assignedSlot||e.parentNode||(H_(e)?e.host:null)||Ju(e)}function pH(e){return!go(e)||Vu(e).position==="fixed"?null:e.offsetParent}function Lke(e){let t=dH(e);for(H_(t)&&(t=t.host);go(t)&&!["html","body"].includes(Ea(t));){if(sH(t))return t;{const n=t.parentNode;t=H_(n)?n.host:n}}return null}function lC(e){const t=wa(e);let n=pH(e);for(;n&&Pke(n)&&Vu(n).position==="static";)n=pH(n);return n&&(Ea(n)==="html"||Ea(n)==="body"&&Vu(n).position==="static"&&!sH(n))?t:n||Lke(e)||t}function hH(e){if(go(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Ra(e);return{width:t.width,height:t.height}}function jke(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=go(n),o=Ju(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const u={x:0,y:0};if((i||!i&&r!=="fixed")&&((Ea(n)!=="body"||J_(o))&&(a=Y_(n)),go(n))){const s=Ra(n,!0);u.x=s.x+n.clientLeft,u.y=s.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+u.x,y:t.y-a.scrollTop+u.y}}function Uke(e,t){const n=wa(e),r=Ju(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=cH();(c||!c&&t==="fixed")&&(u=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:u,y:s}}function Bke(e){var t;const n=Ju(e),r=Y_(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=xm(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=xm(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let u=-r.scrollLeft+fH(e);const s=-r.scrollTop;return Vu(i||n).direction==="rtl"&&(u+=xm(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:u,y:s}}function mH(e){const t=dH(e);return["html","body","#document"].includes(Ea(t))?e.ownerDocument.body:go(t)&&J_(t)?t:mH(t)}function _d(e,t){var n;t===void 0&&(t=[]);const r=mH(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=wa(r),a=i?[o].concat(o.visualViewport||[],J_(r)?r:[]):r,u=t.concat(a);return i?u:u.concat(_d(a))}function zke(e,t){const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&H_(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function qke(e,t){const n=Ra(e,!1,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft;return{top:r,left:i,x:i,y:r,right:i+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}function vH(e,t,n){return t==="viewport"?K_(Uke(e,n)):Hu(t)?qke(t,n):K_(Bke(Ju(e)))}function Kke(e){const t=_d(e),r=["absolute","fixed"].includes(Vu(e).position)&&go(e)?lC(e):e;return Hu(r)?t.filter(i=>Hu(i)&&zke(i,r)&&Ea(i)!=="body"):[]}function Vke(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?Kke(t):[].concat(n),r],u=a[0],s=a.reduce((c,l)=>{const f=vH(t,l,i);return c.top=xm(f.top,c.top),c.right=lH(f.right,c.right),c.bottom=lH(f.bottom,c.bottom),c.left=xm(f.left,c.left),c},vH(t,u,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}const Hke={getClippingRect:Vke,convertOffsetParentRelativeRectToViewportRelativeRect:jke,isElement:Hu,getDimensions:hH,getOffsetParent:lC,getDocumentElement:Ju,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:Dke(t,lC(n),r),floating:{...hH(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Vu(e).direction==="rtl"};function Jke(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=o&&!u,l=s||c?[...Hu(e)?_d(e):[],..._d(t)]:[];l.forEach(v=>{s&&v.addEventListener("scroll",n,{passive:!0}),c&&v.addEventListener("resize",n)});let f=null;if(a){let v=!0;f=new ResizeObserver(()=>{v||n(),v=!1}),Hu(e)&&!u&&f.observe(e),f.observe(t)}let d,p=u?Ra(e):null;u&&h();function h(){const v=Ra(e);p&&(v.x!==p.x||v.y!==p.y||v.width!==p.width||v.height!==p.height)&&n(),p=v,d=requestAnimationFrame(h)}return n(),()=>{var v;l.forEach(y=>{s&&y.removeEventListener("scroll",n),c&&y.removeEventListener("resize",n)}),(v=f)==null||v.disconnect(),f=null,u&&cancelAnimationFrame(d)}}const Gke=(e,t,n)=>$ke(e,t,{platform:Hke,...n});var fC=typeof document<"u"?ie.useLayoutEffect:ie.useEffect;function Z_(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(!Z_(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)&&!Z_(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Yke(e){const t=ye.useRef(e);return fC(()=>{t.current=e}),t}function Zke(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const[o,a]=ye.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[u,s]=ye.useState(t);Z_(u==null?void 0:u.map(g=>{let{name:T,options:I}=g;return{name:T,options:I}}),t==null?void 0:t.map(g=>{let{name:T,options:I}=g;return{name:T,options:I}}))||s(t);const c=ye.useRef(null),l=ye.useRef(null),f=ye.useRef(null),d=ye.useRef(o),p=Yke(i),h=ye.useCallback(()=>{!c.current||!l.current||Gke(c.current,l.current,{middleware:u,placement:n,strategy:r}).then(g=>{v.current&&!Z_(d.current,g)&&(d.current=g,ZH.flushSync(()=>{a(g)}))})},[u,n,r]);fC(()=>{v.current&&h()},[h]);const v=ye.useRef(!1);fC(()=>(v.current=!0,()=>{v.current=!1}),[]);const y=ye.useCallback(()=>{if(typeof f.current=="function"&&(f.current(),f.current=null),c.current&&l.current)if(p.current){const g=p.current(c.current,l.current,h);f.current=g}else h()},[h,p]),b=ye.useCallback(g=>{c.current=g,y()},[y]),w=ye.useCallback(g=>{l.current=g,y()},[y]),F=ye.useMemo(()=>({reference:c,floating:l}),[]);return ye.useMemo(()=>({...o,update:h,refs:F,reference:b,floating:w}),[o,h,F,b,w])}var Gu=typeof document<"u"?ie.useLayoutEffect:ie.useEffect;function Xke(){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 dC=!1,Qke=0;const gH=()=>"floating-ui-"+Qke++;function eAe(){const[e,t]=ye.useState(()=>dC?gH():void 0);return Gu(()=>{e==null&&t(gH())},[]),ye.useEffect(()=>{dC||(dC=!0)},[]),e}const yH=ye["useId".toString()],bH=yH!=null?yH:eAe,tAe=ye.createContext(null),nAe=ye.createContext(null),_H=()=>{var e,t;return(e=(t=ye.useContext(tAe))==null?void 0:t.id)!=null?e:null},pC=()=>ye.useContext(nAe);function hC(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function $H(e){var t;return(t=hC(e).defaultView)!=null?t:window}function X_(e){return e?e instanceof $H(e).Element:!1}function rAe(e){return e?e instanceof $H(e).HTMLElement:!1}const SH=ye["useInsertionEffect".toString()];function mC(e){const t=ye.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return SH?SH(()=>{t.current=e}):t.current=e,ye.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 iAe(e){let{open:t=!1,onOpenChange:n,whileElementsMounted:r,placement:i,middleware:o,strategy:a,nodeId:u}=e===void 0?{}:e;const[s,c]=ye.useState(null),l=pC(),f=ye.useRef(null),d=ye.useRef({}),p=ye.useState(()=>Xke())[0],h=Zke({placement:i,middleware:o,strategy:a,whileElementsMounted:r}),v=mC(n),y=ye.useMemo(()=>({...h.refs,domReference:f}),[h.refs]),b=ye.useMemo(()=>({...h,refs:y,dataRef:d,nodeId:u,events:p,open:t,onOpenChange:v,_:{domReference:s}}),[h,u,p,t,v,y,s]);Gu(()=>{const g=l==null?void 0:l.nodesRef.current.find(T=>T.id===u);g&&(g.context=b)});const{reference:w}=h,F=ye.useCallback(g=>{(X_(g)||g===null)&&(b.refs.domReference.current=g,c(g)),w(g)},[w,b.refs]);return ye.useMemo(()=>({...h,context:b,refs:y,reference:F}),[h,y,b,F])}function vC(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 oAe=function(e){return e===void 0&&(e=[]),{getReferenceProps:t=>vC(t,e,"reference"),getFloatingProps:t=>vC(t,e,"floating"),getItemProps:t=>vC(t,e,"item")}};function gC(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 TH(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 aAe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Yu(e){e.preventDefault(),e.stopPropagation()}function uAe(e){const t=ie.useRef(e);return Gu(()=>{t.current=e}),t}function IH(e){const t=ie.useRef();return Gu(()=>{t.current=e},[e]),t.current}const sAe=function(e,t){let{open:n}=e,{enabled:r=!0,role:i="dialog"}=t===void 0?{}:t;const o=bH(),a=bH(),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 yC(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 cAe=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=pC(),h=_H()!=null,v=ye.useRef(!1);return ye.useEffect(()=>{if(!n||!u)return;function y(T){if(T.key==="Escape"){if(!d&&p&&gC(p.nodesRef.current,a).length>0)return;o.emit("dismiss",{preventScroll:!1}),r(!1)}}function b(T){const I=v.current;if(v.current=!1,I)return;const W=aAe(T);if(X_(W)&&i.floating.current){var E;const q=(E=i.floating.current.ownerDocument.defaultView)!=null?E:window,x=W.scrollWidth>W.clientWidth,G=W.scrollHeight>W.clientHeight;let O=G&&T.offsetX>W.clientWidth;if(G&&q.getComputedStyle(W).direction==="rtl"&&(O=T.offsetX<=W.offsetWidth-W.clientWidth),O||x&&T.offsetY>W.clientHeight)return}const J=p&&gC(p.nodesRef.current,a).some(q=>{var x;return yC(T,(x=q.context)==null?void 0:x.refs.floating.current)});yC(T,i.floating.current)||yC(T,i.domReference.current)||J||!d&&p&&gC(p.nodesRef.current,a).length>0||(o.emit("dismiss",h?{preventScroll:!0}:!1),r(!1))}function w(){r(!1)}const F=hC(i.floating.current);s&&F.addEventListener("keydown",y),c&&F.addEventListener("pointerdown",b);const g=(f?[...X_(i.reference.current)?_d(i.reference.current):[],...X_(i.floating.current)?_d(i.floating.current):[]]:[]).filter(T=>{var I;return T!==((I=F.defaultView)==null?void 0:I.visualViewport)});return g.forEach(T=>T.addEventListener("scroll",w,{passive:!0})),()=>{s&&F.removeEventListener("keydown",y),c&&F.removeEventListener("pointerdown",b),g.forEach(T=>T.removeEventListener("scroll",w))}},[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}}}:{}},bC="ArrowUp",Q_="ArrowDown",$d="ArrowLeft",km="ArrowRight";function e$(e,t,n){return Math.floor(e/t)!==n}function Am(e,t){return t<0||t>=e.current.length}function $n(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?void 0:s.hasAttribute("disabled"))||((c=a[u])==null?void 0:c.getAttribute("aria-disabled"))==="true"));return u}function t$(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function OH(e,t){return t$(t,e===bC||e===Q_,e===$d||e===km)}function _C(e,t,n){return t$(t,e===Q_,n?e===$d:e===km)||e==="Enter"||e==" "||e===""}function lAe(e,t,n){return t$(t,n?e===$d:e===km,e===Q_)}function fAe(e,t,n){return t$(t,n?e===km:e===$d,e===bC)}function $C(e,t){return $n(e,{disabledIndices:t})}function wH(e,t){return $n(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const dAe=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:y=!0,openOnArrowKeyDown:b=!0,disabledIndices:w=void 0,orientation:F="vertical",cols:g=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(" "))),F==="vertical"&&g>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const T=_H(),I=pC(),W=IH(n),E=mC(u),J=mC(IH(u)),q=ye.useRef(v),x=ye.useRef(c!=null?c:-1),G=ye.useRef(null),O=uAe(w),R=ye.useRef(!1),k=ye.useRef(-1),[L,z]=ye.useState(),j=ye.useCallback(($,U)=>{k.current=requestAnimationFrame(()=>{if(h){var Z;z((Z=$.current[U.current])==null?void 0:Z.id)}else{var ge;(ge=$.current[U.current])==null||ge.focus({preventScroll:!0})}})},[h]);Gu(()=>{!s||(!W&&n&&q.current&&c!=null&&E(c),W&&!n&&(cancelAnimationFrame(k.current),x.current=-1,J(null)))},[n,W,c,o,j,s,E,J]),Gu(()=>{if(!!s&&n)if(a==null){if(c!=null)return;W&&(x.current=-1,j(o,x)),!W&&q.current&&(G.current!=null||q.current===!0&&G.current==null)&&(x.current=G.current==null||_C(G.current,F,p)||d?$C(o,O.current):wH(o,O.current),E(x.current),j(o,x))}else Am(o,a)||(x.current=a,j(o,x))},[n,W,a,c,d,o,E,j,s,l,F,p,h,O]),Gu(()=>{if(!!s&&!n&&W){var $,U;const Z=I==null||($=I.nodesRef.current.find(ge=>ge.id===T))==null||(U=$.context)==null?void 0:U.refs.floating.current;Z&&!Z.contains(TH(hC(Z)))&&Z.focus({preventScroll:!0})}},[s,n,W,I,T]),Gu(()=>{G.current=null});function S($){if(R.current=!0,d&&fAe($.key,F,p)){Yu($),r(!1),rAe(i.domReference.current)&&i.domReference.current.focus();return}const U=x.current,Z=$C(o,w),ge=wH(o,w);if($.key==="Home"&&(x.current=Z,E(x.current)),$.key==="End"&&(x.current=ge,E(x.current)),g>1){const he=x.current;if($.key===bC){if(Yu($),he===-1)x.current=ge;else if(x.current=$n(o,{startingIndex:he,amount:g,decrement:!0,disabledIndices:w}),f&&(he-g<Z||x.current<0)){const Te=he%g,et=ge%g,Ft=ge-(et-Te);et===Te?x.current=ge:x.current=et>Te?Ft:Ft-g}Am(o,x.current)&&(x.current=he),E(x.current)}if($.key===Q_&&(Yu($),he===-1?x.current=Z:(x.current=$n(o,{startingIndex:he,amount:g,disabledIndices:w}),f&&he+g>ge&&(x.current=$n(o,{startingIndex:he%g-g,amount:g,disabledIndices:w}))),Am(o,x.current)&&(x.current=he),E(x.current)),F==="both"){const Te=Math.floor(he/g);$.key===km&&(Yu($),he%g!==g-1?(x.current=$n(o,{startingIndex:he,disabledIndices:w}),f&&e$(x.current,g,Te)&&(x.current=$n(o,{startingIndex:he-he%g-1,disabledIndices:w}))):f&&(x.current=$n(o,{startingIndex:he-he%g-1,disabledIndices:w})),e$(x.current,g,Te)&&(x.current=he)),$.key===$d&&(Yu($),he%g!==0?(x.current=$n(o,{startingIndex:he,disabledIndices:w,decrement:!0}),f&&e$(x.current,g,Te)&&(x.current=$n(o,{startingIndex:he+(g-he%g),decrement:!0,disabledIndices:w}))):f&&(x.current=$n(o,{startingIndex:he+(g-he%g),decrement:!0,disabledIndices:w})),e$(x.current,g,Te)&&(x.current=he));const et=Math.floor(ge/g)===Te;Am(o,x.current)&&(f&&et?x.current=$.key===$d?ge:$n(o,{startingIndex:he-he%g-1,disabledIndices:w}):x.current=he),E(x.current);return}}if(OH($.key,F)){if(Yu($),n&&!h&&TH($.currentTarget.ownerDocument)===$.currentTarget){x.current=_C($.key,F,p)?Z:ge,E(x.current);return}_C($.key,F,p)?f?x.current=U>=ge?l&&U!==o.current.length?-1:Z:$n(o,{startingIndex:U,disabledIndices:w}):x.current=Math.min(ge,$n(o,{startingIndex:U,disabledIndices:w})):f?x.current=U<=Z?l&&U!==-1?o.current.length:ge:$n(o,{startingIndex:U,decrement:!0,disabledIndices:w}):x.current=Math.max(Z,$n(o,{startingIndex:U,decrement:!0,disabledIndices:w})),Am(o,x.current)?E(null):E(x.current)}}return s?{reference:{...h&&n&&a!=null&&{"aria-activedescendant":L},onKeyDown($){if(R.current=!0,h&&n)return S($);if(($.key.indexOf("Arrow")===0||$.key==="Enter"||$.key===" "||$.key==="")&&(G.current=$.key),d){lAe($.key,F,p)&&(Yu($),n?(x.current=$C(o,w),E(x.current)):r(!0));return}OH($.key,F)&&(c!=null&&(x.current=c),Yu($),!n&&b?r(!0):S($),n&&E(x.current))}},floating:{"aria-orientation":F==="both"?void 0:F,...h&&a!=null&&{"aria-activedescendant":L},onKeyDown:S,onPointerMove(){R.current=!1}},item:{onFocus($){let{currentTarget:U}=$;const Z=o.current.indexOf(U);Z!==-1&&E(Z)},onClick:$=>{let{currentTarget:U}=$;return U.focus({preventScroll:!0})},...y&&{onMouseMove($){let{currentTarget:U}=$;const Z=U;if(Z){const ge=o.current.indexOf(Z);ge!==-1&&E(ge)}},onPointerLeave(){if(!R.current&&(x.current=-1,j(o,x),E(null),!h)){var $;($=i.floating.current)==null||$.focus({preventScroll:!0})}}}}}:{}};function pAe(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:a}=e,u=tCe(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 y=d+p.index;let b=y+p[0].length;return r&&s.test(f.slice(b-1,b+1))&&(p[0]+=" ",b+=1),y<a.pos&&b>=a.pos?{range:{from:y,to:b},query:p[0].slice(n.length),text:p[0]}:null}const hAe=new ku("suggestion");function mAe({pluginKey:e=hAe,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 Vr({key:e,view(){return{update:async(v,y)=>{var b,w,F,g,T,I,W;const E=(b=this.key)===null||b===void 0?void 0:b.getState(y),J=(w=this.key)===null||w===void 0?void 0:w.getState(v.state),q=E.active&&J.active&&E.range.from!==J.range.from,x=!E.active&&J.active,G=E.active&&!J.active,O=!x&&!G&&E.query!==J.query,R=x||q,k=O&&!q,L=G||q;if(!R&&!k&&!L)return;const z=L&&!R?E:J,j=v.dom.querySelector(`[data-decoration-id="${z.decorationId}"]`);d={editor:t,range:z.range,query:z.query,text:z.text,items:[],command:S=>{s({editor:t,range:z.range,props:S})},decorationNode:j,clientRect:j?()=>{var S;const{decorationId:$}=(S=this.key)===null||S===void 0?void 0:S.getState(t.state),U=v.dom.querySelector(`[data-decoration-id="${$}"]`);return(U==null?void 0:U.getBoundingClientRect())||null}:null},R&&((F=p==null?void 0:p.onBeforeStart)===null||F===void 0||F.call(p,d)),k&&((g=p==null?void 0:p.onBeforeUpdate)===null||g===void 0||g.call(p,d)),(k||R)&&(d.items=await c({editor:t,query:z.query})),L&&((T=p==null?void 0:p.onExit)===null||T===void 0||T.call(p,d)),k&&((I=p==null?void 0:p.onUpdate)===null||I===void 0||I.call(p,d)),R&&((W=p==null?void 0:p.onStart)===null||W===void 0||W.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,y,b,w){const{isEditable:F}=t,{composing:g}=t.view,{selection:T}=v,{empty:I,from:W}=T,E={...y};if(E.composing=g,F&&(I||t.view.composing)){(W<y.range.from||W>y.range.to)&&!g&&!y.composing&&(E.active=!1);const J=pAe({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:T.$from}),q=`id_${Math.floor(Math.random()*4294967295)}`;J&&f({editor:t,state:w,range:J.range})?(E.active=!0,E.decorationId=y.decorationId?y.decorationId:q,E.range=J.range,E.query=J.query,E.text=J.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,y){var b;const{active:w,range:F}=h.getState(v.state);return w&&((b=p==null?void 0:p.onKeyDown)===null||b===void 0?void 0:b.call(p,{view:v,event:y,range:F}))||!1},decorations(v){const{active:y,range:b,decorationId:w}=h.getState(v);return y?Vt.create(v.doc,[Tr.inline(b.from,b.to,{nodeName:a,class:u,"data-decoration-id":w})]):null}}});return h}function EH(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=EH(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function vAe(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=EH(e))&&(r&&(r+=" "),r+=t);return r}const gAe=wr.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",dn(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),yo={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"},n$=()=>(++n$.i).toString();n$.i=0;const yAe=e=>{const t=bAe(e),n=[];for(let r=0;r<t.length;r++)n.push(RH(t[r]));return{key:n$(),children:n}},Wm=(e,t=[])=>({key:n$(),type:e.type,text:"text"in e?e.text:void 0,node:e,children:t}),SC=e=>Wm({type:yo.span,text:e,spans:[]}),bAe=e=>{const t=e.slice(0);for(let n=0;n<t.length;n++){const r=t[n];if(r.type===yo.listItem||r.type===yo.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===yo.listItem?t[n]={type:yo.list,items:i}:t[n]={type:yo.oList,items:i}}}return t},RH=e=>{if("text"in e)return Wm(e,MH(e.spans,e));if("items"in e){const t=[];for(let n=0;n<e.items.length;n++)t.push(RH(e.items[n]));return Wm(e,t)}return Wm(e)},MH=(e,t,n)=>{if(!e.length)return[SC(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(SC(t.text.slice(0,s)));const d={...a,text:l};i.push(Wm(d,MH(f,{...t,text:l},a))),c<t.text.length&&i.push(SC(t.text.slice(c,r[o+1]?r[o+1].start-u:void 0)))}return i},_Ae=(e,t)=>CH(yAe(e).children,t),CH=(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const i=e[r],o=t(i.type,i.node,i.text,CH(i.children,t),i.key);o!=null&&n.push(o)}return n};yo.listItem+"",yo.oListItem+"",yo.list+"",yo.oList+"";const $Ae=wr.create({name:"text",group:"inline"}),SAe={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)}},xH={fromPrismic(e){return t=>{var n;return(n=EC.find(r=>r.richTextNodeTypes[0]===t.type))==null?void 0:n.converter.fromPrismic(e)(t)}},toPrismic(e,t,n){const[r,i]=(()=>{const o=EC.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}:{}}}},kH=$Ae.extend({name:"text"}),TAe={fromPrismic(e){return function(t,n,r=!1){const i={type:t,text:n.content.text,spans:n.content.spans||[]};return _Ae([i],IAe(e,r))[0]}},toPrismic(e,t,n){const r=Uc.children.reduce(e,(i,o)=>{const a=(()=>o.type.name===q_.name?q_.converter.toPrismic(o):o.textContent)(),u=a?i.text+a:i.text,s=i.text.length,c=u.length,l=(()=>o.marks.length?Uc.marks.map(o,d=>xH.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:[...SAe.mergeOverlap(r.spans)].sort((i,o)=>i.type.localeCompare(o.type))},...n}}};function IAe(e,t=!1){return(n,r,i,o)=>{if(n==="span"&&i&&i.length)return t?[e.text(i)]:q_.splitTextToNodes(e,i)(a=>e.text(a));{const a=xH.fromPrismic(e)(r);return a?q0(o).map(s=>s.mark([...s.marks,a].sort((c,l)=>c.type.name.localeCompare(l.type.name)))):q0(o)}}}const Bc={name:kH.name,component:kH,converter:TAe};var AH=(e=>(e.LeftToRight="ltr",e.RightToLeft="rtl",e))(AH||{});const zc="text-direction",OAe=Ce.RichTextNodeType.rtl,wAe=Or.create({name:"textDirection",addOptions(){return{supportedExtensionNames:[]}},addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{[zc]:{default:"ltr",parseHTML:e=>e.attributes.dir?"rtl":"ltr",renderHTML:e=>e[zc]==="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,{[zc]:"rtl"})),setLeftToRight:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.resetAttributes(t,zc))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),Ma={parseNodeAttrsDirection(e){switch(e[zc]){case"rtl":return"rtl";default:return"ltr"}},fromPrismic(e){const t=(()=>{switch(e.direction){case"rtl":return"rtl";default:return"ltr"}})();return{[zc]:t}},toPrismic(e){return{direction:this.parseNodeAttrsDirection(e.attrs)}}},r$=gAe.extend({name:"paragraph",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",dn(this.options.HTMLAttributes,e),0]}}),EAe={fromPrismic(e){return function(t){var r;const n=Bc.converter.fromPrismic(e)(r$.name,t);return(r=e.nodes[r$.name])==null?void 0:r.create(Ma.fromPrismic(t),n)}},toPrismic(e){return Bc.converter.toPrismic(e,Ce.RichTextNodeType.paragraph,Ma.toPrismic(e))}},Zu=new gd([Ce.RichTextNodeType.paragraph],r$.name,r$,EAe,"Type '/' for commands"),WH=["ArrowDown","ArrowUp","End","Home"],NH=["Enter"],RAe=["Escape",...WH,...NH],MAe=Or.create({name:"slash-commands",addOptions(){return{nodeTypes:[]}},addProseMirrorPlugins(){const e=s$(UH,this.options.nodeTypes);return e.length>1?[mAe({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow:({state:t})=>{const n=t.selection.$from;return n.parent.type.name===Zu.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 J5(CAe,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate:n=>{t==null||t.updateProps(n)},onKeyDown:({event:n})=>{var r;return RAe.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()}}}})]:[]}}),CAe=ie.forwardRef(function({command:t,decorationNode:n,editor:r,items:i},o){const[a,u]=ie.useState(!0),s=parseFloat(A.tokens.space["8px"]),{context:c,floating:l,reference:f,strategy:d,x:p,y:h}=iAe({middleware:[kke(s),Cke(),Ake({limiter:Wke()})],onOpenChange:u,open:a,placement:"top-start",strategy:"fixed",whileElementsMounted:Jke});ie.useLayoutEffect(()=>{f(n)},[f,n]),ie.useEffect(()=>{let x;const G=()=>{x=setTimeout(()=>{u(!0)})},O=()=>{u(!1)};return r.on("focus",G).on("blur",O),()=>{r.off("focus",G).off("blur",O),clearTimeout(x)}},[r]);const[v,y]=ie.useState(0),b=ie.useRef([]),[w,F]=ie.useState();i!==w&&(y(0),b.current=[],F(i));const{getFloatingProps:g,getItemProps:T,getReferenceProps:I}=oAe([cAe(c,{outsidePointerDown:!1}),dAe(c,{activeIndex:v,listRef:b,onNavigate:x=>{y(G=>x!=null?x:G)},openOnArrowKeyDown:!1,virtual:!0}),sAe(c,{role:"menu"})]),E=I().onKeyDown;ie.useImperativeHandle(o,()=>({handleKeyDown:x=>{if(a){if(WH.includes(x.key)&&E(x),NH.includes(x.key)){const G=i[v];G!==void 0&&t(G)}return!0}else return!1}}),[v,t,i,E,a]);const J=p!==null&&h!==null,q=ie.useId();return a?qe("div",{...g(),className:A.dropdownMenuStyles.content,ref:l,style:{top:parseFloat(A.tokens.space["0px"]),left:parseFloat(A.tokens.space["0px"]),minWidth:256,position:d,transform:J?`translate3d(${Math.round(p)}px, ${Math.round(h)}px, 0)`:"translate3d(0, -200%, 0)"},children:[i.map((x,G)=>{var O;return ie.createElement(PH,{...T({onClick:()=>{t(x)},onPointerDown:R=>{R.preventDefault()}}),"data-highlighted":G===v?"":void 0,id:`${q}[${G}]`,key:x.nodeType,ref:R=>{b.current[G]=R},shortcut:`/${(O=x.shortText)!=null?O:""}`,startIcon:x.icon},x.text)}),i.length===0?C(PH,{...T({onPointerDown:x=>{x.preventDefault()}}),disabled:!0,id:`${q}[0]`,ref:x=>{b.current[0]=x},children:"No results"}):null]}):null}),PH=ie.forwardRef(function({children:t,disabled:n,shortcut:r,startIcon:i,...o},a){return qe("div",{...o,...n?{"aria-disabled":!0,"data-disabled":!0}:{},className:A.dropdownMenuStyles.item,ref:a,role:"menuitem",children:[ie.isValidElement(i)?ie.cloneElement(i,{className:vAe(i.props.className,A.dropdownMenuStyles.itemStartIcon)}):null,C(A.Text,{className:A.dropdownMenuStyles.itemText,component:"span",children:t}),r?C(A.Text,{className:A.dropdownMenuStyles.itemShortcut,color:"inherit",component:"span",variant:"inherit",weight:"inherit",children:r}):null]})});function xAe(e,t){var o;const n=t.map(a=>a.richTextNodeTypes).flat(),r=m(t,fi(a=>a.nodeType===vd.Text),Dv({},(a,u)=>({...a,[u.name]:u.placeholder}))),i=n.includes(Ce.RichTextNodeType.orderedList)||n.includes(Ce.RichTextNodeType.list);return fi(a=>a!==void 0)([uC.component(((o=e.config)==null?void 0:o.single)===void 0),Bc.component,q_.component,_ke(r),i?yd.component:void 0,MAe.configure({nodeTypes:n})])}const TC=lke.extend({name:"bulletList",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",dn(this.options.HTMLAttributes,e),0]}}).configure({itemTypeName:"listItem"}),kAe={fromPrismic(e){return function(t){var r;const n=yd.converter.fromPrismic(e)(t);if(!!n)return(r=e.nodes[TC.name])==null?void 0:r.create(Ma.fromPrismic(t),n)}},toPrismic(e){return g0(Uc.children.map(e,t=>fi(n=>n!==void 0)(yd.converter.toPrismic(t,Ce.RichTextNodeType.list))))}},i$=new iC([Ce.RichTextNodeType.list],TC.name,TC,kAe),AAe=/^```([a-z]+)?[\s\n]$/,WAe=/^~~~([a-z]+)?[\s\n]$/,o$=wr.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",dn(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
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var u=i.reduce(function(s,c){var l=c&&Rwe(c,r);return l&&s.push(l),s},[]);return kh(e)?u[0]:u}Nh.defaultProps=Cr,Nh.setDefaultProps=Twe,Nh.currentInput=co,Object.assign({},hH,{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)}}),Nh.setDefaultProps({render:XH});var db=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ewe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var QH=Ewe,Cwe=typeof db=="object"&&db&&db.Object===Object&&db,Mwe=Cwe,xwe=Mwe,kwe=typeof self=="object"&&self&&self.Object===Object&&self,Awe=xwe||kwe||Function("return this")(),e5=Awe,Nwe=e5,Fwe=function(){return Nwe.Date.now()},Wwe=Fwe,Pwe=/\s/;function Lwe(e){for(var t=e.length;t--&&Pwe.test(e.charAt(t)););return t}var Dwe=Lwe,jwe=Dwe,qwe=/^\s+/;function Uwe(e){return e&&e.slice(0,jwe(e)+1).replace(qwe,"")}var Bwe=Uwe,zwe=e5,Kwe=zwe.Symbol,t5=Kwe,n5=t5,r5=Object.prototype,Vwe=r5.hasOwnProperty,Hwe=r5.toString,Fh=n5?n5.toStringTag:void 0;function Gwe(e){var t=Vwe.call(e,Fh),n=e[Fh];try{e[Fh]=void 0;var r=!0}catch{}var i=Hwe.call(e);return r&&(t?e[Fh]=n:delete e[Fh]),i}var Jwe=Gwe,Ywe=Object.prototype,Zwe=Ywe.toString;function Xwe(e){return Zwe.call(e)}var Qwe=Xwe,i5=t5,eRe=Jwe,tRe=Qwe,nRe="[object Null]",rRe="[object Undefined]",o5=i5?i5.toStringTag:void 0;function iRe(e){return e==null?e===void 0?rRe:nRe:o5&&o5 in Object(e)?eRe(e):tRe(e)}var oRe=iRe;function aRe(e){return e!=null&&typeof e=="object"}var uRe=aRe,sRe=oRe,cRe=uRe,lRe="[object Symbol]";function fRe(e){return typeof e=="symbol"||cRe(e)&&sRe(e)==lRe}var dRe=fRe,pRe=Bwe,a5=QH,hRe=dRe,u5=0/0,mRe=/^[-+]0x[0-9a-f]+$/i,vRe=/^0b[01]+$/i,gRe=/^0o[0-7]+$/i,yRe=parseInt;function bRe(e){if(typeof e=="number")return e;if(hRe(e))return u5;if(a5(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=a5(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=pRe(e);var n=vRe.test(e);return n||gRe.test(e)?yRe(e.slice(2),n?2:8):mRe.test(e)?u5:+e}var _Re=bRe,SRe=QH,YE=Wwe,s5=_Re,$Re="Expected a function",TRe=Math.max,IRe=Math.min;function ORe(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($Re);t=s5(t)||0,SRe(n)&&(l=!!n.leading,f="maxWait"in n,o=f?TRe(s5(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d);function p(T){var C=r,R=i;return r=i=void 0,c=T,a=e.apply(R,C),a}function h(T){return c=T,u=setTimeout(_,t),l?p(T):a}function v(T){var C=T-s,R=T-c,q=t-C;return f?IRe(q,o-R):q}function m(T){var C=T-s,R=T-c;return s===void 0||C>=t||C<0||f&&R>=o}function _(){var T=YE();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(YE())}function $(){var T=YE(),C=m(T);if(r=arguments,i=this,s=T,C){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 wRe=ORe;class RRe{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&&RE(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(IOe(d.selection)){const $=u.nodeDOM(g);if($)return $.getBoundingClientRect()}return OOe(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=Nh(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?wRe(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 c5=e=>new Vr({key:typeof e.pluginKey=="string"?new lu(e.pluginKey):e.pluginKey,view:t=>new RRe({view:t,...e})});Rr.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[c5({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});const ERe=e=>{const[t,n]=K.useState(null);return K.useEffect(()=>{if(!t||e.editor.isDestroyed)return;const{pluginKey:r="bubbleMenu",editor:i,tippyOptions:o={},updateDelay:a,shouldShow:u=null}=e,s=c5({updateDelay:a,editor:i,element:t,pluginKey:r,shouldShow:u,tippyOptions:o});return i.registerPlugin(s),()=>i.unregisterPlugin(r)},[e.editor,t]),K.createElement("div",{ref:n,className:e.className,style:{visibility:"hidden"}},e.children)};class CRe extends zOe{constructor(){super(...arguments),this.contentComponent=null}}const MRe=({renderers:e})=>K.createElement(K.Fragment,null,Object.entries(e).map(([t,n])=>Wb.createPortal(n.reactElement,n.element,t)));class xRe extends K.Component{constructor(t){super(t),this.editorContentRef=K.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?Wb.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 K.createElement(K.Fragment,null,K.createElement("div",{ref:this.editorContentRef,...n}),K.createElement(MRe,{renderers:this.state.renderers}))}}const kRe=K.memo(xRe),ARe=K.createContext({onDragStart:void 0}),NRe=()=>K.useContext(ARe);K.forwardRef((e,t)=>{const{onDragStart:n}=NRe(),r=e.as||"div";return K.createElement(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function FRe(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function WRe(e){var t;return typeof e=="object"&&((t=e.$$typeof)===null||t===void 0?void 0:t.toString())==="Symbol(react.forward_ref)"}class PRe{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;(FRe(r)||WRe(r))&&(i.ref=o=>{this.ref=o}),this.reactElement=K.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 LRe(){const[,e]=K.useState(0);return()=>e(t=>t+1)}const DRe=(e={},t=[])=>{const[n,r]=K.useState(null),i=LRe();return K.useEffect(()=>{let o=!0;const a=new CRe(e);return r(a),a.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{o&&i()})})}),()=>{a.destroy(),o=!1}},t),n},jRe=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,qRe=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,URe=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,BRe=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,zRe=kE.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",_n(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[rb({find:jRe,type:this.type}),rb({find:URe,type:this.type})]},addPasteRules(){return[ib({find:qRe,type:this.type}),ib({find:BRe,type:this.type})]}});var ZE=(e=>(e.Document="document",e.Mark="mark",e.Node="node",e))(ZE||{}),wf=(e=>(e.Text="text",e.Embed="embed",e.Image="image",e))(wf||{});class KRe{constructor(t,n,r){Uh(this,"extType","document");this.name=t,this.component=n,this.converter=r}}class l5{constructor(t,n,r,i){Uh(this,"extType","mark");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i}}class Rf{constructor(t,n,r,i,o,a=!1){Uh(this,"extType","node");Uh(this,"nodeType","text");this.richTextNodeTypes=t,this.name=n,this.component=r,this.converter=i,this.placeholder=o,this.lockedFormat=a}}class VRe extends Rf{constructor(t,n,r,i,o){super(t,"heading",n,i,o),this.levels=r}}class XE extends Rf{constructor(t,n,r,i){super(t,n,r,i)}}const QE=zRe.extend({name:"bold"}),HRe={fromPrismic(e){return function(){var t;return(t=e.marks[QE.name])==null?void 0:t.create()}},toPrismic(){}},f5=new l5([Pe.RichTextNodeType.strong],QE.name,QE,HRe),GRe=/^\s*([-+*])\s$/,JRe=Gr.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",_n(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[lH({find:GRe,type:this.type})]}}),d5=Gr.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",_n(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()}}}),cc={isHardBreak(e){return e.type.name===d5.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 YRe(e){if(!e||!e.size)return{defaultTextConverter:void 0,extensions:n6()};const t=n6(e),n=Array.from(e.values()),r=(()=>{const a=fi(c=>n.some(l=>c.richTextNodeTypes.includes(l)))(t),u=a.some(c=>c instanceof XE)?[Eu,...a]:a;return u.some(c=>c instanceof Rf)?u:[t6,...u]})(),i=r.find(a=>a instanceof Rf)||t6;function o(a){return u=>i.converter.fromPrismic(a)({...u,type:i.richTextNodeTypes[0]})}return{defaultTextConverter:o,extensions:r}}function ZRe(e){if(!(e!=null&&e.single)&&!(e!=null&&e.multi))return;const t=y((e.single||e.multi||"").split(/\s*,\s*/),Um(n=>c_(()=>{})(Pe.RichTextNodeTypeCodec.decode(n))),fi(ho));return new Set(t)}function XRe(e){const t=ZRe(e);return YRe(t)}const QRe=Gr.create({name:"doc",topNode:!0,content:"block+"}),p5=Gr.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",_n(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)}}}),Ef={component:p5,converter:{fromPrismic(e){return function(t){var r;const n=Eu.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[p5.name])==null?void 0:r.create({},n)}},toPrismic(e,t){return cc.children.reduce(e,(n,r)=>{const i=Eu.converter.toPrismic(r),o=(()=>i instanceof Array?i.map(a=>({...a,type:t})):i?[{...i,type:t}]:[])();return[...n,...o]},[])}},placeholder:"List"};function eEe(e){return e.slice(1,e.length).reduce((t,n)=>t.copy(t.content.append(n.content)),e[0])}const eC="document",tEe=e=>QRe.extend({name:eC,content:e?"block+":"block"}),nEe=e=>({fromPrismic(t,n){function r(i){return function(o=void 0){return!o&&n&&_t.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 wf.Embed:return _t.EmbedBlock.is(s)&&c.converter.fromPrismic(t)(s);case wf.Text:return _t.TextBlock.is(s)&&c.converter.fromPrismic(t)(s);case wf.Image:return _t.ImageBlock.is(s)&&c.converter.fromPrismic(t)(s);default:return}})(),[f,d]=y(u,AS(u.length-1),([h,v])=>[h,kS(v)]),p=(()=>l?y(d,wo(()=>({merged:!1,node:l}),h=>l.type.name===h.type.name&&(l.type.name===Mb.name||l.type.name===Ab.name)?{merged:!0,node:eEe([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[eC])==null?void 0:a.create({},o)}},toPrismic(t){return{__TYPE__:"StructuredTextContent",value:[...cc.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},[])]}}}),tC=new KRe(eC,tEe,nEe),pb=d5.extend({name:"hard_break"}),hb=`
|
|
145
|
+
`,h5={fromPrismic(e){return function(t){var n;if(t===hb)return(n=e.nodes[pb.name])==null?void 0:n.create({})}},toPrismic(e){if(e.type.name===pb.name)return hb}},nC={isEmptyLine(e){return e.length===0},isFirst(e){return e===0}};function rEe(e,t){return function(n){const r=h5.fromPrismic(e)(hb);if(!r)return[n(t)];const i=t.split(hb);return i.length===1?t.length?[n(t)]:[r]:i.reduce((o,a,u)=>nC.isFirst(u)?nC.isEmptyLine(a)?o:[...o,n(a)]:nC.isEmptyLine(a)?[...o,r]:[...o,r,n(a)],[])}}const mb={name:pb.name,component:pb,converter:h5,splitTextToNodes:rEe},iEe=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 Vr({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=wr.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}),jt.create(e,i)}}})]}}),oEe=e=>iEe.configure({includeChildren:!0,placeholder:({editor:t,hasAnchor:n,node:r})=>{const i=!cc.children.exists(t.state.doc,u=>u===r),o=(()=>{const u=t.isEditable,s=t.isFocused&&n,c=r.type.name!==Eu.name;return u&&(s||c||i)})(),a=(()=>{if(i)return Ef.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 vb(e){return e.split("-")[1]}function m5(e){return e==="y"?"height":"width"}function Tu(e){return e.split("-")[0]}function Wh(e){return["top","bottom"].includes(Tu(e))?"x":"y"}function v5(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=Wh(t),s=m5(u),c=r[s]/2-i[s]/2,l=Tu(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(vb(t)){case"start":d[u]-=c*(n&&f?-1:1);break;case"end":d[u]+=c*(n&&f?-1:1);break}return d}const aEe=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}=v5(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}=v5(c,d,s)),v=-1;continue}}return{x:l,y:f,placement:d,strategy:i,middlewareData:p}};function uEe(e){return{top:0,right:0,bottom:0,left:0,...e}}function sEe(e){return typeof e!="number"?uEe(e):{top:e,right:e,bottom:e,left:e}}function rC(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function g5(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=sEe(p),m=u[d?f==="floating"?"reference":"floating":f],_=rC(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},$=rC(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 cEe=Math.min,lEe=Math.max;function y5(e,t,n){return lEe(e,cEe(t,n))}const fEe={left:"right",right:"left",bottom:"top",top:"bottom"};function gb(e){return e.replace(/left|right|bottom|top/g,t=>fEe[t])}function dEe(e,t,n){n===void 0&&(n=!1);const r=vb(e),i=Wh(e),o=m5(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=gb(a)),{main:a,cross:gb(a)}}const pEe={start:"end",end:"start"};function iC(e){return e.replace(/start|end/g,t=>pEe[t])}function hEe(e){const t=gb(e);return[iC(e),t,iC(t)]}function mEe(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 vEe(e,t,n,r){const i=vb(e);let o=mEe(Tu(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(iC)))),o}const gEe=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=Tu(r),_=Tu(a)===a,g=await(u.isRTL==null?void 0:u.isRTL(s.floating)),S=f||(_||!h?[gb(a)]:hEe(a));!f&&p!=="none"&&S.push(...vEe(a,h,p,g));const b=[a,...S],$=await g5(t,v),T=[];let C=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&T.push($[m]),l){const{main:A,cross:Y}=dEe(r,o,g);T.push($[A],$[Y])}if(C=[...C,{placement:r,overflows:T}],!T.every(A=>A<=0)){var R,q;const A=(((R=i.flip)==null?void 0:R.index)||0)+1,Y=b[A];if(Y)return{data:{index:A,overflows:C},reset:{placement:Y}};let ie=(q=C.filter(J=>J.overflows[0]<=0).sort((J,ge)=>J.overflows[1]-ge.overflows[1])[0])==null?void 0:q.placement;if(!ie)switch(d){case"bestFit":{var G;const J=(G=C.map(ge=>[ge.placement,ge.overflows.filter(Te=>Te>0).reduce((Te,M)=>Te+M,0)]).sort((ge,Te)=>ge[1]-Te[1])[0])==null?void 0:G[0];J&&(ie=J);break}case"initialPlacement":ie=a;break}if(r!==ie)return{reset:{placement:ie}}}return{}}}};async function yEe(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Tu(n),u=vb(n),s=Wh(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 bEe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await yEe(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function b5(e){return e==="x"?"y":"x"}const _Ee=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 g5(t,s),f=Wh(Tu(i)),d=b5(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=y5(g,p,S)}if(a){const m=d==="y"?"top":"left",_=d==="y"?"bottom":"right",g=h+l[m],S=h-l[_];h=y5(g,h,S)}const v=u.fn({...t,[f]:p,[d]:h});return{...v,data:{x:v.x-n,y:v.y-r}}}}},SEe=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=Wh(i),d=b5(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(Tu(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 Mr(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function lo(e){return Mr(e).getComputedStyle(e)}const _5=Math.min,Ph=Math.max,yb=Math.round;function S5(e){const t=lo(e);let n=parseFloat(t.width),r=parseFloat(t.height);const i=e.offsetWidth,o=e.offsetHeight,a=yb(n)!==i||yb(r)!==o;return a&&(n=i,r=o),{width:n,height:r,fallback:a}}function Iu(e){return T5(e)?(e.nodeName||"").toLowerCase():""}let bb;function $5(){if(bb)return bb;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(bb=e.brands.map(t=>t.brand+"/"+t.version).join(" "),bb):navigator.userAgent}function fo(e){return e instanceof Mr(e).HTMLElement}function Ai(e){return e instanceof Mr(e).Element}function T5(e){return e instanceof Mr(e).Node}function I5(e){if(typeof ShadowRoot>"u")return!1;const t=Mr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function _b(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=lo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function $Ee(e){return["table","td","th"].includes(Iu(e))}function oC(e){const t=/firefox/i.test($5()),n=lo(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 aC(){return/^((?!chrome|android).)*safari/i.test($5())}function uC(e){return["html","body","#document"].includes(Iu(e))}function O5(e){return Ai(e)?e:e.contextElement}const w5={x:1,y:1};function Cf(e){const t=O5(e);if(!fo(t))return w5;const n=t.getBoundingClientRect(),{width:r,height:i,fallback:o}=S5(t);let a=(o?yb(n.width):n.width)/r,u=(o?yb(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}function lc(e,t,n,r){var i,o;t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),u=O5(e);let s=w5;t&&(r?Ai(r)&&(s=Cf(r)):s=Cf(e));const c=u?Mr(u):window,l=aC()&&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=Mr(u),m=r&&Ai(r)?Mr(r):r;let _=v.frameElement;for(;_&&r&&m!==v;){const g=Cf(_),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,_=Mr(_).frameElement}}return{width:p,height:h,top:d,right:f+p,bottom:d+h,left:f,x:f,y:d}}function Ou(e){return((T5(e)?e.ownerDocument:e.document)||window.document).documentElement}function Sb(e){return Ai(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function TEe(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=fo(n),o=Ou(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")&&((Iu(n)!=="body"||_b(o))&&(a=Sb(n)),fo(n))){const c=lc(n);u=Cf(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 R5(e){return lc(Ou(e)).left+Sb(e).scrollLeft}function IEe(e){const t=Ou(e),n=Sb(e),r=e.ownerDocument.body,i=Ph(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Ph(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+R5(e);const u=-n.scrollTop;return lo(r).direction==="rtl"&&(a+=Ph(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:u}}function Lh(e){if(Iu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||I5(e)&&e.host||Ou(e);return I5(t)?t.host:t}function E5(e){const t=Lh(e);return uC(t)?t.ownerDocument.body:fo(t)&&_b(t)?t:E5(t)}function fc(e,t){var n;t===void 0&&(t=[]);const r=E5(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Mr(r);return i?t.concat(o,o.visualViewport||[],_b(r)?r:[]):t.concat(r,fc(r))}function OEe(e,t){const n=Mr(e),r=Ou(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=aC();(!c||c&&t==="fixed")&&(u=i.offsetLeft,s=i.offsetTop)}return{width:o,height:a,x:u,y:s}}function wEe(e,t){const n=lc(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=fo(e)?Cf(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 C5(e,t,n){let r;if(t==="viewport")r=OEe(e,n);else if(t==="document")r=IEe(Ou(e));else if(Ai(t))r=wEe(t,n);else{const a={...t};if(aC()){var i,o;const u=Mr(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 rC(r)}function REe(e,t){const n=t.get(e);if(n)return n;let r=fc(e).filter(u=>Ai(u)&&Iu(u)!=="body"),i=null;const o=lo(e).position==="fixed";let a=o?Lh(e):e;for(;Ai(a)&&!uC(a);){const u=lo(a),s=oC(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=Lh(a)}return t.set(e,r),r}function EEe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?REe(t,this._c):[].concat(n),r],u=a[0],s=a.reduce((c,l)=>{const f=C5(t,l,i);return c.top=Ph(f.top,c.top),c.right=_5(f.right,c.right),c.bottom=_5(f.bottom,c.bottom),c.left=Ph(f.left,c.left),c},C5(t,u,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function CEe(e){return fo(e)?S5(e):e.getBoundingClientRect()}function M5(e,t){return!fo(e)||lo(e).position==="fixed"?null:t?t(e):e.offsetParent}function MEe(e){let t=Lh(e);for(;fo(t)&&!uC(t);){if(oC(t))return t;t=Lh(t)}return null}function x5(e,t){const n=Mr(e);let r=M5(e,t);for(;r&&$Ee(r)&&lo(r).position==="static";)r=M5(r,t);return r&&(Iu(r)==="html"||Iu(r)==="body"&&lo(r).position==="static"&&!oC(r))?n:r||MEe(e)||n}function xEe(e,t,n){const r=fo(t),i=Ou(t),o=lc(e,!0,n==="fixed",t);let a={scrollLeft:0,scrollTop:0};const u={x:0,y:0};if(r||!r&&n!=="fixed")if((Iu(t)!=="body"||_b(i))&&(a=Sb(t)),fo(t)){const s=lc(t,!0);u.x=s.x+t.clientLeft,u.y=s.y+t.clientTop}else i&&(u.x=R5(i));return{x:o.left+a.scrollLeft-u.x,y:o.top+a.scrollTop-u.y,width:o.width,height:o.height}}const kEe={getClippingRect:EEe,convertOffsetParentRelativeRectToViewportRelativeRect:TEe,isElement:Ai,getDimensions:CEe,getOffsetParent:x5,getDocumentElement:Ou,getScale:Cf,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||x5,o=this.getDimensions;return{reference:xEe(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>lo(e).direction==="rtl"};function AEe(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?[...Ai(e)?fc(e):e.contextElement?fc(e.contextElement):[],...fc(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}),Ai(e)&&!u&&l.observe(e),!Ai(e)&&e.contextElement&&!u&&l.observe(e.contextElement),l.observe(t)}let f,d=u?lc(e):null;u&&p();function p(){const h=lc(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 NEe=(e,t,n)=>{const r=new Map,i={platform:kEe,...n},o={...i.platform,_c:r};return aEe(e,t,{...i,platform:o})};var $b=typeof document<"u"?K.useLayoutEffect:K.useEffect;function Tb(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(!Tb(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)&&!Tb(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function k5(e){const t=_e.useRef(e);return $b(()=>{t.current=e}),t}function FEe(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);Tb(c,r)||l(r);const f=_e.useRef(null),d=_e.useRef(null),p=_e.useRef(u),h=k5(o),v=k5(i),[m,_]=_e.useState(null),[g,S]=_e.useState(null),b=_e.useCallback(G=>{f.current!==G&&(f.current=G,_(G))},[]),$=_e.useCallback(G=>{d.current!==G&&(d.current=G,S(G))},[]),T=_e.useCallback(()=>{if(!f.current||!d.current)return;const G={placement:t,strategy:n,middleware:c};v.current&&(G.platform=v.current),NEe(f.current,d.current,G).then(A=>{const Y={...A,isPositioned:!0};C.current&&!Tb(p.current,Y)&&(p.current=Y,h6.flushSync(()=>{s(Y)}))})},[c,t,n,v]);$b(()=>{a===!1&&p.current.isPositioned&&(p.current.isPositioned=!1,s(G=>({...G,isPositioned:!1})))},[a]);const C=_e.useRef(!1);$b(()=>(C.current=!0,()=>{C.current=!1}),[]),$b(()=>{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 wu=typeof document<"u"?K.useLayoutEffect:K.useEffect;function WEe(){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 sC=!1,PEe=0;const A5=()=>"floating-ui-"+PEe++;function LEe(){const[e,t]=_e.useState(()=>sC?A5():void 0);return wu(()=>{e==null&&t(A5())},[]),_e.useEffect(()=>{sC||(sC=!0)},[]),e}const N5=_e["useId".toString()],F5=N5??LEe,DEe=_e.createContext(null),jEe=_e.createContext(null),W5=()=>{var e,t;return(e=(t=_e.useContext(DEe))==null?void 0:t.id)!=null?e:null},cC=()=>_e.useContext(jEe);function lC(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function P5(e){var t;return(t=lC(e).defaultView)!=null?t:window}function Ib(e){return e?e instanceof P5(e).Element:!1}function qEe(e){return e?e instanceof P5(e).HTMLElement:!1}const L5=_e["useInsertionEffect".toString()];function fC(e){const t=_e.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return L5?L5(()=>{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 UEe(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=cC(),f=_e.useRef(null),d=_e.useRef({}),p=_e.useState(()=>WEe())[0],h=FEe({placement:i,middleware:o,strategy:a,whileElementsMounted:r}),v=fC(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]);wu(()=>{const b=l==null?void 0:l.nodesRef.current.find($=>$.id===u);b&&(b.context=_)});const{reference:g}=h,S=_e.useCallback(b=>{(Ib(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 dC(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 BEe=function(e){return e===void 0&&(e=[]),{getReferenceProps:t=>dC(t,e,"reference"),getFloatingProps:t=>dC(t,e,"floating"),getItemProps:t=>dC(t,e,"item")}};function pC(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 D5(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 zEe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ru(e){e.preventDefault(),e.stopPropagation()}function KEe(e){const t=K.useRef(e);return wu(()=>{t.current=e}),t}function j5(e){const t=K.useRef();return wu(()=>{t.current=e},[e]),t.current}const VEe=function(e,t){let{open:n}=e,{enabled:r=!0,role:i="dialog"}=t===void 0?{}:t;const o=F5(),a=F5(),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 hC(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 HEe=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=cC(),h=W5()!=null,v=_e.useRef(!1);return _e.useEffect(()=>{if(!n||!u)return;function m($){if($.key==="Escape"){if(!d&&p&&pC(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 C=zEe($);if(Ib(C)&&i.floating.current){var R;const G=(R=i.floating.current.ownerDocument.defaultView)!=null?R:window,A=C.scrollWidth>C.clientWidth,Y=C.scrollHeight>C.clientHeight;let ie=Y&&$.offsetX>C.clientWidth;if(Y&&G.getComputedStyle(C).direction==="rtl"&&(ie=$.offsetX<=C.offsetWidth-C.clientWidth),ie||A&&$.offsetY>C.clientHeight)return}const q=p&&pC(p.nodesRef.current,a).some(G=>{var A;return hC($,(A=G.context)==null?void 0:A.refs.floating.current)});hC($,i.floating.current)||hC($,i.domReference.current)||q||!d&&p&&pC(p.nodesRef.current,a).length>0||(o.emit("dismiss",h?{preventScroll:!0}:!1),r(!1))}function g(){r(!1)}const S=lC(i.floating.current);s&&S.addEventListener("keydown",m),c&&S.addEventListener("pointerdown",_);const b=(f?[...Ib(i.reference.current)?fc(i.reference.current):[],...Ib(i.floating.current)?fc(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}}}:{}},mC="ArrowUp",Ob="ArrowDown",Mf="ArrowLeft",Dh="ArrowRight";function wb(e,t,n){return Math.floor(e/t)!==n}function jh(e,t){return t<0||t>=e.current.length}function Cn(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 Rb(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function q5(e,t){return Rb(t,e===mC||e===Ob,e===Mf||e===Dh)}function vC(e,t,n){return Rb(t,e===Ob,n?e===Mf:e===Dh)||e==="Enter"||e==" "||e===""}function GEe(e,t,n){return Rb(t,n?e===Mf:e===Dh,e===Ob)}function JEe(e,t,n){return Rb(t,n?e===Dh:e===Mf,e===mC)}function gC(e,t){return Cn(e,{disabledIndices:t})}function U5(e,t){return Cn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}const YEe=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 $=W5(),T=cC(),C=j5(n),R=fC(u),q=fC(j5(u)),G=_e.useRef(v),A=_e.useRef(c??-1),Y=_e.useRef(null),ie=KEe(g),J=_e.useRef(!1),ge=_e.useRef(-1),[Te,M]=_e.useState(),x=_e.useCallback((I,F)=>{ge.current=requestAnimationFrame(()=>{if(h){var L;M((L=I.current[F.current])==null?void 0:L.id)}else{var Z;(Z=I.current[F.current])==null||Z.focus({preventScroll:!0})}})},[h]);wu(()=>{s&&(!C&&n&&G.current&&c!=null&&R(c),C&&!n&&(cancelAnimationFrame(ge.current),A.current=-1,q(null)))},[n,C,c,o,x,s,R,q]),wu(()=>{if(s&&n)if(a==null){if(c!=null)return;C&&(A.current=-1,x(o,A)),!C&&G.current&&(Y.current!=null||G.current===!0&&Y.current==null)&&(A.current=Y.current==null||vC(Y.current,S,p)||d?gC(o,ie.current):U5(o,ie.current),R(A.current),x(o,A))}else jh(o,a)||(A.current=a,x(o,A))},[n,C,a,c,d,o,R,x,s,l,S,p,h,ie]),wu(()=>{if(s&&!n&&C){var I,F;const L=T==null||(I=T.nodesRef.current.find(Z=>Z.id===$))==null||(F=I.context)==null?void 0:F.refs.floating.current;L&&!L.contains(D5(lC(L)))&&L.focus({preventScroll:!0})}},[s,n,C,T,$]),wu(()=>{Y.current=null});function w(I){if(J.current=!0,d&&JEe(I.key,S,p)){Ru(I),r(!1),qEe(i.domReference.current)&&i.domReference.current.focus();return}const F=A.current,L=gC(o,g),Z=U5(o,g);if(I.key==="Home"&&(A.current=L,R(A.current)),I.key==="End"&&(A.current=Z,R(A.current)),b>1){const ee=A.current;if(I.key===mC){if(Ru(I),ee===-1)A.current=Z;else if(A.current=Cn(o,{startingIndex:ee,amount:b,decrement:!0,disabledIndices:g}),f&&(ee-b<L||A.current<0)){const Ee=ee%b,ue=Z%b,xe=Z-(ue-Ee);ue===Ee?A.current=Z:A.current=ue>Ee?xe:xe-b}jh(o,A.current)&&(A.current=ee),R(A.current)}if(I.key===Ob&&(Ru(I),ee===-1?A.current=L:(A.current=Cn(o,{startingIndex:ee,amount:b,disabledIndices:g}),f&&ee+b>Z&&(A.current=Cn(o,{startingIndex:ee%b-b,amount:b,disabledIndices:g}))),jh(o,A.current)&&(A.current=ee),R(A.current)),S==="both"){const Ee=Math.floor(ee/b);I.key===Dh&&(Ru(I),ee%b!==b-1?(A.current=Cn(o,{startingIndex:ee,disabledIndices:g}),f&&wb(A.current,b,Ee)&&(A.current=Cn(o,{startingIndex:ee-ee%b-1,disabledIndices:g}))):f&&(A.current=Cn(o,{startingIndex:ee-ee%b-1,disabledIndices:g})),wb(A.current,b,Ee)&&(A.current=ee)),I.key===Mf&&(Ru(I),ee%b!==0?(A.current=Cn(o,{startingIndex:ee,disabledIndices:g,decrement:!0}),f&&wb(A.current,b,Ee)&&(A.current=Cn(o,{startingIndex:ee+(b-ee%b),decrement:!0,disabledIndices:g}))):f&&(A.current=Cn(o,{startingIndex:ee+(b-ee%b),decrement:!0,disabledIndices:g})),wb(A.current,b,Ee)&&(A.current=ee));const ue=Math.floor(Z/b)===Ee;jh(o,A.current)&&(f&&ue?A.current=I.key===Mf?Z:Cn(o,{startingIndex:ee-ee%b-1,disabledIndices:g}):A.current=ee),R(A.current);return}}if(q5(I.key,S)){if(Ru(I),n&&!h&&D5(I.currentTarget.ownerDocument)===I.currentTarget){A.current=vC(I.key,S,p)?L:Z,R(A.current);return}vC(I.key,S,p)?f?A.current=F>=Z?l&&F!==o.current.length?-1:L:Cn(o,{startingIndex:F,disabledIndices:g}):A.current=Math.min(Z,Cn(o,{startingIndex:F,disabledIndices:g})):f?A.current=F<=L?l&&F!==-1?o.current.length:Z:Cn(o,{startingIndex:F,decrement:!0,disabledIndices:g}):A.current=Math.max(L,Cn(o,{startingIndex:F,decrement:!0,disabledIndices:g})),jh(o,A.current)?R(null):R(A.current)}}return s?{reference:{...h&&n&&a!=null&&{"aria-activedescendant":Te},onKeyDown(I){if(J.current=!0,h&&n)return w(I);if((I.key.indexOf("Arrow")===0||I.key==="Enter"||I.key===" "||I.key==="")&&(Y.current=I.key),d){GEe(I.key,S,p)&&(Ru(I),n?(A.current=gC(o,g),R(A.current)):r(!0));return}q5(I.key,S)&&(c!=null&&(A.current=c),Ru(I),!n&&_?r(!0):w(I),n&&R(A.current))}},floating:{"aria-orientation":S==="both"?void 0:S,...h&&a!=null&&{"aria-activedescendant":Te},onKeyDown:w,onPointerMove(){J.current=!1}},item:{onFocus(I){let{currentTarget:F}=I;const L=o.current.indexOf(F);L!==-1&&R(L)},onClick:I=>{let{currentTarget:F}=I;return F.focus({preventScroll:!0})},...m&&{onMouseMove(I){let{currentTarget:F}=I;const L=F;if(L){const Z=o.current.indexOf(L);Z!==-1&&R(Z)}},onPointerLeave(){if(!J.current&&(A.current=-1,x(o,A),R(null),!h)){var I;(I=i.floating.current)==null||I.focus({preventScroll:!0})}}}}}:{}};function ZEe(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:a}=e,u=KOe(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 XEe=new lu("suggestion");function QEe({pluginKey:e=XEe,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 Vr({key:e,view(){return{update:async(v,m)=>{var _,g,S,b,$,T,C;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),G=R.active&&q.active&&R.range.from!==q.range.from,A=!R.active&&q.active,Y=R.active&&!q.active,ie=!A&&!Y&&R.query!==q.query,J=A||G,ge=ie&&!G,Te=Y||G;if(!J&&!ge&&!Te)return;const M=Te&&!J?R:q,x=v.dom.querySelector(`[data-decoration-id="${M.decorationId}"]`);d={editor:t,range:M.range,query:M.query,text:M.text,items:[],command:w=>{s({editor:t,range:M.range,props:w})},decorationNode:x,clientRect:x?()=>{var w;const{decorationId:I}=(w=this.key)===null||w===void 0?void 0:w.getState(t.state),F=v.dom.querySelector(`[data-decoration-id="${I}"]`);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)),ge&&((b=p==null?void 0:p.onBeforeUpdate)===null||b===void 0||b.call(p,d)),(ge||J)&&(d.items=await c({editor:t,query:M.query})),Te&&(($=p==null?void 0:p.onExit)===null||$===void 0||$.call(p,d)),ge&&((T=p==null?void 0:p.onUpdate)===null||T===void 0||T.call(p,d)),J&&((C=p==null?void 0:p.onStart)===null||C===void 0||C.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:C}=$,R={...m};if(R.composing=b,S&&(T||t.view.composing)){(C<m.range.from||C>m.range.to)&&!b&&!m.composing&&(R.active=!1);const q=ZEe({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:$.$from}),G=`id_${Math.floor(Math.random()*4294967295)}`;q&&f({editor:t,state:g,range:q.range})?(R.active=!0,R.decorationId=m.decorationId?m.decorationId:G,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?jt.create(v.doc,[wr.inline(_.from,_.to,{nodeName:a,class:u,"data-decoration-id":g})]):null}}});return h}function B5(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=B5(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function eCe(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=B5(e))&&(r&&(r+=" "),r+=t);return r}const tCe=Gr.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",_n(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),po={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"},Eb=()=>(++Eb.i).toString();Eb.i=0;const nCe=e=>{const t=rCe(e),n=[];for(let r=0;r<t.length;r++)n.push(z5(t[r]));return{key:Eb(),children:n}},qh=(e,t=[])=>({key:Eb(),type:e.type,text:"text"in e?e.text:void 0,node:e,children:t}),yC=e=>qh({type:po.span,text:e,spans:[]}),rCe=e=>{const t=e.slice(0);for(let n=0;n<t.length;n++){const r=t[n];if(r.type===po.listItem||r.type===po.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===po.listItem?t[n]={type:po.list,items:i}:t[n]={type:po.oList,items:i}}}return t},z5=e=>{if("text"in e)return qh(e,K5(e.spans,e));if("items"in e){const t=[];for(let n=0;n<e.items.length;n++)t.push(z5(e.items[n]));return qh(e,t)}return qh(e)},K5=(e,t,n)=>{if(!e.length)return[yC(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(yC(t.text.slice(0,s)));const d={...a,text:l};i.push(qh(d,K5(f,{...t,text:l},a))),c<t.text.length&&i.push(yC(t.text.slice(c,r[o+1]?r[o+1].start-u:void 0)))}return i},iCe=(e,t)=>V5(nCe(e).children,t),V5=(e,t)=>{const n=[];for(let r=0;r<e.length;r++){const i=e[r],o=t(i.type,i.node,i.text,V5(i.children,t),i.key);o!=null&&n.push(o)}return n};po.listItem+"",po.oListItem+"",po.list+"",po.oList+"";const oCe=Gr.create({name:"text",group:"inline"}),aCe={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)}},H5={fromPrismic(e){return t=>{var n;return(n=$C.find(r=>r.richTextNodeTypes[0]===t.type))==null?void 0:n.converter.fromPrismic(e)(t)}},toPrismic(e,t,n){const[r,i]=(()=>{const o=$C.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}:{}}}},G5=oCe.extend({name:"text"}),uCe={fromPrismic(e){return function(t,n,r=!1){const i={type:t,text:n.content.text,spans:n.content.spans||[]};return iCe([i],sCe(e,r))[0]}},toPrismic(e,t,n){const r=cc.children.reduce(e,(i,o)=>{const a=(()=>o.type.name===mb.name?mb.converter.toPrismic(o):o.textContent)(),u=a?i.text+a:i.text,s=i.text.length,c=u.length,l=(()=>o.marks.length?cc.marks.map(o,d=>H5.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:[...aCe.mergeOverlap(r.spans)].sort((i,o)=>i.type.localeCompare(o.type))},...n}}};function sCe(e,t=!1){return(n,r,i,o)=>{if(n==="span"&&i&&i.length)return t?[e.text(i)]:mb.splitTextToNodes(e,i)(a=>e.text(a));{const a=H5.fromPrismic(e)(r);return a?v$(o).map(s=>s.mark([...s.marks,a].sort((c,l)=>c.type.name.localeCompare(l.type.name)))):v$(o)}}}const dc={name:G5.name,component:G5,converter:uCe};var J5=(e=>(e.LeftToRight="ltr",e.RightToLeft="rtl",e))(J5||{});const pc="text-direction",cCe=Pe.RichTextNodeType.rtl,lCe=Rr.create({name:"textDirection",addOptions(){return{supportedExtensionNames:[]}},addGlobalAttributes(){return[{types:this.options.supportedExtensionNames,attributes:{[pc]:{default:"ltr",parseHTML:e=>e.attributes.dir?"rtl":"ltr",renderHTML:e=>e[pc]==="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,{[pc]:"rtl"})),setLeftToRight:()=>({commands:e})=>this.options.supportedExtensionNames.every(t=>e.resetAttributes(t,pc))}},addKeyboardShortcuts(){return{"Mod-Shift-r":()=>this.editor.commands.setRightToLeft(),"Mod-Shift-l":()=>this.editor.commands.setLeftToRight()}}}),ga={parseNodeAttrsDirection(e){switch(e[pc]){case"rtl":return"rtl";default:return"ltr"}},fromPrismic(e){const t=(()=>{switch(e.direction){case"rtl":return"rtl";default:return"ltr"}})();return{[pc]:t}},toPrismic(e){return{direction:this.parseNodeAttrsDirection(e.attrs)}}},Cb=tCe.extend({name:"paragraph",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",_n(this.options.HTMLAttributes,e),0]}}),fCe={fromPrismic(e){return function(t){var r;const n=dc.converter.fromPrismic(e)(Cb.name,t);return(r=e.nodes[Cb.name])==null?void 0:r.create(ga.fromPrismic(t),n)}},toPrismic(e){return dc.converter.toPrismic(e,Pe.RichTextNodeType.paragraph,ga.toPrismic(e))}},Eu=new Rf([Pe.RichTextNodeType.paragraph],Cb.name,Cb,fCe,"Type '/' for commands"),Y5=["ArrowDown","ArrowUp","End","Home"],Z5=["Enter"],dCe=["Escape",...Y5,...Z5],pCe=Rr.create({name:"slash-commands",addOptions(){return{nodeTypes:[]}},addProseMirrorPlugins(){const e=Nb(r6,this.options.nodeTypes);return e.length>1?[QEe({allowSpaces:!0,char:"/",editor:this.editor,startOfLine:!0,allow:({state:t})=>{const n=t.selection.$from;return n.parent.type.name===Eu.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 PRe(hCe,{editor:n.editor,props:n}),document.body.appendChild(t.element)},onUpdate:n=>{t==null||t.updateProps(n)},onKeyDown:({event:n})=>{var r;return dCe.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()}}}})]:[]}}),hCe=K.forwardRef(function({command:t,decorationNode:n,editor:r,items:i},o){const[a,u]=K.useState(!0),s=parseFloat(N.tokens.space["8px"]),{context:c,floating:l,reference:f,strategy:d,x:p,y:h}=UEe({middleware:[bEe(s),gEe(),_Ee({limiter:SEe()})],onOpenChange:u,open:a,placement:"top-start",strategy:"fixed",whileElementsMounted:AEe});K.useLayoutEffect(()=>{f(n)},[f,n]),K.useEffect(()=>{let A;const Y=()=>{A=window.setTimeout(()=>{u(!0)})},ie=()=>{u(!1)};return r.on("focus",Y).on("blur",ie),()=>{r.off("focus",Y).off("blur",ie),clearTimeout(A)}},[r]);const[v,m]=K.useState(0),_=K.useRef([]),[g,S]=K.useState();i!==g&&(m(0),_.current=[],S(i));const{getFloatingProps:b,getItemProps:$,getReferenceProps:T}=BEe([HEe(c,{outsidePointerDown:!1}),YEe(c,{activeIndex:v,listRef:_,onNavigate:A=>{m(Y=>A??Y)},openOnArrowKeyDown:!1,virtual:!0}),VEe(c,{role:"menu"})]),R=T().onKeyDown;K.useImperativeHandle(o,()=>({handleKeyDown:A=>{if(a){if(Y5.includes(A.key)&&R(A),Z5.includes(A.key)){const Y=i[v];Y!==void 0&&t(Y)}return!0}else return!1}}),[v,t,i,R,a]);const q=p!==null&&h!==null,G=K.useId();return a?E.jsxs("div",{...b(),className:N.dropdownMenuStyles.content,ref:l,style:{top:parseFloat(N.tokens.space["0px"]),left:parseFloat(N.tokens.space["0px"]),minWidth:256,position:d,transform:q?`translate3d(${Math.round(p)}px, ${Math.round(h)}px, 0)`:"translate3d(0, -200%, 0)"},children:[i.map((A,Y)=>K.createElement(X5,{...$({onClick:()=>{t(A)},onPointerDown:ie=>{ie.preventDefault()}}),"data-highlighted":Y===v?"":void 0,id:`${G}[${Y}]`,key:A.nodeType,ref:ie=>{_.current[Y]=ie},shortcut:`/${A.shortText??""}`,startIcon:A.icon},A.text)),i.length===0?E.jsx(X5,{...$({onPointerDown:A=>{A.preventDefault()}}),disabled:!0,id:`${G}[0]`,ref:A=>{_.current[0]=A},children:"No results"}):null]}):null}),X5=K.forwardRef(function({children:t,disabled:n,shortcut:r,startIcon:i,...o},a){return E.jsxs("div",{...o,...n?{"aria-disabled":!0,"data-disabled":!0}:{},className:N.dropdownMenuStyles.item,ref:a,role:"menuitem",children:[K.isValidElement(i)?K.cloneElement(i,{className:eCe(i.props.className,N.dropdownMenuStyles.itemStartIcon)}):null,E.jsx(N.Text,{className:N.dropdownMenuStyles.itemText,component:"span",children:t}),r?E.jsx(N.Text,{className:N.dropdownMenuStyles.itemShortcut,color:"inherit",component:"span",variant:"inherit",weight:"inherit",children:r}):null]})});function mCe(e,t){var o;const n=t.map(a=>a.richTextNodeTypes).flat(),r=y(t,fi(a=>a.nodeType===wf.Text),zm({},(a,u)=>({...a,[u.name]:u.placeholder}))),i=n.includes(Pe.RichTextNodeType.orderedList)||n.includes(Pe.RichTextNodeType.list);return fi(a=>a!==void 0)([tC.component(((o=e.config)==null?void 0:o.single)===void 0),dc.component,mb.component,oEe(r),i?Ef.component:void 0,pCe.configure({nodeTypes:n})])}const bC=JRe.extend({name:"bulletList",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",_n(this.options.HTMLAttributes,e),0]}}).configure({itemTypeName:"listItem"}),vCe={fromPrismic(e){return function(t){var r;const n=Ef.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[bC.name])==null?void 0:r.create(ga.fromPrismic(t),n)}},toPrismic(e){return BS(cc.children.map(e,t=>fi(n=>n!==void 0)(Ef.converter.toPrismic(t,Pe.RichTextNodeType.list))))}},Mb=new XE([Pe.RichTextNodeType.list],bC.name,bC,vCe),gCe=/^```([a-z]+)?[\s\n]$/,yCe=/^~~~([a-z]+)?[\s\n]$/,xb=Gr.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",_n(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[
|
|
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",dn(this.options.HTMLAttributes),["code",e,0]]}}).configure({exitOnTripleEnter:!1}),NAe={fromPrismic(e){return function(t){var r;const n=Bc.converter.fromPrismic(e)(o$.name,t,!0);return(r=e.nodes[o$.name])==null?void 0:r.create(Ma.fromPrismic(t),n)}},toPrismic(e){return Bc.converter.toPrismic(e,Ce.RichTextNodeType.preformatted,Ma.toPrismic(e))}},FH=new gd([Ce.RichTextNodeType.preformatted],o$.name,o$,NAe,"",!0),PAe=()=>{const[e,t]=ie.useState();return C(Kxe,{className:"react-component",children:qe("div",{children:[C("input",{placeholder:"embed url",onChange:n=>{t(n.target.value)}}),e?C("iframe",{width:"560",height:"315",src:e,title:"YouTube video player",frameBorder:0,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"}):null]})})},IC=wr.create({name:"embed",group:"block",atom:!0,addAttributes(){return{src:{default:null}}},addNodeView(){return Gxe(PAe)},addCommands(){return{setEmbed:()=>({tr:e,dispatch:t})=>{const n=this.type.create();return t&&e.replaceSelectionWith(n),!0}}}}),FAe={fromPrismic(e){return function(t){var r;return(r=e.nodes[IC.name])==null?void 0:r.create({},void 0)}},toPrismic(e){}};new ake([Ce.RichTextNodeType.embed],IC.name,IC,FAe);const DAe=wr.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]}`,dn(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=>LM({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),a$="heading",Ca={byLevel(e){switch(e){case 1:return Ce.RichTextNodeType.heading1;case 2:return Ce.RichTextNodeType.heading2;case 3:return Ce.RichTextNodeType.heading3;case 4:return Ce.RichTextNodeType.heading4;case 5:return Ce.RichTextNodeType.heading5;case 6:return Ce.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:Ca.byLevel(i),level:i}},fromProsemirror(e,t){const n=e.level;if(t.includes(n))return{fullName:Ca.byLevel(n),level:n}}},LAe=e=>DAe.extend({name:a$,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}`,dn(this.options.HTMLAttributes,n,o),0]}}),jAe=e=>{const t=e[0];return{fromPrismic(n){return function(r){var a;const i=Bc.converter.fromPrismic(n)(a$,r),o=Ca.fromPrismic(r.type,e)||Ca.default(t);return(a=n.nodes[a$])==null?void 0:a.create({level:o.level,...Ma.fromPrismic(r)},i)}},toPrismic(n){const{fullName:r}=Ca.fromProsemirror(n.attrs,e)||Ca.default(t);return Bc.converter.toPrismic(n,r,Ma.toPrismic(n))}}};function UAe(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=Ca.fromPrismic(r);return i?[...n,i.level]:n},[]).sort((n,r)=>n-r);return m(Kd(t),bT(()=>{}))}const qc={name:a$,build:e=>{const t=UAe(e);if(!t)return;const n=Kd(t.map(r=>Ca.byLevel(r)));if(!Ne(n))return new uke(n.value,LAe(t),t,jAe(t),r=>{const i=Ca.fromProsemirror(r,t);return i&&`Heading ${i.level}`})}},BAe=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,zAe=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,qAe=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,KAe=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,OC=sd.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",dn(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[A_({find:BAe,type:this.type}),A_({find:qAe,type:this.type})]},addPasteRules(){return[W_({find:zAe,type:this.type}),W_({find:KAe,type:this.type})]}}).extend({name:"em"}),VAe={fromPrismic(e){return function(){var t;return(t=e.marks[OC.name])==null?void 0:t.create()}},toPrismic(){}},DH=new G5([Ce.RichTextNodeType.em],OC.name,OC,VAe),HAe=/^(\d+)\.\s$/,wC=wr.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",dn(this.options.HTMLAttributes,n),0]:["ol",dn(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[r5({find:HAe,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",dn(this.options.HTMLAttributes,n),0]:["ol",dn(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"}),JAe={fromPrismic(e){return function(t){var r;const n=yd.converter.fromPrismic(e)(t);if(!!n)return(r=e.nodes[wC.name])==null?void 0:r.create(Ma.fromPrismic(t),n)}},toPrismic(e){return g0(Uc.children.map(e,t=>fi(n=>n!==void 0)(yd.converter.toPrismic(t,Ce.RichTextNodeType.orderedList))))}},u$=new iC([Ce.RichTextNodeType.orderedList],wC.name,wC,JAe),LH=Zu,GAe=e=>m([Zu,i$,u$,qc.build(e),FH],fi(va)),EC=[Y5,DH],jH=e=>[...GAe(e),...EC],UH=[{nodeType:Ce.RichTextNodeType.paragraph,icon:C(A.Icon,{name:"textFields"}),isActive:e=>e.isActive(Zu.name)&&!e.isActive(i$.name)&&!e.isActive(u$.name),runCommands:Mr((e,t)=>e.clearNodes().setDirection(Ai(t))),shortText:"par",text:"Paragraph"},{nodeType:Ce.RichTextNodeType.heading1,icon:C(A.Icon,{name:"looks1"}),isActive:e=>e.isActive(qc.name,{level:1}),runCommands:Mr((e,t)=>e.setHeading({level:1}).setDirection(Ai(t))),shortText:"h1",text:"Heading 1"},{nodeType:Ce.RichTextNodeType.heading2,icon:C(A.Icon,{name:"looks2"}),isActive:e=>e.isActive(qc.name,{level:2}),runCommands:Mr((e,t)=>e.setHeading({level:2}).setDirection(Ai(t))),shortText:"h2",text:"Heading 2"},{nodeType:Ce.RichTextNodeType.heading3,icon:C(A.Icon,{name:"looks3"}),isActive:e=>e.isActive(qc.name,{level:3}),runCommands:Mr((e,t)=>e.setHeading({level:3}).setDirection(Ai(t))),shortText:"h3",text:"Heading 3"},{nodeType:Ce.RichTextNodeType.heading4,icon:C(A.Icon,{name:"looks4"}),isActive:e=>e.isActive(qc.name,{level:4}),runCommands:Mr((e,t)=>e.setHeading({level:4}).setDirection(Ai(t))),shortText:"h4",text:"Heading 4"},{nodeType:Ce.RichTextNodeType.heading5,icon:C(A.Icon,{name:"looks5"}),isActive:e=>e.isActive(qc.name,{level:5}),runCommands:Mr((e,t)=>e.setHeading({level:5}).setDirection(Ai(t))),shortText:"h5",text:"Heading 5"},{nodeType:Ce.RichTextNodeType.heading6,icon:C(A.Icon,{name:"looks6"}),isActive:e=>e.isActive(qc.name,{level:6}),runCommands:Mr((e,t)=>e.setHeading({level:6}).setDirection(Ai(t))),shortText:"h6",text:"Heading 6"},{nodeType:Ce.RichTextNodeType.list,icon:C(A.Icon,{name:"formatListBulleted"}),isActive:e=>e.isActive(i$.name),runCommands:Mr((e,t)=>e.toggleBulletList().setDirection(Ai(t))),shortText:"bull",text:"Bulleted list"},{nodeType:Ce.RichTextNodeType.orderedList,icon:C(A.Icon,{name:"formatListNumbered"}),isActive:e=>e.isActive(u$.name),runCommands:Mr((e,t)=>e.toggleOrderedList().setDirection(Ai(t))),shortText:"num",text:"Numbered list"},{nodeType:Ce.RichTextNodeType.preformatted,icon:C(A.Icon,{name:"dataObject"}),isActive:e=>e.isActive(FH.name),runCommands:Mr((e,t)=>e.setCodeBlock().setDirection(Ai(t))),shortText:"code",text:"Code"}],YAe=[{nodeType:Ce.RichTextNodeType.strong,icon:C(A.Icon,{name:"formatBold"}),isActive:e=>e.isActive(Y5.name),runCommands:Mr(e=>e.toggleBold())},{nodeType:Ce.RichTextNodeType.em,icon:C(A.Icon,{name:"formatItalic"}),isActive:e=>e.isActive(DH.name),runCommands:Mr(e=>e.toggleItalic())}],ZAe=[{nodeType:Ce.RichTextNodeType.rtl,icon:C(A.Icon,{name:"formatTextDirectionRToL"}),isActive:e=>e.isActive({[zc]:AH.RightToLeft}),runCommands:Mr((e,t)=>e.toggleDirection(Ai(t)))}];function Mr(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 Ai(e){const t=e.state.selection.$from.parent.attrs;return Ma.parseNodeAttrsDirection(t)}function s$(e,t){return e.filter(n=>t.includes(n.nodeType))}const XAe={duration:100,hideOnClick:!0,offset:[-48,parseFloat(A.tokens.space["8px"])],placement:"top-start",zIndex:parseFloat(A.tokens.zIndex[3])},QAe=({editor:e,nodeTypes:t})=>{var a,u;const n=s$(UH,t),r=s$(YAe,t),i=s$(ZAe,t),o=[n.length>1?C(A.ToolbarSelect,{onValueChange:s=>{var c;(c=n.find(l=>l.nodeType===s))==null||c.runCommands(e)},value:(u=(a=n.find(s=>s.isActive(e)))==null?void 0:a.nodeType)!=null?u:"",children:n.map(s=>C(A.ToolbarSelectItem,{value:s.nodeType,children:s.text},s.nodeType))},"node"):null,r.length>0?C(A.ToolbarToggleButtonGroup,{onValueChange:s=>{r.forEach(c=>{(c.isActive(e)&&!s.includes(c.nodeType)||!c.isActive(e)&&s.includes(c.nodeType))&&c.runCommands(e)})},type:"multiple",value:r.filter(s=>s.isActive(e)).map(s=>s.nodeType),children:r.map(s=>C(A.ToolbarToggleButtonGroupItem,{disabled:!s.runCommands(e,{can:!0}),startIcon:s.icon,value:s.nodeType},s.nodeType))},"mark"):null,i.length>0?C(ie.Fragment,{children:i.map(s=>C(A.ToolbarToggleButton,{disabled:!s.runCommands(e,{can:!0}),onPressedChange:()=>{s.runCommands(e)},pressed:s.isActive(e),startIcon:s.icon},s.nodeType))},"extra"):null,n.length+r.length+i.length>1?C(A.ToolbarButton,{onClick:()=>{e.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:C(A.Icon,{name:"formatClear"})},"clear"):null].filter(va).map((s,c)=>qe(ie.Fragment,{children:[c===0?null:C(A.ToolbarSeparator,{}),s]},s.key));return o.length>0?C(Lxe,{editor:e,tippyOptions:XAe,children:C(A.Toolbar,{children:o})}):null},eWe=e=>{var c;const{content:t,field:n,id:r,readOnly:i,config:o}=e,a=t&&uC.converter(o.nodeExtensions).fromPrismic(o.schema,(c=o.defaultTextConverter)==null?void 0:c.call(o,o.schema))(t),u=LOe(e.onContentChange),s=Zxe({...a?{content:a.toJSON()}:{},editable:!i,editorProps:{attributes:{class:A.contentEditableClass,id:r,tabIndex:"0"}},extensions:o.allComponents,injectCSS:!1,onUpdate({editor:l}){const f=uC.converter(o.nodeExtensions).toPrismic(l.state.doc);u(f)}},[r,i,u]);return qe(A.Field,{children:[C(A.FieldLabel,{htmlFor:r,children:ya(n)}),C(A.FieldControl,{children:qe($c,{children:[C(zxe,{editor:s,style:{flex:1}}),(s==null?void 0:s.isEditable)&&C(QAe,{editor:s,nodeTypes:o.names.concat(OAe)})]})})]})},tWe=e=>{const{field:t}=e,n=ie.useMemo(()=>{const{extensions:r,defaultTextConverter:i}=pke(t.config),o=fi(f=>f.extType===rC.Node)(r),a=r.flatMap(f=>f.richTextNodeTypes),u=r.map(f=>f.component),s=[...xAe(t,o),wAe.configure({supportedExtensionNames:fi(f=>f.extType===rC.Node&&f.nodeType===vd.Text&&!f.lockedFormat)(r).map(f=>f.name)}),...u],c=s.map(f=>f.name),l=ZMe(s);return{allComponents:s,extensionsNames:c,defaultTextConverter:i,nodeExtensions:o,names:a,schema:l}},[t]);return C(eWe,{...e,config:n},n.extensionsNames.join("-"))},nWe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var s,c,l;const o=jf(t),a=rWe(t),u=(s=e==null?void 0:e.value)!=null?s:a;return qe(A.Field,{children:[C(A.FieldIcon,{children:C(A.Icon,{name:"arrowDropDownCircle"})}),C(A.FieldLabel,{htmlFor:n,children:ya(t)}),C(A.FieldControl,{children:qe(A.Select,{id:n,onValueChange:f=>{i||r(iWe(f))},placeholder:o,...u===void 0?{}:{value:u},children:[u===void 0||a!==void 0?null:C(A.SelectItem,{value:"",children:o}),(l=(c=t.config)==null?void 0:c.options)==null?void 0:l.map(f=>C(A.SelectItem,{value:f,children:f},f))]})})]},u)};function rWe(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 iWe(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Select",value:e}}const c$=({content:e,nestableWidget:t,...n})=>t.type===nt.WidgetTypes.BooleanField?C(TOe,{...n,content:gt(e,ze.BooleanContent.is),field:t}):t.type===nt.WidgetTypes.Color?(gt(e,dOe),null):t.type===nt.WidgetTypes.Date?C(wOe,{...n,field:t,content:gt(e,pOe)}):t.type===nt.WidgetTypes.Embed?(gt(e,ze.EmbedContent.is),null):t.type===nt.WidgetTypes.GeoPoint?(gt(e,hOe),null):t.type===nt.WidgetTypes.Image?C(f1e,{...n,content:gt(e,mOe),field:t}):t.type===nt.WidgetTypes.IntegrationField?(gt(e,ze.IntegrationFieldContent.is),null):t.type===nt.WidgetTypes.Link?C($1e,{...n,content:gt(e,ze.LinkContent.is),field:t}):t.type===nt.WidgetTypes.Number?C(I1e,{...n,content:gt(e,gOe),field:t}):t.type===nt.WidgetTypes.Range?(gt(e,yOe),null):t.type===nt.WidgetTypes.RichText?C(tWe,{...n,content:gt(e,ze.RichTextContent.is),field:t}):t.type===nt.WidgetTypes.Select?C(nWe,{...n,content:gt(e,bOe),field:t}):t.type===nt.WidgetTypes.Separator?(gt(e,ze.SeparatorContent.is),null):t.type===nt.WidgetTypes.Text?C(v1e,{...n,content:gt(e,vOe),field:t}):(t.type===nt.WidgetTypes.Timestamp&>(e,_Oe),null),BH=({content:e,id:t,nonRepeatableZone:n,onContentChange:r,readOnly:i})=>{const o=oWe(n);return C($c,{children:o.map(([a,u])=>C(c$,{content:gt(e[a],Gb),id:`${t}.${a}`,nestableWidget:u,onContentChange:s=>{r(fOe(e,a,s))},readOnly:i},a))})};function oWe(e){return ie.useMemo(()=>pR(e),[e])}function aWe(e,t){return e.filter((n,r)=>r!==t)}function uWe(e,t,n){const r=e.length;if(zH(t,r)||zH(n,r))return e;const i=[...e],o=i[t],a=i[n];return i[t]=a,i[n]=o,i}function zH(e,t){return e<0||e>=t}let sWe=0;function cWe(){return sWe++}function qH(e){var t,n,r;return(r=(n=(t=e.config)==null?void 0:t.label)!=null?n:e.fieldset)!=null?r:e.type}function lWe(e){var t,n;return(n=(t=e.config)==null?void 0:t.fields)!=null?n:{}}function fWe(e,t){return e===void 0?{__TYPE__:ze.GroupContentType,value:t}:{...e,value:t}}const KH=(e=[])=>({__TYPE__:ze.GroupItemContentType,value:e}),dWe={__TYPE__:"GroupItemContent",value:[]};function pWe(e){return e!=null?e:[dWe]}function hWe(e,t){const[n,r]=t;return r?e.map((i,o)=>o===n?r:i):e.filter((i,o)=>o!==n)}function mWe(e,t){const[n,r]=t,i=(()=>r?Array.from(new Map(e.value).set(n,r)):e.value.filter(([o])=>o!==n))();return KH(i)}const RC=({id:e,title:t,content:n,onContentChange:r,readOnly:i,repeatableZone:o})=>{const a=yWe(o),u=pWe(n),s=ie.useRef(new Map);return Object.keys(o).length===0?null:(vWe(s.current,u),C(A.Group,{title:"Repeatable zone"+(t?` \u2022 ${t}`:""),addItemButtonTitle:"Add item in group",items:u,getItemKey:c=>{var l;return(l=s.current.get(c))!=null?l:""},onAddItem:()=>r(u.concat(KH())),children:(c,l)=>{const f=new Map(c.value);return C(A.GroupItem,{index:l,title:"Item",onMove:({index:d,offset:p})=>{r(uWe(u,d,d+p))},onDelete:({index:d})=>r(aWe(u,d)),children:a.map(([d,p])=>C(c$,{content:gt(f.get(d),Gb),id:`${e}[${l}].${d}`,nestableWidget:p,onContentChange:h=>{const v=mWe(c,[d,h]),y=hWe(u,[l,v]);gWe(s.current,c,v),r(y)},readOnly:i},d))})}}))};function vWe(e,t){const n=new Set(t);t.forEach(r=>{e.has(r)||e.set(r,cWe())});for(const[r]of e)n.has(r)||e.delete(r)}function gWe(e,t,n){const r=e.get(t);r!==void 0&&e.set(n,r)}function yWe(e){return ie.useMemo(()=>pR(e),[e])}const bWe=({compositeSlice:e,content:t,onContentChange:n,...r})=>qe(A.FieldSet,{children:[C(A.FieldSetLegend,{children:sOe(e)}),C(BH,{...r,content:t.nonRepeat,nonRepeatableZone:cOe(e),onContentChange:i=>{n({...t,nonRepeat:i})}}),C(RC,{...r,content:t.repeat,onContentChange:i=>{n({...t,repeat:i})},repeatableZone:lOe(e)})]});function _We(e){return e.type===nt.WidgetTypes.Group?qH(e):ya(e)}const VH=({content:e,group:t,onContentChange:n,...r})=>C(RC,{...r,title:qH(t),content:e==null?void 0:e.value,onContentChange:i=>{n(fWe(e,i))},repeatableZone:lWe(t)}),$We=({content:e,legacySlice:t,...n})=>qe(A.FieldSet,{children:[C(A.FieldSetLegend,{children:_We(t)}),t.type===nt.WidgetTypes.Group?C(VH,{...n,content:gt(e,iV),group:t}):C(c$,{...n,content:gt(e,Gb),nestableWidget:t})]});function SWe(e){return{__TYPE__:"SharedSliceContent",variation:e,primary:{},items:[]}}function TWe(e,t){return e.variations.find(n=>n.id===t)}function IWe(e,t){return[e.name,t.name]}function OWe(e){var t;return(t=e.primary)!=null?t:{}}function wWe(e){var t;return(t=e.items)!=null?t:{}}const HH=({content:e,onContentChange:t,readOnly:n=!1,sharedSlice:r,...i})=>{var c;const o=EWe(r,e.variation),a=ie.useId();if(o===void 0)return null;const s={id:(c=i.id)!=null?c:a,readOnly:n};return qe(A.FieldSet,{children:[C(A.FieldSetLegend,{children:IWe(r,o).join(" \u2022 ")}),C(BH,{...s,content:e.primary,nonRepeatableZone:OWe(o),onContentChange:l=>{t({...e,primary:l})}}),C(RC,{...s,content:e.items,onContentChange:l=>{t({...e,items:l})},repeatableZone:wWe(o)})]})};function EWe(e,t){return ie.useMemo(()=>TWe(e,t),[e,t])}const RWe=({content:e,id:t,onContentChange:n,readOnly:r,sliceZone:i})=>C($c,{children:e==null?void 0:e.value.map((o,a)=>{var l,f;const u=(f=(l=i.config)==null?void 0:l.choices)==null?void 0:f[o.name];if(u===void 0)return null;const s=o.widget,c={id:`${t}[${a}]`,key:o.key,onContentChange:d=>{n(uOe(e,a,d))},readOnly:r};if(u.type===zb.SlicesTypes.SharedSlice)return iOe(s)?C(HH,{...c,content:s,sharedSlice:u}):null;if(u.type===zb.SlicesTypes.Slice)return oOe(s)?C(bWe,{...c,compositeSlice:u,content:s}):null;{const d={...c,legacySlice:u};return aOe(s)?C($We,{...d,content:s}):null}})});function MWe(){return"Static Zone"}const CWe=({content:e,id:t,onContentChange:n,readOnly:r,staticZone:i})=>{const o=xWe(i);return qe(A.FieldSet,{children:[C(A.FieldSetLegend,{children:MWe()}),o.map(([a,u])=>{const s={id:`${t}.${a}`,onContentChange:l=>{n({...e,[a]:l})},readOnly:r},c=e[a];return u.type===nt.WidgetTypes.UID?(gt(c,ze.UIDContent.is),null):u.type===nt.WidgetTypes.Group?ie.createElement(VH,{...s,content:gt(c,iV),group:u,key:a}):ie.createElement(c$,{...s,content:gt(c,Gb),key:a,nestableWidget:u})})]})};function xWe(e){return ie.useMemo(()=>pR(e),[e])}const kWe=({content:e,id:t,onContentChange:n,readOnly:r,section:i})=>{const[o,a]=AWe(i);return qe($c,{children:[C(CWe,{content:rOe(o,e),id:t,onContentChange:u=>{n({...e,...u})},readOnly:r,staticZone:o}),a.map(([u,s])=>C(RWe,{content:gt(e[u],tOe),id:`${t}.${u}`,onContentChange:c=>{n({...e,[u]:c})},readOnly:r,sliceZone:s},u))]})};function AWe(e){return ie.useMemo(()=>nOe(e),[e])}const WWe=({content:e,customType:t,onContentChange:n,readOnly:r=!1,sectionName:i,sharedSlices:o,config:a})=>{const u=NWe(t,o),s=ie.useId();if(_Ie(u))return null;if(i===void 0)throw new Error("The 'sectionName' prop cannot be undefined when the provided 'customType' is non-empty.");const c=$Ie(u,i);return C(LK.Provider,{value:a!=null?a:DK,children:C(kWe,{content:SIe(c,e),id:s,onContentChange:l=>{n({...e,...l})},readOnly:r,section:c})})};function NWe(e,t){return ie.useMemo(()=>kC.toStatic(e,TIe(t)),[e,t])}ni.DocumentEditor=WWe,ni.SharedSliceEditor=HH,ni.defaultSharedSliceContent=SWe,Object.defineProperties(ni,{__esModule:{value:!0},[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[xE({find:gCe,type:this.type,getAttributes:e=>({language:e[1]})}),xE({find:yCe,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Vr({key:new lu("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(Ue.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",_n(this.options.HTMLAttributes),["code",e,0]]}}).configure({exitOnTripleEnter:!1}),bCe={fromPrismic(e){return function(t){var r;const n=dc.converter.fromPrismic(e)(xb.name,t,!0);return(r=e.nodes[xb.name])==null?void 0:r.create(ga.fromPrismic(t),n)}},toPrismic(e){return dc.converter.toPrismic(e,Pe.RichTextNodeType.preformatted,ga.toPrismic(e))}},Q5=new Rf([Pe.RichTextNodeType.preformatted],xb.name,xb,bCe,"",!0),_Ce=Gr.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]}`,_n(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=>xE({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),kb="heading",ya={byLevel(e){switch(e){case 1:return Pe.RichTextNodeType.heading1;case 2:return Pe.RichTextNodeType.heading2;case 3:return Pe.RichTextNodeType.heading3;case 4:return Pe.RichTextNodeType.heading4;case 5:return Pe.RichTextNodeType.heading5;case 6:return Pe.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:ya.byLevel(i),level:i}},fromProsemirror(e,t){const n=e.level;if(t.includes(n))return{fullName:ya.byLevel(n),level:n}}},SCe=e=>_Ce.extend({name:kb,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}`,_n(this.options.HTMLAttributes,n,o),0]}}),$Ce=e=>{const t=e[0];return{fromPrismic(n){return function(r){var a;const i=dc.converter.fromPrismic(n)(kb,r),o=ya.fromPrismic(r.type,e)||ya.default(t);return(a=n.nodes[kb])==null?void 0:a.create({level:o.level,...ga.fromPrismic(r)},i)}},toPrismic(n){const{fullName:r}=ya.fromProsemirror(n.attrs,e)||ya.default(t);return dc.converter.toPrismic(n,r,ga.toPrismic(n))}}};function TCe(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=ya.fromPrismic(r);return i?[...n,i.level]:n},[]).sort((n,r)=>n-r);return y(ad(t),K$(()=>{}))}const hc={name:kb,build:e=>{const t=TCe(e);if(!t)return;const n=ad(t.map(r=>ya.byLevel(r)));if(!je(n))return new VRe(n.value,SCe(t),t,$Ce(t),r=>{const i=ya.fromProsemirror(r,t);return i&&`Heading ${i.level}`})}},ICe=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,OCe=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,wCe=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,RCe=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,_C=kE.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",_n(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[rb({find:ICe,type:this.type}),rb({find:wCe,type:this.type})]},addPasteRules(){return[ib({find:OCe,type:this.type}),ib({find:RCe,type:this.type})]}}).extend({name:"em"}),ECe={fromPrismic(e){return function(){var t;return(t=e.marks[_C.name])==null?void 0:t.create()}},toPrismic(){}},e6=new l5([Pe.RichTextNodeType.em],_C.name,_C,ECe),CCe=/^(\d+)\.\s$/,SC=Gr.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",_n(this.options.HTMLAttributes,n),0]:["ol",_n(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[lH({find:CCe,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",_n(this.options.HTMLAttributes,n),0]:["ol",_n(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"}),MCe={fromPrismic(e){return function(t){var r;const n=Ef.converter.fromPrismic(e)(t);if(n)return(r=e.nodes[SC.name])==null?void 0:r.create(ga.fromPrismic(t),n)}},toPrismic(e){return BS(cc.children.map(e,t=>fi(n=>n!==void 0)(Ef.converter.toPrismic(t,Pe.RichTextNodeType.orderedList))))}},Ab=new XE([Pe.RichTextNodeType.orderedList],SC.name,SC,MCe),t6=Eu,xCe=e=>y([Eu,Mb,Ab,hc.build(e),Q5],fi(ho)),$C=[f5,e6],n6=e=>[...xCe(e),...$C],r6=[{nodeType:Pe.RichTextNodeType.paragraph,icon:E.jsx(N.Icon,{name:"textFields"}),isActive:e=>e.isActive(Eu.name)&&!e.isActive(Mb.name)&&!e.isActive(Ab.name),runCommands:xr((e,t)=>e.clearNodes().setDirection(Ni(t))),shortText:"par",text:"Paragraph"},{nodeType:Pe.RichTextNodeType.heading1,icon:E.jsx(N.Icon,{name:"looks1"}),isActive:e=>e.isActive(hc.name,{level:1}),runCommands:xr((e,t)=>e.setHeading({level:1}).setDirection(Ni(t))),shortText:"h1",text:"Heading 1"},{nodeType:Pe.RichTextNodeType.heading2,icon:E.jsx(N.Icon,{name:"looks2"}),isActive:e=>e.isActive(hc.name,{level:2}),runCommands:xr((e,t)=>e.setHeading({level:2}).setDirection(Ni(t))),shortText:"h2",text:"Heading 2"},{nodeType:Pe.RichTextNodeType.heading3,icon:E.jsx(N.Icon,{name:"looks3"}),isActive:e=>e.isActive(hc.name,{level:3}),runCommands:xr((e,t)=>e.setHeading({level:3}).setDirection(Ni(t))),shortText:"h3",text:"Heading 3"},{nodeType:Pe.RichTextNodeType.heading4,icon:E.jsx(N.Icon,{name:"looks4"}),isActive:e=>e.isActive(hc.name,{level:4}),runCommands:xr((e,t)=>e.setHeading({level:4}).setDirection(Ni(t))),shortText:"h4",text:"Heading 4"},{nodeType:Pe.RichTextNodeType.heading5,icon:E.jsx(N.Icon,{name:"looks5"}),isActive:e=>e.isActive(hc.name,{level:5}),runCommands:xr((e,t)=>e.setHeading({level:5}).setDirection(Ni(t))),shortText:"h5",text:"Heading 5"},{nodeType:Pe.RichTextNodeType.heading6,icon:E.jsx(N.Icon,{name:"looks6"}),isActive:e=>e.isActive(hc.name,{level:6}),runCommands:xr((e,t)=>e.setHeading({level:6}).setDirection(Ni(t))),shortText:"h6",text:"Heading 6"},{nodeType:Pe.RichTextNodeType.list,icon:E.jsx(N.Icon,{name:"formatListBulleted"}),isActive:e=>e.isActive(Mb.name),runCommands:xr((e,t)=>e.toggleBulletList().setDirection(Ni(t))),shortText:"bull",text:"Bulleted list"},{nodeType:Pe.RichTextNodeType.orderedList,icon:E.jsx(N.Icon,{name:"formatListNumbered"}),isActive:e=>e.isActive(Ab.name),runCommands:xr((e,t)=>e.toggleOrderedList().setDirection(Ni(t))),shortText:"num",text:"Numbered list"},{nodeType:Pe.RichTextNodeType.preformatted,icon:E.jsx(N.Icon,{name:"dataObject"}),isActive:e=>e.isActive(Q5.name),runCommands:xr((e,t)=>e.setCodeBlock().setDirection(Ni(t))),shortText:"code",text:"Code"}],kCe=[{nodeType:Pe.RichTextNodeType.strong,icon:E.jsx(N.Icon,{name:"formatBold"}),isActive:e=>e.isActive(f5.name),runCommands:xr(e=>e.toggleBold())},{nodeType:Pe.RichTextNodeType.em,icon:E.jsx(N.Icon,{name:"formatItalic"}),isActive:e=>e.isActive(e6.name),runCommands:xr(e=>e.toggleItalic())}],ACe=[{nodeType:Pe.RichTextNodeType.rtl,icon:E.jsx(N.Icon,{name:"formatTextDirectionRToL"}),isActive:e=>e.isActive({[pc]:J5.RightToLeft}),runCommands:xr((e,t)=>e.toggleDirection(Ni(t)))}];function xr(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 Ni(e){const t=e.state.selection.$from.parent.attrs;return ga.parseNodeAttrsDirection(t)}function Nb(e,t){return e.filter(n=>t.includes(n.nodeType))}const NCe={duration:100,hideOnClick:!0,offset:[-48,parseFloat(N.tokens.space["8px"])],placement:"top-start",zIndex:parseFloat(N.tokens.zIndex[3])},FCe=({editor:e,nodeTypes:t})=>{var a;const n=Nb(r6,t),r=Nb(kCe,t),i=Nb(ACe,t),o=[n.length>1?E.jsx(N.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=>E.jsx(N.ToolbarSelectItem,{value:u.nodeType,children:u.text},u.nodeType))},"node"):null,r.length>0?E.jsx(N.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=>E.jsx(N.ToolbarToggleButtonGroupItem,{disabled:!u.runCommands(e,{can:!0}),startIcon:u.icon,value:u.nodeType},u.nodeType))},"mark"):null,i.length>0?E.jsx(K.Fragment,{children:i.map(u=>E.jsx(N.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?E.jsx(N.ToolbarButton,{onClick:()=>{e.chain().focus().clearNodes().unsetAllMarks().run()},startIcon:E.jsx(N.Icon,{name:"formatClear"})},"clear"):null].filter(ho).map((u,s)=>E.jsxs(K.Fragment,{children:[s===0?null:E.jsx(N.ToolbarSeparator,{}),u]},u.key));return o.length>0?E.jsx(ERe,{editor:e,tippyOptions:NCe,children:E.jsx(N.Toolbar,{children:o})}):null},WCe=e=>{var c;const{content:t,field:n,id:r,readOnly:i,config:o}=e,a=t&&tC.converter(o.nodeExtensions).fromPrismic(o.schema,(c=o.defaultTextConverter)==null?void 0:c.call(o,o.schema))(t),u=OSe(e.onContentChange),s=DRe({...a?{content:a.toJSON()}:{},editable:!i,editorProps:{attributes:{class:N.contentEditableClass,id:r,tabIndex:"0"}},extensions:o.allComponents,injectCSS:!1,onUpdate({editor:l}){const f=tC.converter(o.nodeExtensions).toPrismic(l.state.doc);u(f)}},[r,i,u]);return E.jsxs(N.Field,{children:[E.jsx(N.FieldLabel,{htmlFor:r,children:ca(n)}),E.jsx(N.FieldControl,{children:E.jsxs(E.Fragment,{children:[E.jsx(kRe,{editor:s,style:{flex:1}}),(s==null?void 0:s.isEditable)&&E.jsx(FCe,{editor:s,nodeTypes:o.names.concat(cCe)})]})})]})},PCe=e=>{const{field:t}=e,n=K.useMemo(()=>{const{extensions:r,defaultTextConverter:i}=XRe(t.config),o=fi(f=>f.extType===ZE.Node)(r),a=r.flatMap(f=>f.richTextNodeTypes),u=r.map(f=>f.component),s=[...mCe(t,o),lCe.configure({supportedExtensionNames:fi(f=>f.extType===ZE.Node&&f.nodeType===wf.Text&&!f.lockedFormat)(r).map(f=>f.name)}),...u],c=s.map(f=>f.name),l=yOe(s);return{allComponents:s,extensionsNames:c,defaultTextConverter:i,nodeExtensions:o,names:a,schema:l}},[t]);return E.jsx(WCe,{...e,config:n},n.extensionsNames.join("-"))},LCe=({content:e,field:t,id:n,onContentChange:r,readOnly:i})=>{var s,c;const o=Xl(t),a=DCe(t),u=(e==null?void 0:e.value)??a;return E.jsxs(N.Field,{children:[E.jsx(N.FieldIcon,{children:E.jsx(N.Icon,{name:"arrowDropDownCircle"})}),E.jsx(N.FieldLabel,{htmlFor:n,children:ca(t)}),E.jsx(N.FieldControl,{children:E.jsxs(N.Select,{id:n,onValueChange:l=>{i||r(jCe(l))},placeholder:o,...u===void 0?{}:{value:u},children:[u===void 0||a!==void 0?null:E.jsx(N.SelectItem,{value:"",children:o}),(c=(s=t.config)==null?void 0:s.options)==null?void 0:c.map(l=>E.jsx(N.SelectItem,{value:l,children:l},l))]})})]},u)};function DCe(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 jCe(e){return e.length===0?void 0:{__TYPE__:"FieldContent",type:"Select",value:e}}const Fb=({content:e,nestableWidget:t,...n})=>t.type==="Boolean"?E.jsx(dSe,{...n,field:t,content:_t.isBooleanContent(e)?e:void 0}):t.type==="Date"?E.jsx(mSe,{...n,field:t,content:_t.isDateContent(e)?e:void 0}):t.type==="Image"?E.jsx(e$e,{...n,field:t,content:_t.isImageContent(e)?e:void 0}):t.type==="Link"?E.jsx(l$e,{...n,field:t,content:_t.isLinkContent(e)?e:void 0}):t.type==="Number"?E.jsx(p$e,{...n,field:t,content:_t.isNumberContent(e)?e:void 0}):t.type==="StructuredText"?E.jsx(PCe,{...n,field:t,content:_t.isRichTextContent(e)?e:void 0}):t.type==="Select"?E.jsx(LCe,{...n,field:t,content:_t.isSelectContent(e)?e:void 0}):t.type==="Text"?E.jsx(o$e,{...n,field:t,content:_t.isTextContent(e)?e:void 0}):null,i6=({content:e,id:t,nonRepeatableZone:n,onContentChange:r,readOnly:i})=>{const o=K.useMemo(()=>Object.entries(n),[n]);return E.jsx(E.Fragment,{children:o.map(([a,u])=>{const s=e[a];return E.jsx(Fb,{id:`${t}.${a}`,readOnly:i,nestableWidget:u,content:_t.isNestableContent(s)?s:void 0,onContentChange:c=>{r(qCe(e,a,c))}},a)})})};function qCe(e,t,n){return n===void 0?Sg(t)(e):{...e,[t]:n}}function UCe(e,t){return e.filter((n,r)=>r!==t)}function BCe(e,t,n){const r=e.length;if(o6(t,r)||o6(n,r))return e;const i=[...e],o=i[t],a=i[n];return i[t]=a,i[n]=o,i}function o6(e,t){return e<0||e>=t}let zCe=0;function KCe(){return zCe++}const TC=({id:e,title:t,content:n,onContentChange:r,readOnly:i,repeatableZone:o})=>{const a=K.useMemo(()=>Object.entries(o),[o]),u=JCe(n),s=K.useRef(new Map);return Object.keys(o).length===0?null:(VCe(s.current,u),E.jsx(N.Group,{title:"Repeatable zone"+(t?` • ${t}`:""),addItemButtonTitle:"Add item in group",items:u,getItemKey:c=>s.current.get(c)??"",onAddItem:()=>r(u.concat(a6())),children:(c,l)=>{const f=new Map(c.value);return E.jsx(N.GroupItem,{index:l,title:"Item",onMove:({index:d,offset:p})=>{r(BCe(u,d,d+p))},onDelete:({index:d})=>r(UCe(u,d)),children:a.map(([d,p])=>{const h=f.get(d);return E.jsx(Fb,{content:_t.isNestableContent(h)?h:void 0,id:`${e}[${l}].${d}`,nestableWidget:p,onContentChange:v=>{const m=ZCe(c,[d,v]),_=YCe(u,[l,m]);HCe(s.current,c,m),r(_)},readOnly:i},d)})})}}))};function VCe(e,t){const n=new Set(t);t.forEach(r=>{e.has(r)||e.set(r,KCe())});for(const[r]of e)n.has(r)||e.delete(r)}function HCe(e,t,n){const r=e.get(t);r!==void 0&&e.set(n,r)}const GCe={__TYPE__:"GroupItemContent",value:[]};function JCe(e){return e??[GCe]}function YCe(e,t){const[n,r]=t;return r?e.map((i,o)=>o===n?r:i):e.filter((i,o)=>o!==n)}function ZCe(e,t){const[n,r]=t,i=(()=>r?Array.from(new Map(e.value).set(n,r)):e.value.filter(([o])=>o!==n))();return a6(i)}const a6=(e=[])=>({__TYPE__:"GroupItemContent",value:e}),XCe=({compositeSlice:e,content:t,onContentChange:n,...r})=>E.jsxs(N.FieldSet,{children:[E.jsx(N.FieldSetLegend,{children:QCe(e)}),E.jsx(i6,{...r,nonRepeatableZone:e["non-repeat"]??{},content:t.nonRepeat,onContentChange:i=>{n({...t,nonRepeat:i})}}),E.jsx(TC,{...r,repeatableZone:e.repeat??{},content:t.repeat,onContentChange:i=>{n({...t,repeat:i})}})]});function QCe(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const u6=({group:e,content:t,onContentChange:n,...r})=>{var i;return E.jsx(TC,{...r,title:s6(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 s6(e){var t;return((t=e.config)==null?void 0:t.label)??e.fieldset??e.type}const eMe=({content:e,legacySlice:t,...n})=>E.jsxs(N.FieldSet,{children:[E.jsx(N.FieldSetLegend,{children:t.type==="Group"?s6(t):ca(t)}),t.type==="Group"?E.jsx(u6,{...n,group:t,content:_t.isGroupContent(e)?e:void 0}):E.jsx(Fb,{...n,nestableWidget:t,content:_t.isNestableContent(e)?e:void 0,onContentChange:r=>{r&&n.onContentChange(r)}})]}),c6=({content:e,onContentChange:t,readOnly:n=!1,sharedSlice:r,...i})=>{const o=tMe(r,e.variation),a=K.useId();if(o===void 0)return null;const s={id:i.id??a,readOnly:n};return E.jsxs(N.FieldSet,{children:[E.jsx(N.FieldSetLegend,{children:nMe(r,o)}),E.jsx(i6,{...s,nonRepeatableZone:o.primary??{},content:e.primary,onContentChange:c=>{t({...e,primary:c})}}),E.jsx(TC,{...s,repeatableZone:o.items??{},content:e.items,onContentChange:c=>{t({...e,items:c})}})]})};function tMe(e,t){return K.useMemo(()=>e.variations.find(n=>n.id===t),[e,t])}function nMe(e,t){return[e.name,t.name].join(" • ")}const rMe=({content:e,id:t,onContentChange:n,readOnly:r,sliceZone:i})=>E.jsx(E.Fragment,{children:e==null?void 0:e.value.map((o,a)=>{var l,f;const u=(f=(l=i.config)==null?void 0:l.choices)==null?void 0:f[o.name];if(u===void 0)return null;const s=o.widget,c={id:`${t}[${a}]`,key:o.key,onContentChange:d=>{const p={...o,widget:d},h=iMe(e,[a,p]);n(h)},readOnly:r};if(u.type==="SharedSlice")return _t.isSharedSliceContent(s)?E.jsx(c6,{...c,sharedSlice:u,content:s}):null;if(u.type==="Slice")return _t.isCompositeSliceContent(s)?E.jsx(XCe,{...c,compositeSlice:u,content:s}):null;{const d={...c,legacySlice:u};return _t.isSimpleSliceContent(s)?E.jsx(eMe,{...d,content:s}):null}})});function iMe(e,[t,n]){return{__TYPE__:"SliceContentType",value:e.value.map((r,i)=>i===t?n:r)}}const oMe=({content:e,id:t,onContentChange:n,readOnly:r,staticZone:i})=>{const o=K.useMemo(()=>Object.entries(i),[i]);return E.jsxs(N.FieldSet,{children:[E.jsx(N.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"?K.createElement(u6,{...s,content:_t.isGroupContent(c)?c:void 0,group:u,key:a}):K.createElement(Fb,{...s,content:_t.isNestableContent(c)?c:void 0,key:a,nestableWidget:u})})]})},aMe=({id:e,readOnly:t,section:n,content:r,onContentChange:i})=>{const[o,a]=sMe(n),[u,s]=cMe(r);return E.jsxs(E.Fragment,{children:[E.jsx(oMe,{id:e,readOnly:t,staticZone:o,content:u,onContentChange:c=>i({...s,...c})}),a.map(([c,l])=>{const f=s[c];return E.jsx(rMe,{id:`${e}.${c}`,readOnly:t,sliceZone:l,content:f,onContentChange:d=>i({...u,...s,[c]:d})},c)})]})};function uMe(e){return e.type==="Choice"||e.type==="Slices"}function sMe(e){return K.useMemo(()=>{const t=y(e,Ng(uMe),Jb(vp));return[qf(t),Uf(t)]},[e])}function cMe(e){return K.useMemo(()=>Object.entries(e).reduce(([t,n],[r,i])=>{const o=_t.isSlicesContent(i),a={[r]:i};return[{...t,...o?{}:a},{...n,...o?a:{}}]},[{},{}]),[e])}const lMe=({content:e,customType:t,onContentChange:n,readOnly:r=!1,sectionName:i,sharedSlices:o,config:a})=>{const u=fMe(t,o),s=K.useId();if(gi(u.json))return null;if(i===void 0)throw new Error("The 'sectionName' prop cannot be undefined when the provided 'customType' is non-empty.");const c=dMe(u,i),[l,f]=pMe(c,e);return E.jsx(zK.Provider,{value:a??BK,children:E.jsx(aMe,{id:s,readOnly:r,section:c,content:l,onContentChange:d=>n({...f,...d})})})};function fMe(e,t){return K.useMemo(()=>{const n=new Map(y(t,Ag(ho),vp));return Pe.toStatic(e,n)},[e,t])}function dMe(e,t){const n=e.json[t];if(n===void 0)throw new Error(`Cannot find a section with name '${t}'.`);return n}function pMe(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=lMe,Sn.SharedSliceEditor=c6,Object.defineProperty(Sn,Symbol.toStringTag,{value:"Module"})});
|