!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"substack@538433c"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="89bed018-6bd4-45bc-b879-70d350bdf363",e._sentryDebugIdIdentifier="sentry-dbid-89bed018-6bd4-45bc-b879-70d350bdf363")}catch(e){}}(),(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["6476"],{15871:function(e,t,n){"use strict";n.d(t,{AN:()=>ey,FR:()=>O,MS:()=>N,Mp:()=>eL,PM:()=>eY,Sj:()=>V,Vy:()=>B,fF:()=>e_,fp:()=>L,sl:()=>Q,uN:()=>ep,vL:()=>m,y$:()=>W,zM:()=>eV});var r,i,o,s,l,a,c,u,h,p,d,f,m,g,y,v,w,b,k,S=n(96540),x=n(40961),C=n(74979),M=n(19251);let R=(0,S.createContext)(null),E={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},T={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function D(e){var t;let n,{announcements:r=T,container:i,hiddenTextDescribedById:o,screenReaderInstructions:s=E}=e,{announce:l,announcement:a}=(0,M.bO)(),c=(0,C.YG)("DndLiveRegion"),[u,h]=(0,S.useState)(!1);if((0,S.useEffect)(()=>{h(!0)},[]),t=(0,S.useMemo)(()=>({onDragStart(e){let{active:t}=e;l(r.onDragStart({active:t}))},onDragMove(e){let{active:t,over:n}=e;r.onDragMove&&l(r.onDragMove({active:t,over:n}))},onDragOver(e){let{active:t,over:n}=e;l(r.onDragOver({active:t,over:n}))},onDragEnd(e){let{active:t,over:n}=e;l(r.onDragEnd({active:t,over:n}))},onDragCancel(e){let{active:t,over:n}=e;l(r.onDragCancel({active:t,over:n}))}}),[l,r]),n=(0,S.useContext)(R),(0,S.useEffect)(()=>{if(!n)throw Error("useDndMonitor must be used within a children of ");return n(t)},[t,n]),!u)return null;let p=S.createElement(S.Fragment,null,S.createElement(M.Aw,{id:o,value:s.draggable}),S.createElement(M.L4,{id:c,announcement:a}));return i?(0,x.createPortal)(p,i):p}function A(){}function N(e,t){return(0,S.useMemo)(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}function O(){for(var e=arguments.length,t=Array(e),n=0;n[...t].filter(e=>null!=e),[...t])}(r=p||(p={})).DragStart="dragStart",r.DragMove="dragMove",r.DragEnd="dragEnd",r.DragCancel="dragCancel",r.DragOver="dragOver",r.RegisterDroppable="registerDroppable",r.SetDroppableDisabled="setDroppableDisabled",r.UnregisterDroppable="unregisterDroppable";let I=Object.freeze({x:0,y:0});function F(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function J(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function z(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function $(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function B(e,t){if(!e||0===e.length)return null;let[n]=e;return t?n[t]:n}function K(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}let L=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=K(t,t.left,t.top),o=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=F(K(r),i);o.push({id:t,data:{droppableContainer:e,value:n}})}}return o.sort(J)},W=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=$(t),o=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=$(r),s=Number((i.reduce((e,t,r)=>e+F(n[r],t),0)/4).toFixed(4));o.push({id:t,data:{droppableContainer:e,value:s}})}}return o.sort(J)},j=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,o=n.get(r);if(o){let n=function(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height);if(r0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(z)};function Y(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:I}let _=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r({...e,top:e.top+ +t.y,bottom:e.bottom+ +t.y,left:e.left+ +t.x,right:e.right+ +t.x}),{...e})},P={ignoreTransform:!1};function V(e,t){void 0===t&&(t=P);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=(0,C.zk)(e).getComputedStyle(e);t&&(n=function(e,t,n){let r=function(e){if(e.startsWith("matrix3d(")){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!r)return e;let{scaleX:i,scaleY:o,x:s,y:l}=r,a=e.left-s-(1-i)*parseFloat(n),c=e.top-l-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),u=i?e.width/i:e.width,h=o?e.height/o:e.height;return{width:u,height:h,top:c,right:a+u,bottom:c+h,left:a}}(n,t,r))}let{top:r,left:i,width:o,height:s,bottom:l,right:a}=n;return{top:r,left:i,width:o,height:s,bottom:l,right:a}}function q(e){return V(e,{ignoreTransform:!0})}function Q(e,t){let n=[];return e?function r(i){var o,s;let l;if(null!=t&&n.length>=t||!i)return n;if((0,C.wz)(i)&&null!=i.scrollingElement&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!(0,C.sb)(i)||(0,C.xZ)(i)||n.includes(i))return n;let a=(0,C.zk)(e).getComputedStyle(i);return(i!==e&&(void 0===(o=a)&&(o=(0,C.zk)(i).getComputedStyle(i)),l=/(auto|scroll|overlay)/,["overflow","overflowX","overflowY"].some(e=>{let t=o[e];return"string"==typeof t&&l.test(t)}))&&n.push(i),void 0===(s=a)&&(s=(0,C.zk)(i).getComputedStyle(i)),"fixed"===s.position)?n:r(i.parentNode)}(e):n}function U(e){let[t]=Q(e,1);return null!=t?t:null}function G(e){return C.Sw&&e?(0,C.l6)(e)?e:(0,C.Ll)(e)?(0,C.wz)(e)||e===(0,C.TW)(e).scrollingElement?window:(0,C.sb)(e)?e:null:null:null}function H(e){return(0,C.l6)(e)?e.scrollX:e.scrollLeft}function X(e){return(0,C.l6)(e)?e.scrollY:e.scrollTop}function Z(e){return{x:H(e),y:X(e)}}function ee(e){return!!C.Sw&&!!e&&e===document.scrollingElement}function et(e){let t={x:0,y:0},n=ee(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x;return{isTop:i,isLeft:o,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}(i=d||(d={}))[i.Forward=1]="Forward",i[i.Backward=-1]="Backward";let en={x:.2,y:.2};function er(e){return e.reduce((e,t)=>(0,C.WQ)(e,Z(t)),I)}let ei=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+H(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+X(t),0)}]];class eo{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Q(t),r=er(n);for(const[t,i,o]of(this.rect={...e},this.width=e.width,this.height=e.height,ei))for(const e of i)Object.defineProperty(this,e,{get:()=>{let i=o(n),s=r[t]-i;return this.rect[e]+s},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class es{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function el(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}function ea(e){e.preventDefault()}function ec(e){e.stopPropagation()}(o=f||(f={})).Click="click",o.DragStart="dragstart",o.Keydown="keydown",o.ContextMenu="contextmenu",o.Resize="resize",o.SelectionChange="selectionchange",o.VisibilityChange="visibilitychange",(s=m||(m={})).Space="Space",s.Down="ArrowDown",s.Right="ArrowRight",s.Left="ArrowLeft",s.Up="ArrowUp",s.Esc="Escape",s.Enter="Enter",s.Tab="Tab";let eu={start:[m.Space,m.Enter],cancel:[m.Esc],end:[m.Space,m.Enter,m.Tab]},eh=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case m.Right:return{...n,x:n.x+25};case m.Left:return{...n,x:n.x-25};case m.Down:return{...n,y:n.y+25};case m.Up:return{...n,y:n.y-25}}};class ep{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new es((0,C.TW)(t)),this.windowListeners=new es((0,C.zk)(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(f.Resize,this.handleCancel),this.windowListeners.add(f.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(f.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=V),!e)return;let{top:n,left:r,bottom:i,right:o}=t(e);U(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(I)}handleKeyDown(e){if((0,C.kx)(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=eu,coordinateGetter:o=eh,scrollBehavior:s="smooth"}=r,{code:l}=e;if(i.end.includes(l))return void this.handleEnd(e);if(i.cancel.includes(l))return void this.handleCancel(e);let{collisionRect:a}=n.current,c=a?{x:a.left,y:a.top}:I;this.referenceCoordinates||(this.referenceCoordinates=c);let u=o(e,{active:t,context:n.current,currentCoordinates:c});if(u){let t=(0,C.Re)(u,c),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:o,isRight:l,isLeft:a,isBottom:c,maxScroll:h,minScroll:p}=et(n),d=function(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}(n),f={x:Math.min(i===m.Right?d.right-d.width/2:d.right,Math.max(i===m.Right?d.left:d.left+d.width/2,u.x)),y:Math.min(i===m.Down?d.bottom-d.height/2:d.bottom,Math.max(i===m.Down?d.top:d.top+d.height/2,u.y))},g=i===m.Right&&!l||i===m.Left&&!a,y=i===m.Down&&!c||i===m.Up&&!o;if(g&&f.x!==u.x){let e=n.scrollLeft+t.x,o=i===m.Right&&e<=h.x||i===m.Left&&e>=p.x;if(o&&!t.y)return void n.scrollTo({left:e,behavior:s});o?r.x=n.scrollLeft-e:r.x=i===m.Right?n.scrollLeft-h.x:n.scrollLeft-p.x,r.x&&n.scrollBy({left:-r.x,behavior:s});break}if(y&&f.y!==u.y){let e=n.scrollTop+t.y,o=i===m.Down&&e<=h.y||i===m.Up&&e>=p.y;if(o&&!t.x)return void n.scrollTo({top:e,behavior:s});o?r.y=n.scrollTop-e:r.y=i===m.Down?n.scrollTop-h.y:n.scrollTop-p.y,r.y&&n.scrollBy({top:-r.y,behavior:s});break}}this.handleMove(e,(0,C.WQ)((0,C.Re)(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function ed(e){return!!(e&&"distance"in e)}function ef(e){return!!(e&&"delay"in e)}ep.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=eu,onActivation:i}=t,{active:o}=n,{code:s}=e.nativeEvent;if(r.start.includes(s)){let t=o.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==i||i({event:e.nativeEvent}),!0)}return!1}}];class em{constructor(e,t,n){var r;void 0===n&&(n=function(e){let{EventTarget:t}=(0,C.zk)(e);return e instanceof t?e:(0,C.TW)(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:i}=e,{target:o}=i;this.props=e,this.events=t,this.document=(0,C.TW)(o),this.documentListeners=new es(this.document),this.listeners=new es(n),this.windowListeners=new es((0,C.zk)(o)),this.initialCoordinates=null!=(r=(0,C.e_)(i))?r:I,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(f.Resize,this.handleCancel),this.windowListeners.add(f.DragStart,ea),this.windowListeners.add(f.VisibilityChange,this.handleCancel),this.windowListeners.add(f.ContextMenu,ea),this.documentListeners.add(f.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ef(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(ed(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(f.Click,ec,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(f.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;let{activated:n,initialCoordinates:r,props:i}=this,{onMove:o,options:{activationConstraint:s}}=i;if(!r)return;let l=null!=(t=(0,C.e_)(e))?t:I,a=(0,C.Re)(r,l);if(!n&&s){if(ed(s)){if(null!=s.tolerance&&el(a,s.tolerance))return this.handleCancel();if(el(a,s.distance))return this.handleStart()}return ef(s)&&el(a,s.tolerance)?this.handleCancel():void this.handlePending(s,a)}e.cancelable&&e.preventDefault(),o(l)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===m.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}let eg={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ey extends em{constructor(e){const{event:t}=e;super(e,eg,(0,C.TW)(t.target))}}ey.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!!n.isPrimary&&0===n.button&&(null==r||r({event:n}),!0)}}];(l=g||(g={}))[l.RightClick=2]="RightClick";(a=y||(y={}))[a.Pointer=0]="Pointer",a[a.DraggableRect=1]="DraggableRect",(c=v||(v={}))[c.TreeOrder=0]="TreeOrder",c[c.ReversedTreeOrder=1]="ReversedTreeOrder";let ev={x:{[d.Backward]:!1,[d.Forward]:!1},y:{[d.Backward]:!1,[d.Forward]:!1}};(u=w||(w={}))[u.Always=0]="Always",u[u.BeforeDragging=1]="BeforeDragging",u[u.WhileDragging=2]="WhileDragging",(b||(b={})).Optimized="optimized";let ew=new Map;function eb(e,t){return(0,C.KG)(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function ek(e){let{callback:t,disabled:n}=e,r=(0,C._q)(t),i=(0,S.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,S.useEffect)(()=>()=>null==i?void 0:i.disconnect(),[i]),i}function eS(e){return new eo(V(e),e)}function ex(e,t,n){void 0===t&&(t=eS);let[r,i]=(0,S.useState)(null);function o(){i(r=>{if(!e)return null;if(!1===e.isConnected){var i;return null!=(i=null!=r?r:n)?i:null}let o=t(e);return JSON.stringify(r)===JSON.stringify(o)?r:o})}let s=function(e){let{callback:t,disabled:n}=e,r=(0,C._q)(t),i=(0,S.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,S.useEffect)(()=>()=>null==i?void 0:i.disconnect(),[i]),i}({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){o();break}}}}),l=ek({callback:o});return(0,C.Es)(()=>{o(),e?(null==l||l.observe(e),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==l||l.disconnect(),null==s||s.disconnect())},[e]),r}let eC=[];function eM(e,t){void 0===t&&(t=[]);let n=(0,S.useRef)(null);return(0,S.useEffect)(()=>{n.current=null},t),(0,S.useEffect)(()=>{let t=e!==I;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?(0,C.Re)(e,n.current):I}function eR(e){return(0,S.useMemo)(()=>{let t,n;return e?(t=e.innerWidth,{top:0,left:0,right:t,bottom:n=e.innerHeight,width:t,height:n}):null},[e])}let eE=[],eT=[{sensor:ey,options:{}},{sensor:ep,options:{}}],eD={current:{}},eA={draggable:{measure:q},droppable:{measure:q,strategy:w.WhileDragging,frequency:b.Optimized},dragOverlay:{measure:V}};class eN extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}let eO={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new eN,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:A},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:eA,measureDroppableContainers:A,windowRect:null,measuringScheduled:!1},eI={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:A,draggableNodes:new Map,over:null,measureDroppableContainers:A},eF=(0,S.createContext)(eI),eJ=(0,S.createContext)(eO);function ez(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new eN}}}function e$(e,t){switch(t.type){case p.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case p.DragMove:if(null==e.draggable.active)return e;return{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case p.DragEnd:case p.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case p.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new eN(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case p.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;let s=new eN(e.droppable.containers);return s.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:s}}}case p.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let o=new eN(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function eB(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,S.useContext)(eF),o=(0,C.ZC)(r),s=(0,C.ZC)(null==n?void 0:n.id);return(0,S.useEffect)(()=>{if(!t&&!r&&o&&null!=s){if(!(0,C.kx)(o)||document.activeElement===o.target)return;let e=i.get(s);if(!e)return;let{activatorNode:t,node:n}=e;(t.current||n.current)&&requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=(0,C.ag)(e);if(t){t.focus();break}}})}},[r,t,i,s,o]),null}let eK=(0,S.createContext)({...I,scaleX:1,scaleY:1});(h=k||(k={}))[h.Uninitialized=0]="Uninitialized",h[h.Initializing=1]="Initializing",h[h.Initialized=2]="Initialized";let eL=(0,S.memo)(function(e){var t,n,r,i,o,s,l,a;let c,u,h,f,m,g,b,M,{id:E,accessibility:T,autoScroll:A=!0,children:N,sensors:O=eT,collisionDetection:F=j,measuring:J,modifiers:z,...$}=e,[K,L]=(0,S.useReducer)(e$,void 0,ez),[W,P]=function(){let[e]=(0,S.useState)(()=>new Set),t=(0,S.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,S.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[q,H]=(0,S.useState)(k.Uninitialized),X=q===k.Initialized,{draggable:{active:ei,nodes:es,translate:el},droppable:{containers:ea}}=K,ec=null!=ei?es.get(ei):null,eu=(0,S.useRef)({initial:null,translated:null}),eh=(0,S.useMemo)(()=>{var e;return null!=ei?{id:ei,data:null!=(e=null==ec?void 0:ec.data)?e:eD,rect:eu}:null},[ei,ec]),ep=(0,S.useRef)(null),[ed,ef]=(0,S.useState)(null),[em,eg]=(0,S.useState)(null),ey=(0,C.YN)($,Object.values($)),eS=(0,C.YG)("DndDescribedBy",E),eN=(0,S.useMemo)(()=>ea.getEnabled(),[ea]),eO=(0,S.useMemo)(()=>({draggable:{...eA.draggable,...null==J?void 0:J.draggable},droppable:{...eA.droppable,...null==J?void 0:J.droppable},dragOverlay:{...eA.dragOverlay,...null==J?void 0:J.dragOverlay}}),[null==J?void 0:J.draggable,null==J?void 0:J.droppable,null==J?void 0:J.dragOverlay]),{droppableRects:eI,measureDroppableContainers:eL,measuringScheduled:eW}=function(e,t){let{dragging:n,dependencies:r,config:i}=t,[o,s]=(0,S.useState)(null),{frequency:l,measure:a,strategy:c}=i,u=(0,S.useRef)(e),h=function(){switch(c){case w.Always:return!1;case w.BeforeDragging:return n;default:return!n}}(),p=(0,C.YN)(h),d=(0,S.useCallback)(function(e){void 0===e&&(e=[]),p.current||s(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),f=(0,S.useRef)(null),m=(0,C.KG)(t=>{if(h&&!n)return ew;if(!t||t===ew||u.current!==e||null!=o){let t=new Map;for(let n of e){if(!n)continue;if(o&&o.length>0&&!o.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new eo(a(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,o,n,h,a]);return(0,S.useEffect)(()=>{u.current=e},[e]),(0,S.useEffect)(()=>{h||d()},[n,h]),(0,S.useEffect)(()=>{o&&o.length>0&&s(null)},[JSON.stringify(o)]),(0,S.useEffect)(()=>{h||"number"!=typeof l||null!==f.current||(f.current=setTimeout(()=>{d(),f.current=null},l))},[l,h,d,...r]),{droppableRects:m,measureDroppableContainers:d,measuringScheduled:null!=o}}(eN,{dragging:X,dependencies:[el.x,el.y],config:eO.droppable}),ej=(m=(f=null!=ei?es.get(ei):void 0)?f.node.current:null,(0,C.KG)(e=>{var t;return null==ei?null:null!=(t=null!=m?m:e)?t:null},[m,ei])),eY=(0,S.useMemo)(()=>em?(0,C.e_)(em):null,[em]),e_=(c=(null==ed?void 0:ed.autoScrollEnabled)===!1,u="object"==typeof A?!1===A.enabled:!1===A,h=X&&!c&&!u,"object"==typeof A?{...A,enabled:h}:{enabled:h}),eP=eb(ej,eO.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,o=(0,S.useRef)(!1),{x:s,y:l}="boolean"==typeof i?{x:i,y:i}:i;(0,C.Es)(()=>{if(!s&&!l||!t){o.current=!1;return}if(o.current||!r)return;let e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;let i=Y(n(e),r);if(s||(i.x=0),l||(i.y=0),o.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=U(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,s,l,r,n])}({activeNode:null!=ei?es.get(ei):null,config:e_.layoutShiftCompensation,initialRect:eP,measure:eO.draggable.measure});let eV=ex(ej,eO.draggable.measure,eP),eq=ex(ej?ej.parentElement:null),eQ=(0,S.useRef)({activatorEvent:null,active:null,activeNode:ej,collisionRect:null,collisions:null,droppableRects:eI,draggableNodes:es,draggingNode:null,draggingNodeRect:null,droppableContainers:ea,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),eU=ea.getNodeFor(null==(t=eQ.current.over)?void 0:t.id),eG=function(e){let{measure:t}=e,[n,r]=(0,S.useState)(null),i=ek({callback:(0,S.useCallback)(e=>{for(let{target:n}of e)if((0,C.sb)(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),o=(0,S.useCallback)(e=>{let n=function(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return(0,C.sb)(t)?t:e}(e);null==i||i.disconnect(),n&&(null==i||i.observe(n)),r(n?t(n):null)},[t,i]),[s,l]=(0,C.lk)(o);return(0,S.useMemo)(()=>({nodeRef:s,rect:n,setRef:l}),[n,s,l])}({measure:eO.dragOverlay.measure}),eH=null!=(n=eG.nodeRef.current)?n:ej,eX=X?null!=(r=eG.rect)?r:eV:null,eZ=!!(eG.nodeRef.current&&eG.rect),e0=(g=eb(o=eZ?null:eV),Y(o,g)),e1=eR(eH?(0,C.zk)(eH):null),e2=(s=X?null!=eU?eU:ej:null,b=(0,S.useRef)(s),M=(0,C.KG)(e=>s?e&&e!==eC&&s&&b.current&&s.parentNode===b.current.parentNode?e:Q(s):eC,[s]),(0,S.useEffect)(()=>{b.current=s},[s]),M),e5=function(e,t){void 0===t&&(t=V);let[n]=e,r=eR(n?(0,C.zk)(n):null),[i,o]=(0,S.useState)(eE);function s(){o(()=>e.length?e.map(e=>ee(e)?r:new eo(t(e),e)):eE)}let l=ek({callback:s});return(0,C.Es)(()=>{null==l||l.disconnect(),s(),e.forEach(e=>null==l?void 0:l.observe(e))},[e]),i}(e2),e3=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}(z,{transform:{x:el.x-e0.x,y:el.y-e0.y,scaleX:1,scaleY:1},activatorEvent:em,active:eh,activeNodeRect:eV,containerNodeRect:eq,draggingNodeRect:eX,over:eQ.current.over,overlayNodeRect:eG.rect,scrollableAncestors:e2,scrollableAncestorRects:e5,windowRect:e1}),e9=eY?(0,C.WQ)(eY,el):null,e4=function(e){let[t,n]=(0,S.useState)(null),r=(0,S.useRef)(e),i=(0,S.useCallback)(e=>{let t=G(e.target);t&&n(e=>e?(e.set(t,Z(t)),new Map(e)):null)},[]);return(0,S.useEffect)(()=>{let t=r.current;if(e!==t){o(t);let s=e.map(e=>{let t=G(e);return t?(t.addEventListener("scroll",i,{passive:!0}),[t,Z(t)]):null}).filter(e=>null!=e);n(s.length?new Map(s):null),r.current=e}return()=>{o(e),o(t)};function o(e){e.forEach(e=>{let t=G(e);null==t||t.removeEventListener("scroll",i)})}},[i,e]),(0,S.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>(0,C.WQ)(e,t),I):er(e):I,[e,t])}(e2),e6=eM(e4),e7=eM(e4,[eV]),e8=(0,C.WQ)(e3,e6),te=eX?_(eX,e3):null,tt=eh&&te?F({active:eh,collisionRect:te,droppableRects:eI,droppableContainers:eN,pointerCoordinates:e9}):null,tn=B(tt,"id"),[tr,ti]=(0,S.useState)(null),to=(l=eZ?e3:(0,C.WQ)(e3,e7),a=null!=(i=null==tr?void 0:tr.rect)?i:null,{...l,scaleX:a&&eV?a.width/eV.width:1,scaleY:a&&eV?a.height/eV.height:1}),ts=(0,S.useRef)(null),tl=(0,S.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(null==ep.current)return;let i=es.get(ep.current);if(!i)return;let o=e.nativeEvent,s=new n({active:ep.current,activeNode:i,event:o,options:r,context:eQ,onAbort(e){if(!es.get(e))return;let{onDragAbort:t}=ey.current,n={id:e};null==t||t(n),W({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!es.get(e))return;let{onDragPending:i}=ey.current,o={id:e,constraint:t,initialCoordinates:n,offset:r};null==i||i(o),W({type:"onDragPending",event:o})},onStart(e){let t=ep.current;if(null==t)return;let n=es.get(t);if(!n)return;let{onDragStart:r}=ey.current,i={activatorEvent:o,active:{id:t,data:n.data,rect:eu}};(0,x.unstable_batchedUpdates)(()=>{null==r||r(i),H(k.Initializing),L({type:p.DragStart,initialCoordinates:e,active:t}),W({type:"onDragStart",event:i}),ef(ts.current),eg(o)})},onMove(e){L({type:p.DragMove,coordinates:e})},onEnd:l(p.DragEnd),onCancel:l(p.DragCancel)});function l(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=eQ.current,s=null;if(t&&i){let{cancelDrop:l}=ey.current;s={activatorEvent:o,active:t,collisions:n,delta:i,over:r},e===p.DragEnd&&"function"==typeof l&&await Promise.resolve(l(s))&&(e=p.DragCancel)}ep.current=null,(0,x.unstable_batchedUpdates)(()=>{L({type:e}),H(k.Uninitialized),ti(null),ef(null),eg(null),ts.current=null;let t=e===p.DragEnd?"onDragEnd":"onDragCancel";if(s){let e=ey.current[t];null==e||e(s),W({type:t,event:s})}})}}ts.current=s},[es]),ta=(0,S.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,o=es.get(r);null!==ep.current||!o||i.dndKit||i.defaultPrevented||!0===e(n,t.options,{active:o})&&(i.dndKit={capturedBy:t.sensor},ep.current=r,tl(n,t))},[es,tl]),tc=(0,S.useMemo)(()=>O.reduce((e,t)=>{let{sensor:n}=t;return[...e,...n.activators.map(e=>({eventName:e.eventName,handler:ta(e.handler,t)}))]},[]),[O,ta]);(0,S.useEffect)(()=>{if(!C.Sw)return;let e=O.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(let t of e)null==t||t()}},O.map(e=>{let{sensor:t}=e;return t})),(0,C.Es)(()=>{eV&&q===k.Initializing&&H(k.Initialized)},[eV,q]),(0,S.useEffect)(()=>{let{onDragMove:e}=ey.current,{active:t,activatorEvent:n,collisions:r,over:i}=eQ.current;if(!t||!n)return;let o={active:t,activatorEvent:n,collisions:r,delta:{x:e8.x,y:e8.y},over:i};(0,x.unstable_batchedUpdates)(()=>{null==e||e(o),W({type:"onDragMove",event:o})})},[e8.x,e8.y]),(0,S.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=eQ.current;if(!e||null==ep.current||!t||!i)return;let{onDragOver:o}=ey.current,s=r.get(tn),l=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null,a={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:l};(0,x.unstable_batchedUpdates)(()=>{ti(l),null==o||o(a),W({type:"onDragOver",event:a})})},[tn]),(0,C.Es)(()=>{eQ.current={activatorEvent:em,active:eh,activeNode:ej,collisionRect:te,collisions:tt,droppableRects:eI,draggableNodes:es,draggingNode:eH,draggingNodeRect:eX,droppableContainers:ea,over:tr,scrollableAncestors:e2,scrollAdjustedTranslate:e8},eu.current={initial:eX,translated:te}},[eh,ej,tt,te,es,eH,eX,eI,ea,tr,e2,e8]),function(e){let{acceleration:t,activator:n=y.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:s=5,order:l=v.TreeOrder,pointerCoordinates:a,scrollableAncestors:c,scrollableAncestorRects:u,delta:h,threshold:p}=e,f=function(e){let{delta:t,disabled:n}=e,r=(0,C.ZC)(t);return(0,C.KG)(e=>{if(n||!r||!e)return ev;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[d.Backward]:e.x[d.Backward]||-1===i.x,[d.Forward]:e.x[d.Forward]||1===i.x},y:{[d.Backward]:e.y[d.Backward]||-1===i.y,[d.Forward]:e.y[d.Forward]||1===i.y}}},[n,t,r])}({delta:h,disabled:!o}),[m,g]=(0,C.$$)(),w=(0,S.useRef)({x:0,y:0}),b=(0,S.useRef)({x:0,y:0}),k=(0,S.useMemo)(()=>{switch(n){case y.Pointer:return a?{top:a.y,bottom:a.y,left:a.x,right:a.x}:null;case y.DraggableRect:return i}},[n,i,a]),x=(0,S.useRef)(null),M=(0,S.useCallback)(()=>{let e=x.current;if(!e)return;let t=w.current.x*b.current.x,n=w.current.y*b.current.y;e.scrollBy(t,n)},[]),R=(0,S.useMemo)(()=>l===v.TreeOrder?[...c].reverse():c,[l,c]);(0,S.useEffect)(()=>{if(!o||!c.length||!k)return void g();for(let e of R){if((null==r?void 0:r(e))===!1)continue;let n=u[c.indexOf(e)];if(!n)continue;let{direction:i,speed:o}=function(e,t,n,r,i){let{top:o,left:s,right:l,bottom:a}=n;void 0===r&&(r=10),void 0===i&&(i=en);let{isTop:c,isBottom:u,isLeft:h,isRight:p}=et(e),f={x:0,y:0},m={x:0,y:0},g={height:t.height*i.y,width:t.width*i.x};return!c&&o<=t.top+g.height?(f.y=d.Backward,m.y=r*Math.abs((t.top+g.height-o)/g.height)):!u&&a>=t.bottom-g.height&&(f.y=d.Forward,m.y=r*Math.abs((t.bottom-g.height-a)/g.height)),!p&&l>=t.right-g.width?(f.x=d.Forward,m.x=r*Math.abs((t.right-g.width-l)/g.width)):!h&&s<=t.left+g.width&&(f.x=d.Backward,m.x=r*Math.abs((t.left+g.width-s)/g.width)),{direction:f,speed:m}}(e,n,k,t,p);for(let e of["x","y"])f[e][i[e]]||(o[e]=0,i[e]=0);if(o.x>0||o.y>0){g(),x.current=e,m(M,s),w.current=o,b.current=i;return}}w.current={x:0,y:0},b.current={x:0,y:0},g()},[t,M,r,g,o,s,JSON.stringify(k),JSON.stringify(f),m,c,R,u,JSON.stringify(p)])}({...e_,delta:el,draggingRect:te,pointerCoordinates:e9,scrollableAncestors:e2,scrollableAncestorRects:e5});let tu=(0,S.useMemo)(()=>({active:eh,activeNode:ej,activeNodeRect:eV,activatorEvent:em,collisions:tt,containerNodeRect:eq,dragOverlay:eG,draggableNodes:es,droppableContainers:ea,droppableRects:eI,over:tr,measureDroppableContainers:eL,scrollableAncestors:e2,scrollableAncestorRects:e5,measuringConfiguration:eO,measuringScheduled:eW,windowRect:e1}),[eh,ej,eV,em,tt,eq,eG,es,ea,eI,tr,eL,e2,e5,eO,eW,e1]),th=(0,S.useMemo)(()=>({activatorEvent:em,activators:tc,active:eh,activeNodeRect:eV,ariaDescribedById:{draggable:eS},dispatch:L,draggableNodes:es,over:tr,measureDroppableContainers:eL}),[em,tc,eh,eV,L,eS,es,tr,eL]);return S.createElement(R.Provider,{value:P},S.createElement(eF.Provider,{value:th},S.createElement(eJ.Provider,{value:tu},S.createElement(eK.Provider,{value:to},N)),S.createElement(eB,{disabled:(null==T?void 0:T.restoreFocus)===!1})),S.createElement(D,{...T,hiddenTextDescribedById:eS}))}),eW=(0,S.createContext)(null),ej="button";function eY(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,o=(0,C.YG)("Draggable"),{activators:s,activatorEvent:l,active:a,activeNodeRect:c,ariaDescribedById:u,draggableNodes:h,over:p}=(0,S.useContext)(eF),{role:d=ej,roleDescription:f="draggable",tabIndex:m=0}=null!=i?i:{},g=(null==a?void 0:a.id)===t,y=(0,S.useContext)(g?eK:eW),[v,w]=(0,C.lk)(),[b,k]=(0,C.lk)(),x=(0,S.useMemo)(()=>s.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[s,t]),M=(0,C.YN)(n);return(0,C.Es)(()=>(h.set(t,{id:t,key:o,node:v,activatorNode:b,data:M}),()=>{let e=h.get(t);e&&e.key===o&&h.delete(t)}),[h,t]),{active:a,activatorEvent:l,activeNodeRect:c,attributes:(0,S.useMemo)(()=>({role:d,tabIndex:m,"aria-disabled":r,"aria-pressed":!!g&&d===ej||void 0,"aria-roledescription":f,"aria-describedby":u.draggable}),[r,d,m,g,f,u.draggable]),isDragging:g,listeners:r?void 0:x,node:v,over:p,setNodeRef:w,setActivatorNodeRef:k,transform:y}}function e_(){return(0,S.useContext)(eJ)}let eP={timeout:25};function eV(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,o=(0,C.YG)("Droppable"),{active:s,dispatch:l,over:a,measureDroppableContainers:c}=(0,S.useContext)(eF),u=(0,S.useRef)({disabled:n}),h=(0,S.useRef)(!1),d=(0,S.useRef)(null),f=(0,S.useRef)(null),{disabled:m,updateMeasurementsFor:g,timeout:y}={...eP,...i},v=(0,C.YN)(null!=g?g:r),w=ek({callback:(0,S.useCallback)(()=>{if(!h.current){h.current=!0;return}null!=f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{c(Array.isArray(v.current)?v.current:[v.current]),f.current=null},y)},[y]),disabled:m||!s}),b=(0,S.useCallback)((e,t)=>{w&&(t&&(w.unobserve(t),h.current=!1),e&&w.observe(e))},[w]),[k,x]=(0,C.lk)(b),M=(0,C.YN)(t);return(0,S.useEffect)(()=>{w&&k.current&&(w.disconnect(),h.current=!1,w.observe(k.current))},[k,w]),(0,S.useEffect)(()=>(l({type:p.RegisterDroppable,element:{id:r,key:o,disabled:n,node:k,rect:d,data:M}}),()=>l({type:p.UnregisterDroppable,key:o,id:r})),[r]),(0,S.useEffect)(()=>{n!==u.current.disabled&&(l({type:p.SetDroppableDisabled,id:r,key:o,disabled:n}),u.current.disabled=n)},[r,o,n,l]),{active:s,rect:d,isOver:(null==a?void 0:a.id)===r,node:k,over:a,setNodeRef:x}}},14792:function(e,t,n){var r=n(13222),i=n(55808);e.exports=function(e){return i(r(e).toLowerCase())}},6498:function(e,t,n){e.exports=n(42e3)(function(e,t,n){e[+!n].push(t)},function(){return[[],[]]})},80829:function(e,t,n){"use strict";n.d(t,{n:()=>r});let r=n(88285).YY.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>!!this.options.alignments.includes(e)&&this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).every(e=>e),unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,"textAlign")).every(e=>e),toggleTextAlign:e=>({editor:t,commands:n})=>!!this.options.alignments.includes(e)&&(t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}})},71979:function(e,t,n){"use strict";n.d(t,{Ay:()=>i});var r=n(88285);let i=r.YY.create({name:"typography",addOptions:()=>({closeDoubleQuote:"”",closeSingleQuote:"’",copyright:"\xa9",ellipsis:"…",emDash:"—",laquo:"\xab",leftArrow:"←",multiplication:"\xd7",notEqual:"≠",oneHalf:"\xbd",oneQuarter:"\xbc",openDoubleQuote:"“",openSingleQuote:"‘",plusMinus:"\xb1",raquo:"\xbb",registeredTrademark:"\xae",rightArrow:"→",servicemark:"℠",superscriptThree:"\xb3",superscriptTwo:"\xb2",threeQuarters:"\xbe",trademark:"™"}),addInputRules(){let e,t,n,i,o,s,l,a,c,u,h,p,d,f,m,g,y,v,w,b,k,S,x=[];return!1!==this.options.emDash&&x.push((e=this.options.emDash,(0,r.Yp)({find:/--$/,replace:null!=e?e:"—"}))),!1!==this.options.ellipsis&&x.push((t=this.options.ellipsis,(0,r.Yp)({find:/\.\.\.$/,replace:null!=t?t:"…"}))),!1!==this.options.openDoubleQuote&&x.push((n=this.options.openDoubleQuote,(0,r.Yp)({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:null!=n?n:"“"}))),!1!==this.options.closeDoubleQuote&&x.push((i=this.options.closeDoubleQuote,(0,r.Yp)({find:/"$/,replace:null!=i?i:"”"}))),!1!==this.options.openSingleQuote&&x.push((o=this.options.openSingleQuote,(0,r.Yp)({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:null!=o?o:"‘"}))),!1!==this.options.closeSingleQuote&&x.push((s=this.options.closeSingleQuote,(0,r.Yp)({find:/'$/,replace:null!=s?s:"’"}))),!1!==this.options.leftArrow&&x.push((l=this.options.leftArrow,(0,r.Yp)({find:/<-$/,replace:null!=l?l:"←"}))),!1!==this.options.rightArrow&&x.push((a=this.options.rightArrow,(0,r.Yp)({find:/->$/,replace:null!=a?a:"→"}))),!1!==this.options.copyright&&x.push((c=this.options.copyright,(0,r.Yp)({find:/\(c\)$/,replace:null!=c?c:"\xa9"}))),!1!==this.options.trademark&&x.push((u=this.options.trademark,(0,r.Yp)({find:/\(tm\)$/,replace:null!=u?u:"™"}))),!1!==this.options.servicemark&&x.push((h=this.options.servicemark,(0,r.Yp)({find:/\(sm\)$/,replace:null!=h?h:"℠"}))),!1!==this.options.registeredTrademark&&x.push((p=this.options.registeredTrademark,(0,r.Yp)({find:/\(r\)$/,replace:null!=p?p:"\xae"}))),!1!==this.options.oneHalf&&x.push((d=this.options.oneHalf,(0,r.Yp)({find:/(?:^|\s)(1\/2)\s$/,replace:null!=d?d:"\xbd"}))),!1!==this.options.plusMinus&&x.push((f=this.options.plusMinus,(0,r.Yp)({find:/\+\/-$/,replace:null!=f?f:"\xb1"}))),!1!==this.options.notEqual&&x.push((m=this.options.notEqual,(0,r.Yp)({find:/!=$/,replace:null!=m?m:"≠"}))),!1!==this.options.laquo&&x.push((g=this.options.laquo,(0,r.Yp)({find:/<<$/,replace:null!=g?g:"\xab"}))),!1!==this.options.raquo&&x.push((y=this.options.raquo,(0,r.Yp)({find:/>>$/,replace:null!=y?y:"\xbb"}))),!1!==this.options.multiplication&&x.push((v=this.options.multiplication,(0,r.Yp)({find:/\d+\s?([*x])\s?\d+$/,replace:null!=v?v:"\xd7"}))),!1!==this.options.superscriptTwo&&x.push((w=this.options.superscriptTwo,(0,r.Yp)({find:/\^2$/,replace:null!=w?w:"\xb2"}))),!1!==this.options.superscriptThree&&x.push((b=this.options.superscriptThree,(0,r.Yp)({find:/\^3$/,replace:null!=b?b:"\xb3"}))),!1!==this.options.oneQuarter&&x.push((k=this.options.oneQuarter,(0,r.Yp)({find:/(?:^|\s)(1\/4)\s$/,replace:null!=k?k:"\xbc"}))),!1!==this.options.threeQuarters&&x.push((S=this.options.threeQuarters,(0,r.Yp)({find:/(?:^|\s)(3\/4)\s$/,replace:null!=S?S:"\xbe"}))),x}})},52674:function(e,t,n){"use strict";n.d(t,{$f:()=>A,G2:()=>w,I$:()=>C,Im:()=>O,Qv:()=>a,Sd:()=>y,Z1:()=>M,_G:()=>u,_e:()=>d,bh:()=>b,eB:()=>c,eT:()=>g,ec:()=>N,hy:()=>E,ic:()=>s,iz:()=>R,pC:()=>S,yY:()=>k,y_:()=>I});var r=n(97070),i=n(579),o=n(26469);let s=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function l(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("backward",e):!(n.parentOffset>0))?n:null}let a=(e,t,n)=>{let s=l(e,n);if(!s)return!1;let a=f(s);if(!a){let n=s.blockRange(),i=n&&(0,r.jP)(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let c=a.nodeBefore;if(T(e,a,t,-1))return!0;if(0==s.parent.content.size&&(p(c,"end")||o.nh.isSelectable(c)))for(let n=s.depth;;n--){let l=(0,r.$L)(e.doc,s.before(n),s.after(n),i.Ji.empty);if(l&&l.slice.size1)break}return!!c.isAtom&&a.depth==s.depth-1&&(t&&t(e.tr.delete(a.pos-c.nodeSize,a.pos).scrollIntoView()),!0)},c=(e,t,n)=>{let r=l(e,n);if(!r)return!1;let i=f(r);return!!i&&h(e,i,t)},u=(e,t,n)=>{let r=m(e,n);if(!r)return!1;let i=v(r);return!!i&&h(e,i,t)};function h(e,t,n){let s=t.nodeBefore,l=t.pos-1;for(;!s.isTextblock;l--){if(s.type.spec.isolating)return!1;let e=s.lastChild;if(!e)return!1;s=e}let a=t.nodeAfter,c=t.pos+1;for(;!a.isTextblock;c++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let u=(0,r.$L)(e.doc,l,c,i.Ji.empty);if(!u||u.from!=l||u instanceof r.Ln&&u.slice.size>=c-l)return!1;if(n){let t=e.tr.step(u);t.setSelection(o.U3.create(t.doc,l)),n(t.scrollIntoView())}return!0}function p(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)break}return!1}let d=(e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;s=f(r)}let l=s&&s.nodeBefore;return!!l&&!!o.nh.isSelectable(l)&&(t&&t(e.tr.setSelection(o.nh.create(e.doc,s.pos-l.nodeSize)).scrollIntoView()),!0)};function f(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 m(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("forward",e):!(n.parentOffset{let s=m(e,n);if(!s)return!1;let l=v(s);if(!l)return!1;let a=l.nodeAfter;if(T(e,l,t,1))return!0;if(0==s.parent.content.size&&(p(a,"start")||o.nh.isSelectable(a))){let n=(0,r.$L)(e.doc,s.before(),s.after(),i.Ji.empty);if(n&&n.slice.size{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset=0;t--){let n=e.node(t);if(e.index(t)+1{let n=e.selection,i=n instanceof o.nh,s;if(i){if(n.node.isTextblock||!(0,r.n9)(e.doc,n.from))return!1;s=n.from}else if(null==(s=(0,r.N0)(e.doc,n.from,-1)))return!1;if(t){let n=e.tr.join(s);i&&n.setSelection(o.nh.create(n.doc,s-e.doc.resolve(s).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},b=(e,t)=>{let n=e.selection,i;if(n instanceof o.nh){if(n.node.isTextblock||!(0,r.n9)(e.doc,n.to))return!1;i=n.to}else if(null==(i=(0,r.N0)(e.doc,n.to,1)))return!1;return t&&t(e.tr.join(i).scrollIntoView()),!0},k=(e,t)=>{let{$from:n,$to:i}=e.selection,o=n.blockRange(i),s=o&&(0,r.jP)(o);return null!=s&&(t&&t(e.tr.lift(o,s).scrollIntoView()),!0)},S=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!!n.parent.type.spec.code&&!!n.sameParent(r)&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function x(e){for(let t=0;t{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),l=x(i.contentMatchAt(s));if(!l||!i.canReplaceWith(s,s,l))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,l.createAndFill());i.setSelection(o.LN.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},M=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof o.i5||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=x(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index(){let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if((0,r.zy)(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let i=n.blockRange(),o=i&&(0,r.jP)(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},E=(e,t)=>{let{$from:n,to:r}=e.selection,i,s=n.sharedDepth(r);return 0!=s&&(i=n.before(s),t&&t(e.tr.setSelection(o.nh.create(e.doc,i))),!0)};function T(e,t,n,s){let l,a,c,u=t.nodeBefore,h=t.nodeAfter,d,f,m=u.type.spec.isolating||h.type.spec.isolating;if(!m&&(l=t.nodeBefore,a=t.nodeAfter,c=t.index(),l&&a&&l.type.compatibleContent(a.type)&&(!l.content.size&&t.parent.canReplace(c-1,c)?(n&&n(e.tr.delete(t.pos-l.nodeSize,t.pos).scrollIntoView()),!0):!!t.parent.canReplace(c,c+1)&&!!(a.isTextblock||(0,r.n9)(e.doc,t.pos))&&(n&&n(e.tr.join(t.pos).scrollIntoView()),!0))))return!0;let g=!m&&t.parent.canReplace(t.index(),t.index()+1);if(g&&(d=(f=u.contentMatchAt(u.childCount)).findWrapping(h.type))&&f.matchType(d[0]||h.type).validEnd){if(n){let o=t.pos+h.nodeSize,s=i.FK.empty;for(let e=d.length-1;e>=0;e--)s=i.FK.from(d[e].create(null,s));s=i.FK.from(u.copy(s));let l=e.tr.step(new r.Wg(t.pos-1,o,t.pos,o,new i.Ji(s,1,0),d.length,!0)),a=l.doc.resolve(o+2*d.length);a.nodeAfter&&a.nodeAfter.type==u.type&&(0,r.n9)(l.doc,a.pos)&&l.join(a.pos),n(l.scrollIntoView())}return!0}let y=h.type.spec.isolating||s>0&&m?null:o.LN.findFrom(t,1),v=y&&y.$from.blockRange(y.$to),w=v&&(0,r.jP)(v);if(null!=w&&w>=t.depth)return n&&n(e.tr.lift(v,w).scrollIntoView()),!0;if(g&&p(h,"start",!0)&&p(u,"end")){let o=u,s=[];for(;s.push(o),!o.isTextblock;)o=o.lastChild;let l=h,a=1;for(;!l.isTextblock;l=l.firstChild)a++;if(o.canReplace(o.childCount,o.childCount,l.content)){if(n){let o=i.FK.empty;for(let e=s.length-1;e>=0;e--)o=i.FK.from(s[e].copy(o));n(e.tr.step(new r.Wg(t.pos-s.length,t.pos+h.nodeSize,t.pos+a,t.pos+h.nodeSize-a,new i.Ji(o,s.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function D(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return!!i.node(s).isTextblock&&(n&&n(t.tr.setSelection(o.U3.create(t.doc,e<0?i.start(s):i.end(s)))),!0)}}let A=D(-1),N=D(1);function O(e,t=null){return function(n,i){let{$from:o,$to:s}=n.selection,l=o.blockRange(s),a=l&&(0,r.oM)(l,e,t);return!!a&&(i&&i(n.tr.wrap(l,a).scrollIntoView()),!0)}}function I(e,t=null){return function(n,r){let i=!1;for(let r=0;r{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(o),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r{let{$from:n,$to:i}=e.selection;if(e.selection instanceof o.nh&&e.selection.node.isBlock)return!!n.parentOffset&&!!(0,r.zy)(e.doc,n.pos)&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let s=[],l,a,c=!1,u=!1;for(let e=n.depth;;e--){if(n.node(e).isBlock){let t;c=n.end(e)==n.pos+(n.depth-e),u=n.start(e)==n.pos-(n.depth-e),a=x(n.node(e-1).contentMatchAt(n.indexAfter(e-1)));s.unshift(t||(c&&a?{type:a}:null)),l=e;break}if(1==e)return!1;s.unshift(null)}let h=e.tr;(e.selection instanceof o.U3||e.selection instanceof o.i5)&&h.deleteSelection();let p=h.mapping.map(n.pos),d=(0,r.zy)(h.doc,p,s.length,s);if(d||(s[0]=a?{type:a}:null,d=(0,r.zy)(h.doc,p,s.length,s)),!d)return!1;if(h.split(p,s.length,s),!c&&u&&n.node(l).type!=a){let e=h.mapping.map(n.before(l)),t=h.doc.resolve(e);a&&n.node(l-1).canReplaceWith(t.index(),t.index()+1,a)&&h.setNodeMarkup(h.mapping.map(n.before(l)),a)}return t&&t(h.scrollIntoView()),!0}),"Mod-Enter":C,Backspace:J,"Mod-Backspace":J,"Shift-Backspace":J,Delete:z,"Mod-Delete":z,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new o.i5(e.doc))),!0)},B={"Ctrl-h":$.Backspace,"Alt-Backspace":$["Mod-Backspace"],"Ctrl-d":$.Delete,"Ctrl-Alt-Backspace":$["Mod-Delete"],"Alt-Delete":$["Mod-Delete"],"Alt-d":$["Mod-Delete"],"Ctrl-a":A,"Ctrl-e":N};for(let e in $)B[e]=$[e];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform()},9204:function(e,t,n){"use strict";n.d(t,{$B:()=>l,Sd:()=>o,T2:()=>s});var r=n(97070),i=n(579);function o(e,t=null){return function(n,o){let{$from:s,$to:l}=n.selection,a=s.blockRange(l),c=!1,u=a;if(!a)return!1;if(a.depth>=2&&s.node(a.depth-1).type.compatibleContent(e)&&0==a.startIndex){if(0==s.index(a.depth-1))return!1;let e=n.doc.resolve(a.start-2);u=new i.u$(e,e,a.depth),a.endIndex=0;e--)l=i.FK.from(n[e].type.create(n[e].attrs,l));e.step(new r.Wg(t.start-2*!!o,t.end,t.start,t.end,new i.Ji(l,0,0),n.length,!0));let a=0;for(let e=0;et.childCount>0&&t.firstChild.type==e);return!!l&&(!n||(o.node(l.depth-1).type==e?function(e,t,n,o){let s=e.tr,l=o.end,a=o.$to.end(o.depth);lr;t--)e-=s.child(t).nodeSize,o.delete(e-1,e+1);let l=o.doc.resolve(n.start),a=l.nodeAfter;if(o.mapping.map(n.end)!=n.start+l.nodeAfter.nodeSize)return!1;let c=0==n.startIndex,u=n.endIndex==s.childCount,h=l.node(-1),p=l.index(-1);if(!h.canReplace(p+ +!c,p+1,a.content.append(u?i.FK.empty:i.FK.from(s))))return!1;let d=l.pos,f=d+a.nodeSize;return o.step(new r.Wg(d-!!c,f+ +!!u,d+1,f-1,new i.Ji((c?i.FK.empty:i.FK.from(s.copy(i.FK.empty))).append(u?i.FK.empty:i.FK.from(s.copy(i.FK.empty))),+!c,+!u),+!c)),t(o.scrollIntoView()),!0}(t,n,l)))}}function l(e){return function(t,n){let{$from:o,$to:s}=t.selection,l=o.blockRange(s,t=>t.childCount>0&&t.firstChild.type==e);if(!l)return!1;let a=l.startIndex;if(0==a)return!1;let c=l.parent,u=c.child(a-1);if(u.type!=e)return!1;if(n){let o=u.lastChild&&u.lastChild.type==c.type,s=i.FK.from(o?e.create():null),a=new i.Ji(i.FK.from(e.create(null,i.FK.from(c.type.create(null,s)))),o?3:1,0),h=l.start,p=l.end;n(t.tr.step(new r.Wg(h-(o?3:1),p,h,p,a,1,!0)).scrollIntoView())}return!0}}},26469:function(e,t,n){"use strict";n.d(t,{$t:()=>x,LN:()=>s,U3:()=>u,hs:()=>E,i5:()=>f,k_:()=>C,nh:()=>p});var r=n(579),i=n(97070);let o=Object.create(null);class s{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new l(e.min(t),e.max(t))]}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 e=this.ranges;for(let t=0;t=0;r--){let i=t<0?g(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):g(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new f(e.node(0))}static atStart(e){return g(e,e,0,0,1)||new f(e)}static atEnd(e){return g(e,e,e.content.size,e.childCount,-1)||new f(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError("Invalid input for Selection.fromJSON");let n=o[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in o)throw RangeError("Duplicate use of selection JSON ID "+e);return o[e]=t,t.prototype.jsonID=e,t}getBookmark(){return u.between(this.$anchor,this.$head).getBookmark()}}s.prototype.visible=!0;class l{constructor(e,t){this.$from=e,this.$to=t}}let a=!1;function c(e){a||e.parent.inlineContent||(a=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class u extends s{constructor(e,t=e){c(e),c(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return s.near(n);let r=e.resolve(t.map(this.anchor));return new u(r.parent.inlineContent?r:n,n)}replace(e,t=r.Ji.empty){if(super.replace(e,t),t==r.Ji.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof u&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new h(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new u(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if((!n||r)&&(n=r>=0?1:-1),!t.parent.inlineContent){let e=s.findFrom(t,n,!0)||s.findFrom(t,-n,!0);if(!e)return s.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r?e=t:(e=(s.findFrom(e,-n,!0)||s.findFrom(e,n,!0)).$anchor).posnew f(e)};function g(e,t,n,r,i,o=!1){if(t.inlineContent)return u.create(e,n);for(let s=r-(i>0?0:1);i>0?s=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&p.isSelectable(r))return p.create(e,n-(i<0?r.nodeSize:0))}else{let t=g(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function y(e,t,n){let r,o=e.steps.length-1;if(o{null==r&&(r=i)}),e.setSelection(s.near(e.doc.resolve(r),n)))}class v extends i.dL{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return r.CU.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.CU.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(s.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function w(e,t){return t&&e?e.bind(t):e}class b{constructor(e,t,n){this.name=e,this.init=w(t.init,n),this.apply=w(t.apply,n)}}let k=[new b("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new b("selection",{init:(e,t)=>e.selection||s.atStart(t.doc),apply:e=>e.selection}),new b("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new b("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class S{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=k.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new b(e.key,e.spec.state,e))})}}class x{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;ne.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw RangeError("Required config field 'schema' missing");let i=new S(e.schema,e.plugins),o=new x(i);return i.fields.forEach(i=>{if("doc"==i.name)o.doc=r.bP.fromJSON(e.schema,t.doc);else if("selection"==i.name)o.selection=s.fromJSON(o.doc,t.selection);else if("storedMarks"==i.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let r in n){let s=n[r],l=s.spec.state;if(s.key==i.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(t,r)){o[i.name]=l.fromJSON.call(s,e,t[r],o);return}}o[i.name]=i.init(e,o)}}),o}}class C{constructor(e){this.spec=e,this.props={},e.props&&function e(t,n,r){for(let i in t){let o=t[i];o instanceof Function?o=o.bind(n):"handleDOMEvents"==i&&(o=e(o,n,{})),r[i]=o}return r}(e.props,this,this.props),this.key=e.key?e.key.key:R("plugin")}getState(e){return e[this.key]}}let M=Object.create(null);function R(e){return e in M?e+"$"+ ++M[e]:(M[e]=0,e+"$")}class E{constructor(e="key"){this.key=R(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}},97070:function(e,t,n){"use strict";n.d(t,{$L:()=>D,Ln:()=>m,N0:()=>E,Um:()=>T,Wg:()=>g,X9:()=>s,dL:()=>L,jP:()=>w,n9:()=>M,oM:()=>b,zy:()=>C});var r=n(579);class i{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class o{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&o.empty)return o.empty}recover(e){let t=0,n=65535&e;if(!this.inverted)for(let e=0;ee)break;let c=this.ranges[l+o],u=this.ranges[l+s],h=a+c;if(e<=h){let o=c?e==a?-1:e==h?1:t:t,s=a+r+(o<0?0:u);if(n)return s;let p=e==(t<0?a:h)?null:l/3+(e-a)*65536,d=e==a?2:e==h?1:4;return(t<0?e!=a:e!=h)&&(d|=8),new i(s,d,p)}r+=u-c}return n?e+r:new i(e+r,0,null)}touches(e,t){let n=0,r=65535&t,i=this.inverted?2:1,o=this.inverted?1:2;for(let t=0;te)break;let l=this.ranges[t+i];if(e<=s+l&&t==3*r)return!0;n+=this.ranges[t+o]-l}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new s;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;nn&&te.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,i),t.openStart,t.openEnd);return c.fromReplace(e,this.from,this.to,o)}invert(){return new p(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new h(t.pos,n.pos,this.mark)}merge(e){return e instanceof h&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new h(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new h(t.from,t.to,e.markFromJSON(t.mark))}}a.jsonID("addMark",h);class p extends a{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new r.Ji(u(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return c.fromReplace(e,this.from,this.to,n)}invert(){return new h(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new p(t.pos,n.pos,this.mark)}merge(e){return e instanceof p&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new p(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new p(t.from,t.to,e.markFromJSON(t.mark))}}a.jsonID("removeMark",p);class d extends a{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return c.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return c.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;nn.pos?null:new g(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new g(t.from,t.to,t.gapFrom,t.gapTo,r.Ji.fromJSON(e,t.slice),t.insert,!!t.structure)}}function y(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 e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function v(e,t,n,i=n.contentMatch,o=!0){let s=e.doc.nodeAt(t),l=[],a=t+1;for(let t=0;t=0;t--)e.step(l[t])}function w(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let i=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function x(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+o);e.replaceWith(i,i+1,t.type.schema.text("\n"))}})}function C(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>o;e--,t--){let n=i.node(e),o=i.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),l=r&&r[t+1];l&&(s=s.replaceChild(0,l.type.create(l.attrs)));let a=r&&r[t]||n;if(!n.canReplace(o+1,n.childCount)||!a.type.validContent(s))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function M(e,t){let n=e.resolve(t),r=n.index();return R(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function R(e,t){return!!(e&&t&&!e.isLeaf&&function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i0?(i=r.node(e+1),s++,o=r.node(e).maybeChild(s)):(i=r.node(e).maybeChild(s-1),o=r.node(e+1)),i&&!i.isTextblock&&R(i,o)&&r.node(e).canReplace(s,s+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function T(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,o=r.index(t)+ +(n>0),s=r.node(t),l=!1;if(1==e)l=s.canReplace(o,o,i);else{let e=s.contentMatchAt(o).findWrapping(i.firstChild.type);l=e&&s.canReplaceWith(o,o,e[0])}if(l)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function D(e,t,n=t,i=r.Ji.empty){if(t==n&&!i.size)return null;let o=e.resolve(t),s=e.resolve(n);return A(o,s,i)?new m(t,n,i):new N(o,s,i).fit()}function A(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}a.jsonID("replaceAround",g);class N{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=r.FK.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=r.FK.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let o=this.placed,s=n.depth,l=i.depth;for(;s&&l&&1==o.childCount;)o=o.firstChild.content,s--,l--;let a=new r.Ji(o,s,l);return e>-1?new g(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new m(n.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e=null,i=(n?(e=F(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let o=this.depth;o>=0;o--){let{type:s,match:l}=this.frontier[o],a,c=null;if(1==t&&(i?l.matchType(i.type)||(c=l.fillBefore(r.FK.from(i),!1)):e&&s.compatibleContent(e.type)))return{sliceDepth:n,frontierDepth:o,parent:e,inject:c};if(2==t&&i&&(a=l.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:o,parent:e,wrap:a};if(e&&l.matchType(e.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=F(e,t);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new r.Ji(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=F(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new r.Ji(O(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new r.Ji(O(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let e=0;e1||0==a||e.content.size)&&(h=t,u.push(function e(t,n,i){if(n<=0)return t;let o=t.content;return n>1&&(o=o.replaceChild(0,e(o.firstChild,n-1,1==o.childCount?i-1:0))),n>0&&(o=t.type.contentMatch.fillBefore(o).append(o),i<=0&&(o=o.append(t.type.contentMatch.matchFragment(o).fillBefore(r.FK.empty,!0)))),t.copy(o)}(e.mark(p.allowedMarks(e.marks)),1==c?a:0,c==l.childCount?d:-1)))}let f=c==l.childCount;f||(d=-1),this.placed=I(this.placed,t,r.FK.from(u)),this.frontier[t].match=h,f&&d<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=l;e1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t=0;n--){let{match:t,type:r}=this.frontier[n],i=J(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=I(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=I(this.placed,this.depth,r.FK.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(r.FK.empty,!0);e.childCount&&(this.placed=I(this.placed,this.frontier.length,e))}}function O(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(O(e.firstChild.content,t-1,n)))}function I(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(I(e.lastChild.content,t-1,n)))}function F(e,t){for(let n=0;n=0;i--){let r=e.start(i);if(rt.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}class $ extends a{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return c.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return c.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(i),0,+!t.isLeaf))}getMap(){return o.empty}invert(e){return new $(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new $(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new $(t.pos,t.attr,t.value)}}a.jsonID("attr",$);class B extends a{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return c.ok(n)}getMap(){return o.empty}invert(e){return new B(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new B(t.attr,t.value)}}a.jsonID("docAttr",B);let K=class extends Error{};(K=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype),K.prototype.constructor=K,K.prototype.name="TransformError";class L{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new s}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new K(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=r.Ji.empty){let i=D(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new r.Ji(r.FK.from(n),0,0))}delete(e,t){return this.replace(e,t,r.Ji.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return!function(e,t,n,i){if(!i.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),s=e.doc.resolve(n);if(A(o,s,i))return e.step(new m(t,n,i));let l=z(o,e.doc.resolve(n));0==l[l.length-1]&&l.pop();let a=-(o.depth+1);l.unshift(a);for(let e=o.depth,t=o.pos-1;e>0;e--,t--){let n=o.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;l.indexOf(e)>-1?a=e:o.before(e)==t&&l.splice(1,0,-e)}let c=l.indexOf(a),u=[],h=i.openStart;for(let e=i.content,t=0;;t++){let n=e.firstChild;if(u.push(n),t==i.openStart)break;e=n.content}for(let e=h-1;e>=0;e--){var p;let t=u[e],n=(p=t.type).spec.defining||p.spec.definingForContent;if(n&&!t.sameMarkup(o.node(Math.abs(a)-1)))h=e;else if(n||!t.type.isTextblock)break}for(let t=i.openStart;t>=0;t--){let a=(t+h+1)%(i.openStart+1),p=u[a];if(p)for(let t=0;to){let e=s.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(r.FK.empty,!0))}return t}(i.content,0,i.openStart,a),a,i.openEnd))}}let d=e.steps.length;for(let r=l.length-1;r>=0&&(e.replace(t,n,i),!(e.steps.length>d));r--){let e=l[r];e<0||(t=o.before(e),n=s.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){var i=e,o=t;if(!n.isInline&&i==o&&this.doc.resolve(i).parent.content.size){let e=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return e.delete(r.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return!function(e,t,n){let{$from:i,$to:o,depth:s}=t,l=i.before(s+1),a=o.after(s+1),c=l,u=a,h=r.FK.empty,p=0;for(let e=s,t=!1;e>n;e--)t||i.index(e)>0?(t=!0,h=r.FK.from(i.node(e).copy(h)),p++):c--;let d=r.FK.empty,f=0;for(let e=s,t=!1;e>n;e--)t||o.after(e+1)=0;e--){if(i.size){let t=n[e].type.contentMatch.matchFragment(i);if(!t||!t.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=r.FK.from(n[e].type.create(n[e].attrs,i))}let o=t.start,s=t.end;e.step(new g(o,s,o,s,new r.Ji(i,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,i=null){var o=this;if(!n.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let s=o.steps.length;return o.doc.nodesBetween(e,t,(e,t)=>{var l,a,c;let u,h,p="function"==typeof i?i(e):i;if(e.isTextblock&&!e.hasMarkup(n,p)&&(l=o.doc,a=o.mapping.slice(s).map(t),c=n,h=(u=l.resolve(a)).index(),u.parent.canReplaceWith(h,h+1,c))){let i=null;if(n.schema.linebreakReplacement){let e="pre"==n.whitespace,t=!!n.contentMatch.matchType(n.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}!1===i&&x(o,e,t,s),v(o,o.mapping.slice(s).map(t,1),n,void 0,null===i);let l=o.mapping.slice(s),a=l.map(t,1),c=l.map(t+e.nodeSize,1);return o.step(new g(a,c,a+1,c-1,new r.Ji(r.FK.from(n.create(p,null,e.marks)),0,0),1,!0)),!0===i&&S(o,e,t,s),!1}}),this}setNodeMarkup(e,t,n=null,i){return!function(e,t,n,i,o){let s=e.doc.nodeAt(t);if(!s)throw RangeError("No node at given position");n||(n=s.type);let l=n.create(i,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,l);if(!n.validContent(s.content))throw RangeError("Invalid content for node type "+n.name);e.step(new g(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new r.Ji(r.FK.from(l),0,0),1,!0))}(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new $(e,t,n)),this}setDocAttribute(e,t){return this.step(new B(e,t)),this}addNodeMark(e,t){return this.step(new d(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError("No node at position "+e);if(t instanceof r.CU)t.isInSet(n.marks)&&this.step(new f(e,t));else{let r=n.marks,i,o=[];for(;i=t.isInSet(r);)o.push(new f(e,i)),r=i.removeFromSet(r);for(let e=o.length-1;e>=0;e--)this.step(o[e])}return this}split(e,t=1,n){return!function(e,t,n=1,i){let o=e.doc.resolve(t),s=r.FK.empty,l=r.FK.empty;for(let e=o.depth,t=o.depth-n,a=n-1;e>t;e--,a--){s=r.FK.from(o.node(e).copy(s));let t=i&&i[a];l=r.FK.from(t?t.type.create(t.attrs,l):o.node(e).copy(l))}e.step(new m(t,t,new r.Ji(s.append(l),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){var r;let i,o,s,l;return r=this,s=[],l=[],r.doc.nodesBetween(e,t,(r,a,c)=>{if(!r.isInline)return;let u=r.marks;if(!n.isInSet(u)&&c.type.allowsMarkType(n.type)){let c=Math.max(a,e),d=Math.min(a+r.nodeSize,t),f=n.addToSet(u);for(let e=0;er.step(e)),l.forEach(e=>r.step(e)),this}removeMark(e,t,n){var i;let o,s;return i=this,o=[],s=0,i.doc.nodesBetween(e,t,(i,l)=>{if(!i.isInline)return;s++;let a=null;if(n instanceof r.sX){let e=i.marks,t;for(;t=n.isInSet(e);)(a||(a=[])).push(t),e=t.removeFromSet(e)}else n?n.isInSet(i.marks)&&(a=[n]):a=i.marks;if(a&&a.length){let n=Math.min(l+i.nodeSize,t);for(let t=0;ti.step(new p(e.from,e.to,e.style))),this}clearIncompatible(e,t,n){return v(this,e,t,n),this}}},5243:function(e,t,n){"use strict";n.d(t,{Cl:()=>r,Tt:()=>i,fX:()=>o});var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function o(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i